Revision 20100 branches/v10/libraries/libFMap/src/com/iver/cit/gvsig/fmap/rendering/FGraphic.java
FGraphic.java | ||
---|---|---|
50 | 50 |
import com.iver.cit.gvsig.fmap.core.ISymbol; |
51 | 51 |
|
52 | 52 |
/** |
53 |
* <p>The class <code>FGraphic</code> defines a graphic symbol according to the <i>FMap philosophy</i>.</p>
|
|
53 |
* <p><code>FGraphic</code> defines a graphic symbol.</p>
|
|
54 | 54 |
* |
55 |
* <p>This symbol represents a drawingable geometry with an identifier, and can optionally have attached a tag
|
|
56 |
* that can be text or an object.</p>
|
|
55 |
* <p>That symbol represents a geometry capable to be painted, with an identifier, and can, optionally,
|
|
56 |
* have attached a tag that can be a text or an object.</p>
|
|
57 | 57 |
*/ |
58 | 58 |
public class FGraphic { |
59 | 59 |
/** |
60 |
* Identifies this graphic symbol.
|
|
60 |
* <p>Identifies this graphic symbol.</p>
|
|
61 | 61 |
* |
62 | 62 |
* @see #getIdSymbol() |
63 | 63 |
* @see #setIdSymbol(int) |
... | ... | |
65 | 65 |
int idSymbol; |
66 | 66 |
|
67 | 67 |
/** |
68 |
* Geometry of this graphic symbol.
|
|
68 |
* <p>Geometry of this graphic symbol.</p>
|
|
69 | 69 |
* |
70 | 70 |
* @see #getGeom() |
71 | 71 |
* @see #setGeom(IGeometry) |
... | ... | |
73 | 73 |
IGeometry geom; |
74 | 74 |
|
75 | 75 |
/** |
76 |
* Optional text associated to this graphic symbol as a tag.
|
|
76 |
* <p>Optional text associated to this graphic symbol as a tag.</p>
|
|
77 | 77 |
* |
78 | 78 |
* @see #getTag() |
79 | 79 |
* @see #setTag(String) |
... | ... | |
81 | 81 |
String tag; |
82 | 82 |
|
83 | 83 |
/** |
84 |
* Optional object <i>(example: an icon)</i> associated to this graphic symbol as a tag.
|
|
84 |
* <p>Optional object <i>(example: an icon)</i> associated to this graphic symbol as a tag.</p>
|
|
85 | 85 |
* |
86 | 86 |
* @see #getObjectTag() |
87 | 87 |
* @see #setObjectTag(Object) |
... | ... | |
89 | 89 |
Object objectTag; |
90 | 90 |
|
91 | 91 |
/** |
92 |
* <p>Creates a graphic object according to the <i>FMap philosophy</i>, from a geometry and an identifier.</p>
|
|
92 |
* <p>Creates a <code>geom</code> type <code>FGraphic</code> instance, identified by <code>idSymbol</code>.</p>
|
|
93 | 93 |
* |
94 | 94 |
* @param geom the geometry that this symbol will represent |
95 |
* @param idSymbol the identifier
|
|
95 |
* @param idSymbol this geometry identifier
|
|
96 | 96 |
*/ |
97 | 97 |
public FGraphic(IGeometry geom, int idSymbol) |
98 | 98 |
{ |
... | ... | |
101 | 101 |
} |
102 | 102 |
|
103 | 103 |
/** |
104 |
* Gets the text tag associated to this symbol.
|
|
104 |
* <p>Gets the text tag associated to this symbol.</p>
|
|
105 | 105 |
* |
106 | 106 |
* @return the text tag associated to this symbol, or <code>null</code> if undefined |
107 | 107 |
* |
... | ... | |
112 | 112 |
} |
113 | 113 |
|
114 | 114 |
/** |
115 |
* Sets a text tag associated to this symbol.
|
|
115 |
* <p>Sets a text tag associated to this symbol.</p>
|
|
116 | 116 |
* |
117 | 117 |
* @param tag a text tag associated to this symbol |
118 | 118 |
* |
... | ... | |
123 | 123 |
} |
124 | 124 |
|
125 | 125 |
/** |
126 |
* Gets the geometry of this symbol.
|
|
126 |
* <p>Gets the geometry of this symbol.</p>
|
|
127 | 127 |
* |
128 | 128 |
* @return an object indicating this component's geometry |
129 | 129 |
* |
... | ... | |
134 | 134 |
} |
135 | 135 |
|
136 | 136 |
/** |
137 |
* Changes the geometry of this symbol to the new one.
|
|
137 |
* <p>Replaces the geometry of this symbol by <code>geom</code></p>.
|
|
138 | 138 |
* |
139 |
* @param geom an object indicating this component's geometry
|
|
139 |
* @param geom an object indicating this symbol geometry
|
|
140 | 140 |
* |
141 | 141 |
* @see #getGeom() |
142 | 142 |
*/ |
... | ... | |
145 | 145 |
} |
146 | 146 |
|
147 | 147 |
/** |
148 |
* Gets the identifier of this symbol.
|
|
148 |
* <p>Gets the identifier of this symbol.</p>
|
|
149 | 149 |
* |
150 |
* @return Returns the idSymbol.
|
|
150 |
* @return the identifier of this symbol
|
|
151 | 151 |
* |
152 | 152 |
* @see #setIdSymbol(int) |
153 | 153 |
*/ |
... | ... | |
156 | 156 |
} |
157 | 157 |
|
158 | 158 |
/** |
159 |
* Changes the identifier of this symbol to the new one.
|
|
159 |
* <p>Replaces the identifier of this symbol by <code>idSymbol</code></p>
|
|
160 | 160 |
* |
161 | 161 |
* @param idSymbol the new identifier |
162 | 162 |
* |
... | ... | |
167 | 167 |
} |
168 | 168 |
|
169 | 169 |
/** |
170 |
* <p>Defines the default logic of drawing an <i>FMap</i> graphic symbol.</p>
|
|
170 |
* <p>Defines the default logic of drawing a graphic symbol.</p> |
|
171 | 171 |
* |
172 |
* <p>Using the rendering defined in {@link Graphics2D Graphics2D}, the symbol will |
|
173 |
* be drawn in the viewport. That symbol must be which has the id <code>idSymbol<code> |
|
174 |
* if we want to draw which represents this class.</p> |
|
172 |
* <p>Using the rendering defined in <code>g</code>, if <code>theSymbol</code> is visible, |
|
173 |
* that symbol will be drawn in <code>viewPort</code>.</p> |
|
175 | 174 |
* |
176 | 175 |
* @param g for rendering 2-dimensional shapes, text and images on the Java(tm) platform |
177 | 176 |
* @param viewPort information for drawing this graphic item |
178 |
* @param theSymbol the symbol that will be drawn (this parameter is generally used indicating |
|
179 |
* the object that has the identifier <code>idSymbol</code>) |
|
177 |
* @param theSymbol the symbol that will be drawn |
|
180 | 178 |
*/ |
181 | 179 |
public void draw(Graphics2D g, ViewPort viewPort, ISymbol theSymbol ) |
182 | 180 |
{ |
... | ... | |
188 | 186 |
} |
189 | 187 |
|
190 | 188 |
/** |
191 |
* Gets the object tag associated to this symbol.
|
|
189 |
* <p>Gets the object tag associated to this symbol.</p>
|
|
192 | 190 |
* |
193 | 191 |
* @return the object tag associated to this symbol, or <code>null</code> if undefined |
194 | 192 |
* |
... | ... | |
199 | 197 |
} |
200 | 198 |
|
201 | 199 |
/** |
202 |
* Sets an object tag associated to this symbol.
|
|
200 |
* <p>Sets an object tag associated to this symbol.</p>
|
|
203 | 201 |
* |
204 |
* @param objectTag an object tag associated to this symbol
|
|
202 |
* @param objectTag the object tag associated to this symbol
|
|
205 | 203 |
* |
206 | 204 |
* @see #getObjectTag() |
207 | 205 |
*/ |
Also available in: Unified diff