Revision 9919 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/symbols/SimpleLineSymbol.java
SimpleLineSymbol.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.2 2007-01-24 17:58:22 jaume |
|
46 |
* Revision 1.3 2007-01-25 16:25:23 jaume |
|
47 |
* *** empty log message *** |
|
48 |
* |
|
49 |
* Revision 1.2 2007/01/24 17:58:22 jaume |
|
47 | 50 |
* new features and architecture error fixes |
48 | 51 |
* |
49 | 52 |
* Revision 1.1 2007/01/16 11:50:44 jaume |
... | ... | |
97 | 100 |
XMLEntity xml = new XMLEntity(); |
98 | 101 |
xml.putProperty("className", getClassName()); |
99 | 102 |
xml.putProperty("isShapeVisible", isShapeVisible()); |
100 |
xml.putProperty("color", getColor());
|
|
103 |
xml.putProperty("color", StringUtilities.color2String(getColor()));
|
|
101 | 104 |
xml.putProperty("stroke", ((BasicStroke) getStroke()).getLineWidth()); |
102 | 105 |
return xml; |
103 | 106 |
} |
... | ... | |
105 | 108 |
public void drawInsideRectangle(Graphics2D g, |
106 | 109 |
AffineTransform scaleInstance, Rectangle r) { |
107 | 110 |
g.setColor(getColor()); |
108 |
final int hGap = 5; // the left and right margins |
|
109 |
final int vPos = 1; // the top and bottom margins |
|
110 |
final int splitCount = 3; // number of lines |
|
111 |
g.setStroke(getStroke()); |
|
112 |
final int hGap = (int) (r.getWidth() * 0.1); // the left and right margins |
|
113 |
final int vPos = 1; // the top and bottom margins |
|
114 |
final int splitCount = 3; // number of lines |
|
111 | 115 |
final int splitHSize = (r.width - hGap - hGap) / splitCount; |
112 | 116 |
int hPos = hGap; |
117 |
boolean swap = false; |
|
113 | 118 |
for (int i = 0; i < splitCount; i++) { |
114 |
g.drawLine(hPos, vPos, hPos + splitHSize, r.height-vPos); |
|
119 |
swap = !swap; |
|
120 |
g.drawLine(hPos, swap ? vPos : r.height-vPos, hPos + splitHSize, swap ? r.height-vPos : vPos); |
|
115 | 121 |
hPos += splitHSize; |
116 | 122 |
} |
117 | 123 |
} |
... | ... | |
123 | 129 |
public void setXMLEntity(XMLEntity xml) { |
124 | 130 |
setIsShapeVisible(xml.getBooleanProperty("isShapeVisible")); |
125 | 131 |
setColor(StringUtilities. |
126 |
string2Color(xml.getStringProperty("isShapeVisible")));
|
|
132 |
string2Color(xml.getStringProperty("color")));
|
|
127 | 133 |
setStroke(new BasicStroke(xml.getFloatProperty("stroke"))); |
128 | 134 |
} |
129 | 135 |
|
Also available in: Unified diff