100 if(c instanceof JButton) {
101 JButton b = (JButton) c;
102 String name = b.getName();
103 b.setBackground(Color.decode(i18n.getString("colorprefs." + name + ".defvalue")));
104 }
105 }
106 }
107 });
108
109 c.anchor = GridBagConstraints.EAST;
110 c.fill = GridBagConstraints.NONE;
111 this.add(defaults, c);
112
113 }
114
115 @Override
116 public String getText() {
117 return i18n.getString("colorprefs.name");
118 }
119
120 public void save(Map m) {
121 super.save(m);
122 Component[] components = inputColors.getComponents();
123 for(Component c: components) {
124 if(c instanceof JButton) {
125 JButton b = (JButton) c;
126 UIFactory.Colors.getColorByPreferencesName(c.getName());
127 String colorCode = String.valueOf(b.getBackground().getRGB());
128 UIFactory.setColorByName(b.getName(), b.getBackground());
129 m.put(b.getName(),colorCode);
130 }
131 }
132 }
133 }
|
100 if(c instanceof JButton) {
101 JButton b = (JButton) c;
102 String name = b.getName();
103 b.setBackground(Color.decode(i18n.getString("colorprefs." + name + ".defvalue")));
104 }
105 }
106 }
107 });
108
109 c.anchor = GridBagConstraints.EAST;
110 c.fill = GridBagConstraints.NONE;
111 this.add(defaults, c);
112
113 }
114
115 @Override
116 public String getText() {
117 return i18n.getString("colorprefs.name");
118 }
119
120 public void save(Map<String, String> m) {
121 super.save(m);
122 Component[] components = inputColors.getComponents();
123 for(Component c: components) {
124 if(c instanceof JButton) {
125 JButton b = (JButton) c;
126 UIFactory.Colors.getColorByPreferencesName(c.getName());
127 String colorCode = String.valueOf(b.getBackground().getRGB());
128 UIFactory.setColorByName(b.getName(), b.getBackground());
129 m.put(b.getName(),colorCode);
130 }
131 }
132 }
133 }
|