Revision 7837
trunk/extensions/extGraph_predes/src/com/iver/cit/gvsig/graph/GraphExtension.java | ||
---|---|---|
6 | 6 |
|
7 | 7 |
import com.iver.andami.PluginServices; |
8 | 8 |
import com.iver.andami.plugins.Extension; |
9 |
import com.iver.andami.ui.mdiManager.IWindow; |
|
9 | 10 |
import com.iver.andami.ui.mdiManager.SingletonDialogAlreadyShownException; |
10 |
import com.iver.andami.ui.mdiManager.ViewInfo; |
|
11 |
import com.iver.cit.gvsig.fmap.core.FShape; |
|
12 | 11 |
import com.iver.cit.gvsig.fmap.DriverException; |
13 |
import com.iver.cit.gvsig.fmap.FMap;
|
|
12 |
import com.iver.cit.gvsig.fmap.core.FShape;
|
|
14 | 13 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
15 | 14 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
16 |
import com.iver.cit.gvsig.gui.View; |
|
17 |
import com.iver.cit.gvsig.project.ProjectView; |
|
18 |
import com.iver.utiles.swing.threads.IMonitorableTask; |
|
15 |
import com.iver.cit.gvsig.project.documents.view.IProjectView; |
|
16 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
|
19 | 17 |
|
20 | 18 |
import edu.uci.ics.jung.graph.impl.DirectedSparseGraph; |
21 | 19 |
|
... | ... | |
43 | 41 |
*/ |
44 | 42 |
public void execute(String actionCommand) { |
45 | 43 |
if(actionCommand.equalsIgnoreCase("REDES")){ |
46 |
FLayer[] actives = ((View)PluginServices.getMDIManager().getActiveView()).
|
|
44 |
FLayer[] actives = ((View)PluginServices.getMDIManager().getActiveWindow()).
|
|
47 | 45 |
getModel().getMapContext().getLayers().getActives(); |
48 | 46 |
final FLyrVect lyr = (FLyrVect) actives[0]; |
49 | 47 |
final Flag flag = new Flag(); |
... | ... | |
53 | 51 |
|
54 | 52 |
DirectedSparseGraph graph = |
55 | 53 |
(DirectedSparseGraph) graphGenerator.buildGraph(); |
56 |
com.iver.andami.ui.mdiManager.View view = graphGenerator.getGraphLayout(graph, lyr.getFullExtent());
|
|
57 |
PluginServices.getMDIManager().addView(view);
|
|
54 |
IWindow view = graphGenerator.getGraphLayout(graph, lyr.getFullExtent());
|
|
55 |
PluginServices.getMDIManager().addWindow(view);
|
|
58 | 56 |
} catch (SingletonDialogAlreadyShownException e) { |
59 | 57 |
// TODO Auto-generated catch block |
60 | 58 |
e.printStackTrace(); |
... | ... | |
83 | 81 |
* @see com.iver.andami.plugins.IExtension#isVisible() |
84 | 82 |
*/ |
85 | 83 |
public boolean isVisible() { |
86 |
com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager() |
|
87 |
.getActiveView(); |
|
84 |
IWindow f = PluginServices.getMDIManager().getActiveWindow(); |
|
88 | 85 |
if (f == null) { |
89 | 86 |
return false; |
90 | 87 |
} |
91 | 88 |
if (f instanceof View) { |
92 | 89 |
View vista = (View) f; |
93 |
ProjectView model = vista.getModel(); |
|
90 |
IProjectView model = vista.getModel();
|
|
94 | 91 |
FLayer[] actives = model.getMapContext().getLayers().getActives(); |
95 | 92 |
if(actives == null || actives.length == 0) |
96 | 93 |
return false; |
trunk/extensions/extGraph_predes/src/com/iver/cit/gvsig/graph/LinesLayerGraphGenerator.java | ||
---|---|---|
17 | 17 |
|
18 | 18 |
import org.cresques.cts.ProjectionPool; |
19 | 19 |
|
20 |
import com.iver.andami.ui.mdiManager.ViewInfo; |
|
20 |
import com.iver.andami.ui.mdiManager.IWindow; |
|
21 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
|
21 | 22 |
import com.iver.cit.gvsig.fmap.DriverException; |
22 | 23 |
import com.iver.cit.gvsig.fmap.ViewPort; |
23 | 24 |
import com.iver.cit.gvsig.fmap.core.FShape; |
... | ... | |
69 | 70 |
this.linesLayer = layer; |
70 | 71 |
} |
71 | 72 |
|
72 |
public com.iver.andami.ui.mdiManager.View getGraphLayout(Graph graph, Rectangle2D fullExtent){
|
|
73 |
public IWindow getGraphLayout(Graph graph, Rectangle2D fullExtent){
|
|
73 | 74 |
StaticLayout l = new StaticLayout(graph); |
74 | 75 |
final ViewPort viewPort = new ViewPort(ProjectionPool.get("EPSG:23030")); |
75 | 76 |
viewPort.setImageSize(new Dimension(700, 600)); |
... | ... | |
94 | 95 |
} |
95 | 96 |
|
96 | 97 |
class VisualizationViewerView extends JPanel |
97 |
implements com.iver.andami.ui.mdiManager.View{
|
|
98 |
implements IWindow {
|
|
98 | 99 |
|
99 | 100 |
VisualizationViewerView(VisualizationViewer vv){ |
100 | 101 |
add(vv); |
101 | 102 |
setSize(700,600); |
102 | 103 |
} |
103 | 104 |
|
104 |
public ViewInfo getViewInfo() {
|
|
105 |
ViewInfo viewInfo = new
|
|
106 |
ViewInfo(ViewInfo.MODELESSDIALOG);
|
|
105 |
public WindowInfo getWindowInfo() {
|
|
106 |
WindowInfo viewInfo = new
|
|
107 |
WindowInfo(WindowInfo.MODELESSDIALOG);
|
|
107 | 108 |
viewInfo.setTitle("Analisis_de_redes"); |
108 | 109 |
return viewInfo; |
109 | 110 |
} |
... | ... | |
114 | 115 |
FLyrVect riverLayer = null; |
115 | 116 |
//Para evitar todos estos casts, hay que meter la |
116 | 117 |
//interfaz FileWriter |
117 |
String fileName = "C:/JUMP/datos/cauces_gv.shp";
|
|
118 |
String fileName = "C:/ejes.shp";
|
|
118 | 119 |
String layerName = ""; |
119 | 120 |
File file = new File(fileName); |
120 | 121 |
try { |
Also available in: Unified diff