svn-gvsig-desktop / trunk / extensions / extArcims / src / es / prodevelop / cit / gvsig / arcims / gui / toc / ArcImsLayerScaleTocMenuEntry.java @ 8300
History | View | Annotate | Download (1.88 KB)
1 |
package es.prodevelop.cit.gvsig.arcims.gui.toc; |
---|---|
2 |
|
3 |
import java.awt.event.ActionEvent; |
4 |
|
5 |
import javax.swing.JMenuItem; |
6 |
|
7 |
import com.iver.andami.PluginServices; |
8 |
import com.iver.andami.ui.mdiManager.IWindow; |
9 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
10 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
11 |
import com.iver.cit.gvsig.project.documents.view.toc.TocMenuEntry; |
12 |
import com.iver.cit.gvsig.project.documents.view.toc.gui.FPopupMenu; |
13 |
|
14 |
import es.prodevelop.cit.gvsig.arcims.fmap.layers.FRasterLyrArcIMS; |
15 |
import es.prodevelop.cit.gvsig.arcims.gui.dialogs.LayerScaleDialog; |
16 |
|
17 |
|
18 |
/**
|
19 |
* This class implements the scale limits status properties menu item that is
|
20 |
* added to the ArcIMS layer's popup menu.
|
21 |
|
22 |
* @author jldominguez
|
23 |
*/
|
24 |
public class ArcImsLayerScaleTocMenuEntry extends TocMenuEntry { |
25 |
|
26 |
private JMenuItem scaleMenuItem; |
27 |
FLayer lyr = null;
|
28 |
private LayerScaleDialog scaleDialog;
|
29 |
|
30 |
public void initialize(FPopupMenu m) { |
31 |
super.initialize(m);
|
32 |
|
33 |
if (isTocItemBranch()) {
|
34 |
lyr = getNodeLayer(); |
35 |
// ArcIMS layer
|
36 |
if ((lyr instanceof FRasterLyrArcIMS)) { |
37 |
scaleMenuItem = new JMenuItem(PluginServices.getText(this, "layer_scale_status")); |
38 |
getMenu().addSeparator(); |
39 |
getMenu().add( scaleMenuItem ); |
40 |
scaleMenuItem.setFont(FPopupMenu.theFont); |
41 |
getMenu().setEnabled(true);
|
42 |
scaleMenuItem.addActionListener(this);
|
43 |
} |
44 |
} |
45 |
|
46 |
} |
47 |
|
48 |
/**
|
49 |
* Creates an LayerScaleDialog object and adds it to the MDIManager.
|
50 |
*/
|
51 |
public void actionPerformed(ActionEvent e) { |
52 |
|
53 |
if (scaleDialog != null) { |
54 |
PluginServices.getMDIManager().closeWindow(scaleDialog); |
55 |
} |
56 |
lyr = getNodeLayer(); |
57 |
|
58 |
IWindow v = PluginServices.getMDIManager().getActiveWindow(); |
59 |
View vista = null; if (v instanceof View) vista = (View) v; |
60 |
// vista.get
|
61 |
scaleDialog = new LayerScaleDialog((FRasterLyrArcIMS) lyr, vista);
|
62 |
PluginServices.getMDIManager().addWindow(scaleDialog); |
63 |
} |
64 |
|
65 |
} |
66 |
|