Class OuterLabel

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

public class OuterLabel 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 outside of the sequence backbone.
Author:
Paul Stothard
  • Constructor Details

    • OuterLabel

      protected OuterLabel(Cgview cgview, String labelText, String hyperlink, String mouseover, Font font, Color color, boolean forceLabel, double lineStartRadians, int strand)
      Constructs a new OuterLabel 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 this 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 this Label.
      strand - the strand of this Label (CgviewConstants.DIRECT_STRAND or CgviewConstants.REVERSE_STRAND).
    • OuterLabel

      protected OuterLabel(InnerLabel innerLabel)
      Constructs a new OuterLabel object from an InnerLabel object, and adds the new OuterLabel to the parent Cgview object. This method is used to convert an InnerLabel to an OuterLabel.
      Parameters:
      innerLabel - the innerLabel object to convert to an outerLabel.
  • Method Details

    • clashesWithAny

      protected boolean clashesWithAny()
      Returns a boolean specifying whether or not this Label 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 final boolean extendRadius()
      Attempts to move this Label by extending its radius value. If this Label is already at the edge of the canvas 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 completely fit inside of the map canvas.
      Specified by:
      fitsInBackground in class Label
      Returns:
      a boolean specifying whether this label can completely fit inside of the map canvas.