root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / core / v02 / FSymbol.java @ 1293
History | View | Annotate | Download (18.4 KB)
1 |
/*
|
---|---|
2 |
* Created on 19-feb-2004
|
3 |
*
|
4 |
* To change the template for this generated file go to
|
5 |
* Window>Preferences>Java>Code Generation>Code and Comments
|
6 |
*/
|
7 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
8 |
*
|
9 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
10 |
*
|
11 |
* This program is free software; you can redistribute it and/or
|
12 |
* modify it under the terms of the GNU General Public License
|
13 |
* as published by the Free Software Foundation; either version 2
|
14 |
* of the License, or (at your option) any later version.
|
15 |
*
|
16 |
* This program is distributed in the hope that it will be useful,
|
17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19 |
* GNU General Public License for more details.
|
20 |
*
|
21 |
* You should have received a copy of the GNU General Public License
|
22 |
* along with this program; if not, write to the Free Software
|
23 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
24 |
*
|
25 |
* For more information, contact:
|
26 |
*
|
27 |
* Generalitat Valenciana
|
28 |
* Conselleria d'Infraestructures i Transport
|
29 |
* Av. Blasco Ib??ez, 50
|
30 |
* 46010 VALENCIA
|
31 |
* SPAIN
|
32 |
*
|
33 |
* +34 963862235
|
34 |
* gvsig@gva.es
|
35 |
* www.gvsig.gva.es
|
36 |
*
|
37 |
* or
|
38 |
*
|
39 |
* IVER T.I. S.A
|
40 |
* Salamanca 50
|
41 |
* 46005 Valencia
|
42 |
* Spain
|
43 |
*
|
44 |
* +34 963163400
|
45 |
* dac@iver.es
|
46 |
*/
|
47 |
package com.iver.cit.gvsig.fmap.core.v02; |
48 |
|
49 |
import com.iver.cit.gvsig.fmap.core.FShape; |
50 |
|
51 |
import com.iver.utiles.StringUtilities; |
52 |
import com.iver.utiles.XMLEntity; |
53 |
|
54 |
import java.awt.BasicStroke; |
55 |
import java.awt.Color; |
56 |
import java.awt.Font; |
57 |
import java.awt.Graphics2D; |
58 |
import java.awt.Image; |
59 |
import java.awt.Paint; |
60 |
import java.awt.Rectangle; |
61 |
import java.awt.Stroke; |
62 |
import java.awt.image.BufferedImage; |
63 |
|
64 |
|
65 |
/**
|
66 |
* S?mbolo utilizado para guardar las caracter?sticas que se deben de aplicar a
|
67 |
* los Shapes a dibujar.
|
68 |
*
|
69 |
* @author Vicente Caballero Navarro
|
70 |
*/
|
71 |
public class FSymbol { |
72 |
private static BufferedImage img = new BufferedImage(1, 1, |
73 |
BufferedImage.TYPE_INT_ARGB);
|
74 |
private static Rectangle rect = new Rectangle(0, 0, 1, 1); |
75 |
private static Color selectionColor = Color.YELLOW; |
76 |
private int m_symbolType; |
77 |
private int m_Style; |
78 |
private boolean m_useOutline; |
79 |
private Color m_Color; |
80 |
private Color m_outlineColor; |
81 |
private Font m_Font; |
82 |
private Color m_FontColor; |
83 |
private float m_FontSize; |
84 |
private int rgb; |
85 |
|
86 |
/**
|
87 |
* Si <code>m_bUseFontSize</code> viene a false entonces m_FontSize viene
|
88 |
* en unidades de mapa (metros)
|
89 |
*/
|
90 |
private boolean m_bUseFontSizeInPixels; |
91 |
|
92 |
/**
|
93 |
* <code>m_bDrawShape</code> indica si queremos dibujar el shape de fondo.
|
94 |
* Es ?til cuando est?s etiquetando y no quieres que se dibuje el s?mbolo
|
95 |
* que te sirve de base para etiquetar.
|
96 |
*/
|
97 |
private boolean m_bDrawShape = true; |
98 |
private int m_Size; |
99 |
private Image m_Icon; |
100 |
private int m_Rotation; |
101 |
private Paint m_Fill; |
102 |
public String m_LinePattern = "0"; // Solo para poder mostrarlo cuando vamos a seleccionar un s?mbolo |
103 |
|
104 |
// En realidad lo podemos ver de BasicStroke, pero....
|
105 |
// ya veremos si luego lo quitamos.
|
106 |
private Stroke m_Stroke; |
107 |
|
108 |
//private float m_stroke=0;
|
109 |
// public int m_Transparency; // Ya la lleva dentro del Color
|
110 |
private boolean m_bUseSize; // Si est? a true, m_Size viene en coordenadas de mundo real. |
111 |
private int m_AlingVert; |
112 |
private int m_AlingHoriz; |
113 |
private String m_Descrip; |
114 |
public Color m_BackColor; |
115 |
public Paint m_BackFill; |
116 |
|
117 |
/**
|
118 |
* Crea un nuevo FSymbol.
|
119 |
*/
|
120 |
FSymbol() { |
121 |
} |
122 |
|
123 |
/**
|
124 |
* Creates a new FSymbol object.
|
125 |
*
|
126 |
* @param tipoSymbol Tipo de s?mbolo.
|
127 |
* @param c Color.
|
128 |
*/
|
129 |
public FSymbol(int tipoSymbol, Color c) { |
130 |
createSymbol(tipoSymbol, c); |
131 |
} |
132 |
|
133 |
/**
|
134 |
* Crea un nuevo FSymbol.
|
135 |
*
|
136 |
* @param tipoSymbol Tipo de S?mbolo.
|
137 |
*/
|
138 |
public FSymbol(int tipoSymbol) { |
139 |
int numreg = (int) (Math.random() * 100); |
140 |
Color colorAleatorio = new Color(((numreg * numreg) + 100) % 255, |
141 |
(numreg + ((3 * numreg) + 100)) % 255, numreg % 255); |
142 |
|
143 |
createSymbol(tipoSymbol, colorAleatorio); |
144 |
} |
145 |
|
146 |
/**
|
147 |
* A partir de un s?mbolo devuelve otro similar pero con el color de
|
148 |
* selecci?n.
|
149 |
*
|
150 |
* @param sym S?mbolo a modificar.
|
151 |
*
|
152 |
* @return S?mbolo modificado.
|
153 |
*/
|
154 |
public static FSymbol getSymbolForSelection(FSymbol sym) { |
155 |
FSymbol selecSymbol = sym.fastCloneSymbol(); |
156 |
selecSymbol.setColor(getSelectionColor()); |
157 |
if (selecSymbol.getStyle() == FConstant.SYMBOL_STYLE_FILL_TRANSPARENT)
|
158 |
selecSymbol.setStyle(FConstant.SYMBOL_STYLE_FILL_SOLID); |
159 |
selecSymbol.rgb = getSelectionColor().getRGB(); |
160 |
|
161 |
return selecSymbol;
|
162 |
} |
163 |
|
164 |
/**
|
165 |
* Clona el s?mbolo actual.
|
166 |
*
|
167 |
* @return Nuevo s?mbolo clonado.
|
168 |
*/
|
169 |
public FSymbol cloneSymbol() {
|
170 |
return createFromXML(getXMLEntity());
|
171 |
} |
172 |
|
173 |
/**
|
174 |
* Se usa para el s?mbolo de selecci?n. Es una forma
|
175 |
* r?pida de clonar un s?mbolo, sin hacerlo via XML.
|
176 |
* Vicente, no lo borres!!!
|
177 |
* @return
|
178 |
*/
|
179 |
public FSymbol fastCloneSymbol()
|
180 |
{ |
181 |
FSymbol nS = new FSymbol();
|
182 |
|
183 |
|
184 |
nS.m_symbolType = m_symbolType; |
185 |
nS.m_Style = m_Style; |
186 |
nS.m_useOutline = m_useOutline; |
187 |
nS.m_Color = m_Color; |
188 |
nS.m_outlineColor = m_outlineColor; |
189 |
nS.m_Font = m_Font; |
190 |
nS.m_FontColor = m_FontColor; |
191 |
nS.m_FontSize = m_FontSize; |
192 |
nS.m_bUseFontSizeInPixels = m_bUseFontSizeInPixels; |
193 |
nS.m_bDrawShape = m_bDrawShape; |
194 |
nS.m_Size = m_Size; |
195 |
nS.m_Icon = m_Icon; |
196 |
nS.m_Rotation = m_Rotation; |
197 |
nS.m_Fill = m_Fill; |
198 |
nS.m_Stroke = m_Stroke; |
199 |
// nS.m_Transparency =m_Transparency ;
|
200 |
nS.m_bUseSize = m_bUseSize; |
201 |
nS.m_AlingVert = m_AlingVert; |
202 |
nS.m_AlingHoriz = m_AlingHoriz; |
203 |
nS.m_Descrip = m_Descrip; |
204 |
nS.m_BackColor = m_BackColor; |
205 |
nS.m_BackFill = m_BackFill; |
206 |
|
207 |
nS.m_LinePattern = m_LinePattern; |
208 |
|
209 |
return nS;
|
210 |
} |
211 |
|
212 |
|
213 |
/**
|
214 |
* Crea un s?mbolo a partir del tipo y el color.
|
215 |
*
|
216 |
* @param tipoSymbol Tipo de s?mbolo.
|
217 |
* @param c Color del s?mbolo a crear.
|
218 |
*/
|
219 |
private void createSymbol(int tipoSymbol, Color c) { |
220 |
// OJO: HE HECHO COINCIDIR LOS TIPOS DE SIMBOLO
|
221 |
//FConstant.SYMBOL_TYPE_POINT, LINE Y FILL CON
|
222 |
// FShape.POINT, LINE, POLYGON. EL .MULTI SE REFIERE
|
223 |
// A MULTIPLES TIPO DENTRO DEL SHAPE, AS? QUE SER? UN
|
224 |
// MULTISIMBOLO
|
225 |
// Tipo de simbolo
|
226 |
m_symbolType = tipoSymbol; // Para no recalcular el pixel, no usamos los set
|
227 |
|
228 |
// Ponemos un estilo por defecto
|
229 |
m_useOutline = true;
|
230 |
m_Color = c; |
231 |
m_Stroke = null;
|
232 |
m_Fill = null;
|
233 |
|
234 |
m_FontColor = Color.BLACK;
|
235 |
m_FontSize = 10;
|
236 |
m_bUseFontSizeInPixels = true;
|
237 |
|
238 |
m_Size = 0;
|
239 |
|
240 |
switch (getSymbolType()) {
|
241 |
case FConstant.SYMBOL_TYPE_POINT:
|
242 |
case FConstant.SYMBOL_TYPE_POINTZ:
|
243 |
case FConstant.SYMBOL_TYPE_MULTIPOINT:
|
244 |
m_bUseSize = true; // Esto es lo primero que hay que hacer siempre |
245 |
|
246 |
// para evitar un StackOverflow
|
247 |
m_useOutline = false;
|
248 |
setStyle(FConstant.SYMBOL_STYLE_MARKER_SQUARE); |
249 |
setSize(5); //pixels |
250 |
|
251 |
break;
|
252 |
|
253 |
case FConstant.SYMBOL_TYPE_LINE:
|
254 |
case FConstant.SYMBOL_TYPE_POLYLINEZ:
|
255 |
case FConstant.SYMBOL_TYPE_POLYGONZ:
|
256 |
setStroke(new BasicStroke()); |
257 |
setStyle(FConstant.SYMBOL_STYLE_LINE_SOLID); |
258 |
|
259 |
break;
|
260 |
|
261 |
case FConstant.SYMBOL_TYPE_FILL:
|
262 |
case FShape.MULTI:
|
263 |
setStroke(new BasicStroke()); |
264 |
setStyle(FConstant.SYMBOL_STYLE_FILL_SOLID); |
265 |
|
266 |
break;
|
267 |
} |
268 |
|
269 |
m_outlineColor = c.darker(); |
270 |
|
271 |
calculateRgb(); |
272 |
} |
273 |
|
274 |
/**
|
275 |
* Calcula el RGB del s?mbolo.
|
276 |
*/
|
277 |
public void calculateRgb() { |
278 |
// Recalculamos el RGB
|
279 |
Graphics2D g2 = img.createGraphics();
|
280 |
|
281 |
FGraphicUtilities.DrawSymbol(g2, g2.getTransform(), rect, this);
|
282 |
rgb = img.getRGB(0, 0); |
283 |
} |
284 |
|
285 |
/**
|
286 |
* Devuelve el rgb del s?mbolo.
|
287 |
*
|
288 |
* @return rgb del s?mbolo.
|
289 |
*/
|
290 |
public int getRgb() { |
291 |
return rgb;
|
292 |
} |
293 |
|
294 |
/**
|
295 |
* @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getXMLEntity()
|
296 |
*/
|
297 |
public XMLEntity getXMLEntity() {
|
298 |
XMLEntity xml = new XMLEntity();
|
299 |
xml.putProperty("className",this.getClass().getName()); |
300 |
xml.putProperty("m_symbolType", getSymbolType());
|
301 |
xml.putProperty("m_Style", getStyle());
|
302 |
xml.putProperty("m_useOutline", isOutlined());
|
303 |
|
304 |
if (getColor() != null) { |
305 |
xml.putProperty("m_Color", StringUtilities.color2String(getColor()));
|
306 |
} |
307 |
|
308 |
if (getOutlineColor() != null) { |
309 |
xml.putProperty("m_outlineColor",
|
310 |
StringUtilities.color2String(getOutlineColor())); |
311 |
} |
312 |
|
313 |
if (getFont() != null) { |
314 |
xml.putProperty("fontname", getFont().getName());
|
315 |
xml.putProperty("fontstyle", getFont().getStyle());
|
316 |
xml.putProperty("m_FontSize", getFontSize());
|
317 |
xml.putProperty("m_FontColor",
|
318 |
StringUtilities.color2String(getFontColor())); |
319 |
} |
320 |
|
321 |
xml.putProperty("m_bUseFontSize", isFontSizeInPixels());
|
322 |
xml.putProperty("m_bDrawShape", isShapeVisible());
|
323 |
xml.putProperty("m_Size", getSize());
|
324 |
|
325 |
//xml.putProperty("m_Icon",m_Icon.);
|
326 |
xml.putProperty("m_Rotation", getRotation());
|
327 |
|
328 |
if (getFill() instanceof Color) { |
329 |
xml.putProperty("m_Fill",
|
330 |
StringUtilities.color2String((Color) getFill()));
|
331 |
} |
332 |
|
333 |
xml.putProperty("m_LinePattern", m_LinePattern);
|
334 |
|
335 |
//Ancho del stroke en float
|
336 |
if (getStroke() != null) { |
337 |
xml.putProperty("m_stroke",
|
338 |
((BasicStroke) getStroke()).getLineWidth());
|
339 |
} else {
|
340 |
xml.putProperty("m_stroke", 0f); |
341 |
} |
342 |
|
343 |
xml.putProperty("m_bUseSize", isSizeInPixels());
|
344 |
xml.putProperty("m_AlingVert", getAlingVert());
|
345 |
xml.putProperty("m_AlingHoriz", getAlingHoriz());
|
346 |
xml.putProperty("m_Descrip", getDescription());
|
347 |
|
348 |
if (m_BackColor != null) { |
349 |
xml.putProperty("m_BackColor",
|
350 |
StringUtilities.color2String(m_BackColor)); |
351 |
} |
352 |
|
353 |
if (m_BackFill instanceof Color) { |
354 |
xml.putProperty("m_BackFill",
|
355 |
StringUtilities.color2String((Color) m_BackFill));
|
356 |
} |
357 |
|
358 |
xml.putProperty("rgb", rgb);
|
359 |
|
360 |
return xml;
|
361 |
} |
362 |
|
363 |
/**
|
364 |
* Crea el s?mbolo a partir del xml.
|
365 |
*
|
366 |
* @param xml xml que contiene la informaci?n para crear el s?mbolo.
|
367 |
*
|
368 |
* @return S?mbolo creado a partir del XML.
|
369 |
*/
|
370 |
public static FSymbol createFromXML(XMLEntity xml) { |
371 |
FSymbol symbol = new FSymbol();
|
372 |
symbol.setSymbolType(xml.getIntProperty("m_symbolType"));
|
373 |
symbol.setStyle(xml.getIntProperty("m_Style"));
|
374 |
System.out.println("createFromXML: m_Style=" + xml.getIntProperty("m_Style")); |
375 |
|
376 |
symbol.setOutlined(xml.getBooleanProperty("m_useOutline"));
|
377 |
|
378 |
if (xml.contains("m_Color")) { |
379 |
symbol.setColor(StringUtilities.string2Color(xml.getStringProperty( |
380 |
"m_Color")));
|
381 |
} |
382 |
|
383 |
if (xml.contains("m_outlineColor")) { |
384 |
symbol.setOutlineColor(StringUtilities.string2Color( |
385 |
xml.getStringProperty("m_outlineColor")));
|
386 |
} |
387 |
|
388 |
if (xml.contains("m_FontColor")) { |
389 |
symbol.setFont(new Font(xml.getStringProperty("fontname"), |
390 |
xml.getIntProperty("fontstyle"),
|
391 |
(int) xml.getFloatProperty("m_FontSize"))); |
392 |
symbol.setFontColor(StringUtilities.string2Color( |
393 |
xml.getStringProperty("m_FontColor")));
|
394 |
symbol.setFontSize(xml.getFloatProperty("m_FontSize"));
|
395 |
} |
396 |
|
397 |
symbol.setFontSizeInPixels(xml.getBooleanProperty("m_bUseFontSize"));
|
398 |
symbol.setShapeVisible(xml.getBooleanProperty("m_bDrawShape"));
|
399 |
symbol.setSize(xml.getIntProperty("m_Size"));
|
400 |
|
401 |
//xml.putProperty("m_Icon",m_Icon.);
|
402 |
symbol.setRotation(xml.getIntProperty("m_Rotation"));
|
403 |
|
404 |
if (xml.contains("m_Fill")) { |
405 |
symbol.setFill(StringUtilities.string2Color(xml.getStringProperty( |
406 |
"m_Fill")));
|
407 |
} |
408 |
symbol.setFill(FSymbolFactory.createPatternFill(symbol.getStyle(), symbol.getColor())); |
409 |
|
410 |
symbol.m_LinePattern = xml.getStringProperty("m_LinePattern");
|
411 |
|
412 |
//Ancho del stroke en float
|
413 |
symbol.setStroke(new BasicStroke(xml.getFloatProperty("m_stroke"))); |
414 |
symbol.setSizeInPixels(xml.getBooleanProperty("m_bUseSize"));
|
415 |
symbol.setAlingVert(xml.getIntProperty("m_AlingVert"));
|
416 |
symbol.setAlingHoriz(xml.getIntProperty("m_AlingHoriz"));
|
417 |
symbol.setDescription(xml.getStringProperty("m_Descrip"));
|
418 |
|
419 |
if (xml.contains("m_BackColor")) { |
420 |
symbol.m_BackColor = StringUtilities.string2Color(xml.getStringProperty( |
421 |
"m_BackColor"));
|
422 |
} |
423 |
|
424 |
if (xml.contains("m_BackFill")) { |
425 |
symbol.m_BackFill = StringUtilities.string2Color(xml.getStringProperty( |
426 |
"m_BackFill"));
|
427 |
} |
428 |
|
429 |
symbol.rgb = xml.getIntProperty("rgb");
|
430 |
|
431 |
return symbol;
|
432 |
} |
433 |
|
434 |
/**
|
435 |
* Introduce el estilo del s?mbolo.
|
436 |
*
|
437 |
* @param m_Style The m_Style to set.
|
438 |
*/
|
439 |
public void setStyle(int m_Style) { |
440 |
this.m_Style = m_Style;
|
441 |
|
442 |
// calculateRgb();
|
443 |
} |
444 |
|
445 |
/**
|
446 |
* Devuelve el estilo del s?mbolo.
|
447 |
*
|
448 |
* @return Returns the m_Style.
|
449 |
*/
|
450 |
public int getStyle() { |
451 |
return m_Style;
|
452 |
} |
453 |
|
454 |
/**
|
455 |
* Introduce el tipo de s?mbolo.
|
456 |
*
|
457 |
* @param m_symbolType The m_symbolType to set.
|
458 |
*/
|
459 |
public void setSymbolType(int m_symbolType) { |
460 |
this.m_symbolType = m_symbolType;
|
461 |
} |
462 |
|
463 |
/**
|
464 |
* Devuelve el tipo de s?mbolo.
|
465 |
*
|
466 |
* @return Returns the m_symbolType.
|
467 |
*/
|
468 |
public int getSymbolType() { |
469 |
return m_symbolType;
|
470 |
} |
471 |
|
472 |
/**
|
473 |
* Introduce si el s?mbolo contiene linea de brode o no.
|
474 |
*
|
475 |
* @param m_useOutline The m_useOutline to set.
|
476 |
*/
|
477 |
public void setOutlined(boolean m_useOutline) { |
478 |
this.m_useOutline = m_useOutline;
|
479 |
|
480 |
// calculateRgb();
|
481 |
} |
482 |
|
483 |
/**
|
484 |
* Devuelve si el s?mbolo contiene o no linea de borde.
|
485 |
*
|
486 |
* @return Returns the m_useOutline.
|
487 |
*/
|
488 |
public boolean isOutlined() { |
489 |
return m_useOutline;
|
490 |
} |
491 |
|
492 |
/**
|
493 |
* Introduce el color del s?mbolo.
|
494 |
*
|
495 |
* @param m_Color The m_Color to set.
|
496 |
*/
|
497 |
public void setColor(Color m_Color) { |
498 |
this.m_Color = m_Color;
|
499 |
|
500 |
// calculateRgb();
|
501 |
} |
502 |
|
503 |
/**
|
504 |
* Devuelve el color del s?mbolo.
|
505 |
*
|
506 |
* @return Returns the m_Color.
|
507 |
*/
|
508 |
public Color getColor() { |
509 |
return m_Color;
|
510 |
} |
511 |
|
512 |
/**
|
513 |
* Introduce el color de la l?nea de borde.
|
514 |
*
|
515 |
* @param m_outlineColor The m_outlineColor to set.
|
516 |
*/
|
517 |
public void setOutlineColor(Color m_outlineColor) { |
518 |
this.m_outlineColor = m_outlineColor;
|
519 |
|
520 |
// calculateRgb();
|
521 |
} |
522 |
|
523 |
/**
|
524 |
* Devuelve el color de la l?nea de borde.
|
525 |
*
|
526 |
* @return Returns the m_outlineColor.
|
527 |
*/
|
528 |
public Color getOutlineColor() { |
529 |
return m_outlineColor;
|
530 |
} |
531 |
|
532 |
/**
|
533 |
* Introduce el Font del s?mbolo.
|
534 |
*
|
535 |
* @param m_Font The m_Font to set.
|
536 |
*/
|
537 |
public void setFont(Font m_Font) { |
538 |
this.m_Font = m_Font;
|
539 |
|
540 |
// calculateRgb();
|
541 |
} |
542 |
|
543 |
/**
|
544 |
* Devuelve el Font del s?mbolo.
|
545 |
*
|
546 |
* @return Returns the m_Font.
|
547 |
*/
|
548 |
public Font getFont() { |
549 |
return m_Font;
|
550 |
} |
551 |
|
552 |
/**
|
553 |
* Introduce el color de la fuente.
|
554 |
*
|
555 |
* @param m_FontColor The m_FontColor to set.
|
556 |
*/
|
557 |
public void setFontColor(Color m_FontColor) { |
558 |
this.m_FontColor = m_FontColor;
|
559 |
|
560 |
// calculateRgb();
|
561 |
} |
562 |
|
563 |
/**
|
564 |
* Devuelve el color de la fuente.
|
565 |
*
|
566 |
* @return Returns the m_FontColor.
|
567 |
*/
|
568 |
public Color getFontColor() { |
569 |
return m_FontColor;
|
570 |
} |
571 |
|
572 |
/**
|
573 |
* Introduce si se usa el tama?o de la fuente en pixels.
|
574 |
*
|
575 |
* @param m_bUseFontSize The m_bUseFontSize to set.
|
576 |
*/
|
577 |
public void setFontSizeInPixels(boolean m_bUseFontSize) { |
578 |
this.m_bUseFontSizeInPixels = m_bUseFontSize;
|
579 |
|
580 |
// calculateRgb();
|
581 |
} |
582 |
|
583 |
/**
|
584 |
* Devuelve true si el tama?o de la fuente esta seleccionado en pixels.
|
585 |
*
|
586 |
* @return Returns the m_bUseFontSize.
|
587 |
*/
|
588 |
public boolean isFontSizeInPixels() { |
589 |
return m_bUseFontSizeInPixels;
|
590 |
} |
591 |
|
592 |
/**
|
593 |
* Introduce si el shape e visible o no lo es.
|
594 |
*
|
595 |
* @param m_bDrawShape The m_bDrawShape to set.
|
596 |
*/
|
597 |
public void setShapeVisible(boolean m_bDrawShape) { |
598 |
this.m_bDrawShape = m_bDrawShape;
|
599 |
|
600 |
// calculateRgb();
|
601 |
} |
602 |
|
603 |
/**
|
604 |
* Devuelve true si el shape es visible.
|
605 |
*
|
606 |
* @return Returns the m_bDrawShape.
|
607 |
*/
|
608 |
public boolean isShapeVisible() { |
609 |
return m_bDrawShape;
|
610 |
} |
611 |
|
612 |
/**
|
613 |
* Introduce el tama?o del s?mbolo.
|
614 |
*
|
615 |
* @param m_Size The m_Size to set.
|
616 |
*/
|
617 |
public void setSize(int m_Size) { |
618 |
this.m_Size = m_Size;
|
619 |
|
620 |
// calculateRgb();
|
621 |
} |
622 |
|
623 |
/**
|
624 |
* Devuelve el tama?o del s?mbolo.
|
625 |
*
|
626 |
* @return Returns the m_Size.
|
627 |
*/
|
628 |
public int getSize() { |
629 |
return m_Size;
|
630 |
} |
631 |
|
632 |
/**
|
633 |
* Introduce la imagen que hace de icono.
|
634 |
*
|
635 |
* @param m_Icon The m_Icon to set.
|
636 |
*/
|
637 |
public void setIcon(Image m_Icon) { |
638 |
this.m_Icon = m_Icon;
|
639 |
|
640 |
// calculateRgb();
|
641 |
} |
642 |
|
643 |
/**
|
644 |
* Devuelve el icono.
|
645 |
*
|
646 |
* @return Returns the m_Icon.
|
647 |
*/
|
648 |
public Image getIcon() { |
649 |
return m_Icon;
|
650 |
} |
651 |
|
652 |
/**
|
653 |
* Introduce la rotaci?n.
|
654 |
*
|
655 |
* @param m_Rotation The m_Rotation to set.
|
656 |
*/
|
657 |
public void setRotation(int m_Rotation) { |
658 |
this.m_Rotation = m_Rotation;
|
659 |
|
660 |
// calculateRgb();
|
661 |
} |
662 |
|
663 |
/**
|
664 |
* Devuelve la rotaci?n.
|
665 |
*
|
666 |
* @return Returns the m_Rotation.
|
667 |
*/
|
668 |
public int getRotation() { |
669 |
return m_Rotation;
|
670 |
} |
671 |
|
672 |
/**
|
673 |
* Introduce el relleno.
|
674 |
*
|
675 |
* @param m_Fill The m_Fill to set.
|
676 |
*/
|
677 |
public void setFill(Paint m_Fill) { |
678 |
this.m_Fill = m_Fill;
|
679 |
|
680 |
// calculateRgb();
|
681 |
} |
682 |
|
683 |
/**
|
684 |
* Devuelve el relleno.
|
685 |
*
|
686 |
* @return Returns the m_Fill.
|
687 |
*/
|
688 |
public Paint getFill() { |
689 |
return m_Fill;
|
690 |
} |
691 |
|
692 |
/**
|
693 |
* Introduce el Stroke.
|
694 |
*
|
695 |
* @param m_Stroke The m_Stroke to set.
|
696 |
*/
|
697 |
public void setStroke(Stroke m_Stroke) { |
698 |
this.m_Stroke = m_Stroke;
|
699 |
|
700 |
// calculateRgb();
|
701 |
} |
702 |
|
703 |
/**
|
704 |
* Devuelve el Stroke.
|
705 |
*
|
706 |
* @return Returns the m_Stroke.
|
707 |
*/
|
708 |
public Stroke getStroke() { |
709 |
return m_Stroke;
|
710 |
} |
711 |
|
712 |
/**
|
713 |
* Introduce si el tama?o del simbolo est? en pixels.
|
714 |
*
|
715 |
* @param m_bUseSize The m_bUseSize to set.
|
716 |
*/
|
717 |
public void setSizeInPixels(boolean m_bUseSize) { |
718 |
this.m_bUseSize = m_bUseSize;
|
719 |
|
720 |
// calculateRgb();
|
721 |
} |
722 |
|
723 |
/**
|
724 |
* Devuelve si el tama?o del s?mbolo est? en pixels.
|
725 |
*
|
726 |
* @return Returns the m_bUseSize.
|
727 |
*/
|
728 |
public boolean isSizeInPixels() { |
729 |
return m_bUseSize;
|
730 |
} |
731 |
|
732 |
/**
|
733 |
* Introduce la descripci?n del s?mbolo.
|
734 |
*
|
735 |
* @param m_Descrip The m_Descrip to set.
|
736 |
*/
|
737 |
public void setDescription(String m_Descrip) { |
738 |
this.m_Descrip = m_Descrip;
|
739 |
} |
740 |
|
741 |
/**
|
742 |
* Devuelve la descripci?n del s?mbolo.
|
743 |
*
|
744 |
* @return Returns the m_Descrip.
|
745 |
*/
|
746 |
public String getDescription() { |
747 |
return m_Descrip;
|
748 |
} |
749 |
|
750 |
/**
|
751 |
* Introduce la alineaci?n en vertical.
|
752 |
*
|
753 |
* @param m_AlingVert The m_AlingVert to set.
|
754 |
*/
|
755 |
public void setAlingVert(int m_AlingVert) { |
756 |
this.m_AlingVert = m_AlingVert;
|
757 |
|
758 |
// calculateRgb();
|
759 |
} |
760 |
|
761 |
/**
|
762 |
* Devuelve la alineaci?n en vertical.
|
763 |
*
|
764 |
* @return Returns the m_AlingVert.
|
765 |
*/
|
766 |
public int getAlingVert() { |
767 |
return m_AlingVert;
|
768 |
} |
769 |
|
770 |
/**
|
771 |
* Introduce la alineaci?n en horizontal.
|
772 |
*
|
773 |
* @param m_AlingHoriz The m_AlingHoriz to set.
|
774 |
*/
|
775 |
public void setAlingHoriz(int m_AlingHoriz) { |
776 |
this.m_AlingHoriz = m_AlingHoriz;
|
777 |
|
778 |
// calculateRgb();
|
779 |
} |
780 |
|
781 |
/**
|
782 |
* Devuelve la alineaci?n en horizontal.
|
783 |
*
|
784 |
* @return Returns the m_AlingHoriz.
|
785 |
*/
|
786 |
public int getAlingHoriz() { |
787 |
return m_AlingHoriz;
|
788 |
} |
789 |
|
790 |
/**
|
791 |
* Devuelve el color que se aplica a los shapes seleccionados.
|
792 |
*
|
793 |
* @return DOCUMENT ME!
|
794 |
*/
|
795 |
public static Color getSelectionColor() { |
796 |
return selectionColor;
|
797 |
} |
798 |
|
799 |
/**
|
800 |
* Introduce el color que se aplica a los shapes seleccionados.
|
801 |
*
|
802 |
* @param selectionColor DOCUMENT ME!
|
803 |
*/
|
804 |
public static void setSelectionColor(Color selectionColor) { |
805 |
FSymbol.selectionColor = selectionColor; |
806 |
} |
807 |
|
808 |
/**
|
809 |
* Introduce el tama?o de la fuente.
|
810 |
*
|
811 |
* @param m_FontSize The m_FontSize to set.
|
812 |
*/
|
813 |
public void setFontSize(float m_FontSize) { |
814 |
this.m_FontSize = m_FontSize;
|
815 |
} |
816 |
|
817 |
/**
|
818 |
* Devuelve el tama?o de la fuente.
|
819 |
*
|
820 |
* @return Returns the m_FontSize.
|
821 |
*/
|
822 |
public float getFontSize() { |
823 |
return m_FontSize;
|
824 |
} |
825 |
} |