Revision 24891
trunk/libraries/lib3DMap-share/src/main/java/com/iver/ai2/gvsig3d/legend/ExtrusionProve.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
public class ExtrusionProve implements ILegendPanel{ |
31 | 31 |
|
32 |
private ClassifiableVectorial layer; |
|
33 |
private ExtrusionLegendPanel extrusionPanel = null; |
|
34 |
|
|
35 | 32 |
public String getDescription() { |
36 |
return "Extrusion legend description"; |
|
33 |
// TODO Auto-generated method stub |
|
34 |
return null; |
|
37 | 35 |
} |
38 | 36 |
|
39 | 37 |
public ImageIcon getIcon() { |
... | ... | |
53 | 51 |
|
54 | 52 |
public JPanel getPanel() { |
55 | 53 |
// TODO Auto-generated method stub |
56 |
if ( extrusionPanel == null){ |
|
57 |
extrusionPanel = new ExtrusionLegendPanel(); |
|
58 |
} |
|
59 |
|
|
60 |
return extrusionPanel; |
|
54 |
return null; |
|
61 | 55 |
} |
62 | 56 |
|
63 | 57 |
public Class getParentClass() { |
... | ... | |
67 | 61 |
|
68 | 62 |
public String getTitle() { |
69 | 63 |
// TODO Auto-generated method stub |
70 |
return ("<html><b>"+ "Extrusi?n Legend"+ "</b></html>");
|
|
64 |
return null;
|
|
71 | 65 |
} |
72 | 66 |
|
73 | 67 |
public boolean isSuitableFor(FLayer layer) { |
74 | 68 |
// TODO Auto-generated method stub |
75 |
return (layer instanceof FLyrVect);
|
|
69 |
return false;
|
|
76 | 70 |
} |
77 | 71 |
|
78 | 72 |
public void setData(FLayer lyr, ILegend legend) { |
79 | 73 |
// TODO Auto-generated method stub |
80 |
this.layer = (ClassifiableVectorial) layer; |
|
81 |
extrusionPanel.setLyr((FLyrVect) lyr); |
|
82 | 74 |
|
83 | 75 |
} |
84 |
|
|
85 |
|
|
86 |
|
|
87 |
public Table getAssociatedTable(FLyrVect lyr){ |
|
88 |
Table auxTable = null; |
|
89 |
BaseView vista = (BaseView) PluginServices.getMDIManager().getActiveWindow(); |
|
90 |
FLayer[] actives = vista.getModel().getMapContext().getLayers() |
|
91 |
.getActives(); |
|
92 | 76 |
|
93 |
try { |
|
94 |
for (int i = 0; i < actives.length; i++) { |
|
95 |
if (actives[i] instanceof AlphanumericData) { |
|
96 |
AlphanumericData co = (AlphanumericData) actives[i]; |
|
77 |
// private ClassifiableVectorial layer; |
|
78 |
// private ExtrusionLegendPanel extrusionPanel = null; |
|
79 |
// |
|
80 |
// public String getDescription() { |
|
81 |
// return "Extrusion legend description"; |
|
82 |
// } |
|
83 |
// |
|
84 |
// public ImageIcon getIcon() { |
|
85 |
// // TODO Auto-generated method stub |
|
86 |
// return null; |
|
87 |
// } |
|
88 |
// |
|
89 |
// public ILegend getLegend() { |
|
90 |
// // TODO Auto-generated method stub |
|
91 |
// return null; |
|
92 |
// } |
|
93 |
// |
|
94 |
// public Class getLegendClass() { |
|
95 |
// // TODO Auto-generated method stub |
|
96 |
// return null; |
|
97 |
// } |
|
98 |
// |
|
99 |
// public JPanel getPanel() { |
|
100 |
// // TODO Auto-generated method stub |
|
101 |
// if ( extrusionPanel == null){ |
|
102 |
// extrusionPanel = new ExtrusionLegendPanel(); |
|
103 |
// } |
|
104 |
// |
|
105 |
// return extrusionPanel; |
|
106 |
// } |
|
107 |
// |
|
108 |
// public Class getParentClass() { |
|
109 |
// // TODO Auto-generated method stub |
|
110 |
// return null; |
|
111 |
// } |
|
112 |
// |
|
113 |
// public String getTitle() { |
|
114 |
// // TODO Auto-generated method stub |
|
115 |
// return ("<html><b>"+ "Extrusi?n Legend"+ "</b></html>"); |
|
116 |
// } |
|
117 |
// |
|
118 |
// public boolean isSuitableFor(FLayer layer) { |
|
119 |
// // TODO Auto-generated method stub |
|
120 |
// return (layer instanceof FLyrVect); |
|
121 |
// } |
|
122 |
// |
|
123 |
// public void setData(FLayer lyr, ILegend legend) { |
|
124 |
// // TODO Auto-generated method stub |
|
125 |
// this.layer = (ClassifiableVectorial) layer; |
|
126 |
// extrusionPanel.setLyr((FLyrVect) lyr); |
|
127 |
// |
|
128 |
// } |
|
129 |
// |
|
130 |
// |
|
131 |
// |
|
132 |
// public Table getAssociatedTable(FLyrVect lyr){ |
|
133 |
// Table auxTable = null; |
|
134 |
// BaseView vista = (BaseView) PluginServices.getMDIManager().getActiveWindow(); |
|
135 |
// FLayer[] actives = vista.getModel().getMapContext().getLayers() |
|
136 |
// .getActives(); |
|
137 |
// |
|
138 |
// try { |
|
139 |
// for (int i = 0; i < actives.length; i++) { |
|
140 |
// if (actives[i] instanceof AlphanumericData) { |
|
141 |
// AlphanumericData co = (AlphanumericData) actives[i]; |
|
142 |
// |
|
143 |
// //SelectableDataSource dataSource; |
|
144 |
// //dataSource = co.getRecordset(); |
|
145 |
// |
|
146 |
// ProjectExtension ext = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class); |
|
147 |
// |
|
148 |
// ProjectTable projectTable = ext.getProject().getTable(co); |
|
149 |
// EditableAdapter ea=null; |
|
150 |
// ReadableVectorial rv=((FLyrVect)actives[i]).getSource(); |
|
151 |
// if (rv instanceof VectorialEditableAdapter){ |
|
152 |
// ea=(EditableAdapter)((FLyrVect)actives[i]).getSource(); |
|
153 |
// }else{ |
|
154 |
// ea=new EditableAdapter(); |
|
155 |
// SelectableDataSource sds=((FLyrVect)actives[i]).getRecordset(); |
|
156 |
// ea.setOriginalDataSource(sds); |
|
157 |
// } |
|
158 |
// |
|
159 |
// if (projectTable == null) { |
|
160 |
// projectTable = ProjectFactory.createTable(PluginServices.getText(this, "Tabla_de_Atributos") + ": " + actives[i].getName(), |
|
161 |
// ea); |
|
162 |
// projectTable.setProjectDocumentFactory(new ProjectTableFactory()); |
|
163 |
// projectTable.setAssociatedTable(co); |
|
164 |
// ext.getProject().addDocument(projectTable); |
|
165 |
// } |
|
166 |
// projectTable.setModel(ea); |
|
167 |
// Table t = new Table(); |
|
168 |
// t.setModel(projectTable); |
|
169 |
//// if (ea.isEditing()) |
|
170 |
//// ea.getCommandRecord().addCommandListener(t); |
|
171 |
//// t.getModel().setModified(true); |
|
172 |
//// PluginServices.getMDIManager().addWindow(t); |
|
173 |
// auxTable = t; |
|
174 |
// } |
|
175 |
// } |
|
176 |
// } catch (ReadDriverException e) { |
|
177 |
// NotificationManager.addError(PluginServices.getText(this,"No_se_pudo_obtener_la_tabla_de_la_capa"), e); |
|
178 |
// } |
|
179 |
// return auxTable; |
|
180 |
// } |
|
97 | 181 |
|
98 |
//SelectableDataSource dataSource; |
|
99 |
//dataSource = co.getRecordset(); |
|
100 |
|
|
101 |
ProjectExtension ext = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class); |
|
102 |
|
|
103 |
ProjectTable projectTable = ext.getProject().getTable(co); |
|
104 |
EditableAdapter ea=null; |
|
105 |
ReadableVectorial rv=((FLyrVect)actives[i]).getSource(); |
|
106 |
if (rv instanceof VectorialEditableAdapter){ |
|
107 |
ea=(EditableAdapter)((FLyrVect)actives[i]).getSource(); |
|
108 |
}else{ |
|
109 |
ea=new EditableAdapter(); |
|
110 |
SelectableDataSource sds=((FLyrVect)actives[i]).getRecordset(); |
|
111 |
ea.setOriginalDataSource(sds); |
|
112 |
} |
|
113 |
|
|
114 |
if (projectTable == null) { |
|
115 |
projectTable = ProjectFactory.createTable(PluginServices.getText(this, "Tabla_de_Atributos") + ": " + actives[i].getName(), |
|
116 |
ea); |
|
117 |
projectTable.setProjectDocumentFactory(new ProjectTableFactory()); |
|
118 |
projectTable.setAssociatedTable(co); |
|
119 |
ext.getProject().addDocument(projectTable); |
|
120 |
} |
|
121 |
projectTable.setModel(ea); |
|
122 |
Table t = new Table(); |
|
123 |
t.setModel(projectTable); |
|
124 |
// if (ea.isEditing()) |
|
125 |
// ea.getCommandRecord().addCommandListener(t); |
|
126 |
// t.getModel().setModified(true); |
|
127 |
// PluginServices.getMDIManager().addWindow(t); |
|
128 |
auxTable = t; |
|
129 |
} |
|
130 |
} |
|
131 |
} catch (ReadDriverException e) { |
|
132 |
NotificationManager.addError(PluginServices.getText(this,"No_se_pudo_obtener_la_tabla_de_la_capa"), e); |
|
133 |
} |
|
134 |
return auxTable; |
|
135 |
} |
|
136 |
|
|
137 | 182 |
} |
Also available in: Unified diff