Revision 12131 branches/v10/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/gui/PanelLegendAnnotation.java

View differences:

PanelLegendAnnotation.java
57 57
import com.iver.cit.gvsig.fmap.rendering.VectorialLegend;
58 58

  
59 59
/**
60
 * @author fjp
60
 * Panel legend annotation properties.
61 61
 *
62
 * @author Vicente Caballero Navarro
62 63
 */
63 64
public class PanelLegendAnnotation extends AbstractPanel implements
64 65
		ILegendPanel {
......
75 76

  
76 77
	private JCheckBox jCheckBoxTextOnly = null;
77 78

  
78
	private JCheckBox chkOverWrite = null;
79
	private JCheckBox chkDelOverLapping = null;
79 80

  
81
	private JCheckBox chkAvoidOverLapping = null;
82

  
80 83
	/**
81 84
	 * This is the default constructor
82 85
	 */
......
100 103

  
101 104
		this.add(getJRadioButton1(), null);
102 105
		this.add(getJRadioButton(), null);
103
		this.add(getChkOverWrite(), null);
106
		this.add(getChkDelOverLapping(), null);
107
		this.add(getChkAvoidOverLapping(), null);
104 108
	}
105 109

  
106 110
	public void setLayer(FLayer lyr, Legend r) {
107 111
		m_lyr = (Annotation_Layer) lyr;
108 112
		m_Renderer = (VectorialLegend) r;
109 113
		// getJRadioButton().setSelected(m_lyr.isInPixels());
110
		getChkOverWrite().setSelected(((Annotation_Legend)r).isOverWrite());
114
		getChkAvoidOverLapping().setSelected(((Annotation_Legend)r).isAvoidOverLapping());
115
		getChkDelOverLapping().setSelected(((Annotation_Legend)r).isDelOverLapping());
116
//		getChkOverWrite()
111 117
		if (r.getDefaultSymbol() instanceof FSymbol)
112 118
			setFSymbol((FSymbol) r.getDefaultSymbol());
113 119
	}
......
131 137
		if (jRadioButton == null) {
132 138
			jRadioButton = new javax.swing.JRadioButton();
133 139
			jRadioButton.setText(PluginServices.getText(this, "En_pixels"));
134
			jRadioButton.setBounds(new java.awt.Rectangle(26, 50, 100, 23));
140
			jRadioButton.setBounds(new java.awt.Rectangle(27,50,303,23));
135 141
			jRadioButton.setSelected(true);
136 142
		}
137 143
		return jRadioButton;
......
146 152
		if (jRadioButton1 == null) {
147 153
			jRadioButton1 = new javax.swing.JRadioButton();
148 154
			jRadioButton1.setText(PluginServices.getText(this, "En_metros"));
149
			jRadioButton1.setBounds(new java.awt.Rectangle(27, 21, 100, 23));
155
			jRadioButton1.setBounds(new java.awt.Rectangle(27,21,303,23));
150 156
		}
151 157
		return jRadioButton1;
152 158
	}
......
161 167
	 */
162 168
	public void setRenderer(Legend renderer) {
163 169
		this.m_Renderer = (VectorialLegend) renderer;
164
		getChkOverWrite().setSelected(((Annotation_Legend)renderer).isOverWrite());
170
		getChkDelOverLapping().setSelected(((Annotation_Legend)renderer).isDelOverLapping());
171
		getChkAvoidOverLapping().setSelected(((Annotation_Legend)renderer).isAvoidOverLapping());
165 172
		if (m_Renderer.getDefaultSymbol() instanceof FSymbol)
166 173
			setFSymbol((FSymbol) m_Renderer.getDefaultSymbol());
167 174
	}
......
174 181
	private JCheckBox getJCheckBoxTextOnly() {
175 182
		if (jCheckBoxTextOnly == null) {
176 183
			jCheckBoxTextOnly = new JCheckBox();
177
			jCheckBoxTextOnly.setBounds(28, 88, 200, 22);
184
			jCheckBoxTextOnly.setBounds(27, 88, 303, 23);
178 185
			jCheckBoxTextOnly.setText(PluginServices.getText(this,
179 186
					"draw_text_only"));
180 187
		}
......
184 191
	public void updateValuesFromControls(VectorialLegend l) {
185 192
		m_FSymbol.setFontSizeInPixels(jRadioButton.isSelected());
186 193
		m_FSymbol.setShapeVisible(!jCheckBoxTextOnly.isSelected());
187
		((Annotation_Legend)l).setIsOverWrite(chkOverWrite.isSelected());
194
		((Annotation_Legend)l).setAvoidOverLapping(chkAvoidOverLapping.isSelected());
195
		((Annotation_Legend)l).setDelOverLapping(chkDelOverLapping.isSelected());
196

  
188 197
		// m_Renderer.setDefaultSymbol(m_FSymbol);
189 198
		l.setDefaultSymbol(m_FSymbol);
190 199
	}
......
203 212
	 *
204 213
	 * @return javax.swing.JCheckBox
205 214
	 */
206
	private JCheckBox getChkOverWrite() {
207
		if (chkOverWrite == null) {
208
			chkOverWrite = new JCheckBox();
209
			chkOverWrite.setBounds(new java.awt.Rectangle(28,121,121,23));
210
			chkOverWrite.setText(PluginServices.getText(this,"over_write"));
211
			chkOverWrite.setSelected(true);
215
	private JCheckBox getChkDelOverLapping() {
216
		if (chkDelOverLapping == null) {
217
			chkDelOverLapping = new JCheckBox();
218
			chkDelOverLapping.setBounds(new java.awt.Rectangle(27,147,303,23));
219
			chkDelOverLapping.setText(PluginServices.getText(this,"remove_annotation_overlapping"));
220
			chkDelOverLapping.setSelected(false);
212 221
		}
213
		return chkOverWrite;
222
		return chkDelOverLapping;
214 223
	}
224

  
225
	/**
226
	 * This method initializes chkTryNotOverWrite
227
	 *
228
	 * @return javax.swing.JCheckBox
229
	 */
230
	private JCheckBox getChkAvoidOverLapping() {
231
		if (chkAvoidOverLapping == null) {
232
			chkAvoidOverLapping = new JCheckBox();
233
			chkAvoidOverLapping.setBounds(new java.awt.Rectangle(27,116,303,23));
234
			chkAvoidOverLapping.setText(PluginServices.getText(this,"avoid_overlapping"));
235
		}
236
		return chkAvoidOverLapping;
237
	}
215 238
}

Also available in: Unified diff