Ignore:
Timestamp:
2010-03-29T19:14:54+02:00 (15 years ago)
Author:
guggis
Message:

Additional screenshots, also in German
Added help topics for context sensitive help
Removed sorting on selection list, order should be the order of selection

Location:
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/AdvancedEditorPanel.java

    r20586 r20735  
    1212import javax.swing.JTable;
    1313
     14import org.openstreetmap.josm.gui.help.HelpUtil;
    1415import org.openstreetmap.josm.gui.tagging.TagEditorPanel;
    1516import org.openstreetmap.josm.gui.widgets.HtmlPanel;
     
    104105                this.model = model;
    105106                build();
     107                HelpUtil.setHelpContext(this, HelpUtil.ht("/Plugins/turnrestrictions#AdvancedEditor"));
    106108        }
    107109       
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/BasicEditorPanel.java

    r20675 r20735  
    1313import org.openstreetmap.josm.Main;
    1414import org.openstreetmap.josm.data.Preferences;
     15import org.openstreetmap.josm.gui.help.HelpUtil;
    1516import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
    1617import org.openstreetmap.josm.plugins.turnrestrictions.editor.NavigationControler.BasicEditorFokusTargets;
     
    123124                this.model = model;
    124125                build();
     126                HelpUtil.setHelpContext(this, HelpUtil.ht("/Plugins/turnrestrictions#BasicEditor"));
    125127        }
    126128       
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModel.java

    r20586 r20735  
    122122        }
    123123        this.selection.addAll(selection);
    124         sort();
    125124        fireContentsChanged(this, 0, getSize());       
    126125        setSelected(sel);
    127     }
    128 
    129     /**
    130      * Sorts the primitives in the list
    131      */
    132     public void sort() {
    133         Collections.sort(this.selection,new OsmPrimitiveComparator());
    134126    }
    135127
     
    234226                return ret;
    235227        }
    236        
    237         /**
    238          * The comparator used when sorting the elements in this model
    239          *
    240          */
    241         static private class OsmPrimitiveComparator implements Comparator<OsmPrimitive> {
    242         final private HashMap<Object, String> cache= new HashMap<Object, String>();
    243         final private DefaultNameFormatter df  = DefaultNameFormatter.getInstance();
    244 
    245         private String cachedName(OsmPrimitive p) {
    246             String name = cache.get(p);
    247             if (name == null) {
    248                 name = p.getDisplayName(df);
    249                 cache.put(p, name);
    250             }
    251             return name;
    252         }
    253 
    254         private int compareName(OsmPrimitive a, OsmPrimitive b) {
    255             String an = cachedName(a);
    256             String bn = cachedName(b);
    257             // make sure display names starting with digits are the end of the
    258             // list
    259             if (Character.isDigit(an.charAt(0)) && Character.isDigit(bn.charAt(0)))
    260                 return an.compareTo(bn);
    261             else if (Character.isDigit(an.charAt(0)) && !Character.isDigit(bn.charAt(0)))
    262                 return 1;
    263             else if (!Character.isDigit(an.charAt(0)) && Character.isDigit(bn.charAt(0)))
    264                 return -1;
    265             return an.compareTo(bn);
    266         }
    267 
    268         private int compareType(OsmPrimitive a, OsmPrimitive b) {
    269             // show ways before relations, then nodes
    270             //
    271             if (a.getType().equals(b.getType())) return 0;
    272             if (a.getType().equals(OsmPrimitiveType.WAY)) return -1;
    273             if (a.getType().equals(OsmPrimitiveType.NODE)) return 1;
    274             // a is a relation
    275             if (b.getType().equals(OsmPrimitiveType.WAY)) return 1;
    276             // b is a node
    277             return -1;
    278         }
    279         public int compare(OsmPrimitive a, OsmPrimitive b) {
    280             if (a.getType().equals(b.getType()))
    281                 return compareName(a, b);
    282             return compareType(a, b);
    283         }
    284     }
    285228}
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java

    r20675 r20735  
    105105        pnl.add(new SideButton(new CancelAction()));
    106106       
    107         pnl.add(new SideButton(new ContextSensitiveHelpAction(ht("/Plugins/turnrestrictions"))));
     107        pnl.add(new SideButton(new ContextSensitiveHelpAction(ht("/Plugins/turnrestrictions#TurnRestrictionEditor"))));
    108108        return pnl;
    109109    }
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModel.java

    r20724 r20735  
    209209         */
    210210        public void apply(Relation turnRestriction) {
    211                 CheckParameterUtil.ensureParameterNotNull(turnRestriction, "turnRestriction");
    212                
     211                CheckParameterUtil.ensureParameterNotNull(turnRestriction, "turnRestriction");         
    213212                TagCollection tags = tagEditorModel.getTagCollection();
     213                turnRestriction.removeAll();
    214214                tags.applyTo(turnRestriction);
    215215                memberModel.applyTo(turnRestriction);           
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListDialog.java

    r20711 r20735  
    3333import org.openstreetmap.josm.gui.MapView.EditLayerChangeListener;
    3434import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
     35import org.openstreetmap.josm.gui.help.HelpUtil;
    3536import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    3637import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
     
    166167                );
    167168                build();
     169                HelpUtil.setHelpContext(this, HelpUtil.ht("/Plugins/turnrestrictions#TurnRestrictionToggleDialog"));
    168170        }       
    169171       
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesView.java

    r20586 r20735  
    99import javax.swing.JPanel;
    1010
     11import org.openstreetmap.josm.gui.help.HelpUtil;
    1112import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
    1213import org.openstreetmap.josm.tools.CheckParameterUtil;
     
    3637                model.addObserver(this);
    3738                build();
     39                HelpUtil.setHelpContext(this, HelpUtil.ht("/Plugins/turnrestrictions#ErrorsAndWarnings"));
    3840        }
    3941       
Note: See TracChangeset for help on using the changeset viewer.