Ignore:
Timestamp:
2007-04-05T17:19:54+02:00 (19 years ago)
Author:
imi
Message:
  • fixed the confusing auto-zoom (moved to "View"-menu and made it one-time zoom)
  • added (incomplete) after named ways (now it's the same as unnamed ways)
File:
1 edited

Legend:

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

    r208 r214  
    44import java.awt.Component;
    55import 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;
    106
    117import javax.swing.AbstractButton;
     
    1713
    1814import org.openstreetmap.josm.Main;
    19 import org.openstreetmap.josm.actions.AutoScaleAction;
    2015import org.openstreetmap.josm.actions.mapmode.AddSegmentAction;
    2116import org.openstreetmap.josm.actions.mapmode.AddWayAction;
     
    8176                setLayout(new BorderLayout());
    8277
    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);
    8582
    8683                // toolbar
     
    9895                        toolGroup.add((AbstractButton)c);
    9996                toolGroup.setSelected(((AbstractButton)toolBarActions.getComponent(0)).getModel(), true);
    100 
    101                 // autoScale
     97               
    10298                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               
    123100                add(toggleDialogs, BorderLayout.EAST);
    124101                toggleDialogs.setLayout(new BoxLayout(toggleDialogs, BoxLayout.Y_AXIS));
     
    144121                        if (toolBarActions.getComponent(i) instanceof Destroyable)
    145122                                ((Destroyable)toolBarActions).destroy();
     123               
     124                // remove menu entries
     125                Main.main.menu.viewMenu.setVisible(false);
    146126    }
    147127
Note: See TracChangeset for help on using the changeset viewer.