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