svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / GraphicControls.java @ 4258
History | View | Annotate | Download (3.43 KB)
1 | 312 | fernando | /*
|
---|---|---|---|
2 | * Created on 15-jul-2004
|
||
3 | *
|
||
4 | * To change the template for this generated file go to
|
||
5 | * Window>Preferences>Java>Code Generation>Code and Comments
|
||
6 | */
|
||
7 | 1103 | fjp | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
8 | *
|
||
9 | * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
||
10 | *
|
||
11 | * This program is free software; you can redistribute it and/or
|
||
12 | * modify it under the terms of the GNU General Public License
|
||
13 | * as published by the Free Software Foundation; either version 2
|
||
14 | * of the License, or (at your option) any later version.
|
||
15 | *
|
||
16 | * This program is distributed in the hope that it will be useful,
|
||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
19 | * GNU General Public License for more details.
|
||
20 | *
|
||
21 | * You should have received a copy of the GNU General Public License
|
||
22 | * along with this program; if not, write to the Free Software
|
||
23 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
24 | *
|
||
25 | * For more information, contact:
|
||
26 | *
|
||
27 | * Generalitat Valenciana
|
||
28 | * Conselleria d'Infraestructures i Transport
|
||
29 | * Av. Blasco Ib??ez, 50
|
||
30 | * 46010 VALENCIA
|
||
31 | * SPAIN
|
||
32 | *
|
||
33 | * +34 963862235
|
||
34 | * gvsig@gva.es
|
||
35 | * www.gvsig.gva.es
|
||
36 | *
|
||
37 | * or
|
||
38 | *
|
||
39 | * IVER T.I. S.A
|
||
40 | * Salamanca 50
|
||
41 | * 46005 Valencia
|
||
42 | * Spain
|
||
43 | *
|
||
44 | * +34 963163400
|
||
45 | * dac@iver.es
|
||
46 | */
|
||
47 | 312 | fernando | package com.iver.cit.gvsig; |
48 | |||
49 | 596 | fernando | import com.iver.andami.PluginServices; |
50 | import com.iver.andami.plugins.Extension; |
||
51 | import com.iver.andami.ui.mdiManager.View; |
||
52 | 1219 | vcaballero | |
53 | 312 | fernando | import com.iver.cit.gvsig.gui.layout.FLayoutGraphics; |
54 | import com.iver.cit.gvsig.gui.layout.Layout; |
||
55 | |||
56 | 1219 | vcaballero | import org.apache.log4j.Logger; |
57 | 312 | fernando | |
58 | 1219 | vcaballero | |
59 | 312 | fernando | /**
|
60 | 1219 | vcaballero | * Extensi?n que actua sobre el Layout para controlas las diferentes
|
61 | * operaciones sobre los gr?ficos.
|
||
62 | *
|
||
63 | 312 | fernando | * @author Vicente Caballero Navarro
|
64 | */
|
||
65 | 596 | fernando | public class GraphicControls implements Extension { |
66 | 1219 | vcaballero | private static Logger logger = Logger.getLogger(GraphicControls.class.getName()); |
67 | 312 | fernando | |
68 | /**
|
||
69 | 1219 | vcaballero | * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
|
70 | 312 | fernando | */
|
71 | 596 | fernando | public void execute(String s) { |
72 | Layout layout = (Layout) PluginServices.getMDIManager().getActiveView(); |
||
73 | 1219 | vcaballero | FLayoutGraphics lg = new FLayoutGraphics(layout);
|
74 | 312 | fernando | logger.debug("Comand : " + s);
|
75 | |||
76 | if (s.compareTo("SIMPLIFICAR") == 0) { |
||
77 | lg.simplify(); |
||
78 | } else if (s.compareTo("AGRUPAR") == 0) { |
||
79 | 3550 | caballero | layout.getEFS().startComplexCommand(); |
80 | 312 | fernando | lg.grouping(); |
81 | 3550 | caballero | layout.getEFS().endComplexCommand(); |
82 | 312 | fernando | } else if (s.compareTo("DESAGRUPAR") == 0) { |
83 | lg.ungrouping(); |
||
84 | } else if (s.compareTo("PROPIEDADES") == 0) { |
||
85 | lg.openFFrameDialog(); |
||
86 | } else if (s.compareTo("ALINEAR") == 0) { |
||
87 | lg.aligning(); |
||
88 | } else if (s.compareTo("DETRAS") == 0) { |
||
89 | lg.behind(); |
||
90 | } else if (s.compareTo("DELANTE") == 0) { |
||
91 | lg.before(); |
||
92 | } else if (s.compareTo("BORDEAR") == 0) { |
||
93 | lg.border(); |
||
94 | } else if (s.compareTo("POSICIONAR") == 0) { |
||
95 | lg.position(); |
||
96 | 1219 | vcaballero | } |
97 | 312 | fernando | } |
98 | |||
99 | /**
|
||
100 | * @see com.iver.mdiApp.plugins.Extension#isVisible()
|
||
101 | */
|
||
102 | public boolean isVisible() { |
||
103 | 596 | fernando | View f = PluginServices.getMDIManager().getActiveView();
|
104 | 312 | fernando | |
105 | if (f == null) { |
||
106 | return false; |
||
107 | } |
||
108 | |||
109 | if (f.getClass() == Layout.class) {
|
||
110 | 2429 | caballero | // Layout layout = (Layout) f;
|
111 | 312 | fernando | |
112 | return true; //layout.m_Display.getMapControl().getMapContext().getLayers().layerCount() > 0; |
||
113 | } else {
|
||
114 | return false; |
||
115 | } |
||
116 | } |
||
117 | 596 | fernando | |
118 | /**
|
||
119 | * @see com.iver.andami.plugins.Extension#inicializar()
|
||
120 | */
|
||
121 | public void inicializar() { |
||
122 | } |
||
123 | |||
124 | /**
|
||
125 | * @see com.iver.andami.plugins.Extension#isEnabled()
|
||
126 | */
|
||
127 | public boolean isEnabled() { |
||
128 | 676 | vcaballero | return true; |
129 | 596 | fernando | } |
130 | 312 | fernando | } |