Changeset 30 in josm for src/org/openstreetmap/josm/gui/dialogs
- Timestamp:
- 2005-12-03T14:14:35+01:00 (19 years ago)
- Location:
- src/org/openstreetmap/josm/gui/dialogs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/gui/dialogs/LayerList.java
r29 r30 74 74 */ 75 75 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)); 79 78 add(new JScrollPane(layers), BorderLayout.CENTER); 80 79 layers.setBackground(UIManager.getColor("Button.background")); -
src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
r29 r30 3 3 import java.awt.BorderLayout; 4 4 import java.awt.Component; 5 import java.awt.Dimension; 5 6 import java.awt.Font; 6 7 import java.awt.GridLayout; … … 210 211 */ 211 212 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."); 213 214 mv = mapFrame.mapView; 214 215 215 setLayout(new BorderLayout()); 216 setSize(350,450); 216 setPreferredSize(new Dimension(320,150)); 217 217 218 218 data.setColumnIdentifiers(new String[]{"Key", "Value"}); … … 241 241 JScrollPane scrollPane = new JScrollPane(propertyTable); 242 242 scrollPane.addMouseListener(new DblClickWatch()); 243 getContentPane().add(scrollPane, BorderLayout.CENTER);243 add(scrollPane, BorderLayout.CENTER); 244 244 245 245 JPanel buttonPanel = new JPanel(new GridLayout(1,3)); … … 264 264 buttonPanel.add(createButton("Add", "Add a new key/value pair to all objects", KeyEvent.VK_A, buttonAction)); 265 265 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_D ELETE, 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); 268 268 } 269 269 -
src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r22 r30 3 3 import java.awt.BorderLayout; 4 4 import java.awt.Component; 5 import java.awt.Dimension; 5 6 import java.awt.event.ActionEvent; 6 7 import java.awt.event.ActionListener; … … 46 47 */ 47 48 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)); 51 51 displaylist.setCellRenderer(new DefaultListCellRenderer(){ 52 52 private SelectionComponentVisitor visitor = new SelectionComponentVisitor(); … … 64 64 displaylist.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); 65 65 66 getContentPane().add(new JScrollPane(displaylist), BorderLayout.CENTER);66 add(new JScrollPane(displaylist), BorderLayout.CENTER); 67 67 68 68 JButton button = new JButton("Select", ImageProvider.get("mapmode", "selection")); … … 73 73 } 74 74 }); 75 getContentPane().add(button, BorderLayout.SOUTH);75 add(button, BorderLayout.SOUTH); 76 76 77 77 selectionChanged(Main.main.ds.getSelected()); -
src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r21 r30 1 1 package org.openstreetmap.josm.gui.dialogs; 2 2 3 import java.awt.BorderLayout; 3 4 import java.awt.event.ActionEvent; 4 import java.beans.PropertyChangeEvent;5 import java.beans.PropertyChangeListener;6 5 import java.util.HashMap; 7 6 import java.util.Map; … … 9 8 import javax.swing.AbstractButton; 10 9 import javax.swing.Action; 11 import javax.swing. JComponent;12 import javax.swing.J Dialog;13 import javax.swing. KeyStroke;10 import javax.swing.BorderFactory; 11 import javax.swing.JLabel; 12 import javax.swing.JPanel; 14 13 15 import org.openstreetmap.josm.Main;16 14 import org.openstreetmap.josm.gui.ImageProvider; 17 import org.openstreetmap.josm.gui.MapFrame;18 15 19 16 /** … … 23 20 * @author imi 24 21 */ 25 public class ToggleDialog extends J Dialogimplements Action {22 public class ToggleDialog extends JPanel implements Action { 26 23 27 24 /** … … 29 26 * @param title The title of the dialog. 30 27 */ 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) { 33 29 putValue(SMALL_ICON, ImageProvider.get("dialogs", iconName)); 34 30 putValue(NAME, name); 35 31 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()); 47 38 } 48 39
Note:
See TracChangeset
for help on using the changeset viewer.