org.jdesktop.swingx
Class JXPanel

public class JXPanel
extends JPanel
implements Scrollable
A simple JPanel extension that adds translucency support. This component and all of its content will be displayed with the specified "alpha" transluscency property value. It also supports the Painter API.
SinceNot specified.
VersionNot specified.
Authorrbair
Wiki javadoc Use textile entry format.
Add your comments here.
Constructor Summary
JXPanel()
Creates a new instance of JXPanel
JXPanel( boolean isDoubleBuffered )
No description provided.
JXPanel( LayoutManager layout )
No description provided.
JXPanel( LayoutManager layout, boolean isDoubleBuffered )
No description provided.
Method Summary
float getAlpha()
No description provided.
Painter getBackgroundPainter()
No description provided.
float getEffectiveAlpha()
Unlike other properties, alpha can be set on a component, or on one of its parents.
GradientPaint getGradientPaint()
No description provided.
Dimension getPreferredScrollableViewportSize()
No description provided.
int getScrollableBlockIncrement( Rectangle visibleRect, int orientation, int direction )
No description provided.
boolean getScrollableTracksViewportHeight()
No description provided.
boolean getScrollableTracksViewportWidth()
No description provided.
int getScrollableUnitIncrement( Rectangle visibleRect, int orientation, int direction )
No description provided.
boolean isDrawGradient()
No description provided.
boolean isGradientTrackHeight()
No description provided.
boolean isGradientTrackWidth()
No description provided.
boolean isInheritAlpha()
No description provided.
void paint( Graphics g )
Overriden paint method to take into account the alpha setting
protected void paintComponent( Graphics g )
overridden to provide gradient painting TODO: Chris says that in OGL we actually suffer here by caching the gradient paint since the OGL pipeline will render gradients on hardware for us.
void setAlpha( float alpha )
Set the alpha transparency level for this component.
void setBackgroundPainter( Painter p )
Specifies a Painter to use to paint the background of this JXPanel.
void setDrawGradient( boolean b )
No description provided.
void setGradientPaint( GradientPaint paint )
No description provided.
void setGradientTrackHeight( boolean b )
No description provided.
void setGradientTrackWidth( boolean b )
No description provided.
void setInheritAlpha( boolean val )
No description provided.
void setScrollableTracksViewportHeight( boolean scrollableTracksViewportHeight )
No description provided.
void setScrollableTracksViewportWidth( boolean scrollableTracksViewportWidth )
No description provided.
Methods inherited from javax.accessibilityAccessible
Methods inherited from java.awtComponent
Methods inherited from java.awtContainer
Methods inherited from java.awt.imageImageObserver
Methods inherited from javax.swingJComponent
JXPanel
public JXPanel ( )
Creates a new instance of JXPanel
Wiki javadoc Use textile entry format.
Add your comments here.
JXPanel
public JXPanel ( boolean isDoubleBuffered )
No description provided.
Parameters
TypeNameDescription
boolean isDoubleBuffered No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
JXPanel
public JXPanel ( LayoutManager layout )
No description provided.
Parameters
TypeNameDescription
LayoutManager layout No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
JXPanel
public JXPanel ( LayoutManager layout, boolean isDoubleBuffered )
No description provided.
Parameters
TypeNameDescription
LayoutManager layout No description provided.
boolean isDoubleBuffered No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
getAlpha
public float getAlpha ( )
No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
getBackgroundPainter
public Painter getBackgroundPainter ( )
No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
getEffectiveAlpha
public float getEffectiveAlpha ( )
Unlike other properties, alpha can be set on a component, or on one of its parents. If the alpha of a parent component is .4, and the alpha on this component is .5, effectively the alpha for this component is .4 because the lowest alpha in the heirarchy "wins"
Wiki javadoc Use textile entry format.
Add your comments here.
getGradientPaint
public GradientPaint getGradientPaint ( )
No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
getPreferredScrollableViewportSize
public Dimension getPreferredScrollableViewportSize ( )
No description provided.
Implements method in Scrollable
Wiki javadoc Use textile entry format.
Add your comments here.
getScrollableBlockIncrement
public int getScrollableBlockIncrement ( Rectangle visibleRect, int orientation, int direction )
No description provided.
Implements method in Scrollable
Parameters
TypeNameDescription
Rectangle visibleRect No description provided.
int orientation No description provided.
int direction No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
getScrollableTracksViewportHeight
public boolean getScrollableTracksViewportHeight ( )
No description provided.
Implements method in Scrollable
Wiki javadoc Use textile entry format.
Add your comments here.
getScrollableTracksViewportWidth
public boolean getScrollableTracksViewportWidth ( )
No description provided.
Implements method in Scrollable
Wiki javadoc Use textile entry format.
Add your comments here.
getScrollableUnitIncrement
public int getScrollableUnitIncrement ( Rectangle visibleRect, int orientation, int direction )
No description provided.
Implements method in Scrollable
Parameters
TypeNameDescription
Rectangle visibleRect No description provided.
int orientation No description provided.
int direction No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
isDrawGradient
public boolean isDrawGradient ( )
No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
isGradientTrackHeight
public boolean isGradientTrackHeight ( )
No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
isGradientTrackWidth
public boolean isGradientTrackWidth ( )
No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
isInheritAlpha
public boolean isInheritAlpha ( )
No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
paint
public void paint ( Graphics g )
Overriden paint method to take into account the alpha setting
Overrides method in JComponent
Parameters
TypeNameDescription
Graphics g No description provided.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
paintComponent
protected void paintComponent ( Graphics g )
overridden to provide gradient painting TODO: Chris says that in OGL we actually suffer here by caching the gradient paint since the OGL pipeline will render gradients on hardware for us. The decision to use cacheing is based on my experience with gradient title borders slowing down repaints -- this could use more extensive analysis.
Overrides method in JComponent
Parameters
TypeNameDescription
Graphics g No description provided.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setAlpha
public void setAlpha ( float alpha )
Set the alpha transparency level for this component. This automatically causes a repaint of the component.

