Revision 23918 trunk/extensions/extSymbology/src/org/gvsig/symbology/fmap/labeling/placements/MultiShapePlacementConstraints.java
MultiShapePlacementConstraints.java | ||
---|---|---|
45 | 45 |
import com.iver.utiles.XMLEntity; |
46 | 46 |
|
47 | 47 |
/** |
48 |
*
|
|
48 |
* |
|
49 | 49 |
* MultiShapePlacementConstraints.java |
50 | 50 |
* |
51 |
*
|
|
51 |
* |
|
52 | 52 |
* @author jaume dominguez faus - jaume.dominguez@iver.es Apr 1, 2008 |
53 | 53 |
* |
54 | 54 |
*/ |
... | ... | |
58 | 58 |
private IPlacementConstraints lineConstraints; |
59 | 59 |
private IPlacementConstraints pointConstraints; |
60 | 60 |
|
61 |
|
|
61 |
|
|
62 | 62 |
public MultiShapePlacementConstraints() { } |
63 |
|
|
63 |
|
|
64 | 64 |
public MultiShapePlacementConstraints( |
65 | 65 |
IPlacementConstraints pointConstraints, |
66 | 66 |
IPlacementConstraints lineConstraints, |
... | ... | |
68 | 68 |
this.pointConstraints = pointConstraints; |
69 | 69 |
this.lineConstraints = lineConstraints; |
70 | 70 |
this.polygonConstraints = polygonConstraints; |
71 |
|
|
71 |
|
|
72 | 72 |
} |
73 | 73 |
|
74 | 74 |
public void setPolygonConstraints(IPlacementConstraints polygonConstraints) { |
... | ... | |
96 | 96 |
} |
97 | 97 |
|
98 | 98 |
|
99 |
@Override |
|
100 |
public boolean isAboveTheLine() { |
|
101 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
102 |
} |
|
99 |
// @Override |
|
100 |
// public boolean isAboveTheLine() { |
|
101 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
102 |
// } |
|
103 |
// |
|
104 |
// @Override |
|
105 |
// public boolean isAroundThePoint() { |
|
106 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
107 |
// } |
|
108 |
// |
|
109 |
// @Override |
|
110 |
// public boolean isAtBestOfLine() { |
|
111 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
112 |
// } |
|
113 |
// |
|
114 |
// @Override |
|
115 |
// public boolean isAtTheBeginingOfLine() { |
|
116 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
117 |
// } |
|
118 |
// |
|
119 |
// @Override |
|
120 |
// public boolean isAtTheEndOfLine() { |
|
121 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
122 |
// } |
|
123 |
// |
|
124 |
// @Override |
|
125 |
// public boolean isBelowTheLine() { |
|
126 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
127 |
// } |
|
128 |
// |
|
129 |
// @Override |
|
130 |
// public boolean isFitInsidePolygon() { |
|
131 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
132 |
// } |
|
133 |
// |
|
134 |
// @Override |
|
135 |
// public boolean isFollowingLine() { |
|
136 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
137 |
// } |
|
138 |
// |
|
139 |
// @Override |
|
140 |
// public boolean isHorizontal() { |
|
141 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
142 |
// } |
|
143 |
// |
|
144 |
// @Override |
|
145 |
// public boolean isInTheMiddleOfLine() { |
|
146 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
147 |
// } |
|
148 |
// |
|
149 |
// @Override |
|
150 |
// public boolean isOnTheLine() { |
|
151 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
152 |
// } |
|
153 |
// |
|
154 |
// @Override |
|
155 |
// public boolean isOnTopOfThePoint() { |
|
156 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
157 |
// } |
|
158 |
// |
|
159 |
// @Override |
|
160 |
// public boolean isPageOriented() { |
|
161 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
162 |
// } |
|
163 |
// |
|
164 |
// @Override |
|
165 |
// public boolean isParallel() { |
|
166 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
167 |
// } |
|
168 |
// |
|
169 |
// @Override |
|
170 |
// public boolean isPerpendicular() { |
|
171 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
172 |
// } |
|
173 |
// |
|
174 |
// @Override |
|
175 |
// public void setAboveTheLine(boolean b) { |
|
176 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
177 |
// } |
|
178 |
// |
|
179 |
// @Override |
|
180 |
// public void setBelowTheLine(boolean b) { |
|
181 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
182 |
// } |
|
183 |
// |
|
184 |
// |
|
185 |
// @Override |
|
186 |
// public void setFitInsidePolygon(boolean b) { |
|
187 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
188 |
// } |
|
189 |
// |
|
190 |
// @Override |
|
191 |
// public void setLocationAlongTheLine(int location) { |
|
192 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
193 |
// } |
|
194 |
// |
|
195 |
// @Override |
|
196 |
// public void setOnTheLine(boolean b) { |
|
197 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
198 |
// } |
|
199 |
// |
|
200 |
// @Override |
|
201 |
// public void setPageOriented(boolean b) { |
|
202 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
203 |
// } |
|
204 |
// |
|
205 |
// @Override |
|
206 |
// public void setPlacementMode(int mode) { |
|
207 |
// throw new Error("Operation delegated to its members. Access them directly"); |
|
208 |
// } |
|
103 | 209 |
|
104 |
@Override |
|
105 |
public boolean isAroundThePoint() { |
|
106 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
107 |
} |
|
108 |
|
|
109 |
@Override |
|
110 |
public boolean isAtBestOfLine() { |
|
111 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
112 |
} |
|
113 |
|
|
114 |
@Override |
|
115 |
public boolean isAtTheBeginingOfLine() { |
|
116 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
117 |
} |
|
118 |
|
|
119 |
@Override |
|
120 |
public boolean isAtTheEndOfLine() { |
|
121 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
122 |
} |
|
123 |
|
|
124 |
@Override |
|
125 |
public boolean isBelowTheLine() { |
|
126 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
127 |
} |
|
128 |
|
|
129 |
@Override |
|
130 |
public boolean isFitInsidePolygon() { |
|
131 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
132 |
} |
|
133 |
|
|
134 |
@Override |
|
135 |
public boolean isFollowingLine() { |
|
136 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
137 |
} |
|
138 |
|
|
139 |
@Override |
|
140 |
public boolean isHorizontal() { |
|
141 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
142 |
} |
|
143 |
|
|
144 |
@Override |
|
145 |
public boolean isInTheMiddleOfLine() { |
|
146 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
147 |
} |
|
148 |
|
|
149 |
@Override |
|
150 |
public boolean isOnTheLine() { |
|
151 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
152 |
} |
|
153 |
|
|
154 |
@Override |
|
155 |
public boolean isOnTopOfThePoint() { |
|
156 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
157 |
} |
|
158 |
|
|
159 |
@Override |
|
160 |
public boolean isPageOriented() { |
|
161 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
162 |
} |
|
163 |
|
|
164 |
@Override |
|
165 |
public boolean isParallel() { |
|
166 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
167 |
} |
|
168 |
|
|
169 |
@Override |
|
170 |
public boolean isPerpendicular() { |
|
171 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
172 |
} |
|
173 |
|
|
174 |
@Override |
|
175 |
public void setAboveTheLine(boolean b) { |
|
176 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
177 |
} |
|
178 |
|
|
179 |
@Override |
|
180 |
public void setBelowTheLine(boolean b) { |
|
181 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
182 |
} |
|
183 |
|
|
184 |
|
|
185 |
@Override |
|
186 |
public void setFitInsidePolygon(boolean b) { |
|
187 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
188 |
} |
|
189 |
|
|
190 |
@Override |
|
191 |
public void setLocationAlongTheLine(int location) { |
|
192 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
193 |
} |
|
194 |
|
|
195 |
@Override |
|
196 |
public void setOnTheLine(boolean b) { |
|
197 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
198 |
} |
|
199 |
|
|
200 |
@Override |
|
201 |
public void setPageOriented(boolean b) { |
|
202 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
203 |
} |
|
204 |
|
|
205 |
@Override |
|
206 |
public void setPlacementMode(int mode) { |
|
207 |
throw new Error("Operation delegated to its members. Access them directly"); |
|
208 |
} |
|
209 |
|
|
210 | 210 |
public String getClassName() { |
211 | 211 |
return getClass().getName(); |
212 | 212 |
} |
... | ... | |
214 | 214 |
public XMLEntity getXMLEntity() { |
215 | 215 |
XMLEntity xml = new XMLEntity(); |
216 | 216 |
xml.putProperty("className", getClassName()); |
217 |
|
|
217 |
|
|
218 | 218 |
// point constraints |
219 | 219 |
if (pointConstraints != null) { |
220 | 220 |
XMLEntity points = pointConstraints.getXMLEntity(); |
221 | 221 |
points.putProperty("id", "PointConstraints"); |
222 | 222 |
xml.addChild(points); |
223 | 223 |
} |
224 |
|
|
224 |
|
|
225 | 225 |
// line constraints |
226 | 226 |
if (lineConstraints != null) { |
227 | 227 |
XMLEntity lines = lineConstraints.getXMLEntity(); |
228 | 228 |
lines.putProperty("id", "LineConstraints"); |
229 | 229 |
xml.addChild(lines); |
230 | 230 |
} |
231 |
|
|
231 |
|
|
232 | 232 |
// point constraints |
233 | 233 |
if (polygonConstraints != null) { |
234 | 234 |
XMLEntity polygons = polygonConstraints.getXMLEntity(); |
235 | 235 |
polygons.putProperty("id", "PolygonCostraints"); |
236 | 236 |
xml.addChild(polygons); |
237 | 237 |
} |
238 |
|
|
238 |
|
|
239 | 239 |
return xml; |
240 | 240 |
} |
241 | 241 |
|
242 | 242 |
public void setXMLEntity(XMLEntity xml) { |
243 | 243 |
XMLEntity aux; |
244 |
|
|
244 |
|
|
245 | 245 |
// points |
246 | 246 |
if ( ((aux = xml.firstChild("id", "PointConstraints")) != null) ) { |
247 | 247 |
pointConstraints = LabelingFactory.createPlacementConstraintsFromXML(aux); |
248 | 248 |
} |
249 |
|
|
249 |
|
|
250 | 250 |
// lines |
251 | 251 |
if ( ((aux = xml.firstChild("id", "LineConstraints")) != null) ) { |
252 | 252 |
pointConstraints = LabelingFactory.createPlacementConstraintsFromXML(aux); |
253 | 253 |
} |
254 |
|
|
254 |
|
|
255 | 255 |
// polygons |
256 | 256 |
if ( ((aux = xml.firstChild("id", "PloygonConstraints")) != null) ) { |
257 | 257 |
pointConstraints = LabelingFactory.createPlacementConstraintsFromXML(aux); |
258 | 258 |
} |
259 |
|
|
259 |
|
|
260 | 260 |
} |
261 | 261 |
|
262 | 262 |
|
263 |
|
|
263 |
|
|
264 | 264 |
} |
Also available in: Unified diff