Revision 43593 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/gui/DefaultViewInformationArea.java
DefaultViewInformationArea.java | ||
---|---|---|
21 | 21 |
import java.util.Collections; |
22 | 22 |
import java.util.Comparator; |
23 | 23 |
import java.util.HashMap; |
24 |
import java.util.Iterator; |
|
24 | 25 |
import java.util.List; |
25 | 26 |
import java.util.Map; |
26 | 27 |
import javax.swing.Icon; |
27 | 28 |
import javax.swing.JComponent; |
28 | 29 |
import javax.swing.JPanel; |
29 | 30 |
import javax.swing.JTabbedPane; |
30 |
import org.gvsig.tools.swing.api.Component; |
|
31 | 31 |
import org.slf4j.Logger; |
32 | 32 |
import org.slf4j.LoggerFactory; |
33 | 33 |
|
... | ... | |
38 | 38 |
public class DefaultViewInformationArea implements ViewInformationArea { |
39 | 39 |
|
40 | 40 |
protected final Logger logger = LoggerFactory.getLogger(DefaultViewInformationArea.class); |
41 |
|
|
42 |
private static class Element implements Component {
|
|
41 |
|
|
42 |
private static class Element implements ViewInformationAreaElement {
|
|
43 | 43 |
|
44 | 44 |
private final JComponent component; |
45 | 45 |
private final String id; |
46 |
private final String label;
|
|
47 |
private final Icon icon;
|
|
48 |
private final int priority;
|
|
46 |
private String label; |
|
47 |
private Icon icon; |
|
48 |
private int priority; |
|
49 | 49 |
private String tip; |
50 | 50 |
|
51 | 51 |
public Element(JComponent component, String id, int priority, String label, Icon icon, String tip) { |
... | ... | |
57 | 57 |
this.tip = tip; |
58 | 58 |
} |
59 | 59 |
|
60 |
@Override |
|
60 | 61 |
public int getPriority() { |
61 | 62 |
return this.priority; |
62 | 63 |
} |
... | ... | |
66 | 67 |
return this.component; |
67 | 68 |
} |
68 | 69 |
|
70 |
@Override |
|
69 | 71 |
public String getLabel() { |
70 | 72 |
return this.label; |
71 | 73 |
} |
72 | 74 |
|
75 |
@Override |
|
76 |
public void setLabel(String label) { |
|
77 |
this.label = label; |
|
78 |
} |
|
79 |
|
|
80 |
@Override |
|
73 | 81 |
public String getTip() { |
74 | 82 |
return this.tip; |
75 | 83 |
} |
76 | 84 |
|
85 |
@Override |
|
77 | 86 |
public Icon getIcon() { |
78 | 87 |
return this.icon; |
79 | 88 |
} |
89 |
|
|
90 |
@Override |
|
91 |
public void setIcon(Icon icon) { |
|
92 |
this.icon = icon; |
|
93 |
} |
|
94 |
|
|
95 |
@Override |
|
96 |
public void setPriority(int priority) { |
|
97 |
this.priority = priority; |
|
98 |
} |
|
99 |
|
|
100 |
@Override |
|
101 |
public void setTip(String tip) { |
|
102 |
this.tip = tip; |
|
103 |
} |
|
80 | 104 |
} |
81 | 105 |
|
82 |
private final Map<String,Element> elements; |
|
106 |
private final Map<String,ViewInformationAreaElement> elements;
|
|
83 | 107 |
private JPanel panel; |
84 | 108 |
private JTabbedPane tab; |
85 | 109 |
|
... | ... | |
97 | 121 |
} |
98 | 122 |
|
99 | 123 |
@Override |
124 |
public ViewInformationAreaElement get(String id) { |
|
125 |
ViewInformationAreaElement x = this.elements.get(id); |
|
126 |
return x; |
|
127 |
} |
|
128 |
|
|
129 |
@Override |
|
130 |
public Iterator<ViewInformationAreaElement> iterator() { |
|
131 |
Iterator<ViewInformationAreaElement> x = this.elements.values().iterator(); |
|
132 |
return x; |
|
133 |
} |
|
134 |
|
|
135 |
@Override |
|
100 | 136 |
public void remove(String id) { |
101 | 137 |
this.elements.remove(id); |
102 | 138 |
this.update(); |
103 | 139 |
} |
104 | 140 |
|
105 |
private void update() { |
|
141 |
@Override |
|
142 |
public void update() { |
|
106 | 143 |
if( this.panel == null ) { |
107 | 144 |
return; |
108 | 145 |
} |
Also available in: Unified diff