TODO add support for animated changes in translucency

Parameters
TypeNameDescription
float alpha must be a value between 0 and 1 inclusive.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setBackgroundPainter
public void setBackgroundPainter ( Painter p )
Specifies a Painter to use to paint the background of this JXPanel. If p is not null, then setOpaque(false) will be called as a side effect. A component should not be opaque if painters are being used, because Painters may paint transparent pixels or not paint certain pixels, such as around the border insets.
Parameters
TypeNameDescription
Painter p No description provided.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setDrawGradient
public void setDrawGradient ( boolean b )
No description provided.
Parameters
TypeNameDescription
boolean b No description provided.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setGradientPaint
public void setGradientPaint ( GradientPaint paint )
No description provided.
Parameters
TypeNameDescription
GradientPaint paint No description provided.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setGradientTrackHeight
public void setGradientTrackHeight ( boolean b )
No description provided.
Parameters
TypeNameDescription
boolean b No description provided.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setGradientTrackWidth
public void setGradientTrackWidth ( boolean b )
No description provided.
Parameters
TypeNameDescription
boolean b No description provided.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setInheritAlpha
public void setInheritAlpha ( boolean val )
No description provided.
Parameters
TypeNameDescription
boolean val No description provided.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setScrollableTracksViewportHeight
public void setScrollableTracksViewportHeight ( boolean scrollableTracksViewportHeight )
No description provided.
Parameters
TypeNameDescription
boolean scrollableTracksViewportHeight The scrollableTracksViewportHeight to set.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setScrollableTracksViewportWidth
public void setScrollableTracksViewportWidth ( boolean scrollableTracksViewportWidth )
No description provided.
Parameters
TypeNameDescription
boolean scrollableTracksViewportWidth The scrollableTracksViewportWidth to set.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.