Class LabelBounds

java.lang.Object
ca.ualberta.stothard.cgview.LabelBounds
All Implemented Interfaces:
CgviewConstants

public class LabelBounds extends Object implements CgviewConstants
This class is used to store bounds information about text already drawn on a Cgview map. The information stored in this class can be used to implement label mouseovers and hyperlinks.
Author:
Paul Stothard
  • Constructor Details

    • LabelBounds

      protected LabelBounds(Cgview cgview)
      Constructs a new LabelBounds object.
      Parameters:
      cgview - the Cgview object to contain this LabelBounds.
  • Method Details

    • setBounds

      protected void setBounds(Rectangle2D bounds)
      Specifies the bounds of this LabelBounds.
      Parameters:
      bounds - the bounds of the label.
    • getBounds

      public Rectangle2D getBounds()
      Returns a rectangle that represents the bounds of this LabelBounds.
      Returns:
      the bounds of the label.
    • setLabel

      protected void setLabel(String label)
      Specifies the text that gave rise to this LabelBounds.
      Parameters:
      label - the text that gave rise to this LabelBounds.
    • getLabel

      public String getLabel()
      Returns the text that gave rise to this LabelBounds.
      Returns:
      the text gave rise to this LabelBounds.
    • setHyperlink

      protected void setHyperlink(String hyperlink)
      Specifies a hyperlink to be associated with this LabelBounds.
      Parameters:
      hyperlink - a hyperlink to be associated with this LabelBounds.
    • getHyperlink

      public String getHyperlink()
      Returns the hyperlink associated with this LabelBounds.
      Returns:
      the hyperlink associated with this LabelBounds.
    • setMouseover

      protected void setMouseover(String mouseover)
      Specifies a mouseover to be associated with this LabelBounds.
      Parameters:
      mouseover - a mouseover to be associated with this LabelBounds.
    • getMouseover

      public String getMouseover()
      Returns the mouseover associated with this LabelBounds.
      Returns:
      the mouseover associated with this LabelBounds.
    • setUse

      public void setUse(boolean use)
      Sets whether or not this LabelBounds should be used.
      Parameters:
      use - whether or not this LabelBounds should be used.
    • getUse

      public boolean getUse()
      Returns whether or not this LabelBounds should be used.
      Returns:
      whether or not this LabelBounds should be used.
    • setType

      protected void setType(int type)
      Specifies what map object this LabelBounds represents.
      Parameters:
      type - CgviewConstants.BOUNDS_RULER, CgviewConstants.BOUNDS_FEATURE, of CgviewConstants.BOUNDS_BUTTON.
    • getType

      public int getType()
      Returns the type of this LabelBounds.
      Returns:
      CgviewConstants.BOUNDS_RULER, CgviewConstants.BOUNDS_FEATURE, of CgviewConstants.BOUNDS_BUTTON.
    • setBase

      protected void setBase(int base)
      Specifies which sequence position this LabelBounds is closest to.
      Parameters:
      base - the sequence position.
    • getBase

      public int getBase()
      Returns the sequence position closest to this LabelBounds.
      Returns:
      the sequence position closest to this LabelBounds.