|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.erichseifert.gral.AbstractDrawable
de.erichseifert.gral.DrawableContainer
public class DrawableContainer
Implementation of Container that is a Drawable
itself.
It takes care of the layout and the insets and stores Drawable
s.
Constructor Summary | |
---|---|
DrawableContainer()
Creates a new container for Drawable s without layout manager. |
|
DrawableContainer(Layout layout)
Creates a new container for Drawable s with the specified
layout manager. |
Method Summary | |
---|---|
void |
add(Drawable drawable)
Adds a new component to this container. |
void |
add(Drawable drawable,
Object constraints)
Adds a new component to this container. |
void |
draw(DrawingContext context)
Draws the Drawable with the specified
Graphics2D object. |
Object |
getConstraints(Drawable drawable)
Return additional information on component |
Insets2D |
getInsets()
Return the space that this DrawableContainer must leave at each of its edges. |
Layout |
getLayout()
Returns the layout associated with this container. |
Dimension2D |
getPreferredSize()
Returns the preferred size of the Drawable . |
Iterator<Drawable> |
iterator()
|
void |
remove(Drawable drawable)
Removes a component from this container. |
void |
setBounds(double x,
double y,
double width,
double height)
Sets the bounds to the specified coordinates, width and height. |
void |
setBounds(Rectangle2D bounds)
Sets the bounds to the specified bounding rectangle. |
void |
setInsets(Insets2D insets)
Sets the space that this DrawableContainer must leave at each of its edges. |
void |
setLayout(Layout layout)
Sets the layout associated with this container. |
int |
size()
Returns the number of components that are stored in this container. |
Methods inherited from class de.erichseifert.gral.AbstractDrawable |
---|
getBounds, getHeight, getWidth, getX, getY |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.erichseifert.gral.Container |
---|
getBounds |
Constructor Detail |
---|
public DrawableContainer()
Drawable
s without layout manager.
public DrawableContainer(Layout layout)
Drawable
s with the specified
layout manager.
layout
- Layout manager to be set.Method Detail |
---|
public void draw(DrawingContext context)
Drawable
Drawable
with the specified
Graphics2D
object.
draw
in interface Drawable
context
- Environment used for drawingpublic void add(Drawable drawable)
Container
add
in interface Container
drawable
- Componentpublic void add(Drawable drawable, Object constraints)
Container
add
in interface Container
drawable
- Componentconstraints
- Additional information (e.g. for layout)public void remove(Drawable drawable)
Container
remove
in interface Container
drawable
- Componentpublic Object getConstraints(Drawable drawable)
Container
getConstraints
in interface Container
drawable
- Component
null
public Insets2D getInsets()
Container
getInsets
in interface Container
public void setInsets(Insets2D insets)
Container
setInsets
in interface Container
insets
- Insets to be set.public Layout getLayout()
Container
getLayout
in interface Container
public void setLayout(Layout layout)
Container
setLayout
in interface Container
layout
- Layout to be set.public Iterator<Drawable> iterator()
iterator
in interface Iterable<Drawable>
public int size()
Container
size
in interface Container
public void setBounds(Rectangle2D bounds)
Drawable
setBounds
in interface Container
setBounds
in interface Drawable
setBounds
in class AbstractDrawable
bounds
- rectangle containing the component.public void setBounds(double x, double y, double width, double height)
Drawable
setBounds
in interface Drawable
setBounds
in class AbstractDrawable
x
- horizontal position of the upper-left cornery
- vertical position of the upper-left cornerwidth
- horizontal extentheight
- vertical extentpublic Dimension2D getPreferredSize()
Drawable
Drawable
.
getPreferredSize
in interface Drawable
getPreferredSize
in class AbstractDrawable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |