Ignore:
Timestamp:
2005-12-03T14:14:35+01:00 (19 years ago)
Author:
imi
Message:
  • Removed edit layer, combine action, save gpx (integrated in normal save)
  • Simplified and unified shortkeys
  • many small code simplifications
  • added undo
  • broken checkin!
Location:
src/org/openstreetmap/josm/gui/dialogs
Files:
4 edited

Legend:

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

    r29 r30  
    7474         */
    7575        public LayerList(MapFrame mapFrame) {
    76                 super(mapFrame, "Layers", "List of all layers", "layerlist", KeyEvent.VK_L, "Open a list of all loaded layers.");
    77                 setSize(250,256);
    78                 setMinimumSize(new Dimension(70,70));
     76                super("Layers", "List of all layers", "layerlist", KeyEvent.VK_L, "Open a list of all loaded layers.");
     77                setPreferredSize(new Dimension(320,100));
    7978                add(new JScrollPane(layers), BorderLayout.CENTER);
    8079                layers.setBackground(UIManager.getColor("Button.background"));
  • src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java

    r29 r30  
    33import java.awt.BorderLayout;
    44import java.awt.Component;
     5import java.awt.Dimension;
    56import java.awt.Font;
    67import java.awt.GridLayout;
     
    210211         */
    211212        public PropertiesDialog(MapFrame mapFrame) {
    212                 super(mapFrame, "Properties", "Properties Dialog", "properties", KeyEvent.VK_P, "Property for selected objects.");
     213                super("Properties", "Properties Dialog", "properties", KeyEvent.VK_P, "Property for selected objects.");
    213214                mv = mapFrame.mapView;
    214215
    215                 setLayout(new BorderLayout());
    216                 setSize(350,450);
     216                setPreferredSize(new Dimension(320,150));
    217217               
    218218                data.setColumnIdentifiers(new String[]{"Key", "Value"});
     
    241241                JScrollPane scrollPane = new JScrollPane(propertyTable);
    242242                scrollPane.addMouseListener(new DblClickWatch());
    243                 getContentPane().add(scrollPane, BorderLayout.CENTER);
     243                add(scrollPane, BorderLayout.CENTER);
    244244               
    245245                JPanel buttonPanel = new JPanel(new GridLayout(1,3));
     
    264264                buttonPanel.add(createButton("Add", "Add a new key/value pair to all objects", KeyEvent.VK_A, buttonAction));
    265265                buttonPanel.add(createButton("Edit", "Edit the value of the selected key for all objects", KeyEvent.VK_E, buttonAction));
    266                 buttonPanel.add(createButton("Delete", "Delete the selected key in all objects", KeyEvent.VK_DELETE, buttonAction));
    267                 getContentPane().add(buttonPanel, BorderLayout.SOUTH);
     266                buttonPanel.add(createButton("Delete", "Delete the selected key in all objects", KeyEvent.VK_D, buttonAction));
     267                add(buttonPanel, BorderLayout.SOUTH);
    268268        }
    269269       
  • src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r22 r30  
    33import java.awt.BorderLayout;
    44import java.awt.Component;
     5import java.awt.Dimension;
    56import java.awt.event.ActionEvent;
    67import java.awt.event.ActionListener;
     
    4647         */
    4748        public SelectionListDialog(MapFrame mapFrame) {
    48                 super(mapFrame, "Current Selection", "Selection List", "selectionlist", KeyEvent.VK_E, "Open a selection list window.");
    49                 setLayout(new BorderLayout());
    50                 setSize(300,400);
     49                super("Current Selection", "Selection List", "selectionlist", KeyEvent.VK_E, "Open a selection list window.");
     50                setPreferredSize(new Dimension(320,150));
    5151                displaylist.setCellRenderer(new DefaultListCellRenderer(){
    5252                        private SelectionComponentVisitor visitor = new SelectionComponentVisitor();
     
    6464                displaylist.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    6565
    66                 getContentPane().add(new JScrollPane(displaylist), BorderLayout.CENTER);
     66                add(new JScrollPane(displaylist), BorderLayout.CENTER);
    6767
    6868                JButton button = new JButton("Select", ImageProvider.get("mapmode", "selection"));
     
    7373                        }
    7474                });
    75                 getContentPane().add(button, BorderLayout.SOUTH);
     75                add(button, BorderLayout.SOUTH);
    7676
    7777                selectionChanged(Main.main.ds.getSelected());
  • src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java

    r21 r30  
    11package org.openstreetmap.josm.gui.dialogs;
    22
     3import java.awt.BorderLayout;
    34import java.awt.event.ActionEvent;
    4 import java.beans.PropertyChangeEvent;
    5 import java.beans.PropertyChangeListener;
    65import java.util.HashMap;
    76import java.util.Map;
     
    98import javax.swing.AbstractButton;
    109import javax.swing.Action;
    11 import javax.swing.JComponent;
    12 import javax.swing.JDialog;
    13 import javax.swing.KeyStroke;
     10import javax.swing.BorderFactory;
     11import javax.swing.JLabel;
     12import javax.swing.JPanel;
    1413
    15 import org.openstreetmap.josm.Main;
    1614import org.openstreetmap.josm.gui.ImageProvider;
    17 import org.openstreetmap.josm.gui.MapFrame;
    1815
    1916/**
     
    2320 * @author imi
    2421 */
    25 public class ToggleDialog extends JDialog implements Action {
     22public class ToggleDialog extends JPanel implements Action {
    2623
    2724        /**
     
    2926         * @param title The title of the dialog.
    3027         */
    31         public ToggleDialog(MapFrame mapFrame, String title, String name, String iconName, int mnemonic, String tooltip) {
    32                 super(Main.main, title, false);
     28        public ToggleDialog(String title, String name, String iconName, int mnemonic, String tooltip) {
    3329                putValue(SMALL_ICON, ImageProvider.get("dialogs", iconName));
    3430                putValue(NAME, name);
    3531                putValue(MNEMONIC_KEY, mnemonic);
    36                 KeyStroke ks = KeyStroke.getKeyStroke(mnemonic,0);
    37                 putValue(ACCELERATOR_KEY, ks);
    38                 mapFrame.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(ks, this);
    39                 mapFrame.getActionMap().put(this, this);
    40                 putValue(LONG_DESCRIPTION, tooltip);
    41                 mapFrame.addPropertyChangeListener("visible", new PropertyChangeListener(){
    42                         public void propertyChange(PropertyChangeEvent evt) {
    43                                 if (evt.getNewValue() == Boolean.FALSE)
    44                                         setVisible(false);
    45                         }
    46                 });
     32                putValue(SHORT_DESCRIPTION, tooltip);
     33               
     34                setLayout(new BorderLayout());
     35                add(new JLabel(title), BorderLayout.NORTH);
     36                setVisible(false);
     37                setBorder(BorderFactory.createEtchedBorder());
    4738        }
    4839
Note: See TracChangeset for help on using the changeset viewer.