svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.expressionevaluator / org.gvsig.expressionevaluator.swing / org.gvsig.expressionevaluator.swing.api / src / main / java / org / gvsig / expressionevaluator / swing / spi / AbstractElement.java @ 43987
History | View | Annotate | Download (1.43 KB)
1 |
package org.gvsig.expressionevaluator.swing.spi; |
---|---|
2 |
|
3 |
import javax.swing.ImageIcon; |
4 |
import org.gvsig.expressionevaluator.swing.Element; |
5 |
import org.gvsig.tools.swing.api.Component; |
6 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
7 |
import org.gvsig.tools.swing.icontheme.IconTheme; |
8 |
|
9 |
/**
|
10 |
*
|
11 |
* @author jjdelcerro
|
12 |
*/
|
13 |
public abstract class AbstractElement implements Element { |
14 |
|
15 |
final String name; |
16 |
final String description; |
17 |
final String iconName; |
18 |
final ImageIcon icon; |
19 |
|
20 |
protected AbstractElement(String name, String description) { |
21 |
this(name,description,null); |
22 |
} |
23 |
|
24 |
protected AbstractElement(String name, String description, String iconName) { |
25 |
this.name = name;
|
26 |
this.description = description;
|
27 |
this.iconName = iconName;
|
28 |
IconTheme theme = ToolsSwingLocator.getIconThemeManager().getCurrent(); |
29 |
this.icon = theme.get(iconName);
|
30 |
} |
31 |
|
32 |
@Override
|
33 |
public String getName() { |
34 |
return this.name; |
35 |
} |
36 |
|
37 |
@Override
|
38 |
public String getDescription() { |
39 |
return this.description; |
40 |
} |
41 |
|
42 |
@Override
|
43 |
public String getIconName() { |
44 |
return iconName;
|
45 |
} |
46 |
|
47 |
@Override
|
48 |
public ImageIcon getIcon() { |
49 |
return this.icon; |
50 |
} |
51 |
|
52 |
@Override
|
53 |
public Component getAditionalPanel() { |
54 |
return null; |
55 |
} |
56 |
|
57 |
@Override
|
58 |
public String toString() { |
59 |
return this.getName(); |
60 |
} |
61 |
|
62 |
@Override
|
63 |
public void reload() { |
64 |
} |
65 |
|
66 |
|
67 |
} |