Revision 19317
trunk/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/layers/Annotation_Layer.java | ||
---|---|---|
101 | 101 |
import com.iver.cit.gvsig.fmap.operations.strategies.StrategyManager; |
102 | 102 |
import com.iver.cit.gvsig.fmap.rendering.Annotation_Legend; |
103 | 103 |
import com.iver.cit.gvsig.fmap.rendering.IVectorLegend; |
104 |
import com.iver.cit.gvsig.fmap.rendering.styling.AttrInTableLabeling;
|
|
104 |
import com.iver.cit.gvsig.fmap.rendering.styling.labeling.AttrInTableLabelingStrategy;
|
|
105 | 105 |
import com.iver.cit.gvsig.fmap.spatialindex.QuadtreeJts; |
106 | 106 |
import com.iver.utiles.XMLEntity; |
107 | 107 |
import com.iver.utiles.swing.threads.Cancellable; |
... | ... | |
286 | 286 |
//Si el tama?o de la fuente est? en unidades de mapa. |
287 | 287 |
int unit=-1; |
288 | 288 |
if (this.getLabelingStrategy()!=null) |
289 |
unit=((AttrInTableLabeling)this.getLabelingStrategy()).getUnit(); |
|
289 |
unit=((AttrInTableLabelingStrategy)this.getLabelingStrategy()).getUnit();
|
|
290 | 290 |
if (unit!=-1){ |
291 | 291 |
boolean draw=false; |
292 | 292 |
Rectangle2D r=getTextWrappingGeometryInPixels(unit,size,vv[idTextField].toString(),rotation,fontName, fontStyle,i,viewPort,geom).getBounds2D(); |
... | ... | |
566 | 566 |
if (this.getLabelingStrategy()==null){ |
567 | 567 |
boolean isInPixel=((Annotation_Legend)this.getLegend()).isFontSizeInPixels(); |
568 | 568 |
if (isInPixel){ |
569 |
AttrInTableLabeling labeling = new AttrInTableLabeling();
|
|
569 |
AttrInTableLabelingStrategy labeling = new AttrInTableLabelingStrategy();
|
|
570 | 570 |
labeling.setUnit(-1); |
571 | 571 |
setLabelingStrategy(labeling); |
572 | 572 |
}else{ |
573 |
AttrInTableLabeling labeling = new AttrInTableLabeling();
|
|
573 |
AttrInTableLabelingStrategy labeling = new AttrInTableLabelingStrategy();
|
|
574 | 574 |
labeling.setUnit(1); |
575 | 575 |
setLabelingStrategy(labeling); |
576 | 576 |
} |
trunk/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/operation/strategies/Annotation_Strategy.java | ||
---|---|---|
85 | 85 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
86 | 86 |
import com.iver.cit.gvsig.fmap.operations.strategies.DefaultStrategy; |
87 | 87 |
import com.iver.cit.gvsig.fmap.rendering.Annotation_Legend; |
88 |
import com.iver.cit.gvsig.fmap.rendering.styling.AttrInTableLabeling;
|
|
88 |
import com.iver.cit.gvsig.fmap.rendering.styling.labeling.AttrInTableLabelingStrategy;
|
|
89 | 89 |
import com.iver.utiles.swing.threads.Cancellable; |
90 | 90 |
import com.vividsolutions.jts.geom.Geometry; |
91 | 91 |
import com.vividsolutions.jts.geom.IntersectionMatrix; |
... | ... | |
223 | 223 |
//Si el tama?o de la fuente est? en unidades de mapa. |
224 | 224 |
if (!l.isFontSizeInPixels()){ |
225 | 225 |
boolean draw=false; |
226 |
int unit=((AttrInTableLabeling)capa.getLabelingStrategy()).getUnit(); |
|
226 |
int unit=((AttrInTableLabelingStrategy)capa.getLabelingStrategy()).getUnit();
|
|
227 | 227 |
Rectangle2D r=capa.getTextWrappingGeometryInPixels(unit,size,vv[idTextField].toString(),rotation,fontName, fontStyle,i,viewPort,geom).getBounds2D(); |
228 | 228 |
Rectangle2D rPixels=new Rectangle2D.Double(r.getX(),r.getY()+r.getHeight(),r.getWidth(),r.getHeight()); |
229 | 229 |
|
... | ... | |
258 | 258 |
|
259 | 259 |
// Si el tama?o de la fuente est? en pixels. |
260 | 260 |
boolean draw=false; |
261 |
int unit=((AttrInTableLabeling)capa.getLabelingStrategy()).getUnit(); |
|
261 |
int unit=((AttrInTableLabelingStrategy)capa.getLabelingStrategy()).getUnit();
|
|
262 | 262 |
Rectangle2D r=capa.getTextWrappingGeometryInPixels(unit,size,vv[idTextField].toString(),rotation,fontName,fontStyle,i,viewPort,geom).getBounds2D(); |
263 | 263 |
// g.draw(capa.getTextWrappingGeometryInPixels(size,vv[idTextField].toString(),rotation,fontName,fontStyle,i,viewPort,geom)); |
264 | 264 |
Rectangle2D rPixels= new Rectangle2D.Double(r.getX(),r.getY()+r.getHeight(),r.getWidth(),r.getHeight()); |
... | ... | |
568 | 568 |
geom.reProject(ct); |
569 | 569 |
} |
570 | 570 |
geom.transform(vp.getAffineTransform()); |
571 |
int unit=((AttrInTableLabeling)capa.getLabelingStrategy()).getUnit(); |
|
571 |
int unit=((AttrInTableLabelingStrategy)capa.getLabelingStrategy()).getUnit();
|
|
572 | 572 |
IGeometry geom1 = capa.getTextWrappingGeometryInPixels(unit,vHeight.floatValue(), |
573 | 573 |
vText.toString(), vRotation.doubleValue(),vType.getValue(),vStyle.intValue(), index, vp,geom); |
574 | 574 |
geom1.transform(vp.getAffineTransform().createInverse()); |
trunk/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/edition/Annotation_EditableAdapter.java | ||
---|---|---|
73 | 73 |
import com.iver.cit.gvsig.fmap.layers.Annotation_Layer; |
74 | 74 |
import com.iver.cit.gvsig.fmap.layers.Annotation_Mapping; |
75 | 75 |
import com.iver.cit.gvsig.fmap.rendering.Annotation_Legend; |
76 |
import com.iver.cit.gvsig.fmap.rendering.styling.AttrInTableLabeling;
|
|
76 |
import com.iver.cit.gvsig.fmap.rendering.styling.labeling.AttrInTableLabelingStrategy;
|
|
77 | 77 |
import com.iver.utiles.StringUtilities; |
78 | 78 |
import com.iver.utiles.XMLEntity; |
79 | 79 |
|
... | ... | |
230 | 230 |
geom.transform(vp.getAffineTransform()); |
231 | 231 |
int unit=-1; |
232 | 232 |
if (lyrAnnotation.getLabelingStrategy()!=null) |
233 |
unit=((AttrInTableLabeling)lyrAnnotation.getLabelingStrategy()).getUnit(); |
|
233 |
unit=((AttrInTableLabelingStrategy)lyrAnnotation.getLabelingStrategy()).getUnit();
|
|
234 | 234 |
IGeometry geom1 = lyrAnnotation.getTextWrappingGeometryInPixels(unit,vHeight.floatValue()*FConstant.FONT_HEIGHT_SCALE_FACTOR, |
235 | 235 |
vText.toString(), vRotation.doubleValue(),vType.getValue(),vStyle.intValue(), index, vp,geom); |
236 | 236 |
try { |
trunk/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_Create.java | ||
---|---|---|
61 | 61 |
import com.iver.andami.messages.NotificationManager; |
62 | 62 |
import com.iver.cit.gvsig.exceptions.layers.LegendLayerException; |
63 | 63 |
import com.iver.cit.gvsig.fmap.MapContext; |
64 |
import com.iver.cit.gvsig.fmap.MapControl; |
|
65 | 64 |
import com.iver.cit.gvsig.fmap.core.FShape; |
66 |
import com.iver.cit.gvsig.fmap.core.symbols.SimpleTextSymbol; |
|
67 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
|
68 | 65 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
69 | 66 |
import com.iver.cit.gvsig.fmap.drivers.FieldDescription; |
70 | 67 |
import com.iver.cit.gvsig.fmap.drivers.SHPLayerDefinition; |
... | ... | |
75 | 72 |
import com.iver.cit.gvsig.fmap.layers.Annotation_Mapping; |
76 | 73 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
77 | 74 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
78 |
import com.iver.cit.gvsig.fmap.rendering.styling.AttrInTableLabeling; |
|
79 |
import com.iver.cit.gvsig.fmap.rendering.styling.LabelingFactory; |
|
75 |
import com.iver.cit.gvsig.fmap.rendering.styling.labeling.AttrInTableLabelingStrategy; |
|
80 | 76 |
import com.iver.cit.gvsig.gui.panels.annotation.ConfigureLabel; |
81 | 77 |
import com.iver.utiles.SimpleFileFilter; |
82 | 78 |
|
... | ... | |
141 | 137 |
|
142 | 138 |
try { |
143 | 139 |
this.layerAnnotation.setMapping(mapping); |
144 |
AttrInTableLabeling labeling = new AttrInTableLabeling();
|
|
140 |
AttrInTableLabelingStrategy labeling = new AttrInTableLabelingStrategy();
|
|
145 | 141 |
labeling.setUnit(panel2.getCmbUnits().getSelectedUnitIndex()); |
146 | 142 |
this.layerAnnotation.setLabelingStrategy(labeling); |
147 | 143 |
// ((FSymbol) this.layerAnnotation.getLegend().getDefaultSymbol()).setFontSizeInPixels(panel2.sizeUnitsInPixels()); |
trunk/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_Modify.java | ||
---|---|---|
49 | 49 |
import com.iver.andami.messages.NotificationManager; |
50 | 50 |
import com.iver.cit.gvsig.exceptions.layers.LegendLayerException; |
51 | 51 |
import com.iver.cit.gvsig.fmap.MapContext; |
52 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
|
53 | 52 |
import com.iver.cit.gvsig.fmap.layers.Annotation_Layer; |
54 | 53 |
import com.iver.cit.gvsig.fmap.layers.Annotation_Mapping; |
55 | 54 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
56 |
import com.iver.cit.gvsig.fmap.rendering.styling.AttrInTableLabeling;
|
|
55 |
import com.iver.cit.gvsig.fmap.rendering.styling.labeling.AttrInTableLabelingStrategy;
|
|
57 | 56 |
import com.iver.cit.gvsig.gui.panels.annotation.ConfigureLabel; |
58 | 57 |
|
59 | 58 |
|
... | ... | |
104 | 103 |
mapping.setColumnHeight(source.getFieldIndexByName( |
105 | 104 |
panel2.getSizeFieldName())); |
106 | 105 |
} |
107 |
AttrInTableLabeling labeling = new AttrInTableLabeling();
|
|
106 |
AttrInTableLabelingStrategy labeling = new AttrInTableLabelingStrategy();
|
|
108 | 107 |
labeling.setUnit(panel2.getCmbUnits().getSelectedUnitIndex()); |
109 | 108 |
this.layerAnnotation.setLabelingStrategy(labeling); |
110 | 109 |
// ((FSymbol) this.layerAnnotation.getLegend().getDefaultSymbol()).setFontSizeInPixels(panel2.sizeUnitsInPixels()); |
trunk/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_ConfigureLabel.java | ||
---|---|---|
63 | 63 |
import com.iver.andami.messages.NotificationManager; |
64 | 64 |
import com.iver.cit.gvsig.fmap.layers.Annotation_Layer; |
65 | 65 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
66 |
import com.iver.cit.gvsig.gui.JUnitsComboBox;
|
|
66 |
import com.iver.cit.gvsig.gui.JComboBoxUnits;
|
|
67 | 67 |
import com.iver.cit.gvsig.project.Project; |
68 | 68 |
|
69 | 69 |
|
... | ... | |
122 | 122 |
private JComboBox cmbFont = null; |
123 | 123 |
private EventsListener eventsListener = new EventsListener(); |
124 | 124 |
private SelectableDataSource sds; |
125 |
private JUnitsComboBox cmbUnits;
|
|
125 |
private JComboBoxUnits cmbUnits;
|
|
126 | 126 |
|
127 | 127 |
public Annotation_ConfigureLabel(JWizardComponents arg0, |
128 | 128 |
Annotation_Layer layer) { |
... | ... | |
452 | 452 |
* |
453 | 453 |
* @return DOCUMENT ME! |
454 | 454 |
*/ |
455 |
public JUnitsComboBox getCmbUnits() {
|
|
455 |
public JComboBoxUnits getCmbUnits() {
|
|
456 | 456 |
if (cmbUnits == null) { |
457 |
cmbUnits = new JUnitsComboBox();
|
|
457 |
cmbUnits = new JComboBoxUnits();
|
|
458 | 458 |
cmbUnits.setSelectedIndex(Project.getDefaultDistanceUnits()); |
459 | 459 |
cmbUnits.setName("CMBUNITS"); |
460 | 460 |
} |
trunk/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_Open.java | ||
---|---|---|
79 | 79 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
80 | 80 |
import com.iver.cit.gvsig.fmap.layers.LayerListener; |
81 | 81 |
import com.iver.cit.gvsig.fmap.layers.VectorialFileAdapter; |
82 |
import com.iver.cit.gvsig.fmap.rendering.Annotation_Legend; |
|
83 |
import com.iver.cit.gvsig.fmap.rendering.styling.AttrInTableLabeling; |
|
84 |
import com.iver.cit.gvsig.gui.JUnitsComboBox; |
|
82 |
import com.iver.cit.gvsig.fmap.rendering.styling.labeling.AttrInTableLabelingStrategy; |
|
83 |
import com.iver.cit.gvsig.gui.JComboBoxUnits; |
|
85 | 84 |
import com.iver.cit.gvsig.gui.WizardPanel; |
86 | 85 |
import com.iver.cit.gvsig.gui.panels.CRSSelectPanel; |
87 | 86 |
import com.iver.cit.gvsig.project.Project; |
88 | 87 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
89 |
import com.iver.utiles.swing.JComboBox; |
|
90 | 88 |
|
91 | 89 |
|
92 | 90 |
/** |
... | ... | |
104 | 102 |
private JPanel pFileSelection; |
105 | 103 |
private JPanel pControls; |
106 | 104 |
private JPanel pInPixels; |
107 |
private JUnitsComboBox cmbUnits;
|
|
105 |
private JComboBoxUnits cmbUnits;
|
|
108 | 106 |
|
109 | 107 |
public Annotation_Open() { |
110 | 108 |
super(); |
... | ... | |
392 | 390 |
* |
393 | 391 |
* @return DOCUMENT ME! |
394 | 392 |
*/ |
395 |
public JUnitsComboBox getCmbUnits() {
|
|
393 |
public JComboBoxUnits getCmbUnits() {
|
|
396 | 394 |
if (cmbUnits == null) { |
397 |
cmbUnits = new JUnitsComboBox();
|
|
395 |
cmbUnits = new JComboBoxUnits();
|
|
398 | 396 |
cmbUnits.setSelectedIndex(Project.getDefaultDistanceUnits()); |
399 | 397 |
cmbUnits.setName("CMBUNITS"); |
400 | 398 |
} |
... | ... | |
503 | 501 |
PluginServices.getLogger().error(e.getMessage(),e); |
504 | 502 |
return false; |
505 | 503 |
} |
506 |
AttrInTableLabeling labeling = new AttrInTableLabeling();
|
|
504 |
AttrInTableLabelingStrategy labeling = new AttrInTableLabelingStrategy();
|
|
507 | 505 |
labeling.setUnit(getCmbUnits().getSelectedUnitIndex()); |
508 | 506 |
al.setLabelingStrategy(labeling); |
509 | 507 |
// ((Annotation_Legend)al.getLegend()).setFontInPixels(getCmbInPixels() |
trunk/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/gui/PanelLegendAnnotation.java | ||
---|---|---|
44 | 44 |
*/ |
45 | 45 |
package com.iver.cit.gvsig.project.documents.view.legend.gui; |
46 | 46 |
|
47 |
import javax.swing.ButtonGroup; |
|
48 | 47 |
import javax.swing.JCheckBox; |
49 | 48 |
|
50 | 49 |
import com.iver.andami.PluginServices; |
... | ... | |
56 | 55 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
57 | 56 |
import com.iver.cit.gvsig.fmap.layers.LayerEvent; |
58 | 57 |
import com.iver.cit.gvsig.fmap.rendering.Annotation_Legend; |
59 |
import com.iver.cit.gvsig.fmap.rendering.ILegend; |
|
60 |
import com.iver.cit.gvsig.fmap.rendering.styling.AttrInTableLabeling; |
|
61 |
import com.iver.cit.gvsig.gui.JUnitsComboBox; |
|
58 |
import com.iver.cit.gvsig.fmap.rendering.styling.labeling.AttrInTableLabelingStrategy; |
|
59 |
import com.iver.cit.gvsig.gui.JComboBoxUnits; |
|
62 | 60 |
import com.iver.cit.gvsig.project.Project; |
63 | 61 |
|
64 | 62 |
/** |
... | ... | |
84 | 82 |
|
85 | 83 |
private JCheckBox chkAvoidOverLapping = null; |
86 | 84 |
|
87 |
private JUnitsComboBox cmbUnits;
|
|
85 |
private JComboBoxUnits cmbUnits;
|
|
88 | 86 |
|
89 | 87 |
/** |
90 | 88 |
* This is the default constructor |
... | ... | |
139 | 137 |
|
140 | 138 |
|
141 | 139 |
} |
142 |
public JUnitsComboBox getCmbUnits() {
|
|
140 |
public JComboBoxUnits getCmbUnits() {
|
|
143 | 141 |
if (cmbUnits == null) { |
144 |
cmbUnits = new JUnitsComboBox();
|
|
142 |
cmbUnits = new JComboBoxUnits();
|
|
145 | 143 |
cmbUnits.setSelectedIndex(Project.getDefaultDistanceUnits()); |
146 | 144 |
cmbUnits.setName("CMBUNITS"); |
147 | 145 |
cmbUnits.setBounds(new java.awt.Rectangle(27,50,303,23)); |
... | ... | |
299 | 297 |
} |
300 | 298 |
|
301 | 299 |
public void applyAction() { |
302 |
AttrInTableLabeling labeling = new AttrInTableLabeling();
|
|
300 |
AttrInTableLabelingStrategy labeling = new AttrInTableLabelingStrategy();
|
|
303 | 301 |
labeling.setUnit(getCmbUnits().getSelectedUnitIndex()); |
304 | 302 |
m_lyr.setLabelingStrategy(labeling); |
305 | 303 |
// m_Renderer.setFontInPixels(jRadioButton.isSelected()); |
... | ... | |
322 | 320 |
setFSymbol(m_Renderer.getDefaultSymbol()); |
323 | 321 |
getJCheckBoxTextOnly().setSelected(!m_Renderer.isPointVisible()); |
324 | 322 |
if (m_lyr.getLabelingStrategy()!=null){ |
325 |
getCmbUnits().setSelectedUnitIndex(((AttrInTableLabeling)m_lyr.getLabelingStrategy()).getUnit()); |
|
323 |
getCmbUnits().setSelectedUnitIndex(((AttrInTableLabelingStrategy)m_lyr.getLabelingStrategy()).getUnit());
|
|
326 | 324 |
}else{ |
327 | 325 |
getCmbUnits().setSelectedUnitIndex(-1); |
328 | 326 |
} |
Also available in: Unified diff