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 TypeMethodDescriptionvoidactionPerformed(ActionEvent event) voidclear the selection of the MapGlyphvoidclearSelection(String name) remove the Selection with the name name from the selection listvoidclose()called when the Glyph is no longer held by the MapPanelvoidconnectAlignment(double tolerance) voidconnectElement(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) voidvoidcreateNodeEditDialog(StreamNode streamNode) voidvoidprotected voidbooleanvoidbooleandeleteNode(StreamNode node, boolean askConfirm) voiddraws the stream and its member glyphsvoidvoiddrawConformingString_new(Graphics g, MapScale scl, WorldLine line, String str, double coord) Draw string that follows the streamvoiddrawConformingString_old(Graphics g, MapScale scl, StreamElement stream, String str, double coord) Draw string that follows the streamvoiddrawJunction(Graphics g, MapScale scl, StreamJunction junc) voiddrawNode(Graphics g, MapScale scl, StreamNode node) protected voiddrawReach(Graphics g, MapScale scl, StreamElement reach) This method is calledvoiddrawSelectedJunction(Graphics g, MapScale scl, StreamJunction junc, boolean editing) voiddrawSelectedNode(Graphics g, MapScale scl, StreamNode node, boolean editing) protected voiddrawSelectedObject(Object obj, Graphics g) voiddrawSelectedReach(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 objectdoublegetBestInterval(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.booleangetShown()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 objectvoidinit()called when the MapGlyph is made active.booleanisShown()Gets whether this MapGlyph is currently drawn in the MapPanelbooleandoes the client app hold the write lock for this glyph?booleanjunctionPopupMenu(LocalPt pt, StreamJunction junc) booleannodePopupMenu(LocalPt pt, StreamNode node) booleanobjectDoubleClick(LocalPt pt, int modifiers) called when the user double clicks on the MapPanel.booleanobjectPopupMenu(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.booleanvoidresetStreamTics(StreamElement stream) selectElement(LocalPt pt, boolean add, boolean editing) selectElement(String name, boolean add, boolean editing) voidselectJunction(Graphics g, MapScale scl, StreamJunction junc, boolean add, boolean editing) voidselectNode(Graphics g, MapScale scl, StreamNode node, boolean editing) voidsetShown(boolean show) Sets whether this MapGlyph will draw in the MapPanelvoidshowMapElement(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, transformWorldToLocalArraysMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface hec.map.renderer.TracksRepaint
isRepaintNeeded, setRepaintNeeded
-
Constructor Details
-
StreamAlignmentGlyph
-
-
Method Details
-
getStreamAlignment
-
init
public void init()Description copied from class:MapGlyphcalled when the MapGlyph is made active. Any initialization should be performed here. -
deleteAction
protected void deleteAction() -
getDrawingProperties
-
popupMenu
-
getPopupPoint
-
junctionPopupMenu
-
nodePopupMenu
-
actionPerformed
- Specified by:
actionPerformedin 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:MapGlyphGets whether this MapGlyph is currently drawn in the MapPanel -
clearSelection
public void clearSelection()Description copied from class:MapGlyphclear the selection of the MapGlyph- Overrides:
clearSelectionin classMapGlyph
-
clearSelection
Description copied from class:MapGlyphremove the Selection with the name name from the selection list- Overrides:
clearSelectionin 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:MapGlyphcalled 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:
objectSelectin 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:MapGlyphshow or hide the Map Element glyphElement. This base class handled thehec.map.ModelDrawingAttributeSet.SHOWNflag- Overrides:
showMapElementin 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:MapGlyphSets whether this MapGlyph will draw in the MapPanel -
getShown
public boolean getShown() -
objectDoubleClick
Description copied from class:MapGlyphcalled 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:
objectDoubleClickin 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:MapGlyphcalled 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:
objectPopupMenuin 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:MapGlyphcalled when the Glyph is no longer held by the MapPanel -
getAttributeSet
Description copied from class:MapGlyphGets the AttributeSet of the MapGlyph object- Overrides:
getAttributeSetin classMapGlyph- Returns:
- The AttributeSet value
-
getToolTipText
Description copied from class:MapGlyphGets the ToolTipText of the MapGlyph object- Overrides:
getToolTipTextin 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:
isWriteLockedin 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:
-