Class StreamAlignmentGlyph

java.lang.Object
hec.map.MapGlyph
hec.map.streamAlignment.StreamAlignmentGlyph
All Implemented Interfaces:
TracksRepaint, ActionListener, Comparable<MapGlyph>, EventListener

public class StreamAlignmentGlyph extends MapGlyph implements ActionListener, TracksRepaint

  • Constructor Details

  • Method Details

    • getStreamAlignment

      public StreamAlignmentIfc getStreamAlignment()
    • init

      public void init()
      Description copied from class: MapGlyph
      called when the MapGlyph is made active. Any initialization should be performed here.
      Overrides:
      init in class MapGlyph
    • deleteAction

      protected void deleteAction()
    • getDrawingProperties

      public StreamAlignmentDPData getDrawingProperties()
    • popupMenu

      public boolean popupMenu(LocalPt pt)
    • getPopupPoint

      public LocalPt getPopupPoint()
    • junctionPopupMenu

      public boolean junctionPopupMenu(LocalPt pt, StreamJunction junc)
    • nodePopupMenu

      public boolean nodePopupMenu(LocalPt pt, StreamNode node)
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Specified by:
      actionPerformed in interface ActionListener
    • creatingJunctionEditingDialog

      public void creatingJunctionEditingDialog()
    • creatingJunctionEditingDialog

      public void creatingJunctionEditingDialog(StreamJunction junc)
    • createNodeEditDialog

      public void createNodeEditDialog()
    • createNodeEditDialog

      public void createNodeEditDialog(StreamNode streamNode)
    • resetStreamTics

      public void resetStreamTics(StreamElement stream)
    • deleteAll

      public boolean deleteAll()
    • deleteNode

      public void deleteNode()
    • deleteNode

      public boolean deleteNode(StreamNode node, boolean askConfirm)
    • isShown

      public boolean isShown()
      Description copied from class: MapGlyph
      Gets whether this MapGlyph is currently drawn in the MapPanel

      Overrides:
      isShown in class MapGlyph
      Returns:
      true if this MapGlyph is drawing in the MapPanel
    • clearSelection

      public void clearSelection()
      Description copied from class: MapGlyph
      clear the selection of the MapGlyph
      Overrides:
      clearSelection in class MapGlyph
    • clearSelection

      public void clearSelection(String name)
      Description copied from class: MapGlyph
      remove the Selection with the name name from the selection list

      Overrides:
      clearSelection in class MapGlyph
      Parameters:
      name - the name of the object to remove
    • draw

      public void draw(Graphics g, MapScale scl)
      draws the stream and its member glyphs
      Specified by:
      draw in class MapGlyph
      Parameters:
      g - the Graphics to draw to
      scl - The current MapScale
    • selectJunction

      public void selectJunction(Graphics g, MapScale scl, StreamJunction junc, boolean add, boolean editing)
    • drawSelectedJunction

      public void drawSelectedJunction(Graphics g, MapScale scl, StreamJunction junc, boolean editing)
    • selectNode

      public void selectNode(Graphics g, MapScale scl, StreamNode node, boolean editing)
    • drawSelectedNode

      public void drawSelectedNode(Graphics g, MapScale scl, StreamNode node, boolean editing)
    • selectElement

      public StreamElement selectElement(String name, boolean add, boolean editing)
    • objectSelect

      public NamedType objectSelect(LocalPt pt, int modifiers)
      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 class MapGlyph
      Parameters:
      pt - the location that the single click took place
      modifiers - 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

      public StreamElement selectElement(LocalPt pt, boolean add, boolean editing)
    • 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

      public StreamElement createElement(Vector ptVec)
    • createElement

      public StreamElement createElement(String name, Vector ptVec)
      creates a new stream element based on the given local pt vector

      Parameters:
      name -
      ptVec -

      Returns:
    • connectElement

      public void connectElement(StreamElement elem, LocalPt pt)
    • connectAlignment

      public void connectAlignment(double tolerance)
    • drawJunction

      public void drawJunction(Graphics g, MapScale scl, StreamJunction junc)
    • drawNode

      public void drawNode(Graphics g, MapScale scl, StreamNode node)
    • drawReach

      protected void drawReach(Graphics g, MapScale scl, StreamElement reach)
      This method is called

      Parameters:
      g -
      scl -
      reach -
    • drawSelectedReach

      public void drawSelectedReach(Graphics g, MapScale scl, StreamElement lreg, boolean isXOR, boolean editing)
    • findNearestReach

      public StreamElement findNearestReach(WorldPt wpt)
    • findNearestReach

      public StreamElement findNearestReach(LocalPt pt)
    • findReach

      public StreamElement findReach(LocalPt pt)
    • findReach

      public StreamElement findReach(WorldPt wpt)
      Finds a reach at a point in Display World Coordinates.

      Parameters:
      wpt -

      Returns:
    • findReach

      public StreamElement findReach(LocalPt pt, StreamElement rch0)
    • findReach

      public StreamElement findReach(String name)
    • findReach

      public StreamElement findReach(int idx)
    • drawArrow

      public void drawArrow(Graphics g, MapScale scl, WorldPt loc, WorldPt wslope)
    • 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

      public StreamJunction findStreamJunction(StreamElement stream, LocalPt pt)
      look for a stream junction on the given stream near the given point
    • findStreamNode

      public StreamNode findStreamNode(StreamElement stream, LocalPt pt)
      look for a stream stream node on the given stream near the given point

      Returns:
    • findDownstreamNode

      public StreamNode findDownstreamNode(StreamElement stream, LocalPt pt)
    • findUpstreamNode

      public StreamNode findUpstreamNode(StreamElement stream, LocalPt pt)
    • showMapElement

      public void showMapElement(String glyphName, String glyphElement, boolean show)
      Description copied from class: MapGlyph
      show or hide the Map Element glyphElement. This base class handled the hec.map.ModelDrawingAttributeSet.SHOWN flag

      Overrides:
      showMapElement in class MapGlyph
      Parameters:
      glyphName - the name of the MapGlyph or child MapGlyphs
      glyphElement - the Map Element to
      show - true to show glyphElement
    • setShown

      public void setShown(boolean show)
      Description copied from class: MapGlyph
      Sets whether this MapGlyph will draw in the MapPanel

      Overrides:
      setShown in class MapGlyph
      Parameters:
      show - true if the MapGlyph is to draw
    • getShown

      public boolean getShown()
    • objectDoubleClick

      public boolean objectDoubleClick(LocalPt pt, int modifiers)
      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 class MapGlyph
      Parameters:
      pt - the location that the right click took place
      modifiers - 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

      public boolean objectPopupMenu(LocalPt pt, int modifiers)
      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 class MapGlyph
      Parameters:
      pt - the location that the right click took place
      modifiers - 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

      protected void drawSelectedObject(Object obj, Graphics g)
    • close

      public void close()
      Description copied from class: MapGlyph
      called when the Glyph is no longer held by the MapPanel
      Overrides:
      close in class MapGlyph
    • getAttributeSet

      public ModelDrawingAttributeSet getAttributeSet()
      Description copied from class: MapGlyph
      Gets the AttributeSet of the MapGlyph object

      Overrides:
      getAttributeSet in class MapGlyph
      Returns:
      The AttributeSet value
    • getToolTipText

      public String getToolTipText(WorldPt wpt, MouseEvent e)
      Description copied from class: MapGlyph
      Gets the ToolTipText of the MapGlyph object

      Overrides:
      getToolTipText in class MapGlyph
      Parameters:
      wpt - the WorldPt location of the mouse cursor
      e - the MouseEvent

      Returns:
      The ToolTipText at wpt
    • getStreamSegmentsByNodes

      public String 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. 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 class MapGlyph
      Returns:
      true if the Application holds the write lock for this glyph's data
    • getConnectivityTo

      public List getConnectivityTo(StreamElement start, double startStation, StreamElement end)
      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

      public StreamJunction findStreamJunction(int streamJunctionId)
      Parameters:
      streamJunctionId -
      Returns: