Changeset 43 in josm for src/org/openstreetmap/josm/gui


Ignore:
Timestamp:
2006-01-22T16:10:57+01:00 (20 years ago)
Author:
imi
Message:
  • removed UTM (too complex)
  • added please wait dialog for down-/uploading
  • added created_by=JOSM to every new element
Location:
src/org/openstreetmap/josm/gui
Files:
3 edited

Legend:

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

    r42 r43  
    2020import org.openstreetmap.josm.data.GeoPoint;
    2121import org.openstreetmap.josm.data.osm.DataSet;
    22 import org.openstreetmap.josm.data.osm.Node;
    2322import org.openstreetmap.josm.data.projection.Projection;
    2423import org.openstreetmap.josm.gui.layer.Layer;
     
    9796         */
    9897        public void addLayer(Layer layer) {
    99                 // initialize the projection if it is the first layer
    100                 if (layers.isEmpty())
    101                         getProjection().init(layer.getBoundsLatLon());
    102 
    10398                // reinitialize layer's data
    10499                layer.init(getProjection());
     
    339334                // reset all datasets.
    340335                Projection p = getProjection();
    341                 for (Node n : Main.main.ds.nodes)
    342                         p.latlon2xy(n.coor);
     336                for (Layer l : layers)
     337                        l.init(p);
    343338                recalculateCenterScale();
    344339        }
     
    351346         */
    352347        public void propertyChange(PropertyChangeEvent evt) {
    353                 if (!evt.getPropertyName().equals("projection"))
    354                         return;
    355                 if (evt.getOldValue() != null)
    356                         ((Projection)evt.getOldValue()).removeChangeListener(this);
    357                 if (evt.getNewValue() != null) {
    358                         Projection p = (Projection)evt.getNewValue();
    359                         p.addChangeListener(this);
    360        
     348                if (evt.getPropertyName().equals("projection"))
    361349                        stateChanged(new ChangeEvent(this));
    362                 }
    363350        }
    364351}
  • src/org/openstreetmap/josm/gui/PreferenceDialog.java

    r38 r43  
    1515import javax.swing.JCheckBox;
    1616import javax.swing.JComboBox;
    17 import javax.swing.JComponent;
    1817import javax.swing.JDialog;
    1918import javax.swing.JLabel;
     
    5150                public void actionPerformed(ActionEvent e) {
    5251                        Main.pref.laf = (LookAndFeelInfo)lafCombo.getSelectedItem();
    53                         Projection projection = (Projection)projectionCombo.getSelectedItem();
    54                         projection.commitConfigurationPanel();
    55                         Main.pref.setProjection(projection);
     52                        Main.pref.setProjection((Projection)projectionCombo.getSelectedItem());
    5653                        Main.pref.osmDataServer = osmDataServer.getText();
    5754                        Main.pref.osmDataUsername = osmDataUsername.getText();
     
    9996         * Combobox with all projections available
    10097         */
    101         JComboBox projectionCombo = new JComboBox(Preferences.allProjections.clone());
     98        JComboBox projectionCombo = new JComboBox(Preferences.allProjections);
    10299        /**
    103100         * The main tab panel.
     
    160157                        }
    161158                }
    162                 JButton projectionDetail = new JButton("Configure");
    163                 projectionDetail.addActionListener(new ActionListener(){
    164                         public void actionPerformed(ActionEvent e) {
    165                                 Projection p = (Projection)projectionCombo.getSelectedItem();
    166                                 JComponent configurationPanel = p.getConfigurationPanel();
    167                                 if (configurationPanel == null) {
    168                                         JOptionPane.showMessageDialog(PreferenceDialog.this,
    169                                                         "This projection does not need any configuration.");
    170                                         return;
    171                                 }
    172                                 JPanel detail = new JPanel(new GridBagLayout());
    173                                 detail.setLayout(new GridBagLayout());
    174                                 detail.add(configurationPanel, GBC.eop().fill());
    175                                 int result = JOptionPane.showConfirmDialog(
    176                                                 PreferenceDialog.this, detail, "Configuration of "+p,
    177                                                 JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
    178                                 if (result != JOptionPane.OK_OPTION)
    179                                         p.getConfigurationPanel(); // rollback
    180                         }
    181                 });
    182159               
    183160                // drawRawGpsLines
     
    242219                map.add(GBC.glue(5,0), GBC.std().fill(GBC.HORIZONTAL));
    243220                map.add(projectionCombo, GBC.eol().fill(GBC.HORIZONTAL).insets(0,0,0,5));
    244                 map.add(new JLabel("Projection details:"), GBC.std());
    245                 map.add(GBC.glue(5,0), GBC.std().fill(GBC.HORIZONTAL));
    246                 map.add(projectionDetail, GBC.eop());
    247221                map.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL));
    248222
  • src/org/openstreetmap/josm/gui/WorldChooser.java

    r42 r43  
    1313
    1414import javax.swing.ImageIcon;
    15 import javax.swing.JComponent;
    1615import javax.swing.JTextField;
    1716import javax.swing.SwingUtilities;
     
    6362                new MapMover(this);
    6463                projection = new Projection(){
    65                         @Override
    6664                        public void latlon2xy(GeoPoint p) {
    6765                                p.x = (p.lon+180) / 360 * world.getIconWidth();
    6866                                p.y = (p.lat+90) / 180 * world.getIconHeight();
    6967                        }
    70                         @Override
    7168                        public void xy2latlon(GeoPoint p) {
    7269                                p.lon = p.x*360/world.getIconWidth() - 180;
     
    7673                        public String toString() {
    7774                                return "WorldChooser";
    78                         }
    79                         @Override
    80                         public JComponent getConfigurationPanel() {
    81                                 return null;
    82                         }
    83                         @Override
    84                         public void commitConfigurationPanel() {
    8575                        }
    8676                };
Note: See TracChangeset for help on using the changeset viewer.