Revision 23062 trunk/extensions/extSymbology/src/org/gvsig/symbology/gui/layerproperties/DefaultLabeling.java
DefaultLabeling.java | ||
---|---|---|
91 | 91 |
private String[] fieldNames; |
92 | 92 |
private int[] fieldTypes; |
93 | 93 |
private boolean allowOverlap; |
94 |
private IZoomConstraints zoomConstraints;
|
|
94 |
private IZoomConstraints zoomConstraints; |
|
95 | 95 |
@Override |
96 | 96 |
public Class<? extends ILabelingMethod> getLabelingMethodClass() { |
97 | 97 |
return DefaultLabelingMethod.class; |
... | ... | |
116 | 116 |
labeling = new GeneralLabelingStrategy(); |
117 | 117 |
// (!!) |
118 | 118 |
labeling.setLayer(layer); |
119 |
layer.setLabelingStrategy(labeling);
|
|
120 |
}
|
|
119 |
layer.setLabelingStrategy(labeling); |
|
120 |
} |
|
121 | 121 |
else { |
122 | 122 |
labeling = (GeneralLabelingStrategy) layer.getLabelingStrategy(); |
123 | 123 |
} |
... | ... | |
132 | 132 |
} else { |
133 | 133 |
lc = new LabelClass(); |
134 | 134 |
} |
135 |
setLabel(lc);
|
|
135 |
setLabel(lc); |
|
136 | 136 |
} |
137 | 137 |
|
138 | 138 |
@Override |
139 |
protected void initializePanel() {
|
|
139 |
protected void initializePanel() { |
|
140 | 140 |
setLayout(new BorderLayout()); |
141 | 141 |
JSplitPane scrl = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); |
142 | 142 |
scrl.add(layerPrev = new LayerPreview(), JSplitPane.LEFT); |
... | ... | |
160 | 160 |
public void actionPerformed(ActionEvent e) { |
161 | 161 |
if (e.getSource().equals(btnProperties)) { |
162 | 162 |
LabelClassProperties lcProp = new LabelClassProperties(fieldNames, fieldTypes); |
163 |
lcProp.setLabelClass(getMethod().getLabelClasses()[0]);
|
|
163 |
lcProp.setLabelClass(method.getLabelClasses()[0]);
|
|
164 | 164 |
PluginServices.getMDIManager().addWindow(lcProp); |
165 | 165 |
setLabel(lcProp.getLabelClass()); |
166 | 166 |
} |
... | ... | |
183 | 183 |
GeneralLabelingStrategy s = (GeneralLabelingStrategy) layer. |
184 | 184 |
getLabelingStrategy(); |
185 | 185 |
s.setLabelingMethod(newMethodForThePreview(defaultLabel)); |
186 |
s.setPlacementConstraints(placementConstraints); |
|
187 |
s.setAllowOverlapping(allowOverlap); |
|
188 |
s.setZoomConstraints(zoomConstraints); |
|
186 |
// s.setPlacementConstraints(placementConstraints);
|
|
187 |
// s.setAllowOverlapping(allowOverlap);
|
|
188 |
// s.setZoomConstraints(zoomConstraints);
|
|
189 | 189 |
|
190 | 190 |
layer.setIsLabeled(true); |
191 | 191 |
|
192 |
/* If the selected labeling method is OnSelectionLabeled we have to select some rows
|
|
192 |
/* If the selected labeling method is OnSelectionLabeled we have to select some rows |
|
193 | 193 |
* in the previous sample image*/ |
194 | 194 |
if(s.getLabelingMethod() instanceof OnSelectionLabeled) { |
195 | 195 |
|
196 | 196 |
try { |
197 |
|
|
197 |
|
|
198 | 198 |
IFeatureIterator it = layer.getSource().getFeatureIterator(); |
199 | 199 |
SelectionSupport selectionSupport = new SelectionSupport(); |
200 | 200 |
FBitSet bitSet = new FBitSet(); |
... | ... | |
203 | 203 |
for (int i = 0; i <= rowCount/4; i++) { |
204 | 204 |
bitSet.set(i); |
205 | 205 |
} |
206 |
|
|
206 |
|
|
207 | 207 |
selectionSupport.setSelection(bitSet); |
208 | 208 |
layer.getRecordset().setSelectionSupport(selectionSupport); |
209 |
|
|
209 |
|
|
210 | 210 |
} catch (ReadDriverException e) { |
211 | 211 |
NotificationManager.addError(PluginServices.getText(this, "accessing_file_structure"), e); |
212 | 212 |
} |
213 |
}
|
|
213 |
} |
|
214 | 214 |
|
215 | 215 |
|
216 | 216 |
try { |
... | ... | |
227 | 227 |
} |
228 | 228 |
|
229 | 229 |
public void propertyChange(PropertyChangeEvent evt) { |
230 |
String prop = evt.getPropertyName();
|
|
230 |
String prop = evt.getPropertyName(); |
|
231 | 231 |
if (AbstractLabelingMethodPanel.PLACEMENT_CONSTRAINTS.equals(prop)) { |
232 | 232 |
placementConstraints = (IPlacementConstraints) evt.getNewValue(); |
233 | 233 |
} else if (AbstractLabelingMethodPanel.ALLOW_OVERLAP.equals(prop)) { |
Also available in: Unified diff