com.alee.extended.layout
Class OverlayLayout

java.lang.Object
  extended by com.alee.extended.layout.AbstractLayoutManager
      extended by com.alee.extended.layout.OverlayLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.awt.LayoutManager2, javax.swing.SwingConstants

public class OverlayLayout
extends AbstractLayoutManager
implements javax.swing.SwingConstants

This is a specific layout for WebOverlay component that allows you to add overlaying components atop of single main component.

Author:
Mikle Garin

Field Summary
static java.lang.String COMPONENT
           
protected  java.awt.Insets componentMargin
           
protected  java.util.Map<java.awt.Component,java.lang.String> constraints
           
static java.lang.String OVERLAY
           
protected  java.awt.Insets overlayMargin
           
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
OverlayLayout()
           
 
Method Summary
 void addComponent(java.awt.Component component, java.lang.Object constraints)
          Caled when component added into container with this layout.
protected  java.awt.Insets getActualComponentInsets(java.awt.Container parent)
           
protected  int getActualHalign(java.awt.Component component, OverlayData data)
           
 java.awt.Insets getComponentMargin()
           
 java.awt.Insets getOverlayMargin()
           
 void layoutContainer(java.awt.Container parent)
          
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          
 void removeComponent(java.awt.Component component)
          Called when component removed from container with this layout.
 void setComponentMargin(java.awt.Insets margin)
           
 void setComponentMargin(int margin)
           
 void setComponentMargin(int top, int left, int bottom, int right)
           
 void setOverlayMargin(java.awt.Insets overlayMargin)
           
 void setOverlayMargin(int margin)
           
 void setOverlayMargin(int top, int left, int bottom, int right)
           
 
Methods inherited from class com.alee.extended.layout.AbstractLayoutManager
addLayoutComponent, addLayoutComponent, getLayoutAlignmentX, getLayoutAlignmentY, invalidateLayout, maximumLayoutSize, minimumLayoutSize, removeLayoutComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT

public static final java.lang.String COMPONENT
See Also:
Constant Field Values

OVERLAY

public static final java.lang.String OVERLAY
See Also:
Constant Field Values

constraints

protected java.util.Map<java.awt.Component,java.lang.String> constraints

componentMargin

protected java.awt.Insets componentMargin

overlayMargin

protected java.awt.Insets overlayMargin
Constructor Detail

OverlayLayout

public OverlayLayout()
Method Detail

getComponentMargin

public java.awt.Insets getComponentMargin()

setComponentMargin

public void setComponentMargin(int margin)

setComponentMargin

public void setComponentMargin(int top,
                               int left,
                               int bottom,
                               int right)

setComponentMargin

public void setComponentMargin(java.awt.Insets margin)

getOverlayMargin

public java.awt.Insets getOverlayMargin()

setOverlayMargin

public void setOverlayMargin(int margin)

setOverlayMargin

public void setOverlayMargin(int top,
                             int left,
                             int bottom,
                             int right)

setOverlayMargin

public void setOverlayMargin(java.awt.Insets overlayMargin)

addComponent

public void addComponent(java.awt.Component component,
                         java.lang.Object constraints)
Caled when component added into container with this layout.

Overrides:
addComponent in class AbstractLayoutManager
Parameters:
component - added component
constraints - component constraints

removeComponent

public void removeComponent(java.awt.Component component)
Called when component removed from container with this layout.

Overrides:
removeComponent in class AbstractLayoutManager
Parameters:
component - removed component

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager

getActualComponentInsets

protected java.awt.Insets getActualComponentInsets(java.awt.Container parent)

layoutContainer

public void layoutContainer(java.awt.Container parent)

Specified by:
layoutContainer in interface java.awt.LayoutManager

getActualHalign

protected int getActualHalign(java.awt.Component component,
                              OverlayData data)