Revision 24994 trunk/extensions/extAnnotations/src/org/gvsig/tools/annotations/labeling/gui/ConfigTargetLayer.java
ConfigTargetLayer.java | ||
---|---|---|
77 | 77 |
import com.iver.cit.gvsig.project.documents.view.gui.BaseView; |
78 | 78 |
|
79 | 79 |
/** |
80 |
*
|
|
80 |
* |
|
81 | 81 |
* @author Cesar Martinez Izquierdo <cesar.martinez@iver.es> 12:00:04 |
82 | 82 |
* |
83 | 83 |
*/ |
... | ... | |
115 | 115 |
constraints.weighty = 0.0; |
116 | 116 |
constraints.insets = new Insets(4,10,8,4); |
117 | 117 |
getContent().add(lbl_header, constraints); |
118 |
|
|
118 |
|
|
119 | 119 |
ButtonGroup group = new ButtonGroup(); |
120 | 120 |
group.add(getFileButton()); |
121 | 121 |
group.add(getLayerButton()); |
... | ... | |
130 | 130 |
constraints.weighty = 0.0; |
131 | 131 |
constraints.insets = new Insets(4,10,4,6); |
132 | 132 |
getContent().add(getFileButton(), constraints); |
133 |
|
|
133 |
|
|
134 | 134 |
constraints.gridx = 1; |
135 | 135 |
constraints.gridy = 1; |
136 | 136 |
constraints.gridwidth = 1; |
... | ... | |
141 | 141 |
getContent().add(getFileNameField(), constraints); |
142 | 142 |
|
143 | 143 |
JPanel detailLine = new JPanel(new GridBagLayout()); |
144 |
|
|
144 |
|
|
145 | 145 |
constraints.gridx = 0; |
146 | 146 |
constraints.gridy = 2; |
147 | 147 |
constraints.gridwidth = 2; |
... | ... | |
151 | 151 |
constraints.weighty = 0.0; |
152 | 152 |
constraints.insets = new Insets(3,20,10,6); |
153 | 153 |
getContent().add(detailLine, constraints); |
154 |
|
|
154 |
|
|
155 | 155 |
constraints.gridx = 0; |
156 | 156 |
constraints.gridy = 3; |
157 | 157 |
constraints.gridwidth = 1; |
... | ... | |
161 | 161 |
constraints.weighty = 0.0; |
162 | 162 |
constraints.insets = new Insets(4,10,4,6); |
163 | 163 |
getContent().add(getLayerButton(), constraints); |
164 |
|
|
164 |
|
|
165 | 165 |
constraints.gridx = 1; |
166 | 166 |
constraints.gridy = 3; |
167 | 167 |
constraints.fill = GridBagConstraints.HORIZONTAL; |
... | ... | |
169 | 169 |
constraints.weightx = 0.1; |
170 | 170 |
constraints.weighty = 0.0; |
171 | 171 |
getContent().add(getLayersCombo(), constraints); |
172 |
|
|
173 |
|
|
172 |
|
|
173 |
|
|
174 | 174 |
constraints.gridx = 0; |
175 | 175 |
constraints.gridy = 4; |
176 | 176 |
constraints.gridwidth = 3; |
... | ... | |
179 | 179 |
constraints.weightx = 1.0; |
180 | 180 |
constraints.weighty = 0.2; |
181 | 181 |
getContent().add(new JPanel(), constraints); // empty panel |
182 |
|
|
182 |
|
|
183 | 183 |
Annotation_Layer lyr = toolUI.getTargetLayer(); |
184 | 184 |
if (lyr!=null) { |
185 | 185 |
getLayersCombo().setSelectedItem( |
... | ... | |
188 | 188 |
} |
189 | 189 |
else { |
190 | 190 |
selectFileMode(); |
191 |
}
|
|
191 |
} |
|
192 | 192 |
} |
193 | 193 |
|
194 | 194 |
private void selectFileMode() { |
195 | 195 |
getFileButton().setSelected(true); |
196 | 196 |
getFileNameField().setEnabled(true); |
197 | 197 |
getLayersCombo().setEnabled(false); |
198 |
|
|
198 |
|
|
199 | 199 |
} |
200 | 200 |
|
201 | 201 |
private void selectExistingLayerMode() { |
... | ... | |
270 | 270 |
} |
271 | 271 |
|
272 | 272 |
private class ComboItem { |
273 |
private Annotation_Layer layer;
|
|
273 |
private Annotation_Layer layer; |
|
274 | 274 |
public ComboItem(Annotation_Layer layer) { |
275 | 275 |
this.layer = layer; |
276 | 276 |
} |
... | ... | |
282 | 282 |
public Annotation_Layer getLayer() { |
283 | 283 |
return layer; |
284 | 284 |
} |
285 |
|
|
285 |
|
|
286 | 286 |
@Override |
287 | 287 |
public boolean equals(Object obj) { |
288 | 288 |
if (obj instanceof ComboItem) { |
... | ... | |
305 | 305 |
private boolean apply() { |
306 | 306 |
if (getLayerButton().isSelected()) { |
307 | 307 |
ComboItem item = (ComboItem) getLayersCombo().getSelectedItem(); |
308 |
if (item!=null) {
|
|
308 |
if (item!=null) { |
|
309 | 309 |
toolUI.setTargetLayer(item.getLayer()); |
310 | 310 |
return true; |
311 | 311 |
} |
... | ... | |
371 | 371 |
} |
372 | 372 |
return file; |
373 | 373 |
} |
374 |
|
|
374 |
|
|
375 | 375 |
public void actionButtonPressed(ButtonsPanelEvent e) { |
376 | 376 |
switch (e.getButton()) { |
377 | 377 |
case ButtonsPanel.BUTTON_ACCEPT: |
378 | 378 |
if (apply()) { |
379 |
PluginServices.getMDIManager().closeWindow(this);
|
|
379 |
PluginServices.getMDIManager().closeWindow(this); |
|
380 | 380 |
} |
381 | 381 |
break; |
382 | 382 |
case ButtonsPanel.BUTTON_APPLY: |
... | ... | |
385 | 385 |
case ButtonsPanel.BUTTON_CANCEL: |
386 | 386 |
PluginServices.getMDIManager().closeWindow(this); |
387 | 387 |
break; |
388 |
|
|
388 |
|
|
389 | 389 |
} |
390 | 390 |
} |
391 | 391 |
|
392 |
@Override |
|
393 | 392 |
public Object getWindowProfile() { |
394 | 393 |
return WindowInfo.TOOL_PROFILE; |
395 | 394 |
} |
Also available in: Unified diff