Package hec.map

Class MapLabelItem


public class MapLabelItem extends MapTextObject
MapLabelItem class used by MapCanvas to prevent cluttering of text on screen
  • Field Details

  • Constructor Details

    • MapLabelItem

      public MapLabelItem(String txt, int x, int y, int pos, int iconWidth, int iconHeight, float priority, Font font, Color fg, Color bg, boolean drawBorder, Graphics g)
      Create a new MapLabelItem object
      Parameters:
      txt - the text to display
      x - the x position
      y - the y position
      pos - the position NORTH, SOURTH etc
      iconWidth - the width of the icon
      iconHeight - the height of the icon
      priority - the priority. -1 always draw. otherwise higher priority takes precidence of lower when labels overlap
      font - the font to use
      fg - the foreground color
      bg - the background color
      drawBorder - whether to draw a border or not
      g - the graphics context to draw in
    • MapLabelItem

      public MapLabelItem(String txt, int x, int y, int pos, int size, float priority, Font font, Color fg, Color bg, Graphics g)
      Create a new MapLabelItem object
      Parameters:
      txt - the text to display
      x - the x position
      y - the y position
      pos - the position NORTH, SOURTH etc
      size - the icon size
      priority - the priority. -1 always draw. otherwise higher priority takes precidence of lower when labels overlap * @param font the font to use
      fg - the foreground color
      bg - the background color
      g - the graphics context to draw in
    • MapLabelItem

      public MapLabelItem(String txt, int x, int y, float priority, Font font, Color fg, Color bg, Graphics g)
      Create a new MapLabelItem object
      Parameters:
      txt - the text to display
      x - the x position
      y - the y position
      priority - the priority. -1 always draw. otherwise higher priority takes precidence of lower when labels overlap
      font - the font to use
      fg - the foreground color
      bg - the background color
      g - the graphics context to draw in
    • MapLabelItem

      public MapLabelItem(String txt, int x, int y, int pos, int offset, float priority, Font font, Color fg, Color bg, boolean drawBorder, Graphics g)
      Create a new MapLabelItem object
      Parameters:
      txt - the text to display
      x - the x position
      y - the y position
      pos - the position NORTH, SOURTH etc
      offset -
      priority - the priority. -1 always draw. otherwise higher priority takes precidence of lower when labels overlap
      font - the font to use
      fg - the foreground color
      bg - the background color
      drawBorder - whether to draw a border or not
      g - the graphics context to draw in
  • Method Details

    • intersects

      public boolean intersects(MapTextObject obj)
      Method Description
      Overrides:
      intersects in class MapTextObject
      Parameters:
      obj - Description
      Returns:
      Description
    • getBounds

      public LocalRect getBounds()
      Gets the Bounds attribute of the MapLabelItem object
      Specified by:
      getBounds in class MapTextObject
      Returns:
      The Bounds value
    • getLocalRect

      public LocalRect getLocalRect()
      Gets the LocalRect attribute of the MapLabelItem object
      Returns:
      The LocalRect value
    • getLocalRect

      public LocalRect getLocalRect(LocalRect rc)
      Gets the LocalRect attribute of the MapLabelItem object
      Parameters:
      rc - Description
      Returns:
      The LocalRect value
    • draw

      public void draw(Graphics g)
      Method Description
      Specified by:
      draw in class MapTextObject
      Parameters:
      g - Description
    • getText

      public String getText()
      Gets the Text attribute of the MapLabelItem object
      Returns:
      The Text value