Changeset 2903 in josm


Ignore:
Timestamp:
2010-01-28T19:55:32+01:00 (11 years ago)
Author:
bastiK
Message:

a few minor issues:

  • fixed #2316 - Improve Inactive Presets handling
  • fixed #4075 - Selection panels title doesn't stay when selecting an object by clicking
  • fixed #4359 - Treat junction=roundabout as oneway=yes
  • close #4427 - JOSM typos (patch by andre68)
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/data/defaultpresets.xml

    r2878 r2903  
    13421342                                <check key="fuel:GTL_diesel" text="Diesel (Gas To Liquid - ultimate diesel)" default="off" delete_if_empty="true" />
    13431343                                <check key="fuel:HGV_diesel" text="Diesel for Heavy Good Vehicles" default="off" delete_if_empty="true" />
    1344                                 <check key="fuel:octane 91" text="Octane 91" default="off" delete_if_empty="true" />
    1345                                 <check key="fuel:octane 95" text="Octane 95" default="off" delete_if_empty="true" />
    1346                                 <check key="fuel:octane 98" text="Octane 98" default="off" delete_if_empty="true" />
    1347                                 <check key="fuel:octane 100" text="Octane 100" default="off" delete_if_empty="true" />
     1344                                <check key="fuel:octane_91" text="Octane 91" default="off" delete_if_empty="true" />
     1345                                <check key="fuel:octane_95" text="Octane 95" default="off" delete_if_empty="true" />
     1346                                <check key="fuel:octane_98" text="Octane 98" default="off" delete_if_empty="true" />
     1347                                <check key="fuel:octane_100" text="Octane 100" default="off" delete_if_empty="true" />
    13481348                                <check key="fuel:e10" text="E10 (10% Ethanol mix)" default="off" delete_if_empty="true" />
    13491349                                <check key="fuel:e85" text="E85 (85% Ethanol mix)" default="off" delete_if_empty="true" />
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r2890 r2903  
    554554        }
    555555
     556        // FIXME: incline=\"-*\" search pattern does not work.
    556557        String reversedDirectionDefault = "oneway=\"-1\" | incline=down | incline=\"-*\"";
    557         String directionDefault = "oneway? | incline=* | aerialway=* | waterway=stream | waterway=river | waterway=canal | waterway=drain | waterway=rapids | \"piste:type\"=downhill | \"piste:type\"=sled | man_made=\"piste:halfpipe\" ";
     558       
     559        String directionDefault = "oneway? | incline=* | aerialway=* | "+
     560                                  "waterway=stream | waterway=river | waterway=canal | waterway=drain | waterway=rapids | "+
     561                                  "\"piste:type\"=downhill | \"piste:type\"=sled | man_made=\"piste:halfpipe\" | "+
     562                                  "junction=roundabout";
    558563
    559564        try {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r2869 r2903  
    258258            list.setElementAt(osm, i++);
    259259        }
    260         if (selectionHistory != null && newSelection.size() > 0 && !newSelection.equals(historyIgnoreSelection)) {
    261             historyIgnoreSelection = null;
    262             try {
    263                 // Check if the newSelection has already been added to the history
    264                 Collection<? extends OsmPrimitive> first = selectionHistory.getFirst();
    265                 if (first.equals(newSelection))
    266                     return;
    267             } catch (NoSuchElementException e) {
    268             }
    269             selectionHistory.addFirst(newSelection);
    270             while (selectionHistory.size() > SELECTION_HISTORY_SIZE) {
    271                 selectionHistory.removeLast();
    272             }
    273         }
    274260
    275261        int ways = 0;
     
    290276        } else {
    291277            setTitle(tr("Selection"));
     278        }
     279       
     280        if (selectionHistory != null && newSelection.size() > 0 && !newSelection.equals(historyIgnoreSelection)) {
     281            historyIgnoreSelection = null;
     282            try {
     283                // Check if the newSelection has already been added to the history
     284                Collection<? extends OsmPrimitive> first = selectionHistory.getFirst();
     285                if (first.equals(newSelection))
     286                    return;
     287            } catch (NoSuchElementException e) {
     288            }
     289            selectionHistory.addFirst(newSelection);
     290            while (selectionHistory.size() > SELECTION_HISTORY_SIZE) {
     291                selectionHistory.removeLast();
     292            }
    292293        }
    293294    }
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r2889 r2903  
    88
    99import java.awt.Component;
     10import java.awt.Container;
    1011import java.awt.GridBagLayout;
    1112import java.awt.Image;
     
    702703        }
    703704
     705        JPanel items = new JPanel(new GridBagLayout());
    704706        for (Item i : data){
    705707            if(i instanceof Link) {
    706708                l.add(i);
    707709            } else {
    708                 if(i.addToPanel(p, selected)) {
     710                if(i.addToPanel(items, selected)) {
    709711                    p.hasElements = true;
    710712                }
    711713            }
    712714        }
     715        p.add(items, GBC.eol().fill());
     716        if (selected.size() == 0) {
     717            setEnabledRec(items, false);
     718        }
     719
    713720        for(Item link : l) {
    714721            link.addToPanel(p, selected);
    715722        }
     723
    716724        return p;
     725    }
     726
     727    /**
     728     * setEnabled() does not propagate to child elements, so we need this workaround.
     729     */
     730    static void setEnabledRec(Container root, boolean enabled) {
     731        root.setEnabled(enabled);
     732        Component children[] = root.getComponents();
     733        for(int i = 0; i < children.length; i++) {
     734            if(children[i] instanceof Container) {
     735                setEnabledRec((Container)children[i], enabled);
     736            } else {
     737                children[i].setEnabled(enabled);
     738            }
     739        }
    717740    }
    718741
Note: See TracChangeset for help on using the changeset viewer.