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 @ 47476
History | View | Annotate | Download (4.73 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 |
import org.gvsig.fmap.geom.Geometry; |
29 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
30 |
import org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport; |
31 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol; |
32 |
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException; |
33 |
import org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle; |
34 |
import org.gvsig.tools.lang.Cloneable; |
35 |
import org.gvsig.tools.persistence.Persistent; |
36 |
|
37 |
public interface ILabelClass extends Cloneable, Persistent, CartographicSupport{ |
38 |
|
39 |
/**
|
40 |
* Returns true if the label will be showed in the map
|
41 |
*
|
42 |
* @return isVisible boolean
|
43 |
*/
|
44 |
boolean isVisible();
|
45 |
|
46 |
/**
|
47 |
* Returns true if the label will be showed in the map
|
48 |
*
|
49 |
* @return isVisible boolean
|
50 |
*/
|
51 |
boolean isVisible(double scale); |
52 |
|
53 |
/**
|
54 |
* Sets the visibility of the label in the map.
|
55 |
*
|
56 |
* @param isVisible boolean
|
57 |
*/
|
58 |
void setVisible(boolean isVisible); |
59 |
|
60 |
/**
|
61 |
* Returns the text symbol that is being used for the text(the font,
|
62 |
* size,style,aligment)
|
63 |
*
|
64 |
* @return label ITextSymbol
|
65 |
*/
|
66 |
ITextSymbol getTextSymbol(); |
67 |
|
68 |
/**
|
69 |
* Stablishes the text symbol that is going to be used for the text(the
|
70 |
* font,size,style,aligment)
|
71 |
*
|
72 |
* @param textSymbol ITextSymbol
|
73 |
*/
|
74 |
void setTextSymbol(ITextSymbol textSymbol);
|
75 |
|
76 |
/**
|
77 |
* Stablishes the style for the label.
|
78 |
*
|
79 |
* @param labelStyle ILabelStyle
|
80 |
*/
|
81 |
void setLabelStyle(ILabelStyle labelStyle);
|
82 |
|
83 |
/**
|
84 |
* Returns the style of the label
|
85 |
*
|
86 |
*/
|
87 |
ILabelStyle getLabelStyle(); |
88 |
|
89 |
/**
|
90 |
* Returns the name of the label
|
91 |
*
|
92 |
*/
|
93 |
String getName();
|
94 |
|
95 |
/**
|
96 |
* Stablishes the name of the label
|
97 |
* @param name
|
98 |
*/
|
99 |
void setName(String name); |
100 |
|
101 |
@Override
|
102 |
String toString();
|
103 |
|
104 |
/**
|
105 |
* Sets the text for the label
|
106 |
*
|
107 |
* @param texts String[]
|
108 |
*/
|
109 |
void setTexts(String[] texts); |
110 |
|
111 |
/**
|
112 |
* Return the text for the label
|
113 |
*
|
114 |
* @param texts String[]
|
115 |
*/
|
116 |
String[] getTexts(); |
117 |
|
118 |
/**
|
119 |
* <p>
|
120 |
* LabelLocationMetrics, contains the anchor point, rotation, and some
|
121 |
* other geometric calculations computed by the PlacementManager.
|
122 |
* </p>
|
123 |
*
|
124 |
* <p>
|
125 |
* The shp argument is passed as an accessory for subclasses of this
|
126 |
* class in case they need futher geometric calculations
|
127 |
* </p>
|
128 |
* @param graphics, graphics to use to paint the label.
|
129 |
* @param llm, concrete settings of the placement of this layer
|
130 |
* @param shp, the Shape over whose the label is painted
|
131 |
*/
|
132 |
void draw(Graphics2D graphics, ILabelLocationMetrics llm, Geometry geom); |
133 |
|
134 |
/**
|
135 |
* Useful to render a Label with size inside little rectangles.
|
136 |
*
|
137 |
* @param graphics Graphics2D
|
138 |
* @param bounds Rectangle
|
139 |
* @throws SymbolDrawingException
|
140 |
*/
|
141 |
void drawInsideRectangle(Graphics2D graphics, Rectangle bounds) |
142 |
throws SymbolDrawingException;
|
143 |
|
144 |
int getPriority();
|
145 |
|
146 |
void setPriority(int priority); |
147 |
|
148 |
Geometry getShape(ILabelLocationMetrics llm) throws CreateGeometryException;
|
149 |
|
150 |
String getClassName();
|
151 |
|
152 |
Rectangle getBounds();
|
153 |
|
154 |
String getSQLQuery();
|
155 |
|
156 |
void setSQLQuery(String sqlQuery); |
157 |
|
158 |
/*
|
159 |
* Extended API to add latest improvements from gvSIG 1.X (sept 2013)
|
160 |
*/
|
161 |
|
162 |
/**
|
163 |
* Returns the expression that defines the text which will be showed in
|
164 |
* the label
|
165 |
*
|
166 |
* @return labelExpressions String[]
|
167 |
*/
|
168 |
public String[] getLabelExpressions(); |
169 |
|
170 |
/**
|
171 |
* Sets the expression that defines the text which will be showed in
|
172 |
* the label
|
173 |
*
|
174 |
* @return labelExpressions String[]
|
175 |
*/
|
176 |
public void setLabelExpressions(String[] lbl_exps); |
177 |
|
178 |
public void setUseSqlQuery(boolean use_sql); |
179 |
|
180 |
public boolean isUseSqlQuery(); |
181 |
|
182 |
/**
|
183 |
* Returns the expression that defines the text which will be showed in
|
184 |
* the label ready to be used for the label parser
|
185 |
*
|
186 |
* @return labelExpression String
|
187 |
*/
|
188 |
public String getStringLabelExpression(); |
189 |
|
190 |
|
191 |
|
192 |
} |