|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectru.biosoft.graphics.View
ru.biosoft.graphics.CompositeView
Container for View objects.
| Field Summary | |
protected java.util.Vector |
children
Storage for child views |
protected static int |
DELTA
|
protected java.awt.Rectangle |
rect
Rectangle bound of this composite view |
static int |
REL
If this bit is cleared,then coordinates are used directly from x,y coordinates of view location |
static int |
X_CC
Arrange mode, view is arranged by center along X axis to the center along X axis of previous rectangle |
static int |
X_LC
Arrange mode, view is arranged by center along X axis to the left of previous rectangle |
static int |
X_LL
Arrange mode, view is arranged by left side to the left side of previous rectangle |
static int |
X_LR
Arrange mode, view is arranged by right side to the left side of previous rectangle |
static int |
X_RC
Arrange mode, view is arranged by center along X axis to the right of previous rectangle |
static int |
X_RL
Arrange mode, view is arranged by left side to the right of previous rectangle |
static int |
X_RR
Arrange mode, view is arranged by right side to the right side of previous rectangle |
static int |
X_UN
Arrange mode, X coordinate is get from x coordinate of view location |
static int |
Y_BB
Arrange mode, view is arranged by bottom side to the bottom of previous rectangle |
static int |
Y_BC
Arrange mode, view is arranged by center along Y axis to the bottom of previous rectangle |
static int |
Y_BT
Arrange mode, view is arranged by top side to the bottom of previous rectangle |
static int |
Y_CC
Arrange mode, view is arranged by center along Y axis to the center along Y axis of previous rectangle |
static int |
Y_TB
Arrange mode, view is arranged by bottom side to the top of previous rectangle |
static int |
Y_TC
Arrange mode, view is arranged by center along Y axis to the top of previous rectangle |
static int |
Y_TT
Arrange mode, view is arranged by top side to the top of previous rectangle |
static int |
Y_UN
Arrange mode, Y coordinate is get from y coordinate of view location |
| Fields inherited from class ru.biosoft.graphics.View |
ACTIVE, at, BASELINE, BOTTOM, CENTER, HIDE, LEFT, model, RIGHT, shape, TOP, type |
| Constructor Summary | |
CompositeView()
Constructs composite view |
|
| Method Summary | |
void |
add(View v)
Adds the view to the children list and corrects rectangle of composite view bound. |
void |
add(View v,
int mode)
Adds element with insets coordinates ( 0,0 ) |
void |
add(View v,
int mode,
java.awt.Point insets)
Adds new elements and arrange them relative the previous objects. |
View |
elementAt(int index)
Returns the view at the specified index. |
java.awt.Rectangle |
getBounds()
Returns rectangle bound of this composite view |
java.util.Enumeration |
getChildren()
Returns an enumeration of the views of this composite view. |
View |
getDeepestActive(java.awt.Point pt)
Returns deepest view in tree hierarchy, that has View.ACTIVE state and intersects the specified point. |
View |
getDeepestActive(java.awt.Point pt,
java.lang.Object[] ignoreModels,
java.lang.Class modelClass)
Returns deepest view in tree hierarchy, that has View.ACTIVE state and intersects the specified point. |
java.awt.Point |
getLocation()
Returns the location of this Rectangle bound. |
void |
insert(View v,
int i)
Inserts view in specified position. |
boolean |
intersects(java.awt.Rectangle rect)
Tests if this composite view bound intersects the interior of a specified rectangle. |
void |
move(int x,
int y)
Moves all children to the new location using specified offsets |
void |
paint(java.awt.Graphics2D g)
Paints this composite view on specified Graphics2D. |
protected boolean |
recursiveRemove(View v)
Tracer for remove |
boolean |
remove(View v)
Removes specified view from composite view |
void |
scale(double sx,
double sy)
Scales all children of container in relation to old values. |
int |
size()
Return size of composite view |
void |
updateBounds()
Synchronizes the Rectangle rectangle returned by getBounds()
with composite view. |
| Methods inherited from class ru.biosoft.graphics.View |
getModel, getShape, isActive, isVisible, move, setActive, setLocation, setLocation, setModel, setToScale, setVisible |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.awt.Rectangle rect
protected java.util.Vector children
public static final int REL
public static final int X_UN
public static final int X_RL
public static final int X_RC
public static final int X_RR
public static final int X_LL
public static final int X_LC
public static final int X_LR
public static final int X_CC
public static final int Y_UN
public static final int Y_TT
public static final int Y_TC
public static final int Y_TB
public static final int Y_BT
public static final int Y_BC
public static final int Y_BB
public static final int Y_CC
protected static final int DELTA
| Constructor Detail |
public CompositeView()
| Method Detail |
public java.util.Enumeration getChildren()
public void scale(double sx,
double sy)
scale in class Viewsx - the factor by which coordinates are scaled along the X axis directionsy - the factor by which coordinates are scaled along the Y axis direction
public void move(int x,
int y)
move in class Viewx - offset along the X axis direction.y - offset along the Y axis direction.public void updateBounds()
Rectangle rectangle returned by getBounds()
with composite view.
updateBounds in class Viewpublic View elementAt(int index)
public int size()
public void insert(View v,
int i)
throws java.lang.ArrayIndexOutOfBoundsException
v - inserted Viewi - target position
java.lang.ArrayIndexOutOfBoundsException - if the index was invalid.
public void add(View v,
int mode)
v - mode - add(View v, int mode, Point insets)
public void add(View v,
int mode,
java.awt.Point insets)
v - specified Viewmode - mode to arrange new element relative previous:
Abrevations:
X_RL | || | |--- boundary of new element | ---- boundary of minimal rectangle, described all | previous elements ------ x or y coordinate X - the x coordinate: L - left boundary of the object C - center of the object R - right boundary of the object Y - the y coordinate: T - top boundary of the object C - center of the object B - bottom boundary of the object Special: UN - don't change the corresponding x or y boundory of new element. REL - If this bit is cleared, target coordinates is used from location of view.
insets - Determines the insets of this view in relation to the side of rectangle.protected boolean recursiveRemove(View v)
v - current view
true if view is found in current node of treepublic boolean remove(View v)
v - specified view
true if view is removed or false otherwise.public void add(View v)
v - the added viewpublic java.awt.Rectangle getBounds()
getBounds in class Viewpublic boolean intersects(java.awt.Rectangle rect)
intersects in class Viewrect - specified rectangle
true if intersects,false otherwisepublic View getDeepestActive(java.awt.Point pt)
View.ACTIVE state and intersects the specified point.
pt - specified point
View.ACTIVE state and intersects the specified point.
public View getDeepestActive(java.awt.Point pt,
java.lang.Object[] ignoreModels,
java.lang.Class modelClass)
View.ACTIVE state and intersects the specified point.
pt - specified pointignoreModels - ignore views whose modes are listed at ignoreModelsArray.modelClass - if this parameter is specified the view model should be
assignable to the specified class.
View.ACTIVE state and intersects the specified point.public java.awt.Point getLocation()
Rectangle bound.
Rectangle bound.public void paint(java.awt.Graphics2D g)
paint in class Viewg - specified Graphics2D.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||