org.universAAL.ui.handler.gui.swing.defaultLookAndFeel.Layout
Class FormLayout

Package class diagram package FormLayout
java.lang.Object
  extended by org.universAAL.ui.handler.gui.swing.defaultLookAndFeel.Layout.AbstractUnitLayout
      extended by org.universAAL.ui.handler.gui.swing.defaultLookAndFeel.Layout.FormLayout
All Implemented Interfaces:
LayoutManager
Direct Known Subclasses:
VerticalUnitLayout

public class FormLayout
extends AbstractUnitLayout
implements LayoutManager

This LayoutManager organizes elements in rows, maintaining each element with it's label (this pair is managed as a Unit). Each Row may contain more than one Unit (if both can fit in it). Each Row is justified, ie all Units in each Row are extended to occupy the full width provided. The spare space is added to each Unit maintaining the ratio of space (minimum or preferred size).
Preview:

Layout preview

Each Row is spaced one AbstractUnitLayout.gap between each other and also the margin all arround has the same size.
Layout gaps

Author:
amedrano

Field Summary
 
Fields inherited from class org.universAAL.ui.handler.gui.swing.defaultLookAndFeel.Layout.AbstractUnitLayout
gap, HORIZONAL_UNIT_HEIGHT_LIMIT, LABEL_HEIGHT_THRESHOLD, PIXELS_PER_FONT_SIZE, POST_NEWLINE, PRE_NEWLINE
 
Constructor Summary
FormLayout()
          Create a FormLayout with a default gap of 5.
FormLayout(int gap)
          Create a FormLayout witha specific gap.
 
Method Summary
 void addLayoutComponent(String name, Component comp)
          
 void layoutContainer(Container parent)
          
 Dimension minimumLayoutSize(Container parent)
          
 Dimension preferredLayoutSize(Container parent)
          
 void removeLayoutComponent(Component comp)
          
 
Methods inherited from class org.universAAL.ui.handler.gui.swing.defaultLookAndFeel.Layout.AbstractUnitLayout
getSreenRatio, setNewLineAfter, setNewLineBefore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormLayout

public FormLayout()
Create a FormLayout with a default gap of 5.


FormLayout

public FormLayout(int gap)
Create a FormLayout witha specific gap.

Parameters:
gap - the space in pixels to leave between elements and as margins
Method Detail

preferredLayoutSize

public Dimension preferredLayoutSize(Container parent)

Specified by:
preferredLayoutSize in interface LayoutManager
Specified by:
preferredLayoutSize in class AbstractUnitLayout

layoutContainer

public void layoutContainer(Container parent)

Specified by:
layoutContainer in interface LayoutManager
Specified by:
layoutContainer in class AbstractUnitLayout

minimumLayoutSize

public Dimension minimumLayoutSize(Container parent)

Specified by:
minimumLayoutSize in interface LayoutManager
Specified by:
minimumLayoutSize in class AbstractUnitLayout

removeLayoutComponent

public void removeLayoutComponent(Component comp)

Specified by:
removeLayoutComponent in interface LayoutManager
Specified by:
removeLayoutComponent in class AbstractUnitLayout

addLayoutComponent

public void addLayoutComponent(String name,
                               Component comp)

Specified by:
addLayoutComponent in interface LayoutManager
Specified by:
addLayoutComponent in class AbstractUnitLayout


Copyright © 2014 universAAL Consortium. All Rights Reserved.