public class ObjectCardLayout
extends java.lang.Object
implements java.awt.LayoutManager2
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Object,java.awt.Component> |
components
The components.
|
protected java.lang.Object |
curkey
The key of the current component (if any).
|
protected java.awt.Component |
current
The current component (if any).
|
static java.lang.String |
DEFAULT_COMPONENT
The default component (used when no other component is shown).
|
protected int |
hgap
The horizontal gap.
|
protected int |
vgap
The vertical gap.
|
Constructor and Description |
---|
ObjectCardLayout()
Construct a new layout.
|
Modifier and Type | Method and Description |
---|---|
void |
addLayoutComponent(java.awt.Component component,
java.lang.Object constraints)
Will be called from the container, when
a new component with constraint object
was added.
|
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
A component was added to the container.
|
java.awt.Component |
getComponent(java.lang.Object object)
Get a component for the given identifier.
|
java.lang.Object |
getCurrentKey()
Get the key of the currently shown component (if any).
|
float |
getLayoutAlignmentX(java.awt.Container target)
Get the component interest where to be aligned.
|
float |
getLayoutAlignmentY(java.awt.Container target)
Get the component interest where to be aligned.
|
void |
invalidateLayout(java.awt.Container target)
When called, all values are recalculated.
|
boolean |
isAvailable(java.lang.Object object)
Test if there is a panel
for a object available.
|
void |
layoutContainer(java.awt.Container parent)
Set the components bounds in the parent.
|
java.awt.Dimension |
maximumLayoutSize(java.awt.Container target)
Compute the maximum layout size.
|
java.awt.Dimension |
minimumLayoutSize(java.awt.Container parent)
Compute the minimum layout size.
|
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent)
Compute the preferred layout size.
|
void |
removeLayoutComponent(java.awt.Component comp)
Will be called from the container, when
a component was removed.
|
void |
show(java.lang.Object object)
Shows the component in the parent.
|
java.lang.String |
toString() |
public static final java.lang.String DEFAULT_COMPONENT
protected int hgap
protected int vgap
protected java.util.Map<java.lang.Object,java.awt.Component> components
protected java.awt.Component current
protected java.lang.Object curkey
public void show(java.lang.Object object)
object
- The object.parent
- The parent.public boolean isAvailable(java.lang.Object object)
object
- The object.public java.awt.Component getComponent(java.lang.Object object)
public java.lang.Object getCurrentKey()
public void addLayoutComponent(java.lang.String name, java.awt.Component comp)
addLayoutComponent
in interface java.awt.LayoutManager
name
- The constraint in a string.comp
- The component.public void layoutContainer(java.awt.Container parent)
layoutContainer
in interface java.awt.LayoutManager
parent
- The container.public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
minimumLayoutSize
in interface java.awt.LayoutManager
parent
- The container.public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
preferredLayoutSize
in interface java.awt.LayoutManager
parent
- The container.public void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent
in interface java.awt.LayoutManager
comp
- The component.public void addLayoutComponent(java.awt.Component component, java.lang.Object constraints)
addLayoutComponent
in interface java.awt.LayoutManager2
component
- The component.constraints
- The constraints.public float getLayoutAlignmentX(java.awt.Container target)
getLayoutAlignmentX
in interface java.awt.LayoutManager2
target
- The container.public float getLayoutAlignmentY(java.awt.Container target)
getLayoutAlignmentY
in interface java.awt.LayoutManager2
target
- The container.public void invalidateLayout(java.awt.Container target)
invalidateLayout
in interface java.awt.LayoutManager2
target
- The container.public java.awt.Dimension maximumLayoutSize(java.awt.Container target)
maximumLayoutSize
in interface java.awt.LayoutManager2
target
- The container.public java.lang.String toString()
toString
in class java.lang.Object