Changeset 16383 in osm for applications
- Timestamp:
- 2009-07-08T16:40:06+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/colorscheme
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/colorscheme/build.xml
r14015 r16383 27 27 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 28 28 <attribute name="Plugin-Description" value="Allows the user to create different color schemes and to switch between them. Just change the colors and create a new scheme. Used to switch to a white background with matching colors for better visibility in bright sunlight. See dialog in JOSM's preferences and 'Map Settings' (strange but true :-)" /> 29 <attribute name="Plugin-Mainversion" value="1 180"/>29 <attribute name="Plugin-Mainversion" value="1742"/> 30 30 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 31 31 </manifest> -
applications/editors/josm/plugins/colorscheme/src/at/dallermassl/josm/plugin/colorscheme/ColorSchemePreference.java
r13497 r16383 40 40 private List<String>colorKeys; 41 41 private ColorPreference colorPreference; 42 42 43 43 /** 44 * Default Constructor 44 * Default Constructor 45 45 */ 46 46 public ColorSchemePreference() { 47 47 } 48 48 49 49 50 50 /* (non-Javadoc) … … 58 58 schemesList = new JList(listModel); 59 59 String schemes = Main.pref.get(PREF_KEY_SCHEMES_NAMES); 60 StringTokenizer st = new StringTokenizer(schemes, ";"); 60 StringTokenizer st = new StringTokenizer(schemes, ";"); 61 61 String schemeName; 62 62 while (st.hasMoreTokens()) { … … 72 72 else { 73 73 String schemeName = (String) listModel.get(schemesList.getSelectedIndex()); 74 getColorPreference( ).setColorModel(getColorMap(schemeName));74 getColorPreference(gui).setColorModel(getColorMap(schemeName)); 75 75 } 76 76 } … … 83 83 return; 84 84 schemeName = schemeName.replaceAll("\\.", "_"); 85 setColorScheme(schemeName, getColorPreference( ).getColorModel());85 setColorScheme(schemeName, getColorPreference(gui).getColorModel()); 86 86 listModel.addElement(schemeName); 87 87 saveSchemeNamesToPref(); … … 118 118 buttonPanel.add(deleteScheme, GBC.std().insets(0,5,5,0)); 119 119 } 120 120 121 121 /** 122 * Saves the names of the schemes to the preferences. 122 * Saves the names of the schemes to the preferences. 123 123 */ 124 124 public void saveSchemeNamesToPref() { … … 129 129 Main.pref.put(PREF_KEY_SCHEMES_NAMES, sb.toString().substring(1)); 130 130 } else 131 Main.pref.put(PREF_KEY_SCHEMES_NAMES, null); 131 Main.pref.put(PREF_KEY_SCHEMES_NAMES, null); 132 132 } 133 133 … … 135 135 return false;// nothing to do 136 136 } 137 137 138 138 /** 139 139 * Remove all color entries for the given scheme from the preferences. … … 145 145 for(String key : colors.keySet()) { 146 146 Main.pref.put(key, null); 147 } 147 } 148 148 } 149 149 150 150 /** 151 151 * Copy all color entries from the given map to entries in preferences with the scheme name. … … 160 160 } 161 161 } 162 162 163 163 /** 164 * Reads all colors for a scheme and returns them in a map (key = color key without prefix, 164 * Reads all colors for a scheme and returns them in a map (key = color key without prefix, 165 165 * value = html color code). 166 166 * @param schemeName the name of the scheme. … … 177 177 } 178 178 179 public ColorPreference getColorPreference( ) {179 public ColorPreference getColorPreference(PreferenceDialog gui) { 180 180 if(colorPreference == null) { 181 for(PreferenceSetting setting : PreferenceDialog.settings) {181 for(PreferenceSetting setting : gui.getSettings()) { 182 182 if(setting instanceof ColorPreference) { 183 183 colorPreference = (ColorPreference) setting;
Note:
See TracChangeset
for help on using the changeset viewer.