Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Devrim Gunyel
core
Commits
5992ea86
Commit
5992ea86
authored
Oct 25, 2019
by
Piotr Gawron
Browse files
export/import of border color works the same as before introducing border color
parent
ffc1f543
Changes
5
Hide whitespace changes
Inline
Side-by-side
converter-SBGNML/src/main/java/lcsb/mapviewer/converter/model/sbgnml/SbgnmlXmlParser.java
View file @
5992ea86
...
...
@@ -1514,6 +1514,7 @@ public class SbgnmlXmlParser {
compartment
.
setY
(
new
Double
(
glyph
.
getBbox
().
getY
()));
compartment
.
setThickness
(
1.0
);
compartment
.
setFillColor
(
COMPARTMENT_COLOR
);
compartment
.
setBorderColor
(
COMPARTMENT_COLOR
);
if
(
glyph
.
getLabel
()
!=
null
&&
glyph
.
getLabel
().
getBbox
()
!=
null
)
{
compartment
.
setNamePoint
(
glyph
.
getLabel
().
getBbox
().
getX
(),
glyph
.
getLabel
().
getBbox
().
getY
());
...
...
converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/SbmlBioEntityParser.java
View file @
5992ea86
...
...
@@ -21,6 +21,7 @@ import lcsb.mapviewer.converter.annotation.XmlAnnotationParser;
import
lcsb.mapviewer.converter.model.sbml.species.ElementColorEnum
;
import
lcsb.mapviewer.model.map.BioEntity
;
import
lcsb.mapviewer.model.map.MiriamData
;
import
lcsb.mapviewer.model.map.compartment.Compartment
;
import
lcsb.mapviewer.model.map.model.Author
;
import
lcsb.mapviewer.model.map.model.Model
;
import
lcsb.mapviewer.model.map.species.Element
;
...
...
@@ -147,6 +148,9 @@ public class SbmlBioEntityParser {
if
(
result
instanceof
Element
)
{
Element
element
=
(
Element
)
result
;
element
.
setFillColor
(
ElementColorEnum
.
getColorByClass
(
element
.
getClass
()));
if
(
result
instanceof
Compartment
)
{
element
.
setBorderColor
(
ElementColorEnum
.
getColorByClass
(
element
.
getClass
()));
}
}
}
...
...
converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/SbmlElementParser.java
View file @
5992ea86
...
...
@@ -13,6 +13,7 @@ import org.sbml.jsbml.ext.render.LocalStyle;
import
lcsb.mapviewer.common.Pair
;
import
lcsb.mapviewer.converter.InvalidInputDataExecption
;
import
lcsb.mapviewer.model.map.compartment.Compartment
;
import
lcsb.mapviewer.model.map.species.Element
;
public
abstract
class
SbmlElementParser
<
T
extends
org
.
sbml
.
jsbml
.
Symbol
>
extends
SbmlBioEntityParser
{
...
...
@@ -116,6 +117,9 @@ public abstract class SbmlElementParser<T extends org.sbml.jsbml.Symbol> extends
if
(
style
.
getGroup
().
isSetFill
())
{
Color
backgroundColor
=
getColorByColorDefinition
(
style
.
getGroup
().
getFill
());
elementWithLayout
.
setFillColor
(
backgroundColor
);
if
(
elementWithLayout
instanceof
Compartment
)
{
elementWithLayout
.
setBorderColor
(
backgroundColor
);
}
}
if
(
style
.
getGroup
().
isSetFontSize
())
{
elementWithLayout
.
setFontSize
(
style
.
getGroup
().
getFontSize
());
...
...
converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/compartment/SbmlCompartmentParser.java
View file @
5992ea86
...
...
@@ -81,6 +81,9 @@ public class SbmlCompartmentParser extends SbmlElementParser<org.sbml.jsbml.Comp
if
(!
style
.
getGroup
().
isSetFill
()
&&
style
.
getGroup
().
isSetStroke
())
{
Color
backgroundColor
=
getColorByColorDefinition
(
style
.
getGroup
().
getStroke
());
elementWithLayout
.
setFillColor
(
backgroundColor
);
if
(
elementWithLayout
instanceof
Compartment
)
{
elementWithLayout
.
setBorderColor
(
backgroundColor
);
}
}
}
...
...
converter-sbml/src/test/java/lcsb/mapviewer/converter/model/sbml/SbmlExporterTest.java
View file @
5992ea86
...
...
@@ -242,7 +242,7 @@ public class SbmlExporterTest extends SbmlTestFunctions {
@Test
public
void
testColorParsing
()
throws
Exception
{
Model
model
=
parser
.
createModel
(
new
ConverterParams
().
filename
(
"testFiles/layoutExample/example1.xml"
));
for
(
Element
element
:
model
.
get
Elements
())
{
for
(
Species
element
:
model
.
get
SpeciesList
())
{
element
.
setFillColor
(
Color
.
BLUE
);
}
Model
model2
=
getModelAfterSerializing
(
model
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment