Ignore:
Timestamp:
2006-04-28T01:32:03+02:00 (19 years ago)
Author:
imi
Message:
  • fixed JOSM crash when importing GeoImages on layers without timestamp
  • fixed merging: incomplete segments do not overwrite complete on ways
  • fixed focus when entering the popups from PropertyDialog
  • fixed broken "draw lines between gps points"
  • added doubleclick on bookmarklist
  • added background color configuration
  • added GpxImport to import 1.0 and 1.1 GPX files

This is release JOSM 1.3

Location:
src/org/openstreetmap/josm/gui/dialogs
Files:
4 edited

Legend:

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

    r99 r100  
    3636                                        Main.main.editLayer().listenerCommands.add(CommandStackDialog.this);
    3737                        }
    38                         public void layerRemoved(Layer oldLayer) {}
     38                        public void layerRemoved(Layer oldLayer) {
     39                                if (oldLayer instanceof OsmDataLayer)
     40                                        Main.main.editLayer().listenerCommands.remove(CommandStackDialog.this);
     41                        }
    3942                });
    4043                if (mapFrame.mapView.editLayer != null)
     
    6972
    7073        private void buildList() {
     74                if (Main.map == null || Main.map.mapView == null || Main.map.mapView.editLayer == null)
     75                        return;
    7176                Collection<Command> commands = Main.main.editLayer().commands;
    7277                DefaultMutableTreeNode root = new DefaultMutableTreeNode();
     
    7479                        root.add(c.description());
    7580                treeModel.setRoot(root);
     81                tree.scrollRowToVisible(treeModel.getChildCount(root)-1);
    7682        }
    7783
  • src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java

    r98 r100  
    140140         */
    141141        public void paintConflicts(final Graphics g, final NavigatableComponent nc) {
    142                 Color preferencesColor = SimplePaintVisitor.getPreferencesColor("conflict", Color.GRAY);
     142                Color preferencesColor = SimplePaintVisitor.getPreferencesColor("conflict", Color.gray);
    143143                if (preferencesColor.equals(Color.BLACK))
    144144                        return;
  • src/org/openstreetmap/josm/gui/dialogs/LayerList.java

    r98 r100  
    145145                layers.addListSelectionListener(new ListSelectionListener(){
    146146                        public void valueChanged(ListSelectionEvent e) {
     147                                if (layers.getModel().getSize() == 0)
     148                                        return;
    147149                                if (layers.getSelectedIndex() == -1)
    148150                                        layers.setSelectedIndex(e.getFirstIndex());
  • src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java

    r98 r100  
    1111import java.awt.event.MouseAdapter;
    1212import java.awt.event.MouseEvent;
    13 import java.awt.event.WindowEvent;
    14 import java.awt.event.WindowFocusListener;
    1513import java.util.Collection;
    1614import java.util.HashMap;
    17 import java.util.Iterator;
    1815import java.util.Map;
    1916import java.util.TreeMap;
     
    9390                p.add(combo, BorderLayout.CENTER);
    9491
    95                 final JOptionPane optionPane = new JOptionPane(p, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
     92                final JOptionPane optionPane = new JOptionPane(p, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION){
     93                        @Override public void selectInitialValue() {
     94                                combo.requestFocusInWindow();
     95                                combo.getEditor().selectAll();
     96                        }
     97                };
    9698                final JDialog dlg = optionPane.createDialog(Main.parent, "Change values?");
    97                 dlg.addWindowFocusListener(new WindowFocusListener(){
    98                         public void windowGainedFocus(WindowEvent e) {
    99                                 combo.requestFocusInWindow();
    100                         }
    101                         public void windowLostFocus(WindowEvent e) {
    102                         }
    103                 });
    10499                combo.getEditor().addActionListener(new ActionListener(){
    105100                        public void actionPerformed(ActionEvent e) {
     
    130125                        PropertiesDialog.this.repaint(); // repaint is enough
    131126        }
    132        
     127
    133128        /**
    134129         * Open the add selection dialog and add a new key/value to the table (and to the
     
    137132        void add() {
    138133                Collection<OsmPrimitive> sel = Main.ds.getSelected();
    139                
     134
    140135                JPanel p = new JPanel(new BorderLayout());
    141136                p.add(new JLabel("<html>This will change "+sel.size()+" object"+(sel.size()==1?"":"s")+".<br><br>"+
    142137                "Please select a key"), BorderLayout.NORTH);
    143                 Vector<String> allKeys = new Vector<String>();
     138                TreeSet<String> allKeys = new TreeSet<String>();
    144139                for (OsmPrimitive osm : Main.ds.allNonDeletedPrimitives())
    145140                        allKeys.addAll(osm.keySet());
    146                 for (Iterator<String> it = allKeys.iterator(); it.hasNext();) {
    147                         String s = it.next();
    148                         for (int i = 0; i < data.getRowCount(); ++i) {
    149                                 if (s.equals(data.getValueAt(i, 0))) {
    150                                         it.remove();
    151                                         break;
    152                                 }
    153                         }
    154                 }
    155                 JComboBox keys = new JComboBox(allKeys);
     141                for (int i = 0; i < data.getRowCount(); ++i)
     142                        allKeys.remove(data.getValueAt(i, 0));
     143                final JComboBox keys = new JComboBox(new Vector<String>(allKeys));
    156144                keys.setEditable(true);
    157145                p.add(keys, BorderLayout.CENTER);
    158                
     146
    159147                JPanel p2 = new JPanel(new BorderLayout());
    160148                p.add(p2, BorderLayout.SOUTH);
    161149                p2.add(new JLabel("Please select a value"), BorderLayout.NORTH);
    162                 JTextField values = new JTextField();
     150                final JTextField values = new JTextField();
    163151                p2.add(values, BorderLayout.CENTER);
    164                 int answer = JOptionPane.showConfirmDialog(Main.parent, p,
    165                                 "Change values?", JOptionPane.OK_CANCEL_OPTION);
    166                 if (answer != JOptionPane.OK_OPTION)
     152                JOptionPane pane = new JOptionPane(p, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION){
     153                        @Override public void selectInitialValue() {
     154                                keys.requestFocusInWindow();
     155                                keys.getEditor().selectAll();
     156                        }
     157                };
     158                pane.createDialog(Main.parent, "Change values?").setVisible(true);
     159                if (!Integer.valueOf(JOptionPane.OK_OPTION).equals(pane.getValue()))
    167160                        return;
    168161                String key = keys.getEditor().getItem().toString();
     
    184177                selectionChanged(sel); // update table
    185178        }
    186        
     179
    187180        /**
    188181         * The property data.
     
    200193         */
    201194        private final JTable propertyTable = new JTable(data);
    202        
     195
    203196        /**
    204197         * Create a new PropertiesDialog
     
    208201
    209202                setPreferredSize(new Dimension(320,150));
    210                
     203
    211204                data.setColumnIdentifiers(new String[]{"Key", "Value"});
    212205                propertyTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     
    228221                        }
    229222                });
    230                 //propertyTable.addMouseListener(new DblClickWatch());
    231 
     223                DblClickWatch dblClickWatch = new DblClickWatch();
     224                propertyTable.addMouseListener(dblClickWatch);
    232225                JScrollPane scrollPane = new JScrollPane(propertyTable);
    233                 scrollPane.addMouseListener(new DblClickWatch());
     226                scrollPane.addMouseListener(dblClickWatch);
    234227                add(scrollPane, BorderLayout.CENTER);
    235                
     228
    236229                JPanel buttonPanel = new JPanel(new GridLayout(1,3));
    237230                ActionListener buttonAction = new ActionListener(){
     
    258251                add(buttonPanel, BorderLayout.SOUTH);
    259252        }
    260        
     253
    261254        private JButton createButton(String name, String tooltip, int mnemonic, ActionListener actionListener) {
    262255                JButton b = new JButton(name, ImageProvider.get("dialogs", name.toLowerCase()));
     
    284277                        propertyTable.getCellEditor().cancelCellEditing();
    285278                data.setRowCount(0);
    286                
     279
    287280                Map<String, Integer> valueCount = new HashMap<String, Integer>();
    288281                TreeMap<String, Collection<String>> props = new TreeMap<String, Collection<String>>();
Note: See TracChangeset for help on using the changeset viewer.