Changeset 29819 in osm


Ignore:
Timestamp:
2013-08-03T11:50:12+02:00 (11 years ago)
Author:
hind
Message:

Support for CommandLine asynchronous commands

Location:
applications/editors/josm/plugins/CommandLine/src/CommandLine
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/CommandLine/src/CommandLine/Command.java

    r29505 r29819  
    2626    public int currentParameterNum;
    2727    public boolean tracks;
    28 
    29     public Command () { parameters = new ArrayList<Parameter>(); optParameters = new ArrayList<Parameter>(); currentParameterNum = 0; tracks = false; icon = ""; }
     28    public boolean asynchronous;
     29
     30    public Command () { parameters = new ArrayList<Parameter>(); optParameters = new ArrayList<Parameter>(); currentParameterNum = 0; tracks = false; asynchronous = false; icon = ""; }
    3031
    3132    public boolean loadObject(Object obj) {
  • applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java

    r29817 r29819  
    558558                }
    559559                Utils.close(osmWriter);
     560                synchronized (syncObj) {
     561                    if (currentCommand.asynchronous) {
     562                        tp.running = false;
     563                        syncObj.notifyAll();
     564                    }
     565                }
    560566            }
    561567        });
  • applications/editors/josm/plugins/CommandLine/src/CommandLine/Loader.java

    r29769 r29819  
    8585                                        if (Value.equals("bbox"))
    8686                                                currentCommand.tracks = true;
    87                                 }
    88                                 else if (Name.equals("icon")) {
     87                                } else if (Name.equals("icon")) {
    8988                                        currentCommand.icon = Value;
     89                                } else if (Name.equals("asynchronous")) {
     90                                        currentCommand.asynchronous = Value.equals("true") ? true : false;
    9091                                }
    9192                        }
     
    126127        }
    127128
    128         @Override
     129        @Override
    129130        public void characters(char ch[], int start, int length)
    130131        {
     
    167168        }
    168169
    169         @Override
     170        @Override
    170171        public void warning(SAXParseException ex) {
    171           System.err.println("Warning in command xml file " + currentFile + ": " + ex.getMessage());
     172                System.err.println("Warning in command xml file " + currentFile + ": " + ex.getMessage());
    172173        }
    173174
    174         @Override
     175        @Override
    175176        public void error(SAXParseException ex) {
    176           System.err.println("Error in command xml file " + currentFile + ": " + ex.getMessage());
     177                System.err.println("Error in command xml file " + currentFile + ": " + ex.getMessage());
    177178        }
    178179
    179         @Override
     180        @Override
    180181        public void fatalError(SAXParseException ex) throws SAXException {
    181           System.err.println("Error in command xml file " + currentFile + ": " + ex.getMessage());
    182           throw ex;
     182                System.err.println("Error in command xml file " + currentFile + ": " + ex.getMessage());
     183                throw ex;
    183184        }
    184185}
Note: See TracChangeset for help on using the changeset viewer.