Revision 35740 branches/v2_0_0_prep/extensions/org.gvsig.daltransform.app.mainplugin/src/main/java/org/gvsig/daltransform/app/mainplugin/DataTransformExtension.java
DataTransformExtension.java | ||
---|---|---|
60 | 60 |
*/ |
61 | 61 |
public void execute(String actionCommand) { |
62 | 62 |
ApplicationManager application = ApplicationLocator.getManager(); |
63 |
DataTransformManager manager = DataTransformLocator.getDataTransformManager(); |
|
64 |
|
|
65 |
if ("CREATE".equalsIgnoreCase(actionCommand) ) { |
|
63 |
DataTransformManager manager = |
|
64 |
DataTransformLocator.getDataTransformManager(); |
|
65 |
|
|
66 |
if ("CREATE".equalsIgnoreCase(actionCommand)) { |
|
66 | 67 |
try { |
67 | 68 |
PluginServices.getMDIManager().addWindow( |
68 |
manager.createWizard().getWindow()); |
|
69 |
manager.createWizard().getWindow()); |
|
70 |
|
|
69 | 71 |
} catch (Exception e) { |
70 | 72 |
JOptionPane.showInternalMessageDialog( |
71 | 73 |
(Component) PluginServices.getMDIManager(), PluginServices |
... | ... | |
75 | 77 |
} |
76 | 78 |
} else |
77 | 79 |
if ("VIEW".equalsIgnoreCase(actionCommand)) { |
80 |
|
|
81 |
// TODO: no retorna null si no hay activeDocument |
|
82 |
System.out.println("no retorna null si no hay activeDocument: "); |
|
78 | 83 |
Document doc = |
79 | 84 |
application.getActiveDocument(ViewManager.TYPENAME); |
85 |
|
|
80 | 86 |
if (doc == null) { |
87 |
System.out.println("activeDocument es null"); |
|
81 | 88 |
// TODO |
82 | 89 |
return; |
83 | 90 |
} |
84 | 91 |
ViewDocument viewDocument = (ViewDocument) doc; |
85 | 92 |
FLayer[] activeLayers = |
86 | 93 |
viewDocument.getMapContext().getLayers().getActives(); |
94 |
|
|
87 | 95 |
if (activeLayers.length < 1) { |
88 | 96 |
// TODO |
97 |
System.out.println("one layer must be active (selected): " |
|
98 |
+ activeLayers.length); |
|
89 | 99 |
return; |
90 | 100 |
} |
91 | 101 |
if (activeLayers.length > 1) { |
92 | 102 |
// TODO |
103 |
System.out |
|
104 |
.println("there must be just one layer selected "); |
|
93 | 105 |
return; |
94 | 106 |
} |
95 | 107 |
if (!(activeLayers[0] instanceof FLyrVect)) { |
96 | 108 |
// TODO |
109 |
System.out.println("activeLayers[0] is not FLyrVect"); |
|
97 | 110 |
return; |
98 | 111 |
} |
99 | 112 |
FLyrVect layer = (FLyrVect) activeLayers[0]; |
113 |
|
|
100 | 114 |
JDialogDataTransformList dialog = |
101 | 115 |
manager.createJDialogDataTransformList((FeatureStore) layer |
102 | 116 |
.getDataStore()); |
103 | 117 |
ToolsWindowManager wm = new ToolsWindowManager(); |
104 |
wm.showWindow(dialog, "TODO", WindowManager.MODE.WINDOW,
|
|
105 |
GridBagConstraints.CENTER); |
|
118 |
wm.showWindow(dialog, "_View_transforms",
|
|
119 |
WindowManager.MODE.WINDOW, GridBagConstraints.CENTER);
|
|
106 | 120 |
} |
107 | 121 |
|
108 | 122 |
} |
Also available in: Unified diff