|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jimmc.treepar.Box
Box is the primary visual object in a Layout. The following fields in the Box object must be set: name, size, text, textPosition.
Layout
Field Summary | |
protected Connector[] |
connectors
Our connectors. |
protected java.util.Vector |
connectorVector
|
protected Layout |
layout
The layout we are a part of. |
protected java.lang.String |
name
The name of this box. |
protected boolean |
orderSet
True when the row ordering has been set for this box. |
protected java.awt.Point |
origin
The location of the lower left corner of the box. |
protected boolean |
positionSet
True after we have fixed the position of the box in the row. |
protected Row |
row
The row containing this box. |
protected int |
rowNumber
The row number for this box. |
protected boolean |
rowNumberSet
True when rowNumber has been set. |
protected int |
rowOrder
The ordering of this box within its row. |
protected java.awt.Dimension |
size
The size of the box. |
protected java.lang.String |
text
The text to display inside the box. |
protected java.lang.String[] |
textLines
The text split up into single lines. |
protected java.awt.Point |
textPosition
The position of the text within the box. |
Constructor Summary | |
Box(Layout layout,
java.lang.String name)
Create a new Box in a layout. |
Method Summary | |
protected void |
addConnector(Connector connector)
Add a connector to this box. |
protected void |
addNetForce(int side,
int[] forcesums)
Add in the force data for all of the connectors on the specified side of the box. |
protected void |
addToBounds(BoundsRectangle bounds)
Increase the bounds if necessary to include this box. |
protected void |
clearRowNumber()
Clear the row number and pointer for the box. |
protected void |
clearRowOrder()
Clear the row ordering of this box. |
protected void |
connectorsDone()
Create the array of connectors from the vector. |
protected boolean |
contains(int x,
int y)
True if the box contains the specified point. |
protected int |
countLines(java.lang.String s)
Count the number of newlines found in the string. |
protected int |
countWidth(java.lang.String s)
Count the length of the longest line. |
static void |
dump(java.io.PrintWriter f,
Box[] boxes,
java.lang.String prefix,
boolean details)
Dump an array of boxes. |
void |
dump(java.io.PrintWriter f,
java.lang.String prefix,
boolean details)
Dump a box for debugging. |
protected LayoutHitText |
getHitText(int x,
int y)
Find the text at the specified point. |
protected int |
getLength()
Get the length of this box. |
protected int |
getR()
Get the R coordinat. |
protected int |
getThickness()
Get the thickness of this box. |
protected boolean |
isPositionSet()
Return true if the positionSet flag has been set. |
protected boolean |
isRowOrderSet()
Return true if the row order has already been set on this box. |
protected void |
moveR(int d)
Change the R coordinate of this box. |
protected void |
paint(LayoutGraphics g)
Draw the box. |
protected void |
setConnectorsRowOrder(int side,
boolean negdir)
Set the ordering on the connectors on the specified side of this box. |
protected void |
setPositionSet(boolean b)
Set the positionSet flag. |
protected void |
setR(int d)
Set the R coordinate as specified. |
protected void |
setRow(Row row)
Set the row for the box. |
void |
setRowNumber(int rowNum)
Set the row number for the box. |
protected void |
setRowOrder(boolean negdir)
Set the row ordering of this box and neighbors. |
protected void |
setS()
Set the S coordinate of this box to the same as its row. |
void |
setSize(int width,
int height)
Set the size of the Box. |
void |
setText(java.lang.String text)
Set the text inside the Box. |
void |
setTextPosition(int x,
int y)
Set the location of the text relative to the box origin. |
void |
setupDone()
Call this method when setup on this box is done, after all connectors have been added. |
protected void |
textDone()
Create the array of text lines from the text string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Layout layout
protected java.lang.String name
protected java.awt.Dimension size
protected java.lang.String text
protected java.awt.Point textPosition
protected Connector[] connectors
protected java.util.Vector connectorVector
protected java.lang.String[] textLines
protected int rowNumber
protected boolean rowNumberSet
protected Row row
protected int rowOrder
protected boolean orderSet
protected java.awt.Point origin
protected boolean positionSet
Constructor Detail |
public Box(Layout layout, java.lang.String name)
Method Detail |
public void setSize(int width, int height)
public void setText(java.lang.String text)
public void setTextPosition(int x, int y)
protected void addConnector(Connector connector)
public void setupDone()
protected void connectorsDone()
protected void textDone()
protected int getThickness()
protected int getLength()
protected void clearRowNumber()
public void setRowNumber(int rowNum)
protected void setRow(Row row)
protected void setR(int d)
protected int getR()
protected void moveR(int d)
d
- the amount to add to the R coordinate.protected void setS()
protected void clearRowOrder()
protected void setRowOrder(boolean negdir)
negdir
- if set, expand in the negative direction.protected boolean isRowOrderSet()
protected void setPositionSet(boolean b)
protected boolean isPositionSet()
protected void setConnectorsRowOrder(int side, boolean negdir)
side
- the side of the box out of which connectors
we propagate to the network.negdir
- true means new items are added to the lesser
end of the row.protected void addNetForce(int side, int[] forcesums)
side
- ignore connectors not on this side of the box.forcesums
- [0] is the force sum, [1] is the count.
We add to these two numbers.protected void addToBounds(BoundsRectangle bounds)
protected int countLines(java.lang.String s)
protected int countWidth(java.lang.String s)
protected void paint(LayoutGraphics g)
protected boolean contains(int x, int y)
protected LayoutHitText getHitText(int x, int y)
public void dump(java.io.PrintWriter f, java.lang.String prefix, boolean details)
public static void dump(java.io.PrintWriter f, Box[] boxes, java.lang.String prefix, boolean details)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |