|
||||||||||
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
org.jdesktop.swingx.JXGlassBox
public class JXGlassBox
Component used to display transluscent user-interface content. This component and all of its content will be displayed with the specified "alpha" transluscency property value. When this component is made visible, it's content will fade in until the alpha transluscency level is reached.
If the glassbox's "dismissOnClick" property is true
(the default) then the glassbox will be made invisible when the user
clicks on it.
This component is particularly useful for displaying transient messages on the glasspane.
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 | |
---|---|
JXGlassBox()
|
|
JXGlassBox(float alpha)
|
Method Summary | |
---|---|
void |
dismiss()
Dismisses this glass box. |
boolean |
isDismissOnClick()
Determines if the glass box if dismissed when a user clicks on it. |
void |
paint(Graphics g)
Overriden paint method to take into account the alpha setting |
void |
setAlpha(float alpha)
Set the alpha transparency level for this component. |
void |
setDismissOnClick(boolean dismissOnClick)
Configures the glass box to dismiss (or not) when clicked. |
void |
setVisible(boolean visible)
Makes the component visible or invisible. |
void |
showOnGlassPane(Container glassPane,
Component origin,
int offsetX,
int offsetY,
int positionHint)
Shows this glass box on the glass pane. |
void |
showOnGlassPane(Container glassPane,
int originX,
int originY)
Shows this glass box on the glass pane. |
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 JXGlassBox()
public JXGlassBox(float alpha)
Method Detail |
---|
public void setAlpha(float alpha)
JXPanel
TODO add support for animated changes in translucency
setAlpha
in class JXPanel
alpha
- must be a value between 0 and 1 inclusive.public void dismiss()
public boolean isDismissOnClick()
true
if the glass box can be dismissed with a click;
false
otherwisesetDismissOnClick(boolean)
,
dismiss()
public void setDismissOnClick(boolean dismissOnClick)
dismissOnClick
- true
if the glass box should dismiss when clicked;
false
otherwiseisDismissOnClick()
,
dismiss()
public void paint(Graphics g)
JXPanel
paint
in class JXPanel
g
- the Graphics
context in which to paintJComponent.paintComponent(java.awt.Graphics)
,
JComponent.paintBorder(java.awt.Graphics)
,
JComponent.paintChildren(java.awt.Graphics)
,
JComponent.getComponentGraphics(java.awt.Graphics)
,
JComponent.repaint(long, int, int, int, int)
public void setVisible(boolean visible)
javax.swing.JComponent
Component.setVisible
.
setVisible
in class JComponent
visible
- true to make the component visible; false to
make it invisibleComponent.isVisible()
public void showOnGlassPane(Container glassPane, Component origin, int offsetX, int offsetY, int positionHint)
glassPane
- the glass paneorigin
- the component representing the origin locationoffsetX
- the offset on the X-axis from the originoffsetY
- the offset on the Y-axis from the originpositionHint
- a SwingConstants
box position hint (CENTER
,
TOP
, BOTTOM
, LEFT
, or RIGHT
)
NullPointerException
- if glassPane
or origin
is null
IllegalArgumentException
- if positionHint
is not a valid hintpublic void showOnGlassPane(Container glassPane, int originX, int originY)
glassPane
- the glass paneoriginX
- the location on the X-axis to position the glass boxoriginY
- the location on the Y-axis to position the glass box
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |