|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jvnet.lafwidget.layout.TransitionLayout
public class TransitionLayout
Transition layout. The public methods in this class that are not implementing
the LayoutManager
are for look-and-feel usage. Application code
should use the getAlphaComposite(Component)
and
getAlphaComposite(Component, float)
methods only in custom painting
code (overriding the JComponent.paintComponent(Graphics)
method.
Field Summary | |
---|---|
static java.lang.String |
ALPHA
Client property that specifies the current transition state of a component. |
static java.lang.String |
BOUNDS
Client property for storing the current bounds of a component. |
static FadeKind |
COMPONENT_BOUNDS
Fade kind for animating the change in component bounds. |
static FadeKind |
COMPONENT_FADE
Fade kind for animating the change in component visibility. |
protected java.awt.Container |
container
The associated container. |
protected java.awt.LayoutManager |
delegate
The original layout manager. |
protected boolean |
doImmediateRepaint
|
protected java.util.List |
eventListeners
|
protected boolean |
hasFades
|
protected boolean |
hasPendingLayoutRequests
|
static java.lang.String |
LIMBO
Client property that marks components in fade-out state. |
static java.lang.String |
ORIGINAL_OPACITY
Client property to store the original opacity of the component while it is in a transition. |
static java.lang.String |
OWN_ALPHA
Client property that specifies the transition state of a component in a transition that happens directly on that component. |
protected int |
pendingAnimationCount
|
static java.lang.String |
SHOWING
Client property to store the current visibility of components. |
Constructor Summary | |
---|---|
TransitionLayout(java.awt.Container container,
java.awt.LayoutManager delegate,
boolean hasFades)
|
Method Summary | |
---|---|
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
|
void |
addTransitionLayoutListener(TransitionLayoutListener listener)
|
protected static void |
clearAlpha(java.awt.Component comp,
boolean main)
|
protected void |
fireEvent(java.awt.Component child,
int id)
|
static java.awt.Composite |
getAlphaComposite(java.awt.Component c)
Returns the composite to use for painting the specified component. |
static java.awt.Composite |
getAlphaComposite(java.awt.Component c,
float translucency)
|
static java.awt.Composite |
getAlphaComposite(java.awt.Component c,
float translucency,
java.awt.Graphics g)
Returns the composite to use for painting the specified component. |
static java.awt.Composite |
getAlphaComposite(java.awt.Component c,
java.awt.Graphics g)
Returns the composite to use for painting the specified component. |
protected float |
getCompositeAlpha(java.awt.Component c)
Returns the composite alpha for the specified component. |
java.awt.LayoutManager |
getDelegate()
|
boolean |
isAnimating()
|
static boolean |
isOpaque(java.awt.Component c)
Returns indication whether the specified component is opaque. |
void |
layoutContainer(java.awt.Container parent)
|
static void |
makeNonOpaque(java.awt.Component comp,
java.util.Map opaquenessSnapshot)
Makes the specified component and all its descendants non-opaque. |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container parent)
|
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent)
|
void |
removeLayoutComponent(java.awt.Component comp)
|
void |
removeTransitionLayoutListener(TransitionLayoutListener listener)
|
protected void |
repaint(java.awt.Component comp)
|
static void |
restoreOpaque(java.awt.Component comp,
java.util.Map opaquenessSnapshot)
Restores the opacity of the specified component and all its descendants. |
static void |
setAlpha(java.awt.Component comp,
java.lang.Float alpha,
java.lang.Float ownAlpha,
boolean main)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.awt.LayoutManager delegate
protected java.util.List eventListeners
public static final java.lang.String ALPHA
OWN_ALPHA
,
getCompositeAlpha(Component)
,
getAlphaComposite(Component)
,
getAlphaComposite(Component, float)
,
Constant Field Valuespublic static final java.lang.String OWN_ALPHA
ALPHA
,
getCompositeAlpha(Component)
,
getAlphaComposite(Component)
,
getAlphaComposite(Component, float)
,
Constant Field Valuespublic static final java.lang.String ORIGINAL_OPACITY
isOpaque(Component)
uses this property
to correctly report the "real" component opacity to the painting code.
public static final java.lang.String SHOWING
Component.setVisible(boolean)
, this
property tracks the "real" visibility.
public static final java.lang.String LIMBO
public static final java.lang.String BOUNDS
protected java.awt.Container container
protected boolean doImmediateRepaint
public static final FadeKind COMPONENT_BOUNDS
public static final FadeKind COMPONENT_FADE
protected boolean hasFades
protected boolean hasPendingLayoutRequests
protected int pendingAnimationCount
Constructor Detail |
---|
public TransitionLayout(java.awt.Container container, java.awt.LayoutManager delegate, boolean hasFades)
Method Detail |
---|
public void addLayoutComponent(java.lang.String name, java.awt.Component comp)
addLayoutComponent
in interface java.awt.LayoutManager
public void layoutContainer(java.awt.Container parent)
layoutContainer
in interface java.awt.LayoutManager
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
minimumLayoutSize
in interface java.awt.LayoutManager
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
preferredLayoutSize
in interface java.awt.LayoutManager
public void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent
in interface java.awt.LayoutManager
public static void makeNonOpaque(java.awt.Component comp, java.util.Map opaquenessSnapshot)
comp
- Component.opaquenessSnapshot
- The "snapshot" map that will contain the original opacity
status of the specified component and all its descendants.public static void restoreOpaque(java.awt.Component comp, java.util.Map opaquenessSnapshot)
comp
- Component.opaquenessSnapshot
- The "snapshot" map that contains the original opacity status
of the specified component and all its descendants.public static void setAlpha(java.awt.Component comp, java.lang.Float alpha, java.lang.Float ownAlpha, boolean main)
protected static void clearAlpha(java.awt.Component comp, boolean main)
public java.awt.LayoutManager getDelegate()
public static java.awt.Composite getAlphaComposite(java.awt.Component c, float translucency, java.awt.Graphics g)
Graphics2D
before any custom
rendering is done. This method can be used by application painting code
and by look-and-feel delegates.
c
- Component.translucency
- The translucency of the original painting (when the component
is not under any transition fade effect).g
- The original graphics context.
public static java.awt.Composite getAlphaComposite(java.awt.Component c, float translucency)
public static java.awt.Composite getAlphaComposite(java.awt.Component c, java.awt.Graphics g)
Graphics2D
before any custom
rendering is done. This method can be used by application painting code
and by look-and-feel delegates.
c
- Component.
public static java.awt.Composite getAlphaComposite(java.awt.Component c)
Graphics2D
before any custom
rendering is done. This method can be used by application painting code
and by look-and-feel delegates.
c
- Component.
public static boolean isOpaque(java.awt.Component c)
getAlphaComposite(Component)
or
getAlphaComposite(Component, float)
to correctly fill the
component background during the transition fade animations. Note that
during the transition fades, the components are marked as non-opaque so
that Swing will handle them correctly. This means that calling
Component.isOpaque()
will return false
,
incorrectly signifying to the painting code that the background fill
should be omitted.
c
- Component.
true
if the specified component is opaque,
false
otherwise.protected void repaint(java.awt.Component comp)
protected float getCompositeAlpha(java.awt.Component c)
c
- Component.
public boolean isAnimating()
public void addTransitionLayoutListener(TransitionLayoutListener listener)
public void removeTransitionLayoutListener(TransitionLayoutListener listener)
protected void fireEvent(java.awt.Component child, int id)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |