public class LineCollection extends java.util.TreeMap<java.lang.String,LabeledLine>
LineCollection
class holds an ordered set of
line objects. Each line encodes information about which line it
is and what line segments it contains. The line collection is
used as a convenient interface for adding segments to a set of
lines, and then iterating over the lines for rendering.Constructor and Description |
---|
LineCollection()
Creates a new empty collection of lines.
|
Modifier and Type | Method and Description |
---|---|
void |
addSegment(java.lang.String textLabel,
EarthImageTransform trans,
DataLocation start,
DataLocation end)
Adds a line segment to the collection.
|
void |
addSegment(java.lang.String textLabel,
EarthImageTransform trans,
EarthLocation start,
EarthLocation end)
Adds a line segment to the collection.
|
java.util.List<TextElement> |
getLabels(java.awt.Dimension imageDims,
LineLabelFactory labelFactory)
Gets the labels for this collection of lines.
|
void |
render(java.awt.Graphics2D g)
Renders this collection of lines.
|
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, forEach, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, replace, replace, replaceAll, size, subMap, subMap, tailMap, tailMap, values
public void addSegment(java.lang.String textLabel, EarthImageTransform trans, EarthLocation start, EarthLocation end)
textLabel
- the line text label, used as a key in the
collection.trans
- the earth image transform used for
translating earth locations to image points.start
- the starting earth location.end
- the ending earth location.public void addSegment(java.lang.String textLabel, EarthImageTransform trans, DataLocation start, DataLocation end)
textLabel
- the line text label, used as a key in the
collection.trans
- the earth image transform used for
translating data locations to image points.start
- the starting data location.end
- the ending Earthdata location.public void render(java.awt.Graphics2D g)
g
- the graphics device for rendering.public java.util.List<TextElement> getLabels(java.awt.Dimension imageDims, LineLabelFactory labelFactory)
imageDims
- the image dimensions.labelFactory
- the label factory to use for creating labels.