Class FeatureRange

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

public class FeatureRange extends Object implements CgviewConstants
This class is used to assign sequence features, which are described using the Feature object, to specific bases of a DNA sequence. FeatureRange objects inherit most of their attributes from the parent Feature object.
Author:
Paul Stothard
  • Constructor Details

    • FeatureRange

      public FeatureRange(Feature feature, int start, int stop)
      Constructs a new FeatureRange object. The start and stop positions refer to the direct strand. If the start is greater than the stop , the feature is assumed to extend from the start, across the end of the sequence, to the stop. If start equals stop, the FeatureRange is assumed to refer to a single base.
      Parameters:
      feature - the Feature object to contain this FeatureRange.
      start - the first base in this FeatureRange.
      stop - the last base in this FeatureRange.
  • Method Details

    • getStart

      public int getStart()
      Returns the position of the first base in this FeatureRange.
      Returns:
      the position of the first base in this FeatureRange.
    • getStop

      public int getStop()
      Returns the position of the last base in this FeatureRange.
      Returns:
      the position of the last base in this FeatureRange.
    • setForceLabel

      public void setForceLabel(boolean forceLabel)
      Specifies whether or not labels created for this FeatureRange should be drawn even if they cannot be placed such that they do not clash with other labels.
      Parameters:
      forceLabel - a boolean specifying whether or not to draw labels for this FeatureRange even if they cannot be placed such that they do not clash with other labels.
    • getForceLabel

      public boolean getForceLabel()
      Returns a boolean specifying whether or not labels created for this FeatureRange should be drawn even if they cannot be placed such that they do not clash with other labels.
      Returns:
      whether or not to draw labels for this FeatureRange even if they cannot be placed such that they do not clash with other labels.
    • draw

      protected void draw(Cgview cgview, double radius, float thickness, double minimumFeatureLength)
      Draws this FeatureRange and creates a label if necessary.
      Parameters:
      cgview - the Cgview object that contains this FeatureRange.
      radius - the radius of the FeatureSlot that contains this FeatureRange.
      thickness - the thickness of the FeatureSlot that contains this FeatureRange.
    • setShowLabel

      public void setShowLabel(int showLabel)
      Sets whether or not a label a should be drawn for this FeatureRange.
      Parameters:
      showLabel - CgviewConstants.LABEL, CgviewConstants.NO_LABEL, or CgviewConstants.LABEL_FORCE.
    • getShowLabel

      public int getShowLabel()
      Returns whether or not a label should be generated for this FeatureRange when drawn.
      Returns:
      CgviewConstants.LABEL, CgviewConstants.NO_LABEL, or CgviewConstants.LABEL_FORCE.
    • setDecoration

      public void setDecoration(int decoration)
      Sets the type of decoration added to this FeatureRange when drawn.
      Parameters:
      decoration - CgviewConstants.DECORATION_STANDARD, CgviewConstants.DECORATION_COUNTERCLOCKWISE_ARROW, CgviewConstants.DECORATION_CLOCKWISE_ARROW, CgviewConstants.DECORATION_HIDDEN.
    • getDecoration

      public int getDecoration()
      Returns an integer indicating what type of decoration will be added to this FeatureRange when drawn.
      Returns:
      CgviewConstants.DECORATION_STANDARD, CgviewConstants.DECORATION_COUNTERCLOCKWISE_ARROW, CgviewConstants.DECORATION_CLOCKWISE_ARROW, CgviewConstants.DECORATION_HIDDEN.
    • setLabel

      public void setLabel(String label)
      Sets the label text for this FeatureRange.
      Parameters:
      label - the label for this FeatureRange.
    • getLabel

      public String getLabel()
      Returns the label text for this FeatureRange.
      Returns:
      the label for this FeatureRange.
    • setRadiusAdjustment

      public void setRadiusAdjustment(float radiusAdjustment)
      Sets the position of this FeatureRange relative to the FeatureSlot object that contains it. This value is only applied when the thickness of this FeatureRange is adjusted using setProportionOfThickness(float) or Feature.setProportionOfThickness(float).
      Parameters:
      radiusAdjustment - between 0 and 1, with 1 being near the edge furthest from the map center.
    • getRadiusAdjustment

      public float getRadiusAdjustment()
      Returns the position of this FeatureRange relative to the FeatureSlot object that contains it. This value is only applied when the thickness of this FeatureRange is adjusted using setProportionOfThickness(float) or Feature.setProportionOfThickness(float).
      Returns:
      a float between 0 and 1, with 1 being near the edge furthest from the map center.
      See Also:
    • setProportionOfThickness

      public void setProportionOfThickness(float proportionOfThickness)
      Sets the thickness of this FeatureRange when drawn, as a proportion of the thickness of the FeatureSlot containing this Feature.
      Parameters:
      proportionOfThickness - between 0 and 1, with 1 being full thickness.
    • getProportionOfThickness

      public float getProportionOfThickness()
      Returns the thickness of this FeatureRange when drawn, as a proportion of the thickness of the FeatureSlot containing this FeatureRange.
      Returns:
      a float between 0 and 1, with 1 being full thickness.
    • setOpacity

      public void setOpacity(float opacity)
      Sets the opacity of this FeatureRange when drawn.
      Parameters:
      opacity - the opacity between 0 and 1, with 1 being the most opaque.
    • getOpacity

      public float getOpacity()
      Returns the opacity of this FeatureRange when drawn.
      Returns:
      the opacity between 0 and 1, with 1 being the most opaque.
    • setColor

      public void setColor(Color color)
      Sets the color of this FeatureRange when drawn.
      Parameters:
      color - the color of this FeatureRange when drawn.
    • getColor

      public Color getColor()
      Returns the color of this FeatureRange when drawn.
      Returns:
      the color of this FeatureRange when drawn.
    • setFont

      public void setFont(Font font)
      Sets the font used for the label generated for this FeatureRange.
      Parameters:
      font - the font used for the label generated for this FeatureRange.
    • getFont

      public Font getFont()
      Returns the font used for the label generated for this FeatureRange.
      Returns:
      the font used for the label generated for this FeatureRange.
    • setShowShading

      public void setShowShading(boolean showShading)
      Sets whether or not this FeatureRange should be drawn with shading.
      Parameters:
      showShading - whether or not this FeatureRange should be drawn with shading.
    • getShowShading

      public boolean getShowShading()
      Returns whether or not this FeatureRange should be drawn with shading.
      Returns:
      whether or not this FeatureRange should be drawn with shading.
    • setHyperlink

      public void setHyperlink(String hyperlink)
      Specifies a hyperlink to be associated with this FeatureRange. Hyperlinks are included in SVG output generated using CgviewIO.writeToSVGFile(ca.ualberta.stothard.cgview.Cgview, java.lang.String, boolean, boolean) or in image maps for PNG and JPG images generated using CgviewIO.writeHTMLFile(ca.ualberta.stothard.cgview.Cgview, java.lang.String, java.lang.String, java.lang.String).
      Parameters:
      hyperlink - a hyperlink for this FeatureRange.
    • getHyperlink

      public String getHyperlink()
      Returns the hyperlink to be associated with this Feature.
      Returns:
      the hyperlink for this Feature.
    • setMouseover

      public void setMouseover(String mouseover)
      Specifies a mouseover to be associated with this FeatureRange. Mouseovers are included in SVG output generated using CgviewIO.writeToSVGFile(ca.ualberta.stothard.cgview.Cgview, java.lang.String, boolean, boolean) or in image maps for PNG and JPG images generated using CgviewIO.writeHTMLFile(ca.ualberta.stothard.cgview.Cgview, java.lang.String, java.lang.String, java.lang.String).
      Parameters:
      mouseover - the mouseover for this featureRange.
    • getMouseover

      public String getMouseover()
      Returns the mouseover to be associated with this FeatureRange.
      Returns:
      the mouseover for this FeatureRange.