com.levigo.util.swing.effect
Class EffectLayout.Constraints

java.lang.Object
  extended by com.levigo.util.swing.effect.EffectLayout.Constraints
Enclosing class:
EffectLayout

public static class EffectLayout.Constraints
extends Object


Nested Class Summary
static class EffectLayout.Constraints.Mode
           
 
Field Summary
 float alignment
           
 boolean alignOnInsets
           
 int displacement
           
 EffectLayout.Edge edge
           
 EffectLayout.Constraints.Mode mode
           
 boolean overlapBorder
           
 
Method Summary
static EffectLayout.Constraints absolute()
          Create a constraint used to exclude the component from layout.
static EffectLayout.Constraints absolutePosition()
          Create a constraint used to lock the component to its given position.
static EffectLayout.Constraints base()
          Create a constraint for internal use: it will be used to deal with the base component and the glass pane.
static EffectLayout.Constraints center()
          Create a constraint for internal use: it will be used to deal with the base component and the glass pane.
static EffectLayout.Constraints fill(EffectLayout.Edge edge, boolean overlapBorder, boolean alignOnInsets)
           
static EffectLayout.Constraints relative(EffectLayout.Edge edge, float alignment, boolean overlapBorder, boolean alignOnInsets)
          Create a constraint for relative alignment along the edge selected via the edge argument.
static EffectLayout.Constraints relative(EffectLayout.Edge edge, float alignment, int displacement, boolean overlapBorder, boolean alignOnInsets)
          Create a constraint for relative alignment along the edge selected via the edge argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

edge

public final EffectLayout.Edge edge

mode

public final EffectLayout.Constraints.Mode mode

alignment

public final float alignment

overlapBorder

public final boolean overlapBorder

alignOnInsets

public final boolean alignOnInsets

displacement

public final int displacement
Method Detail

relative

public static EffectLayout.Constraints relative(EffectLayout.Edge edge,
                                                float alignment,
                                                boolean overlapBorder,
                                                boolean alignOnInsets)
Create a constraint for relative alignment along the edge selected via the edge argument. The alignment argument controls how the ratio by which the remaining space (the space left after subtracting the component's size in the relevant dimension from the size of the parent component or viewport area) is distributed. It must fall within the range [-1,1]:
-1f:
the component is aligned to the left/top
0f
the component is centered
1f
the component is aligned to the right/bottom
The overlapBorder argument controls whether the component should be aligned so that it overlaps the parent's border (true) or that it resides inside the border ( false).

Parameters:
edge - the edge on which to "dock" the component
alignment - the relative alignment in the range [-1,1]
overlapBorder - whether to overlap the parent's border
alignOnInsets - whether to align the child so that its the border touching the effect container's edge lies outside the edge.
Returns:

relative

public static EffectLayout.Constraints relative(EffectLayout.Edge edge,
                                                float alignment,
                                                int displacement,
                                                boolean overlapBorder,
                                                boolean alignOnInsets)
Create a constraint for relative alignment along the edge selected via the edge argument. The alignment argument controls how the ratio by which the remaining space (the space left after subtracting the component's size in the relevant dimension from the size of the parent component or viewport area) is distributed. It must fall within the range [-1,1]:
-1f:
the component is aligned to the left/top
0f
the component is centered
1f
the component is aligned to the right/bottom
The overlapBorder argument controls whether the component should be aligned so that it overlaps the parent's border (true) or that it resides inside the border ( false).

Parameters:
edge - the edge on which to "dock" the component
alignment - the relative alignment in the range [-1,1]
displacement - the number of pixels the position is displaced to the right/bottom
overlapBorder - whether to overlap the parent's border
alignOnInsets - whether to align the child so that its the border touching the effect container's edge lies outside the edge.
Returns:

absolute

public static EffectLayout.Constraints absolute()
Create a constraint used to exclude the component from layout. Layout and positioning of the component added with constraint none must be managed externally.


absolutePosition

public static EffectLayout.Constraints absolutePosition()
Create a constraint used to lock the component to its given position. The component's size is set to its preferred size, unless the latter would overlap the parent's bounds. The location must be managed externally.


fill

public static EffectLayout.Constraints fill(EffectLayout.Edge edge,
                                            boolean overlapBorder,
                                            boolean alignOnInsets)

base

public static EffectLayout.Constraints base()
Create a constraint for internal use: it will be used to deal with the base component and the glass pane.


center

public static EffectLayout.Constraints center()
Create a constraint for internal use: it will be used to deal with the base component and the glass pane.



Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.