Class InnerLabel

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

public class InnerLabel extends Label implements CgviewConstants
This class is used by Cgview objects to facilitate label layout and drawing. The labels represented by this class are drawn on the inside of the sequence backbone.
Author:
Paul Stothard
  • Constructor Details

    • InnerLabel

      protected InnerLabel(Cgview cgview, String labelText, String hyperlink, String mouseover, Font font, Color color, boolean forceLabel, double lineStartRadians, int strand)
      Constructs a new InnerLabel object.
      Parameters:
      cgview - the Cgview object to contain this Label.
      labelText - the text that is to be drawn.
      hyperlink - a hyperlink to be associated with this Label.
      mouseover - mouseover information to be associated with this Label.
      font - the font to use when drawing this Label.
      color - the color to use when drawing the Label.
      forceLabel - whether or not this Label should be drawn even if it cannot be placed such that it does not clash with other labels.
      lineStartRadians - the angle in radians of the line extending from the feature to the label.
      strand - the strand of this Label (CgviewConstants.DIRECT_STRAND or CgviewConstants.REVERSE_STRAND).
  • Method Details

    • clashesWithAny

      protected boolean clashesWithAny()
      Returns a boolean specifying whether or not this Label currently clashes with other Label objects in the Cgview object containing this Label.
      Specified by:
      clashesWithAny in class Label
      Returns:
      a boolean specifying whether or not this Label clashes with other Labels.
    • drawLabelLine

      protected void drawLabelLine()
      Draws a line joining the feature to this Label.
      Specified by:
      drawLabelLine in class Label
    • drawLabelText

      protected void drawLabelText()
      Draws the text portion of this Label.
      Specified by:
      drawLabelText in class Label
    • updateBounds

      protected void updateBounds()
      Recalculates the rectangle that represents the bounds of this Label.
      Specified by:
      updateBounds in class Label
    • updateBounds

      protected void updateBounds(double padding)
      Recalculates the rectangle that represents the bounds of this Label.
      Specified by:
      updateBounds in class Label
      Parameters:
      padding - the amount of padding to add to the bounds box.
    • extendRadius

      protected boolean extendRadius()
      Attempts to move this Label by increasing its radius value. If this Label cannot be moved without introducing a new conflict for space, it is not moved.
      Specified by:
      extendRadius in class Label
      Returns:
      a boolean specifing whether or not this Label was moved.
    • setLineStartRadius

      protected void setLineStartRadius(double lineStartRadius)
      Specifies radius of the innermost point in the line extending from the feature to this Label.
      Specified by:
      setLineStartRadius in class Label
      Parameters:
      lineStartRadius - the radius of the innermost point in the line extending from the feature to this Label.
    • fitsInBackground

      protected boolean fitsInBackground()
      Returns a boolean specifying whether or not this Label can fit inside of the map canvas.
      Specified by:
      fitsInBackground in class Label
      Returns:
      a boolean specifying whether or not this Label can fit inside of the map canvas.