Package org.nuiton.jaxx.widgets.extra
Class XMLGridLayout
java.lang.Object
org.nuiton.jaxx.widgets.extra.XMLGridLayout
- All Implemented Interfaces:
java.awt.LayoutManager
public class XMLGridLayout
extends java.lang.Object
implements java.awt.LayoutManager
XMLGridLayout uses a XML input (a string, for the time being) to define the
layout of components inside the container. To do this a set of constraints in
the form of GridBagConstraints are build and associated to a name. When
adding the component to the container, the name of the constraint to be used
must be supplied, using the add(name,component) method. If the name
associated to the component has no associated constrain, the component is not
layout.
Implementation Note: Internally this class uses a GridBagLayout and delegates to it all the calculations necesary to layout the components.
Implementation Note: Internally this class uses a GridBagLayout and delegates to it all the calculations necesary to layout the components.
- Author:
- Rafael Alvarez
-
Constructor Summary
Constructors Constructor Description XMLGridLayout(java.lang.String layoutStringOrFile)XMLGridLayout(java.net.URL url) -
Method Summary
Modifier and Type Method Description voidaddLayoutComponent(java.lang.String name, java.awt.Component comp)Binds a name in the layout to the specified component.java.awt.GridBagConstraintsgetConstraint(java.lang.String componentName)java.lang.StringgetLayoutString()protected voidinit(java.lang.String layoutString)protected voidinit(java.net.URL url)voidlayoutContainer(java.awt.Container parent)java.awt.DimensionminimumLayoutSize(java.awt.Container parent)java.awt.DimensionpreferredLayoutSize(java.awt.Container parent)voidremoveLayoutComponent(java.awt.Component comp)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
XMLGridLayout
public XMLGridLayout(java.lang.String layoutStringOrFile) -
XMLGridLayout
public XMLGridLayout(java.net.URL url)
-
-
Method Details
-
init
protected void init(java.net.URL url) -
init
protected void init(java.lang.String layoutString)- Parameters:
layoutString- string that represente the layout
-
addLayoutComponent
public void addLayoutComponent(java.lang.String name, java.awt.Component comp)Binds a name in the layout to the specified component. If the name is not defined in the layout an error message will be send to System.err- Specified by:
addLayoutComponentin interfacejava.awt.LayoutManager- Parameters:
name- The name in the layout to bind the component tocomp- The component to bind to the specified name.
-
removeLayoutComponent
public void removeLayoutComponent(java.awt.Component comp)- Specified by:
removeLayoutComponentin interfacejava.awt.LayoutManager
-
preferredLayoutSize
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)- Specified by:
preferredLayoutSizein interfacejava.awt.LayoutManager
-
minimumLayoutSize
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)- Specified by:
minimumLayoutSizein interfacejava.awt.LayoutManager
-
layoutContainer
public void layoutContainer(java.awt.Container parent)- Specified by:
layoutContainerin interfacejava.awt.LayoutManager
-
getConstraint
public java.awt.GridBagConstraints getConstraint(java.lang.String componentName) -
getLayoutString
public java.lang.String getLayoutString()
-