Changeset 2193 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2009-09-26T13:53:12+02:00 (15 years ago)
Author:
stoecker
Message:

fix #3523 - Show only interactive presets in properties

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java

    r2145 r2193  
    527527        // combine both tables and wrap them in a scrollPane
    528528        JPanel bothTables = new JPanel();
     529        boolean top = Main.pref.getBoolean("properties.presets.top", true);
    529530        bothTables.setLayout(new GridBagLayout());
    530         bothTables.add(presets, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 2, 5, 2));
     531        if(top)
     532            bothTables.add(presets, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 2, 5, 2));
    531533        bothTables.add(selectSth, GBC.eol().fill().insets(10, 10, 10, 10));
    532534        bothTables.add(propertyTable.getTableHeader(), GBC.eol().fill(GBC.HORIZONTAL));
     
    534536        bothTables.add(membershipTable.getTableHeader(), GBC.eol().fill(GBC.HORIZONTAL));
    535537        bothTables.add(membershipTable, GBC.eol().fill(GBC.BOTH));
     538        if(!top)
     539            bothTables.add(presets, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 2, 5, 2));
    536540
    537541        DblClickWatch dblClickWatch = new DblClickWatch();
     
    644648
    645649        for(TaggingPreset t : TaggingPresetPreference.taggingPresets) {
    646             if(t.types == null || !((relations > 0 && !t.types.contains("relation")) &&
     650            if((t.types == null || !((relations > 0 && !t.types.contains("relation")) &&
    647651                    (nodes > 0 && !t.types.contains("node")) &&
    648652                    (ways+closedways > 0 && !t.types.contains("way")) &&
    649                     (closedways > 0 && !t.types.contains("closedway"))))
     653                    (closedways > 0 && !t.types.contains("closedway")))) && t.isShowable())
    650654            {
    651655                int found = 0;
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r2170 r2193  
    678678    }
    679679
     680    public boolean isShowable()
     681    {
     682        for(Item i : data)
     683        {
     684            if(!(i instanceof Optional || i instanceof Space || i instanceof Key))
     685                return true;
     686        }
     687        return false;
     688    }
     689
    680690    public void actionPerformed(ActionEvent e) {
    681691        if (Main.main == null) return;
Note: See TracChangeset for help on using the changeset viewer.