Ignore:
Timestamp:
2009-10-04T00:37:05+02:00 (15 years ago)
Author:
stoecker
Message:

fixed #3649 - show node coordinates in history dialog

File:
1 edited

Legend:

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

    r1709 r2242  
    1414
    1515import org.openstreetmap.josm.data.osm.history.History;
     16import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    1617
    1718/**
    1819 * HistoryBrowser is an UI component which displays history information about an {@see OsmPrimitive}.
    19  * 
     20 *
    2021 *
    2122 */
     
    2425    /** the model */
    2526    private HistoryBrowserModel model;
     27    private JTabbedPane dataPane;
    2628
    2729    /**
    2830     * embedds table in a {@see JScrollPane}
    29      * 
     31     *
    3032     * @param table the table
    3133     * @return the {@see JScrollPane} with the embedded table
     
    4042    /**
    4143     * creates the table which shows the list of versions
    42      * 
     44     *
    4345     * @return  the panel with the version table
    4446     */
     
    5557     * creates the panel which shows information about two different versions
    5658     * of the same {@see OsmPrimitive}.
    57      * 
     59     *
    5860     * @return the panel
    5961     */
     62
    6063    protected JPanel createVersionComparePanel() {
    61         JTabbedPane pane = new JTabbedPane();
    62         pane.add(new TagInfoViewer(model));
    63         pane.setTitleAt(0, tr("Tags"));
     64        dataPane = new JTabbedPane();
     65        dataPane.add(new TagInfoViewer(model));
     66        dataPane.setTitleAt(0, tr("Tags"));
    6467
    65         pane.add(new NodeListViewer(model));
    66         pane.setTitleAt(1, tr("Nodes"));
     68        dataPane.add(new NodeListViewer(model));
     69        dataPane.setTitleAt(1, tr("Nodes"));
    6770
    68         pane.add(new RelationMemberListViewer(model));
    69         pane.setTitleAt(2, tr("Members"));
     71        dataPane.add(new RelationMemberListViewer(model));
     72        dataPane.setTitleAt(2, tr("Members"));
     73
     74        dataPane.add(new CoordinateViewer(model));
     75        dataPane.setTitleAt(3, tr("Coordinate"));
    7076
    7177        JPanel pnl = new JPanel();
    7278        pnl.setLayout(new BorderLayout());
    73         pnl.add(pane, BorderLayout.CENTER);
     79        pnl.add(dataPane, BorderLayout.CENTER);
    7480        return pnl;
    7581    }
     
    116122    /**
    117123     * populates the browser with the history of a specific {@see OsmPrimitive}
    118      * 
     124     *
    119125     * @param history the history
    120126     */
    121127    public void populate(History history) {
    122128        model.setHistory(history);
     129        OsmPrimitiveType type = history.getType();
     130        if(type != null)
     131        {
     132            if(type == OsmPrimitiveType.NODE)
     133            {
     134                dataPane.setEnabledAt(1, false);
     135                dataPane.setEnabledAt(2, false);
     136            }
     137            else if(type == OsmPrimitiveType.WAY)
     138            {
     139                dataPane.setEnabledAt(2, false);
     140                dataPane.setEnabledAt(3, false);
     141            }
     142            else
     143            {
     144                dataPane.setEnabledAt(3, false);
     145            }
     146        }
    123147    }
    124148
    125149    /**
    126150     * replies the {@see History} currently displayed by this browser
    127      * 
     151     *
    128152     * @return the current history
    129153     */
Note: See TracChangeset for help on using the changeset viewer.