Package ca.ualberta.stothard.cgview
Class LabelBounds
java.lang.Object
ca.ualberta.stothard.cgview.LabelBounds
- All Implemented Interfaces:
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
-
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
ModifierConstructorDescriptionprotected
LabelBounds
(Cgview cgview) Constructs a new LabelBounds object. -
Method Summary
Modifier and TypeMethodDescriptionint
getBase()
Returns the sequence position closest to this LabelBounds.Returns a rectangle that represents the bounds of this LabelBounds.Returns the hyperlink associated with this LabelBounds.getLabel()
Returns the text that gave rise to this LabelBounds.Returns the mouseover associated with this LabelBounds.int
getType()
Returns the type of this LabelBounds.boolean
getUse()
Returns whether or not this LabelBounds should be used.protected void
setBase
(int base) Specifies which sequence position this LabelBounds is closest to.protected void
setBounds
(Rectangle2D bounds) Specifies the bounds of this LabelBounds.protected void
setHyperlink
(String hyperlink) Specifies a hyperlink to be associated with this LabelBounds.protected void
Specifies the text that gave rise to this LabelBounds.protected void
setMouseover
(String mouseover) Specifies a mouseover to be associated with this LabelBounds.protected void
setType
(int type) Specifies what map object this LabelBounds represents.void
setUse
(boolean use) Sets whether or not this LabelBounds should be used.
-
Constructor Details
-
LabelBounds
Constructs a new LabelBounds object.- Parameters:
cgview
- the Cgview object to contain this LabelBounds.
-
-
Method Details
-
setBounds
Specifies the bounds of this LabelBounds.- Parameters:
bounds
- the bounds of the label.
-
getBounds
Returns a rectangle that represents the bounds of this LabelBounds.- Returns:
- the bounds of the label.
-
setLabel
Specifies the text that gave rise to this LabelBounds.- Parameters:
label
- the text that gave rise to this LabelBounds.
-
getLabel
Returns the text that gave rise to this LabelBounds.- Returns:
- the text gave rise to this LabelBounds.
-
setHyperlink
Specifies a hyperlink to be associated with this LabelBounds.- Parameters:
hyperlink
- a hyperlink to be associated with this LabelBounds.
-
getHyperlink
Returns the hyperlink associated with this LabelBounds.- Returns:
- the hyperlink associated with this LabelBounds.
-
setMouseover
Specifies a mouseover to be associated with this LabelBounds.- Parameters:
mouseover
- a mouseover to be associated with this LabelBounds.
-
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
, ofCgviewConstants.BOUNDS_BUTTON
.
-
getType
public int getType()Returns the type of this LabelBounds. -
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.
-