root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / core / v02 / FSymbol.java @ 1100
History | View | Annotate | Download (18 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 |
selecSymbol.rgb = getSelectionColor().getRGB(); |
158 |
|
159 |
return selecSymbol;
|
160 |
} |
161 |
|
162 |
/**
|
163 |
* Clona el s?mbolo actual.
|
164 |
*
|
165 |
* @return Nuevo s?mbolo clonado.
|
166 |
*/
|
167 |
public FSymbol cloneSymbol() {
|
168 |
return createFromXML(getXMLEntity());
|
169 |
} |
170 |
|
171 |
/**
|
172 |
* Se usa para el s?mbolo de selecci?n. Es una forma
|
173 |
* r?pida de clonar un s?mbolo, sin hacerlo via XML.
|
174 |
* Vicente, no lo borres!!!
|
175 |
* @return
|
176 |
*/
|
177 |
public FSymbol fastCloneSymbol()
|
178 |
{ |
179 |
FSymbol nS = new FSymbol();
|
180 |
|
181 |
|
182 |
nS.m_symbolType = m_symbolType; |
183 |
nS.m_Style = m_Style; |
184 |
nS.m_useOutline = m_useOutline; |
185 |
nS.m_Color = m_Color; |
186 |
nS.m_outlineColor = m_outlineColor; |
187 |
nS.m_Font = m_Font; |
188 |
nS.m_FontColor = m_FontColor; |
189 |
nS.m_FontSize = m_FontSize; |
190 |
nS.m_bUseFontSizeInPixels = m_bUseFontSizeInPixels; |
191 |
nS.m_bDrawShape = m_bDrawShape; |
192 |
nS.m_Size = m_Size; |
193 |
nS.m_Icon = m_Icon; |
194 |
nS.m_Rotation = m_Rotation; |
195 |
nS.m_Fill = m_Fill; |
196 |
nS.m_Stroke = m_Stroke; |
197 |
// nS.m_Transparency =m_Transparency ;
|
198 |
nS.m_bUseSize = m_bUseSize; |
199 |
nS.m_AlingVert = m_AlingVert; |
200 |
nS.m_AlingHoriz = m_AlingHoriz; |
201 |
nS.m_Descrip = m_Descrip; |
202 |
nS.m_BackColor = m_BackColor; |
203 |
nS.m_BackFill = m_BackFill; |
204 |
|
205 |
nS.m_LinePattern = m_LinePattern; |
206 |
|
207 |
return nS;
|
208 |
} |
209 |
|
210 |
|
211 |
/**
|
212 |
* Crea un s?mbolo a partir del tipo y el color.
|
213 |
*
|
214 |
* @param tipoSymbol Tipo de s?mbolo.
|
215 |
* @param c Color del s?mbolo a crear.
|
216 |
*/
|
217 |
private void createSymbol(int tipoSymbol, Color c) { |
218 |
// OJO: HE HECHO COINCIDIR LOS TIPOS DE SIMBOLO
|
219 |
//FConstant.SYMBOL_TYPE_POINT, LINE Y FILL CON
|
220 |
// FShape.POINT, LINE, POLYGON. EL .MULTI SE REFIERE
|
221 |
// A MULTIPLES TIPO DENTRO DEL SHAPE, AS? QUE SER? UN
|
222 |
// MULTISIMBOLO
|
223 |
// Tipo de simbolo
|
224 |
m_symbolType = tipoSymbol; // Para no recalcular el pixel, no usamos los set
|
225 |
|
226 |
// Ponemos un estilo por defecto
|
227 |
m_useOutline = true;
|
228 |
m_Color = c; |
229 |
m_Stroke = null;
|
230 |
m_Fill = null;
|
231 |
|
232 |
m_FontColor = Color.BLACK;
|
233 |
m_FontSize = 10;
|
234 |
m_bUseFontSizeInPixels = true;
|
235 |
|
236 |
m_Size = 0;
|
237 |
|
238 |
switch (getSymbolType()) {
|
239 |
case FConstant.SYMBOL_TYPE_POINT:
|
240 |
case FConstant.SYMBOL_TYPE_POINTZ:
|
241 |
case FConstant.SYMBOL_TYPE_MULTIPOINT:
|
242 |
m_bUseSize = true; // Esto es lo primero que hay que hacer siempre |
243 |
|
244 |
// para evitar un StackOverflow
|
245 |
m_useOutline = false;
|
246 |
setStyle(FConstant.SYMBOL_STYLE_MARKER_SQUARE); |
247 |
setSize(5); //pixels |
248 |
|
249 |
break;
|
250 |
|
251 |
case FConstant.SYMBOL_TYPE_LINE:
|
252 |
case FConstant.SYMBOL_TYPE_POLYLINEZ:
|
253 |
case FConstant.SYMBOL_TYPE_POLYGONZ:
|
254 |
setStroke(new BasicStroke()); |
255 |
setStyle(FConstant.SYMBOL_STYLE_LINE_SOLID); |
256 |
|
257 |
break;
|
258 |
|
259 |
case FConstant.SYMBOL_TYPE_FILL:
|
260 |
case FShape.MULTI:
|
261 |
setStyle(FConstant.SYMBOL_STYLE_FILL_SOLID); |
262 |
|
263 |
break;
|
264 |
} |
265 |
|
266 |
m_outlineColor = c.darker(); |
267 |
|
268 |
calculateRgb(); |
269 |
} |
270 |
|
271 |
/**
|
272 |
* Calcula el RGB del s?mbolo.
|
273 |
*/
|
274 |
public void calculateRgb() { |
275 |
// Recalculamos el RGB
|
276 |
Graphics2D g2 = img.createGraphics();
|
277 |
|
278 |
FGraphicUtilities.DrawSymbol(g2, g2.getTransform(), rect, this);
|
279 |
rgb = img.getRGB(0, 0); |
280 |
} |
281 |
|
282 |
/**
|
283 |
* Devuelve el rgb del s?mbolo.
|
284 |
*
|
285 |
* @return rgb del s?mbolo.
|
286 |
*/
|
287 |
public int getRgb() { |
288 |
return rgb;
|
289 |
} |
290 |
|
291 |
/**
|
292 |
* @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getXMLEntity()
|
293 |
*/
|
294 |
public XMLEntity getXMLEntity() {
|
295 |
XMLEntity xml = new XMLEntity();
|
296 |
xml.putProperty("className",this.getClass().getName()); |
297 |
xml.putProperty("m_symbolType", getSymbolType());
|
298 |
xml.putProperty("m_Style", getStyle());
|
299 |
xml.putProperty("m_useOutline", isOutlined());
|
300 |
|
301 |
if (getColor() != null) { |
302 |
xml.putProperty("m_Color", StringUtilities.color2String(getColor()));
|
303 |
} |
304 |
|
305 |
if (getOutlineColor() != null) { |
306 |
xml.putProperty("m_outlineColor",
|
307 |
StringUtilities.color2String(getOutlineColor())); |
308 |
} |
309 |
|
310 |
if (getFont() != null) { |
311 |
xml.putProperty("fontname", getFont().getName());
|
312 |
xml.putProperty("fontstyle", getFont().getStyle());
|
313 |
xml.putProperty("m_FontSize", getFontSize());
|
314 |
xml.putProperty("m_FontColor",
|
315 |
StringUtilities.color2String(getFontColor())); |
316 |
} |
317 |
|
318 |
xml.putProperty("m_bUseFontSize", isFontSizeInPixels());
|
319 |
xml.putProperty("m_bDrawShape", isShapeVisible());
|
320 |
xml.putProperty("m_Size", getSize());
|
321 |
|
322 |
//xml.putProperty("m_Icon",m_Icon.);
|
323 |
xml.putProperty("m_Rotation", getRotation());
|
324 |
|
325 |
if (getFill() instanceof Color) { |
326 |
xml.putProperty("m_Fill",
|
327 |
StringUtilities.color2String((Color) getFill()));
|
328 |
} |
329 |
|
330 |
xml.putProperty("m_LinePattern", m_LinePattern);
|
331 |
|
332 |
//Ancho del stroke en float
|
333 |
if (getStroke() != null) { |
334 |
xml.putProperty("m_stroke",
|
335 |
((BasicStroke) getStroke()).getLineWidth());
|
336 |
} else {
|
337 |
xml.putProperty("m_stroke", 0f); |
338 |
} |
339 |
|
340 |
xml.putProperty("m_bUseSize", isSizeInPixels());
|
341 |
xml.putProperty("m_AlingVert", getAlingVert());
|
342 |
xml.putProperty("m_AlingHoriz", getAlingHoriz());
|
343 |
xml.putProperty("m_Descrip", getDescription());
|
344 |
|
345 |
if (m_BackColor != null) { |
346 |
xml.putProperty("m_BackColor",
|
347 |
StringUtilities.color2String(m_BackColor)); |
348 |
} |
349 |
|
350 |
if (m_BackFill instanceof Color) { |
351 |
xml.putProperty("m_BackFill",
|
352 |
StringUtilities.color2String((Color) m_BackFill));
|
353 |
} |
354 |
|
355 |
xml.putProperty("rgb", rgb);
|
356 |
|
357 |
return xml;
|
358 |
} |
359 |
|
360 |
/**
|
361 |
* Crea el s?mbolo a partir del xml.
|
362 |
*
|
363 |
* @param xml xml que contiene la informaci?n para crear el s?mbolo.
|
364 |
*
|
365 |
* @return S?mbolo creado a partir del XML.
|
366 |
*/
|
367 |
public static FSymbol createFromXML(XMLEntity xml) { |
368 |
FSymbol symbol = new FSymbol();
|
369 |
symbol.setSymbolType(xml.getIntProperty("m_symbolType"));
|
370 |
symbol.setStyle(xml.getIntProperty("m_Style"));
|
371 |
symbol.setOutlined(xml.getBooleanProperty("m_useOutline"));
|
372 |
|
373 |
if (xml.contains("m_Color")) { |
374 |
symbol.setColor(StringUtilities.string2Color(xml.getStringProperty( |
375 |
"m_Color")));
|
376 |
} |
377 |
|
378 |
if (xml.contains("m_outlineColor")) { |
379 |
symbol.setOutlineColor(StringUtilities.string2Color( |
380 |
xml.getStringProperty("m_outlineColor")));
|
381 |
} |
382 |
|
383 |
if (xml.contains("m_FontColor")) { |
384 |
symbol.setFont(new Font(xml.getStringProperty("fontname"), |
385 |
xml.getIntProperty("fontstyle"),
|
386 |
(int) xml.getFloatProperty("m_FontSize"))); |
387 |
symbol.setFontColor(StringUtilities.string2Color( |
388 |
xml.getStringProperty("m_FontColor")));
|
389 |
symbol.setFontSize(xml.getFloatProperty("m_FontSize"));
|
390 |
} |
391 |
|
392 |
symbol.setFontSizeInPixels(xml.getBooleanProperty("m_bUseFontSize"));
|
393 |
symbol.setShapeVisible(xml.getBooleanProperty("m_bDrawShape"));
|
394 |
symbol.setSize(xml.getIntProperty("m_Size"));
|
395 |
|
396 |
//xml.putProperty("m_Icon",m_Icon.);
|
397 |
symbol.setRotation(xml.getIntProperty("m_Rotation"));
|
398 |
|
399 |
if (xml.contains("m_Fill")) { |
400 |
symbol.setFill(StringUtilities.string2Color(xml.getStringProperty( |
401 |
"m_Fill")));
|
402 |
} |
403 |
|
404 |
symbol.m_LinePattern = xml.getStringProperty("m_LinePattern");
|
405 |
|
406 |
//Ancho del stroke en float
|
407 |
symbol.setStroke(new BasicStroke(xml.getFloatProperty("m_stroke"))); |
408 |
symbol.setSizeInPixels(xml.getBooleanProperty("m_bUseSize"));
|
409 |
symbol.setAlingVert(xml.getIntProperty("m_AlingVert"));
|
410 |
symbol.setAlingHoriz(xml.getIntProperty("m_AlingHoriz"));
|
411 |
symbol.setDescription(xml.getStringProperty("m_Descrip"));
|
412 |
|
413 |
if (xml.contains("m_BackColor")) { |
414 |
symbol.m_BackColor = StringUtilities.string2Color(xml.getStringProperty( |
415 |
"m_BackColor"));
|
416 |
} |
417 |
|
418 |
if (xml.contains("m_BackFill")) { |
419 |
symbol.m_BackFill = StringUtilities.string2Color(xml.getStringProperty( |
420 |
"m_BackFill"));
|
421 |
} |
422 |
|
423 |
symbol.rgb = xml.getIntProperty("rgb");
|
424 |
|
425 |
return symbol;
|
426 |
} |
427 |
|
428 |
/**
|
429 |
* Introduce el estilo del s?mbolo.
|
430 |
*
|
431 |
* @param m_Style The m_Style to set.
|
432 |
*/
|
433 |
public void setStyle(int m_Style) { |
434 |
this.m_Style = m_Style;
|
435 |
|
436 |
// calculateRgb();
|
437 |
} |
438 |
|
439 |
/**
|
440 |
* Devuelve el estilo del s?mbolo.
|
441 |
*
|
442 |
* @return Returns the m_Style.
|
443 |
*/
|
444 |
public int getStyle() { |
445 |
return m_Style;
|
446 |
} |
447 |
|
448 |
/**
|
449 |
* Introduce el tipo de s?mbolo.
|
450 |
*
|
451 |
* @param m_symbolType The m_symbolType to set.
|
452 |
*/
|
453 |
public void setSymbolType(int m_symbolType) { |
454 |
this.m_symbolType = m_symbolType;
|
455 |
} |
456 |
|
457 |
/**
|
458 |
* Devuelve el tipo de s?mbolo.
|
459 |
*
|
460 |
* @return Returns the m_symbolType.
|
461 |
*/
|
462 |
public int getSymbolType() { |
463 |
return m_symbolType;
|
464 |
} |
465 |
|
466 |
/**
|
467 |
* Introduce si el s?mbolo contiene linea de brode o no.
|
468 |
*
|
469 |
* @param m_useOutline The m_useOutline to set.
|
470 |
*/
|
471 |
public void setOutlined(boolean m_useOutline) { |
472 |
this.m_useOutline = m_useOutline;
|
473 |
|
474 |
// calculateRgb();
|
475 |
} |
476 |
|
477 |
/**
|
478 |
* Devuelve si el s?mbolo contiene o no linea de borde.
|
479 |
*
|
480 |
* @return Returns the m_useOutline.
|
481 |
*/
|
482 |
public boolean isOutlined() { |
483 |
return m_useOutline;
|
484 |
} |
485 |
|
486 |
/**
|
487 |
* Introduce el color del s?mbolo.
|
488 |
*
|
489 |
* @param m_Color The m_Color to set.
|
490 |
*/
|
491 |
public void setColor(Color m_Color) { |
492 |
this.m_Color = m_Color;
|
493 |
|
494 |
// calculateRgb();
|
495 |
} |
496 |
|
497 |
/**
|
498 |
* Devuelve el color del s?mbolo.
|
499 |
*
|
500 |
* @return Returns the m_Color.
|
501 |
*/
|
502 |
public Color getColor() { |
503 |
return m_Color;
|
504 |
} |
505 |
|
506 |
/**
|
507 |
* Introduce el color de la l?nea de borde.
|
508 |
*
|
509 |
* @param m_outlineColor The m_outlineColor to set.
|
510 |
*/
|
511 |
public void setOutlineColor(Color m_outlineColor) { |
512 |
this.m_outlineColor = m_outlineColor;
|
513 |
|
514 |
// calculateRgb();
|
515 |
} |
516 |
|
517 |
/**
|
518 |
* Devuelve el color de la l?nea de borde.
|
519 |
*
|
520 |
* @return Returns the m_outlineColor.
|
521 |
*/
|
522 |
public Color getOutlineColor() { |
523 |
return m_outlineColor;
|
524 |
} |
525 |
|
526 |
/**
|
527 |
* Introduce el Font del s?mbolo.
|
528 |
*
|
529 |
* @param m_Font The m_Font to set.
|
530 |
*/
|
531 |
public void setFont(Font m_Font) { |
532 |
this.m_Font = m_Font;
|
533 |
|
534 |
// calculateRgb();
|
535 |
} |
536 |
|
537 |
/**
|
538 |
* Devuelve el Font del s?mbolo.
|
539 |
*
|
540 |
* @return Returns the m_Font.
|
541 |
*/
|
542 |
public Font getFont() { |
543 |
return m_Font;
|
544 |
} |
545 |
|
546 |
/**
|
547 |
* Introduce el color de la fuente.
|
548 |
*
|
549 |
* @param m_FontColor The m_FontColor to set.
|
550 |
*/
|
551 |
public void setFontColor(Color m_FontColor) { |
552 |
this.m_FontColor = m_FontColor;
|
553 |
|
554 |
// calculateRgb();
|
555 |
} |
556 |
|
557 |
/**
|
558 |
* Devuelve el color de la fuente.
|
559 |
*
|
560 |
* @return Returns the m_FontColor.
|
561 |
*/
|
562 |
public Color getFontColor() { |
563 |
return m_FontColor;
|
564 |
} |
565 |
|
566 |
/**
|
567 |
* Introduce si se usa el tama?o de la fuente en pixels.
|
568 |
*
|
569 |
* @param m_bUseFontSize The m_bUseFontSize to set.
|
570 |
*/
|
571 |
public void setFontSizeInPixels(boolean m_bUseFontSize) { |
572 |
this.m_bUseFontSizeInPixels = m_bUseFontSize;
|
573 |
|
574 |
// calculateRgb();
|
575 |
} |
576 |
|
577 |
/**
|
578 |
* Devuelve true si el tama?o de la fuente esta seleccionado en pixels.
|
579 |
*
|
580 |
* @return Returns the m_bUseFontSize.
|
581 |
*/
|
582 |
public boolean isFontSizeInPixels() { |
583 |
return m_bUseFontSizeInPixels;
|
584 |
} |
585 |
|
586 |
/**
|
587 |
* Introduce si el shape e visible o no lo es.
|
588 |
*
|
589 |
* @param m_bDrawShape The m_bDrawShape to set.
|
590 |
*/
|
591 |
public void setShapeVisible(boolean m_bDrawShape) { |
592 |
this.m_bDrawShape = m_bDrawShape;
|
593 |
|
594 |
// calculateRgb();
|
595 |
} |
596 |
|
597 |
/**
|
598 |
* Devuelve true si el shape es visible.
|
599 |
*
|
600 |
* @return Returns the m_bDrawShape.
|
601 |
*/
|
602 |
public boolean isShapeVisible() { |
603 |
return m_bDrawShape;
|
604 |
} |
605 |
|
606 |
/**
|
607 |
* Introduce el tama?o del s?mbolo.
|
608 |
*
|
609 |
* @param m_Size The m_Size to set.
|
610 |
*/
|
611 |
public void setSize(int m_Size) { |
612 |
this.m_Size = m_Size;
|
613 |
|
614 |
// calculateRgb();
|
615 |
} |
616 |
|
617 |
/**
|
618 |
* Devuelve el tama?o del s?mbolo.
|
619 |
*
|
620 |
* @return Returns the m_Size.
|
621 |
*/
|
622 |
public int getSize() { |
623 |
return m_Size;
|
624 |
} |
625 |
|
626 |
/**
|
627 |
* Introduce la imagen que hace de icono.
|
628 |
*
|
629 |
* @param m_Icon The m_Icon to set.
|
630 |
*/
|
631 |
public void setIcon(Image m_Icon) { |
632 |
this.m_Icon = m_Icon;
|
633 |
|
634 |
// calculateRgb();
|
635 |
} |
636 |
|
637 |
/**
|
638 |
* Devuelve el icono.
|
639 |
*
|
640 |
* @return Returns the m_Icon.
|
641 |
*/
|
642 |
public Image getIcon() { |
643 |
return m_Icon;
|
644 |
} |
645 |
|
646 |
/**
|
647 |
* Introduce la rotaci?n.
|
648 |
*
|
649 |
* @param m_Rotation The m_Rotation to set.
|
650 |
*/
|
651 |
public void setRotation(int m_Rotation) { |
652 |
this.m_Rotation = m_Rotation;
|
653 |
|
654 |
// calculateRgb();
|
655 |
} |
656 |
|
657 |
/**
|
658 |
* Devuelve la rotaci?n.
|
659 |
*
|
660 |
* @return Returns the m_Rotation.
|
661 |
*/
|
662 |
public int getRotation() { |
663 |
return m_Rotation;
|
664 |
} |
665 |
|
666 |
/**
|
667 |
* Introduce el relleno.
|
668 |
*
|
669 |
* @param m_Fill The m_Fill to set.
|
670 |
*/
|
671 |
public void setFill(Paint m_Fill) { |
672 |
this.m_Fill = m_Fill;
|
673 |
|
674 |
// calculateRgb();
|
675 |
} |
676 |
|
677 |
/**
|
678 |
* Devuelve el relleno.
|
679 |
*
|
680 |
* @return Returns the m_Fill.
|
681 |
*/
|
682 |
public Paint getFill() { |
683 |
return m_Fill;
|
684 |
} |
685 |
|
686 |
/**
|
687 |
* Introduce el Stroke.
|
688 |
*
|
689 |
* @param m_Stroke The m_Stroke to set.
|
690 |
*/
|
691 |
public void setStroke(Stroke m_Stroke) { |
692 |
this.m_Stroke = m_Stroke;
|
693 |
|
694 |
// calculateRgb();
|
695 |
} |
696 |
|
697 |
/**
|
698 |
* Devuelve el Stroke.
|
699 |
*
|
700 |
* @return Returns the m_Stroke.
|
701 |
*/
|
702 |
public Stroke getStroke() { |
703 |
return m_Stroke;
|
704 |
} |
705 |
|
706 |
/**
|
707 |
* Introduce si el tama?o del simbolo est? en pixels.
|
708 |
*
|
709 |
* @param m_bUseSize The m_bUseSize to set.
|
710 |
*/
|
711 |
public void setSizeInPixels(boolean m_bUseSize) { |
712 |
this.m_bUseSize = m_bUseSize;
|
713 |
|
714 |
// calculateRgb();
|
715 |
} |
716 |
|
717 |
/**
|
718 |
* Devuelve si el tama?o del s?mbolo est? en pixels.
|
719 |
*
|
720 |
* @return Returns the m_bUseSize.
|
721 |
*/
|
722 |
public boolean isSizeInPixels() { |
723 |
return m_bUseSize;
|
724 |
} |
725 |
|
726 |
/**
|
727 |
* Introduce la descripci?n del s?mbolo.
|
728 |
*
|
729 |
* @param m_Descrip The m_Descrip to set.
|
730 |
*/
|
731 |
public void setDescription(String m_Descrip) { |
732 |
this.m_Descrip = m_Descrip;
|
733 |
} |
734 |
|
735 |
/**
|
736 |
* Devuelve la descripci?n del s?mbolo.
|
737 |
*
|
738 |
* @return Returns the m_Descrip.
|
739 |
*/
|
740 |
public String getDescription() { |
741 |
return m_Descrip;
|
742 |
} |
743 |
|
744 |
/**
|
745 |
* Introduce la alineaci?n en vertical.
|
746 |
*
|
747 |
* @param m_AlingVert The m_AlingVert to set.
|
748 |
*/
|
749 |
public void setAlingVert(int m_AlingVert) { |
750 |
this.m_AlingVert = m_AlingVert;
|
751 |
|
752 |
// calculateRgb();
|
753 |
} |
754 |
|
755 |
/**
|
756 |
* Devuelve la alineaci?n en vertical.
|
757 |
*
|
758 |
* @return Returns the m_AlingVert.
|
759 |
*/
|
760 |
public int getAlingVert() { |
761 |
return m_AlingVert;
|
762 |
} |
763 |
|
764 |
/**
|
765 |
* Introduce la alineaci?n en horizontal.
|
766 |
*
|
767 |
* @param m_AlingHoriz The m_AlingHoriz to set.
|
768 |
*/
|
769 |
public void setAlingHoriz(int m_AlingHoriz) { |
770 |
this.m_AlingHoriz = m_AlingHoriz;
|
771 |
|
772 |
// calculateRgb();
|
773 |
} |
774 |
|
775 |
/**
|
776 |
* Devuelve la alineaci?n en horizontal.
|
777 |
*
|
778 |
* @return Returns the m_AlingHoriz.
|
779 |
*/
|
780 |
public int getAlingHoriz() { |
781 |
return m_AlingHoriz;
|
782 |
} |
783 |
|
784 |
/**
|
785 |
* Devuelve el color que se aplica a los shapes seleccionados.
|
786 |
*
|
787 |
* @return DOCUMENT ME!
|
788 |
*/
|
789 |
public static Color getSelectionColor() { |
790 |
return selectionColor;
|
791 |
} |
792 |
|
793 |
/**
|
794 |
* Introduce el color que se aplica a los shapes seleccionados.
|
795 |
*
|
796 |
* @param selectionColor DOCUMENT ME!
|
797 |
*/
|
798 |
public static void setSelectionColor(Color selectionColor) { |
799 |
FSymbol.selectionColor = selectionColor; |
800 |
} |
801 |
|
802 |
/**
|
803 |
* Introduce el tama?o de la fuente.
|
804 |
*
|
805 |
* @param m_FontSize The m_FontSize to set.
|
806 |
*/
|
807 |
public void setFontSize(float m_FontSize) { |
808 |
this.m_FontSize = m_FontSize;
|
809 |
} |
810 |
|
811 |
/**
|
812 |
* Devuelve el tama?o de la fuente.
|
813 |
*
|
814 |
* @return Returns the m_FontSize.
|
815 |
*/
|
816 |
public float getFontSize() { |
817 |
return m_FontSize;
|
818 |
} |
819 |
} |