public final class AnimatedLabel
extends javax.swing.JPanel
Note: This is preview code that is not supported. It is more raw than other classes that you have downloaded from JGoodies.com in the past and contains known bugs.
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static int |
CENTER |
static java.awt.Color |
DEFAULT_BASE_COLOR |
static int |
DEFAULT_FONT_EXTRA_SIZE |
static int |
LEFT |
static java.lang.String |
PROPERTYNAME_ANIMATED |
static java.lang.String |
PROPERTYNAME_DURATION |
static java.lang.String |
PROPERTYNAME_FOREGROUND |
static java.lang.String |
PROPERTYNAME_TEXT |
static int |
RIGHT |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
AnimatedLabel()
Constructs an
AnimatedLabel with default base color,
default font extra size, and an empty text. |
AnimatedLabel(java.awt.Color baseColor,
int fontExtraSize,
java.lang.String text)
Constructs an
AnimatedLabel with the given initial text
using a left oriented label. |
AnimatedLabel(java.awt.Color baseColor,
int fontExtraSize,
java.lang.String text,
int orientation)
Constructs an
AnimatedLabel with the given initial text
and orientation. |
AnimatedLabel(java.awt.Color baseColor,
int fontExtraSize,
java.lang.String text,
int orientation,
int duration,
int frames_per_second)
Constructs an
AnimatedLabel with the given properties. |
Modifier and Type | Method and Description |
---|---|
long |
getDuration()
Returns the duration of the blend over animation.
|
java.awt.Color |
getForeground()
Returns the label's foreground base color.
|
java.lang.String |
getText()
Returns the text of the foreground label.
|
boolean |
isAnimated()
Answers whether the animation is currently enabled.
|
void |
setAnimated(boolean animated)
Enables or disables the blend over effect.
|
void |
setDuration(long newDuration)
Sets the animation's duration and invalidates the animation cache.
|
void |
setForeground(java.awt.Color newForeground)
Sets a new foreground base color.
|
void |
setText(java.lang.String newText)
Sets a new text.
|
void |
setTextImmediately(java.lang.String newText)
Sets a new text without using the blend over animation.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String PROPERTYNAME_ANIMATED
public static final java.lang.String PROPERTYNAME_DURATION
public static final java.lang.String PROPERTYNAME_FOREGROUND
public static final java.lang.String PROPERTYNAME_TEXT
public static final int RIGHT
public static final int CENTER
public static final int LEFT
public static final java.awt.Color DEFAULT_BASE_COLOR
public static final int DEFAULT_FONT_EXTRA_SIZE
public AnimatedLabel()
AnimatedLabel
with default base color,
default font extra size, and an empty text.public AnimatedLabel(java.awt.Color baseColor, int fontExtraSize, java.lang.String text)
AnimatedLabel
with the given initial text
using a left oriented label.baseColor
- the color used as a basis for the text colorfontExtraSize
- pixels that are added to the dialog font sizetext
- the initial text to be displayedpublic AnimatedLabel(java.awt.Color baseColor, int fontExtraSize, java.lang.String text, int orientation)
AnimatedLabel
with the given initial text
and orientation.baseColor
- the color used as a basis for the text colorfontExtraSize
- pixels that are added to the dialog font sizetext
- the initial text to be displayedorientation
- the label's orientationpublic AnimatedLabel(java.awt.Color baseColor, int fontExtraSize, java.lang.String text, int orientation, int duration, int frames_per_second)
AnimatedLabel
with the given properties.baseColor
- the color used as a basis for the text colorfontExtraSize
- pixels that are added to the dialog font sizetext
- the initial text to be displayedorientation
- the label's orientationduration
- the duration of the blend over animationframes_per_second
- the blend over animation's frame ratepublic boolean isAnimated()
public long getDuration()
public java.awt.Color getForeground()
getForeground
in class java.awt.Component
public java.lang.String getText()
public void setAnimated(boolean animated)
animated
- true to enable the blend over effect, false to disable itpublic void setDuration(long newDuration)
newDuration
- the duration to be setpublic void setForeground(java.awt.Color newForeground)
setForeground
in class javax.swing.JComponent
newForeground
- the color to be set as new foreground base colorpublic void setText(java.lang.String newText)
newText
- the new text to be displayedpublic void setTextImmediately(java.lang.String newText)
newText
- the text to be setCopyright © 2001-2006 JGoodies Karsten Lentzsch. All Rights Reserved.