Package ca.ualberta.stothard.cgview
Class FeatureRange
java.lang.Object
ca.ualberta.stothard.cgview.FeatureRange
- All Implemented Interfaces:
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
-
Field Summary
Fields inherited from interface ca.ualberta.stothard.cgview.CgviewConstants
BASES, BOUNDS_BUTTON, BOUNDS_FEATURE, BOUNDS_RULER, CENTISOMES, DECORATION_CLOCKWISE_ARROW, DECORATION_COUNTERCLOCKWISE_ARROW, DECORATION_HIDDEN, DECORATION_STANDARD, DIRECT_STRAND, INNER_LABELS_AUTO, INNER_LABELS_NO_SHOW, INNER_LABELS_SHOW, LABEL, LABEL_FORCE, LABEL_NONE, LABEL_ZOOMED, LEGEND_DRAW_ZOOMED, LEGEND_ITEM_ALIGN_CENTER, LEGEND_ITEM_ALIGN_LEFT, LEGEND_ITEM_ALIGN_RIGHT, LEGEND_LOWER_CENTER, LEGEND_LOWER_LEFT, LEGEND_LOWER_RIGHT, LEGEND_MIDDLE_CENTER, LEGEND_MIDDLE_LEFT, LEGEND_MIDDLE_LEFT_OF_CENTER, LEGEND_MIDDLE_RIGHT, LEGEND_MIDDLE_RIGHT_OF_CENTER, LEGEND_NO_DRAW_ZOOMED, LEGEND_UPPER_CENTER, LEGEND_UPPER_LEFT, LEGEND_UPPER_RIGHT, POSITIONS_AUTO, POSITIONS_NO_SHOW, POSITIONS_SHOW, REVERSE_STRAND, SWATCH_NO_SHOW, SWATCH_SHOW
-
Constructor Summary
ConstructorDescriptionFeatureRange
(Feature feature, int start, int stop) Constructs a newFeatureRange
object. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Draws this FeatureRange and creates a label if necessary.getColor()
Returns the color of this FeatureRange when drawn.int
Returns an integer indicating what type of decoration will be added to this FeatureRange when drawn.getFont()
Returns the font used for the label generated for this FeatureRange.boolean
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 the hyperlink to be associated with this Feature.getLabel()
Returns the label text for this FeatureRange.Returns the mouseover to be associated with this FeatureRange.float
Returns the opacity of this FeatureRange when drawn.float
Returns the thickness of this FeatureRange when drawn, as a proportion of the thickness of the FeatureSlot containing this FeatureRange.float
Returns the position of this FeatureRange relative to the FeatureSlot object that contains it.int
Returns whether or not a label should be generated for this FeatureRange when drawn.boolean
Returns whether or not this FeatureRange should be drawn with shading.int
getStart()
Returns the position of the first base in this FeatureRange.int
getStop()
Returns the position of the last base in this FeatureRange.void
Sets the color of this FeatureRange when drawn.void
setDecoration
(int decoration) Sets the type of decoration added to this FeatureRange when drawn.void
Sets the font used for the label generated for this FeatureRange.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.void
setHyperlink
(String hyperlink) Specifies a hyperlink to be associated with this FeatureRange.void
Sets the label text for this FeatureRange.void
setMouseover
(String mouseover) Specifies a mouseover to be associated with this FeatureRange.void
setOpacity
(float opacity) Sets the opacity of this FeatureRange when drawn.void
setProportionOfThickness
(float proportionOfThickness) Sets the thickness of this FeatureRange when drawn, as a proportion of the thickness of the FeatureSlot containing this Feature.void
setRadiusAdjustment
(float radiusAdjustment) Sets the position of this FeatureRange relative to the FeatureSlot object that contains it.void
setShowLabel
(int showLabel) Sets whether or not a label a should be drawn for this FeatureRange.void
setShowShading
(boolean showShading) Sets whether or not this FeatureRange should be drawn with shading.
-
Constructor Details
-
FeatureRange
Constructs a newFeatureRange
object. Thestart
andstop
positions refer to the direct strand. If thestart
is greater than thestop
, the feature is assumed to extend from the start, across the end of the sequence, to the stop. Ifstart
equalsstop
, 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
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
, orCgviewConstants.LABEL_FORCE
.
-
getShowLabel
public int getShowLabel()Returns whether or not a label should be generated for this FeatureRange when drawn. -
setDecoration
public void setDecoration(int decoration) Sets the type of decoration added to this FeatureRange when drawn. -
getDecoration
public int getDecoration()Returns an integer indicating what type of decoration will be added to this FeatureRange when drawn. -
setLabel
Sets the label text for this FeatureRange.- Parameters:
label
- the label for this FeatureRange.
-
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 usingsetProportionOfThickness(float)
orFeature.setProportionOfThickness(float)
.- Parameters:
radiusAdjustment
- between0
and1
, with1
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 usingsetProportionOfThickness(float)
orFeature.setProportionOfThickness(float)
.- Returns:
- a
float
between0
and1
, with1
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
- between0
and1
, with1
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
between0
and1
, with1
being full thickness.
-
setOpacity
public void setOpacity(float opacity) Sets the opacity of this FeatureRange when drawn.- Parameters:
opacity
- the opacity between0
and1
, with1
being the most opaque.
-
getOpacity
public float getOpacity()Returns the opacity of this FeatureRange when drawn.- Returns:
- the opacity between
0
and1
, with1
being the most opaque.
-
setColor
Sets the color of this FeatureRange when drawn.- Parameters:
color
- the color of this FeatureRange when drawn.
-
getColor
Returns the color of this FeatureRange when drawn.- Returns:
- the color of this FeatureRange when drawn.
-
setFont
Sets the font used for the label generated for this FeatureRange.- Parameters:
font
- the font used for the label generated for this FeatureRange.
-
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
Specifies a hyperlink to be associated with this FeatureRange. Hyperlinks are included in SVG output generated usingCgviewIO.writeToSVGFile(ca.ualberta.stothard.cgview.Cgview, java.lang.String, boolean, boolean)
or in image maps for PNG and JPG images generated usingCgviewIO.writeHTMLFile(ca.ualberta.stothard.cgview.Cgview, java.lang.String, java.lang.String, java.lang.String)
.- Parameters:
hyperlink
- a hyperlink for this FeatureRange.
-
getHyperlink
Returns the hyperlink to be associated with this Feature.- Returns:
- the hyperlink for this Feature.
-
setMouseover
Specifies a mouseover to be associated with this FeatureRange. Mouseovers are included in SVG output generated usingCgviewIO.writeToSVGFile(ca.ualberta.stothard.cgview.Cgview, java.lang.String, boolean, boolean)
or in image maps for PNG and JPG images generated usingCgviewIO.writeHTMLFile(ca.ualberta.stothard.cgview.Cgview, java.lang.String, java.lang.String, java.lang.String)
.- Parameters:
mouseover
- the mouseover for this featureRange.
-
getMouseover
Returns the mouseover to be associated with this FeatureRange.- Returns:
- the mouseover for this FeatureRange.
-