Changeset 2311 in josm for trunk/src/org/openstreetmap/josm/gui/dialogs/relation/WayConnectionType.java
- Timestamp:
- 2009-10-25T12:55:53+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/WayConnectionType.java
r2298 r2311 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 public enumWayConnectionType {6 public class WayConnectionType { 7 7 8 none("", tr("Not connected")), 9 head_to_head("-><-", tr("Last points of ways are connected")), 10 tail_to_tail("<-->", tr("First points of ways are connected")), 11 head_to_tail("->->", tr("First point of second way connects to last point of first way")), 12 tail_to_head("<-<-", tr("First point of first way connects to last point of second way")); 8 public final boolean connectedToPrevious; 9 public final boolean connectedToNext; 10 /** Is 1 if way has the same direction as the first way in the set of connected ways. Else it is (-1) */ 11 public final int direction; 12 /** The WayConnectionType is invalid, if the corresponding primitive is not a way or the way is incomplete */ 13 public final boolean invalid; 13 14 14 private String textSymbol; 15 private String toolTip; 16 17 WayConnectionType(String textSymbol, String toolTip) { 18 this.textSymbol = textSymbol; 19 this.toolTip = toolTip; 15 public WayConnectionType(boolean connectedToPrevious, boolean connectedToNext, int direction) { 16 this.connectedToPrevious = connectedToPrevious; 17 this.connectedToNext = connectedToNext; 18 this.direction = direction; 19 invalid = false; 20 20 } 21 21 22 @Override 23 public String toString() { 24 return textSymbol; 22 public WayConnectionType() { 23 connectedToPrevious = false; 24 connectedToNext = false; 25 direction = 1; 26 invalid = true; 25 27 } 26 28 29 // @Override 30 // public String toString() { 31 // return ... 32 // } 33 27 34 public String getToolTip() { 28 return toolTip; 35 if (invalid) { 36 return ""; 37 } 38 else if (connectedToPrevious && connectedToNext) { 39 return tr("way is connected"); 40 } 41 else if (connectedToPrevious) { 42 return tr("way is connected to previous relation member"); 43 } 44 else if (connectedToNext) { 45 return tr("way is connected to next relation member"); 46 } 47 else { 48 return tr("way is not connected to previous or next relation member"); 49 } 29 50 } 30 51 }
Note:
See TracChangeset
for help on using the changeset viewer.