Changeset 214 in josm for src/org/openstreetmap/josm/gui/MapFrame.java
- Timestamp:
- 2007-04-05T17:19:54+02:00 (19 years ago)
- File:
-
- 1 edited
-
src/org/openstreetmap/josm/gui/MapFrame.java (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/gui/MapFrame.java
r208 r214 4 4 import java.awt.Component; 5 5 import java.awt.Container; 6 import java.awt.event.ActionEvent;7 import java.awt.event.ActionListener;8 import java.beans.PropertyChangeEvent;9 import java.beans.PropertyChangeListener;10 6 11 7 import javax.swing.AbstractButton; … … 17 13 18 14 import org.openstreetmap.josm.Main; 19 import org.openstreetmap.josm.actions.AutoScaleAction;20 15 import org.openstreetmap.josm.actions.mapmode.AddSegmentAction; 21 16 import org.openstreetmap.josm.actions.mapmode.AddWayAction; … … 81 76 setLayout(new BorderLayout()); 82 77 83 final AutoScaleAction autoScaleAction = new AutoScaleAction(this); 84 add(mapView = new MapView(autoScaleAction), BorderLayout.CENTER); 78 add(mapView = new MapView(), BorderLayout.CENTER); 79 80 // show menu entry 81 Main.main.menu.viewMenu.setVisible(true); 85 82 86 83 // toolbar … … 98 95 toolGroup.add((AbstractButton)c); 99 96 toolGroup.setSelected(((AbstractButton)toolBarActions.getComponent(0)).getModel(), true); 100 101 // autoScale 97 102 98 toolBarActions.addSeparator(); 103 final IconToggleButton autoScaleButton = new IconToggleButton(autoScaleAction); 104 toolBarActions.add(autoScaleButton); 105 autoScaleButton.setText(null); 106 autoScaleButton.setSelected(mapView.isAutoScale()); 107 autoScaleAction.putValue("active", true); 108 mapView.addPropertyChangeListener(new PropertyChangeListener(){ 109 public void propertyChange(PropertyChangeEvent evt) { 110 if (evt.getPropertyName().equals("autoScale")) { 111 autoScaleAction.putValue("active", evt.getNewValue()); 112 autoScaleButton.setSelected((Boolean)evt.getNewValue()); 113 } 114 } 115 }); 116 autoScaleButton.addActionListener(new ActionListener(){ 117 public void actionPerformed(ActionEvent e) { 118 if (!autoScaleButton.groupbutton) 119 autoScaleButton.setSelected(true); 120 } 121 }); 122 99 123 100 add(toggleDialogs, BorderLayout.EAST); 124 101 toggleDialogs.setLayout(new BoxLayout(toggleDialogs, BoxLayout.Y_AXIS)); … … 144 121 if (toolBarActions.getComponent(i) instanceof Destroyable) 145 122 ((Destroyable)toolBarActions).destroy(); 123 124 // remove menu entries 125 Main.main.menu.viewMenu.setVisible(false); 146 126 } 147 127
Note:
See TracChangeset
for help on using the changeset viewer.
