Changeset 33269 in osm for applications/editors


Ignore:
Timestamp:
2017-04-20T20:56:53+02:00 (8 years ago)
Author:
niplecrumple
Message:

Old style SideButton usage removed + refactoring

Location:
applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters
Files:
16 edited
1 moved

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/RasterFiltersPlugin.java

    r32853 r33269  
    11package org.openstreetmap.josm.plugins.rasterfilters;
     2
     3import java.awt.Container;
     4import java.io.File;
     5import java.io.IOException;
     6
     7import javax.swing.JPanel;
    28
    39import org.openstreetmap.josm.Main;
     
    1521import org.openstreetmap.josm.plugins.Plugin;
    1622import org.openstreetmap.josm.plugins.PluginInformation;
    17 import org.openstreetmap.josm.plugins.rasterfilters.actions.ShowLayerFiltersDialog;
     23import org.openstreetmap.josm.plugins.rasterfilters.actions.ShowFiltersDialogAction;
    1824import org.openstreetmap.josm.plugins.rasterfilters.gui.FiltersDialog;
    1925import org.openstreetmap.josm.plugins.rasterfilters.preferences.FiltersDownloader;
    2026import org.openstreetmap.josm.plugins.rasterfilters.preferences.RasterFiltersPreferences;
    2127
    22 import javax.swing.*;
    23 import java.awt.*;
    24 import java.io.File;
    25 import java.io.IOException;
    2628
    2729/**
     
    3032 *
    3133 * @author Nipel-Crumple
    32  *
    3334 */
    3435public class RasterFiltersPlugin extends Plugin implements LayerChangeListener, ActiveLayerChangeListener {
    3536
    3637    private SideButton filterButton;
    37     private ShowLayerFiltersDialog action;
     38    private ShowFiltersDialogAction action;
    3839    private PreferenceSetting setting;
    3940
     
    8687
    8788            if (action == null) {
    88                 action = new ShowLayerFiltersDialog();
     89                action = new ShowFiltersDialogAction();
    8990            }
    9091
     
    122123        if (Main.getLayerManager().getLayers().isEmpty()) {
    123124            Container container = filterButton.getParent();
    124             if (container != null)
     125            if (container != null) {
    125126                container.remove(filterButton);
     127            }
    126128
    127129            FiltersDownloader.destroyFilters();
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/actions/ShowFiltersDialogAction.java

    r33268 r33269  
    11package org.openstreetmap.josm.plugins.rasterfilters.actions;
     2
     3import java.awt.Component;
     4import java.awt.event.ActionEvent;
     5import java.net.MalformedURLException;
     6import java.util.ArrayList;
     7import java.util.List;
     8
     9import javax.swing.AbstractAction;
     10import javax.swing.JMenuItem;
    211
    312import org.openstreetmap.josm.Main;
     
    817import org.openstreetmap.josm.tools.ImageProvider;
    918
    10 import javax.swing.*;
    11 import java.awt.*;
    12 import java.awt.event.ActionEvent;
    13 import java.net.MalformedURLException;
    14 import java.util.ArrayList;
    15 import java.util.List;
    16 
    1719import static org.openstreetmap.josm.tools.I18n.tr;
    1820
    1921/**
    2022 * The action that is called when user click on 'Choose filters' button
    21  * <p>
    22  * and sets image on that button
    2323 *
    2424 * @author Nipel-Crumple
    2525 */
    26 public final class ShowLayerFiltersDialog extends AbstractAction implements LayerAction {
     26public final class ShowFiltersDialogAction extends AbstractAction implements LayerAction {
    2727
    2828    private List<FiltersDialog> dialogs = new ArrayList<>();
    2929
    3030    /**
    31      * Constructs a new {@code ShowLayerFiltersDialog}.
     31     * Constructs a new {@code ShowFiltersDialogAction}.
    3232     */
    33     public ShowLayerFiltersDialog() {
     33    public ShowFiltersDialogAction() {
    3434        putValue(NAME, tr("Filters"));
    3535        putValue(SHORT_DESCRIPTION, tr("Choose Filter"));
    36         putValue(SMALL_ICON, ImageProvider.get("josm_filters_48.png"));
     36        putValue("ImageResource", new ImageProvider("josm_filters_48.png").getResource());
    3737    }
    3838
     
    5555                if (temp.getLayer().equals(layer)) {
    5656                    try {
    57                         temp.createAndShowGUI();
     57                        temp.createAndShowGui();
    5858                    } catch (MalformedURLException e1) {
    5959                        e1.printStackTrace();
     
    6363
    6464            }
     65        } else {
     66            Main.debug("The layer is not the instance of " + ImageryLayer.class.getCanonicalName());
    6567        }
    6668    }
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/filters/Filter.java

    r32853 r33269  
    11package org.openstreetmap.josm.plugins.rasterfilters.filters;
    22
    3 import javax.json.JsonObject;
    43import java.awt.image.BufferedImage;
    54import java.rmi.server.UID;
     5
     6import javax.json.JsonObject;
    67
    78/**
     
    2728     * @return json object 'filterState'
    2829     */
    29     public JsonObject changeFilterState(JsonObject filterState);
     30    JsonObject changeFilterState(JsonObject filterState);
    3031
    3132    /**
     
    3738     * @return processed image
    3839     */
    39     public BufferedImage applyFilter(BufferedImage img);
     40    BufferedImage applyFilter(BufferedImage img);
    4041
    4142    /**
     
    4546     * @param id sets value of ID field
    4647     */
    47     public void setId(UID id);
     48    void setId(UID id);
    4849
    4950    /**
     
    5253     * @return id of filter
    5354     */
    54     public UID getId();
     55    UID getId();
    5556}
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/gui/FilterGuiListener.java

    r32853 r33269  
    11package org.openstreetmap.josm.plugins.rasterfilters.gui;
    22
    3 import com.bric.swing.ColorPicker;
    4 import org.openstreetmap.josm.plugins.rasterfilters.model.FilterStateModel;
    5 import org.openstreetmap.josm.plugins.rasterfilters.model.StateChangeListener;
    6 import org.openstreetmap.josm.plugins.rasterfilters.values.BooleanValue;
    7 import org.openstreetmap.josm.plugins.rasterfilters.values.ColorValue;
    8 import org.openstreetmap.josm.plugins.rasterfilters.values.SelectValue;
    9 import org.openstreetmap.josm.plugins.rasterfilters.values.SliderValue;
    10 
    11 import javax.swing.*;
    12 import javax.swing.event.ChangeEvent;
    13 import javax.swing.event.ChangeListener;
    14 import java.awt.*;
     3import java.awt.Color;
    154import java.awt.event.ActionEvent;
    165import java.awt.event.ActionListener;
     
    2312import java.util.Set;
    2413
     14import javax.swing.ComboBoxModel;
     15import javax.swing.JCheckBox;
     16import javax.swing.JComboBox;
     17import javax.swing.JSlider;
     18import javax.swing.event.ChangeEvent;
     19import javax.swing.event.ChangeListener;
     20
     21import com.bric.swing.ColorPicker;
     22import org.openstreetmap.josm.plugins.rasterfilters.model.FilterStateModel;
     23import org.openstreetmap.josm.plugins.rasterfilters.model.StateChangeListener;
     24import org.openstreetmap.josm.plugins.rasterfilters.values.BooleanValue;
     25import org.openstreetmap.josm.plugins.rasterfilters.values.ColorValue;
     26import org.openstreetmap.josm.plugins.rasterfilters.values.SelectValue;
     27import org.openstreetmap.josm.plugins.rasterfilters.values.SliderValue;
     28
    2529/**
    2630 * This class is GUI listener which tracks all changes of GUI controls
     
    3034 */
    3135public class FilterGuiListener implements ChangeListener, ItemListener,
    32         ActionListener, PropertyChangeListener, FilterStateOwner {
     36        ActionListener, PropertyChangeListener, FilterStateOwner
     37{
    3338
    3439    private StateChangeListener handler;
     
    133138
    134139        // notify about state is changed now so send msg to FiltersManager
    135         if (handler != null)
     140        if (handler != null) {
    136141            handler.filterStateChanged(filterId, filterState);
     142        }
    137143
    138144    }
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/gui/FilterPanel.java

    r32853 r33269  
    11package org.openstreetmap.josm.plugins.rasterfilters.gui;
    22
    3 import com.bric.swing.ColorPicker;
    4 import org.openstreetmap.josm.Main;
    5 import org.openstreetmap.josm.plugins.rasterfilters.model.FiltersManager;
    6 
    7 import javax.json.JsonArray;
    8 import javax.json.JsonObject;
    9 import javax.swing.*;
    10 import javax.swing.border.Border;
    11 import javax.swing.border.EmptyBorder;
    12 import java.awt.*;
     3import java.awt.Color;
     4import java.awt.Component;
     5import java.awt.Dimension;
     6import java.awt.FlowLayout;
     7import java.awt.Font;
    138import java.awt.event.ActionListener;
    149import java.awt.event.ItemListener;
    1510import java.rmi.server.UID;
    1611import java.util.Hashtable;
     12
     13import javax.json.JsonArray;
     14import javax.json.JsonObject;
     15import javax.swing.BorderFactory;
     16import javax.swing.Box;
     17import javax.swing.BoxLayout;
     18import javax.swing.DefaultComboBoxModel;
     19import javax.swing.JButton;
     20import javax.swing.JCheckBox;
     21import javax.swing.JComboBox;
     22import javax.swing.JComponent;
     23import javax.swing.JLabel;
     24import javax.swing.JOptionPane;
     25import javax.swing.JPanel;
     26import javax.swing.JSlider;
     27import javax.swing.border.Border;
     28import javax.swing.border.EmptyBorder;
     29
     30import com.bric.swing.ColorPicker;
     31import org.openstreetmap.josm.Main;
     32import org.openstreetmap.josm.plugins.rasterfilters.model.FiltersManager;
    1733
    1834import static org.openstreetmap.josm.tools.I18n.tr;
     
    230246
    231247            Main.debug("Slider is integer\n");
    232             Main.debug("minValue: " + String.valueOf(minValue) +
    233                     "maxValue: " + String.valueOf(maxValue));
     248            Main.debug("minValue: " + String.valueOf(minValue)
     249                    + "maxValue: " + String.valueOf(maxValue));
    234250            try {
    235251                slider = new JSlider(JSlider.HORIZONTAL, minValue, maxValue,
     
    253269            double minValueDouble = array.getJsonNumber(0).doubleValue();
    254270            double maxValueDouble = array.getJsonNumber(1).doubleValue();
    255             Main.debug("DminValue: " + String.valueOf(minValueDouble) +
    256                     "DmaxValue: " + String.valueOf(maxValueDouble));
     271            Main.debug("DminValue: " + String.valueOf(minValueDouble)
     272                    + "DmaxValue: " + String.valueOf(maxValueDouble));
    257273
    258274            int minValue = (int) (minValueDouble * 100);
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/gui/FilterStateOwner.java

    r32853 r33269  
    44
    55/**
    6  * Filter state's keeper. This interface is implemented by {@link FilterGuiListeener}.
     6 * Filter state's keeper. This interface is implemented by {@link FilterGuiListener}.
    77 *
    88 * @author Nipel-Crumple
     
    1010public interface FilterStateOwner {
    1111
    12     public FilterStateModel getState();
     12    FilterStateModel getState();
    1313
    1414}
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/gui/FiltersDialog.java

    r32853 r33269  
    11package org.openstreetmap.josm.plugins.rasterfilters.gui;
    22
    3 import org.openstreetmap.josm.gui.layer.ImageryLayer;
    4 import org.openstreetmap.josm.gui.layer.Layer;
    5 import org.openstreetmap.josm.plugins.rasterfilters.model.FiltersManager;
    6 import org.openstreetmap.josm.plugins.rasterfilters.preferences.FiltersDownloader;
    7 
    8 import javax.swing.*;
    9 import javax.swing.border.EmptyBorder;
    10 import java.awt.*;
     3import java.awt.Color;
     4import java.awt.Component;
     5import java.awt.Dimension;
    116import java.awt.event.ActionEvent;
    127import java.awt.event.ActionListener;
     
    149import java.util.HashSet;
    1510import java.util.Set;
     11
     12import javax.swing.Box;
     13import javax.swing.BoxLayout;
     14import javax.swing.DefaultComboBoxModel;
     15import javax.swing.JButton;
     16import javax.swing.JComboBox;
     17import javax.swing.JFrame;
     18import javax.swing.JLabel;
     19import javax.swing.JPanel;
     20import javax.swing.JScrollPane;
     21import javax.swing.border.EmptyBorder;
     22
     23import org.openstreetmap.josm.gui.layer.ImageryLayer;
     24import org.openstreetmap.josm.gui.layer.Layer;
     25import org.openstreetmap.josm.plugins.rasterfilters.model.FiltersManager;
     26import org.openstreetmap.josm.plugins.rasterfilters.preferences.FiltersDownloader;
    1627
    1728/**
     
    7182    }
    7283
    73     public JFrame createAndShowGUI() throws MalformedURLException {
     84    public JFrame createAndShowGui() throws MalformedURLException {
    7485        listModel.removeAllElements();
    7586
     
    167178        }
    168179
    169         if (FiltersDownloader.filterTitles.isEmpty()
    170                 || listModel.getSize() == 0) {
     180        if (FiltersDownloader.filterTitles.isEmpty() || listModel.getSize() == 0) {
    171181            addButton.setEnabled(false);
    172182            filterChooser.setEnabled(false);
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/model/FilterStateModel.java

    r32853 r33269  
    11package org.openstreetmap.josm.plugins.rasterfilters.model;
    22
    3 import org.openstreetmap.josm.plugins.rasterfilters.values.*;
     3import java.awt.Color;
     4import java.util.HashMap;
     5import java.util.Map;
     6import java.util.Map.Entry;
    47
    58import javax.json.Json;
    69import javax.json.JsonObject;
    710import javax.json.JsonObjectBuilder;
    8 import java.awt.*;
    9 import java.util.HashMap;
    10 import java.util.Map;
    11 import java.util.Map.Entry;
     11
     12import org.openstreetmap.josm.plugins.rasterfilters.values.BooleanValue;
     13import org.openstreetmap.josm.plugins.rasterfilters.values.ColorValue;
     14import org.openstreetmap.josm.plugins.rasterfilters.values.SelectValue;
     15import org.openstreetmap.josm.plugins.rasterfilters.values.SliderValue;
     16import org.openstreetmap.josm.plugins.rasterfilters.values.Value;
    1217
    1318/**
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/model/FiltersManager.java

    r32853 r33269  
    11package org.openstreetmap.josm.plugins.rasterfilters.model;
     2
     3import java.awt.Dimension;
     4import java.awt.event.ActionEvent;
     5import java.awt.event.ActionListener;
     6import java.awt.event.ItemEvent;
     7import java.awt.event.ItemListener;
     8import java.awt.image.BufferedImage;
     9import java.rmi.server.UID;
     10import java.util.HashSet;
     11import java.util.Iterator;
     12import java.util.LinkedHashMap;
     13import java.util.Map;
     14import java.util.Set;
     15
     16import javax.json.JsonArray;
     17import javax.json.JsonObject;
     18import javax.swing.BorderFactory;
     19import javax.swing.JButton;
     20import javax.swing.JCheckBox;
     21import javax.swing.JComboBox;
     22import javax.swing.JComponent;
     23import javax.swing.JPanel;
     24import javax.swing.JSlider;
    225
    326import com.bric.swing.ColorPicker;
     
    1033import org.openstreetmap.josm.plugins.rasterfilters.preferences.FiltersDownloader;
    1134
    12 import javax.json.JsonArray;
    13 import javax.json.JsonObject;
    14 import javax.swing.*;
    15 import java.awt.*;
    16 import java.awt.event.ActionEvent;
    17 import java.awt.event.ActionListener;
    18 import java.awt.event.ItemEvent;
    19 import java.awt.event.ItemListener;
    20 import java.awt.image.BufferedImage;
    21 import java.rmi.server.UID;
    22 import java.util.*;
    2335
    2436/**
     
    2840 * @author Nipel-Crumple
    2941 */
    30 public class FiltersManager implements StateChangeListener, ImageProcessor,
    31         ActionListener, ItemListener {
     42public class FiltersManager implements StateChangeListener, ImageProcessor, ActionListener, ItemListener {
    3243
    3344    public Map<UID, Filter> filtersMap = new LinkedHashMap<>();
     
    139150    public void filterStateChanged(UID filterId, FilterStateModel filterState) {
    140151
    141         if (filtersMap.get(filterId) != null)
     152        if (filtersMap.get(filterId) != null) {
    142153            filtersMap.get(filterId).changeFilterState(filterState.encodeJson());
     154        }
    143155
    144156        if (Main.getLayerManager().getActiveLayer() != null) {
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/model/StateChangeListener.java

    r32853 r33269  
    1111public interface StateChangeListener {
    1212
    13     public void filterStateChanged(UID filterId, FilterStateModel filterState);
     13    void filterStateChanged(UID filterId, FilterStateModel filterState);
    1414
    1515}
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/preferences/FiltersDownloader.java

    r33113 r33269  
    11package org.openstreetmap.josm.plugins.rasterfilters.preferences;
     2
     3import java.awt.event.ActionEvent;
     4import java.awt.event.ActionListener;
     5import java.io.BufferedInputStream;
     6import java.io.BufferedOutputStream;
     7import java.io.BufferedReader;
     8import java.io.BufferedWriter;
     9import java.io.File;
     10import java.io.FileOutputStream;
     11import java.io.IOException;
     12import java.io.StringReader;
     13import java.net.HttpURLConnection;
     14import java.net.MalformedURLException;
     15import java.net.URL;
     16import java.net.URLClassLoader;
     17import java.net.URLConnection;
     18import java.nio.charset.StandardCharsets;
     19import java.nio.file.Files;
     20import java.util.ArrayList;
     21import java.util.HashMap;
     22import java.util.HashSet;
     23import java.util.List;
     24import java.util.Map;
     25import java.util.Set;
     26import java.util.TreeSet;
     27import java.util.regex.Matcher;
     28import java.util.regex.Pattern;
     29
     30import javax.json.Json;
     31import javax.json.JsonArray;
     32import javax.json.JsonObject;
     33import javax.json.JsonReader;
    234
    335import org.jsoup.Jsoup;
     
    638import org.jsoup.select.Elements;
    739import org.openstreetmap.josm.Main;
    8 
    9 import javax.json.Json;
    10 import javax.json.JsonArray;
    11 import javax.json.JsonObject;
    12 import javax.json.JsonReader;
    13 import java.awt.event.ActionEvent;
    14 import java.awt.event.ActionListener;
    15 import java.io.*;
    16 import java.net.*;
    17 import java.nio.charset.StandardCharsets;
    18 import java.nio.file.Files;
    19 import java.util.*;
    20 import java.util.regex.Matcher;
    21 import java.util.regex.Pattern;
    2240
    2341/**
     
    103121                        String paramName = "rasterfilters."
    104122                                + meta.getString("name");
    105    
     123
    106124                        boolean needToLoad = Main.pref.getBoolean(paramName);
    107    
     125
    108126                        if (needToLoad) {
    109127                            JsonArray binaries = meta.getJsonArray("binaries");
     
    117135                                description, meta, needToLoad);
    118136                        newFilterInfo.setOwner(owner);
    119    
     137
    120138                        if (!filtersInfoList.contains(newFilterInfo)) {
    121139                            filtersInfoList.add(newFilterInfo);
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/preferences/RasterFiltersPreferences.java

    r32853 r33269  
    11package org.openstreetmap.josm.plugins.rasterfilters.preferences;
     2
     3import java.awt.GridBagConstraints;
     4import java.awt.GridBagLayout;
     5import java.util.List;
     6
     7import javax.json.JsonObject;
     8import javax.swing.JButton;
     9import javax.swing.JPanel;
     10import javax.swing.JScrollPane;
     11import javax.swing.JTable;
     12import javax.swing.border.EmptyBorder;
     13import javax.swing.event.TableModelEvent;
     14import javax.swing.event.TableModelListener;
     15import javax.swing.table.AbstractTableModel;
     16import javax.swing.table.TableModel;
    217
    318import org.openstreetmap.josm.Main;
     
    823import org.openstreetmap.josm.tools.GBC;
    924
    10 import javax.json.JsonObject;
    11 import javax.swing.*;
    12 import javax.swing.border.EmptyBorder;
    13 import javax.swing.event.TableModelEvent;
    14 import javax.swing.event.TableModelListener;
    15 import javax.swing.table.AbstractTableModel;
    16 import javax.swing.table.TableModel;
    17 import java.awt.*;
    18 import java.util.List;
    19 
    2025/**
    2126 * This class draws subtab 'Image Filters' in the Preferences menu.
     
    109114        Object[][] data;
    110115
    111         public FiltersTableModel() {
     116        FiltersTableModel() {
    112117
    113118            filtersInfoList = FiltersDownloader.downloadFiltersInfoList();
     
    190195    private String owner;
    191196
    192     public FilterInfo() {
    193 
    194     }
    195 
    196     public FilterInfo(String name, String description, JsonObject meta,
    197                       boolean needToDownload) {
     197    FilterInfo(String name, String description, JsonObject meta, boolean needToDownload) {
    198198        this.setName(name);
    199199        this.setDescription(description);
     
    250250    @Override
    251251    public boolean equals(Object o) {
    252         if (o instanceof FilterInfo) {
    253             if (name.equals(((FilterInfo) o).getName()) &&
    254                     meta.equals(((FilterInfo) o).getMeta()) &&
    255                     description.equals(((FilterInfo) o).getDescription())) {
    256                 return true;
    257             }
    258         }
    259 
    260         return false;
     252        return (o instanceof FilterInfo) && name.equals(((FilterInfo) o).getName())
     253                && meta.equals(((FilterInfo) o).getMeta()) && description.equals(((FilterInfo) o).getDescription());
    261254    }
    262255}
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/values/BooleanValue.java

    r32853 r33269  
    11package org.openstreetmap.josm.plugins.rasterfilters.values;
    22
     3/**
     4 * @author Nipel-Crumple
     5 */
    36public class BooleanValue implements Value<Boolean> {
    47
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/values/ColorValue.java

    r32853 r33269  
    11package org.openstreetmap.josm.plugins.rasterfilters.values;
    22
     3/**
     4 * @author Nipel-Crumple
     5 */
    36public class ColorValue<Color> implements Value<Color> {
    47
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/values/SelectValue.java

    r32853 r33269  
    11package org.openstreetmap.josm.plugins.rasterfilters.values;
    22
     3/**
     4 * @author Nipel-Crumple
     5 */
    36public class SelectValue<T> implements Value<T> {
    47
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/values/SliderValue.java

    r32853 r33269  
    11package org.openstreetmap.josm.plugins.rasterfilters.values;
    22
     3/**
     4 * @author Nipel-Crumple
     5 */
    36public class SliderValue<Number> implements Value<Number> {
    47
     
    2932    public void setParameterName(String name) {
    3033        this.parameterName = name;
    31         ;
    3234    }
    3335
    3436    public boolean isDouble() {
    35         if (value instanceof Double)
    36             return true;
    37         return false;
     37        return value instanceof Double;
    3838    }
    3939}
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/values/Value.java

    r32853 r33269  
    99 * @author Nipel-Crumple
    1010 */
    11 public interface Value<T extends Object> {
     11public interface Value<T> {
    1212
    13     public T getValue();
     13    T getValue();
    1414
    15     public void setValue(T value);
     15    void setValue(T value);
    1616
    17     public String getParameterName();
     17    String getParameterName();
    1818
    19     public void setParameterName(String name);
     19    void setParameterName(String name);
    2020}
Note: See TracChangeset for help on using the changeset viewer.