Package hec.map.image

Class ImageGlyphProxy

All Implemented Interfaces:
IImageGlyph, ImageObserver, Comparable<MapGlyph>

public class ImageGlyphProxy extends ImageGlyph implements IImageGlyph
  • Constructor Details

    • ImageGlyphProxy

      public ImageGlyphProxy()
    • ImageGlyphProxy

      public ImageGlyphProxy(MapPanel panel, ImageMap map)
  • Method Details

    • adjustFinished

      public void adjustFinished()
      Description copied from class: ImageGlyph
      This is called when a series of adjustments are finished. This allows the glyph to hold off on the expensive paints until elements that are calling "adjustImage()" are done with their work.
      Specified by:
      adjustFinished in interface IImageGlyph
      Overrides:
      adjustFinished in class ImageGlyph
    • adjustImage

      public void adjustImage(DragPoint dragPoint, Point PT0, Point PT1)
      Specified by:
      adjustImage in interface IImageGlyph
      Overrides:
      adjustImage in class ImageGlyph
    • getDragPoints

      public List<DragPoint> getDragPoints()
      Specified by:
      getDragPoints in interface IImageGlyph
      Overrides:
      getDragPoints in class ImageGlyph
    • imageUpdate

      public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height)
      Specified by:
      imageUpdate in interface ImageObserver
      Overrides:
      imageUpdate in class ImageGlyph
    • getImageGlyphDataRecord

      protected ImageGlyphDataRecord getImageGlyphDataRecord()
      Overrides:
      getImageGlyphDataRecord in class ImageGlyph
    • compareTo

      public int compareTo(MapGlyph o)
      Specified by:
      compareTo in interface Comparable<MapGlyph>
      Overrides:
      compareTo in class MapGlyph
    • getParentGlyph

      public MapGlyph getParentGlyph()
      Overrides:
      getParentGlyph in class MapGlyph
    • setParentGlyph

      public void setParentGlyph(MapGlyph glyph)
      Overrides:
      setParentGlyph in class MapGlyph
    • saveImageCoordinates

      public void saveImageCoordinates()
      Specified by:
      saveImageCoordinates in interface IImageGlyph
      Overrides:
      saveImageCoordinates in class ImageGlyph
    • scaleTransform

      protected void scaleTransform(AffineTransform af, MapScale scl)
      Overrides:
      scaleTransform in class ImageGlyph
    • addChangeListener

      public void addChangeListener(ChangeListener cl)
      Description copied from class: MapGlyph
      Adds a feature to the ChangeListener attribute of the MapGlyph object

      Overrides:
      addChangeListener in class MapGlyph
      Parameters:
      cl - The feature to be added to the ChangeListener attribute
    • addGlyphSelectionListener

      public void addGlyphSelectionListener(GlyphSelectionListener msl)
      Description copied from class: MapGlyph
      Adds a feature to the GlyphSelectionListener attribute of the MapGlyph object

      Overrides:
      addGlyphSelectionListener in class MapGlyph
      Parameters:
      msl - The feature to be added to the GlyphSelectionListener attribute
    • 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
    • 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
    • containsSelection

      public boolean containsSelection(Object object)
      Overrides:
      containsSelection in class MapGlyph
    • drawConformingString

      public void drawConformingString(Graphics g, MapScale scl, WorldLine line, String str, double coord, int baseoffset, Font font, Color color, int bank, float priority)
      Description copied from class: MapGlyph
      Draw string rotated to best fit location on a line

      Overrides:
      drawConformingString in class MapGlyph
      Parameters:
      g - the Graphics to draw to
      scl - the Current MapScale
      line - the line to fit the string to
      str - the string to draw
      coord - the location relative to the line to draw.
      baseoffset - the offset from line to draw str
      font - the Font to render str with
      color - the foreground color to render str with
      bank - the side of line to draw the string on
      priority - the Priority to give to this string. -1 means to always draw.

      See Also:
    • drawConformingString2

      public void drawConformingString2(Graphics g, MapScale scl, WorldLine line, String str, double coord, Font font, Color color, int bank)
      Description copied from class: MapGlyph
      Draw string that follows the line

      Overrides:
      drawConformingString2 in class MapGlyph
      Parameters:
      g - the Graphics to draw to
      scl - the Current MapScale
      line - the line to fit the string to
      str - the string to draw
      coord - the location relative to the line to draw.
      font - the Font to render str with
      color - the foreground color to render str with
      bank - the side of line to draw the string on

      See Also:
    • drawLine

      public void drawLine(Graphics g, WorldLine line, MapScale scl, double halfwidth, Color fillColor, Color outlineColor)
      Overrides:
      drawLine in class MapGlyph
    • drawLine

      public void drawLine(Graphics g, WorldLine line, MapScale scl, double halfwidth, Color fillColor, Color outlineColor, boolean drawPoints, Color pointColor, int halfPointSize)
      Description copied from class: MapGlyph
      draw the line on the map. This will draw the line in chunks if the line is too large.  If the outline color is specified, and the line gets drawn in segments where the segments meet there will be a line between them.

      Overrides:
      drawLine in class MapGlyph
      Parameters:
      g - The Graphics context to draw on
      line - The WorldLine to draw
      scl - The MapScale
      halfwidth - the width of the line
      fillColor - the Fill Color. NULL to not fill the line
      outlineColor - The outlineColor. NULL for no outline
    • drawLine

      public void drawLine(Graphics g, WorldLine line, MapScale scl, double halfwidth, Color fillColor, Color outlineColor, boolean drawPoints, Color pointColor, int halfPointSize, boolean isXOR)
      Overrides:
      drawLine in class MapGlyph
    • drawLine

      public void drawLine(Graphics g, WorldLine line, MapScale scl, double halfwidth, Color fillColor, Color outlineColor, boolean drawPoints, Color pointColor, int halfPointSize, boolean isXOR, float alpha)
      Overrides:
      drawLine in class MapGlyph
    • drawLine2D

      public void drawLine2D(Graphics g, WorldLine line, MapScale scl, double halfwidth, Color fillColor, Color outlineColor, boolean drawPoints, Color pointColor, int halfPointSize, boolean isXOR)
      Description copied from class: MapGlyph
      draw the line using graphics 2d

      Overrides:
      drawLine2D in class MapGlyph
    • drawRegion

      public void drawRegion(Graphics g, MapScale scl, WorldRegion region, boolean drawPts, Color outline, Color fill)
      Overrides:
      drawRegion in class MapGlyph
    • fillMap

      public void fillMap(boolean load)
      Description copied from class: MapGlyph
      have the _map load or unload its data.

      Overrides:
      fillMap in class ImageGlyph
      Parameters:
      load - true if _map is load it's data
    • findGlyphOfClass

      public MapGlyph findGlyphOfClass(String classname)
      Description copied from class: MapGlyph
      finds the MapGlyph of type classname in the list of child MapGlyphs

      Overrides:
      findGlyphOfClass in class MapGlyph
      Parameters:
      classname - the classname of the child MapGlyphs

      Returns:
      the child MapGlyph with the class of classname
    • findObject

      public NamedType findObject(LocalPt pt)
      Description copied from class: MapGlyph
      find the NamedType object held by this MapGlyph that resides as LocalPt pt.

      Overrides:
      findObject in class MapGlyph
      Parameters:
      pt - the LocalPt to find an Object at

      Returns:
      the NamedType Object at pt.
    • 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
    • getBounds

      public WorldRect getBounds()
      Description copied from class: MapGlyph
      Gets the Bounds of the MapGlyph object

      Specified by:
      getBounds in interface IImageGlyph
      Overrides:
      getBounds in class MapGlyph
      Returns:
      The Bounds value
    • getDataRecord

      public GlyphDataRecord getDataRecord()
      Description copied from class: MapGlyph
      Gets the DataRecord of the MapGlyph's MapIdentifier object

      Overrides:
      getDataRecord in class MapGlyph
      Returns:
      The DataRecord value
    • getDefaultDataRecord

      public GlyphDataRecord getDefaultDataRecord()
      Description copied from class: MapGlyph
      Gets the DefaultDataRecord of the MapGlyph object

      Overrides:
      getDefaultDataRecord in class ImageGlyph
      Returns:
      null unless overridden to return something else
    • getGlyphLevel

      public float getGlyphLevel()
      Overrides:
      getGlyphLevel in class MapGlyph
    • getMap

      public MapObjectInterface getMap()
      Description copied from class: MapGlyph
      Gets the MapObjectInterface that this MapGlyph is drawing

      Specified by:
      getMap in interface IImageGlyph
      Overrides:
      getMap in class MapGlyph
      Returns:
      The Map value
    • getMapPanel

      public MapPanel getMapPanel()
      Description copied from class: MapGlyph
      Gets the MapPanel of the MapGlyph object

      Specified by:
      getMapPanel in interface IImageGlyph
      Overrides:
      getMapPanel in class MapGlyph
      Returns:
      The MapPanel value
    • getMaximumScale

      public int getMaximumScale()
      Specified by:
      getMaximumScale in interface IImageGlyph
      Overrides:
      getMaximumScale in class MapGlyph
    • getMinimumScale

      public int getMinimumScale()
      Specified by:
      getMinimumScale in interface IImageGlyph
      Overrides:
      getMinimumScale in class MapGlyph
    • getName

      public String getName()
      Description copied from class: MapGlyph
      Gets the Name of the MapGlyph object

      Overrides:
      getName in class MapGlyph
      Returns:
      The Name value
    • getSelectedObject

      public NamedType getSelectedObject()
      Description copied from class: MapGlyph
      override to return the selected glyph object

      Overrides:
      getSelectedObject in class MapGlyph
      Returns:
      The Selected Object
    • getSelections

      public NamedType[] getSelections()
      Description copied from class: MapGlyph
      override to return more than a wrapper around getSelectedObject()

      Overrides:
      getSelections in class MapGlyph
      Returns:
      the first selected object.
    • 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
    • glyphVector

      public Vector glyphVector()
      Description copied from class: MapGlyph
      get the MapGlyph's list of child MapGlyphs

      Overrides:
      glyphVector in class MapGlyph
      Returns:
      the Vector of child MapGlyphs
    • hasChildGlyphs

      public boolean hasChildGlyphs()
      Description copied from class: MapGlyph
      get whether this glyph contains child glyphs

      Overrides:
      hasChildGlyphs in class MapGlyph
      Returns:
      true if the MapGlyph holds child MapGlyphs
    • hasMap

      public boolean hasMap()
      Description copied from class: MapGlyph
      return whether the MapGlyph has a MapObjectInterface

      Overrides:
      hasMap in class MapGlyph
      Returns:
      true if _map != null
    • intersects

      public boolean intersects(Graphics2D graphics, MapScale scl, int[] xarray, int[] yarray, int numpts)
      Description copied from class: MapGlyph
      return whether the line intersects with the scale

      Overrides:
      intersects in class MapGlyph
      scl - the MapScale

      Returns:
      true if any of the point in the line intersect with the current scale
    • isAttributeAvailable

      public boolean isAttributeAvailable(String s)
      Description copied from class: MapGlyph
      Gets the AttributeAvailable attribute of the MapGlyph object

      Overrides:
      isAttributeAvailable in class MapGlyph
      Parameters:
      s - Description

      Returns:
      The AttributeAvailable value
    • 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
    • isWriteLocked

      public boolean isWriteLocked()
      Description copied from class: MapGlyph
      does the Application hold the write lock for this glyph data

      Overrides:
      isWriteLocked in class MapGlyph
      Returns:
      true if the Application holds the write lock for this glyph's data
    • 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
    • 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
    • removeChangeListener

      public void removeChangeListener(ChangeListener cl)
      Description copied from class: MapGlyph
      retmove the ChangeListener cl from the _listenerList

      Overrides:
      removeChangeListener in class MapGlyph
      Parameters:
      cl - Description
    • removeGlyphSelectionListener

      public void removeGlyphSelectionListener(GlyphSelectionListener msl)
      Description copied from class: MapGlyph
      remove the GlyphSelectionListener msl from the _listenerList

      Overrides:
      removeGlyphSelectionListener in class MapGlyph
      Parameters:
      msl - the GlyphSelectionListener to remove
    • setDataRecord

      public void setDataRecord(GlyphDataRecord rec)
      Description copied from class: MapGlyph
      Sets the DataRecord of the MapGlyph's MapIdentifier

      Overrides:
      setDataRecord in class MapGlyph
      Parameters:
      rec - The new DataRecord value
    • setGlyphLevel

      public void setGlyphLevel(float glyphLevel)
      Overrides:
      setGlyphLevel in class MapGlyph
    • setMap

      public void setMap(MapObjectInterface map)
      Description copied from class: MapGlyph
      Sets the MapObjectInterface of the MapGlyph object

      Overrides:
      setMap in class MapGlyph
      Parameters:
      map - The new Map value
    • setMapPanel

      public void setMapPanel(MapPanel panel)
      Description copied from class: MapGlyph
      Sets the MapPanel of the MapGlyph object

      Overrides:
      setMapPanel in class MapGlyph
      Parameters:
      panel - The new MapPanel value
    • setMaximumScale

      public void setMaximumScale(int maxScale)
      Specified by:
      setMaximumScale in interface IImageGlyph
      Overrides:
      setMaximumScale in class MapGlyph
    • setMinimumScale

      public void setMinimumScale(int minScale)
      Specified by:
      setMinimumScale in interface IImageGlyph
      Overrides:
      setMinimumScale in class MapGlyph
    • setShown

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

      Overrides:
      setShown in class MapGlyph
      Parameters:
      shown - true if the MapGlyph is to draw
    • 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
    • toString

      public String toString()
      Description copied from class: MapGlyph
      return's the string representation of this MapGlyph. By Default it's the name of the _map's MapIdentifier

      Overrides:
      toString in class MapGlyph
      Returns:
      the name of this MapGlyph
    • draw

      public void draw(Graphics graphics, MapScale scl)
      Description copied from class: MapGlyph
      draw this MapGlyph to graphics using the MapScale scl

      Overrides:
      draw in class ImageGlyph
      Parameters:
      graphics - the Graphics to draw to
      scl - The current MapScale
    • isAdjustmentEnabled

      public boolean isAdjustmentEnabled()
      Specified by:
      isAdjustmentEnabled in interface IImageGlyph
      Overrides:
      isAdjustmentEnabled in class ImageGlyph
    • setAdjustmentEnabled

      public void setAdjustmentEnabled(boolean b)
      Specified by:
      setAdjustmentEnabled in interface IImageGlyph
      Overrides:
      setAdjustmentEnabled in class ImageGlyph