Revision 10832

View differences:

trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/symbols/CharacterMarkerSymbol.java
43 43
 *
44 44
 * $Id$
45 45
 * $Log$
46
 * Revision 1.7  2007-03-09 11:20:56  jaume
46
 * Revision 1.8  2007-03-21 11:02:17  jaume
47
 * *** empty log message ***
48
 *
49
 * Revision 1.7  2007/03/09 11:20:56  jaume
47 50
 * Advanced symbology (start committing)
48 51
 *
49 52
 * Revision 1.5.2.8  2007/02/21 07:34:09  jaume
......
218 221
	}
219 222

  
220 223
	public void draw(Graphics2D g, AffineTransform affineTransform, FShape shp) {
221
		g.setFont(getFont()/*.deriveFont((float) getSize())*/);
224
		g.setFont(getFont());
222 225
		g.setColor(getColor());
223 226
		g.rotate(getRotation());
224 227
		Point2D p = null;
......
237 240
			com.vividsolutions.jts.geom.Point centroid = geom.getCentroid();
238 241
			p = new Point2D.Double(centroid.getX(), centroid.getY());
239 242
		}
240
		// p = affineTransform.transform(p, null);
241 243

  
242 244
		char[] text = new char[] { (char) symbol };
243 245
		g.drawChars(text, 0, text.length, (int) p.getX(), (int) p.getY());
......
263 265
		// font style
264 266
		xml.putProperty("fontStyle", font.getStyle());
265 267

  
268
		// marker size
269
		xml.putProperty("size", font.getSize());
270

  
266 271
		// symbol code
267 272
		xml.putProperty("symbolCode", symbol);
268 273

  
......
293 298
		RenderingHints old = g.getRenderingHints();
294 299
		g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
295 300
		double h = r.getHeight();
296
		Font myFont = font.deriveFont(
297
				(float) (h * FConstant.FONT_HEIGHT_SCALE_FACTOR)).deriveFont(
298
						scaleInstance);
299
		g.setFont(myFont);
301
		g.setFont(font);
300 302
		g.setColor(getColor());
301 303
		r.y = (int) h;
302 304

  
303
		// center character in case the rectangle is not square
304
//		FontMetrics metrics = g.getFontMetrics(font);
305
//		String text = String.valueOf( (char) symbol );
306
//
307
//		int x = (r.width - metrics.stringWidth(text)) / 2;
308
//		int y = r.height / 2;
309
//
310
//		// and apply the offset
311
//		x = x + (int) offset.getX(); // TODO scale offset
312
//		y = y + (int) offset.getY(); // TODO scale offset
313
//		g.drawString(text, x, y);
314

  
315 305
		int x = r.x;
316 306
		int y = r.y;
317 307
		int width = (int) r.getHeight();
......
347 337
		setDescription(xml.getStringProperty("desc"));
348 338
		font = new Font(xml.getStringProperty("font"),
349 339
				xml.getIntProperty("fontStyle"),
350
				100 /* or whatever*/);
340
				xml.getIntProperty("size") /* or whatever (in fact)*/);
351 341
		setIsShapeVisible(xml.getBooleanProperty("isShapeVisible"));
352 342
		symbol = xml.getIntProperty("symbolCode");
353 343
		setOffset(p);
......
361 351

  
362 352
	}
363 353

  
354
	public double getSize() {
355
		return font.getSize();
356
	}
357

  
358
	public void setSize(double size) {
359
		font = new Font(font.getName(), font.getStyle(), (int) size);
360
	}
364 361
}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/symbols/SimpleFillSymbol.java
43 43
*
44 44
* $Id$
45 45
* $Log$
46
* Revision 1.7  2007-03-20 17:00:50  jaume
46
* Revision 1.8  2007-03-21 11:02:17  jaume
47 47
* *** empty log message ***
48 48
*
49
* Revision 1.7  2007/03/20 17:00:50  jaume
50
* *** empty log message ***
51
*
49 52
* Revision 1.6  2007/03/20 16:02:09  jaume
50 53
* *** empty log message ***
51 54
*
......
199 202
		// color
200 203
		setFillColor(StringUtilities.string2Color(xml.getStringProperty("color")));
201 204

  
202

  
203 205
		// description
204 206
		setDescription(xml.getStringProperty("desc"));
205 207

  
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/symbols/AbstractMarkerSymbol.java
43 43
*
44 44
* $Id$
45 45
* $Log$
46
* Revision 1.4  2007-03-09 11:20:56  jaume
46
* Revision 1.5  2007-03-21 11:02:17  jaume
47
* *** empty log message ***
48
*
49
* Revision 1.4  2007/03/09 11:20:56  jaume
47 50
* Advanced symbology (start committing)
48 51
*
49 52
* Revision 1.3.2.4  2007/02/16 10:54:12  jaume
......
112 115
 * @author  jaume dominguez faus - jaume.dominguez@iver.es
113 116
 */
114 117
public abstract class AbstractMarkerSymbol extends AbstractSymbol implements IMarkerSymbol {
115
	/**
116
	 * @uml.property  name="color"
117
	 */
118 118
	private Color color = Color.BLACK;
119
	/**
120
	 * @uml.property  name="rotation"
121
	 */
122 119
	private double rotation;
123
	/**
124
	 * @uml.property  name="offset"
125
	 */
126 120
	private Point2D offset = new Point2D.Double();
127
	/**
128
	 * @uml.property  name="size"
129
	 */
130 121
	private double size;
131 122

  
132
	/* (non-Javadoc)
133
	 * @see com.iver.cit.gvsig.fmap.core.symbols.IMarkerSymbol#getRotation()
134
	 */
135
	/**
136
	 * @return
137
	 * @uml.property  name="rotation"
138
	 */
139 123
	public double getRotation() {
140 124
		return rotation;
141 125
	}
142 126

  
143
	/* (non-Javadoc)
144
	 * @see com.iver.cit.gvsig.fmap.core.symbols.IMarkerSymbol#setRotation(double)
145
	 */
146
	/**
147
	 * @param r
148
	 * @uml.property  name="rotation"
149
	 */
150 127
	public void setRotation(double r) {
151 128
		this.rotation = r;
152 129
	}
153
	/* (non-Javadoc)
154
	 * @see com.iver.cit.gvsig.fmap.core.symbols.IMarkerSymbol#getOffset()
155
	 */
156
	/**
157
	 * @return
158
	 * @uml.property  name="offset"
159
	 */
130

  
160 131
	public Point2D getOffset() {
161 132
		if (offset == null) {
162 133
			offset = new Point();
......
164 135
		return offset;
165 136
	}
166 137

  
167
	/* (non-Javadoc)
168
	 * @see com.iver.cit.gvsig.fmap.core.symbols.IMarkerSymbol#setOffset(java.awt.geom.Point2D.Double)
169
	 */
170 138
	public void setOffset(Point2D offset) {
171 139
		this.offset = offset;
172 140
	}
......
179 147
		return color.getRGB();
180 148
	}
181 149

  
182
	/* (non-Javadoc)
183
	 * @see com.iver.cit.gvsig.fmap.core.symbols.IMarkerSymbol#getSize()
184
	 */
185
	/**
186
	 * @return
187
	 * @uml.property  name="size"
188
	 */
189 150
	public double getSize() {
190 151
		return size;
191 152
	}
192 153

  
193
	/* (non-Javadoc)
194
	 * @see com.iver.cit.gvsig.fmap.core.symbols.IMarkerSymbol#setSize(double)
195
	 */
196
	/**
197
	 * @param size
198
	 * @uml.property  name="size"
199
	 */
200 154
	public void setSize(double size) {
201 155
		this.size = size;
202 156
	}
203 157

  
204
	/* (non-Javadoc)
205
	 * @see com.iver.cit.gvsig.fmap.core.symbols.IMarkerSymbol#getColor()
206
	 */
207
	/**
208
	 * @return
209
	 * @uml.property  name="color"
210
	 */
211 158
	public Color getColor() {
212 159
		return color;
213 160
	}
214 161

  
215
	/* (non-Javadoc)
216
	 * @see com.iver.cit.gvsig.fmap.core.symbols.IMarkerSymbol#setColor(java.awt.Color)
217
	 */
218
	/**
219
	 * @param color
220
	 * @uml.property  name="color"
221
	 */
222 162
	public void setColor(Color color) {
223 163
		this.color = color;
224 164
	}
225

  
226 165
}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/rendering/SingleSymbolLegend.java
71 71
	 */
72 72
	private int shapeType = FShape.POLYGON; // Por defecto, tipo pol?gono
73 73
	// private boolean bWithHeightText;
74

  
75

  
76
	public SingleSymbolLegend() {	}
77

  
78

  
74 79
	/**
75 80
	 * Crea un nuevo SingleSymbolLegend.
76 81
	 *

Also available in: Unified diff