|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.olduvai.accordiondrawer.LabelBox
public class LabelBox
Axis-aligned bounding box class for label drawing. Stores information in screen coordintes, checks for overlap with other bounding boxes.
Field Summary | |
---|---|
private CellGeom |
attachedObject
Attached object for this label, if applicable. |
protected int[] |
bl
Bottom left coordinates, in pixels |
protected int[] |
blbg
Bottom left corner of the label box, shifted by the label buffer distance (the "real" bottom left corner) |
protected int[] |
center
Center of the label box, between bl and tr |
protected int[] |
extent
The size of the label box, from bl to tr |
protected int |
fontHeight
Font height in points |
protected int |
frameNum
Last frame in which this box is drawn |
private java.lang.String |
name
The string to draw as the label |
protected int[] |
tr
Top right coordinates, in pixels |
Constructor Summary | |
---|---|
LabelBox(int[] bottomLeft,
int[] topRight,
int[] bottomLeftBG,
int computedFrame,
java.lang.String name,
CellGeom attachedObject,
int fontHeight)
Label box constructor. |
Method Summary | |
---|---|
int |
bottomLeftPos(int xy)
Return a coordinate (in screen space) for the bottom or left edge of this box. |
int |
compareTo(java.lang.Object o)
Compare label boxes with another for vertical overlap (0 = overlap). |
CellGeom |
getAttachedObject()
Get the object that is attached to this label box. |
int |
getFontHeight()
Accessor for font height value for this label box. |
java.lang.String |
getName()
Accessor for the name (label) contained in this label box. |
boolean |
overlaps(LabelBox other,
int[] bufferSize)
Test for box overlap with another Label box. |
int |
size(int xy)
Returns the size of the label box, in the given dimension. |
int |
topRightPos(int xy)
Return a coordinate (in screen space) for the top or right edge of this box. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int[] bl
protected int[] tr
protected int[] blbg
protected int[] center
bl
and tr
protected int[] extent
bl
to tr
protected int frameNum
private java.lang.String name
private CellGeom attachedObject
protected int fontHeight
Constructor Detail |
---|
public LabelBox(int[] bottomLeft, int[] topRight, int[] bottomLeftBG, int computedFrame, java.lang.String name, CellGeom attachedObject, int fontHeight)
bottomLeft
- Bottom left corner of actual label box, not including buffers.topRight
- Top right corner of actual label box, not including buffers.bottomLeftBG
- Bottom left corner of buffer sounding label box.computedFrame
- Current frame for this label box.name
- String to be drawn in as the label.attachedObject
- The object attached to this label, if any.fontHeight
- Height of font used to draw string in points.Method Detail |
---|
public CellGeom getAttachedObject()
attachedObject
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- Label box to test for overlaps.
public int bottomLeftPos(int xy)
xy
- Either AccordionDrawer.X
for left edge or AccordionDrawer.Y
for bottom edge.
public int topRightPos(int xy)
xy
- Either AccordionDrawer.X
for right edge or AccordionDrawer.Y
for top edge.
public java.lang.String getName()
name
.public int size(int xy)
xy
- The dimension, either AccordionDrawer.X
or AccordionDrawer.Y
.
public int getFontHeight()
fontHeight
.public boolean overlaps(LabelBox other, int[] bufferSize)
other
- A second Label box to test for overlaps.
blbg
and tr
values of each
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |