Commit 1ac37e09 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

color split to fillColor and borderColor

parent ec3a13fa
......@@ -96,7 +96,7 @@ public class CompartmentAliasXmlParser extends AbstractAliasXmlParser<Compartmen
result.setLineOuterWidth(XmlParser.getNodeAttr("outerWidth", node));
result.setLineInnerWidth(XmlParser.getNodeAttr("innerWidth", node));
} else if (node.getNodeName().equalsIgnoreCase("celldesigner:paint")) {
result.setColor(getCommonParser().getColor(node));
result.setFillColor(getCommonParser().getColor(node));
} else if (node.getNodeName().equalsIgnoreCase("celldesigner:info")) {
// not handled
continue;
......@@ -176,7 +176,7 @@ public class CompartmentAliasXmlParser extends AbstractAliasXmlParser<Compartmen
sb.append("innerWidth=\"" + compartment.getInnerWidth() + "\"/>\n");
sb.append("<celldesigner:paint ");
sb.append("color=\"" + XmlParser.colorToString(compartment.getColor()) + "\" scheme=\"Color\"/>\n");
sb.append("color=\"" + XmlParser.colorToString(compartment.getFillColor()) + "\" scheme=\"Color\"/>\n");
sb.append("</celldesigner:compartmentAlias>\n");
......
......@@ -142,7 +142,7 @@ public class ComplexAliasXmlParser extends AbstractAliasXmlParser<Complex> {
result.setWidth(view.getBoxSize().width);
result.setHeight(view.getBoxSize().height);
result.setLineWidth(view.getSingleLine().getWidth());
result.setColor(view.getColor());
result.setFillColor(view.getColor());
} else if (!state.equalsIgnoreCase("complexnoborder")) {
throw new InvalidXmlSchemaException("No view (" + state + ") in ComplexAlias for " + result.getElementId());
}
......@@ -228,13 +228,13 @@ public class ComplexAliasXmlParser extends AbstractAliasXmlParser<Complex> {
sb.append("<celldesigner:innerPosition x=\"" + complex.getX() + "\" y=\"" + complex.getY() + "\"/>");
sb.append("<celldesigner:boxSize width=\"" + complex.getWidth() + "\" height=\"" + complex.getHeight() + "\"/>");
sb.append("<celldesigner:singleLine width=\"" + complex.getLineWidth() + "\"/>");
sb.append("<celldesigner:paint color=\"" + XmlParser.colorToString(complex.getColor()) + "\" scheme=\"Color\"/>");
sb.append("<celldesigner:paint color=\"" + XmlParser.colorToString(complex.getFillColor()) + "\" scheme=\"Color\"/>");
sb.append("</celldesigner:usualView>\n");
sb.append("<celldesigner:briefView>");
sb.append("<celldesigner:innerPosition x=\"" + complex.getX() + "\" y=\"" + complex.getY() + "\"/>");
sb.append("<celldesigner:boxSize width=\"" + complex.getWidth() + "\" height=\"" + complex.getHeight() + "\"/>");
sb.append("<celldesigner:singleLine width=\"" + complex.getWidth() + "\"/>");
sb.append("<celldesigner:paint color=\"" + XmlParser.colorToString(complex.getColor()) + "\" scheme=\"Color\"/>");
sb.append("<celldesigner:paint color=\"" + XmlParser.colorToString(complex.getFillColor()) + "\" scheme=\"Color\"/>");
sb.append("</celldesigner:briefView>\n");
sb.append(createStructuralStateTag(complex));
......
......@@ -121,7 +121,7 @@ public class SpeciesAliasXmlParser extends AbstractAliasXmlParser<Species> {
result.setWidth(view.getBoxSize().width);
result.setHeight(view.getBoxSize().height);
result.setLineWidth(view.getSingleLine().getWidth());
result.setColor(view.getColor());
result.setFillColor(view.getColor());
} else {
throw new InvalidXmlSchemaException(errorPrefix + "No view in Alias");
}
......@@ -220,13 +220,13 @@ public class SpeciesAliasXmlParser extends AbstractAliasXmlParser<Species> {
sb.append("<celldesigner:innerPosition x=\"" + species.getX() + "\" y=\"" + species.getY() + "\"/>");
sb.append("<celldesigner:boxSize width=\"" + species.getWidth() + "\" height=\"" + species.getHeight() + "\"/>");
sb.append("<celldesigner:singleLine width=\"" + species.getLineWidth() + "\"/>");
sb.append("<celldesigner:paint color=\"" + XmlParser.colorToString(species.getColor()) + "\" scheme=\"Color\"/>");
sb.append("<celldesigner:paint color=\"" + XmlParser.colorToString(species.getFillColor()) + "\" scheme=\"Color\"/>");
sb.append("</celldesigner:usualView>\n");
sb.append("<celldesigner:briefView>");
sb.append("<celldesigner:innerPosition x=\"" + species.getX() + "\" y=\"" + species.getY() + "\"/>");
sb.append("<celldesigner:boxSize width=\"" + species.getWidth() + "\" height=\"" + species.getHeight() + "\"/>");
sb.append("<celldesigner:singleLine width=\"" + species.getLineWidth() + "\"/>");
sb.append("<celldesigner:paint color=\"" + XmlParser.colorToString(species.getColor()) + "\" scheme=\"Color\"/>");
sb.append("<celldesigner:paint color=\"" + XmlParser.colorToString(species.getFillColor()) + "\" scheme=\"Color\"/>");
sb.append("</celldesigner:briefView>\n");
if (species.getStateLabel() != null || species.getStatePrefix() != null) {
sb.append("<celldesigner:info state=\"open\" prefix=\"" + species.getStatePrefix() + "\" label=\""
......
......@@ -127,7 +127,7 @@ public class CompartmentAliasXmlParserTest extends CellDesignerTestFunctions {
assertEquals(522.0, alias.getWidth(), 1e-6);
assertEquals(392.5, alias.getNamePoint().getX(), 1e-6);
assertEquals(196.5, alias.getNamePoint().getY(), 1e-6);
assertEquals(0xffcccc00, alias.getColor().getRGB());
assertEquals(0xffcccc00, alias.getFillColor().getRGB());
}
@Test
......
......@@ -1513,7 +1513,7 @@ public class SbgnmlXmlParser {
compartment.setX(new Double(glyph.getBbox().getX()));
compartment.setY(new Double(glyph.getBbox().getY()));
compartment.setThickness(1.0);
compartment.setColor(COMPARTMENT_COLOR);
compartment.setFillColor(COMPARTMENT_COLOR);
if (glyph.getLabel() != null && glyph.getLabel().getBbox() != null) {
compartment.setNamePoint(glyph.getLabel().getBbox().getX(), glyph.getLabel().getBbox().getY());
......
......@@ -53,7 +53,7 @@ public class BottomSquareCompartmentConverter extends CompartmentConverter<Botto
Area a1 = new Area(
new Rectangle2D.Double(0.0, compartment.getY(), compartment.getWidth(), compartment.getHeight()));
Color c1 = compartment.getColor();
Color c1 = compartment.getFillColor();
Color c2 = new Color(c1.getRed(), c1.getGreen(), c1.getBlue(), HIGH_ALPHA_LEVEL);
if (c1.equals(Color.WHITE)) {
c1 = Color.BLACK;
......
......@@ -53,7 +53,7 @@ public class LeftSquareCompartmentConverter extends CompartmentConverter<LeftSqu
compartment.getHeight());
Area a1 = new Area(new Rectangle2D.Double(0.0, 0.0, compartment.getWidth(), compartment.getHeight()));
Color c1 = compartment.getColor();
Color c1 = compartment.getFillColor();
Color c2 = new Color(c1.getRed(), c1.getGreen(), c1.getBlue(), HIGH_ALPHA_LEVEL);
if (c1.equals(Color.WHITE)) {
c1 = Color.BLACK;
......
......@@ -56,7 +56,7 @@ public class OvalCompartmentConverter extends CompartmentConverter<OvalCompartme
Shape s3 = getShape(compartment);
compartment.increaseBorder(compartment.getThickness());
Color c1 = compartment.getColor();
Color c1 = compartment.getFillColor();
Color c2 = new Color(c1.getRed(), c1.getGreen(), c1.getBlue(), HIGH_ALPHA_LEVEL);
if (c1.equals(Color.WHITE)) {
c1 = Color.BLACK;
......
......@@ -43,7 +43,7 @@ public class PathwayCompartmentConverter extends CompartmentConverter<PathwayCom
compartment.getHeight());
Color color = compartment.getFontColor();
Color backgroundColor = compartment.getColor();
Color backgroundColor = compartment.getFillColor();
// fill the background
boolean fill = !isTransparent(compartment, params);
......
......@@ -53,7 +53,7 @@ public class RightSquareCompartmentConverter extends CompartmentConverter<RightS
Area a1 = new Area(
new Rectangle2D.Double(compartment.getX(), 0.0, compartment.getWidth(), compartment.getHeight()));
Color c1 = compartment.getColor();
Color c1 = compartment.getFillColor();
Color c2 = new Color(c1.getRed(), c1.getGreen(), c1.getBlue(), HIGH_ALPHA_LEVEL);
if (c1.equals(Color.WHITE)) {
c1 = Color.BLACK;
......
......@@ -70,7 +70,7 @@ public class SquareCompartmentConverter extends CompartmentConverter<SquareCompa
Shape s3 = getShape(compartment);
compartment.increaseBorder(compartment.getThickness());
Color c1 = compartment.getColor();
Color c1 = compartment.getFillColor();
Color c2 = new Color(c1.getRed(), c1.getGreen(), c1.getBlue(), HIGH_ALPHA_LEVEL);
if (c1.equals(Color.WHITE)) {
c1 = Color.BLACK;
......
......@@ -51,7 +51,7 @@ public class TopSquareCompartmentConverter extends CompartmentConverter<TopSquar
compartment.getHeight() - compartment.getThickness());
Area a1 = new Area(new Rectangle2D.Double(0.0, 0.0, compartment.getWidth(), compartment.getHeight()));
Color c1 = compartment.getColor();
Color c1 = compartment.getFillColor();
Color c2 = new Color(c1.getRed(), c1.getGreen(), c1.getBlue(), HIGH_ALPHA_LEVEL);
if (c1.equals(Color.WHITE)) {
c1 = Color.BLACK;
......
......@@ -43,7 +43,7 @@ public class AntisenseRnaConverter extends SpeciesConverter<AntisenseRna> {
protected void drawImpl(final AntisenseRna antisenseRna, final Graphics2D graphics, final ConverterParams params) {
GeneralPath path = getAntisenseRnaPath(antisenseRna);
Color c = graphics.getColor();
graphics.setColor(antisenseRna.getColor());
graphics.setColor(antisenseRna.getFillColor());
graphics.fill(path);
graphics.setColor(c);
Stroke stroke = graphics.getStroke();
......
......@@ -83,7 +83,7 @@ public class ComplexConverter extends SpeciesConverter<Complex> {
Color c = graphics.getColor();
Stroke stroke = graphics.getStroke();
graphics.setColor(complex.getColor());
graphics.setColor(complex.getFillColor());
graphics.fill(path);
graphics.setColor(c);
graphics.setStroke(getBorderLine(complex));
......
......@@ -65,7 +65,7 @@ public class DegradedConverter extends SpeciesConverter<Degraded> {
a1.exclusiveOr(new Area(path));
Color c = graphics.getColor();
graphics.setColor(degraded.getColor());
graphics.setColor(degraded.getFillColor());
graphics.fill(a1);
graphics.setColor(c);
Stroke stroke = graphics.getStroke();
......
......@@ -71,7 +71,7 @@ public class DrugConverter extends SpeciesConverter<Drug> {
RECTANGLE_CORNER_ARC_SIZE,
RECTANGLE_CORNER_ARC_SIZE);
Color c = graphics.getColor();
graphics.setColor(drug.getColor());
graphics.setColor(drug.getFillColor());
graphics.fill(a1);
graphics.setColor(c);
Stroke stroke = graphics.getStroke();
......
......@@ -43,7 +43,7 @@ public class GeneConverter extends SpeciesConverter<Gene> {
protected void drawImpl(final Gene gene, final Graphics2D graphics, final ConverterParams params) {
Shape shape = getGeneShape(gene);
Color c = graphics.getColor();
graphics.setColor(gene.getColor());
graphics.setColor(gene.getFillColor());
graphics.fill(shape);
graphics.setColor(c);
Stroke stroke = graphics.getStroke();
......
......@@ -46,7 +46,7 @@ public class IonConverter extends SpeciesConverter<Ion> {
double y = getYCoord(ion);
Shape shape = new Ellipse2D.Double(x, y, diameter, diameter);
Color c = graphics.getColor();
graphics.setColor(ion.getColor());
graphics.setColor(ion.getFillColor());
graphics.fill(shape);
graphics.setColor(c);
Stroke stroke = graphics.getStroke();
......
......@@ -42,7 +42,7 @@ public class PhenotypeConverter extends SpeciesConverter<Phenotype> {
GeneralPath path = getPhenotypePath(phenotype);
Color c = graphics.getColor();
graphics.setColor(phenotype.getColor());
graphics.setColor(phenotype.getFillColor());
graphics.fill(path);
graphics.setColor(c);
Stroke stroke = graphics.getStroke();
......
......@@ -149,7 +149,7 @@ public class ProteinConverter extends SpeciesConverter<Protein> {
shape = getDefaultAliasShape(protein);
}
Color c = graphics.getColor();
graphics.setColor(protein.getColor());
graphics.setColor(protein.getFillColor());
graphics.fill(shape);
graphics.setColor(c);
Stroke stroke = graphics.getStroke();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment