Changeset 30114 in osm for applications


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
Files:
1 added
4 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/OpeningHoursEditor/.project

    r29853 r30114  
    22<projectDescription>
    33        <name>JOSM-OpeningHoursEditor</name>
    4         <comment></comment>
     4        <comment>Nature JavaCC</comment>
    55        <projects>
    66        </projects>
    77        <buildSpec>
     8                <buildCommand>
     9                        <name>sf.eclipse.javacc.javaccbuilder</name>
     10                        <arguments>
     11                        </arguments>
     12                </buildCommand>
    813                <buildCommand>
    914                        <name>org.eclipse.jdt.core.javabuilder</name>
     
    1419        <natures>
    1520                <nature>org.eclipse.jdt.core.javanature</nature>
     21                <nature>sf.eclipse.javacc.javaccnature</nature>
    1622        </natures>
    1723</projectDescription>
  • applications/editors/josm/plugins/OpeningHoursEditor/.settings/org.eclipse.jdt.core.prefs

    r29854 r30114  
    66org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
    77org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
     8org.eclipse.jdt.core.compiler.doc.comment.support=enabled
    89org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
    910org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
     
    2728org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
    2829org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
     30org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
     31org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
     32org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
     33org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
     34org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
    2935org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
    3036org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
     
    3339org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
    3440org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
     41org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
     42org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
     43org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
     44org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
     45org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
     46org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
     47org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
     48org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
    3549org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
    3650org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
  • 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.