root / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / project / documents / view / toc / AbstractTocContextMenuAction.java @ 37338
History | View | Annotate | Download (3.27 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 59 Temple Place - Suite 330,
|
19 |
* Boston, MA 02111-1307, USA.
|
20 |
*
|
21 |
*/
|
22 |
package com.iver.cit.gvsig.project.documents.view.toc; |
23 |
|
24 |
import java.util.Map; |
25 |
|
26 |
import com.iver.cit.gvsig.fmap.MapContext; |
27 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
28 |
import com.iver.cit.gvsig.project.documents.contextMenu.AbstractContextMenuAction; |
29 |
import com.iver.utiles.extensionPoints.IExtensionBuilder; |
30 |
|
31 |
public abstract class AbstractTocContextMenuAction extends |
32 |
AbstractContextMenuAction implements IExtensionBuilder {
|
33 |
|
34 |
private MapContext mapContext;
|
35 |
|
36 |
public MapContext getMapContext() {
|
37 |
return this.mapContext; |
38 |
} |
39 |
|
40 |
public void setMapContext(MapContext mapContext) { |
41 |
this.mapContext = mapContext;
|
42 |
} |
43 |
|
44 |
/**
|
45 |
* @deprecated use public boolean isEnabled(ITocItem item, FLayer[]
|
46 |
* selectedItems)
|
47 |
*/
|
48 |
@Deprecated
|
49 |
@Override
|
50 |
public boolean isEnabled(Object item, Object[] selectedItems) { |
51 |
return this.isEnabled((ITocItem) item, (FLayer[]) selectedItems); |
52 |
} |
53 |
|
54 |
/**
|
55 |
* @deprecated use public boolean isVisible(ITocItem item, FLayer[]
|
56 |
* selectedItems)
|
57 |
*/
|
58 |
@Deprecated
|
59 |
@Override
|
60 |
public boolean isVisible(Object item, Object[] selectedItems) { |
61 |
return this.isVisible((ITocItem) item, (FLayer[]) selectedItems); |
62 |
} |
63 |
|
64 |
/**
|
65 |
* @deprecated use public void execute(ITocItem item, FLayer[]
|
66 |
* selectedItems)
|
67 |
*/
|
68 |
@Deprecated
|
69 |
public void execute(Object item, Object[] selectedItems) { |
70 |
this.execute((ITocItem) item, (FLayer[]) selectedItems); |
71 |
} |
72 |
|
73 |
public FLayer getNodeLayer(ITocItem node) {
|
74 |
if (isTocItemBranch(node)) {
|
75 |
return ((TocItemBranch) node).getLayer();
|
76 |
} |
77 |
return null; |
78 |
} |
79 |
|
80 |
public boolean isTocItemLeaf(ITocItem node) { |
81 |
return node instanceof TocItemLeaf; |
82 |
} |
83 |
|
84 |
public boolean isTocItemBranch(ITocItem node) { |
85 |
return node instanceof TocItemBranch; |
86 |
} |
87 |
|
88 |
public boolean isEnabled(ITocItem item, FLayer[] selectedItems) { |
89 |
return true; |
90 |
} |
91 |
|
92 |
public boolean isVisible(ITocItem item, FLayer[] selectedItems) { |
93 |
return true; |
94 |
} |
95 |
|
96 |
public abstract void execute(ITocItem item, FLayer[] selectedItems); |
97 |
|
98 |
public Object create() { |
99 |
return this; |
100 |
} |
101 |
|
102 |
public Object create(Map args) { |
103 |
// TODO Auto-generated method stub
|
104 |
return this; |
105 |
} |
106 |
|
107 |
public Object create(Object[] args) { |
108 |
// TODO Auto-generated method stub
|
109 |
return this; |
110 |
} |
111 |
|
112 |
} |