svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / GraphicControls.java @ 312
History | View | Annotate | Download (1.85 KB)
1 |
/*
|
---|---|
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 |
package com.iver.cit.gvsig; |
8 |
|
9 |
import org.apache.log4j.Logger; |
10 |
|
11 |
import com.iver.cit.gvsig.gui.layout.FLayoutGraphics; |
12 |
import com.iver.cit.gvsig.gui.layout.Layout; |
13 |
import com.iver.mdiApp.App; |
14 |
import com.iver.mdiApp.AppStatus; |
15 |
import com.iver.mdiApp.plugins.AbstractExtension; |
16 |
import com.iver.mdiApp.ui.MDIManager.View; |
17 |
|
18 |
|
19 |
/**
|
20 |
*
|
21 |
*
|
22 |
* @author Vicente Caballero Navarro
|
23 |
*/
|
24 |
public class GraphicControls extends AbstractExtension { |
25 |
private static Logger logger = Logger.getLogger(LayoutControls.class.getName()); |
26 |
|
27 |
/**
|
28 |
* DOCUMENT ME!
|
29 |
*
|
30 |
* @param s DOCUMENT ME!
|
31 |
*/
|
32 |
public void updateUI(AppStatus status, String s) { |
33 |
Layout layout = (Layout) status.getActiveView(); |
34 |
FLayoutGraphics lg= new FLayoutGraphics(layout);
|
35 |
logger.debug("Comand : " + s);
|
36 |
|
37 |
if (s.compareTo("SIMPLIFICAR") == 0) { |
38 |
lg.simplify(); |
39 |
} else if (s.compareTo("AGRUPAR") == 0) { |
40 |
lg.grouping(); |
41 |
} else if (s.compareTo("DESAGRUPAR") == 0) { |
42 |
lg.ungrouping(); |
43 |
} else if (s.compareTo("PROPIEDADES") == 0) { |
44 |
lg.openFFrameDialog(); |
45 |
} else if (s.compareTo("ALINEAR") == 0) { |
46 |
lg.aligning(); |
47 |
} else if (s.compareTo("DETRAS") == 0) { |
48 |
lg.behind(); |
49 |
} else if (s.compareTo("DELANTE") == 0) { |
50 |
lg.before(); |
51 |
} else if (s.compareTo("BORDEAR") == 0) { |
52 |
lg.border(); |
53 |
} else if (s.compareTo("POSICIONAR") == 0) { |
54 |
lg.position(); |
55 |
} |
56 |
} |
57 |
|
58 |
/**
|
59 |
* @see com.iver.mdiApp.plugins.Extension#isVisible()
|
60 |
*/
|
61 |
public boolean isVisible() { |
62 |
View f = App.instance.getMDIContext().getActiveView();
|
63 |
|
64 |
if (f == null) { |
65 |
return false; |
66 |
} |
67 |
|
68 |
if (f.getClass() == Layout.class) {
|
69 |
Layout layout = (Layout) f; |
70 |
|
71 |
return true; //layout.m_Display.getMapControl().getMapContext().getLayers().layerCount() > 0; |
72 |
} else {
|
73 |
return false; |
74 |
} |
75 |
} |
76 |
} |