Changeset 23795 in osm for applications/editors/josm/plugins/ElevationProfile/src/org
- Timestamp:
- 2010-10-24T02:08:34+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationMapMode.java
r23709 r23795 23 23 24 24 /** 25 * @author Oliver 26 * 25 * @author Oliver Wieland <oliver.wieland@online.de> 26 * Provides the map mode and controls visibility of the elevation profile layer/panel. 27 27 */ 28 28 public class ElevationMapMode extends MapMode implements IElevationModelListener { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationModel.java
r23754 r23795 38 38 * @see IElevationModelTrackListener 39 39 * @see IElevationModelSliceListener 40 * @author Oliver 40 * @author Oliver Wieland <oliver.wieland@online.de> 41 41 */ 42 42 public class ElevationModel extends ElevationProfileBase implements IGpxVisitor { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfileBase.java
r23764 r23795 38 38 * {@link IElevationProfile} {@link IGpxWaypointVisitor} {@link GpxIterator} 39 39 * 40 * @author Oliver 40 * @author Oliver Wieland <oliver.wieland@online.de> 41 41 * 42 42 */ -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfileLeaf.java
r23709 r23795 1 /** 2 * This program is free software: you can redistribute it and/or modify it under 3 * the terms of the GNU General Public License as published by the 4 * Free Software Foundation, either version 3 of the License, or 5 * (at your option) any later version. 6 * 7 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 8 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 9 * See the GNU General Public License for more details. 10 * 11 * You should have received a copy of the GNU General Public License along with this program. 12 * If not, see <http://www.gnu.org/licenses/>. 13 */ 1 14 package org.openstreetmap.josm.plugins.elevation; 2 15 … … 10 23 * 11 24 * ElevationModelSlice is intended to be used internally. 12 * @author oliverwieland25 * @author Oliver Wieland <oliver.wieland@online.de> 13 26 * 14 27 */ -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfileNode.java
r23709 r23795 1 /** 2 * This program is free software: you can redistribute it and/or modify it under 3 * the terms of the GNU General Public License as published by the 4 * Free Software Foundation, either version 3 of the License, or 5 * (at your option) any later version. 6 * 7 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 8 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 9 * See the GNU General Public License for more details. 10 * 11 * You should have received a copy of the GNU General Public License along with this program. 12 * If not, see <http://www.gnu.org/licenses/>. 13 */ 1 14 package org.openstreetmap.josm.plugins.elevation; 2 15 … … 11 24 * {@link ElevationProfileLeaf} which are accessible via {@link ElevationProfileBase#getChildren()}. 12 25 * 13 * @author Oliver 26 * @author Oliver Wieland <oliver.wieland@online.de> 14 27 * 15 28 * @see ElevationProfileBase -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfilePlugin.java
r23721 r23795 26 26 /** 27 27 * Plugin class for displaying an elevation profile of the tracks. 28 * @author Oliver 28 * @author Oliver Wieland <oliver.wieland@online.de> 29 29 * 30 30 */ -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationWayPointKind.java
r23764 r23795 16 16 17 17 /** 18 * @author Oliver 19 * 18 * @author Oliver Wieland <oliver.wieland@online.de> 19 * Enumeration which classifies way points within an elevation profile. 20 20 */ 21 21 public enum ElevationWayPointKind { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/GeoidCorrectionKind.java
r23709 r23795 16 16 17 17 /** 18 * @author Oliver 19 * 18 * @author Oliver Wieland <oliver.wieland@online.de> 19 * Enumeration for available elevation correction modes. 20 20 */ 21 21 public enum GeoidCorrectionKind { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/GeoidData.java
r23709 r23795 16 16 17 17 /** 18 * Holds the geoid correction data. 19 * @author Oliver 18 * Holds the geoid correction data. The data has been generated; usually this class does not need to change. 19 * @author Oliver Wieland <oliver.wieland@online.de> 20 20 */ 21 21 public class GeoidData { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/GpxIterator.java
r23709 r23795 25 25 /** 26 26 * Utility class to apply a visitor on GPX containers (track, route, data). 27 * @author Oliver 27 * @author Oliver Wieland <oliver.wieland@online.de> 28 28 */ 29 29 public class GpxIterator { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/IElevationModelListener.java
r23709 r23795 19 19 * repaint UI widgets). 20 20 * {@link ElevationModel} 21 * @author Oliver 21 * @author Oliver Wieland <oliver.wieland@online.de> 22 22 */ 23 23 public interface IElevationModelListener { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/IElevationProfile.java
r23736 r23795 21 21 22 22 /** 23 * @author Oliver 24 * 23 * @author Oliver Wieland <oliver.wieland@online.de> 24 * Interface for an elevation profile providing special properties/values. 25 25 */ 26 26 public interface IElevationProfile { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/IGpxVisitor.java
r23709 r23795 21 21 22 22 /** 23 * Interface for all GPX visitor .24 * @author Oliver 23 * Interface for all GPX visitors. 24 * @author Oliver Wieland <oliver.wieland@online.de> 25 25 */ 26 26 public interface IGpxVisitor extends IGpxWaypointVisitor { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/IGpxWaypointVisitor.java
r23709 r23795 18 18 19 19 /** 20 * @author Oliver 21 * 20 * @author Oliver Wieland <oliver.wieland@online.de> 21 * Interface for all GPX data visitors. Hopefully this will be part of JOSM some day. 22 22 */ 23 23 public interface IGpxWaypointVisitor { 24 24 /** 25 * Visits a way point. This method is called for isolated way points, i e. way points25 * Visits a way point. This method is called for isolated way points, i. e. way points 26 26 * without an associated route or track. 27 27 * @param wp The way point to visit. -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/UnitMode.java
r23769 r23795 1 /** 2 * This program is free software: you can redistribute it and/or modify it under 3 * the terms of the GNU General Public License as published by the 4 * Free Software Foundation, either version 3 of the License, or 5 * (at your option) any later version. 6 * 7 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 8 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 9 * See the GNU General Public License for more details. 10 * 11 * You should have received a copy of the GNU General Public License along with this program. 12 * If not, see <http://www.gnu.org/licenses/>. 13 */ 14 1 15 package org.openstreetmap.josm.plugins.elevation; 2 16 17 /** 18 * @author Oliver Wieland <oliver.wieland@online.de> 19 * Enumeration for different unit types. 20 */ 3 21 public enum UnitMode { 4 22 NotSelected, 5 23 Metric, 6 24 Imperial 25 // Chinese system missing 7 26 } -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/WayPointHelper.java
r23791 r23795 15 15 package org.openstreetmap.josm.plugins.elevation; 16 16 17 import java.awt.Color;18 17 import java.util.ArrayList; 19 18 import java.util.Calendar; … … 25 24 26 25 /** 27 * @author Oliver Provides several static methods to access way point 28 * attributes. 26 * Provides methods to access way point attributes and some utility methods regarding elevation stuff ( 27 * e. g. special text formats, unit conversion, geoid calc). 28 * @author Oliver Wieland <oliver.wieland@online.de> 29 29 */ 30 30 public class WayPointHelper { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/DefaultElevationProfileRenderer.java
r23769 r23795 37 37 38 38 /** 39 * @author Oliver40 * 39 * Provides default rendering for elevation profile layer. 40 * @author Oliver Wieland <oliver.wieland@online.de> 41 41 */ 42 42 public class DefaultElevationProfileRenderer implements … … 184 184 int rad = REGULAR_WPT_RADIUS; 185 185 g.setColor(c); 186 // g.drawOval(pnt.x - rad, pnt.y - rad, r2, r2);187 186 drawSphere(g, Color.WHITE, c, pnt.x, pnt.y, rad); 188 187 188 /* Paint full hour label */ 189 189 if (kind == ElevationWayPointKind.FullHour) { 190 190 int hour = WayPointHelper.getHourOfWayPoint(wpt); … … 193 193 } 194 194 195 /* Paint label for elevation levels */ 195 196 if (kind == ElevationWayPointKind.ElevationLevelGain) { 196 197 drawLabelWithTriangle(WayPointHelper.getElevationText(ele), pnt.x, pnt.y … … 207 208 } 208 209 210 /* Paint cursor labels */ 209 211 if (kind == ElevationWayPointKind.Highlighted) { 210 int eleH = (int) WayPointHelper.getElevation(wpt);211 int hour = WayPointHelper.getHourOfWayPoint(wpt);212 int min = WayPointHelper.getMinuteOfWayPoint(wpt);213 212 drawSphere(g, Color.WHITE, c, pnt.x, pnt.y, BIG_WPT_RADIUS); 214 drawLabel( String.format("%02d:%02d", hour, min), pnt.x, pnt.y213 drawLabel(WayPointHelper.getTimeText(wpt), pnt.x, pnt.y 215 214 - g.getFontMetrics().getHeight() - 5, g); 216 drawLabel(WayPointHelper.getElevationText( eleH), pnt.x, pnt.y215 drawLabel(WayPointHelper.getElevationText(wpt), pnt.x, pnt.y 217 216 + g.getFontMetrics().getHeight() + 5, g); 218 217 } … … 345 344 346 345 /** 347 * Renders a start/end point 346 * Renders a start/end point. 348 347 * 349 348 * @param g … … 367 366 368 367 /** 369 * Draw a shaded sphere.368 * Draws a shaded sphere. 370 369 * 371 370 * @param g … … 401 400 402 401 /** 403 * Draws a label .402 * Draws a label within a filled rounded rectangle with standard gradient colors. 404 403 * 405 404 * @param s … … 417 416 418 417 /** 419 * Draws a label .418 * Draws a label within a filled rounded rectangle with the specified second gradient color (first color is <tt>Color.WHITE<tt>). 420 419 * 421 420 * @param s … … 518 517 519 518 /** 520 * Checks, if the rectangle has been 'reserved' by a previous draw action.519 * Checks, if the rectangle has been 'reserved' by an previous draw action. 521 520 * 522 521 * @param r 523 522 * The area to check for. 524 * @return true ;if area is already occupied by another rectangle.523 * @return true, if area is already occupied by another rectangle. 525 524 */ 526 525 private boolean isForbiddenArea(Rectangle r) { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationColors.java
r23721 r23795 19 19 /** 20 20 * Contains some extra predefined colors. 21 * @author Oliver 21 * @author Oliver Wieland <oliver.wieland@online.de> 22 22 */ 23 23 public class ElevationColors { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java
r23769 r23795 53 53 54 54 /** 55 * @author Oliver 55 * @author Oliver Wieland <oliver.wieland@online.de> 56 56 * Implements a JOSM ToggleDialog to show the elevation profile. It monitors the 57 57 * connection between layer and elevation profile. -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileLayer.java
r23789 r23795 38 38 * min/max elevation markers. 39 39 * 40 * @author Oliver 40 * @author Oliver Wieland <oliver.wieland@online.de> 41 41 * 42 42 */ -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfilePanel.java
r23791 r23795 1 /** 2 * This program is free software: you can redistribute it and/or modify it under 3 * the terms of the GNU General Public License as published by the 4 * Free Software Foundation, either version 3 of the License, or 5 * (at your option) any later version. 6 * 7 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 8 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 9 * See the GNU General Public License for more details. 10 * 11 * You should have received a copy of the GNU General Public License along with this program. 12 * If not, see <http://www.gnu.org/licenses/>. 13 */ 1 14 package org.openstreetmap.josm.plugins.elevation.gui; 2 15 … … 30 43 /** 31 44 * Provides the panel showing the elevation profile. 32 * @author Oliver 45 * @author Oliver Wieland <oliver.wieland@online.de> 33 46 * 34 47 */ -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/IElevationProfileRenderer.java
r23757 r23795 29 29 * details. 30 30 * 31 * @author Oliver 31 * @author Oliver Wieland <oliver.wieland@online.de> 32 32 * 33 33 */ -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/IElevationProfileSelectionListener.java
r23721 r23795 1 /** 2 * This program is free software: you can redistribute it and/or modify it under 3 * the terms of the GNU General Public License as published by the 4 * Free Software Foundation, either version 3 of the License, or 5 * (at your option) any later version. 6 * 7 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 8 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 9 * See the GNU General Public License for more details. 10 * 11 * You should have received a copy of the GNU General Public License along with this program. 12 * If not, see <http://www.gnu.org/licenses/>. 13 */ 1 14 package org.openstreetmap.josm.plugins.elevation.gui; 2 15 -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/TextAlignment.java
r23709 r23795 16 16 17 17 /** 18 * @author Oliver 18 * @author Oliver Wieland <oliver.wieland@online.de> 19 19 * 20 20 */ -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/Triangle.java
r23709 r23795 26 26 27 27 /** 28 * @author Oliver 29 * 30 */ 31 /* 32 * Class to represent a Triangle. Implementing the java.awt.Shape inteface. 28 * @author Oliver Wieland <oliver.wieland@online.de> 29 * Class to represent a triangle shape. {@see java.awt.Shape}. 33 30 */ 34 31 public class Triangle implements Shape { 35 32 private Polygon poly; 36 33 34 /** 35 * Copy constructor. 36 * @param p 37 */ 37 38 public Triangle(Polygon p) { 39 if (p == null || p.npoints != 3) throw new RuntimeException("Given polygon was null or had invalid number of points"); 38 40 poly = p; 39 41 } 40 42 43 /** 44 * Creates a triangle from 3 given points. The points are used without any sanity check, so it is up to 45 * the user that the points form a triangle. 46 * @param p1 47 * @param p2 48 * @param p3 49 */ 41 50 public Triangle(Point p1, Point p2, Point p3) { 42 51 poly = new Polygon(); … … 46 55 } 47 56 57 /** 58 * Draws an outlined triangle. 59 * @param g 60 */ 48 61 public void draw(Graphics g) { 49 62 g.drawPolygon(poly); 50 63 } 51 64 65 /** 66 * Draws a filled triangle. 67 * @param g 68 */ 52 69 public void fill(Graphics g) { 53 70 g.fillPolygon(poly); 54 71 } 55 72 56 // methods implemented from interface Shape 57 73 /* (non-Javadoc) 74 * @see java.awt.Shape#getBounds() 75 */ 58 76 public Rectangle getBounds() { 59 77 return poly.getBounds(); 60 78 } 61 79 80 /* (non-Javadoc) 81 * @see java.awt.Shape#getBounds2D() 82 */ 62 83 public Rectangle2D getBounds2D() { 63 84 return poly.getBounds2D(); 64 85 } 65 86 87 /* (non-Javadoc) 88 * @see java.awt.Shape#contains(double, double) 89 */ 66 90 public boolean contains(double x, double y) { 67 91 return poly.contains(x, y); 68 92 } 69 93 94 /* (non-Javadoc) 95 * @see java.awt.Shape#contains(java.awt.geom.Point2D) 96 */ 70 97 public boolean contains(Point2D p) { 71 98 return poly.contains(p); 72 99 } 73 100 101 /* (non-Javadoc) 102 * @see java.awt.Shape#intersects(double, double, double, double) 103 */ 74 104 public boolean intersects(double x, double y, double w, double h) { 75 105 return poly.intersects(x, y, w, h); 76 106 } 77 107 108 /* (non-Javadoc) 109 * @see java.awt.Shape#intersects(java.awt.geom.Rectangle2D) 110 */ 78 111 public boolean intersects(Rectangle2D r) { 79 112 return poly.intersects(r); 80 113 } 81 114 115 /* (non-Javadoc) 116 * @see java.awt.Shape#contains(double, double, double, double) 117 */ 82 118 public boolean contains(double x, double y, double w, double h) { 83 119 return poly.contains(x, y, w, h); 84 120 } 85 121 122 /* (non-Javadoc) 123 * @see java.awt.Shape#contains(java.awt.geom.Rectangle2D) 124 */ 86 125 public boolean contains(Rectangle2D r) { 87 126 return poly.intersects(r); 88 127 } 89 128 129 /* (non-Javadoc) 130 * @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform) 131 */ 90 132 public PathIterator getPathIterator(AffineTransform at) { 91 133 return poly.getPathIterator(at); 92 134 } 93 135 136 /* (non-Javadoc) 137 * @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform, double) 138 */ 94 139 public PathIterator getPathIterator(AffineTransform at, double flatness) { 95 140 return poly.getPathIterator(at, flatness); -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/TriangleDir.java
r23709 r23795 16 16 17 17 /** 18 * @author Oliver 18 * @author Oliver Wieland <oliver.wieland@online.de> 19 19 * 20 20 */
Note:
See TracChangeset
for help on using the changeset viewer.