Changeset 27348 in osm for applications/editors/josm/plugins/alignways/src
- Timestamp:
- 2011-12-30T16:03:22+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/alignways/src/com
- Files:
-
- 12 added
- 13 copied
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysAction.java
r26842 r27348 2 2 * 3 3 */ 4 package org.openstreetmap.josm.plugins.alignways;4 package com.tilusnet.josm.plugins.alignways; 5 5 6 6 import static org.openstreetmap.josm.tools.I18n.tr; … … 10 10 import java.util.Collection; 11 11 12 import javax.swing.JOptionPane;13 14 12 import org.openstreetmap.josm.Main; 15 13 import org.openstreetmap.josm.actions.JosmAction; … … 17 15 import org.openstreetmap.josm.data.osm.Node; 18 16 import org.openstreetmap.josm.tools.Shortcut; 17 18 import com.tilusnet.josm.plugins.alignways.AlignWaysDialog.AligningModeOption; 19 19 20 20 /** … … 24 24 public class AlignWaysAction extends JosmAction { 25 25 26 /**27 *28 */29 26 private static final long serialVersionUID = -1540319652562985458L; 30 27 31 28 public AlignWaysAction() { 32 super(tr("Align Way Segments"), "alignways", 33 tr("Makes a pair of selected way segments parallel by rotating one of them " + 34 "around a chosen pivot."), 35 Shortcut.registerShortcut("tools:alignways", tr("Tool: {0}", 36 tr("Align Ways")), KeyEvent.VK_A, Shortcut.GROUP_EDIT, KeyEvent.CTRL_DOWN_MASK|KeyEvent.ALT_DOWN_MASK), true); 29 super( 30 tr("Align Way Segments"), 31 "alignways", 32 tr("Makes a pair of selected way segments parallel by rotating one of them " 33 + "around a chosen pivot."), Shortcut.registerShortcut( 34 "tools:alignways", tr("Tool: {0}", tr("Align Ways")), 35 KeyEvent.VK_A, Shortcut.GROUP_EDIT, 36 KeyEvent.CTRL_DOWN_MASK | KeyEvent.ALT_DOWN_MASK), true); 37 37 setEnabled(false); 38 38 } 39 39 40 @Override 40 41 public void actionPerformed(ActionEvent e) { 41 42 if (!isEnabled()) … … 44 45 return; 45 46 46 Collection<Node> affectedNodes = AlignWaysSegmentMgr.getInstance(Main.map.mapView).getSelectedNodes(); 47 Collection<Node> affectableNodes = AlignWaysSegmentMgr.getInstance( 48 Main.map.mapView).getSelectedNodes(); 47 49 50 // c is the last command launched, if any 48 51 Command c = !Main.main.undoRedo.commands.isEmpty() ? Main.main.undoRedo.commands 49 .getLast() 50 : null; 52 .getLast() : null; 51 53 52 if (!(c instanceof AlignWaysRotateCommand && 53 affectedNodes.equals(((AlignWaysRotateCommand) c).getRotatedNodes()))) { 54 c = new AlignWaysRotateCommand(); 55 if (actionValid((AlignWaysRotateCommand)c, affectedNodes)) { 56 Main.main.undoRedo.add(c); 54 // Potentially add my type of command only if last command wasn't my type 55 // or, if it was, the rotated nodes were not the same as now 56 if (!(c instanceof AlignWaysCmdKeepLength && affectableNodes 57 .equals(((AlignWaysCmdKeepLength) c).getPrevAffectedNodes()))) { 58 59 AlignWaysCmdKeepLength cmdAW; 60 if (AlignWaysPlugin.awDialog.getAwOpt() == AligningModeOption.ALGN_OPT_KEEP_ANGLE) { 61 cmdAW = new AlignWaysCmdKeepAngles(); 62 } else { 63 cmdAW = new AlignWaysCmdKeepLength(); 64 } 65 66 if (cmdAW.executable()) { 67 // This will also trigger AlignWaysCmdKeepLength.executeCommand() 68 Main.main.undoRedo.add(cmdAW); 57 69 } 58 70 } … … 63 75 } 64 76 65 66 /**67 * Validates the circumstances of the alignment (rotation) command to be executed.68 * @param c Command to be verified.69 * @param affectedNodes Nodes to be affected by the action.70 * @return true if the aligning action can be done, false otherwise.71 */72 private boolean actionValid(AlignWaysRotateCommand c, Collection<Node> affectedNodes) {73 // Deny action if reference and alignee segment cannot be aligned74 if (!c.areSegsAlignable()) {75 JOptionPane.showMessageDialog(Main.parent,76 tr("Please select two segments that don''t share any nodes\n"77 + " or put the pivot on their common node.\n"),78 tr("AlignWayS: Alignment not possible"), JOptionPane.WARNING_MESSAGE);79 return false;80 }81 82 // Deny action if the nodes would end up outside world83 for (Node n : affectedNodes) {84 if (n.getCoor().isOutSideWorld()) {85 // Revert move86 (c).undoCommand();87 JOptionPane.showMessageDialog(Main.parent,88 tr("Aligning would result nodes outside the world.\n"),89 tr("AlignWayS: Alignment not possible"), JOptionPane.WARNING_MESSAGE);90 return false;91 }92 93 }94 95 // Action valid96 return true;97 }98 99 77 } -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysAlgnSegment.java
r26842 r27348 1 package org.openstreetmap.josm.plugins.alignways;1 package com.tilusnet.josm.plugins.alignways; 2 2 3 3 import java.awt.BasicStroke; … … 8 8 import java.awt.geom.Ellipse2D; 9 9 import java.awt.geom.Line2D; 10 import java.util.ArrayList; 11 import java.util.Collection; 10 12 import java.util.EnumMap; 13 import java.util.HashMap; 14 import java.util.HashSet; 11 15 import java.util.Map; 12 16 17 import org.openstreetmap.josm.Main; 13 18 import org.openstreetmap.josm.data.Bounds; 14 19 import org.openstreetmap.josm.data.coor.EastNorth; 20 import org.openstreetmap.josm.data.osm.Node; 21 import org.openstreetmap.josm.data.osm.OsmPrimitive; 15 22 import org.openstreetmap.josm.data.osm.WaySegment; 16 23 import org.openstreetmap.josm.gui.MapView; … … 18 25 19 26 /** 20 * @author tilusnet <tilusnet@gmail.com> The segment to be aligned to the 21 * reference segment. Actions it can do: - remember its selected pivot 22 * point - keeps its potential pivot point list up to date - rotate 23 * itself - paint itself and its selected pivot point 24 * 27 * @author tilusnet <tilusnet@gmail.com> 28 * 29 * The segment to be aligned to the reference segment. Actions it can do: 30 * - remember its selected pivot point 31 * - keeps its potential pivot point list up to date 32 * - rotate itself 33 * - paint itself and its selected pivot point 34 * 25 35 */ 26 36 public class AlignWaysAlgnSegment extends AlignWaysSegment { … … 35 45 private final Color pivotColor = Color.YELLOW; 36 46 private final Color crossColor = pivotColor; 47 private final Map<Node,ArrayList<WaySegment>> adjWaySegs = new HashMap<Node,ArrayList<WaySegment>>(); 37 48 38 49 public AlignWaysAlgnSegment(MapView mapview, Point p) 39 throws IllegalArgumentException {50 throws IllegalArgumentException { 40 51 super(mapview, p); 41 52 setSegment(getNearestWaySegment(p)); … … 53 64 } 54 65 66 /* (non-Javadoc) 67 * @see com.tilusnet.josm.plugins.alignways.AlignWaysSegment#setSegmentEndpoints(org.openstreetmap.josm.data.osm.WaySegment) 68 */ 69 @Override 70 void setSegmentEndpoints(WaySegment segment) { 71 super.setSegmentEndpoints(segment); 72 73 // Update the list of adjacent waysegments to the endpoints 74 for (Node nA : getSegmentEndPoints()) { 75 adjWaySegs.put(nA, new ArrayList<WaySegment>(determineAdjacentWaysegments(nA))); 76 } 77 78 } 79 55 80 /** 56 81 * Useful when segments moves (or e.g. rotates) on the map. Updates the end … … 88 113 * Returns the EastNorth of the specified pivot point pp. It always returns 89 114 * up-to-date data from dataset. Assumes segment is not null. 90 * 115 * 91 116 * @param pp 92 117 * The pivot location … … 153 178 } 154 179 180 /** 181 * Given a Node (usually an endpoint), it will return a collection of way segments that are adjacently 182 * connected to it. The current alignee waysegment is not added to the collection. 183 * 184 * @param node The Node (endpoint) to analyse. 185 * @return The collection of the adjacent waysegments. 186 */ 187 private Collection<WaySegment> determineAdjacentWaysegments(Node node) { 188 Collection<WaySegment> wsSet = new HashSet<WaySegment>(); 189 final double radius = 10.0; 190 final int stepsOnCircle = 24; 191 final double incrementOnCircle = 2 * Math.PI / stepsOnCircle; 192 193 Point p = Main.map.mapView.getPoint(node); 194 for (int i = 0; i < stepsOnCircle; i++) { 195 double ang = i * incrementOnCircle; 196 double x = p.getX() + (Math.cos(ang) * radius); 197 double y = p.getY() + (Math.sin(ang) * radius); 198 Point pnew = new Point(); 199 pnew.setLocation(x, y); 200 WaySegment ws = Main.map.mapView.getNearestWaySegment(pnew, OsmPrimitive.isUsablePredicate); 201 if (ws != null && !ws.equals(this.segment) && 202 (ws.getFirstNode().equals(node) || ws.getSecondNode().equals(node))) { 203 // We won't want to add a: 204 // - 'no match' (=null) 205 // - segment that is not connected to the alignee endpoint 206 wsSet.add(ws); 207 } 208 } 209 210 return wsSet; 211 } 212 213 /** 214 * Returns the collection of adjacent way segments to Node node. 215 * The node is normally a valid endpoint of the segment. 216 * If it isn't, null may be returned. 217 * 218 * @param node The (endpoint) node. 219 * @return Collection of the adjacent way segments. 220 */ 221 public ArrayList<WaySegment> getAdjacentWaySegments(Node node) { 222 return adjWaySegs.get(node); 223 } 224 155 225 /* 156 226 * (non-Javadoc) 157 * 227 * 158 228 * @see 159 * org.openstreetmap.josm.plugins.alignways.AlignWaysRefSegment#paint(java229 * com.tilusnet.josm.plugins.alignways.AlignWaysRefSegment#paint(java 160 230 * .awt.Graphics2D, org.openstreetmap.josm.gui.MapView, 161 231 * org.openstreetmap.josm.data.Bounds) … … 165 235 // Note: segment should never be null here 166 236 super.paint(g, mv, bbox); 237 238 // Ensure consistency 239 updatePivotsEndpoints(); 167 240 168 241 // Highlight potential pivot points -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysMode.java
r26842 r27348 2 2 * 3 3 */ 4 package org.openstreetmap.josm.plugins.alignways;4 package com.tilusnet.josm.plugins.alignways; 5 5 6 6 import static org.openstreetmap.josm.tools.I18n.tr; 7 7 8 8 import java.awt.Cursor; 9 import java.awt.Dimension; 10 import java.awt.Image; 9 11 import java.awt.Point; 10 12 import java.awt.event.ActionEvent; … … 13 15 import java.awt.event.MouseEvent; 14 16 17 import javax.swing.BorderFactory; 18 import javax.swing.ImageIcon; 19 import javax.swing.JButton; 15 20 import javax.swing.JDialog; 16 21 import javax.swing.JOptionPane; … … 18 23 import org.openstreetmap.josm.Main; 19 24 import org.openstreetmap.josm.actions.mapmode.MapMode; 25 import org.openstreetmap.josm.gui.IconToggleButton; 20 26 import org.openstreetmap.josm.gui.MapFrame; 27 import org.openstreetmap.josm.gui.layer.Layer; 21 28 import org.openstreetmap.josm.tools.Shortcut; 22 29 … … 54 61 public void enterMode() { 55 62 super.enterMode(); 63 64 AlignWaysPlugin.getAwDialog().activate(true); 65 IconToggleButton optBtn = AlignWaysPlugin.getOptBtn(); 66 if (!optBtn.isSelected()) { 67 // Make sure the option panel is visible when align mode starts 68 optBtn.doClick(); 69 } 70 56 71 boolean showTips = Boolean.parseBoolean(Main.pref.get("alignways.showtips", "true")); 57 72 if ((showTips) && (!tipShown)) { 58 73 showTips(); 59 74 } 75 int majorVer = Integer.parseInt(Main.pref.get("alignways.majorver", "-1")); 76 if (majorVer != AlignWaysPlugin.AlignWaysMajorVersion) { 77 showWhatsNew(); 78 } 79 60 80 awSegs = AlignWaysSegmentMgr.getInstance(Main.map.mapView); 61 81 Main.map.mapView.addMouseListener(this); … … 63 83 } 64 84 85 65 86 @Override 66 87 public void exitMode() { 67 88 super.exitMode(); 89 90 AlignWaysPlugin.getAwDialog().activate(false); 91 IconToggleButton optBtn = AlignWaysPlugin.getOptBtn(); 92 if (optBtn.isSelected()) { 93 // The option panel is switched off 94 optBtn.doClick(); 95 } 96 68 97 setCurrentState(noneSelected); 69 98 Main.map.mapView.removeMouseListener(this); … … 120 149 if (currentState == noneSelected) { 121 150 awSegs.cleanupWays(); 122 // FIX:getCurrentDataSet may return null when the editable layer had151 // TODO getCurrentDataSet may return null when the editable layer had 123 152 // already been removed by JOSM. This happens e.g. when the user closes 124 153 // JOSM while AlignWays mode is still active. … … 166 195 private void showTips() { 167 196 168 AlignWaysTipsPanel at d= new AlignWaysTipsPanel();197 AlignWaysTipsPanel atp = new AlignWaysTipsPanel(); 169 198 Object[] okButton = {tr("I''m ready!")}; 170 JOptionPane tipPane = new JOptionPane(at d, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null, okButton, okButton[0]);171 // JDialog tipDialog = tipPane.createDialog(null, tr("AlignWays Tips"));172 // Take Main.map as frame as it's better to inherit its icon than the default Java cup199 JOptionPane tipPane = new JOptionPane(atp, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, 200 null, okButton, okButton[0]); 201 tipPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 30, 10)); 173 202 JDialog tipDialog = tipPane.createDialog(Main.parent, tr("AlignWays Tips")); 174 // ((Frame)tipDialog.getOwner()).setIconImage(new ImageIcon(getClass().getResource("/images/blank.png")).getImage());203 tipDialog.setIconImage(new ImageIcon(getClass().getResource("/images/alignways.png")).getImage()); 175 204 176 205 tipDialog.setResizable(true); … … 180 209 tipDialog.dispose(); 181 210 182 Main.pref.put("alignways.showtips", !atd.isChkBoxSelected()); 183 211 Main.pref.put("alignways.showtips", !atp.isChkBoxSelected()); 212 213 } 214 215 216 private void showWhatsNew() { 217 218 AlignWaysWhatsNewPanel awnp = new AlignWaysWhatsNewPanel(); 219 JOptionPane wnPane = new JOptionPane(awnp, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null); 220 wnPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); 221 JDialog wnDialog = wnPane.createDialog(Main.parent, tr("AlignWays: What''s New...")); 222 wnDialog.setIconImage(new ImageIcon(getClass().getResource("/images/alignways.png")).getImage()); 223 224 wnDialog.setResizable(true); 225 wnDialog.setVisible(true); 226 227 wnDialog.dispose(); 228 229 Main.pref.put("alignways.majorver", new Integer(AlignWaysPlugin.AlignWaysMajorVersion).toString()); 230 231 } 232 233 /* (non-Javadoc) 234 * @see org.openstreetmap.josm.actions.mapmode.MapMode#layerIsSupported(org.openstreetmap.josm.gui.layer.Layer) 235 */ 236 @Override 237 public boolean layerIsSupported(Layer l) { 238 if (l == null) 239 return false; 240 else 241 return true; 184 242 } 185 243 } -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysPlugin.java
r26842 r27348 1 package org.openstreetmap.josm.plugins.alignways;1 package com.tilusnet.josm.plugins.alignways; 2 2 3 3 import static org.openstreetmap.josm.tools.I18n.tr; … … 24 24 static JMenuItem alignWaysMenuItem; 25 25 static JosmAction awAction; 26 static AlignWaysDialog awDialog; 27 static IconToggleButton optBtn; 26 28 27 / **28 *29 */ 29 // The major version is e.g. used to decide when to trigger What's New windows 30 public static final int AlignWaysMajorVersion = 2; 31 30 32 public AlignWaysPlugin(PluginInformation info) { 31 33 super(info); … … 36 38 awAction = new AlignWaysAction(); 37 39 alignWaysMenuItem = MainMenu.add(Main.main.menu.toolsMenu, awAction); 38 Main.main.menu.toolsMenu.addSeparator(); 39 40 awDialog = new AlignWaysDialog(awMode); 40 41 } 41 42 42 43 @Override 43 44 public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) { 45 if(newFrame != null) { 46 optBtn = newFrame.addToggleDialog(AlignWaysPlugin.getAwDialog()); 47 } 44 48 if (Main.map != null) { 45 49 Main.map.addMapMode(btn); … … 61 65 } 62 66 67 /** 68 * @return the awDialog 69 */ 70 public static AlignWaysDialog getAwDialog() { 71 return awDialog; 72 } 73 74 /** 75 * @return the optBtn 76 */ 77 public static IconToggleButton getOptBtn() { 78 return optBtn; 79 } 80 63 81 } -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysRefSegment.java
r26842 r27348 2 2 * 3 3 */ 4 package org.openstreetmap.josm.plugins.alignways;4 package com.tilusnet.josm.plugins.alignways; 5 5 6 6 import java.awt.Color; -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysSegment.java
r26842 r27348 2 2 * 3 3 */ 4 package org.openstreetmap.josm.plugins.alignways;4 package com.tilusnet.josm.plugins.alignways; 5 5 6 6 import static org.openstreetmap.josm.tools.I18n.tr; … … 27 27 public class AlignWaysSegment implements MapViewPaintable { 28 28 29 30 31 32 29 protected WaySegment segment; 30 protected MapView mapview; 31 protected Color segmentColor = Color.WHITE; 32 protected Collection<Node> segmentEndPoints; 33 33 34 public AlignWaysSegment(MapView mapview, Point p) 35 throws IllegalArgumentException { 36 if (mapview == null) 37 throw new IllegalArgumentException(tr( 38 "Parameter ''{0}'' must not be null", "mapview")); 39 if (p == null) 40 throw new IllegalArgumentException(tr( 41 "Parameter ''{0}'' must not be null", "p")); 34 public AlignWaysSegment(MapView mapview, Point p) throws IllegalArgumentException { 35 if (mapview == null) 36 throw new IllegalArgumentException(tr( 37 "Parameter ''{0}'' must not be null", "mapview")); 38 if (p == null) 39 throw new IllegalArgumentException(tr( 40 "Parameter ''{0}'' must not be null", "p")); 42 41 43 44 42 this.mapview = mapview; 43 } 45 44 46 47 48 49 50 51 52 45 void setSegment(WaySegment segment) { 46 this.segment = segment; 47 if (segment != null) { 48 setSegmentEndpoints(segment); 49 mapview.addTemporaryLayer(this); 50 } 51 } 53 52 54 53 55 56 57 58 54 void setSegmentEndpoints(WaySegment segment) { 55 if (segment != null) { 56 Node node1 = segment.way.getNode(segment.lowerIndex); 57 Node node2 = segment.way.getNode(segment.lowerIndex + 1); 59 58 60 61 62 59 segmentEndPoints = new HashSet<Node>(); 60 segmentEndPoints.add(node1); 61 segmentEndPoints.add(node2); 63 62 64 65 63 } 64 } 66 65 67 66 protected WaySegment getNearestWaySegment(Point p) { 68 67 69 68 return mapview.getNearestWaySegment(p, OsmPrimitive.isUsablePredicate); 70 69 71 70 } 72 71 73 74 75 76 77 72 public void destroy() { 73 if (segment != null) { 74 mapview.removeTemporaryLayer(this); 75 } 76 } 78 77 79 80 81 78 public WaySegment getSegment() { 79 return segment; 80 } 82 81 83 84 85 82 public Collection<Node> getSegmentEndPoints() { 83 return segmentEndPoints; 84 } 86 85 87 public void paint(Graphics2D g, MapView mv, Bounds bbox) { 88 highlightSegment(segmentColor, g, mv); 89 } 86 @Override 87 public void paint(Graphics2D g, MapView mv, Bounds bbox) { 88 highlightSegment(segmentColor, g, mv); 89 } 90 90 91 91 protected void highlightSegment(Color c, Graphics2D g, MapView mv) { 92 92 93 94 95 96 93 g.setColor(c); 94 g.setStroke(new BasicStroke(6, BasicStroke.CAP_ROUND, 95 BasicStroke.JOIN_ROUND)); 96 drawSegment(g, mv); 97 97 98 98 } 99 99 100 101 102 100 protected void drawSegment(Graphics2D g, MapView mv) { 101 Node n1 = segment.way.getNode(segment.lowerIndex); 102 Node n2 = segment.way.getNode(segment.lowerIndex + 1); 103 103 104 105 106 104 Line2D newline = new Line2D.Double(mv.getPoint(n1), mv.getPoint(n2)); 105 g.draw(newline); 106 } 107 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 108 /* 109 * (non-Javadoc) 110 * 111 * @see java.lang.Object#hashCode() 112 */ 113 @Override 114 public int hashCode() { 115 final int prime = 31; 116 int result = 1; 117 result = prime * result + ((segment == null) ? 0 : segment.hashCode()); 118 result = prime * result 119 + ((segmentColor == null) ? 0 : segmentColor.hashCode()); 120 return result; 121 } 122 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 123 /* 124 * (non-Javadoc) 125 * 126 * @see java.lang.Object#equals(java.lang.Object) 127 */ 128 @Override 129 public boolean equals(Object obj) { 130 if (this == obj) 131 return true; 132 if (obj == null) 133 return false; 134 if (!(obj instanceof AlignWaysSegment)) 135 return false; 136 AlignWaysSegment other = (AlignWaysSegment) obj; 137 if (segment == null) { 138 if (other.segment != null) 139 return false; 140 } else if (!segment.equals(other.segment)) 141 return false; 142 /* Segment colour is ignored in comparison 143 143 if (segmentColor == null) { 144 144 if (other.segmentColor != null) … … 146 146 } else if (!segmentColor.equals(other.segmentColor)) 147 147 return false; 148 149 150 148 */ 149 return true; 150 } 151 151 } -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysSegmentMgr.java
r26842 r27348 1 package org.openstreetmap.josm.plugins.alignways;1 package com.tilusnet.josm.plugins.alignways; 2 2 3 3 import static org.openstreetmap.josm.tools.I18n.tr; -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysSelAlgnState.java
r26842 r27348 2 2 * 3 3 */ 4 package org.openstreetmap.josm.plugins.alignways;4 package com.tilusnet.josm.plugins.alignways; 5 5 6 6 import org.openstreetmap.josm.Main; -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysSelBothState.java
r26842 r27348 2 2 * 3 3 */ 4 package org.openstreetmap.josm.plugins.alignways;4 package com.tilusnet.josm.plugins.alignways; 5 5 6 6 import org.openstreetmap.josm.Main; -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysSelNoneState.java
r26842 r27348 2 2 * 3 3 */ 4 package org.openstreetmap.josm.plugins.alignways;4 package com.tilusnet.josm.plugins.alignways; 5 5 6 6 import org.openstreetmap.josm.Main; -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysSelRefState.java
r26842 r27348 2 2 * 3 3 */ 4 package org.openstreetmap.josm.plugins.alignways;4 package com.tilusnet.josm.plugins.alignways; 5 5 6 6 import org.openstreetmap.josm.Main; -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysState.java
r26842 r27348 2 2 * 3 3 */ 4 package org.openstreetmap.josm.plugins.alignways;4 package com.tilusnet.josm.plugins.alignways; 5 5 6 6 import org.openstreetmap.josm.Main; -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysTipsPanel.java
r26842 r27348 2 2 * 3 3 */ 4 package org.openstreetmap.josm.plugins.alignways;4 package com.tilusnet.josm.plugins.alignways; 5 5 6 6 import static org.openstreetmap.josm.tools.I18n.tr; … … 25 25 * 26 26 */ 27 public class AlignWaysTipsPanel extends javax.swing.JPanel {27 public class AlignWaysTipsPanel extends JPanel { 28 28 29 29 private static final long serialVersionUID = -8583989497599985140L; … … 53 53 54 54 WelcomeTo.setText("<html>\n<div style=\"font-family: \"sans-serif\"; font-weight: bold; font-style: italic;\">\n<span style=\"font-size: large;\">" 55 + tr("Welcome to the</span><br>\n<span style=\"font-size: xx-large;\">AlignWay<span style=\"color: rgb(204, 85, 0);\">S</span> Plugin<br>\n</span>"56 + "<span style=\"font-size: medium;\"><br>\n...or it rather should be called <br>\n<span style=\"font-size: large;\">AlignWayS(egments)</span> Plugin...")57 + "</span>\n</div>\n</html>");55 + tr("Welcome to the</span><br>\n<span style=\"font-size: xx-large;\">AlignWay<span style=\"color: rgb(204, 85, 0);\">S</span> Plugin<br>\n</span>" 56 + "<span style=\"font-size: medium;\"><br>\n...or it rather should be called <br>\n<span style=\"font-size: large;\">AlignWayS(egments)</span> Plugin...") 57 + "</span>\n</div>\n</html>"); 58 58 59 59 WelcomeTo.setVerticalAlignment(SwingConstants.TOP); … … 69 69 .addPreferredGap(LayoutStyle.RELATED) 70 70 .add(Icon, GroupLayout.PREFERRED_SIZE, 132, GroupLayout.PREFERRED_SIZE)) 71 );71 ); 72 72 TitleLayout.setVerticalGroup( 73 73 TitleLayout.createParallelGroup(GroupLayout.LEADING) … … 76 76 .addContainerGap()) 77 77 .add(WelcomeTo, GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE) 78 );78 ); 79 79 80 80 Intro.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); … … 120 120 .add(GroupLayout.LEADING, step01, GroupLayout.DEFAULT_SIZE, 496, Short.MAX_VALUE)) 121 121 .add(18, 18, 18)) 122 );122 ); 123 123 stepsLayout.setVerticalGroup( 124 124 stepsLayout.createParallelGroup(GroupLayout.LEADING) … … 134 134 .add(lastHint, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) 135 135 .addContainerGap(22, Short.MAX_VALUE)) 136 );136 ); 137 137 138 138 scrollableSteps.setViewportView(steps); … … 150 150 .add(scrollableSteps, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE) 151 151 .add(introText, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE) 152 );152 ); 153 153 IntroLayout.setVerticalGroup( 154 154 IntroLayout.createParallelGroup(GroupLayout.LEADING) … … 160 160 .add(dontShow) 161 161 .addContainerGap()) 162 );162 ); 163 163 164 164 GroupLayout layout = new GroupLayout(this); … … 173 173 .add(Intro, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 174 174 .addContainerGap()) 175 );175 ); 176 176 layout.setVerticalGroup( 177 177 layout.createParallelGroup(GroupLayout.LEADING) … … 184 184 .add(Intro, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) 185 185 .addContainerGap(45, Short.MAX_VALUE)) 186 );186 ); 187 187 } 188 188
Note:
See TracChangeset
for help on using the changeset viewer.