|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent com.levigo.util.swing.FadeablePane
public class FadeablePane
Document me.
Nested Class Summary |
---|
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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static String |
ANIMATION_STATE_KEY
Used when generating PropertyChangeEvents for the "animationState" property |
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 | |
---|---|
FadeablePane()
Constructs a new JCollapsiblePane with a JPanel as content pane and a vertical with a
gap of 2 pixels as layout manager. |
|
FadeablePane(JComponent contentPane)
Constructs a new JCollapsiblePane with a JPanel as content pane and a vertical with a
gap of 2 pixels as layout manager. |
Method Summary | |
---|---|
protected void |
addImpl(Component comp,
Object constraints,
int index)
|
protected void |
configureGraphics(Graphics2D dst,
Graphics2D src)
|
protected BufferedImage |
createBuffer(int width,
int height)
Creates the BufferedImage to be used as the cached image. |
void |
doLayout()
|
protected void |
fadeCompleted()
Subclasses may override this method in order to perform some action after a fade-in or fade-out animation completed. |
protected void |
fadeStarted()
Subclasses may override this method in order to perform some action before a fade-in or fade-out animation starts. |
float |
getAlpha()
|
int |
getAnimationFPS()
|
int |
getAnimationSteps()
|
Border |
getBorder()
|
protected BufferedImage |
getBuffer()
Returns the current cached image. |
Container |
getContentPanel()
|
Insets |
getInsets()
|
Insets |
getInsets(Insets insets)
|
Dimension |
getMinimumSize()
|
Dimension |
getPreferredSize()
|
protected boolean |
isBufferFormatValid(BufferedImage buffer)
Defines if the cached image has the valid format for the current painting painting operation and there is no need to recreate it. |
void |
paint(Graphics g)
|
protected void |
paintBorder(Graphics g)
|
void |
remove(Component comp)
|
void |
remove(int index)
|
void |
removeAll()
|
void |
setAlpha(float alpha)
Set the global transparency of this fadeable pane. |
void |
setAlphaImmediate(float alpha)
Set the global transparency of this fadable pane without animation. |
void |
setAnimationFPS(int animationFPS)
|
void |
setAnimationSteps(int animationSteps)
|
void |
setBorder(Border border)
|
protected void |
setBuffer(BufferedImage buffer)
Sets the current cached image. |
void |
setContentPane(JComponent contentPanel)
Sets the content pane of this JCollapsiblePane. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ANIMATION_STATE_KEY
Constructor Detail |
---|
@CallOnEDT public FadeablePane(JComponent contentPane)
JPanel
as content pane and a vertical with a
gap of 2 pixels as layout manager.
@CallOnEDT public FadeablePane()
JPanel
as content pane and a vertical with a
gap of 2 pixels as layout manager.
Method Detail |
---|
protected void addImpl(Component comp, Object constraints, int index)
addImpl
in class Container
@CallOnEDT public void setContentPane(JComponent contentPanel)
contentPanel
-
IllegalArgumentException
- if contentPanel is null@CallOnEDT public void remove(Component comp)
remove
in class Container
@CallOnEDT public void remove(int index)
remove
in class Container
@CallOnEDT public void removeAll()
removeAll
in class Container
@CallOnEDT public Container getContentPanel()
@CallOnEDT public void setAlpha(float alpha)
@CallOnEDT public float getAlpha()
@CallOnEDT public void setAlphaImmediate(float alpha)
protected void fadeStarted()
protected void fadeCompleted()
@CallOnEDT public Dimension getMinimumSize()
getMinimumSize
in class JComponent
@CallOnEDT public int getAnimationSteps()
@CallOnEDT public void setAnimationSteps(int animationSteps)
animationSteps
- the animationSteps to set@CallOnEDT public int getAnimationFPS()
@CallOnEDT public void setAnimationFPS(int animationFPS)
animationFPS
- the animationFPS to set@CallOnEDT public void paint(Graphics g)
paint
in class JComponent
@CallOnEDT public void doLayout()
doLayout
in class Container
@CallOnEDT public Dimension getPreferredSize()
getPreferredSize
in class JComponent
@CallOnEDT public Insets getInsets(Insets insets)
getInsets
in class JComponent
@CallOnEDT public Insets getInsets()
getInsets
in class JComponent
@CallOnEDT public void setBorder(Border border)
setBorder
in class JComponent
protected void paintBorder(Graphics g)
paintBorder
in class JComponent
@CallOnEDT public Border getBorder()
getBorder
in class JComponent
protected void configureGraphics(Graphics2D dst, Graphics2D src)
protected BufferedImage createBuffer(int width, int height)
BufferedImage
to be used as the cached image. This method must never return
null
.
width
- the width of the imageheight
- the height of the image
BufferedImage
, which can be used for double buffering.protected BufferedImage getBuffer()
The implementation of this LayerUI may use SoftReference to keep this image, so this method may
return null
at any time.
setBuffer(BufferedImage)
protected boolean isBufferFormatValid(BufferedImage buffer)
The default implementation returns true
if the cached image is not null and its size
matches the size of the JXLayer
being painted, otherwise it returns true
.
buffer
- the image to validate
true
if the format of existing cache image is valid, otherwise returns
false
getBuffer()
protected void setBuffer(BufferedImage buffer)
buffer
- the BufferedImage
to be used as the cachegetBuffer()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |