Package org.openstreetmap.josm.data.gpx
Class GpxTrack
java.lang.Object
org.openstreetmap.josm.data.gpx.WithAttributes
org.openstreetmap.josm.data.gpx.GpxTrack
- All Implemented Interfaces:
GpxConstants,IGpxTrack,IWithAttributes
GPX track.
Note that the color attributes are not immutable and may be modified by the user.
- Since:
- 15496
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openstreetmap.josm.data.gpx.GpxConstants
GpxConstants.ColorFormatNested classes/interfaces inherited from interface org.openstreetmap.josm.data.gpx.IGpxTrack
IGpxTrack.GpxTrackChangeEvent, IGpxTrack.GpxTrackChangeListener -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Boundsprivate Colorprivate GpxConstants.ColorFormatprivate final doubleprivate final ListenerList<IGpxTrack.GpxTrackChangeListener>private final List<IGpxTrackSegment>Fields inherited from class org.openstreetmap.josm.data.gpx.WithAttributes
attrFields inherited from interface org.openstreetmap.josm.data.gpx.GpxConstants
EXTENSION_ABBREVIATIONS, FIX_VALUES, GARMIN_COLORS, GPX_CMT, GPX_DESC, GPX_NAME, GPX_PREFIX, GPX_SRC, JOSM_CREATOR_NAME, META_AUTHOR_EMAIL, META_AUTHOR_LINK, META_AUTHOR_NAME, META_BOUNDS, META_COPYRIGHT_AUTHOR, META_COPYRIGHT_LICENSE, META_COPYRIGHT_YEAR, META_DESC, META_KEYWORDS, META_LINKS, META_NAME, META_PREFIX, META_TIME, PT_AGEOFDGPSDATA, PT_COURSE, PT_DGPSID, PT_ELE, PT_FIX, PT_GEOIDHEIGHT, PT_HDOP, PT_MAGVAR, PT_PDOP, PT_SAT, PT_STD_HDEV, PT_STD_VDEV, PT_SYM, PT_TIME, PT_TYPE, PT_VDOP, RTE_TRK_KEYS, RTKLIB_AGE, RTKLIB_Q, RTKLIB_RATIO, RTKLIB_SDE, RTKLIB_SDEU, RTKLIB_SDN, RTKLIB_SDNE, RTKLIB_SDU, RTKLIB_SDUN, WPT_KEYS, XML_URI_EXTENSIONS_DRAWING, XML_URI_EXTENSIONS_GARMIN, XML_URI_EXTENSIONS_JOSM, XML_URI_XSD, XML_XSD_EXTENSIONS_DRAWING, XML_XSD_EXTENSIONS_GARMIN, XML_XSD_EXTENSIONS_JOSM -
Constructor Summary
ConstructorsConstructorDescriptionGpxTrack(Collection<Collection<WayPoint>> trackSegs, Map<String, Object> attributes) Constructs a newGpxTrack.Constructs a newGpxTrackfromGpxTrackSegmentobjects. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a listener that listens to changes in the GPX track.private Boundsprivate doubleprivate doublevoidconvertColor(GpxConstants.ColorFormat cFormat) Converts the color to the given format, if present.booleanprivate voidReturns the track bounds.getColor()Gets the color of this track.private ColorReturns the track segments.inthashCode()voidResets the color cachedoublelength()Returns the track length.voidPut a key / value pair as a new attribute.voidRemove a listener that listens to changes in the GPX track.voidSets the color of this track.private voidsetColorExtensionGPXD(Color color, boolean invalidate) Methods inherited from class org.openstreetmap.josm.data.gpx.WithAttributes
get, getAttributes, getCollection, getExtensions, getString, hasExtensionsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openstreetmap.josm.data.gpx.IWithAttributes
get, getAttributes, getCollection, getExtensions, getString, hasExtensions
-
Field Details
-
segments
-
length
-
bounds
-
colorCache
-
listeners
-
closestGarminColorCache
-
colorFormat
-
-
Constructor Details
-
GpxTrack
Constructs a newGpxTrack.- Parameters:
trackSegs- track segmentsattributes- track attributes
-
GpxTrack
Constructs a newGpxTrackfromGpxTrackSegmentobjects.- Parameters:
trackSegs- The segments to build the track from. Input is not deep-copied, which means the caller may reuse the same segments to build multiple GpxTrack instances from. This should not be a problem, since this object cannot modifythis.segments.attributes- Attributes for the GpxTrack, the input map is copied.
-
-
Method Details
-
calculateLength
-
calculateBounds
-
setColor
Description copied from interface:IGpxTrackSets the color of this track. Not necessarily supported by all implementations. -
setColorExtensionGPXD
-
getColor
Description copied from interface:IGpxTrackGets the color of this track. -
getColorFromExtension
-
convertColor
Converts the color to the given format, if present.- Parameters:
cFormat- can be aGpxConstants.ColorFormat
-
colorDist
-
put
Description copied from class:WithAttributesPut a key / value pair as a new attribute. Overrides key / value pair with the same key (if present).- Specified by:
putin interfaceIWithAttributes- Overrides:
putin classWithAttributes- Parameters:
key- the keyvalue- the value
-
fireInvalidate
-
getBounds
Description copied from interface:IGpxTrackReturns the track bounds. -
length
Description copied from interface:IGpxTrackReturns the track length. -
getSegments
Description copied from interface:IGpxTrackReturns the track segments.- Specified by:
getSegmentsin interfaceIGpxTrack- Returns:
- the track segments
-
hashCode
- Overrides:
hashCodein classWithAttributes
-
equals
- Overrides:
equalsin classWithAttributes
-
addListener
Description copied from interface:IGpxTrackAdd a listener that listens to changes in the GPX track.- Specified by:
addListenerin interfaceIGpxTrack- Parameters:
l- The listener
-
removeListener
Description copied from interface:IGpxTrackRemove a listener that listens to changes in the GPX track.- Specified by:
removeListenerin interfaceIGpxTrack- Parameters:
l- The listener
-
invalidate
Resets the color cache
-