Changeset 35262 in osm
- Timestamp:
- 2019-12-28T15:13:36+01:00 (5 years ago)
- Location:
- applications/editors/josm/plugins/surveyor
- Files:
-
- 8 added
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/surveyor/.classpath
r32680 r35262 2 2 <classpath> 3 3 <classpathentry kind="src" path="src"/> 4 <classpathentry kind="src" output="bintest" path="unit"> 5 <attributes> 6 <attribute name="test" value="true"/> 7 </attributes> 8 </classpathentry> 9 <classpathentry including="resources/" kind="src" path=""/> 4 10 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> 5 11 <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/> 6 12 <classpathentry combineaccessrules="false" kind="src" path="/JOSM-livegps"/> 13 <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> 7 14 <classpathentry kind="output" path="bin"/> 8 15 </classpath> -
applications/editors/josm/plugins/surveyor/resources/surveyor.xml
r16957 r35262 4 4 <!-- action class: either fully qualified classnames or if not found, 5 5 package at.dallermassl.josm.plugin.surveyor.action is assumed --> 6 <button label="Tunnel Start" hotkey="T" icon=" styles/standard/vehicle/tunnel.png">6 <button label="Tunnel Start" hotkey="T" icon="presets/transport/passage/tunnel.svg"> 7 7 <action class="PlayAudioAction" params="resource://audio/KDE_Window_Iconify.wav"/> 8 8 <action class="SetWaypointAction" params="tunnel start"/> … … 14 14 <action class="SetWaypointAction" params="bridge"/> 15 15 </button> 16 <button label="Village/City" hotkey="V" icon=" styles/standard/place.png">16 <button label="Village/City" hotkey="V" icon="presets/place/village.svg"> 17 17 <action class="PlayAudioAction" params="resource://audio/KDE_Window_Iconify.wav"/> 18 18 <action class="SetWaypointAction" params="village"/> … … 22 22 --> 23 23 </button> 24 <button label="Parking" hotkey="P" icon=" styles/standard/vehicle/parking.png">24 <button label="Parking" hotkey="P" icon="presets/vehicle/parking/parking.svg"> 25 25 <!--action class="SetNodeAction" params="amenity=parking"/--> 26 26 <action class="PlayAudioAction" params="resource://audio/KDE_Window_Iconify.wav"/> 27 27 <action class="SetWaypointAction" params="Parking"/> 28 28 </button> 29 <button label="One Way" hotkey="O" icon="presets/oneway.png"> 30 <action class="PlayAudioAction" params="resource://audio/KDE_Window_Iconify.wav"/> 31 <action class="SetWaypointAction" params="oneway=yes"/> 32 </button> 33 <button label="Church" hotkey="C" icon="styles/standard/religion/church.png"> 29 <button label="Church" hotkey="C" icon="presets/religion/church.svg"> 34 30 <action class="PlayAudioAction" params="resource://audio/KDE_Window_Iconify.wav"/> 35 31 <action class="SetNodeAction" params="amenity=place_of_worship,denomination=christian"/> 36 32 <action class="SetWaypointAction" params="Church"/> 37 33 </button> 38 <button label="Fuel Station" hotkey="F" icon=" styles/standard/vehicle/fuel.png">34 <button label="Fuel Station" hotkey="F" icon="presets/vehicle/fuel.svg"> 39 35 <!--action class="SetNodeAction" params="amenity=fuel"/--> 40 36 <action class="PlayAudioAction" params="resource://audio/KDE_Window_Iconify.wav"/> 41 37 <action class="SetWaypointAction" params="Fuel"/> 42 38 </button> 43 <button label="Hotel" hotkey="H" icon=" styles/standard/accommodation/hotel.png">39 <button label="Hotel" hotkey="H" icon="presets/accommodation/hotel.svg"> 44 40 <action class="PlayAudioAction" params="resource://audio/KDE_Window_Iconify.wav"/> 45 41 <action class="SetWaypointAction" params="Hotel"/> 46 42 </button> 47 <button label="Restaurant" hotkey="R" icon=" styles/standard/food/restaurant.png">43 <button label="Restaurant" hotkey="R" icon="presets/food/restaurant.svg"> 48 44 <action class="PlayAudioAction" params="resource://audio/KDE_Window_Iconify.wav"/> 49 45 <action class="SetNodeAction" params="amenity=restaurant"/> 50 46 <action class="SetWaypointAction" params="Restaurant"/> 51 47 </button> 52 <button label="Shopping" hotkey="S" icon=" styles/standard/shop.png">48 <button label="Shopping" hotkey="S" icon="presets/shop/mall.svg"> 53 49 <action class="PlayAudioAction" params="resource://audio/KDE_Window_Iconify.wav"/> 54 50 <action class="SetWaypointAction" params="Info"/> 55 51 </button> 56 <button label="WC" hotkey="W" icon=" styles/standard/vehicle/parking/restarea_toilets.png">52 <button label="WC" hotkey="W" icon="presets/service/toilets.svg"> 57 53 <action class="PlayAudioAction" params="resource://audio/KDE_Window_Iconify.wav"/> 58 54 <action class="SetWaypointAction" params="Info"/> 59 55 </button> 60 <button label="Camping" hotkey="Z" icon=" styles/standard/accommodation/camping/caravan.png">56 <button label="Camping" hotkey="Z" icon="presets/accommodation/caravan.svg"> 61 57 <action class="PlayAudioAction" params="resource://audio/KDE_Window_Iconify.wav"/> 62 58 <action class="SetWaypointAction" params="Camping"/> -
applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/ButtonDescription.java
r35252 r35262 175 175 String actionName = tr(getLabel()) + " (" + hotkey + ")"; 176 176 177 Icon icon = ImageProvider.getIfAvailable(iconName); 178 if (icon == null) 179 icon = ImageProvider.getIfAvailable("markers", iconName); 180 if (icon == null) 181 icon = ImageProvider.getIfAvailable("symbols", iconName); 182 if (icon == null) 183 icon = ImageProvider.getIfAvailable("nodes", iconName); 177 Icon icon = null; 178 if (iconName != null) { 179 icon = ImageProvider.getIfAvailable(iconName); 180 if (icon == null) 181 icon = ImageProvider.getIfAvailable("markers", iconName); 182 if (icon == null) 183 icon = ImageProvider.getIfAvailable("symbols", iconName); 184 if (icon == null) 185 icon = ImageProvider.getIfAvailable("nodes", iconName); 186 } 184 187 185 188 MetaAction action = new MetaAction(actionName, icon); -
applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/SurveyorComponent.java
r34591 r35262 64 64 */ 65 65 public void setColumns(String columnsString) { 66 System.out.println("setting columns to " +columnsString);67 66 columns = Integer.parseInt(columnsString); 68 67 buttonPanel.setLayout(new GridLayout(rows, columns)); -
applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/SurveyorShowAction.java
r34591 r35262 23 23 import org.openstreetmap.josm.actions.JosmAction; 24 24 import org.openstreetmap.josm.gui.MainApplication; 25 import org.openstreetmap.josm. plugins.surveyor.util.ResourceLoader;25 import org.openstreetmap.josm.io.CachedFile; 26 26 import org.openstreetmap.josm.spi.preferences.Config; 27 27 import org.openstreetmap.josm.tools.Logging; … … 107 107 } 108 108 109 public SurveyorComponent createComponent() { 109 public static SurveyorComponent createComponent() { 110 110 String source = Config.getPref().get("surveyor.source"); 111 if (source == null || source. length() == 0) {111 if (source == null || source.isEmpty()) { 112 112 source = DEFAULT_SOURCE; 113 113 Config.getPref().put("surveyor.source", DEFAULT_SOURCE); 114 // <FIXXME date="04.05.2007" author="cdaller">115 // TODO copy xml file to .josm directory if it does not exist!116 // </FIXXME>117 114 } 118 try (InputStream in = ResourceLoader.getInputStream(source)) {115 try (CachedFile cf = new CachedFile(source); InputStream in = cf.getInputStream()) { 119 116 return createComponent(in); 120 117 } catch (IOException e) { … … 134 131 * @throws SAXException if the xml could not be read. 135 132 */ 136 public SurveyorComponent createComponent(InputStream in) throws SAXException { 133 public static SurveyorComponent createComponent(InputStream in) throws SAXException { 137 134 XmlObjectParser parser = new XmlObjectParser(); 138 135 parser.mapOnStart("surveyor", SurveyorComponent.class); … … 146 143 Object object = parser.next(); 147 144 if (object instanceof SurveyorComponent) { 148 //System.out.println("SurveyorComponent " + object);149 145 surveyorComponent = (SurveyorComponent) object; 150 146 } else if (object instanceof ButtonDescription) { 151 //System.out.println("ButtonDescription " + object);152 147 ((ButtonDescription) object).setActions(actions); 153 148 surveyorComponent.addButton(((ButtonDescription) object)); 154 149 actions = new ArrayList<>(); 155 150 } else if (object instanceof SurveyorActionDescription) { 156 //System.out.println("SurveyorActionDescription " + object);157 151 actions.add((SurveyorActionDescription) object); 158 152 } else { -
applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/action/PlayAudioAction.java
r34591 r35262 4 4 import java.io.BufferedInputStream; 5 5 import java.io.IOException; 6 import java.io.InputStream;7 6 8 7 import javax.sound.sampled.AudioFormat; … … 15 14 16 15 import org.openstreetmap.josm.gui.MainApplication; 16 import org.openstreetmap.josm.io.CachedFile; 17 17 import org.openstreetmap.josm.plugins.surveyor.GpsActionEvent; 18 import org.openstreetmap.josm.plugins.surveyor.util.ResourceLoader;19 18 import org.openstreetmap.josm.tools.Logging; 20 19 … … 32 31 // run as a separate thread 33 32 MainApplication.worker.execute(() -> { 34 try { 35 if (audioSource == null) { 36 audioSource = getParameters().get(0); 37 } 38 InputStream in = new BufferedInputStream(ResourceLoader.getInputStream(audioSource)); 39 AudioInputStream stream = AudioSystem.getAudioInputStream(in); 33 if (audioSource == null) { 34 audioSource = getParameters().get(0); 35 } 36 try (CachedFile cf = new CachedFile(audioSource)) { 37 AudioInputStream stream = AudioSystem.getAudioInputStream(new BufferedInputStream(cf.getInputStream())); 40 38 41 39 // At present, ALAW and ULAW encodings must be converted
Note:
See TracChangeset
for help on using the changeset viewer.