org.jvnet.lafwidget.layout
Class TransitionBorder
java.lang.Object
org.jvnet.lafwidget.layout.TransitionBorder
- All Implemented Interfaces:
- javax.swing.border.Border
- Direct Known Subclasses:
- TransitionBorder.BorderUIResource
public class TransitionBorder
- extends java.lang.Object
- implements javax.swing.border.Border
Border implementation that respects the transition composite effects
set by the TransitionLayout. All Borders installed on the
component hierarchy are wrapped in instances of this class once the
TransitionLayout is installed on that component (with
TransitionLayoutManager.track(Container, boolean) or
TransitionLayoutManager.track(Container, boolean, boolean).
Note that installing the TransitionLayout on a component may break
applications that operate directly on the installed borders, resulting in
ClassCastException or incorrect logic being called. The relevant code
needs to be changed using the getDelegate(). In addition, the
applications will get PropertyChangeEvents when these borders are
set / unset.
- Author:
- Kirill Grouchnikov
|
Field Summary |
protected javax.swing.border.Border |
delegate
The delegate (original) border. |
|
Constructor Summary |
TransitionBorder(javax.swing.border.Border original)
Creates a new wrapper border. |
|
Method Summary |
java.awt.Insets |
getBorderInsets(java.awt.Component c)
|
javax.swing.border.Border |
getDelegate()
Returns the original (delegate) border. |
boolean |
isBorderOpaque()
|
void |
paintBorder(java.awt.Component c,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
delegate
protected javax.swing.border.Border delegate
- The delegate (original) border. Handles all the
Border methods,
including paintBorder(Component, Graphics, int, int, int, int)
that operates on a Graphics2D object with
TransitionLayout-relevant Composite.
TransitionBorder
public TransitionBorder(javax.swing.border.Border original)
- Creates a new wrapper border.
- Parameters:
original - The original border.
getBorderInsets
public java.awt.Insets getBorderInsets(java.awt.Component c)
- Specified by:
getBorderInsets in interface javax.swing.border.Border
isBorderOpaque
public boolean isBorderOpaque()
- Specified by:
isBorderOpaque in interface javax.swing.border.Border
paintBorder
public void paintBorder(java.awt.Component c,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
- Specified by:
paintBorder in interface javax.swing.border.Border
getDelegate
public javax.swing.border.Border getDelegate()
- Returns the original (delegate) border.
- Returns:
- The original (delegate) border.