Klasse SwingPercentLayoutAdapter
java.lang.Object
net.sf.jguiraffe.gui.platform.swing.layout.SwingPercentLayoutAdapter
- Alle implementierten Schnittstellen:
LayoutManager
,LayoutManager2
,Serializable
,PercentLayoutPlatformAdapter
public class SwingPercentLayoutAdapter
extends Object
implements LayoutManager2, PercentLayoutPlatformAdapter, Serializable
Implementation of a Swing-specific adapter class for the percent layout manager.
This class implements the percent layout manager for swing. It implements the
LayoutManager2
interface and can be used as a standard Swing
layout.
- Version:
- $Id: SwingPercentLayoutAdapter.java 205 2012-01-29 18:29:57Z oheger $
- Autor:
- Oliver Heger
- Siehe auch:
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungSwingPercentLayoutAdapter
(PercentLayoutBase percentLayout) Creates a new instance ofSwingPercentLayouAdaptert
and sets the associated percent layout. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
addLayoutComponent
(Component comp, Object constraints) Adds a component to this layout.void
addLayoutComponent
(String name, Component comp) Adds a component to this layout manager using the given name as constraints object.getComponent
(int index) Returns the component with the given index.int
Returns the number of components in this layout.getConstraints
(int index) Returns the constraints for the component with the given index.float
getLayoutAlignmentX
(Container container) Returns the layout alignment in X direction.float
getLayoutAlignmentY
(Container container) Returns the layout alignment in Y direction.int
getMinimumComponentSize
(Object component, boolean vert) Returns the minimum size of the specified component in the given axis.Returns a reference to the associated percent layout object.int
getPreferredComponentSize
(Object component, boolean vert) Returns the preferred size of the specified component in the given axis.Returns the size handler used by this layout.void
invalidateLayout
(Container container) Invalidates this layout.void
layoutContainer
(Container container) Determines the coordinates and sizes of all components that belong to this layout.maximumLayoutSize
(Container container) Returns the maximum layout size.minimumLayoutSize
(Container container) Returns the minimum size of this layout.preferredLayoutSize
(Container container) Returns the preferred size of this layout.void
Removes the specified component from the layout manager.void
setComponentBounds
(Object component, Rectangle bounds) Initializes the bounds for the specified component.
-
Konstruktordetails
-
SwingPercentLayoutAdapter
Creates a new instance ofSwingPercentLayouAdaptert
and sets the associated percent layout.- Parameter:
percentLayout
- the percent layout object (must not be null)- Löst aus:
IllegalArgumentException
- if thePercentLayoutBase
object is null
-
-
Methodendetails
-
getPercentLayout
Returns a reference to the associated percent layout object.- Gibt zurück:
- the percent layout object
-
getLayoutAlignmentX
Returns the layout alignment in X direction.- Angegeben von:
getLayoutAlignmentX
in SchnittstelleLayoutManager2
- Parameter:
container
- the associated container- Gibt zurück:
- the layout alignment in X direction
-
getLayoutAlignmentY
Returns the layout alignment in Y direction.- Angegeben von:
getLayoutAlignmentY
in SchnittstelleLayoutManager2
- Parameter:
container
- the associated container- Gibt zurück:
- the layout alignment in Y direction
-
invalidateLayout
Invalidates this layout. Clears all cached values.- Angegeben von:
invalidateLayout
in SchnittstelleLayoutManager2
- Parameter:
container
- the associated container
-
maximumLayoutSize
Returns the maximum layout size. For this layout type there is no upper limit.- Angegeben von:
maximumLayoutSize
in SchnittstelleLayoutManager2
- Parameter:
container
- the container- Gibt zurück:
- the maximum layout size
-
addLayoutComponent
Adds a component to this layout.- Angegeben von:
addLayoutComponent
in SchnittstelleLayoutManager2
- Parameter:
comp
- the component to addconstraints
- the constraints
-
addLayoutComponent
Adds a component to this layout manager using the given name as constraints object.- Angegeben von:
addLayoutComponent
in SchnittstelleLayoutManager
- Parameter:
name
- the namecomp
- the component
-
removeLayoutComponent
Removes the specified component from the layout manager.- Angegeben von:
removeLayoutComponent
in SchnittstelleLayoutManager
- Parameter:
c
- the component to remove
-
layoutContainer
Determines the coordinates and sizes of all components that belong to this layout.- Angegeben von:
layoutContainer
in SchnittstelleLayoutManager
- Parameter:
container
- the associated container
-
minimumLayoutSize
Returns the minimum size of this layout. For this layout type this equals the preferred layout size.- Angegeben von:
minimumLayoutSize
in SchnittstelleLayoutManager
- Parameter:
container
- the associated container- Gibt zurück:
- the minimum layout size
-
preferredLayoutSize
Returns the preferred size of this layout.- Angegeben von:
preferredLayoutSize
in SchnittstelleLayoutManager
- Parameter:
container
- the associated container- Gibt zurück:
- the preferred layout size
-
getSizeHandler
Returns the size handler used by this layout. This happens to be a swing size handler.- Angegeben von:
getSizeHandler
in SchnittstellePercentLayoutPlatformAdapter
- Gibt zurück:
- the size handler
-
getComponentCount
public int getComponentCount()Returns the number of components in this layout.- Angegeben von:
getComponentCount
in SchnittstellePercentLayoutPlatformAdapter
- Gibt zurück:
- the number of components
-
getComponent
Returns the component with the given index.- Angegeben von:
getComponent
in SchnittstellePercentLayoutPlatformAdapter
- Parameter:
index
- the index- Gibt zurück:
- the component with this index
-
getConstraints
Returns the constraints for the component with the given index.- Angegeben von:
getConstraints
in SchnittstellePercentLayoutPlatformAdapter
- Parameter:
index
- the index- Gibt zurück:
- the constraints for the specified component
-
getMinimumComponentSize
Returns the minimum size of the specified component in the given axis.- Angegeben von:
getMinimumComponentSize
in SchnittstellePercentLayoutPlatformAdapter
- Parameter:
component
- the componentvert
- the flag for the axis- Gibt zurück:
- the minimum component size
-
getPreferredComponentSize
Returns the preferred size of the specified component in the given axis.- Angegeben von:
getPreferredComponentSize
in SchnittstellePercentLayoutPlatformAdapter
- Parameter:
component
- the componentvert
- the flag for the axis- Gibt zurück:
- the preferred component size
-
setComponentBounds
Initializes the bounds for the specified component.- Angegeben von:
setComponentBounds
in SchnittstellePercentLayoutPlatformAdapter
- Parameter:
component
- the componentbounds
- the new bounds
-