Changeset 144 in josm
- Timestamp:
- 2006-10-01T19:45:33+02:00 (18 years ago)
- Files:
-
- 52 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/Main.java
r142 r144 12 12 import java.net.URISyntaxException; 13 13 import java.util.Collection; 14 import java.util.LinkedList; 14 15 import java.util.Map; 15 16 import java.util.StringTokenizer; … … 55 56 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 56 57 import org.openstreetmap.josm.gui.layer.OsmDataLayer.CommandQueueListener; 58 import org.openstreetmap.josm.plugins.Plugin; 57 59 import org.openstreetmap.josm.tools.ImageProvider; 58 60 … … 88 90 */ 89 91 public static MapFrame map; 92 /** 93 * All installed and loaded plugins (resp. their main classes) 94 */ 95 public final Collection<Plugin> plugins = new LinkedList<Plugin>(); 90 96 91 97 /** … … 118 124 } 119 125 redoUndoListener.commandChanged(0,0); 126 127 for (Plugin plugin : plugins) 128 plugin.mapFrameInitialized(map); 120 129 } 121 130 … … 236 245 237 246 contentPane.updateUI(); 247 248 // Plugins 249 if (pref.hasKey("plugins")) { 250 for (String pluginName : pref.get("plugins").split(",")) { 251 try { 252 plugins.add((Plugin)Class.forName(pluginName).newInstance()); 253 } catch (Exception e) { 254 e.printStackTrace(); 255 JOptionPane.showMessageDialog(parent, tr("Could not load plugin {0}.", pluginName)); 256 } 257 } 258 } 238 259 } 239 260 /** -
src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
r100 r144 27 27 * The environment to paint to. 28 28 */ 29 pr ivate finalGraphics g;29 protected Graphics g; 30 30 /** 31 31 * MapView to get screen coordinates. 32 32 */ 33 private final NavigatableComponent nc; 34 private static final double PHI = Math.toRadians(20); 33 protected NavigatableComponent nc; 35 34 36 /** 37 * Construct the painter visitor. 38 * @param g The graphics to draw to. 39 * @param mv The view to get screen coordinates from. 40 */ 41 public SimplePaintVisitor(Graphics g, NavigatableComponent mv) { 42 this.g = g; 43 this.nc = mv; 44 } 35 protected static final double PHI = Math.toRadians(20); 45 36 46 37 /** … … 97 88 * Draw a line with the given color. 98 89 */ 99 pr ivatevoid drawSegment(Segment ls, Color col) {90 protected void drawSegment(Segment ls, Color col) { 100 91 if (ls.incomplete) 101 92 return; … … 122 113 return ColorHelper.html2color(colStr); 123 114 } 115 116 117 public void setGraphics(Graphics g) { 118 this.g = g; 119 } 120 121 public void setNavigatableComponent(NavigatableComponent nc) { 122 this.nc = nc; 123 } 124 124 } -
src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
r138 r144 138 138 if (value == null) 139 139 selectionChanged(sel); // update whole table 140 else141 PropertiesDialog.this.repaint(); // repaint is enough140 141 Main.parent.repaint(); // repaint all - drawing could have been changed 142 142 } 143 143 … … 185 185 Main.main.editLayer().add(new ChangePropertyCommand(sel, key, value)); 186 186 selectionChanged(sel); // update table 187 Main.parent.repaint(); // repaint all - drawing could have been changed 187 188 } 188 189 -
src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r138 r144 114 114 public final LinkedList<CommandQueueListener> listenerCommands = new LinkedList<CommandQueueListener>(); 115 115 116 private SimplePaintVisitor mapPainter = new SimplePaintVisitor(); 117 116 118 /** 117 119 * Construct a OsmDataLayer. … … 138 140 */ 139 141 @Override public void paint(final Graphics g, final MapView mv) { 140 final SimplePaintVisitor visitor = new SimplePaintVisitor(g, mv); 142 mapPainter.setGraphics(g); 143 mapPainter.setNavigatableComponent(mv); 141 144 for (final OsmPrimitive osm : data.segments) 142 145 if (!osm.deleted) 143 osm.visit( visitor);146 osm.visit(mapPainter); 144 147 for (final OsmPrimitive osm : data.ways) 145 148 if (!osm.deleted) 146 osm.visit( visitor);149 osm.visit(mapPainter); 147 150 for (final OsmPrimitive osm : data.nodes) 148 151 if (!osm.deleted) 149 osm.visit( visitor);152 osm.visit(mapPainter); 150 153 for (final OsmPrimitive osm : data.getSelected()) 151 154 if (!osm.deleted) 152 osm.visit( visitor);155 osm.visit(mapPainter); 153 156 Main.map.conflictDialog.paintConflicts(g, mv); 154 157 } … … 335 338 new JMenuItem(new LayerListPopup.InfoAction(this))}; 336 339 } 340 341 342 public void setMapPainter(SimplePaintVisitor mapPainter) { 343 this.mapPainter = mapPainter; 344 } 337 345 }
Note:
See TracChangeset
for help on using the changeset viewer.