Revision 46158

View differences:

trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/marker/IMarkerSymbol.java
49 49
    public static final int TRIANGLE_STYLE = 5;
50 50
    public static final int STAR_STYLE = 6;
51 51
    public static final int VERTICAL_LINE_STYLE = 7;
52
    public static final int HORIZONTAL_LINE_STYLE = 8;
52 53

  
53 54
    /**
54 55
     * Returns the rotation (in radians, counter-clockwise) of the marker symbol
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
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
	/**
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.swing/org.gvsig.symbology.swing.api/src/main/java/org/gvsig/app/gui/styling/JComboBoxSimpleMarkeStyles.java
61 61
		new MyItem(IMarkerSymbol.TRIANGLE_STYLE),
62 62
		new MyItem(IMarkerSymbol.STAR_STYLE),
63 63
		new MyItem(IMarkerSymbol.VERTICAL_LINE_STYLE),
64
		new MyItem(IMarkerSymbol.HORIZONTAL_LINE_STYLE),
64 65
	};
65 66

  
66 67
	/**

Also available in: Unified diff