Ignore:
Timestamp:
2013-12-07T21:29:17+01:00 (11 years ago)
Author:
donvip
Message:

[josm_openinghours] code cleanup

Location:
applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe
Files:
4 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OhePlugin.java

    r29854 r30114  
    4848import org.openstreetmap.josm.tools.Shortcut;
    4949
     50/**
     51 * Opening hours editor plugin.
     52 */
    5053public class OhePlugin extends Plugin {
     54   
    5155    /**
    5256     * Strings for choosing which key of an object with given tags should be
     
    6872     * Will be invoked by JOSM to bootstrap the plugin
    6973     *
    70      * @param info
    71      *            information about the plugin and its local installation
     74     * @param info information about the plugin and its local installation
    7275     */
    7376    public OhePlugin(PluginInformation info) {
     
    7982     * this Action is used for calling the OpeningsHourEditor, the selected
    8083     * objects in the active datalayer are edited
    81      *
    82      * @author boman
    8384     */
    8485    class OheMenuAction extends JosmAction {
  • applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OpeningTimeUtils.java

    r26219 r30114  
    66import org.openstreetmap.josm.plugins.ohe.parser.OpeningTimeCompiler;
    77
     8/**
     9 * Collection of utility methods.
     10 */
    811public class OpeningTimeUtils {
    9     // implements the subtraction of daytimes in spans of days when a day in
    10     // the list occurs direct afterwards
     12   
     13    /**
     14     * Implements the subtraction of daytimes in spans of days when a day in the list occurs direct afterwards
     15     */
    1116    public static ArrayList<int[]> convert(ArrayList<DateTime> dateTimes) {
    1217        ArrayList<int[]> ret = new ArrayList<int[]>(); // the list which is
     
    104109    }
    105110
    106     // returns a String (e.g "Mo-Sa 10:00-20:00; Tu off") representing the
    107     // TimeRects
     111    /**
     112     * Returns a String (e.g "Mo-Sa 10:00-20:00; Tu off") representing the TimeRects
     113     */
    108114    public static String makeStringFromRects(ArrayList<TimeRect> givenTimeRects) {
    109115        // create an array of booleans representing every minute on all the days
     
    178184    }
    179185
    180     // returns a String representing the openinghours on one special day (e.g.
    181     // "10:00-20:00")
     186    /**
     187     * Returns a String representing the openinghours on one special day (e.g. "10:00-20:00")
     188     */
    182189    private static String makeStringFromMinuteArray(boolean[] minutes) {
    183190        String ret = "";
     
    212219
    213220    /**
     221     *
    214222     * @param minutes integer in range from 0 and 24*60 inclusive
    215223     * @param hourMode 12 or 24 hour clock
  • applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheDialogPanel.java

    r29854 r30114  
    1717import javax.swing.JTextField;
    1818
     19import org.openstreetmap.josm.Main;
    1920import org.openstreetmap.josm.plugins.ohe.ClockSystem;
    2021import org.openstreetmap.josm.plugins.ohe.OhePlugin;
     
    2324import org.openstreetmap.josm.plugins.ohe.parser.ParseException;
    2425import org.openstreetmap.josm.plugins.ohe.parser.SyntaxException;
    25 import org.openstreetmap.josm.plugins.ohe.parser.TokenMgrError;
    2626import org.openstreetmap.josm.tools.GBC;
    2727
     
    6767                value = valuesMap.keySet().iterator().next();
    6868            else if (valuesMap.size() > 1) {
    69                 // TODO let the user choose which value he wants to edit (e.g.
    70                 // with a combobox)
     69                // TODO let the user choose which value he wants to edit (e.g. with a combobox)
    7170                int mostOccurences = 0;
    7271                for (String v : valuesMap.keySet())
     
    140139                    tColumns = new int[] { syntaxError.getStartColumn(), syntaxError.getEndColumn() };
    141140                    info = syntaxError.getInfo();
    142                 } else if (t instanceof TokenMgrError) {
    143                     TokenMgrError tokenMgrError = (TokenMgrError) t;
    144                     tColumns = new int[] { tokenMgrError.errorColumn - 1, tokenMgrError.errorColumn + 1 };
    145141                } else {
    146                     t.printStackTrace();
     142                    Main.warn(t);
    147143                }
    148144
  • applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/OpeningTimeCompiler.jj

    r30112 r30114  
    3030  ERROR_REPORTING = true;
    3131  JAVA_UNICODE_ESCAPE = false;
    32   UNICODE_INPUT = false;
     32  UNICODE_INPUT = true;
    3333  IGNORE_CASE = false;
    3434  USER_TOKEN_MANAGER = false;
Note: See TracChangeset for help on using the changeset viewer.