svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.mapcontext / org.gvsig.fmap.mapcontext.api / src / main / java / org / gvsig / fmap / mapcontext / rendering / legend / styling / ILabelClass.java @ 41676
History | View | Annotate | Download (5.09 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.fmap.mapcontext.rendering.legend.styling; |
25 |
|
26 |
import java.awt.Graphics2D; |
27 |
import java.awt.Rectangle; |
28 |
|
29 |
import org.gvsig.fmap.geom.Geometry; |
30 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
31 |
import org.gvsig.fmap.mapcontext.ViewPort; |
32 |
import org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport; |
33 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol; |
34 |
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException; |
35 |
import org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle; |
36 |
import org.gvsig.tools.persistence.Persistent; |
37 |
import org.gvsig.tools.lang.Cloneable; |
38 |
|
39 |
public interface ILabelClass extends Cloneable, Persistent, CartographicSupport{ |
40 |
|
41 |
/**
|
42 |
* Returns true if the label will be showed in the map
|
43 |
*
|
44 |
* @return isVisible boolean
|
45 |
*/
|
46 |
boolean isVisible();
|
47 |
|
48 |
/**
|
49 |
* Returns true if the label will be showed in the map
|
50 |
*
|
51 |
* @return isVisible boolean
|
52 |
*/
|
53 |
boolean isVisible(double scale); |
54 |
|
55 |
/**
|
56 |
* Sets the visibility of the label in the map.
|
57 |
*
|
58 |
* @param isVisible boolean
|
59 |
*/
|
60 |
void setVisible(boolean isVisible); |
61 |
|
62 |
/**
|
63 |
* Returns the text symbol that is being used for the text(the font,
|
64 |
* size,style,aligment)
|
65 |
*
|
66 |
* @return label ITextSymbol
|
67 |
*/
|
68 |
ITextSymbol getTextSymbol(); |
69 |
|
70 |
/**
|
71 |
* Stablishes the text symbol that is going to be used for the text(the
|
72 |
* font,size,style,aligment)
|
73 |
*
|
74 |
* @param textSymbol ITextSymbol
|
75 |
*/
|
76 |
void setTextSymbol(ITextSymbol textSymbol);
|
77 |
|
78 |
/**
|
79 |
* Stablishes the style for the label.
|
80 |
*
|
81 |
* @param labelStyle ILabelStyle
|
82 |
*/
|
83 |
void setLabelStyle(ILabelStyle labelStyle);
|
84 |
|
85 |
/**
|
86 |
* Returns the style of the label
|
87 |
*
|
88 |
*/
|
89 |
ILabelStyle getLabelStyle(); |
90 |
|
91 |
/**
|
92 |
* Returns the name of the label
|
93 |
*
|
94 |
*/
|
95 |
String getName();
|
96 |
|
97 |
/**
|
98 |
* Stablishes the name of the label
|
99 |
* @param name
|
100 |
*/
|
101 |
void setName(String name); |
102 |
|
103 |
String toString();
|
104 |
|
105 |
/**
|
106 |
* Sets the text for the label
|
107 |
*
|
108 |
* @param texts String[]
|
109 |
*/
|
110 |
void setTexts(String[] texts); |
111 |
|
112 |
/**
|
113 |
* Return the text for the label
|
114 |
*
|
115 |
* @param texts String[]
|
116 |
*/
|
117 |
String[] getTexts(); |
118 |
|
119 |
/**
|
120 |
* <p>
|
121 |
* LabelLocationMetrics, contains the anchor point, rotation, and some
|
122 |
* other geometric calculations computed by the PlacementManager.
|
123 |
* </p>
|
124 |
*
|
125 |
* <p>
|
126 |
* The shp argument is passed as an accessory for subclasses of this
|
127 |
* class in case they need futher geometric calculations
|
128 |
* </p>
|
129 |
* @param graphics, graphics to use to paint the label.
|
130 |
* @param llm, concrete settings of the placement of this layer
|
131 |
* @param shp, the Shape over whose the label is painted
|
132 |
*/
|
133 |
void draw(Graphics2D graphics, ILabelLocationMetrics llm, Geometry geom); |
134 |
|
135 |
/**
|
136 |
* Useful to render a Label with size inside little rectangles.
|
137 |
*
|
138 |
* @param graphics Graphics2D
|
139 |
* @param bounds Rectangle
|
140 |
* @throws SymbolDrawingException
|
141 |
*/
|
142 |
void drawInsideRectangle(Graphics2D graphics, Rectangle bounds) |
143 |
throws SymbolDrawingException;
|
144 |
|
145 |
int getPriority();
|
146 |
|
147 |
void setPriority(int priority); |
148 |
|
149 |
Geometry getShape(ILabelLocationMetrics llm) throws CreateGeometryException;
|
150 |
|
151 |
String getClassName();
|
152 |
|
153 |
double getCartographicSize(ViewPort viewPort, double dpi, Geometry geom); |
154 |
|
155 |
int getReferenceSystem();
|
156 |
|
157 |
int getUnit();
|
158 |
|
159 |
void setCartographicSize(double cartographicSize, Geometry geom); |
160 |
|
161 |
void setReferenceSystem(int referenceSystem); |
162 |
|
163 |
void setUnit(int unitIndex); |
164 |
|
165 |
double toCartographicSize(ViewPort viewPort, double dpi, Geometry geom); |
166 |
|
167 |
Rectangle getBounds();
|
168 |
|
169 |
String getSQLQuery();
|
170 |
|
171 |
void setSQLQuery(String sqlQuery); |
172 |
|
173 |
/*
|
174 |
* Extended API to add latest improvements from gvSIG 1.X (sept 2013)
|
175 |
*/
|
176 |
|
177 |
/**
|
178 |
* Returns the expression that defines the text which will be showed in
|
179 |
* the label
|
180 |
*
|
181 |
* @return labelExpressions String[]
|
182 |
*/
|
183 |
public String[] getLabelExpressions(); |
184 |
|
185 |
/**
|
186 |
* Sets the expression that defines the text which will be showed in
|
187 |
* the label
|
188 |
*
|
189 |
* @return labelExpressions String[]
|
190 |
*/
|
191 |
public void setLabelExpressions(String[] lbl_exps); |
192 |
|
193 |
public void setUseSqlQuery(boolean use_sql); |
194 |
|
195 |
public boolean isUseSqlQuery(); |
196 |
|
197 |
/**
|
198 |
* Returns the expression that defines the text which will be showed in
|
199 |
* the label ready to be used for the label parser
|
200 |
*
|
201 |
* @return labelExpression String
|
202 |
*/
|
203 |
public String getStringLabelExpression(); |
204 |
|
205 |
|
206 |
|
207 |
} |