Revision 38608
branches/v2_0_0_prep/libraries/org.gvsig.annotation/org.gvsig.annotation.swing/org.gvsig.annotation.swing.impl/src/main/java/org/gvsig/annotation/swing/impl/AnnotationSwingDefaultImplLibrary.java | ||
---|---|---|
25 | 25 |
|
26 | 26 |
import org.gvsig.annotation.swing.AnnotationSwingLibrary; |
27 | 27 |
import org.gvsig.annotation.swing.AnnotationSwingLocator; |
28 |
import org.gvsig.gui.beans.wizard.WizardPanelWithLogo; |
|
28 | 29 |
import org.gvsig.i18n.Messages; |
29 | 30 |
import org.gvsig.tools.library.AbstractLibrary; |
30 | 31 |
import org.gvsig.tools.library.LibraryException; |
32 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
33 |
import org.gvsig.tools.swing.icontheme.IconThemeManager; |
|
31 | 34 |
|
32 | 35 |
/** |
33 | 36 |
* Library for default swing implementation initialization and configuration. |
... | ... | |
46 | 49 |
protected void doInitialize() throws LibraryException { |
47 | 50 |
AnnotationSwingLocator |
48 | 51 |
.registerSwingManager(DefaultAnnotationSwingManager.class); |
52 |
|
|
53 |
IconThemeManager themeManager = ToolsSwingLocator.getIconThemeManager(); |
|
54 |
|
|
55 |
themeManager.getDefault().registerDefault( |
|
56 |
this.getClass().getName(), |
|
57 |
"annotation", |
|
58 |
"wizard-annotation", |
|
59 |
null, |
|
60 |
this.getClass().getClassLoader().getResource("org/gvsig/annotation/swing/impl/images/wizard-icon.png") |
|
61 |
); |
|
62 |
|
|
49 | 63 |
} |
50 | 64 |
|
51 | 65 |
@Override |
branches/v2_0_0_prep/libraries/org.gvsig.annotation/org.gvsig.annotation.swing/org.gvsig.annotation.swing.impl/src/main/java/org/gvsig/annotation/swing/impl/DefaultJAnnotationCreationServicePanel.java | ||
---|---|---|
45 | 45 |
import org.gvsig.gui.beans.wizard.WizardPanelWithLogo; |
46 | 46 |
import org.gvsig.i18n.Messages; |
47 | 47 |
import org.gvsig.tools.service.ServiceException; |
48 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
49 |
import org.gvsig.tools.swing.icontheme.IconThemeManager; |
|
48 | 50 |
import org.gvsig.tools.task.TaskStatus; |
49 | 51 |
|
50 | 52 |
/** |
... | ... | |
77 | 79 |
|
78 | 80 |
super(); |
79 | 81 |
|
80 |
URL iconURL = getClass().getClassLoader().getResource("org/gvsig/annotation/swing/impl/images/wizard-icon.png"); |
|
81 |
ImageIcon icon = new ImageIcon(iconURL); |
|
82 |
wizardPanelWithLogo = new WizardPanelWithLogo(icon); |
|
82 |
IconThemeManager themeManager = ToolsSwingLocator.getIconThemeManager(); |
|
83 |
wizardPanelWithLogo = new WizardPanelWithLogo(themeManager.getCurrent().get("wizard-annotation")); |
|
83 | 84 |
|
84 | 85 |
this.annotationCreationService = annotationCreationService; |
85 | 86 |
this.annotationSwingManager = annotationSwingManager; |
branches/v2_0_0_prep/libraries/org.gvsig.symbology/org.gvsig.symbology.swing/org.gvsig.symbology.swing.impl/pom.xml | ||
---|---|---|
13 | 13 |
<dependencies> |
14 | 14 |
<dependency> |
15 | 15 |
<groupId>org.gvsig</groupId> |
16 |
<artifactId>org.gvsig.tools.swing.api</artifactId> |
|
17 |
<scope>compile</scope> |
|
18 |
</dependency> |
|
19 |
<dependency> |
|
20 |
<groupId>org.gvsig</groupId> |
|
16 | 21 |
<artifactId>org.gvsig.symbology.lib.api</artifactId> |
17 | 22 |
<version>2.0.0-SNAPSHOT</version> |
18 |
<scope>compile</scope>
|
|
23 |
<scope>compile</scope>
|
|
19 | 24 |
</dependency> |
20 | 25 |
<dependency> |
21 | 26 |
<groupId>org.gvsig</groupId> |
22 | 27 |
<artifactId>org.gvsig.symbology.swing.api</artifactId> |
23 | 28 |
<version>2.0.0-SNAPSHOT</version> |
24 |
<scope>compile</scope>
|
|
29 |
<scope>compile</scope>
|
|
25 | 30 |
</dependency> |
26 | 31 |
<dependency> |
27 | 32 |
<groupId>org.gvsig</groupId> |
... | ... | |
39 | 44 |
<dependency> |
40 | 45 |
<groupId>org.gvsig</groupId> |
41 | 46 |
<artifactId>org.gvsig.ui</artifactId> |
42 |
<scope>compile</scope>
|
|
47 |
<scope>compile</scope>
|
|
43 | 48 |
</dependency> |
44 | 49 |
<dependency> |
45 | 50 |
<groupId>org.gvsig</groupId> |
... | ... | |
53 | 58 |
<classifier>impl</classifier> |
54 | 59 |
<scope>test</scope> |
55 | 60 |
</dependency> |
56 |
<dependency> |
|
57 |
<groupId>org.gvsig</groupId> |
|
58 |
<artifactId>org.gvsig.projection</artifactId> |
|
59 |
<scope>test</scope> |
|
60 |
</dependency> |
|
61 | 61 |
<dependency> |
62 | 62 |
<groupId>org.gvsig</groupId> |
63 | 63 |
<artifactId>org.gvsig.projection</artifactId> |
64 |
<scope>test</scope> |
|
65 |
</dependency> |
|
66 |
<dependency> |
|
67 |
<groupId>org.gvsig</groupId> |
|
68 |
<artifactId>org.gvsig.projection</artifactId> |
|
64 | 69 |
<classifier>cresques-impl</classifier> |
65 | 70 |
<scope>test</scope> |
66 | 71 |
</dependency> |
... | ... | |
70 | 75 |
<classifier>se</classifier> |
71 | 76 |
<scope>test</scope> |
72 | 77 |
</dependency> |
73 |
<dependency>
|
|
74 |
<groupId>org.gvsig</groupId>
|
|
75 |
<artifactId>org.gvsig.fmap.mapcontext</artifactId>
|
|
76 |
<scope>test</scope>
|
|
77 |
</dependency>
|
|
78 |
<dependency>
|
|
79 |
<groupId>org.gvsig</groupId>
|
|
80 |
<artifactId>org.gvsig.fmap.mapcontext</artifactId>
|
|
81 |
<classifier>impl</classifier>
|
|
82 |
<scope>test</scope>
|
|
83 |
</dependency>
|
|
78 |
<dependency>
|
|
79 |
<groupId>org.gvsig</groupId>
|
|
80 |
<artifactId>org.gvsig.fmap.mapcontext</artifactId>
|
|
81 |
<scope>test</scope>
|
|
82 |
</dependency>
|
|
83 |
<dependency>
|
|
84 |
<groupId>org.gvsig</groupId>
|
|
85 |
<artifactId>org.gvsig.fmap.mapcontext</artifactId>
|
|
86 |
<classifier>impl</classifier>
|
|
87 |
<scope>test</scope>
|
|
88 |
</dependency>
|
|
84 | 89 |
</dependencies> |
85 | 90 |
</project> |
branches/v2_0_0_prep/libraries/org.gvsig.symbology/org.gvsig.symbology.swing/org.gvsig.symbology.swing.impl/src/main/java/org/gvsig/symbology/swing/impl/SymbologySwingDefaultImplLibrary.java | ||
---|---|---|
21 | 21 |
*/ |
22 | 22 |
package org.gvsig.symbology.swing.impl; |
23 | 23 |
|
24 |
|
|
24 | 25 |
import org.gvsig.symbology.swing.SymbologySwingLibrary; |
25 | 26 |
import org.gvsig.symbology.swing.SymbologySwingLocator; |
26 | 27 |
import org.gvsig.tools.library.AbstractLibrary; |
... | ... | |
43 | 44 |
protected void doInitialize() throws LibraryException { |
44 | 45 |
SymbologySwingLocator |
45 | 46 |
.registerSwingManager(DefaultSymbologySwingManager.class); |
47 |
|
|
48 |
// LineProperties |
|
49 |
IconThemeHelper.registerIcon("line-properties", "line-properties-join-bevel", this); |
|
50 |
IconThemeHelper.registerIcon("line-properties", "line-properties-join-bevel-selected", this); |
|
51 |
IconThemeHelper.registerIcon("line-properties", "line-properties-join-miter", this); |
|
52 |
IconThemeHelper.registerIcon("line-properties", "line-properties-join-miter-selected", this); |
|
53 |
IconThemeHelper.registerIcon("line-properties", "line-properties-join-round", this); |
|
54 |
IconThemeHelper.registerIcon("line-properties", "line-properties-join-round-selected", this); |
|
55 |
IconThemeHelper.registerIcon("line-properties", "line-properties-cap-butt", this); |
|
56 |
IconThemeHelper.registerIcon("line-properties", "line-properties-cap-butt-selected", this); |
|
57 |
IconThemeHelper.registerIcon("line-properties", "line-properties-cap-round", this); |
|
58 |
IconThemeHelper.registerIcon("line-properties", "line-properties-cap-round-selected", this); |
|
59 |
IconThemeHelper.registerIcon("line-properties", "line-properties-cap-square", this); |
|
60 |
IconThemeHelper.registerIcon("line-properties", "line-properties-cap-square-selected", this); |
|
61 |
// SymbolLayerManager |
|
62 |
IconThemeHelper.registerIcon("symbol-editor", "symbol-editor-unlocked", this); |
|
46 | 63 |
} |
47 | 64 |
|
48 | 65 |
@Override |
branches/v2_0_0_prep/libraries/org.gvsig.symbology/org.gvsig.symbology.swing/org.gvsig.symbology.swing.impl/src/main/java/org/gvsig/symbology/swing/impl/IconThemeHelper.java | ||
---|---|---|
1 |
package org.gvsig.symbology.swing.impl; |
|
2 |
|
|
3 |
import java.awt.Image; |
|
4 |
|
|
5 |
import javax.swing.ImageIcon; |
|
6 |
|
|
7 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
8 |
import org.gvsig.tools.swing.icontheme.IconTheme; |
|
9 |
import org.gvsig.tools.swing.icontheme.IconThemeManager; |
|
10 |
import org.slf4j.Logger; |
|
11 |
import org.slf4j.LoggerFactory; |
|
12 |
|
|
13 |
public class IconThemeHelper { |
|
14 |
|
|
15 |
private static Logger logger = LoggerFactory.getLogger(IconThemeHelper.class); |
|
16 |
|
|
17 |
@SuppressWarnings("rawtypes") |
|
18 |
public static void registerIcon(String group, String name, Object obj) { |
|
19 |
String resourceName; |
|
20 |
ClassLoader loader; |
|
21 |
String provider; |
|
22 |
IconTheme iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent(); |
|
23 |
if( group == null || group.trim().length()==0 ) { |
|
24 |
resourceName = "images/"+name+".png"; |
|
25 |
} else { |
|
26 |
resourceName = "images/"+group+"/"+name+".png"; |
|
27 |
} |
|
28 |
if( obj instanceof Class ) { |
|
29 |
loader = ((Class) obj).getClassLoader(); |
|
30 |
provider = ((Class) obj).getName(); |
|
31 |
} else { |
|
32 |
loader = obj.getClass().getClassLoader(); |
|
33 |
provider = obj.getClass().getName(); |
|
34 |
} |
|
35 |
try { |
|
36 |
iconTheme.registerDefault(provider, group, name, null, loader.getResource(resourceName)); |
|
37 |
} catch( Throwable e) { |
|
38 |
logger.info(e.getMessage()); |
|
39 |
} |
|
40 |
} |
|
41 |
|
|
42 |
public static ImageIcon getImageIcon(String iconName) { |
|
43 |
IconThemeManager manager = ToolsSwingLocator.getIconThemeManager(); |
|
44 |
return manager.getCurrent().get(iconName); |
|
45 |
} |
|
46 |
|
|
47 |
public static Image getImage(String iconName) { |
|
48 |
IconThemeManager manager = ToolsSwingLocator.getIconThemeManager(); |
|
49 |
return manager.getCurrent().get(iconName).getImage(); |
|
50 |
} |
|
51 |
} |
|
0 | 52 |
branches/v2_0_0_prep/libraries/org.gvsig.symbology/org.gvsig.symbology.swing/org.gvsig.symbology.swing.api/src/main/java/org/gvsig/app/gui/styling/LineProperties.java | ||
---|---|---|
10 | 10 |
import javax.swing.BorderFactory; |
11 | 11 |
import javax.swing.BoxLayout; |
12 | 12 |
import javax.swing.ButtonGroup; |
13 |
import javax.swing.ImageIcon; |
|
14 | 13 |
import javax.swing.JButton; |
15 | 14 |
import javax.swing.JLabel; |
16 | 15 |
import javax.swing.JPanel; |
17 | 16 |
import javax.swing.JRadioButton; |
18 | 17 |
|
19 |
import org.gvsig.andami.PluginServices;
|
|
18 |
import org.gvsig.andami.IconThemeHelper;
|
|
20 | 19 |
import org.gvsig.gui.beans.DefaultBean; |
21 | 20 |
import org.gvsig.gui.beans.swing.JBlank; |
22 | 21 |
import org.gvsig.i18n.Messages; |
... | ... | |
55 | 54 |
|
56 | 55 |
pnlJoin.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), Messages.getText("join_style")+":")); |
57 | 56 |
|
58 |
////////// |
|
59 |
PluginServices.getIconTheme().registerDefault( |
|
60 |
"join-bevel", |
|
61 |
this.getClass().getClassLoader().getResource("images/join_bevel.png")); |
|
62 |
PluginServices.getIconTheme().registerDefault( |
|
63 |
"join-bevel-selected", |
|
64 |
this.getClass().getClassLoader().getResource("images/join_bevel-selected.png")); |
|
65 |
ImageIcon img= PluginServices.getIconTheme().get("join-bevel"); |
|
66 |
|
|
67 | 57 |
JPanel d = new JPanel(); |
68 | 58 |
JPanel toCenter; |
69 | 59 |
d.setLayout(new BoxLayout(d, BoxLayout.Y_AXIS)); |
70 |
joinBevel = new JRadioButton(img);
|
|
71 |
joinBevel.setSelectedIcon(PluginServices.getIconTheme().get("join-bevel-selected"));
|
|
60 |
joinBevel = new JRadioButton(IconThemeHelper.getImageIcon("line-properties-join-bevel"));
|
|
61 |
joinBevel.setSelectedIcon(IconThemeHelper.getImageIcon("line-properties-join-bevel-selected"));
|
|
72 | 62 |
FlowLayout flowCenteredLayout = new FlowLayout(FlowLayout.CENTER, 0, 0); |
73 | 63 |
toCenter = new JPanel(flowCenteredLayout); |
74 | 64 |
toCenter.add(joinBevel); |
... | ... | |
80 | 70 |
|
81 | 71 |
pnlJoin.add(d); |
82 | 72 |
|
83 |
PluginServices.getIconTheme().registerDefault( |
|
84 |
"join-miter", |
|
85 |
this.getClass().getClassLoader().getResource("images/join_miter.png")); |
|
86 |
PluginServices.getIconTheme().registerDefault( |
|
87 |
"join-miter-selected", |
|
88 |
this.getClass().getClassLoader().getResource("images/join_miter-selected.png")); |
|
89 | 73 |
|
90 |
img= PluginServices.getIconTheme().get("join-miter"); |
|
91 |
|
|
92 | 74 |
d = new JPanel(); |
93 | 75 |
d.setLayout(new BoxLayout(d, BoxLayout.Y_AXIS)); |
94 |
joinMiter = new JRadioButton(img);
|
|
95 |
joinMiter.setSelectedIcon(PluginServices.getIconTheme().get("join-miter-selected"));
|
|
76 |
joinMiter = new JRadioButton(IconThemeHelper.getImageIcon("line-properties-join-miter"));
|
|
77 |
joinMiter.setSelectedIcon(IconThemeHelper.getImageIcon("line-properties-join-miter-selected"));
|
|
96 | 78 |
toCenter = new JPanel(flowCenteredLayout); |
97 | 79 |
toCenter.add(joinMiter); |
98 | 80 |
d.add(toCenter); |
... | ... | |
102 | 84 |
d.add(toCenter); |
103 | 85 |
pnlJoin.add(d); |
104 | 86 |
|
105 |
PluginServices.getIconTheme().registerDefault( |
|
106 |
"join-round", |
|
107 |
this.getClass().getClassLoader().getResource("images/join_round.png")); |
|
108 |
PluginServices.getIconTheme().registerDefault( |
|
109 |
"join-round-selected", |
|
110 |
this.getClass().getClassLoader().getResource("images/join_round-selected.png")); |
|
111 |
img= PluginServices.getIconTheme().get("join-round"); |
|
112 | 87 |
|
88 |
|
|
113 | 89 |
d = new JPanel(); |
114 | 90 |
d.setLayout(new BoxLayout(d, BoxLayout.Y_AXIS)); |
115 |
joinRound = new JRadioButton(img);
|
|
116 |
joinRound.setSelectedIcon(PluginServices.getIconTheme().get("join-round-selected"));
|
|
91 |
joinRound = new JRadioButton(IconThemeHelper.getImageIcon("line-properties-join-round"));
|
|
92 |
joinRound.setSelectedIcon(IconThemeHelper.getImageIcon("line-properties-join-round-selected"));
|
|
117 | 93 |
toCenter = new JPanel(flowCenteredLayout); |
118 | 94 |
toCenter.add(joinRound); |
119 | 95 |
d.add(toCenter); |
... | ... | |
134 | 110 |
JPanel pnlCap = new JPanel(new FlowLayout(FlowLayout.LEFT, 30, 0)); |
135 | 111 |
pnlCap.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), Messages.getText("end_style")+":")); |
136 | 112 |
|
137 |
PluginServices.getIconTheme().registerDefault( |
|
138 |
"cap-butt", |
|
139 |
this.getClass().getClassLoader().getResource("images/cap_butt.png")); |
|
140 |
PluginServices.getIconTheme().registerDefault( |
|
141 |
"cap-butt-selected", |
|
142 |
this.getClass().getClassLoader().getResource("images/cap_butt-selected.png")); |
|
143 |
img= PluginServices.getIconTheme().get("cap-butt"); |
|
144 |
|
|
145 | 113 |
JPanel c = new JPanel(); |
146 | 114 |
c.setLayout(new BoxLayout(c, BoxLayout.Y_AXIS)); |
147 |
capBut = new JRadioButton(img);
|
|
148 |
capBut.setSelectedIcon(PluginServices.getIconTheme().get("cap-butt-selected"));
|
|
115 |
capBut = new JRadioButton(IconThemeHelper.getImageIcon("line-properties-cap-butt"));
|
|
116 |
capBut.setSelectedIcon(IconThemeHelper.getImageIcon("line-properties-cap-butt-selected"));
|
|
149 | 117 |
toCenter = new JPanel(flowCenteredLayout); |
150 | 118 |
toCenter.add(capBut); |
151 | 119 |
c.add(toCenter); |
... | ... | |
154 | 122 |
c.add(toCenter); |
155 | 123 |
pnlCap.add(c); |
156 | 124 |
|
157 |
PluginServices.getIconTheme().registerDefault( |
|
158 |
"cap-round", |
|
159 |
this.getClass().getClassLoader().getResource("images/cap_round.png")); |
|
160 |
PluginServices.getIconTheme().registerDefault( |
|
161 |
"cap-round-selected", |
|
162 |
this.getClass().getClassLoader().getResource("images/cap_round-selected.png")); |
|
163 |
img= PluginServices.getIconTheme().get("cap-round"); |
|
164 |
|
|
165 |
|
|
166 | 125 |
JPanel a = new JPanel(); |
167 | 126 |
a.setLayout(new BoxLayout(a, BoxLayout.Y_AXIS)); |
168 |
capRound = new JRadioButton(img);
|
|
169 |
capRound.setSelectedIcon(PluginServices.getIconTheme().get("cap-round-selected"));
|
|
127 |
capRound = new JRadioButton(IconThemeHelper.getImageIcon("line-properties-cap-round"));
|
|
128 |
capRound.setSelectedIcon(IconThemeHelper.getImageIcon("line-properties-cap-round-selected"));
|
|
170 | 129 |
toCenter = new JPanel(flowCenteredLayout); |
171 | 130 |
toCenter.add(capRound); |
172 | 131 |
a.add(toCenter); |
... | ... | |
175 | 134 |
a.add(toCenter); |
176 | 135 |
pnlCap.add(a); |
177 | 136 |
|
178 |
PluginServices.getIconTheme().registerDefault( |
|
179 |
"cap-square", |
|
180 |
this.getClass().getClassLoader().getResource("images/cap_square.png")); |
|
181 |
PluginServices.getIconTheme().registerDefault( |
|
182 |
"cap-square-selected", |
|
183 |
this.getClass().getClassLoader().getResource("images/cap_square-selected.png")); |
|
184 |
img= PluginServices.getIconTheme().get("cap-square"); |
|
185 | 137 |
|
186 | 138 |
JPanel b = new JPanel(); |
187 | 139 |
b.setLayout(new BoxLayout(b, BoxLayout.Y_AXIS)); |
188 |
capSquare = new JRadioButton(img);
|
|
189 |
capSquare.setSelectedIcon(PluginServices.getIconTheme().get("cap-square-selected"));
|
|
140 |
capSquare = new JRadioButton(IconThemeHelper.getImageIcon("line-properties-cap-square"));
|
|
141 |
capSquare.setSelectedIcon(IconThemeHelper.getImageIcon("line-properties-cap-square-selected"));
|
|
190 | 142 |
toCenter = new JPanel(flowCenteredLayout); |
191 | 143 |
toCenter.add(capSquare); |
192 | 144 |
|
branches/v2_0_0_prep/libraries/org.gvsig.symbology/org.gvsig.symbology.swing/org.gvsig.symbology.swing.api/src/main/java/org/gvsig/app/gui/styling/SymbolLayerManager.java | ||
---|---|---|
125 | 125 |
import javax.swing.event.ListSelectionEvent; |
126 | 126 |
import javax.swing.event.ListSelectionListener; |
127 | 127 |
|
128 |
import org.gvsig.andami.IconThemeHelper; |
|
128 | 129 |
import org.gvsig.andami.PluginServices; |
129 | 130 |
import org.gvsig.app.project.documents.view.legend.gui.ISymbolSelector; |
130 | 131 |
import org.gvsig.fmap.geom.Geometry; |
... | ... | |
414 | 415 |
// "images/unlocked.png"; |
415 | 416 |
// else |
416 | 417 |
// source = "images/unlocked.png"; |
417 |
String source = "images/unlocked.png"; |
|
418 | 418 |
|
419 |
ImageIcon icon = new ImageIcon(getClass(). |
|
420 |
getClassLoader().getResource(source)); |
|
421 |
JButton btnLock = new JButton(icon); |
|
419 |
|
|
420 |
JButton btnLock = new JButton(IconThemeHelper.getImageIcon("symbol-editor-unlocked")); |
|
422 | 421 |
btnLock.setSize(btnDimension); |
423 | 422 |
btnLock.setPreferredSize(btnDimension); |
424 | 423 |
btnLock.setActionCommand("LOCK"); |
branches/v2_0_0_prep/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.impl/src/main/java/org/gvsig/exportto/swing/impl/DefaultJExporttoServicePanel.java | ||
---|---|---|
33 | 33 |
import org.slf4j.Logger; |
34 | 34 |
import org.slf4j.LoggerFactory; |
35 | 35 |
|
36 |
import org.gvsig.andami.IconThemeHelper; |
|
36 | 37 |
import org.gvsig.exportto.ExporttoService; |
37 | 38 |
import org.gvsig.exportto.ExporttoServiceException; |
38 | 39 |
import org.gvsig.exportto.ExporttoServiceFinishAction; |
... | ... | |
113 | 114 |
this.providerTypes = providerTypes; |
114 | 115 |
this.status = JOptionPane.UNDEFINED_CONDITION; |
115 | 116 |
|
116 |
URL iconURL = |
|
117 |
getClass().getClassLoader().getResource( |
|
118 |
"org/gvsig/exportto/swing/impl/images/exporttoicon.png"); |
|
119 |
ImageIcon icon = new ImageIcon(iconURL); |
|
120 |
wizardPanelWithLogo = new WizardPanelWithLogo(icon); |
|
117 |
wizardPanelWithLogo = new WizardPanelWithLogo(IconThemeHelper.getImageIcon("wizard-export-to")); |
|
121 | 118 |
|
122 | 119 |
// Initialize the wizards |
123 | 120 |
exporterSelectionWizard = |
branches/v2_0_0_prep/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.impl/src/main/java/org/gvsig/exportto/swing/impl/ExporttoSwingDefaultImplLibrary.java | ||
---|---|---|
23 | 23 |
|
24 | 24 |
import java.util.Locale; |
25 | 25 |
|
26 |
import org.gvsig.andami.IconThemeHelper; |
|
26 | 27 |
import org.gvsig.exportto.swing.ExporttoSwingLibrary; |
27 | 28 |
import org.gvsig.exportto.swing.ExporttoSwingLocator; |
28 | 29 |
import org.gvsig.exportto.swing.spi.ExporttoSwingProviderLocator; |
... | ... | |
56 | 57 |
Messages.addResourceFamily("org.gvsig.exportto.swing.impl.i18n.text", |
57 | 58 |
ExporttoSwingDefaultImplLibrary.class.getClassLoader(), |
58 | 59 |
ExporttoSwingDefaultImplLibrary.class.getClass().getName()); |
60 |
IconThemeHelper.registerIcon("export-to", "wizard-export-to", this); |
|
59 | 61 |
} |
60 | 62 |
|
61 | 63 |
@Override |
branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/spi/memory/MemoryFeatureSet.java | ||
---|---|---|
50 | 50 |
|
51 | 51 |
protected List data; |
52 | 52 |
|
53 |
public MemoryFeatureSet(AbstractMemoryStoreProvider store,
|
|
53 |
public MemoryFeatureSet(AbstractFeatureStoreProvider store,
|
|
54 | 54 |
FeatureQuery query, FeatureType featureType, List data) { |
55 | 55 |
super(store, query, |
56 | 56 |
/* |
branches/v2_0_0_prep/libraries/libInternationalization/src/org/gvsig/i18n/Messages.java | ||
---|---|---|
144 | 144 |
|
145 | 145 |
public static String getText(String key, String[] arguments, String callerName) { |
146 | 146 |
String translation = getText(key, callerName); |
147 |
if (translation!=null) { |
|
147 |
if (translation!=null && arguments!=null ) {
|
|
148 | 148 |
try { |
149 | 149 |
translation = MessageFormat.format(translation, arguments); |
150 | 150 |
} |
... | ... | |
192 | 192 |
|
193 | 193 |
public static String getText(String key, String[] arguments, boolean log) { |
194 | 194 |
String translation = getText(key, _CLASSNAME, log); |
195 |
if (translation!=null) { |
|
195 |
if (translation!=null && arguments!=null ) {
|
|
196 | 196 |
try { |
197 | 197 |
translation = MessageFormat.format(translation, arguments); |
198 |
} |
|
199 |
catch (IllegalFormatException ex) { |
|
198 |
} catch (IllegalFormatException ex) { |
|
200 | 199 |
if (log) { |
201 | 200 |
logger.error(_CLASSNAME+" -- Error formating key: "+key+" -- "+translation); |
202 | 201 |
} |
branches/v2_0_0_prep/libraries/libCorePlugin/src/org/gvsig/coreplugin/mdiManager/NewSkin.java | ||
---|---|---|
147 | 147 |
private Cursor lastCursor = null; |
148 | 148 |
private ImageIcon image; |
149 | 149 |
private String typeDesktop; |
150 |
|
|
151 |
private int alignCounter = 1; |
|
150 | 152 |
|
151 | 153 |
//Anyade barras de scroll |
152 | 154 |
private void addScrolledDesktopPanel( JFrame parent, MyDesktopPane desktopPane) { |
... | ... | |
410 | 412 |
int visibleWidth = contentPane.getWidth() - contentPane.getX(); // The last substraction is for if there is any menu,... at left |
411 | 413 |
int visibleHeight = contentPane.getHeight() - newStatusBar.getHeight() - contentPane.getY() - Math.abs(jDesktopPane.getY() - contentPane.getY()); // The last substraction is for if there is any menu,... at top |
412 | 414 |
|
413 |
// ------------------------------------------------- |
|
414 |
// |FIRST_LINE_START PAGE_START FIRST_LINE_END|
|
|
415 |
// | | |
|
416 |
// | | |
|
417 |
// |LINE_START CENTER LINE_END|
|
|
418 |
// | | |
|
419 |
// | | |
|
420 |
// |LAST_LINE_START PAGE_END LAST_LINE_END|
|
|
421 |
// ------------------------------------------------- |
|
422 |
|
|
415 |
// ---------------------------------------------------------------
|
|
416 |
// |FIRST_LINE_START(23) PAGE_START(19) FIRST_LINE_END(24) |
|
|
417 |
// | |
|
|
418 |
// | |
|
|
419 |
// |LINE_START(21) CENTER(10) LINE_END(22)|
|
|
420 |
// | |
|
|
421 |
// | |
|
|
422 |
// |LAST_LINE_START(25) PAGE_END(20) LAST_LINE_END(26) |
|
|
423 |
// ---------------------------------------------------------------
|
|
424 |
|
|
423 | 425 |
switch (mode) { |
424 |
case GridBagConstraints.FIRST_LINE_START:
|
|
426 |
case ALIGN_FIRST_LINE_START:
|
|
425 | 427 |
newReferencePoint.x = DefaultXMargin; |
426 | 428 |
newReferencePoint.y = DefaultYMargin; |
427 | 429 |
break; |
428 | 430 |
|
429 |
case GridBagConstraints.PAGE_START:
|
|
431 |
case ALIGN_PAGE_START:
|
|
430 | 432 |
newReferencePoint.x = visibleWidth / 2; |
431 | 433 |
newReferencePoint.y = DefaultYMargin; |
432 | 434 |
break; |
433 | 435 |
|
434 |
case GridBagConstraints.FIRST_LINE_END:
|
|
436 |
case ALIGN_FIRST_LINE_END:
|
|
435 | 437 |
newReferencePoint.x = visibleWidth - window.getWidth() - DefaultXMargin; |
436 | 438 |
newReferencePoint.y = DefaultYMargin; |
437 | 439 |
break; |
438 | 440 |
|
439 |
case GridBagConstraints.LINE_START: |
|
441 |
case ALIGN_FIRST_LINE_END_CASCADE: |
|
442 |
newReferencePoint.x = visibleWidth - window.getWidth() - (int)(DefaultXMargin + (DefaultXMargin*1.5*this.alignCounter)); |
|
443 |
newReferencePoint.y = DefaultYMargin + (int)(DefaultYMargin*1.5*this.alignCounter); |
|
444 |
if( ++this.alignCounter >5 ) { |
|
445 |
this.alignCounter = 0; |
|
446 |
} |
|
447 |
break; |
|
448 |
|
|
449 |
case ALIGN_LINE_START: |
|
440 | 450 |
newReferencePoint.x = DefaultXMargin; |
441 | 451 |
newReferencePoint.y = visibleHeight / 2; |
442 | 452 |
break; |
443 | 453 |
|
444 |
case GridBagConstraints.LINE_END:
|
|
454 |
case ALIGN_LINE_END:
|
|
445 | 455 |
newReferencePoint.x = visibleWidth - window.getWidth() - DefaultXMargin; |
446 | 456 |
newReferencePoint.y = visibleHeight / 2; |
447 | 457 |
break; |
448 | 458 |
|
449 |
case GridBagConstraints.LAST_LINE_START:
|
|
459 |
case ALIGN_LAST_LINE_START:
|
|
450 | 460 |
newReferencePoint.x = DefaultXMargin; |
451 | 461 |
newReferencePoint.y = visibleHeight - window.getHeight() - DefaultYMargin; |
452 | 462 |
break; |
453 | 463 |
|
454 |
case GridBagConstraints.PAGE_END:
|
|
464 |
case ALIGN_PAGE_END:
|
|
455 | 465 |
newReferencePoint.x = visibleWidth / 2; |
456 | 466 |
newReferencePoint.y = visibleHeight - window.getHeight() - DefaultYMargin; |
457 | 467 |
break; |
458 | 468 |
|
459 |
case GridBagConstraints.LAST_LINE_END:
|
|
469 |
case ALIGN_LAST_LINE_END:
|
|
460 | 470 |
newReferencePoint.x = visibleWidth - window.getWidth() - DefaultXMargin; |
461 | 471 |
newReferencePoint.y = visibleHeight - window.getHeight() - DefaultYMargin; |
462 | 472 |
break; |
463 | 473 |
|
464 | 474 |
default: |
465 |
case GridBagConstraints.CENTER:
|
|
475 |
case ALIGN_CENTER:
|
|
466 | 476 |
newReferencePoint.x = visibleWidth / 2; |
467 | 477 |
newReferencePoint.y = visibleHeight / 2; |
468 | 478 |
break; |
branches/v2_0_0_prep/libraries/libCorePlugin/src/org/gvsig/coreplugin/mdiManager/WindowStackSupport.java | ||
---|---|---|
95 | 95 |
Menu m = new Menu(); |
96 | 96 |
m.setActionCommand(""+id); |
97 | 97 |
m.setTooltip(PluginServices.getText(this, "activa_la_ventana")); |
98 |
m.setText("Ventana/"+vi.getTitle());
|
|
98 |
m.setText("Window/"+vi.getTitle());
|
|
99 | 99 |
/* get the first free mnemonic (if any) and assign */ |
100 | 100 |
for ( int i=0; i < 10; i++) { |
101 | 101 |
if ( key_free[i]) { |
branches/v2_0_0_prep/libraries/libCorePlugin/src/org/gvsig/coreplugin/preferences/general/SkinPreferences.java | ||
---|---|---|
22 | 22 |
import org.gvsig.andami.ui.mdiManager.MDIManagerFactory; |
23 | 23 |
import org.gvsig.utils.XMLEntity; |
24 | 24 |
import org.gvsig.utils.swing.JComboBox; |
25 |
import org.slf4j.Logger; |
|
26 |
import org.slf4j.LoggerFactory; |
|
25 | 27 |
|
26 | 28 |
|
27 | 29 |
public class SkinPreferences extends AbstractPreferencePage { |
28 | 30 |
|
31 |
private static final Logger logger = LoggerFactory.getLogger(SkinPreferences.class); |
|
29 | 32 |
private String id; |
30 | 33 |
private ImageIcon icon; |
31 | 34 |
private Vector listSkinsPlugins; |
... | ... | |
108 | 111 |
} |
109 | 112 |
|
110 | 113 |
public void initializeValues() { |
111 |
// TODO Auto-generated method stub |
|
112 |
// System.out.println("inicialize values"); |
|
113 |
|
|
114 | 114 |
listSkinsPlugins = new Vector(); |
115 | 115 |
|
116 | 116 |
HashMap pluginsConfig = Launcher.getPluginConfig(); |
... | ... | |
123 | 123 |
if (pc.getExtensions().getSkinExtension() != null) { |
124 | 124 |
SkinExtension[] se = pc.getExtensions().getSkinExtension(); |
125 | 125 |
for (int j=0;j<se.length;j++){ |
126 |
|
|
127 |
listSkinsPlugins.add(se[j].getClassName());
|
|
128 |
System.out.println("plugin de skin + name");
|
|
126 |
String extensionName = se[j].getClassName(); |
|
127 |
listSkinsPlugins.add(extensionName );
|
|
128 |
logger.info("Skin plugin '"+name + "', extension '"+ extensionName +".");
|
|
129 | 129 |
} |
130 | 130 |
} |
131 | 131 |
} |
branches/v2_0_0_prep/libraries/libCorePlugin/src/org/gvsig/coreplugin/preferences/network/FirewallPage.java | ||
---|---|---|
159 | 159 |
|
160 | 160 |
public FirewallPage() { |
161 | 161 |
super(); |
162 |
//icon = new ImageIcon(this.getClass().getClassLoader().getResource("images/shield.png")); |
|
163 | 162 |
icon=PluginServices.getIconTheme().get("edit-setup-firewall"); |
164 | 163 |
setParentID(NetworkPage.id); |
165 | 164 |
// checkbox |
branches/v2_0_0_prep/libraries/libCorePlugin/src/org/gvsig/coreplugin/preferences/network/NetworkPage.java | ||
---|---|---|
132 | 132 |
public NetworkPage() { |
133 | 133 |
super(); |
134 | 134 |
id = this.getClass().getName(); |
135 |
// icon = new ImageIcon(this.getClass().getClassLoader().getResource("images/network.png")); |
|
136 | 135 |
icon=PluginServices.getIconTheme().get("edit-setup-network"); |
137 | 136 |
lblNetworkStatus = new JLabel(); |
138 | 137 |
lblNetworkStatus.setFont(lblNetworkStatus.getFont().deriveFont(Font.BOLD)); |
branches/v2_0_0_prep/extensions/org.gvsig.geometrymeasurement.app/org.gvsig.geometrymeasurement.app.extension/src/main/resources/config.xml | ||
---|---|---|
8 | 8 |
<extension class-name="org.gvsig.geometrymeasurement.app.extension.AreaMeasurementExtension" |
9 | 9 |
description="Extension that measures the area of all the polygonos they selected." |
10 | 10 |
active="true"> |
11 |
<menu text="Tabla/area" tooltip="area"
|
|
11 |
<menu text="Table/Add/area" tooltip="area"
|
|
12 | 12 |
action-command="AREA" |
13 |
position="500800100" |
|
13 | 14 |
icon="add-area" /> |
14 | 15 |
<tool-bar name="area"> |
15 | 16 |
<action-tool icon="add-area" |
16 |
action-command="AREA" tooltip="area" |
|
17 |
action-command="AREA" tooltip="area" position="500800100"
|
|
17 | 18 |
enable-text="deber?a de estar activada" last="true"/> |
18 | 19 |
</tool-bar> |
19 | 20 |
</extension> |
... | ... | |
21 | 22 |
<extension class-name="org.gvsig.geometrymeasurement.app.extension.PerimeterMeasurementExtension" |
22 | 23 |
description="Extension that measures the perimeter of all the lines they selected." |
23 | 24 |
active="true"> |
24 |
<menu text="Tabla/perimeter" tooltip="perimeter"
|
|
25 |
<menu text="Table/Add/perimeter" tooltip="perimeter"
|
|
25 | 26 |
action-command="PERIMETER" |
27 |
position="500800200" |
|
26 | 28 |
icon="add-perimeter" /> |
27 | 29 |
<tool-bar name="perimeter"> |
28 | 30 |
<action-tool icon="add-perimeter" |
29 |
action-command="PERIMETER" tooltip="perimeter" |
|
31 |
action-command="PERIMETER" tooltip="perimeter" position="500800200"
|
|
30 | 32 |
enable-text="deber?a de estar activada" last="true"/> |
31 | 33 |
</tool-bar> |
32 | 34 |
</extension> |
branches/v2_0_0_prep/extensions/org.gvsig.hyperlink.app/org.gvsig.hyperlink.app.extension/src/main/resources/config.xml | ||
---|---|---|
8 | 8 |
description="" |
9 | 9 |
active="true" |
10 | 10 |
priority="20"> |
11 |
<menu text="Capa/Advanced_Hyperlink" action-command="HYPERLINK" icon="view-hyperlink" position="5040"/>
|
|
11 |
<menu text="View/Hyperlink" action-command="HYPERLINK" icon="view-hyperlink" position="650750000"/>
|
|
12 | 12 |
<tool-bar name="View_Tools_Query" position="5"> |
13 |
<selectable-tool icon="view-query-link" action-command="HYPERLINK" tooltip="Advanced_Hyperlink" position="7"/>
|
|
13 |
<selectable-tool icon="view-query-link" action-command="HYPERLINK" tooltip="Hyperlink" position="650750000"/>
|
|
14 | 14 |
</tool-bar> |
15 | 15 |
</extension> |
16 | 16 |
</extensions> |
branches/v2_0_0_prep/extensions/org.gvsig.selectiontools.app/org.gvsig.selectiontools.app.extension/src/main/java/org/gvsig/selectiontools/app/extension/tools/CircleSelectionListener.java | ||
---|---|---|
64 | 64 |
*/ |
65 | 65 |
public class CircleSelectionListener implements CircleListener { |
66 | 66 |
|
67 |
/** |
|
68 |
* The image to display when the cursor is active. |
|
69 |
*/ |
|
70 |
// private final Image img = new ImageIcon(this.getClass() |
|
71 |
// .getClassLoader() |
|
72 |
// .getResource("images/circle-cursor-icon.png")).getImage(); |
|
73 | 67 |
|
68 |
|
|
74 | 69 |
/** |
75 | 70 |
* The cursor used to work with this tool listener. |
76 | 71 |
* |
branches/v2_0_0_prep/extensions/org.gvsig.selectiontools.app/org.gvsig.selectiontools.app.extension/src/main/resources/config.xml | ||
---|---|---|
19 | 19 |
action-command="SELALL" |
20 | 20 |
tooltip="select_all_info" |
21 | 21 |
icon="selection-select-all" |
22 |
position="0"/> |
|
22 |
position="300400000"/>
|
|
23 | 23 |
<tool-bar name="Tools_Select" position="6"> |
24 | 24 |
<selectable-tool icon="selection-all" action-command="SELALL" tooltip="select_all_info" position="7"/> |
25 | 25 |
</tool-bar> |
... | ... | |
32 | 32 |
action-command="SELCIRCLE" |
33 | 33 |
tooltip="select_by_circle_info" |
34 | 34 |
icon="selection-select-by-circle" |
35 |
position="0"/> |
|
35 |
position="301000000"/>
|
|
36 | 36 |
<tool-bar name="Tools_Select" position="6"> |
37 | 37 |
<selectable-tool icon="selection-select-by-circle" action-command="SELCIRCLE" tooltip="select_by_circle" position="6"/> |
38 | 38 |
</tool-bar> |
... | ... | |
45 | 45 |
action-command="SELPOLYLINE" |
46 | 46 |
tooltip="select_by_polyline_info" |
47 | 47 |
icon="selection-select-by-polyline" |
48 |
position="0"/> |
|
48 |
position="301300000"/>
|
|
49 | 49 |
<tool-bar name="Tools_Select" position="6"> |
50 | 50 |
<selectable-tool icon="selection-select-by-polyline" action-command="SELPOLYLINE" tooltip="select_by_polyline" position="5"/> |
51 | 51 |
</tool-bar> |
... | ... | |
59 | 59 |
action-command="SELBUFFER" |
60 | 60 |
tooltip="select_by_buffer_info" |
61 | 61 |
icon="selection-select-by-buffer" |
62 |
position="0"/> |
|
62 |
position="300900000"/>
|
|
63 | 63 |
<tool-bar name="Tools_Select" position="6"> |
64 | 64 |
<action-tool icon="selection-select-by-buffer" action-command="SELBUFFER" tooltip="select_by_buffer" position="7"/> |
65 | 65 |
</tool-bar> |
branches/v2_0_0_prep/extensions/org.gvsig.annotation.app/org.gvsig.annotation.app.extension/src/main/resources/config.xml | ||
---|---|---|
10 | 10 |
description="" |
11 | 11 |
active="true" |
12 | 12 |
priority="1"> |
13 |
<menu text="Capa/export_to_annotation"
|
|
14 |
position="35020"
|
|
13 |
<menu text="Layer/export_to_annotation"
|
|
14 |
position="600550000"
|
|
15 | 15 |
action-command="Annotation"/> |
16 | 16 |
</extension> |
17 | 17 |
<extension class-name="org.gvsig.annotation.app.extension.AnnotationAboutExtension" |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/execution/DefaultInstallPackageWizard.java | ||
---|---|---|
83 | 83 |
installerExecutionService = InstallerLocator.getInstallerManager() |
84 | 84 |
.getInstallPackageService(); |
85 | 85 |
|
86 |
// URL iconURL = |
|
87 |
// getClass().getClassLoader().getResource( |
|
88 |
// "images/installpackageicon.png"); |
|
89 |
// ImageIcon icon = new ImageIcon(iconURL); |
|
90 |
// wizardPanelWithLogo = new WizardPanelWithLogo(icon); |
|
91 | 86 |
wizardPanelWithLogo = new WizardPanelWithLogo(); |
92 | 87 |
|
93 | 88 |
List<URL> downloadURLs = SwingInstallerLocator |
branches/v2_0_0_prep/extensions/extGeoDB/src/org/gvsig/geodb/ExtDB_Spatial.java | ||
---|---|---|
44 | 44 |
|
45 | 45 |
import org.gvsig.about.AboutManager; |
46 | 46 |
import org.gvsig.about.AboutParticipant; |
47 |
import org.gvsig.andami.IconThemeHelper; |
|
47 | 48 |
import org.gvsig.andami.plugins.Extension; |
48 | 49 |
import org.gvsig.app.ApplicationLocator; |
49 | 50 |
import org.gvsig.app.ApplicationManager; |
... | ... | |
62 | 63 |
public class ExtDB_Spatial extends Extension { |
63 | 64 |
|
64 | 65 |
public void initialize() { |
65 |
//do nothing
|
|
66 |
IconThemeHelper.registerIcon("geodb", "geodb-connection-add", this);
|
|
66 | 67 |
} |
67 | 68 |
|
68 | 69 |
public void execute(String actionCommand) { |
branches/v2_0_0_prep/extensions/extGeoDB/src/org/gvsig/geodb/vectorialdb/wizard/WizardDB.java | ||
---|---|---|
52 | 52 |
import org.slf4j.Logger; |
53 | 53 |
import org.slf4j.LoggerFactory; |
54 | 54 |
|
55 |
import org.gvsig.andami.IconThemeHelper; |
|
55 | 56 |
import org.gvsig.andami.PluginServices; |
56 | 57 |
import org.gvsig.andami.PluginsLocator; |
57 | 58 |
import org.gvsig.andami.PluginsManager; |
... | ... | |
542 | 543 |
"add_connection")); |
543 | 544 |
dbButton.setBounds(new java.awt.Rectangle(465, 20, 26, 21)); |
544 | 545 |
|
545 |
// FIXME use standard icon theme |
|
546 |
String _file = createResourceUrl("images/jdbc.png").getFile(); |
|
547 |
dbButton.setIcon(new ImageIcon(_file)); |
|
546 |
dbButton.setIcon(IconThemeHelper.getImageIcon("geodb-connection-add")); |
|
548 | 547 |
} |
549 | 548 |
|
550 | 549 |
return dbButton; |
branches/v2_0_0_prep/extensions/extEditing/config/config.xml | ||
---|---|---|
309 | 309 |
name="layer-insert-line" |
310 | 310 |
label="_Insert_line" |
311 | 311 |
tooltip="_Insert_line" |
312 |
position="60100500" |
|
312 |
position="601000500"
|
|
313 | 313 |
action-command="layer-insert-line" |
314 | 314 |
icon="layer-insert-line" |
315 | 315 |
accelerator="" |
branches/v2_0_0_prep/extensions/extEditing/src/org/gvsig/editing/TestJWizard.java | ||
---|---|---|
1 |
package org.gvsig.editing; |
|
2 |
|
|
3 |
import javax.swing.ImageIcon; |
|
4 |
import javax.swing.JFrame; |
|
5 |
import javax.swing.SwingUtilities; |
|
6 |
import javax.swing.UIManager; |
|
7 |
|
|
8 |
import jwizardcomponent.Utilities; |
|
9 |
import jwizardcomponent.frame.SimpleLogoJWizardFrame; |
|
10 |
|
|
11 |
import org.gvsig.editing.gui.cad.MyFinishAction; |
|
12 |
import org.gvsig.editing.gui.cad.panels.ChooseGeometryType; |
|
13 |
import org.gvsig.editing.gui.cad.panels.JPanelFieldDefinition; |
|
14 |
|
|
15 |
|
|
16 |
/** |
|
17 |
* <p>Title: JWizardComponent</p> |
|
18 |
* <p>Description: Swing-Based Wizard Framework for Wizards</p> |
|
19 |
* <p>Copyright (C) 2003 William Ready |
|
20 |
* |
|
21 |
* <br>This library is free software; you can redistribute it and/or |
|
22 |
* <br>modify it under the terms of the GNU Lesser General Public |
|
23 |
* <br>License as published by the Free Software Foundation; either |
|
24 |
* <br>version 2.1 of the License, or (at your option) any later version. |
|
25 |
* |
|
26 |
* <br>This library is distributed in the hope that it will be useful, |
|
27 |
* <br>but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
28 |
* <br>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
29 |
* <br>See the GNU Lesser General Public License for more details. |
|
30 |
* |
|
31 |
* <br>To receive a copy of the GNU Lesser General Public License |
|
32 |
* <br>write to: The Free Software Foundation, Inc., |
|
33 |
* <br>59 Temple Place, Suite 330 |
|
34 |
* <br>Boston, MA 02111-1307 USA</p> |
|
35 |
* @author William Ready |
|
36 |
* @version 1.0 |
|
37 |
*/ |
|
38 |
|
|
39 |
public class TestJWizard { |
|
40 |
|
|
41 |
static ImageIcon LOGO; |
|
42 |
|
|
43 |
|
|
44 |
public static void main(String [] args) { |
|
45 |
try { |
|
46 |
|
|
47 |
LOGO = new javax.swing.ImageIcon("images/package_graphics.png"); |
|
48 |
// new ImageIcon(DefaultJWizardComponents.class.getResource("images/logo.jpeg")); |
|
49 |
|
|
50 |
SimpleLogoJWizardFrame wizardFrame = new SimpleLogoJWizardFrame( |
|
51 |
LOGO); |
|
52 |
wizardFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
53 |
|
|
54 |
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); |
|
55 |
SwingUtilities.updateComponentTreeUI(wizardFrame); |
|
56 |
|
|
57 |
wizardFrame.setTitle("Nuevo tema"); |
|
58 |
|
|
59 |
MyFinishAction myFinish = new MyFinishAction(wizardFrame.getWizardComponents(), null, "SHP"); |
|
60 |
|
|
61 |
wizardFrame.getWizardComponents().setFinishAction(myFinish); |
|
62 |
|
|
63 |
|
|
64 |
/* wizardFrame.getWizardComponents().addWizardPanel( |
|
65 |
new SimpleLabelWizardPanel(wizardFrame.getWizardComponents(), |
|
66 |
new JLabel("Dynamic Test"))); */ |
|
67 |
/* LayerFactory.setDriversPath("d:/Eclipse/workspace/_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/drivers"); |
|
68 |
|
|
69 |
DriverManager writerManager = LayerFactory.getDM(); |
|
70 |
ArrayList spatialDrivers = new ArrayList(); |
|
71 |
String[] writerNames = writerManager.getDriverNames(); |
|
72 |
for (int i=0; i<writerNames.length; i++) |
|
73 |
{ |
|
74 |
Driver drv = writerManager.getDriver(writerNames[i]); |
|
75 |
if (drv instanceof ISpatialWriter) |
|
76 |
spatialDrivers.add(drv.getName()); |
|
77 |
} |
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
wizardFrame.getWizardComponents().addWizardPanel( |
|
82 |
new ChooseWriteDriver(wizardFrame.getWizardComponents(), |
|
83 |
"Dynamic Test", (String[]) spatialDrivers.toArray(new String[0]))); |
|
84 |
*/ |
|
85 |
ChooseGeometryType panelChoose = new ChooseGeometryType(wizardFrame.getWizardComponents()); |
|
86 |
JPanelFieldDefinition panelFields = new JPanelFieldDefinition(wizardFrame.getWizardComponents()); |
|
87 |
wizardFrame.getWizardComponents().addWizardPanel(panelChoose); |
|
88 |
|
|
89 |
wizardFrame.getWizardComponents().addWizardPanel(panelFields); |
|
90 |
|
|
91 |
/* wizardFrame.getWizardComponents().addWizardPanel( |
|
92 |
new SimpleLabelWizardPanel(wizardFrame.getWizardComponents(), |
|
93 |
new JLabel("Done!"))); */ |
|
94 |
wizardFrame.setSize(540, 350); |
|
95 |
Utilities.centerComponentOnScreen(wizardFrame); |
|
96 |
wizardFrame.show(); |
|
97 |
|
|
98 |
// System.out.println("Salgo con " + panelChoose.getLayerName()); |
|
99 |
|
|
100 |
} catch (Exception e) { |
|
101 |
e.printStackTrace(); |
|
102 |
} |
|
103 |
} |
|
104 |
|
|
105 |
} |
branches/v2_0_0_prep/extensions/extEditing/src/org/gvsig/editing/gui/preferences/SnapConfigPage.java | ||
---|---|---|
8 | 8 |
import javax.swing.ImageIcon; |
9 | 9 |
import javax.swing.JPanel; |
10 | 10 |
|
11 |
import org.gvsig.andami.IconThemeHelper; |
|
11 | 12 |
import org.gvsig.andami.PluginServices; |
12 | 13 |
import org.gvsig.andami.messages.NotificationManager; |
13 | 14 |
import org.gvsig.andami.preferences.AbstractPreferencePage; |
... | ... | |
34 | 35 |
*/ |
35 | 36 |
public class SnapConfigPage extends AbstractPreferencePage { |
36 | 37 |
private static Preferences prefs = Preferences.userRoot().node("snappers"); |
37 |
private ImageIcon icon; |
|
38 | 38 |
private SnapConfig snapConfig; |
39 | 39 |
private static boolean applySnappers=true; |
40 | 40 |
@SuppressWarnings("unchecked") |
... | ... | |
44 | 44 |
public SnapConfigPage() { |
45 | 45 |
super(); |
46 | 46 |
this.setLayout(new BorderLayout()); |
47 |
icon = new ImageIcon(this.getClass().getClassLoader().getResource("images/Snapper.png")); |
|
48 | 47 |
IWindow window=PluginServices.getMDIManager().getActiveWindow(); |
49 | 48 |
if (window instanceof DefaultViewPanel){ |
50 | 49 |
mc=((DefaultViewPanel)window).getMapControl(); |
... | ... | |
160 | 159 |
* @return DOCUMENT ME! |
161 | 160 |
*/ |
162 | 161 |
public ImageIcon getIcon() { |
163 |
return icon;
|
|
162 |
return IconThemeHelper.getImageIcon("preferences-snapper");
|
|
164 | 163 |
} |
165 | 164 |
|
166 | 165 |
/** |
branches/v2_0_0_prep/extensions/extEditing/src/org/gvsig/editing/CADExtension.java | ||
---|---|---|
225 | 225 |
|
226 | 226 |
|
227 | 227 |
IconThemeHelper.registerIcon("preferences", "preferences-layer-modify-flatness", this); |
228 |
IconThemeHelper.registerIcon("preferences", "preferences-snapper", this); |
|
228 | 229 |
} |
229 | 230 |
|
230 | 231 |
/** |
branches/v2_0_0_prep/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/extension/ShowGraphicsLayerTable.java | ||
---|---|---|
24 | 24 |
import java.beans.PropertyChangeEvent; |
25 | 25 |
import java.beans.PropertyChangeListener; |
26 | 26 |
|
27 |
import org.gvsig.andami.IconThemeHelper; |
|
27 | 28 |
import org.gvsig.andami.PluginServices; |
28 | 29 |
import org.gvsig.andami.plugins.Extension; |
29 | 30 |
import org.gvsig.app.ApplicationLocator; |
... | ... | |
147 | 148 |
} |
148 | 149 |
|
149 | 150 |
private void registerIcons() { |
150 |
PluginServices.getIconTheme().registerDefault( |
|
151 |
"layer-show-attribute-table", |
|
152 |
this.getClass().getClassLoader() |
|
153 |
.getResource("images/ResultConsulta.png")); |
|
151 |
IconThemeHelper.registerIcon("action", "layer-show-attributes-table", this); |
|
154 | 152 |
} |
155 | 153 |
|
156 | 154 |
public void propertyChange(PropertyChangeEvent evt) { |
branches/v2_0_0_prep/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/resources/config.xml | ||
---|---|---|
259 | 259 |
name="table-rename-column" |
260 | 260 |
label="_Rename_column" |
261 | 261 |
tooltip="_Rename_column" |
262 |
position="5006500000"
|
|
262 |
position="500650000" |
|
263 | 263 |
action-command="table-add-column" |
264 | 264 |
icon="table-add-column" |
265 | 265 |
accelerator="" |
... | ... | |
452 | 452 |
name="table-statistics" |
453 | 453 |
label="_Statistics" |
454 | 454 |
tooltip="_Statistics" |
455 |
position="5080000000"
|
|
455 |
position="508000000" |
|
456 | 456 |
action-command="table-statistics" |
457 | 457 |
icon="table-statistics" |
458 | 458 |
accelerator="" |
branches/v2_0_0_prep/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/resources/config.xml | ||
---|---|---|
11 | 11 |
description="" |
12 | 12 |
active="true" |
13 | 13 |
priority="1"> |
14 |
<menu text="Capa/export_to"
|
|
15 |
position="11"
|
|
14 |
<menu text="Layer/export_to"
|
|
15 |
position="600500000"
|
|
16 | 16 |
action-command="Exportto"/> |
17 | 17 |
</extension> |
18 | 18 |
<extension class-name="org.gvsig.exportto.app.extension.ExporttoTableExtension" |
19 | 19 |
description="" |
20 | 20 |
active="true" |
21 | 21 |
priority="1"> |
22 |
<menu text="Tabla/export_to"
|
|
23 |
position="50"
|
|
22 |
<menu text="Table/export_to"
|
|
23 |
position="600850000"
|
|
24 | 24 |
action-command="Exportto"/> |
25 | 25 |
</extension> |
26 | 26 |
<extension class-name="org.gvsig.exportto.app.extension.ExporttoPreferencesExtension" |
branches/v2_0_0_prep/extensions/org.gvsig.symbology.app/org.gvsig.symbology.app.symbolinstaller/src/main/java/org/gvsig/symbology/app/symbolinstaller/execution/SymbolInstallerExtension.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import java.util.Locale; |
26 | 26 |
|
27 |
import org.gvsig.andami.IconThemeHelper; |
|
27 | 28 |
import org.gvsig.andami.plugins.Extension; |
28 | 29 |
import org.gvsig.andami.ui.ToolsWindowManager; |
29 | 30 |
import org.gvsig.i18n.Messages; |
... | ... | |
39 | 40 |
Messages.addResourceFamily("org.gvsig.symbology.app.symbolinstaller.text", |
40 | 41 |
SymbolInstallerExtension.class.getClassLoader(), |
41 | 42 |
SymbolInstallerExtension.class.getClass().getName()); |
43 |
|
|
44 |
IconThemeHelper.registerIcon("symbol-installer", "wizard-make-symbol-package", this); |
|
42 | 45 |
} |
43 | 46 |
|
44 | 47 |
@Override |
branches/v2_0_0_prep/extensions/org.gvsig.symbology.app/org.gvsig.symbology.app.symbolinstaller/src/main/java/org/gvsig/symbology/app/symbolinstaller/creation/DefaultMakeSymbolPackageWizard.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import java.awt.BorderLayout; |
26 | 26 |
import java.io.File; |
27 |
import java.net.URL; |
|
28 | 27 |
|
29 |
import javax.swing.ImageIcon; |
|
30 | 28 |
import javax.swing.JPanel; |
31 | 29 |
|
30 |
import org.gvsig.andami.IconThemeHelper; |
|
32 | 31 |
import org.gvsig.gui.beans.wizard.WizardPanel; |
33 | 32 |
import org.gvsig.gui.beans.wizard.WizardPanelActionListener; |
34 | 33 |
import org.gvsig.gui.beans.wizard.WizardPanelWithLogo; |
... | ... | |
62 | 61 |
private WizardListenerAdapter wizardListenerAdapter = null; |
63 | 62 |
|
64 | 63 |
public DefaultMakeSymbolPackageWizard() throws LocatorException { |
65 |
URL iconURL = |
|
66 |
getClass().getClassLoader().getResource( |
|
67 |
"images/makepluginpackageicon.png"); |
|
68 |
ImageIcon icon = new ImageIcon(iconURL); |
|
69 |
wizardPanelWithLogo = new WizardPanelWithLogo(icon); |
|
64 |
wizardPanelWithLogo = new WizardPanelWithLogo(IconThemeHelper.getImageIcon("wizard-make-symbol-package")); |
|
70 | 65 |
|
71 | 66 |
setCancelButtonEnabled(true); |
72 | 67 |
setFinishButtonEnabled(false); |
branches/v2_0_0_prep/extensions/org.gvsig.newlayer.app/org.gvsig.newlayer.app.extension/src/main/resources/config.xml | ||
---|---|---|
8 | 8 |
description="" |
9 | 9 |
active="true" |
10 | 10 |
priority="1"> |
11 |
<menu text="Vista/new_layer"
|
|
12 |
position="30090"
|
|
11 |
<menu text="View/new_layer"
|
|
12 |
position="650200000"
|
|
13 | 13 |
action-command="NewLayer"/> |
14 | 14 |
</extension> |
15 | 15 |
<!-- <extension class-name="org.gvsig.newlayer.app.extension.ExporttoTableExtension" |
branches/v2_0_0_prep/frameworks/_fwAndami/src/org/gvsig/andami/IconThemeHelper.java | ||
---|---|---|
1 | 1 |
package org.gvsig.andami; |
2 | 2 |
|
3 | 3 |
import java.awt.Image; |
4 |
import java.net.URL; |
|
4 | 5 |
|
5 | 6 |
import javax.swing.ImageIcon; |
6 | 7 |
|
... | ... | |
16 | 17 |
@SuppressWarnings("rawtypes") |
17 | 18 |
public static void registerIcon(String group, String name, Object obj) { |
18 | 19 |
String resourceName; |
20 |
String provider; |
|
19 | 21 |
ClassLoader loader; |
20 | 22 |
IconTheme iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent(); |
21 | 23 |
if( group == null || group.trim().length()==0 ) { |
... | ... | |
25 | 27 |
} |
26 | 28 |
if( obj instanceof Class ) { |
27 | 29 |
loader = ((Class) obj).getClassLoader(); |
30 |
provider = ((Class) obj).getName(); |
|
28 | 31 |
} else { |
29 | 32 |
loader = obj.getClass().getClassLoader(); |
33 |
provider = obj.getClass().getName(); |
|
30 | 34 |
} |
31 | 35 |
PluginServices plugin = PluginServices.getPluginServices(obj); |
36 |
if( plugin != null ) { |
|
37 |
provider = plugin.getPluginName(); |
|
38 |
} |
|
32 | 39 |
try { |
33 |
iconTheme.registerDefault(plugin.getPluginName(), group, name, null, loader.getResource(resourceName)); |
|
40 |
URL resource = loader.getResource(resourceName); |
|
41 |
iconTheme.registerDefault(provider, group, name, null, resource); |
|
34 | 42 |
} catch( Throwable e) { |
35 |
logger.info(e.getMessage());
|
|
43 |
logger.info("Can't register icon '"+name+"'.",e);
|
|
36 | 44 |
} |
37 | 45 |
} |
38 | 46 |
|
branches/v2_0_0_prep/frameworks/_fwAndami/src/org/gvsig/andami/ui/mdiFrame/MainFrame.java | ||
---|---|---|
224 | 224 |
*/ |
225 | 225 |
public void removeStatusBarLabels(Class clase); |
226 | 226 |
|
227 |
public void messageDialog(String message, String title, int messageType); |
|
228 |
|
|
229 |
public void messageDialog(String message, String messageArgs[], String title, int messageType); |
|
227 | 230 |
} |
branches/v2_0_0_prep/frameworks/_fwAndami/src/org/gvsig/andami/ui/mdiFrame/MDIFrame.java | ||
---|---|---|
1524 | 1524 |
// Se registra y a�ade el menu |
1525 | 1525 |
JMenuItem nuevoMenu = createJMenuItem(loader, menu); |
1526 | 1526 |
nuevoMenu.addMouseListener(tooltipListener); |
1527 |
if( listener != null ) { |
|
1527 |
if( listener != null && menu.getName() != null && menu.getName().trim().length()>0 ) {
|
|
1528 | 1528 |
ActionInfoManager actionManager = PluginsLocator.getActionInfoManager(); |
1529 | 1529 |
final ActionInfo actionInfo = actionManager.getAction(menu.getName()); |
1530 | 1530 |
if( actionInfo != null ) { |
... | ... | |
1723 | 1723 |
} |
1724 | 1724 |
return getMenu(menu, menuBar); |
1725 | 1725 |
} |
1726 |
|
|
1727 |
public void messageDialog(String message, String title, int messageType) { |
|
1728 |
messageDialog(message, null, title, messageType); |
|
1729 |
} |
|
1730 |
|
|
1731 |
public void messageDialog(String message, String messageArgs[], String title, int messageType) { |
|
1732 |
String msg = message; |
|
1733 |
String theTitle = title; |
|
1734 |
|
|
1735 |
if (message == null) { |
|
1736 |
logger.info("message if null, message dialog not show."); |
|
1737 |
return; |
|
1738 |
} |
|
1739 |
if( theTitle == null ) { |
|
1740 |
theTitle = ""; |
|
1741 |
} |
|
1742 |
if (msg.startsWith("_")) { |
|
1743 |
msg = org.gvsig.i18n.Messages.getText(message, messageArgs); |
|
1744 |
if (msg == null) { |
|
1745 |
msg = "_"+message.replace("_", " "); |
|
1746 |
} |
|
1747 |
} |
|
1748 |
if (theTitle.startsWith("_")) { |
|
1749 |
theTitle = org.gvsig.i18n.Messages.getText(theTitle); |
|
1750 |
if (theTitle == null) { |
|
1751 |
theTitle = "_"+title.replace("_", " "); |
|
1752 |
} |
|
1753 |
} |
|
1754 |
JOptionPane.showMessageDialog(this, msg,theTitle, messageType); |
|
1755 |
} |
|
1726 | 1756 |
} |
branches/v2_0_0_prep/frameworks/_fwAndami/src/org/gvsig/andami/ui/mdiManager/MDIManager.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package org.gvsig.andami.ui.mdiManager; |
42 | 42 |
|
43 |
import java.awt.GridBagConstraints; |
|
43 | 44 |
import java.beans.PropertyVetoException; |
44 | 45 |
|
45 | 46 |
import javax.swing.ImageIcon; |
... | ... | |
172 | 173 |
*/ |
173 | 174 |
public IWindow addCentredWindow(IWindow p) throws SingletonDialogAlreadyShownException; |
174 | 175 |
|
176 |
public static final int ALIGN_FIRST_LINE_START = GridBagConstraints.FIRST_LINE_START; |
|
177 |
public static final int ALIGN_PAGE_START = GridBagConstraints.PAGE_START; |
|
178 |
public static final int ALIGN_FIRST_LINE_END = GridBagConstraints.FIRST_LINE_END; |
|
179 |
public static final int ALIGN_FIRST_LINE_END_CASCADE = GridBagConstraints.FIRST_LINE_END + GridBagConstraints.BELOW_BASELINE; |
|
180 |
public static final int ALIGN_LINE_START = GridBagConstraints.LINE_START; |
|
181 |
public static final int ALIGN_LINE_END = GridBagConstraints.LINE_END; |
|
182 |
public static final int ALIGN_LAST_LINE_START = GridBagConstraints.LAST_LINE_START; |
|
183 |
public static final int ALIGN_PAGE_END = GridBagConstraints.PAGE_END; |
|
184 |
public static final int ALIGN_LAST_LINE_END = GridBagConstraints.LAST_LINE_END; |
|
185 |
public static final int ALIGN_CENTER = GridBagConstraints.CENTER; |
|
186 |
|
|
175 | 187 |
public IWindow addWindow(IWindow p, int align) throws SingletonDialogAlreadyShownException; |
176 | 188 |
|
177 | 189 |
/** |
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/extension/develtools/MenusDevelTool.java | ||
---|---|---|
69 | 69 |
buffer.append(" <tr valign=\"top\">\n"); |
70 | 70 |
buffer |
71 | 71 |
.append(" <td>") |
72 |
.append(String.format("%012d", menu.getPosition()))
|
|
72 |
.append(formatPosition( menu.getPosition()))
|
|
73 | 73 |
.append("</td>\n"); |
74 | 74 |
buffer |
75 | 75 |
.append(" <td>") |
... | ... | |
116 | 116 |
|
117 | 117 |
return buffer.toString(); |
118 | 118 |
} |
119 |
|
|
120 |
static String formatPosition(long position) { |
|
121 |
String pos = String.format("%012d",position); |
|
122 |
if( pos.length() != 12) { |
|
123 |
return pos; |
|
124 |
} |
|
125 |
String posf = pos.substring(0, 5) + "-" + |
|
126 |
pos.substring(5,8) + "-" + |
|
127 |
pos.substring(8,11) + "-" + |
|
128 |
pos.substring(11); |
|
129 |
return posf; |
|
130 |
} |
|
119 | 131 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/extension/develtools/ActionsInfoDevelTool.java | ||
---|---|---|
80 | 80 |
if( action.getPosition()<100000000 ) { |
81 | 81 |
buffer.append(" <td title=\"Incorrect position\">") |
82 | 82 |
.append(error_open) |
83 |
.append(action.getPosition())
|
|
83 |
.append(MenusDevelTool.formatPosition(action.getPosition()))
|
|
84 | 84 |
.append(error_close) |
85 | 85 |
.append("</td>\n"); |
86 | 86 |
} else { |
87 | 87 |
buffer.append(" <td>") |
88 |
.append(action.getPosition())
|
|
88 |
.append(MenusDevelTool.formatPosition(action.getPosition()))
|
|
89 | 89 |
.append("</td>\n"); |
90 | 90 |
} |
91 | 91 |
if( action.getLabel()==null ) { |
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/view/gui/AbstractViewPanel.java | ||
---|---|---|
48 | 48 |
import org.gvsig.app.project.documents.view.toc.gui.TOC; |
49 | 49 |
import org.gvsig.fmap.mapcontrol.MapControl; |
50 | 50 |
import org.gvsig.utils.exceptionHandling.ExceptionListener; |
51 |
import org.slf4j.Logger; |
|
52 |
import org.slf4j.LoggerFactory; |
|
51 | 53 |
|
52 | 54 |
/** |
53 | 55 |
* |
... | ... | |
59 | 61 |
public abstract class AbstractViewPanel extends JPanel implements IView, |
60 | 62 |
IWindowTransform, PropertyChangeListener { |
61 | 63 |
|
64 |
private static final Logger logger = LoggerFactory.getLogger(AbstractViewPanel.class); |
|
65 |
|
|
62 | 66 |
private static final long serialVersionUID = -259620280790490262L; |
63 | 67 |
|
64 | 68 |
private static final int DEFAULT_HEIGHT = 450; |
... | ... | |
105 | 109 |
|
106 | 110 |
protected void paintChildren(Graphics g) { |
107 | 111 |
if (lastDivider != lastDividerLocation) { |
108 |
System.out.println("paintChildren = " |
|
109 |
+ this.lastDividerLocation); |
|
112 |
logger.debug("paintChildren = "+ this.lastDividerLocation); |
|
110 | 113 |
lastDivider = lastDividerLocation; |
111 | 114 |
} |
112 | 115 |
super.paintChildren(g); |
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/view/legend/gui/ThemeManagerWindow.java | ||
---|---|---|
50 | 50 |
import java.util.ArrayList; |
51 | 51 |
import java.util.Hashtable; |
52 | 52 |
|
53 |
import javax.swing.JOptionPane; |
|
53 | 54 |
import javax.swing.JPanel; |
54 | 55 |
import javax.swing.JTabbedPane; |
55 | 56 |
import javax.swing.event.ChangeListener; |
56 | 57 |
|
57 | 58 |
import org.gvsig.andami.PluginServices; |
58 | 59 |
import org.gvsig.andami.messages.NotificationManager; |
60 |
import org.gvsig.andami.ui.mdiFrame.MDIFrame; |
|
59 | 61 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
62 |
import org.gvsig.andami.ui.mdiManager.MDIManagerFactory; |
|
60 | 63 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
64 |
import org.gvsig.app.ApplicationLocator; |
|
65 |
import org.gvsig.app.ApplicationManager; |
|
61 | 66 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
62 | 67 |
import org.gvsig.fmap.mapcontext.layers.FLyrDefault; |
63 | 68 |
import org.gvsig.gui.beans.swing.JButton; |
69 |
import org.slf4j.Logger; |
|
70 |
import org.slf4j.LoggerFactory; |
|
64 | 71 |
|
65 | 72 |
|
66 | 73 |
/** |
... | ... | |
69 | 76 |
* @version 01-feb-2007 |
70 | 77 |
*/ |
71 | 78 |
public final class ThemeManagerWindow extends JPanel implements IWindow, ActionListener { |
79 |
private static final Logger logger = LoggerFactory.getLogger(ThemeManagerWindow.class); |
|
80 |
|
|
72 | 81 |
private static final long serialVersionUID = 4650656815369149211L; |
73 | 82 |
private static int selectedTabIndex = 0; |
74 | 83 |
private static ArrayList<Class<? extends AbstractThemeManagerPage>> pages = |
... | ... | |
96 | 105 |
} |
97 | 106 |
|
98 | 107 |
private void initialize() { |
108 |
StringBuffer msgerr = new StringBuffer(); |
|
99 | 109 |
for (int i = 0; i < pages.size(); i++) { |
100 | 110 |
Class<? extends AbstractThemeManagerPage> pageClass = pages.get(i); |
101 | 111 |
AbstractThemeManagerPage tab = null; |
102 | 112 |
try { |
103 | 113 |
tab = pageClass.newInstance(); |
104 |
} catch (InstantiationException e) { |
|
105 |
NotificationManager.addError("Trying to instantiate an interface" + |
|
106 |
" or abstract class + "+pageClass.getName(), e); |
|
107 |
} catch (IllegalAccessException e) { |
|
108 |
NotificationManager.addError("IllegalAccessException: does " + |
|
109 |
pageClass.getName() + " class have an anonymous" + |
|
110 |
" constructor?", e); |
|
114 |
} catch (Exception e) { |
|
115 |
msgerr.append(translate("_Cant_add_property_page_related_to_{0}", pageClass.getName())) |
|
116 |
.append("\n"); |
|
117 |
logger.info("Can't instance propety page from class "+pageClass.getName(),e); |
|
118 |
continue; |
|
111 | 119 |
} |
112 | 120 |
if (tab!=null){ |
113 | 121 |
if (s.get(tab.getClass()).contains(layer.getClass())){ |
114 |
tab.setModel(layer); |
|
115 |
tabs.addTab(tab.getName(), tab); |
|
122 |
String tabName = null; |
|
123 |
try { |
|
124 |
tab.setModel(layer); |
|
125 |
tabName = tab.getName(); |
|
126 |
} catch( Throwable ex) { |
|
127 |
msgerr.append(translate("_Cant_initialice_property_page_{0}", tabName)) |
|
128 |
.append("\n"); |
|
129 |
logger.info("Can't set model of property page '"+tabName+"' from class '"+pageClass.getName()+"'."); |
|
130 |
} |
|
131 |
tabs.addTab(tabName, tab); |
|
116 | 132 |
} |
117 | 133 |
} |
118 | 134 |
} |
... | ... | |
138 | 154 |
}); |
139 | 155 |
add(getPanelButtons(), java.awt.BorderLayout.SOUTH); |
140 | 156 |
setSize(new Dimension(780, 540)); |
157 |
if( msgerr.length()>0 ) { |
|
158 |
PluginServices.getMainFrame().messageDialog(msgerr.toString(), "_Warning", JOptionPane.WARNING_MESSAGE); |
|
159 |
} |
|
141 | 160 |
} |
142 | 161 |
|
162 |
private String translate(String msg, String arg1) { |
|
163 |
String[] args = null; |
|
164 |
String translation = null; |
Also available in: Unified diff