Changeset 129 in josm
- Timestamp:
- 2006-07-26T22:14:05+02:00 (18 years ago)
- Location:
- src/org/openstreetmap/josm
- Files:
-
- 2 added
- 4 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/Main.java
r128 r129 48 48 import org.openstreetmap.josm.gui.MapFrame; 49 49 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; 50 import org.openstreetmap.josm.gui. dialogs.AnnotationTester;50 import org.openstreetmap.josm.gui.annotation.AnnotationTester; 51 51 import org.openstreetmap.josm.gui.dialogs.SelectionListDialog; 52 52 import org.openstreetmap.josm.gui.layer.Layer; … … 142 142 setMapFrame(null); 143 143 } 144 145 144 146 public Main() { 145 147 main = this; -
src/org/openstreetmap/josm/gui/annotation/AnnotationPreset.java
r126 r129 1 package org.openstreetmap.josm.gui. dialogs;1 package org.openstreetmap.josm.gui.annotation; 2 2 3 3 import static org.openstreetmap.josm.tools.I18n.tr; … … 203 203 private List<Item> data; 204 204 public String name; 205 Collection<Class<?>> types;205 public Collection<Class<?>> types; 206 206 207 207 public AnnotationPreset(List<Item> data, String name, Collection<Class<?>> currentTypes) { -
src/org/openstreetmap/josm/gui/annotation/AnnotationTester.java
r125 r129 1 package org.openstreetmap.josm.gui. dialogs;1 package org.openstreetmap.josm.gui.annotation; 2 2 3 3 import java.awt.BorderLayout; … … 73 73 this.args = args; 74 74 annotationPresets = new JComboBox(); 75 annotationPresets.setRenderer(new AnnotationCellRenderer()); 75 76 reload(); 76 77 -
src/org/openstreetmap/josm/gui/dialogs/HistoryDialog.java
r128 r129 57 57 return c.getTime(); 58 58 } 59 59 60 60 private static class HistoryItem implements Comparable<HistoryItem> { 61 61 OsmPrimitive osm; 62 62 boolean visible; 63 63 64 64 public int compareTo(HistoryItem o) { 65 66 65 return unifyDate(osm.timestamp).compareTo(unifyDate(o.osm.timestamp)); 66 } 67 67 } 68 68 … … 100 100 history.getTableHeader().setDefaultRenderer(new DefaultTableCellRenderer(){ 101 101 @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { 102 103 104 105 106 107 108 109 110 111 112 102 JComponent c = (JComponent)oldRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); 103 if (!value.equals("")) 104 return c; 105 JLabel l = new JLabel(ImageProvider.get("misc","showhide")); 106 l.setForeground(c.getForeground()); 107 l.setBackground(c.getBackground()); 108 l.setFont(c.getFont()); 109 l.setBorder(c.getBorder()); 110 l.setOpaque(true); 111 return l; 112 } 113 113 }); 114 114 -
src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
r126 r129 28 28 29 29 import javax.swing.DefaultComboBoxModel; 30 import javax.swing.DefaultListCellRenderer;31 30 import javax.swing.JButton; 32 31 import javax.swing.JComboBox; 33 import javax.swing.JComponent;34 32 import javax.swing.JDialog; 35 33 import javax.swing.JLabel; 36 import javax.swing.JList;37 34 import javax.swing.JOptionPane; 38 35 import javax.swing.JPanel; … … 50 47 import org.openstreetmap.josm.data.osm.OsmPrimitive; 51 48 import org.openstreetmap.josm.gui.MapFrame; 49 import org.openstreetmap.josm.gui.annotation.AnnotationCellRenderer; 50 import org.openstreetmap.josm.gui.annotation.AnnotationPreset; 52 51 import org.openstreetmap.josm.tools.ImageProvider; 53 52 import org.xml.sax.SAXException; … … 264 263 } 265 264 }); 266 annotationPresets.setRenderer(new DefaultListCellRenderer(){ 267 @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { 268 AnnotationPreset a = (AnnotationPreset)value; 269 if (a.name == null) 270 return super.getListCellRendererComponent(list, "", index, false, false); 271 JComponent c = (JComponent)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); 272 JLabel l = new JLabel((a).name); 273 l.setForeground(c.getForeground()); 274 l.setBackground(c.getBackground()); 275 l.setFont(c.getFont()); 276 l.setBorder(c.getBorder()); 277 if (a.types == null) 278 l.setIcon(ImageProvider.get("data", "empty")); 279 else if (a.types.size() != 1) 280 l.setIcon(ImageProvider.get("data", "object")); 281 else 282 l.setIcon(ImageProvider.get("data", a.types.iterator().next().getSimpleName().toLowerCase())); 283 l.setOpaque(true); 284 return l; 285 } 286 }); 265 annotationPresets.setRenderer(new AnnotationCellRenderer()); 287 266 288 267 data.setColumnIdentifiers(new String[]{tr("Key"),tr("Value")}); -
src/org/openstreetmap/josm/gui/layer/GeoImageLayer.java
r113 r129 299 299 e.icon.paintIcon(mv, g, r.x, r.y); 300 300 Border b = null; 301 if (!clickedFound && mousePressed && r.contains(mv.getMousePosition())) { 301 Point mousePosition = mv.getMousePosition(); 302 if (mousePosition == null) 303 continue; // mouse outside the whole window 304 if (!clickedFound && mousePressed && r.contains(mousePosition)) { 302 305 b = BorderFactory.createBevelBorder(BevelBorder.LOWERED); 303 306 clickedFound = true;
Note:
See TracChangeset
for help on using the changeset viewer.