Changeset 1415 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2009-02-16T15:14:34+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
r1397 r1415 4 4 import java.awt.Dimension; 5 5 import java.awt.event.ActionEvent; 6 import java.awt.event.ComponentEvent;7 import java.awt.event.ComponentListener;8 6 import java.awt.GridBagLayout; 9 7 import java.awt.Toolkit; … … 11 9 import javax.swing.AbstractAction; 12 10 import javax.swing.Action; 13 import javax.swing.BorderFactory;14 import javax.swing.BoundedRangeModel;15 import javax.swing.InputMap;16 11 import javax.swing.JButton; 17 12 import javax.swing.JComponent; … … 19 14 import javax.swing.JOptionPane; 20 15 import javax.swing.JPanel; 21 import javax.swing.JRootPane;22 16 import javax.swing.JScrollBar; 23 17 import javax.swing.JScrollPane; 24 18 import javax.swing.KeyStroke; 25 19 26 import org.openstreetmap.josm.Main;27 20 import org.openstreetmap.josm.gui.JMultilineLabel; 28 21 import org.openstreetmap.josm.tools.GBC; 29 import org.openstreetmap.josm.tools.I18n;30 22 import org.openstreetmap.josm.tools.ImageProvider; 31 23 … … 37 29 /** 38 30 * Sets up the dialog. The first button is always the default. 39 * @param Component The parent element that will be used for position and maximum size40 * @param StringThe text that will be shown in the window titlebar41 * @param Component Any component that should be show above the buttons (e.g. JLabel)42 * @param String[]The labels that will be displayed on the buttons43 * @param String[]The path to the icons that will be displayed on the buttons. Path is relative to JOSM's image directory. File extensions need to be included. If a button should not have an icon pass null.31 * @param parent The parent element that will be used for position and maximum size 32 * @param title The text that will be shown in the window titlebar 33 * @param content Any component that should be show above the buttons (e.g. JLabel) 34 * @param buttonTexts The labels that will be displayed on the buttons 35 * @param buttonIcons The path to the icons that will be displayed on the buttons. Path is relative to JOSM's image directory. File extensions need to be included. If a button should not have an icon pass null. 44 36 */ 45 37 public ExtendedDialog(Component parent, String title, Component content, String[] buttonTexts, String[] buttonIcons) { -
trunk/src/org/openstreetmap/josm/gui/GettingStarted.java
r1370 r1415 15 15 16 16 import java.awt.BorderLayout; 17 import java.awt.Component;18 17 import java.awt.EventQueue; 19 18 … … 142 141 ArrayList<Future<String>> linkContent = new ArrayList<Future<String>>(); 143 142 for(int i=0; i < links.size(); i++) { 144 String[] obj = (String[])links.get(i);143 String[] obj = links.get(i); 145 144 int targetVersion = Integer.parseInt(obj[1]); 146 145 String condition = obj[0]; -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r1356 r1415 11 11 import java.awt.event.WindowAdapter; 12 12 import java.awt.event.WindowEvent; 13 import java.io.File;14 import java.io.IOException;15 13 import java.util.Arrays; 16 14 import java.util.Collection; -
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r1380 r1415 63 63 import org.openstreetmap.josm.actions.search.SearchAction; 64 64 import org.openstreetmap.josm.actions.ToggleGPXLinesAction; 65 import org.openstreetmap.josm.data.DataSetChecker;66 65 import org.openstreetmap.josm.tools.Shortcut; 67 66 -
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r1405 r1415 179 179 public void addMapMode(IconToggleButton b) { 180 180 toolBarActions.add(b); 181 toolGroup.add( (AbstractButton)b);181 toolGroup.add(b); 182 182 } 183 183 -
trunk/src/org/openstreetmap/josm/gui/MapSlider.java
r1337 r1415 31 31 double sizey = this.mv.scale * this.mv.getHeight(); 32 32 for (int zoom = 0; zoom <= 150; zoom++, sizex *= 1.1, sizey *= 1.1) { 33 if (sizex > this.mv.world.east() || sizey > this.mv.world.north()) {33 if (sizex > MapView.world.east() || sizey > MapView.world.north()) { 34 34 preventChange=true; 35 35 setValue(zoom); -
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r1350 r1415 24 24 import java.awt.event.MouseListener; 25 25 import java.lang.reflect.InvocationTargetException; 26 import java.text.DecimalFormat;27 26 import java.util.Collection; 28 27 import java.util.ConcurrentModificationException; -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r1379 r1415 365 365 * that I switch layers and actions at the same time and it was annoying to mind the 366 366 * order. This way it works as visual clue for new users */ 367 for (Enumeration e = Main.map.toolGroup.getElements() ; e.hasMoreElements() ;) {368 AbstractButton x= (AbstractButton)e.nextElement();367 for (Enumeration<AbstractButton> e = Main.map.toolGroup.getElements() ; e.hasMoreElements() ;) { 368 AbstractButton x=e.nextElement(); 369 369 x.setEnabled(((MapMode)x.getAction()).layerIsSupported(layer)); 370 370 } … … 400 400 * 401 401 * @return <code>true</code> if a zoom operation has been performed 402 * @author Jan Peter Stotz403 402 */ 404 403 public boolean zoomToEditLayerBoundingBox() { -
trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java
r1372 r1415 3 3 4 4 import java.awt.Component; 5 import java.awt.Dimension;6 5 import java.awt.GridBagLayout; 7 6 import java.awt.event.ComponentEvent; -
trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
r1414 r1415 32 32 33 33 import javax.swing.Box; 34 import javax.swing.DefaultComboBoxModel;35 34 import javax.swing.DefaultListCellRenderer; 36 35 import javax.swing.JComboBox; … … 259 258 } 260 259 261 Main.ds.fireSelectionChanged(sel);260 DataSet.fireSelectionChanged(sel); 262 261 selectionChanged(sel); // update whole table 263 262 Main.parent.repaint(); // repaint all - drawing could have been changed … … 342 341 return; 343 342 Main.main.undoRedo.add(new ChangePropertyCommand(sel, key, value)); 344 Main.ds.fireSelectionChanged(sel);343 DataSet.fireSelectionChanged(sel); 345 344 selectionChanged(sel); // update table 346 345 Main.parent.repaint(); // repaint all - drawing could have been changed … … 366 365 } 367 366 private String objKey; 368 /** 369 * @return 370 */ 367 371 368 private TreeMap<String, TreeSet<String>> createAutoCompletionInfo( 372 369 boolean edit) { … … 399 396 Collection<OsmPrimitive> sel = Main.ds.getSelected(); 400 397 Main.main.undoRedo.add(new ChangePropertyCommand(sel, key, null)); 401 Main.ds.fireSelectionChanged(sel);398 DataSet.fireSelectionChanged(sel); 402 399 selectionChanged(sel); // update table 403 400 … … 582 579 } 583 580 Main.main.undoRedo.add(new ChangeCommand(cur, rel)); 584 Main.ds.fireSelectionChanged(sel);581 DataSet.fireSelectionChanged(sel); 585 582 selectionChanged(sel); // update whole table 586 583 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationEditor.java
r1378 r1415 6 6 import java.awt.BorderLayout; 7 7 import java.awt.Dimension; 8 import java.awt.FlowLayout;9 8 import java.awt.GridBagLayout; 10 9 import java.awt.GridLayout; … … 110 109 private final JTable memberTable = new JTable(memberData); 111 110 112 // =================== FIXME FIXME FIXME=====================111 // =================== FIXME ===================== 113 112 // As soon as API 0.5 is dead, drop all the collation stuff from here ... 114 113 … … 208 207 this.relation = relation; 209 208 210 ordered = Main.pref.get("osm-server.version", "0.5").equals("0.6");209 ordered = !Main.pref.get("osm-server.version", "0.5").equals("0.5"); 211 210 212 211 if (relation == null) { … … 248 247 }); 249 248 250 /* I don't like this text any more. Let's just get on with doing the specialist251 * editors instead of talking about it.252 JLabel help = new JLabel("<html><em>"+253 tr("This is the basic relation editor which allows you to change the relation's tags " +254 "as well as the members. In addition to this we should have a smart editor that " +255 "detects the type of relationship and limits your choices in a sensible way.")+"</em></html>");256 getContentPane().add(help, BorderLayout.NORTH);257 */258 249 try { setAlwaysOnTop(true); } catch (SecurityException sx) {} 259 250 … … 326 317 bothTables.add(new JScrollPane(propertyTable), GBC.eop().fill(GBC.BOTH)); 327 318 bothTables.add(status = new JLabel(tr("Members")), GBC.eol().fill(GBC.HORIZONTAL)); 319 // this is not exactly pretty but the four buttons simply don't fit in one line. 320 // we should have smaller buttons for situations like this. 321 JPanel buttonPanel = new JPanel(new GridLayout(2,ordered ? 3 : 2)); 322 328 323 if (ordered) { 329 JPanel upDownPanel = new JPanel(); 330 upDownPanel.setLayout(new BoxLayout(upDownPanel, BoxLayout.Y_AXIS)); 331 332 upDownPanel.add(createButton(null, "moveup", tr("Move the currently selected members up"), 333 KeyEvent.VK_U, new ActionListener() { 324 buttonPanel.add(createButton(null, "moveup", tr("Move the currently selected members up"), KeyEvent.VK_U, new ActionListener() { 334 325 public void actionPerformed(ActionEvent e) { 335 326 moveMembers(-1); 336 327 } 337 328 })); 338 upDownPanel.add(createButton(null, "movedown", tr("Move the currently selected members down"), 339 KeyEvent.VK_N, new ActionListener() { 340 public void actionPerformed(ActionEvent e) { 341 moveMembers(1); 342 } 343 })); 344 345 346 bothTables.add(new JScrollPane(memberTable), GBC.std().fill(GBC.BOTH)); 347 bothTables.add(upDownPanel, GBC.eol().fill(GBC.VERTICAL)); 348 } else { 349 bothTables.add(new JScrollPane(memberTable), GBC.eol().fill(GBC.BOTH)); 350 } 351 352 // this is not exactly pretty but the four buttons simply don't fit in one line. 353 // we should have smaller buttons for situations like this. 354 JPanel buttonPanel = new JPanel(new GridLayout(2,2)); 329 } 330 bothTables.add(new JScrollPane(memberTable), GBC.eol().fill(GBC.BOTH)); 355 331 356 332 buttonPanel.add(createButton(marktr("Add Selected"),"addselected", … … 367 343 } 368 344 })); 345 346 if(ordered) { 347 buttonPanel.add(createButton(null, "movedown", tr("Move the currently selected members down"), KeyEvent.VK_N, new ActionListener() { 348 public void actionPerformed(ActionEvent e) { 349 moveMembers(1); 350 } 351 })); 352 } 369 353 370 354 buttonPanel.add(createButton(marktr("Remove"),"remove", … … 382 366 })); 383 367 384 /*buttonPanel.add(createButton(marktr("Select"),"select",385 tr("Highlight the member from the current table row as JOSM's selection"), KeyEvent.VK_S, new ActionListener() {386 public void actionPerformed(ActionEvent e) {387 ArrayList<OsmPrimitive> sel;388 int cnt = memberTable.getSelectedRowCount();389 if(cnt > 0)390 {391 sel = new ArrayList<OsmPrimitive>(cnt);392 for (int i : memberTable.getSelectedRows())393 sel.add((OsmPrimitive)memberTable.getValueAt(i, 1));394 }395 else396 {397 cnt = memberTable.getRowCount();398 sel = new ArrayList<OsmPrimitive>(cnt);399 for (int i = 0; i < cnt; ++i)400 sel.add((OsmPrimitive)memberTable.getValueAt(i, 1));401 }402 Main.ds.setSelected(sel);403 }404 }));*/405 368 buttonPanel.add(createButton(marktr("Download Members"),"downloadincomplete", 406 369 tr("Download all incomplete ways and nodes in relation"), KeyEvent.VK_L, new ActionListener() { -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r1331 r1415 19 19 import javax.swing.ListSelectionModel; 20 20 import javax.swing.event.ListSelectionListener; 21 import javax.swing.event.ListSelectionEvent;22 23 21 import org.openstreetmap.josm.Main; 24 import org.openstreetmap.josm.actions.AutoScaleAction;25 22 import org.openstreetmap.josm.command.DeleteCommand; 26 23 import org.openstreetmap.josm.data.osm.DataSet; -
trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java
r1345 r1415 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.Color;7 6 import java.awt.Dimension; 8 7 import java.awt.GridBagLayout; … … 12 11 import java.awt.event.KeyEvent; 13 12 import java.awt.event.KeyListener; 14 import java.awt.event.MouseAdapter;15 import java.util.HashMap;16 13 17 14 import javax.swing.JLabel; … … 24 21 25 22 import org.openstreetmap.josm.data.Bounds; 26 import org.openstreetmap.josm.data.coor.LatLon;27 23 import org.openstreetmap.josm.tools.GBC; 28 24 import org.openstreetmap.josm.tools.OsmUrlToBounds; … … 87 83 public void keyPressed(KeyEvent keyEvent) {} 88 84 public void keyReleased(KeyEvent keyEvent) { 89 if (keyEvent.getKeyCode() == keyEvent.VK_ENTER && parseURL(gui))85 if (keyEvent.getKeyCode() == KeyEvent.VK_ENTER && parseURL(gui)) 90 86 gui.closeDownloadDialog(true); 91 87 } -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r1353 r1415 41 41 import org.openstreetmap.josm.actions.SaveAction; 42 42 import org.openstreetmap.josm.actions.SaveAsAction; 43 import org.openstreetmap.josm.command.Command;44 43 import org.openstreetmap.josm.data.coor.EastNorth; 45 44 import org.openstreetmap.josm.data.coor.LatLon; … … 222 221 @Override public void mergeFrom(final Layer from) { 223 222 final MergeVisitor visitor = new MergeVisitor(data,((OsmDataLayer)from).data); 224 // int i=0;225 int max = ((OsmDataLayer)from).data.allPrimitives().size();226 227 // System.out.format("Add/Merge data:");228 229 223 for (final OsmPrimitive osm : ((OsmDataLayer)from).data.allPrimitives()) { 230 224 // i++; -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java
r1245 r1415 129 129 130 130 /** 131 * Find the closest track point within the pixelTolerance of the screen point pNear132 * @param pNear : the point in screen coordinates near which to find a track point133 * @param pixelTolerance : only accept the point if within this number of pixels of en134 * @return the nearest trackpoint or null if nothing nearby135 *136 * XXX seems unused, F.R. 2008-03-15137 private WayPoint getClosestTrackPoint(Point pNear, double pixelTolerance) {138 WayPoint cw = null;139 AudioMarker recentlyPlayedMarker = AudioMarker.recentlyPlayedMarker();140 if (recentlyPlayedMarker != null) {141 // Find the track point closest to letting go of the play head142 double minDistance = pixelTolerance;143 GpxLayer trackLayer = recentlyPlayedMarker.parentLayer.fromLayer;144 if (trackLayer.data.tracks == null)145 return null;146 147 for (GpxTrack track : trackLayer.data.tracks) {148 if (track.trackSegs == null)149 continue;150 151 for (Collection<WayPoint> trackseg : track.trackSegs) {152 for (WayPoint w : trackseg) {153 Point p = Main.map.mapView.getPoint(w.eastNorth);154 double distance = p.distance(pNear);155 if (distance <= minDistance) {156 cw = w;157 minDistance = distance;158 }159 }160 }161 }162 }163 return cw;164 }165 */166 167 /**168 131 * reposition the play head at the point on the track nearest position given, 169 132 * providing we are within reasonable distance from the track; otherwise reset to the -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
r1313 r1415 11 11 import org.openstreetmap.josm.data.osm.OsmPrimitive; 12 12 import org.openstreetmap.josm.data.osm.OsmUtils; 13 import org.openstreetmap.josm.data.osm.Relation;14 import org.openstreetmap.josm.data.osm.Way;15 13 import org.openstreetmap.josm.Main; 16 14 -
trunk/src/org/openstreetmap/josm/gui/preferences/ColorPreference.java
r1243 r1415 2 2 package org.openstreetmap.josm.gui.preferences; 3 3 4 import static org.openstreetmap.josm.tools.I18n.marktr;5 4 import static org.openstreetmap.josm.tools.I18n.tr; 6 5 … … 13 12 import java.util.regex.Matcher; 14 13 import java.util.regex.Pattern; 15 import java.util.ArrayList;16 import java.util.Collections;17 14 import java.util.HashMap; 18 import java.util.List;19 15 import java.util.Map; 20 16 import java.util.Map.Entry; … … 33 29 import javax.swing.table.TableCellRenderer; 34 30 import javax.swing.BorderFactory; 35 import javax.swing.Box;36 31 37 32 import org.openstreetmap.josm.Main; 38 33 import org.openstreetmap.josm.data.osm.visitor.MapPaintVisitor; 39 34 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 40 import org.openstreetmap.josm.gui.layer.GpxLayer;41 import org.openstreetmap.josm.gui.layer.OsmDataLayer;42 35 import org.openstreetmap.josm.gui.MapScaler; 43 36 import org.openstreetmap.josm.gui.dialogs.ConflictDialog; … … 77 70 colorKeyList.put(getName(key), key); 78 71 } 79 for (Entry k : colorKeyList.entrySet()) {72 for (Entry<String, String> k : colorKeyList.entrySet()) { 80 73 Vector<Object> row = new Vector<Object>(2); 81 74 row.add(k.getValue()); … … 83 76 tableModel.addRow(row); 84 77 } 85 for (Entry k : colorKeyList_mappaint.entrySet()) {78 for (Entry<String, String> k : colorKeyList_mappaint.entrySet()) { 86 79 Vector<Object> row = new Vector<Object>(2); 87 80 row.add(k.getValue()); -
trunk/src/org/openstreetmap/josm/gui/preferences/LanguagePreference.java
r1180 r1415 55 55 56 56 JPanel panel = null; 57 for(PreferenceSetting s : gui.settings)57 for(PreferenceSetting s : PreferenceDialog.settings) 58 58 { 59 59 if(s instanceof LafPreference) -
trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
r1326 r1415 22 22 import javax.swing.Scrollable; 23 23 24 import org.openstreetmap.josm.Main;25 24 import org.openstreetmap.josm.plugins.PluginDownloader; 26 25 import org.openstreetmap.josm.plugins.PluginSelection; -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java
r1326 r1415 7 7 import java.awt.GridBagLayout; 8 8 import java.awt.ScrollPane; 9 import java.awt.event.ActionEvent;10 import java.awt.event.ActionListener;11 9 import java.util.Collection; 12 10 import java.util.Iterator; … … 56 54 */ 57 55 public JPanel createPreferenceTab(String icon, String title, String desc) { 58 return createPreferenceTab(icon, title, desc, true);56 return createPreferenceTab(icon, title, desc, false); 59 57 } 60 58 -
trunk/src/org/openstreetmap/josm/gui/preferences/TaggingPresetPreference.java
r1399 r1415 11 11 import java.util.Collection; 12 12 import java.util.HashMap; 13 import java.util.StringTokenizer;14 13 15 14 import javax.swing.BorderFactory; -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r1360 r1415 9 9 import java.awt.Image; 10 10 import java.awt.event.ActionEvent; 11 import java.awt.event.ActionListener;12 11 import java.io.BufferedReader; 13 12 import java.io.InputStreamReader; … … 27 26 import javax.swing.Action; 28 27 import javax.swing.ImageIcon; 29 import javax.swing.JButton;30 28 import javax.swing.JComboBox; 31 29 import javax.swing.JComponent; … … 50 48 import org.openstreetmap.josm.tools.GBC; 51 49 import org.openstreetmap.josm.tools.ImageProvider; 52 import org.openstreetmap.josm.tools.OpenBrowser;53 50 import org.openstreetmap.josm.tools.UrlLabel; 54 51 import org.openstreetmap.josm.tools.XmlObjectParser;
Note:
See TracChangeset
for help on using the changeset viewer.