public final class AnimatedLabel extends 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.
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
static int |
CENTER |
static Color |
DEFAULT_BASE_COLOR |
static int |
DEFAULT_FONT_EXTRA_SIZE |
static int |
LEFT |
static String |
PROPERTY_ANIMATED |
static String |
PROPERTY_DURATION |
static String |
PROPERTY_FOREGROUND |
static String |
PROPERTY_TEXT |
static int |
RIGHT |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
AnimatedLabel()
Constructs an
AnimatedLabel with default base color,
default font extra size, and an empty text. |
AnimatedLabel(Color baseColor,
int fontExtraSize,
String text)
Constructs an
AnimatedLabel with the given initial text
using a left oriented label. |
AnimatedLabel(Color baseColor,
int fontExtraSize,
String text,
int orientation)
Constructs an
AnimatedLabel with the given initial text
and orientation. |
AnimatedLabel(Color baseColor,
int fontExtraSize,
String text,
int orientation,
int duration,
int framesPerSecond)
Constructs an
AnimatedLabel with the given properties. |
| Modifier and Type | Method and Description |
|---|---|
long |
getDuration()
Returns the duration of the blend over animation.
|
Color |
getForeground()
Returns the label's foreground base color.
|
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(Color newForeground)
Sets a new foreground base color.
|
void |
setText(String newText)
Sets a new text.
|
void |
setTextImmediately(String newText)
Sets a new text without using the blend over animation.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, updateadd, 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, validateTreeaction, 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, transferFocusUpCyclepublic static final String PROPERTY_ANIMATED
public static final String PROPERTY_DURATION
public static final String PROPERTY_FOREGROUND
public static final String PROPERTY_TEXT
public static final int RIGHT
public static final int CENTER
public static final int LEFT
public static final 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(Color baseColor, int fontExtraSize, 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(Color baseColor, int fontExtraSize, 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(Color baseColor, int fontExtraSize, String text, int orientation, int duration, int framesPerSecond)
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 animationframesPerSecond - the blend over animation's frame ratepublic boolean isAnimated()
public long getDuration()
public Color getForeground()
getForeground in class Componentpublic 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(Color newForeground)
setForeground in class JComponentnewForeground - the color to be set as new foreground base colorpublic void setText(String newText)
newText - the new text to be displayedpublic void setTextImmediately(String newText)
newText - the text to be setCopyright © 2018 JGoodies Software GmbH. All rights reserved.