Changeset 32503 in osm for applications/editors


Ignore:
Timestamp:
2016-07-01T20:25:06+02:00 (9 years ago)
Author:
donvip
Message:

remove calls to deprecated methods

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

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/rasterfilters/.settings/org.eclipse.jdt.core.prefs

    r31485 r32503  
    11eclipse.preferences.version=1
     2org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
     3org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
     4org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
     5org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
     6org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
     7org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
     8org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
     9org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
     10org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
    211org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
    312org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
    413org.eclipse.jdt.core.compiler.compliance=1.7
     14org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
    515org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
     16org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
     17org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
     18org.eclipse.jdt.core.compiler.problem.deadCode=warning
     19org.eclipse.jdt.core.compiler.problem.deprecation=warning
     20org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
     21org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
     22org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
     23org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
    624org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
     25org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
     26org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
     27org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
     28org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
     29org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
     30org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
     31org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
     32org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
     33org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
     34org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
     35org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
     36org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
     37org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
     38org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
     39org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
     40org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
     41org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
     42org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
     43org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
     44org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
     45org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
     46org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
     47org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
     48org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
     49org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
     50org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
     51org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
     52org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
     53org.eclipse.jdt.core.compiler.problem.nullReference=warning
     54org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
     55org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
     56org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
     57org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
     58org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
     59org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
     60org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
     61org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
     62org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
     63org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
     64org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
     65org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
     66org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
     67org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
     68org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
     69org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
     70org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
     71org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
     72org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
     73org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
     74org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
     75org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
     76org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
     77org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
     78org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
     79org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
     80org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
     81org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
     82org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
     83org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
     84org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
     85org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
     86org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
     87org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
     88org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
     89org.eclipse.jdt.core.compiler.problem.unusedImport=warning
     90org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
     91org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
     92org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
     93org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
     94org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
     95org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
     96org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
     97org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
     98org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
     99org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
     100org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
    7101org.eclipse.jdt.core.compiler.source=1.7
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/RasterFiltersPlugin.java

    r32329 r32503  
    99import org.openstreetmap.josm.Main;
    1010import org.openstreetmap.josm.gui.MapFrame;
    11 import org.openstreetmap.josm.gui.MapView;
    12 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
    1311import org.openstreetmap.josm.gui.SideButton;
    1412import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
    1513import org.openstreetmap.josm.gui.layer.ImageryLayer;
    16 import org.openstreetmap.josm.gui.layer.Layer;
     14import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
     15import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener;
     16import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent;
     17import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
     18import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;
     19import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
    1720import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
    1821import org.openstreetmap.josm.plugins.Plugin;
     
    2225import org.openstreetmap.josm.plugins.rasterfilters.preferences.FiltersDownloader;
    2326import org.openstreetmap.josm.plugins.rasterfilters.preferences.RasterFiltersPreferences;
     27
    2428/**
    2529 * Main Plugin class. This class embed new plugin button for adding filter and
     
    2933 *
    3034 */
    31 public class RasterFiltersPlugin extends Plugin implements LayerChangeListener {
     35public class RasterFiltersPlugin extends Plugin implements LayerChangeListener, ActiveLayerChangeListener {
    3236
    3337        private SideButton filterButton;
     
    5963        public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
    6064                if (Main.isDisplayingMapView()) {
    61                         MapView.addLayerChangeListener(this);
     65                        Main.getLayerManager().addLayerChangeListener(this);
     66            Main.getLayerManager().addActiveLayerChangeListener(this);
    6267                }
    6368        }
    6469
    6570        @Override
    66         public void activeLayerChange(Layer oldLayer, Layer newLayer) {
    67                 if (!(newLayer instanceof ImageryLayer)) {
     71        public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
     72                if (!(Main.getLayerManager().getActiveLayer() instanceof ImageryLayer)) {
    6873                        filterButton.setEnabled(false);
    6974                } else {
    7075                        filterButton.setEnabled(true);
    7176                }
    72 
    7377        }
    7478
    7579        @Override
    76         public void layerAdded(Layer newLayer) {
     80        public void layerAdded(LayerAddEvent e) {
    7781
    7882                if (filterButton == null) {
    7983
    80                         // filter reading and adding to the collections of
    81                         // FilterDownloader
     84                        // filter reading and adding to the collections of FilterDownloader
    8285                        FiltersDownloader.downloadFiltersInfoList();
    8386                        FiltersDownloader.initFilters();
     
    8790                        }
    8891
    89                         if (newLayer instanceof ImageryLayer) {
     92                        if (e.getAddedLayer() instanceof ImageryLayer) {
    9093                                filterButton = new SideButton(action, false);
    9194                                filterButton.setEnabled(true);
     
    97100                        LayerListDialog dialog = LayerListDialog.getInstance();
    98101
    99                         JPanel buttonRowPanel = (JPanel) ((JPanel) dialog.getComponent(2))
    100                                         .getComponent(0);
     102                        JPanel buttonRowPanel = (JPanel) ((JPanel) dialog.getComponent(2)).getComponent(0);
    101103                        buttonRowPanel.add(filterButton);
    102104                }
    103105
    104                 if (newLayer instanceof ImageryLayer) {
    105                         FiltersDialog dialog = new FiltersDialog((ImageryLayer) newLayer);
     106                if (e.getAddedLayer() instanceof ImageryLayer) {
     107                        FiltersDialog dialog = new FiltersDialog((ImageryLayer) e.getAddedLayer());
    106108                        action.addFiltersDialog(dialog);
    107109                }
     
    110112
    111113        @Override
    112         public void layerRemoved(Layer oldLayer) {
     114        public void layerRemoving(LayerRemoveEvent e) {
    113115
    114                 if (oldLayer instanceof ImageryLayer) {
    115                         FiltersDialog dialog = action.getDialogByLayer(oldLayer);
    116                         ((ImageryLayer) oldLayer).removeImageProcessor(dialog.getFiltersManager());
     116                if (e.getRemovedLayer() instanceof ImageryLayer) {
     117                        FiltersDialog dialog = action.getDialogByLayer(e.getRemovedLayer());
     118                        ((ImageryLayer) e.getRemovedLayer()).removeImageProcessor(dialog.getFiltersManager());
    117119                        dialog.closeFrame();
    118120                        action.removeFiltersDialog(dialog);
     
    132134
    133135        @Override
     136    public void layerOrderChanged(LayerOrderChangeEvent e) {
     137        // Do nothing
     138    }
     139
     140    @Override
    134141        public PreferenceSetting getPreferenceSetting() {
    135142                if (setting == null) {
     
    139146                return setting;
    140147        }
    141 
    142148}
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/actions/ShowLayerFiltersDialog.java

    r32329 r32503  
    2929public final class ShowLayerFiltersDialog extends AbstractAction implements LayerAction {
    3030
    31         private List<FiltersDialog> dialogs = new ArrayList<FiltersDialog>();
     31        private List<FiltersDialog> dialogs = new ArrayList<>();
    3232
    3333        /**
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/gui/FiltersDialog.java

    r31504 r32503  
    3939        private JPanel pane;
    4040        private JButton addButton;
    41         private DefaultComboBoxModel<String> listModel = new DefaultComboBoxModel<String>();
     41        private DefaultComboBoxModel<String> listModel = new DefaultComboBoxModel<>();
    4242        private Set<String> showedFiltersTitles = new HashSet<>();
    4343        private JPanel filterContainer;
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/preferences/RasterFiltersPreferences.java

    r31504 r32503  
    111111
    112112                String[] columnNames = { "Filter Name", "Author", "Description", "" };
    113                 Class[] columnClasses = { String.class, String.class, String.class, Boolean.class };
     113                Class<?>[] columnClasses = { String.class, String.class, String.class, Boolean.class };
    114114                List<FilterInfo> filtersInfoList;
    115115                Object[][] data;
     
    161161
    162162                @Override
    163                 public Class getColumnClass(int col) {
     163                public Class<?> getColumnClass(int col) {
    164164                        return columnClasses[col];
    165165                }
Note: See TracChangeset for help on using the changeset viewer.