Package jadex.commons.gui
Class ObjectCardLayout
- java.lang.Object
- 
- jadex.commons.gui.ObjectCardLayout
 
- 
- All Implemented Interfaces:
- java.awt.LayoutManager,- java.awt.LayoutManager2
 
 public class ObjectCardLayout extends java.lang.Object implements java.awt.LayoutManager2A ObjectCardLayout is an object based cardlayout.
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.util.Map<java.lang.Object,java.awt.Component>componentsThe components.protected java.lang.ObjectcurkeyThe key of the current component (if any).protected java.awt.ComponentcurrentThe current component (if any).static java.lang.StringDEFAULT_COMPONENTThe default component (used when no other component is shown).protected inthgapThe horizontal gap.protected intvgapThe vertical gap.
 - 
Constructor SummaryConstructors Constructor Description ObjectCardLayout()Construct a new layout.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLayoutComponent(java.awt.Component component, java.lang.Object constraints)Will be called from the container, when a new component with constraint object was added.voidaddLayoutComponent(java.lang.String name, java.awt.Component comp)A component was added to the container.java.awt.ComponentgetComponent(java.lang.Object object)Get a component for the given identifier.java.lang.ObjectgetCurrentKey()Get the key of the currently shown component (if any).floatgetLayoutAlignmentX(java.awt.Container target)Get the component interest where to be aligned.floatgetLayoutAlignmentY(java.awt.Container target)Get the component interest where to be aligned.voidinvalidateLayout(java.awt.Container target)When called, all values are recalculated.booleanisAvailable(java.lang.Object object)Test if there is a panel for a object available.voidlayoutContainer(java.awt.Container parent)Set the components bounds in the parent.java.awt.DimensionmaximumLayoutSize(java.awt.Container target)Compute the maximum layout size.java.awt.DimensionminimumLayoutSize(java.awt.Container parent)Compute the minimum layout size.java.awt.DimensionpreferredLayoutSize(java.awt.Container parent)Compute the preferred layout size.voidremoveLayoutComponent(java.awt.Component comp)Will be called from the container, when a component was removed.voidshow(java.lang.Object object)Shows the component in the parent.java.lang.StringtoString()
 
- 
- 
- 
Field Detail- 
DEFAULT_COMPONENTpublic static final java.lang.String DEFAULT_COMPONENT The default component (used when no other component is shown).- See Also:
- Constant Field Values
 
 - 
hgapprotected int hgap The horizontal gap.
 - 
vgapprotected int vgap The vertical gap.
 - 
componentsprotected java.util.Map<java.lang.Object,java.awt.Component> components The components.
 - 
currentprotected java.awt.Component current The current component (if any).
 - 
curkeyprotected java.lang.Object curkey The key of the current component (if any).
 
- 
 - 
Method Detail- 
showpublic void show(java.lang.Object object) Shows the component in the parent.- Parameters:
- object- The object.
- parent- The parent.
 
 - 
isAvailablepublic boolean isAvailable(java.lang.Object object) Test if there is a panel for a object available.- Parameters:
- object- The object.
- Returns:
- True, if it exists a panel.
 
 - 
getComponentpublic java.awt.Component getComponent(java.lang.Object object) Get a component for the given identifier.
 - 
getCurrentKeypublic java.lang.Object getCurrentKey() Get the key of the currently shown component (if any).
 - 
addLayoutComponentpublic void addLayoutComponent(java.lang.String name, java.awt.Component comp)A component was added to the container.- Specified by:
- addLayoutComponentin interface- java.awt.LayoutManager
- Parameters:
- name- The constraint in a string.
- comp- The component.
 
 - 
layoutContainerpublic void layoutContainer(java.awt.Container parent) Set the components bounds in the parent.- Specified by:
- layoutContainerin interface- java.awt.LayoutManager
- Parameters:
- parent- The container.
 
 - 
minimumLayoutSizepublic java.awt.Dimension minimumLayoutSize(java.awt.Container parent) Compute the minimum layout size.- Specified by:
- minimumLayoutSizein interface- java.awt.LayoutManager
- Parameters:
- parent- The container.
- Returns:
- The minimum layout size.
 
 - 
preferredLayoutSizepublic java.awt.Dimension preferredLayoutSize(java.awt.Container parent) Compute the preferred layout size.- Specified by:
- preferredLayoutSizein interface- java.awt.LayoutManager
- Parameters:
- parent- The container.
- Returns:
- The preferred layout size.
 
 - 
removeLayoutComponentpublic void removeLayoutComponent(java.awt.Component comp) Will be called from the container, when a component was removed.- Specified by:
- removeLayoutComponentin interface- java.awt.LayoutManager
- Parameters:
- comp- The component.
 
 - 
addLayoutComponentpublic 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.- Specified by:
- addLayoutComponentin interface- java.awt.LayoutManager2
- Parameters:
- component- The component.
- constraints- The constraints.
 
 - 
getLayoutAlignmentXpublic float getLayoutAlignmentX(java.awt.Container target) Get the component interest where to be aligned. (not used).- Specified by:
- getLayoutAlignmentXin interface- java.awt.LayoutManager2
- Parameters:
- target- The container.
- Returns:
- Always 0.5 (centered).
 
 - 
getLayoutAlignmentYpublic float getLayoutAlignmentY(java.awt.Container target) Get the component interest where to be aligned. (not used).- Specified by:
- getLayoutAlignmentYin interface- java.awt.LayoutManager2
- Parameters:
- target- The container.
- Returns:
- Always 0.5 (centered).
 
 - 
invalidateLayoutpublic void invalidateLayout(java.awt.Container target) When called, all values are recalculated.- Specified by:
- invalidateLayoutin interface- java.awt.LayoutManager2
- Parameters:
- target- The container.
 
 - 
maximumLayoutSizepublic java.awt.Dimension maximumLayoutSize(java.awt.Container target) Compute the maximum layout size.- Specified by:
- maximumLayoutSizein interface- java.awt.LayoutManager2
- Parameters:
- target- The container.
- Returns:
- The maximum layout size.
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-