svn-gvsig-desktop / trunk / extensions / extRasterTools-SE / src / org / gvsig / rastertools / generictoolbar / GenericToolBarMenuItem.java @ 18824
History | View | Annotate | Download (3.55 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*/
|
19 |
package org.gvsig.rastertools.generictoolbar; |
20 |
|
21 |
import javax.swing.Icon; |
22 |
|
23 |
import org.gvsig.raster.gui.IGenericToolBarMenuItem; |
24 |
|
25 |
import com.iver.andami.PluginServices; |
26 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
27 |
import com.iver.cit.gvsig.project.documents.view.toc.ITocItem; |
28 |
/**
|
29 |
* Clase que implementa un IGenericToolBarMenuItem para evitar tener que crear
|
30 |
* clases para items de menu sencillas
|
31 |
*
|
32 |
* @version 06/02/2008
|
33 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es)
|
34 |
*/
|
35 |
public class GenericToolBarMenuItem implements IGenericToolBarMenuItem { |
36 |
private String text = ""; |
37 |
private int order = 0; |
38 |
private Icon icon = null; |
39 |
private String group = ""; |
40 |
|
41 |
public GenericToolBarMenuItem(String text, Icon icon) { |
42 |
this(text, icon, "", 0); |
43 |
} |
44 |
|
45 |
public GenericToolBarMenuItem(String text) { |
46 |
this(text, PluginServices.getIconTheme().get("blank-icon"), "", 0); |
47 |
} |
48 |
|
49 |
public GenericToolBarMenuItem(String text, Icon icon, String group, int order) { |
50 |
this.text = text;
|
51 |
this.order = order;
|
52 |
this.icon = icon;
|
53 |
this.group = group;
|
54 |
} |
55 |
|
56 |
public GenericToolBarMenuItem(String text, Icon icon, String group) { |
57 |
this(text, icon, group, 0); |
58 |
} |
59 |
|
60 |
public GenericToolBarMenuItem(String text, Icon icon, int order) { |
61 |
this(text, icon, "", 0); |
62 |
} |
63 |
|
64 |
/*
|
65 |
* (non-Javadoc)
|
66 |
* @see org.gvsig.raster.gui.IGenericToolBarMenuItem#getGroup()
|
67 |
*/
|
68 |
public String getGroup() { |
69 |
return group;
|
70 |
} |
71 |
|
72 |
/*
|
73 |
* (non-Javadoc)
|
74 |
* @see org.gvsig.rastertools.generictoolbar.IGenericToolBarMenuItem#getOrder()
|
75 |
*/
|
76 |
public int getOrder() { |
77 |
return order;
|
78 |
} |
79 |
|
80 |
/*
|
81 |
* (non-Javadoc)
|
82 |
* @see org.gvsig.rastertools.generictoolbar.IGenericToolBarMenuItem#getText()
|
83 |
*/
|
84 |
public String getText() { |
85 |
return text;
|
86 |
} |
87 |
|
88 |
/*
|
89 |
* (non-Javadoc)
|
90 |
* @see org.gvsig.rastertools.generictoolbar.IGenericToolBarMenuItem#getIcon()
|
91 |
*/
|
92 |
public Icon getIcon() { |
93 |
return icon;
|
94 |
} |
95 |
|
96 |
/*
|
97 |
* (non-Javadoc)
|
98 |
* @see org.gvsig.raster.gui.IGenericToolBarMenuItem#isEnabled(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
|
99 |
*/
|
100 |
public boolean isEnabled(ITocItem item, FLayer[] selectedItems) { |
101 |
return true; |
102 |
} |
103 |
|
104 |
/*
|
105 |
* (non-Javadoc)
|
106 |
* @see org.gvsig.raster.gui.IGenericToolBarMenuItem#isVisible(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
|
107 |
*/
|
108 |
public boolean isVisible(ITocItem item, FLayer[] selectedItems) { |
109 |
return true; |
110 |
} |
111 |
|
112 |
/*
|
113 |
* (non-Javadoc)
|
114 |
* @see org.gvsig.raster.gui.IGenericToolBarMenuItem#execute(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
|
115 |
*/
|
116 |
public void execute(ITocItem item, FLayer[] selectedItems) {} |
117 |
} |