Changeset 30646 in osm for applications/editors/josm/plugins/surveyor
- Timestamp:
- 2014-09-15T22:10:28+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/surveyor/src
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveAction.java
r29854 r30646 39 39 } 40 40 41 /* (non-Javadoc) 42 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) 43 */ 41 @Override 44 42 public void actionPerformed(ActionEvent e) { 45 43 if (e.getSource() instanceof AbstractButton) { … … 60 58 task = new AutoSaveEditLayerTimerTask(osmFilename); 61 59 gpsDataTimer.schedule(task, 5000, AUTO_SAVE_PERIOD_SEC * 1000); 62 } else { 63 if(gpsDataTimer != null) { 64 gpsDataTimer.cancel(); 65 } 60 } else if (gpsDataTimer != null) { 61 gpsDataTimer.cancel(); 66 62 } 67 68 69 63 } 70 64 } -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveGpsLayerTimerTask.java
r29854 r30646 53 53 } 54 54 55 56 /* (non-Javadoc)57 * @see java.util.TimerTask#run()58 */59 55 @Override 60 56 public void run() { 61 57 62 58 try { 63 64 59 GpxLayer gpsLayer = LayerUtil.findGpsLayer(gpsLayerName, GpxLayer.class); 65 60 if(gpsLayer == null) { -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/MetaAction.java
r13497 r30646 33 33 */ 34 34 public MetaAction() { 35 // TODO Auto-generated constructor stub36 35 } 37 36 … … 41 40 public MetaAction(String name) { 42 41 super(name); 43 // TODO Auto-generated constructor stub44 42 } 45 43 … … 68 66 } 69 67 70 /* 71 * (non-Javadoc) 72 * 73 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) 74 */ 68 @Override 75 69 public void actionPerformed(ActionEvent e) { 76 70 // check if action was called by repeating key presses too long pressed): … … 78 72 if ((time - lastActionCall) < MIN_TIME_DIFF) { 79 73 lastActionCall = time; 80 // System.out.println("repeating key detected");81 74 return; 82 75 } 83 76 lastActionCall = time; 84 // System.out.println("meta action '" + super.toString() + "' called");85 77 86 78 // toggle on/off -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorComponent.java
r29916 r30646 6 6 7 7 import static org.openstreetmap.josm.tools.I18n.tr; 8 8 9 import java.awt.BorderLayout; 9 10 import java.awt.Dimension; … … 116 117 } 117 118 118 119 120 119 public static void main(String[] args) { 121 122 120 123 121 // parse xml file and create component from it: … … 160 158 } 161 159 162 /* (non-Javadoc) 163 * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent) 164 */ 160 @Override 165 161 public void propertyChange(PropertyChangeEvent evt) { 166 162 if("gpsdata".equals(evt.getPropertyName())) { … … 171 167 } 172 168 173 /* (non-Javadoc) 174 * @see at.dallermassl.josm.plugin.surveyor.GpsDataSource#getGpsData() 175 */ 169 @Override 176 170 public LiveGpsData getGpsData() { 177 171 return gpsData; 178 172 } 179 180 173 } -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorShowAction.java
r29916 r30646 50 50 } 51 51 52 53 /* (non-Javadoc)54 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)55 */56 52 public void actionPerformed(ActionEvent e) { 57 53 if(surveyorFrame == null) { … … 59 55 60 56 SurveyorComponent comp = createComponent(); 61 // comp.setGridSize(3,3);62 // comp.addButton(new ButtonDescription("Tunnel", "T", "images/symbols/tunnel.png", "ConsolePrinterAction", ButtonType.SINGLE));63 // comp.addButton(new ButtonDescription("Bridge", "B", null, "ConsolePrinterAction", ButtonType.TOGGLE));64 // comp.addButton(new ButtonDescription("Motorway", "M", null, "ConsolePrinterAction", null));65 // comp.addButton(new ButtonDescription("Primary", "I", null, "ConsolePrinterAction", null));66 // comp.addButton(new ButtonDescription("Secondary", "S", null, "ConsolePrinterAction", null));67 // comp.addButton(new ButtonDescription("Unclassified", "U", null, "ConsolePrinterAction", null));68 // comp.addButton(new ButtonDescription("Residential", "R", null,69 // new SurveyorActionDescription("SetWaypointAction", new String[] {"residential", "images/reorder.png"}), null));70 // comp.addButton(new ButtonDescription("Parking", "P", "images/symbols/parking.png",71 // new SurveyorActionDescription("SetNodeAction", new String[] {"amenity", "parking", "createdby", "surveyor"}), null));72 57 73 58 // add component as gps event listener: … … 143 128 } 144 129 return component; 145 146 130 } 147 131 … … 175 159 actions.add((SurveyorActionDescription)object); 176 160 } else { 177 System.err.println("surveyor: unknown xml element: " + object);161 Main.error("surveyor: unknown xml element: " + object); 178 162 } 179 163 } 180 164 return surveyorComponent; 181 165 } 182 183 166 } -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/AbstractSurveyorAction.java
r13497 r30646 24 24 } 25 25 26 /* (non-Javadoc) 27 * @see at.dallermassl.josm.plugin.surveyor.SurveyorAction#setParameters(java.util.List) 28 */ 29 //@Override 26 @Override 30 27 public void setParameters(List<String> parameters) { 31 28 this.parameters = parameters; 32 29 } 33 34 30 } -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/BeepAction.java
r13497 r30646 20 20 int beepNumber = 1; 21 21 22 /* (non-Javadoc) 23 * @see at.dallermassl.josm.plugin.surveyor.SurveyorAction#actionPerformed(at.dallermassl.josm.plugin.surveyor.GpsActionEvent) 24 */ 22 @Override 25 23 public void actionPerformed(GpsActionEvent event) { 26 // run as a separate thread24 // run as a separate thread 27 25 Main.worker.execute(new Runnable() { 28 26 public void run() { … … 38 36 } 39 37 40 /* (non-Javadoc) 41 * @see at.dallermassl.josm.plugin.surveyor.SurveyorAction#setParameters(java.util.List) 42 */ 38 @Override 43 39 public void setParameters(List<String> parameters) { 44 40 try { … … 49 45 } 50 46 } 51 52 47 } -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/ConsolePrinterAction.java
r13497 r30646 15 15 public class ConsolePrinterAction extends AbstractSurveyorAction { 16 16 17 /* (non-Javadoc) 18 * @see at.dallermassl.josm.plugin.surveyor.ButtonAction#actionPerformed(at.dallermassl.josm.plugin.surveyor.GpsActionEvent, java.util.List) 19 */ 17 @Override 20 18 public void actionPerformed(GpsActionEvent event) { 21 19 LatLon coordinates = event.getCoordinates(); … … 23 21 + coordinates.lon() + " params: " + getParameters()); 24 22 } 25 26 23 } -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/PlayAudioAction.java
r30362 r30646 32 32 private String audioSource = null; 33 33 34 /* (non-Javadoc) 35 * @see at.dallermassl.josm.plugin.surveyor.SurveyorAction#actionPerformed(at.dallermassl.josm.plugin.surveyor.GpsActionEvent) 36 */ 37 //@Override 34 @Override 38 35 public void actionPerformed(GpsActionEvent event) { 39 36 // run as a separate thread … … 43 40 if(audioSource == null) { 44 41 audioSource = getParameters().get(0); 45 //System.out.println("reading audio from " + audioSource);46 42 } 47 43 InputStream in = new BufferedInputStream(ResourceLoader.getInputStream(audioSource)); -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SetNodeAction.java
r29916 r30646 36 36 } 37 37 38 /* (non-Javadoc) 39 * @see at.dallermassl.josm.plugin.surveyor.SurveyorAction#setParameters(java.util.List) 40 */ 41 //@Override 38 @Override 42 39 public void setParameters(List<String> parameters) { 43 40 keyValues = new ArrayList<Pair<String, String>>(); … … 57 54 } 58 55 59 /* (non-Javadoc) 60 * @see at.dallermassl.josm.plugin.surveyor.ButtonAction#actionPerformed(at.dallermassl.josm.plugin.surveyor.GpsActionEvent) 61 */ 56 @Override 62 57 public void actionPerformed(GpsActionEvent event) { 63 58 LatLon coordinates = event.getCoordinates(); -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SetWaypointAction.java
r29854 r30646 24 24 import at.dallermassl.josm.plugin.surveyor.SurveyorLock; 25 25 import at.dallermassl.josm.plugin.surveyor.SurveyorPlugin; 26 import at.dallermassl.josm.plugin.surveyor.action.gui.DialogClosingThread; 26 27 import at.dallermassl.josm.plugin.surveyor.action.gui.WaypointDialog; 27 28 import at.dallermassl.josm.plugin.surveyor.util.LayerUtil; … … 47 48 } 48 49 49 50 /* (non-Javadoc)51 * @see at.dallermassl.josm.plugin.surveyor.ButtonAction#actionPerformed(at.dallermassl.josm.plugin.surveyor.GpsActionEvent, java.util.List)52 */53 50 public void actionPerformed(GpsActionEvent event) { 54 //System.out.println(getClass().getSimpleName() + " KOORD: " + coordinates.lat() + ", " + coordinates.lon());55 51 String markerTitle = getParameters().get(0); 56 52 Object source = event.getSource(); … … 62 58 } 63 59 } 60 61 String iconName = getParameters().size() > 1 ? getParameters().get(1).trim() : null; 64 62 65 if(dialog == null) { 66 dialog = new WaypointDialog(); 63 long timeout = DialogClosingThread.DEFAULT_TIMEOUT; 64 if (getParameters().size() > 2) { 65 try { 66 timeout = Integer.parseInt(getParameters().get(2)); 67 } catch (NumberFormatException e) { 68 Main.error(e.getMessage()); 69 } 67 70 } 68 71 69 72 String markerText = markerTitle; 70 String inputText = dialog.openDialog(SurveyorPlugin.getSurveyorFrame(), tr("Waypoint Description")); 71 if(inputText != null && inputText.length() > 0) { 72 inputText = inputText.replaceAll("<", "_"); // otherwise the gpx file is ruined 73 markerText = markerText + " " + inputText; 73 74 if (timeout > 0) { 75 if (dialog == null) { 76 dialog = new WaypointDialog(); 77 } 78 79 String inputText = dialog.openDialog(SurveyorPlugin.getSurveyorFrame(), tr("Waypoint Description"), timeout*1000); 80 if(inputText != null && inputText.length() > 0) { 81 inputText = inputText.replaceAll("<", "_"); // otherwise the gpx file is ruined 82 markerText = markerText + " " + inputText; 83 } 74 84 } 75 76 String iconName = getParameters().size() > 1 ? getParameters().get(1) : null;77 85 78 86 // add the waypoint to the marker layer AND to the gpx layer … … 82 90 WayPoint waypoint = new WayPoint(event.getCoordinates()); 83 91 waypoint.attr.put("name", markerText); 84 if(iconName != null )92 if(iconName != null && !iconName.isEmpty()) 85 93 waypoint.attr.put("sym", iconName); 86 94 synchronized(SurveyorLock.class) { 87 //layer.data.add(new Marker(event.getCoordinates(), markerText, iconName));88 95 layer.data.add(new Marker(event.getCoordinates(), markerText, iconName, null, -1.0, 0.0)); 89 96 if(gpsLayer != null) { … … 105 112 if(markerLayer == null) { 106 113 // not found, add a new one 107 //markerLayer = new MarkerLayer(new GpxData(), MARKER_LAYER_NAME, null);108 114 markerLayer = new MarkerLayer(new GpxData(), MARKER_LAYER_NAME, null, null); 109 115 Main.main.addLayer(markerLayer); … … 129 135 return liveGpsLayer; 130 136 } 131 132 137 } -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SystemExecuteAction.java
r13497 r30646 10 10 import java.io.InputStreamReader; 11 11 12 import org.openstreetmap.josm.Main; 13 12 14 import at.dallermassl.josm.plugin.surveyor.GpsActionEvent; 13 15 … … 18 20 public class SystemExecuteAction extends AbstractSurveyorAction { 19 21 20 /* (non-Javadoc) 21 * @see at.dallermassl.josm.plugin.surveyor.SurveyorAction#actionPerformed(at.dallermassl.josm.plugin.surveyor.GpsActionEvent, java.util.List) 22 */ 23 //@Override 22 @Override 24 23 public void actionPerformed(GpsActionEvent event) { 25 24 final ProcessBuilder builder = new ProcessBuilder(getParameters()); 26 //Map<String, String> environ = builder.environment();27 25 builder.directory(new File(System.getProperty("user.home"))); 28 26 29 System.out.println("Directory : " + builder.directory());27 Main.debug("Directory : " + builder.directory()); 30 28 Thread executionThread = new Thread() { 31 29 32 /* (non-Javadoc)33 * @see java.lang.Thread#run()34 */35 30 @Override 36 31 public void run() { … … 48 43 System.out.println(getClass().getSimpleName() + "Program terminated!"); 49 44 } catch (Throwable t) { 50 t.printStackTrace();45 Main.error(t); 51 46 } 52 47 } 53 54 48 }; 55 49 executionThread.start(); 56 // try {57 // System.in.read();58 // } catch (IOException e) {59 // // TODO Auto-generated catch block60 // e.printStackTrace();61 // }62 50 } 63 51 } -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/gui/DialogClosingThread.java
r13497 r30646 15 15 import javax.swing.event.DocumentListener; 16 16 17 import org.openstreetmap.josm.Main; 18 17 19 /** 18 20 * @author cdaller … … 20 22 */ 21 23 public class DialogClosingThread extends Thread implements KeyListener, DocumentListener { 22 p rivate staticlong DEFAULT_TIMEOUT = 5000;24 public static final long DEFAULT_TIMEOUT = 5000; 23 25 private JDialog dialog; 24 26 private long timeout; … … 44 46 } 45 47 46 /* (non-Javadoc)47 * @see java.lang.Thread#run()48 */49 48 @Override 50 49 public void run() { … … 66 65 } 67 66 68 /* (non-Javadoc) 69 * @see java.awt.event.KeyListener#keyPressed(java.awt.event.KeyEvent) 70 */ 71 //@Override 67 @Override 72 68 public void keyPressed(KeyEvent e) { 73 69 reset(); 74 System.out.println("keypressed: " + e.getKeyCode());70 Main.debug("keypressed: " + e.getKeyCode()); 75 71 } 76 72 77 /* (non-Javadoc) 78 * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent) 79 */ 80 //@Override 73 @Override 81 74 public void keyReleased(KeyEvent e) { 82 75 reset(); 83 System.out.println("keyreleased: " + e.getKeyCode());76 Main.debug("keyreleased: " + e.getKeyCode()); 84 77 } 85 78 86 /* (non-Javadoc) 87 * @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent) 88 */ 89 //@Override 79 @Override 90 80 public void keyTyped(KeyEvent e) { 91 81 reset(); 92 System.out.println("keytyped: " + e.getKeyCode());82 Main.debug("keytyped: " + e.getKeyCode()); 93 83 } 94 84 … … 114 104 } 115 105 116 /* (non-Javadoc) 117 * @see javax.swing.event.DocumentListener#changedUpdate(javax.swing.event.DocumentEvent) 118 */ 119 //@Override 106 @Override 120 107 public void changedUpdate(DocumentEvent e) { 121 108 reset(); 122 System.out.println("changedUpdate: " + e);109 Main.debug("changedUpdate: " + e); 123 110 } 124 111 125 /* (non-Javadoc) 126 * @see javax.swing.event.DocumentListener#insertUpdate(javax.swing.event.DocumentEvent) 127 */ 128 //@Override 112 @Override 129 113 public void insertUpdate(DocumentEvent e) { 130 114 reset(); 131 System.out.println("insertUpdate: " + e);115 Main.debug("insertUpdate: " + e); 132 116 } 133 117 134 /* (non-Javadoc) 135 * @see javax.swing.event.DocumentListener#removeUpdate(javax.swing.event.DocumentEvent) 136 */ 137 //@Override 118 @Override 138 119 public void removeUpdate(DocumentEvent e) { 139 120 reset(); 140 System.out.println("removeUpdate: " + e);121 Main.debug("removeUpdate: " + e); 141 122 } 142 123 } -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/gui/WaypointDialog.java
r19211 r30646 5 5 package at.dallermassl.josm.plugin.surveyor.action.gui; 6 6 7 import java.awt.BorderLayout;8 7 import java.beans.PropertyChangeEvent; 9 8 import java.beans.PropertyChangeListener; … … 11 10 import javax.swing.JDialog; 12 11 import javax.swing.JFrame; 13 import javax.swing.JLabel;14 12 import javax.swing.JOptionPane; 15 13 import javax.swing.JTextField; 16 17 14 18 15 /** … … 22 19 public class WaypointDialog { 23 20 24 public String openDialog(JFrame frame, String message ) {21 public String openDialog(JFrame frame, String message, long timeout) { 25 22 26 23 JTextField textField = new JTextField(10); … … 29 26 Object[] array = {message, textField}; 30 27 31 //Create an array specifying the number of dialog buttons 32 //and their text. 28 //Create an array specifying the number of dialog buttons and their text. 33 29 Object[] options = {"OK"}; 34 30 … … 41 37 options[0]); 42 38 43 // final JOptionPane optionPane = new JOptionPane("The only way to close this dialog is by\n"44 // + "pressing one of the following buttons.\n" + "Do you understand?",45 // JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_NO_OPTION);46 47 48 39 final JDialog dialog = new JDialog(frame, "Enter Description", true); 49 DialogClosingThread closer = new DialogClosingThread(dialog );40 DialogClosingThread closer = new DialogClosingThread(dialog, timeout); 50 41 closer.observe(textField); 51 42 dialog.setContentPane(optionPane); … … 57 48 && (prop.equals(JOptionPane.VALUE_PROPERTY))) { 58 49 // If you were going to check something 59 // before closing the window, you'd do 60 // it here. 50 // before closing the window, you'd do it here. 61 51 dialog.setVisible(false); 62 52 } … … 67 57 dialog.setVisible(true); 68 58 69 70 //System.out.println("value: " + optionPane.getValue());71 59 return textField.getText(); 72 73 // int value = ((Integer) optionPane.getValue()).intValue();74 // if (value == JOptionPane.YES_OPTION) {75 // System.out.println("yes");76 // } else if (value == JOptionPane.NO_OPTION) {77 // System.out.println("no");78 // }79 80 60 } 81 82 public static void main(String[] args) {83 //1. Create the frame.84 JFrame frame = new JFrame("FrameDemo");85 86 //2. Optional: What happens when the frame closes?87 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);88 89 //3. Create components and put them in the frame.90 //...create emptyLabel...91 frame.getContentPane().add(new JLabel("test"), BorderLayout.CENTER);92 93 //4. Size the frame.94 frame.pack();95 frame.setSize(600,400);96 frame.setLocation(0,0);97 98 //5. Show it.99 frame.setVisible(true);100 new WaypointDialog().openDialog(frame, "test");101 }102 61 } -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/util/ResourceLoader.java
r30362 r30646 37 37 in = new FileInputStream(source); 38 38 } 39 System.out.println("stream for resource is " + in);40 39 return in; 41 40 } -
applications/editors/josm/plugins/surveyor/src/org/dinopolis/util/io/Tokenizer.java
r26509 r30646 801 801 return(new_list); 802 802 } 803 804 // /**805 // * Demonstrates the low level interface.806 // * @param args command line arguments.807 // */808 // protected static void testLowLevel(String[] args)809 // {810 // try811 // {812 // String filename;813 // if(args.length > 0)814 // filename = args[0];815 // else816 // filename = "/filer/cdaller/tmp/test.csv";817 //818 // Tokenizer tokenizer = new Tokenizer(new BufferedReader(new FileReader(filename)));819 //// Tokenizer tokenizer = new Tokenizer("column1,\"quoted column2\",column3\\, with quoted comma");820 // tokenizer.setDelimiter(',');821 //// tokenizer.eolIsSignificant(false);822 // tokenizer.respectEscapedCharacters(true);823 // tokenizer.respectQuotedWords(true);824 //825 // int token;826 // while((token = tokenizer.nextToken()) != Tokenizer.EOF)827 // {828 // switch(token)829 // {830 // case Tokenizer.EOL:831 // System.out.println("------------- ");832 // break;833 // case Tokenizer.WORD:834 // System.out.println("line" +tokenizer.getLineNumber() +" word: "+tokenizer.getWord());835 // break;836 // case Tokenizer.QUOTED_WORD:837 // System.out.println("line" +tokenizer.getLineNumber() +" quoted word: "+tokenizer.getWord());838 // break;839 // case Tokenizer.DELIMITER:840 // System.out.println("delimiter");841 // break;842 // default:843 // System.err.println("Unknown Token: "+token);844 // }845 // }846 // tokenizer.close();847 // }848 // catch(Exception ioe)849 // {850 // ioe.printStackTrace();851 // }852 // }853 //854 //855 // /**856 // * Demonstration of the high level interface.857 // * @param args command line arguments.858 // */859 // protected static void testHighLevel(String[] args)860 // {861 // try862 // {863 // String filename;864 // if(args.length > 0)865 // filename = args[0];866 // else867 // filename = "/filer/cdaller/tmp/test.csv";868 //869 // Tokenizer tokenizer = new Tokenizer(new BufferedReader(new FileReader(filename)));870 //// Tokenizer tokenizer = new Tokenizer("column1,\"quoted column2\",column3\\, with quoted comma");871 // tokenizer.setDelimiter(',');872 //// tokenizer.eolIsSignificant(false);873 // tokenizer.respectEscapedCharacters(true);874 // tokenizer.respectQuotedWords(true);875 //876 // List list;877 // while(tokenizer.hasNextLine())878 // {879 // list = tokenizer.nextLine();880 // System.out.println("List: "+list);881 // System.out.println("List w/o zero length elements: "+removeZeroLengthElements(list));882 // System.out.println("--");883 // }884 //885 // }886 // catch(Exception ioe)887 // {888 // ioe.printStackTrace();889 // }890 // }891 //892 // /**893 // * Demo code for the high level interface.894 // */895 // protected static void testHighLevelExample()896 // {897 // try898 // {899 // // simple example, tokenizing string, no escape, but quoted900 // // works:901 // System.out.println("example 1");902 // Tokenizer tokenizer = new Tokenizer("text,,,\"another,text\"");903 // List tokens;904 // while(tokenizer.hasNextLine())905 // {906 // tokens = tokenizer.nextLine();907 // System.out.println(tokens.get(0)); // prints 'text'908 // System.out.println(tokens.get(1)); // prints ''909 // System.out.println(tokens.get(2)); // prints ''910 // System.out.println(tokens.get(3)); // prints 'another,text'911 // }912 //913 // System.out.println("example 2");914 // // simple example, tokenizing string, using escape char and915 // // quoted strings:916 // tokenizer = new Tokenizer("text,text with\\,comma,,\"another,text\"");917 // tokenizer.respectEscapedCharacters(true);918 // while(tokenizer.hasNextLine())919 // {920 // tokens = tokenizer.nextLine();921 // System.out.println(tokens.get(0)); // prints 'text'922 // System.out.println(tokens.get(1)); // prints 'text with, comma'923 // System.out.println(tokens.get(2)); // prints ''924 // System.out.println(tokens.get(3)); // prints 'another,text'925 // }926 // }927 // catch(Exception ioe)928 // {929 // ioe.printStackTrace();930 // }931 // }932 //933 // public static void main(String[] args)934 // {935 //// testLowLevel(args);936 //// testHighLevel(args);937 //// testGeonetUTF8(args);938 // testHighLevelExample();939 // }940 803 } 941 942
Note:
See TracChangeset
for help on using the changeset viewer.