Revision 18063 trunk/extensions/extTopology/src/org/gvsig/topology/ui/TopologyPropertiesPanel.java
TopologyPropertiesPanel.java | ||
---|---|---|
100 | 100 |
private GeneralTabPanel generalTab = null; |
101 | 101 |
private LayerSelectionPanel lyrsPanel = null; |
102 | 102 |
private TopologyRulesPanel rulesTabPanel = null; |
103 |
private TopologyErrorPanel errorPanel = null; |
|
103 | 104 |
|
104 |
|
|
105 | 105 |
private AcceptCancelPanel acceptCancelPanel = null; |
106 | 106 |
private boolean accepted = false; |
107 | 107 |
|
108 | 108 |
public TopologyPropertiesPanel(Topology topology){ |
109 | 109 |
this.originalTopology = topology; |
110 |
this.workingTopology = new Topology(topology.getMapContext(), topology.getMapContext().getLayers());
|
|
111 |
Topology.copyProperties(originalTopology, workingTopology); |
|
110 |
this.workingTopology = (Topology) topology.clone();
|
|
111 |
|
|
112 | 112 |
initialize(); |
113 | 113 |
} |
114 | 114 |
|
115 |
|
|
116 |
|
|
117 | 115 |
private void initialize() { |
118 | 116 |
this.setLayout(new BorderLayout()); |
119 | 117 |
this.setSize(523, 385); |
... | ... | |
183 | 181 |
|
184 | 182 |
|
185 | 183 |
//Topology errors tab |
186 |
JPanel errorsPanel = new JPanel();
|
|
187 |
getJTabbedPane().addTab(PluginServices.getText(this, "Errors"), errorsPanel);
|
|
184 |
errorPanel = new TopologyErrorPanel(workingTopology.getErrorContainer());
|
|
185 |
getJTabbedPane().addTab(PluginServices.getText(this, "Errors"), errorPanel); |
|
188 | 186 |
} |
189 | 187 |
|
190 | 188 |
private JTabbedPane getJTabbedPane() { |
... | ... | |
207 | 205 |
ActionListener okAction = new ActionListener() { |
208 | 206 |
public void actionPerformed(ActionEvent e) { |
209 | 207 |
accepted = true; |
210 |
verifyChanges(); |
|
208 |
try { |
|
209 |
verifyChanges(); |
|
210 |
} catch (CloneNotSupportedException e1) { |
|
211 |
// TODO Auto-generated catch block |
|
212 |
e1.printStackTrace(); |
|
213 |
} |
|
211 | 214 |
if (PluginServices.getMainFrame() == null) { |
212 | 215 |
((JDialog) (getParent().getParent().getParent().getParent())).dispose(); |
213 | 216 |
} else { |
... | ... | |
243 | 246 |
} |
244 | 247 |
|
245 | 248 |
|
246 |
private void verifyChanges(){ |
|
249 |
private void verifyChanges() throws CloneNotSupportedException{
|
|
247 | 250 |
|
248 | 251 |
if(generalTab.isChanged()){ |
249 | 252 |
String topologyName = generalTab.getTopologyName(); |
... | ... | |
267 | 270 |
workingTopology.setMaxNumberOfErrors(maxNumberOfErrors); |
268 | 271 |
}//general tab |
269 | 272 |
|
273 |
//TODO No hay modo de chequear si se han a?adido reglas o capas?? |
|
274 |
//si no, estamos copiando datos sin necesidad de working a original |
|
270 | 275 |
Topology.copyProperties(workingTopology, originalTopology); |
276 |
// this.originalTopology = (Topology) workingTopology.clone(); |
|
271 | 277 |
} |
272 | 278 |
|
273 | 279 |
|
... | ... | |
518 | 524 |
//FIXME Implementar TopologyErrorsPanel (visor alfanumerico de errores topologicos) |
519 | 525 |
//y el panel este del TabPanel |
520 | 526 |
|
521 |
class TopologyErrorsTabPanel extends JPanel{ |
|
522 |
void applyChanges(){ |
|
523 |
|
|
524 |
} |
|
525 |
} |
|
527 |
// class TopologyErrorsTabPanel extends JPanel{
|
|
528 |
// void applyChanges(){
|
|
529 |
// |
|
530 |
// }
|
|
531 |
// }
|
|
526 | 532 |
|
527 | 533 |
} |
Also available in: Unified diff