Revision 18621 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/symbols/ISymbol.java
ISymbol.java | ||
---|---|---|
43 | 43 |
import java.awt.Color; |
44 | 44 |
import java.awt.Graphics2D; |
45 | 45 |
import java.awt.Rectangle; |
46 |
import java.awt.Shape; |
|
47 | 46 |
import java.awt.geom.AffineTransform; |
48 | 47 |
|
48 |
import com.iver.cit.gvsig.fmap.ViewPort; |
|
49 | 49 |
import com.iver.cit.gvsig.fmap.core.FShape; |
50 | 50 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
51 | 51 |
import com.iver.cit.gvsig.fmap.core.IPrintable; |
... | ... | |
64 | 64 |
* |
65 | 65 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
66 | 66 |
*/ |
67 |
public interface ISymbol extends IPersistence, IPrintable{ |
|
67 |
public interface ISymbol extends IPersistence, IPrintable {
|
|
68 | 68 |
public static Color SELECTION_COLOR = Color.YELLOW; |
69 | 69 |
|
70 | 70 |
/** |
... | ... | |
84 | 84 |
*/ |
85 | 85 |
public void draw(Graphics2D g, AffineTransform affineTransform, FShape shp, Cancellable cancel); |
86 | 86 |
|
87 |
// In the future, we may need something like that, but now if |
|
88 |
// I put it, we should change the rendering process, and it will |
|
89 |
// be slowly. |
|
90 |
// El problema es que antes de renderizar algo, tenemos que calcular |
|
91 |
// c�mo va a quedar en pantalla, para saber su bounding box real y si |
|
92 |
// hay que dibujarlo o no. Pasa con los textos, pero en general |
|
93 |
// con cualquier s�mbolo de tipo puntual, tambi�n. En menor medida con |
|
94 |
// l�neas y pol�gonos. |
|
95 |
// |
|
96 |
// IDEA!!!: |
|
97 |
// Para no depender de leer un shape y pedirle al s�mbolo que toca |
|
98 |
// el bounding box para ver si hay que dibujarlo, se puede hacer una |
|
99 |
// pasada previa por la leyenda y ver los pixels que a�ade al bounding |
|
100 |
// box. (Se coge un punto, una l�nea o un pol�gono, y se calcula |
|
101 |
// su bounding box para esa escala. Si es mayor que el original del |
|
102 |
// shape, se calculan los pixels. Luego se pasan esos pixels a |
|
103 |
// coordenadas de mundo real, y se le suman al visibleExtent para que |
|
104 |
// se dibujen los trozos de texto que no se pintan, etc, etc. |
|
105 |
|
|
106 |
|
|
107 |
public int getPixExtentPlus(Graphics2D g, AffineTransform affineTransform, Shape shp); |
|
108 | 87 |
/** |
88 |
* <p> |
|
89 |
* Returns <b>the distance between the shape's bounding box and the |
|
90 |
* symbol-that-represents-this-shape's bounding box</b> in a two-length-float |
|
91 |
* array passed as parameter.<br> |
|
92 |
* </p> |
|
93 |
* <p> |
|
94 |
* After this method returns, the float array passed will contain two values |
|
95 |
* representing <b>the amount of pixels</b> separating each of the X (first element) |
|
96 |
* and Y (second element) axes.<br> |
|
97 |
* </p> |
|
98 |
* <p> |
|
99 |
* This distance maybe dependent on: |
|
100 |
* <ol> |
|
101 |
* <li> |
|
102 |
* <b>The ViewPort</b>: if the symbol is an instance of CartographicSupport |
|
103 |
* the units it uses are not pixels and the reference system is |
|
104 |
* CarthographicSupport.WORLD. |
|
105 |
* </li> |
|
106 |
* <li> |
|
107 |
* <b>The target rendering context's dpi (dots-per-inch)</b>: if the symbol |
|
108 |
* is an instance of CartographicSupport the units it uses are not pixels and |
|
109 |
* CarthographicSupport.PAPER. |
|
110 |
* </li> |
|
111 |
* </ol> |
|
112 |
* <br> |
|
113 |
* </p> |
|
114 |
* <p> |
|
115 |
* And in any other case, if the unit of the symbol is pixels or the symbol is not |
|
116 |
* even an instance of CartographicSupport, the returning values are only |
|
117 |
* defined by the symbol and are not calculated. |
|
118 |
* </p> |
|
119 |
* @param ViewPort viewPort |
|
120 |
* @param Shape shp |
|
121 |
* @param int dpi |
|
122 |
* @param float[] distances, the array of floats where to store the distances in x and y axis |
|
123 |
*/ |
|
124 |
public void getPixExtentPlus(FShape shp, float[] distances, ViewPort viewPort, int dpi); |
|
125 |
|
|
126 |
/** |
|
109 | 127 |
* Returns the rgb of the symbol when it is drawn like a point. |
110 | 128 |
* |
111 | 129 |
* @return rgb of the symbol. |
... | ... | |
173 | 191 |
* @param g2 |
174 | 192 |
* @param scaleInstance |
175 | 193 |
* @param r |
194 |
* @throws SymbolDrawingException TODO |
|
176 | 195 |
*/ |
177 |
public void drawInsideRectangle(Graphics2D g, AffineTransform scaleInstance, Rectangle r); |
|
196 |
public void drawInsideRectangle(Graphics2D g, AffineTransform scaleInstance, Rectangle r) throws SymbolDrawingException;
|
|
178 | 197 |
|
179 | 198 |
} |
180 | 199 |
|
Also available in: Unified diff