Revision 20002
trunk/extensions/extSymbology/src/org/gvsig/symbology/gui/layerproperties/GeneralLabeling.java | ||
---|---|---|
44 | 44 |
import java.awt.Component; |
45 | 45 |
import java.awt.Dimension; |
46 | 46 |
import java.awt.FlowLayout; |
47 |
import java.awt.GridLayout; |
|
47 | 48 |
import java.awt.event.ActionEvent; |
48 | 49 |
import java.awt.event.ActionListener; |
49 | 50 |
import java.awt.event.MouseAdapter; |
... | ... | |
54 | 55 |
import java.util.TreeSet; |
55 | 56 |
|
56 | 57 |
import javax.swing.BorderFactory; |
58 |
import javax.swing.ButtonGroup; |
|
57 | 59 |
import javax.swing.JCheckBox; |
58 | 60 |
import javax.swing.JComponent; |
59 | 61 |
import javax.swing.JLabel; |
60 | 62 |
import javax.swing.JOptionPane; |
61 | 63 |
import javax.swing.JPanel; |
64 |
import javax.swing.JRadioButton; |
|
62 | 65 |
import javax.swing.JScrollPane; |
63 | 66 |
|
64 | 67 |
import org.gvsig.gui.beans.controls.dnd.JDnDList; |
... | ... | |
99 | 102 |
private JComboBox cmbClasses; |
100 | 103 |
private IPlacementConstraints placementConstraints; |
101 | 104 |
private IZoomConstraints zoomConstraints; |
105 |
private long minScaleView = -1, maxScaleView = -1; |
|
102 | 106 |
private boolean noEvent; |
103 | 107 |
private JCheckBox chkLabel; |
104 | 108 |
private JCheckBox chkTextOnly; |
... | ... | |
108 | 112 |
private JCheckBox chkDefinePriorities; |
109 | 113 |
private JScrollPane scrlPan; |
110 | 114 |
private LabelClassRenderingProperties labelClassRenderingProperties; |
115 |
private JCheckBox chkAllowLabelOverlapping; |
|
111 | 116 |
|
112 | 117 |
public GeneralLabeling() { |
113 | 118 |
initialize(); |
... | ... | |
148 | 153 |
aux.setBorder(BorderFactory.createTitledBorder( |
149 | 154 |
null, PluginServices.getText(this, "options"))); |
150 | 155 |
aux.add(getBtnVisualization()); |
156 |
|
|
151 | 157 |
aux.add(getBtnPlacement()); |
158 |
aux.add(getChkAllowLabelOverlapping()); |
|
152 | 159 |
aux.setPreferredSize(new Dimension(612, 60)); |
153 | 160 |
|
154 | 161 |
left.addComponent(aux); |
... | ... | |
166 | 173 |
add(right, BorderLayout.EAST); |
167 | 174 |
} |
168 | 175 |
|
176 |
|
|
177 |
private JCheckBox getChkAllowLabelOverlapping() { |
|
178 |
if (chkAllowLabelOverlapping == null) { |
|
179 |
chkAllowLabelOverlapping = new JCheckBox(PluginServices.getText(this, "allow_label_overlapping")); |
|
180 |
|
|
181 |
} |
|
182 |
|
|
183 |
return chkAllowLabelOverlapping; |
|
184 |
} |
|
185 |
|
|
169 | 186 |
private Component getScrlClassPriorities() { |
170 | 187 |
if (scrlPan == null) { |
171 | 188 |
scrlPan = new JScrollPane(); |
... | ... | |
319 | 336 |
} |
320 | 337 |
|
321 | 338 |
public ILabelingStrategy getLabelingStrategy() { |
322 |
return ExtendedLabelingFactory.
|
|
339 |
ILabelingStrategy st = ExtendedLabelingFactory.
|
|
323 | 340 |
createStrategy((FLayer) layer, |
324 | 341 |
getMethod(), |
325 | 342 |
getPlacementConstraints(), |
326 | 343 |
getZoomConstraints()); |
344 |
if (st instanceof GeneralLabelingStrategy) { |
|
345 |
GeneralLabelingStrategy gStr = (GeneralLabelingStrategy) st; |
|
346 |
gStr.setAllowOverlapping(getChkAllowLabelOverlapping().isSelected()); |
|
347 |
gStr.setMinScaleView(minScaleView); |
|
348 |
gStr.setMaxScaleView(maxScaleView); |
|
349 |
} |
|
350 |
return st; |
|
327 | 351 |
} |
328 | 352 |
|
329 | 353 |
public void setModel(FLayer layer, ILabelingStrategy str) { |
... | ... | |
334 | 358 |
fieldNames = lv.getRecordset().getFieldNames(); |
335 | 359 |
labelClassRenderingProperties.setFieldNames(fieldNames); |
336 | 360 |
if (str instanceof GeneralLabelingStrategy) { |
361 |
GeneralLabelingStrategy gStr = (GeneralLabelingStrategy) str; |
|
337 | 362 |
setMethod(str.getLabelingMethod()); |
338 | 363 |
placementConstraints = str.getPlacementConstraints(); |
364 |
getChkAllowLabelOverlapping().setSelected(gStr.isAllowOverlapping()); |
|
365 |
minScaleView = gStr.getMinScaleView(); |
|
366 |
maxScaleView = gStr.getMaxScaleView(); |
|
339 | 367 |
} |
340 | 368 |
|
341 | 369 |
refreshControls(); |
... | ... | |
473 | 501 |
} |
474 | 502 |
|
475 | 503 |
} else if (c.equals(btnVisualization)) { |
476 |
|
|
504 |
LabelScaleRange lsr = new LabelScaleRange(minScaleView, maxScaleView); |
|
505 |
PluginServices.getMDIManager().addWindow(lsr); |
|
506 |
minScaleView = lsr.getMinScale(); |
|
507 |
maxScaleView = lsr.getMaxScale(); |
|
477 | 508 |
} else if (c.equals(cmbMethod)) { |
478 | 509 |
// disable components in class panel |
479 | 510 |
// multiple class or not enables or disables the class panel |
Also available in: Unified diff