svn-gvsig-desktop / tags / v1_0_2_Build_896 / libraries / libFMap / src / com / iver / cit / gvsig / fmap / core / ISymbol.java @ 10391
History | View | Annotate | Download (4.17 KB)
1 | 7659 | fjp | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
||
4 | *
|
||
5 | * This program is free software; you can redistribute it and/or
|
||
6 | * modify it under the terms of the GNU General Public License
|
||
7 | * as published by the Free Software Foundation; either version 2
|
||
8 | * of the License, or (at your option) any later version.
|
||
9 | *
|
||
10 | * This program is distributed in the hope that it will be useful,
|
||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
13 | * GNU General Public License for more details.
|
||
14 | *
|
||
15 | * You should have received a copy of the GNU General Public License
|
||
16 | * along with this program; if not, write to the Free Software
|
||
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
18 | *
|
||
19 | * For more information, contact:
|
||
20 | *
|
||
21 | * Generalitat Valenciana
|
||
22 | * Conselleria d'Infraestructures i Transport
|
||
23 | * Av. Blasco Ib??ez, 50
|
||
24 | * 46010 VALENCIA
|
||
25 | * SPAIN
|
||
26 | *
|
||
27 | * +34 963862235
|
||
28 | * gvsig@gva.es
|
||
29 | * www.gvsig.gva.es
|
||
30 | *
|
||
31 | * or
|
||
32 | *
|
||
33 | * IVER T.I. S.A
|
||
34 | * Salamanca 50
|
||
35 | * 46005 Valencia
|
||
36 | * Spain
|
||
37 | *
|
||
38 | * +34 963163400
|
||
39 | * dac@iver.es
|
||
40 | */
|
||
41 | package com.iver.cit.gvsig.fmap.core; |
||
42 | |||
43 | import java.awt.Graphics2D; |
||
44 | 7679 | fjp | import java.awt.Rectangle; |
45 | 7659 | fjp | import java.awt.Shape; |
46 | import java.awt.geom.AffineTransform; |
||
47 | |||
48 | 9013 | caballero | import javax.print.attribute.PrintRequestAttributeSet; |
49 | |||
50 | 8309 | jaume | import com.iver.utiles.IPersistance; |
51 | 7659 | fjp | import com.iver.utiles.XMLEntity; |
52 | |||
53 | 8309 | jaume | public interface ISymbol extends IPersistance { |
54 | 8142 | jaume | public final static int CHARACTER_MARKER = 1; |
55 | 8458 | jaume | public final static int SIMPLE_FILL = 2; |
56 | public static final int MARKER_FILL = 3; |
||
57 | 7659 | fjp | ISymbol getSymbolForSelection(); |
58 | |||
59 | 8142 | jaume | void draw(Graphics2D g, AffineTransform affineTransform, FShape shp); |
60 | |||
61 | 7659 | fjp | // In the future, we may need something like that, but now if
|
62 | // I put it, we should change the rendering process, and it will
|
||
63 | // be slowly.
|
||
64 | // El problema es que antes de renderizar algo, tenemos que calcular
|
||
65 | // c?mo va a quedar en pantalla, para saber su bounding box real y si
|
||
66 | // hay que dibujarlo o no. Pasa con los textos, pero en general
|
||
67 | // con cualquier s?mbolo de tipo puntual, tambi?n. En menor medida con
|
||
68 | // l?neas y pol?gonos.
|
||
69 | 8142 | jaume | //
|
70 | 7659 | fjp | // IDEA!!!:
|
71 | // Para no depender de leer un shape y pedirle al s?mbolo que toca
|
||
72 | // el bounding box para ver si hay que dibujarlo, se puede hacer una
|
||
73 | // pasada previa por la leyenda y ver los pixels que a?ade al bounding
|
||
74 | // box. (Se coge un punto, una l?nea o un pol?gono, y se calcula
|
||
75 | 8142 | jaume | // su bounding box para esa escala. Si es mayor que el original del
|
76 | // shape, se calculan los pixels. Luego se pasan esos pixels a
|
||
77 | 7659 | fjp | // coordenadas de mundo real, y se le suman al visibleExtent para que
|
78 | // se dibujen los trozos de texto que no se pintan, etc, etc.
|
||
79 | int getPixExtentPlus(Graphics2D g, AffineTransform affineTransform, Shape shp); |
||
80 | /**
|
||
81 | * Devuelve el rgb del s?mbolo cuando se dibuja como un punto.
|
||
82 | *
|
||
83 | * @return rgb del s?mbolo.
|
||
84 | */
|
||
85 | public int getOnePointRgb(); |
||
86 | |||
87 | /**
|
||
88 | * Use it to specify how do you want to write the symbol in .gvp project
|
||
89 | * @return
|
||
90 | */
|
||
91 | XMLEntity getXMLEntity(); |
||
92 | |||
93 | 7662 | fjp | /**
|
94 | 8516 | jaume | * The description is a human-readable text used to
|
95 | 7662 | fjp | * @return description of this symbol.
|
96 | */
|
||
97 | 7659 | fjp | String getDescription();
|
98 | |||
99 | 7662 | fjp | /**
|
100 | 8516 | jaume | * Tells whether the shape of the symbol will be drawn or not.
|
101 | *
|
||
102 | * @return <b>true</b> if Shape must be drawn. Useful if you are labelling
|
||
103 | 7662 | fjp | */
|
104 | 7659 | fjp | boolean isShapeVisible();
|
105 | |||
106 | void setDescription(String string); |
||
107 | |||
108 | 7662 | fjp | /**
|
109 | * @return FSymbol constants. I think it is better to use isSuitableFor
|
||
110 | */
|
||
111 | 7659 | fjp | int getSymbolType();
|
112 | 8142 | jaume | |
113 | 7662 | fjp | /**
|
114 | * True if this symbol is ok for the geometry. For example, a FillSymbol will
|
||
115 | * be suitable for a Polygon.
|
||
116 | * @param geom
|
||
117 | * @return
|
||
118 | */
|
||
119 | boolean isSuitableFor(IGeometry geom);
|
||
120 | 7659 | fjp | |
121 | 7679 | fjp | /**
|
122 | 8588 | jaume | * Useful to render the symbol inside the TOC, or inside little
|
123 | 7679 | fjp | * rectangles. For example, think about rendering a Label with size
|
124 | * in meters => You will need to specify a size in pixels.
|
||
125 | * Of course, you can also to choose to render a prepared image, etc.
|
||
126 | * @param g2
|
||
127 | * @param scaleInstance
|
||
128 | * @param r
|
||
129 | */
|
||
130 | 8142 | jaume | void drawInsideRectangle(Graphics2D g, AffineTransform scaleInstance, Rectangle r); |
131 | 7659 | fjp | |
132 | 9013 | caballero | void setPrintingProperties(PrintRequestAttributeSet printProperties); |
133 | 7679 | fjp | |
134 | 9013 | caballero | |
135 | 7659 | fjp | } |
136 |