|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.jdesktop.swingx.JXPanel
public class JXPanel
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JXPanel()
Creates a new instance of JXPanel |
|
JXPanel(boolean isDoubleBuffered)
|
|
JXPanel(LayoutManager layout)
|
|
JXPanel(LayoutManager layout,
boolean isDoubleBuffered)
|
Method Summary | |
---|---|
float |
getAlpha()
|
Painter |
getBackgroundPainter()
|
float |
getEffectiveAlpha()
Unlike other properties, alpha can be set on a component, or on one of its parents. |
GradientPaint |
getGradientPaint()
Deprecated. See setGradientPaint |
Dimension |
getPreferredScrollableViewportSize()
|
int |
getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction)
|
boolean |
getScrollableTracksViewportHeight()
|
boolean |
getScrollableTracksViewportWidth()
|
int |
getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
|
boolean |
isDrawGradient()
Deprecated. See setGradientPaint |
boolean |
isGradientTrackHeight()
Deprecated. See setGradientPaint |
boolean |
isGradientTrackWidth()
Deprecated. See setGradientPaint |
boolean |
isInheritAlpha()
|
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)
Deprecated. See setGradientPaint |
void |
setGradientPaint(GradientPaint paint)
Deprecated. To specify a gradient for the panel, use the #setBackgroundPainter method, along with a Painter, like this:
There are several predefined gradients that may also be used. For example:
|
void |
setGradientTrackHeight(boolean b)
Deprecated. See setGradientPaint |
void |
setGradientTrackWidth(boolean b)
Deprecated. See setGradientPaint |
void |
setInheritAlpha(boolean val)
|
void |
setScrollableTracksViewportHeight(boolean scrollableTracksViewportHeight)
|
void |
setScrollableTracksViewportWidth(boolean scrollableTracksViewportWidth)
|
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JXPanel()
public JXPanel(boolean isDoubleBuffered)
isDoubleBuffered
- public JXPanel(LayoutManager layout)
layout
- public JXPanel(LayoutManager layout, boolean isDoubleBuffered)
layout
- isDoubleBuffered
- Method Detail |
---|
public void setAlpha(float alpha)
TODO add support for animated changes in translucency
alpha
- must be a value between 0 and 1 inclusive.public float getAlpha()
public float getEffectiveAlpha()
public boolean isInheritAlpha()
public void setInheritAlpha(boolean val)
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface Scrollable
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth
in interface Scrollable
public Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface Scrollable
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
getScrollableBlockIncrement
in interface Scrollable
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
getScrollableUnitIncrement
in interface Scrollable
public void setScrollableTracksViewportHeight(boolean scrollableTracksViewportHeight)
scrollableTracksViewportHeight
- The scrollableTracksViewportHeight to set.public void setScrollableTracksViewportWidth(boolean scrollableTracksViewportWidth)
scrollableTracksViewportWidth
- The scrollableTracksViewportWidth to set.public void setGradientPaint(GradientPaint paint)
BasicGradientPainter gradient =
new BasicGradientPainter(new GradientPaint(
new Point2D.Double(0,0),
Color.WHITE,
new Point2D.Double(1,0),
UIManager.getColor("control")));
panel.setBackgroundPainter(gradient);
There are several predefined gradients that may also be used. For example:
BasicGradientPainter gradient =
new BasicGradientPainter(BasicGradientPainter.WHITE_TO_CONTROL_HORIZONTAL);
panel.setBackgroundPainter(gradient);
public GradientPaint getGradientPaint()
public void setDrawGradient(boolean b)
public boolean isDrawGradient()
public void setGradientTrackWidth(boolean b)
public boolean isGradientTrackWidth()
public void setGradientTrackHeight(boolean b)
public boolean isGradientTrackHeight()
public void setBackgroundPainter(Painter p)
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.
public Painter getBackgroundPainter()
public void paint(Graphics g)
paint
in class JComponent
protected void paintComponent(Graphics g)
paintComponent
in class JComponent
|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |