Ignore:
Timestamp:
2016-05-11T02:44:10+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar - squid:AssignmentInSubExpressionCheck - Assignments should not be made from within sub-expressions

Location:
trunk/src/org/openstreetmap/josm/gui/history
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java

    r10055 r10179  
    8383        gc.fill = GridBagConstraints.HORIZONTAL;
    8484        gc.anchor = GridBagConstraints.NORTHWEST;
    85         add(referenceLatLonViewer = new LatLonViewer(model, PointInTimeType.REFERENCE_POINT_IN_TIME), gc);
     85        referenceLatLonViewer = new LatLonViewer(model, PointInTimeType.REFERENCE_POINT_IN_TIME);
     86        add(referenceLatLonViewer, gc);
    8687
    8788        gc.gridx = 1;
     
    9192        gc.fill = GridBagConstraints.HORIZONTAL;
    9293        gc.anchor = GridBagConstraints.NORTHWEST;
    93         add(currentLatLonViewer = new LatLonViewer(model, PointInTimeType.CURRENT_POINT_IN_TIME), gc);
     94        currentLatLonViewer = new LatLonViewer(model, PointInTimeType.CURRENT_POINT_IN_TIME);
     95        add(currentLatLonViewer, gc);
    9496
    9597        // --------------------
     
    101103        gc.weightx = 1.0;
    102104        gc.weighty = 0.0;
    103         add(distanceViewer = new DistanceViewer(model), gc);
     105        distanceViewer = new DistanceViewer(model);
     106        add(distanceViewer, gc);
    104107
    105108        // the map panel
     
    110113        gc.weightx = 1.0;
    111114        gc.weighty = 1.0;
    112         add(mapViewer = new MapViewer(model), gc);
     115        mapViewer = new MapViewer(model);
     116        add(mapViewer, gc);
    113117        mapViewer.setZoomContolsVisible(false);
    114118    }
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java

    r9543 r10179  
    3434
    3535    /**
     36     * Constructs a new {@code HistoryBrowser}.
     37     */
     38    public HistoryBrowser() {
     39        model = new HistoryBrowserModel();
     40        build();
     41    }
     42
     43    /**
     44     * Constructs a new {@code HistoryBrowser}.
     45     * @param history the history of an {@link OsmPrimitive}
     46     */
     47    public HistoryBrowser(History history) {
     48        this();
     49        populate(history);
     50    }
     51
     52    /**
    3653     * creates the table which shows the list of versions
    3754     *
     
    4057    protected JPanel createVersionTablePanel() {
    4158        JPanel pnl = new JPanel(new BorderLayout());
    42 
    43         VersionTable versionTable = new VersionTable(model);
    44         pnl.add(new JScrollPane(versionTable), BorderLayout.CENTER);
     59        pnl.add(new JScrollPane(new VersionTable(model)), BorderLayout.CENTER);
    4560        return pnl;
    4661    }
     
    8297     */
    8398    protected void build() {
    84         JPanel left;
    85         JPanel right;
     99        JPanel left = createVersionTablePanel();
     100        JPanel right = createVersionComparePanel();
    86101        setLayout(new BorderLayout());
    87         JSplitPane pane = new JSplitPane(
    88                 JSplitPane.HORIZONTAL_SPLIT,
    89                 left = createVersionTablePanel(),
    90                 right = createVersionComparePanel()
    91         );
     102        JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, left, right);
    92103        add(pane, BorderLayout.CENTER);
    93104
     
    100111    }
    101112
    102     /**
    103      * constructor
    104      */
    105     public HistoryBrowser() {
    106         model = new HistoryBrowserModel();
    107         build();
    108     }
    109 
    110     /**
    111      * constructor
    112      * @param history  the history of an {@link OsmPrimitive}
    113      */
    114     public HistoryBrowser(History history) {
    115         this();
    116         populate(history);
    117     }
    118113
    119114    /**
Note: See TracChangeset for help on using the changeset viewer.