Changeset 33585 in osm for applications


Ignore:
Timestamp:
2017-09-08T02:37:56+02:00 (7 years ago)
Author:
donvip
Message:

update to JOSM 12782

Location:
applications/editors/josm/plugins/rasterfilters
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/rasterfilters/build.xml

    r32680 r33585  
    1010       
    1111        <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    12         <property name="plugin.main.version" value="10580" />
    13         <property name="plugin.version" value="1.0.1"/>
     12        <property name="plugin.main.version" value="12782" />
     13        <property name="plugin.version" value="1.0.2"/>
    1414
    1515    <property name="plugin.icon" value="images/josm_filters_48.png"/>
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/RasterFiltersPlugin.java

    r33269 r33585  
    88
    99import org.openstreetmap.josm.Main;
     10import org.openstreetmap.josm.gui.MainApplication;
    1011import org.openstreetmap.josm.gui.MapFrame;
    1112import org.openstreetmap.josm.gui.SideButton;
     
    2526import org.openstreetmap.josm.plugins.rasterfilters.preferences.FiltersDownloader;
    2627import org.openstreetmap.josm.plugins.rasterfilters.preferences.RasterFiltersPreferences;
    27 
     28import org.openstreetmap.josm.tools.Logging;
    2829
    2930/**
     
    4142    public RasterFiltersPlugin(PluginInformation info) {
    4243        super(info);
    43         Main.debug("Loading RasterFiltersPlugin");
     44        Logging.debug("Loading RasterFiltersPlugin");
    4445
    4546        File file = new File(getPluginDir());
     
    5253                    file.createNewFile();
    5354                } catch (IOException e) {
    54                     Main.debug("Cannot create file" + file.getAbsolutePath() + "\n" + e.getMessage());
     55                    Logging.debug("Cannot create file" + file.getAbsolutePath() + "\n" + e.getMessage());
    5556                }
    5657            }
     
    6263    @Override
    6364    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
    64         if (Main.isDisplayingMapView()) {
    65             Main.getLayerManager().addLayerChangeListener(this);
    66             Main.getLayerManager().addActiveLayerChangeListener(this);
     65        if (MainApplication.isDisplayingMapView()) {
     66            MainApplication.getLayerManager().addLayerChangeListener(this);
     67            MainApplication.getLayerManager().addActiveLayerChangeListener(this);
    6768        }
    6869    }
     
    7071    @Override
    7172    public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
    72         if (!(Main.getLayerManager().getActiveLayer() instanceof ImageryLayer)) {
     73        if (!(MainApplication.getLayerManager().getActiveLayer() instanceof ImageryLayer)) {
    7374            filterButton.setEnabled(false);
    7475        } else {
     
    121122        }
    122123
    123         if (Main.getLayerManager().getLayers().isEmpty()) {
     124        if (MainApplication.getLayerManager().getLayers().isEmpty()) {
    124125            Container container = filterButton.getParent();
    125126            if (container != null) {
     
    131132        }
    132133
    133         Main.getLayerManager().removeLayerChangeListener(this);
    134         Main.getLayerManager().removeActiveLayerChangeListener(this);
     134        MainApplication.getLayerManager().removeLayerChangeListener(this);
     135        MainApplication.getLayerManager().removeActiveLayerChangeListener(this);
    135136    }
    136137
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/actions/ShowFiltersDialogAction.java

    r33269 r33585  
    1010import javax.swing.JMenuItem;
    1111
    12 import org.openstreetmap.josm.Main;
     12import org.openstreetmap.josm.gui.MainApplication;
    1313import org.openstreetmap.josm.gui.layer.ImageryLayer;
    1414import org.openstreetmap.josm.gui.layer.Layer;
     
    1616import org.openstreetmap.josm.plugins.rasterfilters.gui.FiltersDialog;
    1717import org.openstreetmap.josm.tools.ImageProvider;
     18import org.openstreetmap.josm.tools.Logging;
    1819
    1920import static org.openstreetmap.josm.tools.I18n.tr;
     
    4849    public void actionPerformed(ActionEvent e) {
    4950
    50         Layer layer = Main.getLayerManager().getActiveLayer();
     51        Layer layer = MainApplication.getLayerManager().getActiveLayer();
    5152
    5253        if (layer instanceof ImageryLayer) {
     
    6465            }
    6566        } else {
    66             Main.debug("The layer is not the instance of " + ImageryLayer.class.getCanonicalName());
     67            Logging.debug("The layer is not the instance of " + ImageryLayer.class.getCanonicalName());
    6768        }
    6869    }
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/gui/FilterPanel.java

    r33269 r33585  
    3131import org.openstreetmap.josm.Main;
    3232import org.openstreetmap.josm.plugins.rasterfilters.model.FiltersManager;
     33import org.openstreetmap.josm.tools.Logging;
    3334
    3435import static org.openstreetmap.josm.tools.I18n.tr;
     
    245246            int initValue = json.getInt("default");
    246247
    247             Main.debug("Slider is integer\n");
    248             Main.debug("minValue: " + String.valueOf(minValue)
     248            Logging.debug("Slider is integer\n");
     249            Logging.debug("minValue: " + String.valueOf(minValue)
    249250                    + "maxValue: " + String.valueOf(maxValue));
    250251            try {
     
    265266        } else if (valueType.equals("float")) {
    266267
    267             Main.debug("Slider is float\n");
     268            Logging.debug("Slider is float\n");
    268269            // every value is supplied by 10 to be integer for slider
    269270            double minValueDouble = array.getJsonNumber(0).doubleValue();
    270271            double maxValueDouble = array.getJsonNumber(1).doubleValue();
    271             Main.debug("DminValue: " + String.valueOf(minValueDouble)
     272            Logging.debug("DminValue: " + String.valueOf(minValueDouble)
    272273                    + "DmaxValue: " + String.valueOf(maxValueDouble));
    273274
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/model/FiltersManager.java

    r33269 r33585  
    2525
    2626import com.bric.swing.ColorPicker;
    27 import org.openstreetmap.josm.Main;
    28 import org.openstreetmap.josm.gui.layer.ImageProcessor;
     27import org.openstreetmap.josm.gui.MainApplication;
    2928import org.openstreetmap.josm.plugins.rasterfilters.filters.Filter;
    3029import org.openstreetmap.josm.plugins.rasterfilters.gui.FilterGuiListener;
     
    3231import org.openstreetmap.josm.plugins.rasterfilters.gui.FiltersDialog;
    3332import org.openstreetmap.josm.plugins.rasterfilters.preferences.FiltersDownloader;
     33import org.openstreetmap.josm.tools.ImageProcessor;
     34import org.openstreetmap.josm.tools.Logging;
    3435
    3536
     
    7576
    7677        try {
    77             Main.debug("ClassName for loading " + filterState.getFilterClassName());
     78            Logging.debug("ClassName for loading " + filterState.getFilterClassName());
    7879            clazz = FiltersDownloader.loader.loadClass(filterState
    7980                    .getFilterClassName());
     
    8182
    8283        } catch (ReflectiveOperationException | IllegalArgumentException | SecurityException e) {
    83             e.printStackTrace();
     84            Logging.error(e);
    8485        }
    8586
     
    130131            filter.changeFilterState(filterState.encodeJson());
    131132        }
    132         Main.getLayerManager().getActiveLayer().setFilterStateChanged();
     133        MainApplication.getLayerManager().getActiveLayer().setFilterStateChanged();
    133134
    134135        fp.createBottomPanel(this);
     
    136137        filterListener.setFilterState(filterState);
    137138
    138         Main.debug("The number of elems in the Filters map is equal \n"
     139        Logging.debug("The number of elems in the Filters map is equal \n"
    139140                + filtersMap.size());
    140141
     
    154155        }
    155156
    156         if (Main.getLayerManager().getActiveLayer() != null) {
    157             Main.getLayerManager().getActiveLayer().setFilterStateChanged();
     157        if (MainApplication.getLayerManager().getActiveLayer() != null) {
     158            MainApplication.getLayerManager().getActiveLayer().setFilterStateChanged();
    158159        }
    159160
     
    238239        }
    239240
    240         Main.getLayerManager().getActiveLayer().setFilterStateChanged();
     241        MainApplication.getLayerManager().getActiveLayer().setFilterStateChanged();
    241242
    242243    }
     
    254255            disabledFilters.add(filtersMap.get(filterId));
    255256
    256             Main.getLayerManager().getActiveLayer().setFilterStateChanged();
     257            MainApplication.getLayerManager().getActiveLayer().setFilterStateChanged();
    257258
    258259        } else {
     
    261262            disabledFilters.remove(filtersMap.get(filterId));
    262263
    263             Main.getLayerManager().getActiveLayer().setFilterStateChanged();
     264            MainApplication.getLayerManager().getActiveLayer().setFilterStateChanged();
    264265
    265266        }
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/preferences/FiltersDownloader.java

    r33269 r33585  
    3838import org.jsoup.select.Elements;
    3939import org.openstreetmap.josm.Main;
     40import org.openstreetmap.josm.tools.Logging;
    4041
    4142/**
     
    225226    public static void initFilters() {
    226227        File file = new File(pluginDir, "urls.map");
    227         Main.debug("EXIST FILE? " + file.exists());
     228        Logging.debug("EXIST FILE? " + file.exists());
    228229
    229230        try (BufferedReader br = Files.newBufferedReader(file.toPath(), StandardCharsets.UTF_8)) {
     
    237238                    try {
    238239                        url = new URL("jar", "", fileUrl.toURI().toURL() + "!/");
    239                         Main.debug("binaryUrl: " + url.toString());
     240                        Logging.debug("binaryUrl: " + url.toString());
    240241                        binariesLocalUrls.add(url);
    241242                    } catch (MalformedURLException e) {
    242                         Main.debug("Initializing filters with unknown protocol. \n"
     243                        Logging.debug("Initializing filters with unknown protocol. \n"
    243244                                + e.getMessage());
    244245                    }
     
    249250        }
    250251
    251         Main.debug("BinariesLocal : " + binariesLocalUrls.toString());
     252        Logging.debug("BinariesLocal : " + binariesLocalUrls.toString());
    252253
    253254        loader = new URLClassLoader(
     
    286287
    287288        File file = new File(pluginDir, "urls.map");
    288         Main.debug("pluginDir and urls map" + file.getAbsoluteFile());
     289        Logging.debug("pluginDir and urls map" + file.getAbsoluteFile());
    289290
    290291        try (BufferedWriter writer = Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8)) {
     
    317318    public static String loadBinaryToFile(String fromUrl) {
    318319
    319         // Main.debug("Need to load binary from " + fromUrl);
     320        // Logging.debug("Need to load binary from " + fromUrl);
    320321
    321322        URL url = null;
     
    327328        String localFile = null;
    328329        File plugin = new File(pluginDir);
    329         Main.debug("plugin dir" + plugin.getAbsolutePath());
     330        Logging.debug("plugin dir" + plugin.getAbsolutePath());
    330331
    331332        if (m.find()) {
    332 
    333333            if (plugin.exists()) {
    334 
    335334                localFile = fromUrl.substring(m.end());
    336                 Main.debug("localFile: " + localFile);
     335                Logging.debug("localFile: " + localFile);
    337336            }
    338337        }
     
    343342            String plugDir = plugin.getAbsolutePath();
    344343            File file = new File(plugDir, localFile);
    345             Main.debug("Binary file: " + file.getAbsolutePath());
     344            Logging.debug("Binary file: " + file.getAbsolutePath());
    346345
    347346            if (file.exists()) {
    348                 Main.debug("File " + localFile + " already exists");
     347                Logging.debug("File " + localFile + " already exists");
    349348
    350349                return file.getAbsolutePath();
Note: See TracChangeset for help on using the changeset viewer.