Package hec.map.streamAlignment
Class StreamAlignmentGlyph
java.lang.Object
hec.map.MapGlyph
hec.map.streamAlignment.StreamAlignmentGlyph
- All Implemented Interfaces:
TracksRepaint
,ActionListener
,Comparable<MapGlyph>
,EventListener
-
Nested Class Summary
Nested classes/interfaces inherited from class hec.map.MapGlyph
MapGlyph.Selection
-
Field Summary
Fields inherited from class hec.map.MapGlyph
_changeEvent, _listenerList, _map, _mapIdentifier, _mapPanel, _paintOk, _parentGlyph, maxPtArraySz, needsRepaint, xarray, XOR_COLOR, yarray
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
actionPerformed
(ActionEvent event) void
clear the selection of the MapGlyphvoid
clearSelection
(String name) remove the Selection with the name name from the selection listvoid
close()
called when the Glyph is no longer held by the MapPanelvoid
connectAlignment
(double tolerance) void
connectElement
(StreamElement elem, LocalPt pt) createElement
(String streamName, StreamPolyLine streamPolyLine, double tolerance, boolean createJunctions) creates a new StreamElement based on the stream name, stream poly line, and world coord tolerance.createElement
(String name, Vector ptVec) creates a new stream element based on the given local pt vectorcreateElement
(Vector ptVec) void
void
createNodeEditDialog
(StreamNode streamNode) void
void
protected void
boolean
void
boolean
deleteNode
(StreamNode node, boolean askConfirm) void
draws the stream and its member glyphsvoid
void
drawConformingString_new
(Graphics g, MapScale scl, WorldLine line, String str, double coord) Draw string that follows the streamvoid
drawConformingString_old
(Graphics g, MapScale scl, StreamElement stream, String str, double coord) Draw string that follows the streamvoid
drawJunction
(Graphics g, MapScale scl, StreamJunction junc) void
drawNode
(Graphics g, MapScale scl, StreamNode node) protected void
drawReach
(Graphics g, MapScale scl, StreamElement reach) This method is calledvoid
drawSelectedJunction
(Graphics g, MapScale scl, StreamJunction junc, boolean editing) void
drawSelectedNode
(Graphics g, MapScale scl, StreamNode node, boolean editing) protected void
drawSelectedObject
(Object obj, Graphics g) void
drawSelectedReach
(Graphics g, MapScale scl, StreamElement lreg, boolean isXOR, boolean editing) findDownstreamNode
(StreamElement stream, LocalPt pt) findNearestReach
(WorldPt wpt) findReach
(int idx) findReach
(LocalPt pt, StreamElement rch0) Finds a reach at a point in Display World Coordinates.findStreamJunction
(int streamJunctionId) findStreamJunction
(StreamElement stream, LocalPt pt) look for a stream junction on the given stream near the given pointfindStreamNode
(StreamElement stream, LocalPt pt) look for a stream stream node on the given stream near the given pointfindUpstreamNode
(StreamElement stream, LocalPt pt) Gets the AttributeSet of the MapGlyph objectdouble
getBestInterval
(double delta) Find a nice tic interval for station markinggetConnectivityTo
(StreamElement start, double startStation, StreamElement end) get the connectivity from StreamElement start to StreamElement end.boolean
getShown()
getStreamSegmentsByNodes
(Vector nodeVec, Vector ndirVec, Vector segVec) develops a set of stream segments bounded by the given nodes, also determines whether the nodes are inflow points or outflow points relative to the bounded segments.getToolTipText
(WorldPt wpt, MouseEvent e) Gets the ToolTipText of the MapGlyph objectvoid
init()
called when the MapGlyph is made active.boolean
isShown()
Gets whether this MapGlyph is currently drawn in the MapPanelboolean
does the client app hold the write lock for this glyph?boolean
junctionPopupMenu
(LocalPt pt, StreamJunction junc) boolean
nodePopupMenu
(LocalPt pt, StreamNode node) boolean
objectDoubleClick
(LocalPt pt, int modifiers) called when the user double clicks on the MapPanel.boolean
objectPopupMenu
(LocalPt pt, int modifiers) called when the user right clicks on the map panel.objectSelect
(LocalPt pt, int modifiers) called when the user single clicks on the MapPanel.boolean
void
resetStreamTics
(StreamElement stream) selectElement
(LocalPt pt, boolean add, boolean editing) selectElement
(String name, boolean add, boolean editing) void
selectJunction
(Graphics g, MapScale scl, StreamJunction junc, boolean add, boolean editing) void
selectNode
(Graphics g, MapScale scl, StreamNode node, boolean editing) void
setShown
(boolean show) Sets whether this MapGlyph will draw in the MapPanelvoid
showMapElement
(String glyphName, String glyphElement, boolean show) show or hide the Map Element glyphElement.Methods inherited from class hec.map.MapGlyph
addChangeListener, addGlyphSelectionListener, checkXYArraySize, compareTo, containsSelection, drawConformingString, drawConformingString2, drawLine, drawLine, drawLine, drawLine, drawLine2D, drawRegion, drawRegion, fillMap, findGlyphOfClass, findObject, fireGlyphSelectionChanged, fireStateChanged, getBounds, getDataRecord, getDefaultDataRecord, getDescription, getGlyphLevel, getMap, getMapPanel, getMaximumScale, getMinimumScale, getName, getParentGlyph, getSelectedObject, getSelections, glyphVector, hasChildGlyphs, hasMap, intersects, isAltDown, isAttributeAvailable, isControlDown, isMetaDown, isPaintOk, isRepaintNeeded, isShiftDown, reInit, removeChangeListener, removeGlyphSelectionListener, setDataRecord, setGlyphLevel, setMap, setMapPanel, setMaximumScale, setMinimumScale, setPaintOk, setParentGlyph, setRepaintNeeded, shouldReturn, toString, transformArrays, transformLocalToWorldArrays, transformLookup, transformPoint, transformPointToLocal, transformPointToWorld, transformRect, transformRect, transformRectToLocal, transformWorldToLocalArrays
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface hec.map.renderer.TracksRepaint
isRepaintNeeded, setRepaintNeeded
-
Constructor Details
-
StreamAlignmentGlyph
-
-
Method Details
-
getStreamAlignment
-
init
public void init()Description copied from class:MapGlyph
called when the MapGlyph is made active. Any initialization should be performed here. -
deleteAction
protected void deleteAction() -
getDrawingProperties
-
popupMenu
-
getPopupPoint
-
junctionPopupMenu
-
nodePopupMenu
-
actionPerformed
- Specified by:
actionPerformed
in interfaceActionListener
-
creatingJunctionEditingDialog
public void creatingJunctionEditingDialog() -
creatingJunctionEditingDialog
-
createNodeEditDialog
public void createNodeEditDialog() -
createNodeEditDialog
-
resetStreamTics
-
deleteAll
public boolean deleteAll() -
deleteNode
public void deleteNode() -
deleteNode
-
isShown
public boolean isShown()Description copied from class:MapGlyph
Gets whether this MapGlyph is currently drawn in the MapPanel -
clearSelection
public void clearSelection()Description copied from class:MapGlyph
clear the selection of the MapGlyph- Overrides:
clearSelection
in classMapGlyph
-
clearSelection
Description copied from class:MapGlyph
remove the Selection with the name name from the selection list- Overrides:
clearSelection
in classMapGlyph
- Parameters:
name
- the name of the object to remove
-
draw
draws the stream and its member glyphs -
selectJunction
public void selectJunction(Graphics g, MapScale scl, StreamJunction junc, boolean add, boolean editing) -
drawSelectedJunction
-
selectNode
-
drawSelectedNode
-
selectElement
-
objectSelect
Description copied from class:MapGlyph
called when the user single clicks on the MapPanel. If the MapGlyph can process the event successfully then it should return true. Otherwise the MapPanel will pass the event to the next MapGlyph.- Overrides:
objectSelect
in classMapGlyph
- Parameters:
pt
- the location that the single click took placemodifiers
- the MouseEvent Modifiers. Useful to see if the Shift/Control/Alt keys were pressed- Returns:
- The object at pt. this class always returns false
-
selectElement
-
createElement
public StreamElement createElement(String streamName, StreamPolyLine streamPolyLine, double tolerance, boolean createJunctions) creates a new StreamElement based on the stream name, stream poly line, and world coord tolerance. -
createElement
-
createElement
creates a new stream element based on the given local pt vector- Parameters:
name
-ptVec
-- Returns:
-
connectElement
-
connectAlignment
public void connectAlignment(double tolerance) -
drawJunction
-
drawNode
-
drawReach
This method is called- Parameters:
g
-scl
-reach
-
-
drawSelectedReach
public void drawSelectedReach(Graphics g, MapScale scl, StreamElement lreg, boolean isXOR, boolean editing) -
findNearestReach
-
findNearestReach
-
findReach
-
findReach
Finds a reach at a point in Display World Coordinates.- Parameters:
wpt
-- Returns:
-
findReach
-
findReach
-
findReach
-
drawArrow
-
getBestInterval
public double getBestInterval(double delta) Find a nice tic interval for station marking- Parameters:
delta
-- Returns:
-
drawConformingString_new
public void drawConformingString_new(Graphics g, MapScale scl, WorldLine line, String str, double coord) Draw string that follows the stream- Parameters:
g
-scl
-line
-str
-coord
-
-
drawConformingString_old
public void drawConformingString_old(Graphics g, MapScale scl, StreamElement stream, String str, double coord) Draw string that follows the stream -
findStreamJunction
look for a stream junction on the given stream near the given point -
findStreamNode
look for a stream stream node on the given stream near the given point- Returns:
-
findDownstreamNode
-
findUpstreamNode
-
showMapElement
Description copied from class:MapGlyph
show or hide the Map Element glyphElement. This base class handled thehec.map.ModelDrawingAttributeSet.SHOWN
flag- Overrides:
showMapElement
in classMapGlyph
- Parameters:
glyphName
- the name of the MapGlyph or child MapGlyphsglyphElement
- the Map Element toshow
- true to show glyphElement
-
setShown
public void setShown(boolean show) Description copied from class:MapGlyph
Sets whether this MapGlyph will draw in the MapPanel -
getShown
public boolean getShown() -
objectDoubleClick
Description copied from class:MapGlyph
called when the user double clicks on the MapPanel. If the MapGlyph can process the event successfully then it should return true. Otherwise the MapPanel will pass the event to the next MapGlyph.- Overrides:
objectDoubleClick
in classMapGlyph
- Parameters:
pt
- the location that the right click took placemodifiers
- the MouseEvent Modifiers. Useful to see if the Shift/Control/Alt keys were pressed- Returns:
- true if the MapGlyph has handled this event. this class always returns false
-
objectPopupMenu
Description copied from class:MapGlyph
called when the user right clicks on the map panel. If the MapGlyph can process the event successfully then it should return true. Otherwise the MapPanel will pass the event to the next MapGlyph.- Overrides:
objectPopupMenu
in classMapGlyph
- Parameters:
pt
- the location that the right click took placemodifiers
- the MouseEvent Modifiers. Useful to see if the Shift/Control/Alt keys were pressed- Returns:
- true if the MapGlyph has handled this event. this class always returns false
-
drawSelectedObject
-
close
public void close()Description copied from class:MapGlyph
called when the Glyph is no longer held by the MapPanel -
getAttributeSet
Description copied from class:MapGlyph
Gets the AttributeSet of the MapGlyph object- Overrides:
getAttributeSet
in classMapGlyph
- Returns:
- The AttributeSet value
-
getToolTipText
Description copied from class:MapGlyph
Gets the ToolTipText of the MapGlyph object- Overrides:
getToolTipText
in classMapGlyph
- Parameters:
wpt
- the WorldPt location of the mouse cursore
- the MouseEvent- Returns:
- The ToolTipText at wpt
-
getStreamSegmentsByNodes
develops a set of stream segments bounded by the given nodes, also determines whether the nodes are inflow points or outflow points relative to the bounded segments. An error message is returned if the set of nodes do not form a closed pool. -
isWriteLocked
public boolean isWriteLocked()does the client app hold the write lock for this glyph?- Overrides:
isWriteLocked
in classMapGlyph
- Returns:
- true if the Application holds the write lock for this glyph's data
-
getConnectivityTo
get the connectivity from StreamElement start to StreamElement end. If there is no connectivity then an empty list is returned. start must be upstream of end.- Parameters:
start
-end
-- Returns:
- a List of StreamSegments
-
findStreamJunction
- Parameters:
streamJunctionId
-- Returns:
-