Ignore:
Timestamp:
2010-12-08T11:02:25+01:00 (9 years ago)
Author:
bastiK
Message:

Added remotecontrol plugin to josm core. This plugin was initially written by Frederik Ramm (frederik) and incorporates code taken from YWMS plugin by frsantos. Major contributions by Bodo Meissner (bomm) and stephankn. Note: The code has been added, but is not "active" yet (RemoteControl.on == false). This is because wmsplugin and imagery plugin has not been adapted to this change. They are about to be integrated as well, so this adaption is not necessary.

Location:
trunk/src/org/openstreetmap/josm/data/validation
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java

    r3671 r3707  
    4646import org.openstreetmap.josm.data.validation.tests.UntaggedWay;
    4747import org.openstreetmap.josm.data.validation.tests.WronglyOrderedWays;
    48 import org.openstreetmap.josm.data.validation.util.ValUtil;
    4948import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
    50 import org.openstreetmap.josm.gui.dialogs.ValidatorDialog;
    5149import org.openstreetmap.josm.gui.layer.ValidatorLayer;
    5250import org.openstreetmap.josm.gui.layer.Layer;
     
    6664    /** The validate action */
    6765    public ValidateAction validateAction = new ValidateAction();
    68 
    69     /** The validation dialog */
    70     ValidatorDialog validationDialog;
    7166
    7267    /** Grid detail, multiplier of east,north values for valuable cell sizing */
     
    10398
    10499    public OsmValidator() {
    105         checkPluginDir();
     100        checkValidatorDir();
    106101        initializeGridDetail();
    107102        initializeTests(getTests());
     
    110105
    111106    /**
     107     * Returns the plugin's directory of the plugin
     108     *
     109     * @return The directory of the plugin
     110     */
     111    public static String getValidatorDir()
     112    {
     113        return Main.pref.getPreferencesDir() + "validator/";
     114    }
     115
     116    /**
    112117     * Check if plugin directory exists (store ignored errors file)
    113118     */
    114     private void checkPluginDir() {
     119    private void checkValidatorDir() {
    115120        try {
    116             File pathDir = new File(ValUtil.getPluginDir());
     121            File pathDir = new File(getValidatorDir());
    117122            if (!pathDir.exists()) {
    118123                pathDir.mkdirs();
     
    127132        if (Main.pref.getBoolean(ValidatorPreference.PREF_USE_IGNORE, true)) {
    128133            try {
    129                 final BufferedReader in = new BufferedReader(new FileReader(ValUtil.getPluginDir() + "ignorederrors"));
     134                final BufferedReader in = new BufferedReader(new FileReader(getValidatorDir() + "ignorederrors"));
    130135                for (String line = in.readLine(); line != null; line = in.readLine()) {
    131136                    ignoredErrors.add(line);
     
    149154    public static void saveIgnoredErrors() {
    150155        try {
    151             final PrintWriter out = new PrintWriter(new FileWriter(ValUtil.getPluginDir() + "ignorederrors"), false);
     156            final PrintWriter out = new PrintWriter(new FileWriter(getValidatorDir() + "ignorederrors"), false);
    152157            for (String e : ignoredErrors) {
    153158                out.println(e);
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r3674 r3707  
    4848import org.openstreetmap.josm.data.osm.Relation;
    4949import org.openstreetmap.josm.data.osm.Way;
     50import org.openstreetmap.josm.data.validation.OsmValidator;
    5051import org.openstreetmap.josm.data.validation.Severity;
    5152import org.openstreetmap.josm.data.validation.Test;
    5253import org.openstreetmap.josm.data.validation.TestError;
    5354import org.openstreetmap.josm.data.validation.util.Entities;
    54 import org.openstreetmap.josm.data.validation.util.ValUtil;
    5555import org.openstreetmap.josm.gui.preferences.ValidatorPreference;
    5656import org.openstreetmap.josm.gui.preferences.TaggingPresetPreference;
     
    199199        for (String source : sources.split(";")) {
    200200            try {
    201                 MirroredInputStream s = new MirroredInputStream(source, ValUtil.getPluginDir(), -1);
     201                MirroredInputStream s = new MirroredInputStream(source, OsmValidator.getValidatorDir(), -1);
    202202                InputStreamReader r;
    203203                try {
  • trunk/src/org/openstreetmap/josm/data/validation/util/ValUtil.java

    r3671 r3707  
    1010import java.util.Set;
    1111
    12 import org.openstreetmap.josm.Main;
    1312import org.openstreetmap.josm.data.osm.Node;
    1413import org.openstreetmap.josm.data.osm.Way;
     
    2221public class ValUtil
    2322{
    24     /**
    25      * Returns the plugin's directory of the plugin
    26      *
    27      * @return The directory of the plugin
    28      */
    29     public static String getPluginDir()
    30     {
    31         return Main.pref.getPreferencesDir() + "validator/";
    32     }
    33 
    3423    /**
    3524     * Returns the start and end cells of a way.
Note: See TracChangeset for help on using the changeset viewer.