|
|||||||||
| 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
org.formaria.swing.animation.AnimationSurface
org.formaria.swing.ProgressIndicator
public class ProgressIndicator
Copyright (c) Formaria Ltd., 2008, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from formaria.
$Revision: 1.2 $
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected int |
alphaLevel
Alpha level of the veil, used for fade in/out. |
protected int |
barsCount
Amount of bars composing the circular shape. |
protected float |
fps
Amount of frames per seconde. |
protected java.awt.RenderingHints |
hints
Rendering hints to set anti aliasing. |
protected double |
prevHeight
|
protected double |
prevWidth
|
protected int |
rampDelay
Duration of the veil's fade in/out. |
protected float |
scale
|
protected float |
shield
Alpha level of the veil. |
protected java.awt.geom.Area[] |
ticker
Contains the bars composing the circular shape. |
| Fields inherited from class org.formaria.swing.animation.AnimationSurface |
|---|
animationContext, animator, antiAlias, ascent, autoStart, bimg, composite, currentProject, finished, imageType, increment, label, loopTime, oH, oldH, oldW, oW, oX, oY, position, rendering, sleepTime, startTime, texture, timingFraction |
| 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.print.Printable |
|---|
NO_SUCH_PAGE, PAGE_EXISTS |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ProgressIndicator()
Creates a new progress panel with default values: No message 14 bars Veil's alpha level is 70% 15 frames per second Fade in/out last 300 ms |
|
| Method Summary | |
|---|---|
void |
drawObjects(int w,
int h,
java.awt.Graphics2D g2)
Draw the tick objects to the passed graphics context |
void |
drawTicker(java.awt.Graphics2D g2,
int width,
int height)
Draw the indicator to the passed graphics context |
int |
getAlphaLevel()
Get alpha level of the veil, used for fade in/out |
int |
getBarsCount()
Get amount of bars composing the circular shape |
float |
getFps()
Get amount of frames per second |
int |
getRampDelay()
Get duration of the veil's fade in/out |
float |
getScale()
Get the scaled size of the indicator |
float |
getShield()
Get alpha level of the veil |
void |
init()
Intializes the progress indicator |
void |
setAlphaLevel(int a)
Set alpha level of the veil, used for fade in/out |
void |
setBarsCount(int b)
Set amount of bars composing the circular shape |
void |
setFps(float f)
Set amount of frames per second. |
void |
setRampDelay(int r)
Set duration of the veil's fade in/out |
void |
setScale(float s)
Set the scaled size of the indicator |
void |
setShield(float s)
Set alpha level of the veil |
void |
stop()
End the animation |
void |
timingEvent(float fraction)
This method will receive all of the timing events from an Animator during an animation. |
| Methods inherited from class org.formaria.swing.animation.AnimationSurface |
|---|
autoStart, begin, createBufferedImage, createGraphics2D, end, getAnimator, getAntiAlias, getAutoStart, getComposite, getImageType, getIncrement, getLoopTime, getRendering, getSleepTime, getText, isAnimated, isFinished, isStarted, paintComponent, print, quoteReplacement, render, repeat, replace, reset, setAnimator, setAntiAlias, setAutoStart, setComposite, setImageType, setIncrement, setLoopTime, setRendering, setSleepTime, setText, setTexture, start |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
| Methods inherited from class java.awt.Container |
|---|
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
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, getForeground, 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, hide, 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, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.awt.geom.Area[] ticker
protected int alphaLevel
protected int rampDelay
protected float shield
protected int barsCount
protected float fps
protected java.awt.RenderingHints hints
protected double prevWidth
protected double prevHeight
protected float scale
| Constructor Detail |
|---|
public ProgressIndicator()
| Method Detail |
|---|
public void init()
init in class AnimationSurfacepublic void timingEvent(float fraction)
timingEvent in class AnimationSurfacefraction - the fraction of completion between the start and
end of the current cycle. Note that on reversing cycles
(Animator.Direction#BACKWARD) the fraction decreases
from 1.0 to 0 on backwards-running cycles. Note also that animations
with a duration of INFINITE will call
timingEvent with an undefined value for fraction, since there is
no fraction that makes sense if the animation has no defined length.Animator.Direction
public void drawObjects(int w,
int h,
java.awt.Graphics2D g2)
drawObjects in class AnimationSurfacew - int specifying the width of the componenth - int specifying the width of the componentg2 - Graphics2D
public void drawTicker(java.awt.Graphics2D g2,
int width,
int height)
g2 - Graphics2Dwidth - int specifying the width of the componentheight - int specifying the width of the componentpublic void stop()
stop in class AnimationSurfacepublic float getScale()
float - the scalepublic void setScale(float s)
float - - the scalepublic int getRampDelay()
public void setRampDelay(int r)
int - - the durationpublic float getShield()
public void setShield(float s)
float - - the alpha levelpublic int getAlphaLevel()
int the alpha levelpublic void setAlphaLevel(int a)
a - int - the alpha levelpublic int getBarsCount()
int specifying the amount of barspublic void setBarsCount(int b)
b - int - amount of barspublic float getFps()
float - frames per secondpublic void setFps(float f)
f - float - frames per second
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||