Revision 46158 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/marker/impl/SimpleMarkerSymbol.java
SimpleMarkerSymbol.java | ||
---|---|---|
81 | 81 |
return selectionSymbol; |
82 | 82 |
} |
83 | 83 |
|
84 |
public void draw(Graphics2D g, AffineTransform affineTransform,
|
|
84 |
public void draw(Graphics2D g, AffineTransform affineTransform,
|
|
85 | 85 |
Geometry geom, Feature feature, Cancellable cancel) { |
86 |
int x, y; |
|
86 |
int x = 0; |
|
87 |
int y = 0; |
|
87 | 88 |
Point p; |
88 | 89 |
try { |
89 | 90 |
p = geom.centroid(); |
... | ... | |
95 | 96 |
int size = (int) getSize(); |
96 | 97 |
|
97 | 98 |
int halfSize = size/2; |
98 |
x = ((int) (p.getX() + getOffset().getX()) - halfSize);
|
|
99 |
y = ((int) (p.getY() + getOffset().getY()) - halfSize);
|
|
99 |
int posX = (int) (p.getX() + getOffset().getX()) - halfSize;
|
|
100 |
int posY = (int) (p.getY() + getOffset().getY()) - halfSize;
|
|
100 | 101 |
|
101 | 102 |
// IMask mask = getMask(); |
102 | 103 |
// if (mask != null) { |
... | ... | |
104 | 105 |
// // maskShape.draw(g, null, mask.getHaloShape(shp)); |
105 | 106 |
// } |
106 | 107 |
|
108 |
g.translate(posX, posY); |
|
109 |
if(getRotation() != 0.0){ |
|
110 |
g.rotate(getRotation()); |
|
111 |
} |
|
112 |
|
|
107 | 113 |
g.setColor(getColor()); |
108 | 114 |
GeneralPathX genPath = null; |
109 | 115 |
g.setStroke(new BasicStroke(1)); |
... | ... | |
131 | 137 |
genPath.lineTo(x + halfSize, y + size); |
132 | 138 |
g.draw(genPath); |
133 | 139 |
break; |
140 |
case HORIZONTAL_LINE_STYLE: |
|
141 |
genPath = new GeneralPathX(); |
|
142 |
genPath.moveTo(x, y + halfSize); |
|
143 |
genPath.lineTo(x + size, y + halfSize); |
|
144 |
g.draw(genPath); |
|
145 |
break; |
|
134 | 146 |
case DIAMOND_STYLE: |
135 | 147 |
x = x + halfSize; |
136 | 148 |
y = y + halfSize; |
... | ... | |
205 | 217 |
break; |
206 | 218 |
} |
207 | 219 |
|
208 |
|
|
209 | 220 |
if (outlined) { |
210 | 221 |
g.setColor(outlineColor); |
211 | 222 |
switch (markerStyle) { |
... | ... | |
221 | 232 |
case X_STYLE: |
222 | 233 |
case TRIANGLE_STYLE: |
223 | 234 |
case VERTICAL_LINE_STYLE: |
235 |
case HORIZONTAL_LINE_STYLE: |
|
224 | 236 |
g.draw(genPath); |
225 | 237 |
break; |
226 | 238 |
} |
227 |
} |
|
239 |
} |
|
240 |
if (getRotation() != 0.0) { |
|
241 |
g.rotate(-getRotation()); |
|
242 |
}; |
|
243 |
g.translate(-posX, -posY); |
|
244 |
|
|
228 | 245 |
} |
229 | 246 |
|
230 | 247 |
/** |
Also available in: Unified diff