Ignore:
Timestamp:
2016-07-14T17:02:54+02:00 (9 years ago)
Author:
floscher
Message:

Fix some code issues reported by checkstyle/findbugs

Mainly these are superfluous or missing modifiers, missing license headers and whitespace issues.

Location:
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/HyperlinkLabel.java

    r31828 r32653  
    110110    private final JMenuItem edit;
    111111
    112     public LinkPopUp(final String key) {
     112    LinkPopUp(final String key) {
    113113      this.copy = new JMenuItem(tr("Copy key"));
    114114      this.copy.addActionListener(new ActionListener() {
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java

    r32631 r32653  
    277277  }
    278278
    279   private class UpdateAction extends AbstractAction {
     279  private static class UpdateAction extends AbstractAction {
    280280
    281281    private static final long serialVersionUID = -7417238601979689863L;
     
    292292  }
    293293
    294   private class ResetAction extends AbstractAction {
     294  private static class ResetAction extends AbstractAction {
    295295    /**
    296296     *
     
    328328   * @author nokutu
    329329   */
    330   private class SignChooserAction extends AbstractAction {
     330  private static class SignChooserAction extends AbstractAction {
    331331
    332332    private static final long serialVersionUID = 8706299665735930148L;
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryHistoryDialog.java

    r32631 r32653  
    4949 *
    5050 */
    51 public class MapillaryHistoryDialog extends ToggleDialog implements
    52     MapillaryRecordListener {
     51public final class MapillaryHistoryDialog extends ToggleDialog implements MapillaryRecordListener {
    5352
    5453  private static final long serialVersionUID = -3019715241209349372L;
     
    5958  private final transient UndoRedoSelectionListener redoSelectionListener;
    6059
    61   private final DefaultTreeModel undoTreeModel = new DefaultTreeModel(
    62       new DefaultMutableTreeNode());
    63   private final DefaultTreeModel redoTreeModel = new DefaultTreeModel(
    64       new DefaultMutableTreeNode());
     60  private final DefaultTreeModel undoTreeModel = new DefaultTreeModel(new DefaultMutableTreeNode());
     61  private final DefaultTreeModel redoTreeModel = new DefaultTreeModel(new DefaultMutableTreeNode());
    6562  private final JTree undoTree = new JTree(this.undoTreeModel);
    6663  private final JTree redoTree = new JTree(this.redoTreeModel);
     
    8885    this.undoTree.setRootVisible(false);
    8986    this.undoTree.setCellRenderer(new MapillaryImageTreeCellRenderer());
    90     this.undoTree.getSelectionModel().setSelectionMode(
    91         TreeSelectionModel.SINGLE_TREE_SELECTION);
     87    this.undoTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    9288    this.undoTree.addMouseListener(new MouseEventHandler());
    9389    this.undoSelectionListener = new UndoRedoSelectionListener(this.undoTree);
    94     this.undoTree.getSelectionModel().addTreeSelectionListener(
    95         this.undoSelectionListener);
     90    this.undoTree.getSelectionModel().addTreeSelectionListener(this.undoSelectionListener);
    9691
    9792    this.redoTree.expandRow(0);
     
    9994    this.redoTree.setShowsRootHandles(true);
    10095    this.redoTree.setRootVisible(false);
    101     this.redoTree.getSelectionModel().setSelectionMode(
    102         TreeSelectionModel.SINGLE_TREE_SELECTION);
     96    this.redoTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    10397    this.redoTree.addMouseListener(new MouseEventHandler());
    10498    this.redoSelectionListener = new UndoRedoSelectionListener(this.redoTree);
    105     this.redoTree.getSelectionModel().addTreeSelectionListener(
    106         this.redoSelectionListener);
     99    this.redoTree.getSelectionModel().addTreeSelectionListener(this.redoSelectionListener);
    107100
    108101    JPanel treesPanel = new JPanel(new GridBagLayout());
    109102    treesPanel.add(this.spacer, GBC.eol());
    110103    this.spacer.setVisible(false);
    111     treesPanel
    112         .add(this.undoTree, GBC.eol().fill(GridBagConstraints.HORIZONTAL));
     104    treesPanel.add(this.undoTree, GBC.eol().fill(GridBagConstraints.HORIZONTAL));
    113105    this.separator.setVisible(false);
    114     treesPanel.add(this.separator, GBC.eol()
    115         .fill(GridBagConstraints.HORIZONTAL));
    116     treesPanel
    117         .add(this.redoTree, GBC.eol().fill(GridBagConstraints.HORIZONTAL));
    118     treesPanel.add(Box.createRigidArea(new Dimension(0, 0)),
    119         GBC.std().weight(0, 1));
     106    treesPanel.add(this.separator, GBC.eol().fill(GridBagConstraints.HORIZONTAL));
     107    treesPanel.add(this.redoTree, GBC.eol().fill(GridBagConstraints.HORIZONTAL));
     108    treesPanel.add(Box.createRigidArea(new Dimension(0, 0)), GBC.std().weight(0, 1));
    120109    treesPanel.setBackground(this.redoTree.getBackground());
    121110
     
    123112    this.redoButton = new SideButton(new RedoAction());
    124113
    125     createLayout(treesPanel, true,
    126         Arrays.asList(new SideButton[] { this.undoButton, this.redoButton }));
     114    createLayout(treesPanel, true, Arrays.asList(new SideButton[] {this.undoButton, this.redoButton}));
    127115  }
    128116
     
    196184  }
    197185
    198   private class UndoAction extends AbstractAction {
     186  private static class UndoAction extends AbstractAction {
    199187
    200188    private static final long serialVersionUID = -6435832206342007269L;
    201189
    202     public UndoAction() {
     190    UndoAction() {
    203191      putValue(NAME, tr("Undo"));
    204192      new ImageProvider("undo").getResource().attachImageIcon(this, true);
     
    211199  }
    212200
    213   private class RedoAction extends AbstractAction {
     201  private static class RedoAction extends AbstractAction {
    214202
    215203    private static final long serialVersionUID = -2761935780353053512L;
    216204
    217     public RedoAction() {
     205    RedoAction() {
    218206      putValue(NAME, tr("Redo"));
    219207      new ImageProvider("redo").getResource().attachImageIcon(this, true);
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryImageDisplay.java

    r32592 r32653  
    417417  }
    418418
    419   private final Point img2compCoord(Rectangle visibleRect, int xImg, int yImg) {
     419  private Point img2compCoord(Rectangle visibleRect, int xImg, int yImg) {
    420420    Rectangle drawRect = calculateDrawImageRectangle(visibleRect);
    421421    return new Point(drawRect.x + ((xImg - visibleRect.x) * drawRect.width)
     
    424424  }
    425425
    426   private final Point comp2imgCoord(Rectangle visibleRect, int xComp, int yComp) {
     426  private Point comp2imgCoord(Rectangle visibleRect, int xComp, int yComp) {
    427427    Rectangle drawRect = calculateDrawImageRectangle(visibleRect);
    428428    return new Point(
     
    432432  }
    433433
    434   private static final Point getCenterImgCoord(Rectangle visibleRect) {
     434  private static Point getCenterImgCoord(Rectangle visibleRect) {
    435435    return new Point(visibleRect.x + visibleRect.width / 2, visibleRect.y + visibleRect.height / 2);
    436436  }
     
    499499  }
    500500
    501   private static final void checkVisibleRectPos(Image image, Rectangle visibleRect) {
     501  private static void checkVisibleRectPos(Image image, Rectangle visibleRect) {
    502502    if (visibleRect.x < 0) {
    503503      visibleRect.x = 0;
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java

    r32631 r32653  
    4545 * @author nokutu
    4646 */
    47 public class MapillaryMainDialog extends ToggleDialog implements
     47public final class MapillaryMainDialog extends ToggleDialog implements
    4848        ICachedLoaderListener, MapillaryDataListener {
    4949
     
    343343     * Constructs a normal NextPictureAction
    344344     */
    345     public NextPictureAction() {
     345    NextPictureAction() {
    346346      putValue(NAME, tr("Next picture"));
    347347      putValue(SHORT_DESCRIPTION, tr("Shows the next picture in the sequence"));
     
    359359   * @author nokutu
    360360   */
    361   private class PreviousPictureAction extends AbstractAction {
     361  private static class PreviousPictureAction extends AbstractAction {
    362362
    363363    private static final long serialVersionUID = -6420511632957956012L;
     
    366366     * Constructs a normal PreviousPictureAction
    367367     */
    368     public PreviousPictureAction() {
     368    PreviousPictureAction() {
    369369      putValue(NAME, tr("Previous picture"));
    370370      putValue(SHORT_DESCRIPTION, tr("Shows the previous picture in the sequence"));
     
    382382   * @author nokutu
    383383   */
    384   private class RedAction extends AbstractAction {
     384  private static class RedAction extends AbstractAction {
    385385
    386386    private static final long serialVersionUID = -6480229431481386376L;
     
    389389     * Constructs a normal RedAction
    390390     */
    391     public RedAction() {
     391    RedAction() {
    392392      putValue(NAME, tr("Jump to red"));
    393393      putValue(SHORT_DESCRIPTION,
     
    409409   * @author nokutu
    410410   */
    411   private class BlueAction extends AbstractAction {
     411  private static class BlueAction extends AbstractAction {
    412412
    413413    private static final long serialVersionUID = 6250690644594703314L;
     
    416416     * Constructs a normal BlueAction
    417417     */
    418     public BlueAction() {
     418    BlueAction() {
    419419      putValue(NAME, tr("Jump to blue"));
    420420      putValue(SHORT_DESCRIPTION,
     
    431431  }
    432432
    433   private class StopAction extends AbstractAction implements WalkListener {
     433  private static class StopAction extends AbstractAction implements WalkListener {
    434434
    435435    private static final long serialVersionUID = -6561451575815789198L;
     
    440440     * Constructs a normal StopAction
    441441     */
    442     public StopAction() {
     442    StopAction() {
    443443      putValue(NAME, tr("Stop"));
    444444      putValue(SHORT_DESCRIPTION, tr("Stops the walk."));
     
    459459  }
    460460
    461   private class PlayAction extends AbstractAction implements WalkListener {
     461  private static class PlayAction extends AbstractAction implements WalkListener {
    462462
    463463    private static final long serialVersionUID = -17943404752082788L;
     
    467467     * Constructs a normal PlayAction
    468468     */
    469     public PlayAction() {
     469    PlayAction() {
    470470      putValue(NAME, tr("Play"));
    471471      putValue(SHORT_DESCRIPTION, tr("Continues with the paused walk."));
     
    487487  }
    488488
    489   private class PauseAction extends AbstractAction implements WalkListener {
     489  private static class PauseAction extends AbstractAction implements WalkListener {
    490490
    491491    private static final long serialVersionUID = 4400240686337741192L;
     
    496496     * Constructs a normal PauseAction
    497497     */
    498     public PauseAction() {
     498    PauseAction() {
    499499      putValue(NAME, tr("Pause"));
    500500      putValue(SHORT_DESCRIPTION, tr("Pauses the walk."));
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSetting.java

    r32652 r32653  
    125125    }
    126126
    127     new Thread( new Runnable() {
     127    new Thread(new Runnable() {
    128128      @Override
    129129      public void run() {
    130130        String username = MapillaryUser.getUsername();
    131131        if (username != null) {
    132           SwingUtilities.invokeLater( new Runnable() {
     132          SwingUtilities.invokeLater(new Runnable() {
    133133            @Override
    134134            public void run() {
    135135              onLogin(MapillaryUser.getUsername());
    136136            }
    137           } );
     137          });
    138138        }
    139139      }
     
    197197    private final transient MapillaryLoginListener callback;
    198198
    199     public LoginAction(MapillaryLoginListener loginCallback) {
     199    LoginAction(MapillaryLoginListener loginCallback) {
    200200      this.callback = loginCallback;
    201201    }
Note: See TracChangeset for help on using the changeset viewer.