public class InfiniteProgress extends Component
Shows a "Washing Machine" infinite progress indication animation, to customize the image you can either
use the infiniteImage theme constant or the setAnimation
method. The image is rotated
automatically so don't use an animated image or anything like that as it would fail with the rotation logic.
This class can be used in one of two ways either by embedding the component into the UI thru something like this:
Notice that this can be used within a custom dialog too.
A second approach allows showing the infinite progress over the entire screen which blocks all input. This tints
the background while the infinite progress rotates:
BASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, CROSSHAIR_CURSOR, DEFAULT_CURSOR, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_POSSIBLE_DRAG_Y, E_RESIZE_CURSOR, HAND_CURSOR, LEFT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NW_RESIZE_CURSOR, RIGHT, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, TOP, W_RESIZE_CURSOR, WAIT_CURSOR
Constructor and Description |
---|
InfiniteProgress()
Default constructor to define the UIID
|
Modifier and Type | Method and Description |
---|---|
boolean |
animate()
Updates the progress animation.
|
boolean |
animate(boolean force)
Updates the progress animation.
|
protected Dimension |
calcPreferredSize()
Calculates the preferred size based on component content.
|
protected void |
deinitialize()
Invoked to indicate that the component initialization is being reversed
since the component was detached from the container hierarchy.
|
int |
getAngleIncrease()
The angle to increase (in degrees naturally) in every tick count, reduce to 1 to make the animation perfectly
slow and smooth, increase to 45 to make it fast and jumpy.
|
Image |
getAnimation() |
static int |
getDefaultMaterialDesignColor()
The default color of the current material design progress spinner
|
int |
getMaterialDesignColor()
The color of the current material design progress spinner
|
String[] |
getPropertyNames()
A component may expose mutable property names for a UI designer to manipulate, this
API is designed for usage internally by the GUI builder code
|
Class[] |
getPropertyTypes()
Matches the property names method (see that method for further details).
|
Object |
getPropertyValue(String name)
Returns the current value of the property name, this method is used by the GUI builder
|
int |
getTickCount()
The animation rotates with EDT ticks, but not for every tick.
|
int |
getTintColor()
The tinting color of the screen when the showInfiniteBlocking method is invoked
|
protected void |
initComponent()
Allows subclasses to bind functionality that relies on fully initialized and
"ready for action" component state
|
static boolean |
isDefaultMaterialDesignMode()
Indicates whether infinite progress and pull to refresh work in the material
design mode by default
|
boolean |
isMaterialDesignMode()
Indicates whether this instance of infinite progress works in the material
design mode by default
|
void |
paint(Graphics g)
This method paints the Component on the screen, it should be overriden
by subclasses to perform custom drawing or invoke the UI API's to let
the PLAF perform the rendering.
|
void |
setAngleIncrease(int angleIncrease)
The angle to increase (in degrees naturally) in every tick count, reduce to 1 to make the animation perfectly
slow and smooth, increase to 45 to make it fast and jumpy.
|
void |
setAnimation(Image animation)
Allows setting the image that will be rotated as part of this effect
|
static void |
setDefaultMaterialDesignColor(int aDefaultMaterialDesignColor)
The default color of the current material design progress spinner
|
static void |
setDefaultMaterialDesignMode(boolean aDefaultMaterialDesignMode)
Indicates whether infinite progress and pull to refresh work in the material
design mode by default
|
void |
setMaterialDesignColor(int materialDesignColor)
The color of the current material design progress spinner
|
void |
setMaterialDesignMode(boolean materialDesignMode)
Indicates whether this instance of infinite progress works in the material
design mode by default
|
String |
setPropertyValue(String name,
Object value)
Sets a new value to the given property, returns an error message if failed
and null if successful.
|
void |
setTickCount(int tickCount)
The animation rotates with EDT ticks, but not for every tick.
|
void |
setTintColor(int tintColor)
The tinting color of the screen when the showInfiniteBlocking method is invoked
|
Dialog |
showInfiniteBlocking()
Shows the infinite progress over the whole screen, the blocking can be competed by calling
dispose()
on the returned Dialog . |
Dialog |
showInifiniteBlocking()
Deprecated.
typo in method name please use
showInfiniteBlocking() instead |
addDragFinishedListener, addDragOverListener, addDropListener, addFocusListener, addLongPressListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, addStateChangeListener, bindProperty, blocksSideSwipe, calcScrollSize, cancelRepaints, clearClientProperties, contains, containsOrOwns, createStyleAnimation, deinitializeCustomStyle, dragEnter, dragExit, dragFinished, draggingOver, dragInitiated, drawDraggedImage, drop, fireClicked, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getAllStyles, getAnimationManager, getBaseline, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBorder, getBottomGap, getBoundPropertyValue, getBounds, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getCursor, getDefaultDragTransparency, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragRegionStatus, getDragSpeed, getDragTransparency, getEditingDelegate, getGridPosX, getGridPosY, getHeight, getInlineAllStyles, getInlineDisabledStyles, getInlinePressedStyles, getInlineSelectedStyles, getInlineStylesTheme, getInlineUnselectedStyles, getInnerHeight, getInnerPreferredH, getInnerPreferredW, getInnerWidth, getInnerX, getInnerY, getLabelForComponent, getName, getNativeOverlay, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getOuterHeight, getOuterPreferredH, getOuterPreferredW, getOuterWidth, getOuterX, getOuterY, getOwner, getParent, getPreferredH, getPreferredSize, getPreferredSizeStr, getPreferredTabIndex, getPreferredW, getPressedStyle, getPropertyTypeNames, getSameHeight, getSameWidth, getScrollable, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getSideGap, getStyle, getTabIndex, getTensileLength, getTextSelectionSupport, getTooltip, getUIID, getUIManager, getUnselectedStyle, getVisibleBounds, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFixedPreferredSize, hasFocus, hideNativeOverlay, initCustomStyle, initDisabledStyle, initLaf, initPressedStyle, initSelectedStyle, initUnselectedStyle, installDefaultPainter, isAlwaysTensile, isBlockLead, isCellRenderer, isChildOf, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isEditable, isEditing, isEnabled, isFlatten, isFocusable, isGrabsPointerEvents, isHidden, isHidden, isHideInLandscape, isHideInPortrait, isIgnorePointerEvents, isInClippingRegion, isInitialized, isOpaque, isOwnedBy, isPinchBlocksDragAndDrop, isRippleEffect, isRTL, isScrollable, isScrollableX, isScrollableY, isScrollVisible, isSelectableInteraction, isSetCursorSupported, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isTraversable, isVisible, keyPressed, keyReleased, keyRepeated, laidOut, longKeyPress, longPointerPress, onScrollX, onScrollY, paintBackground, paintBackgrounds, paintBorder, paintBorderBackground, paintComponent, paintComponent, paintIntersectingComponentsAbove, paintLock, paintLockRelease, paintRippleOverlay, paintScrollbars, paintScrollbarX, paintScrollbarY, paintShadows, paramString, parsePreferredSize, pinch, pinch, pinchReleased, pointerDragged, pointerDragged, pointerHover, pointerHoverPressed, pointerHoverReleased, pointerPressed, pointerPressed, pointerReleased, pointerReleased, putClientProperty, refreshTheme, refreshTheme, refreshTheme, remove, removeDragFinishedListener, removeDragOverListener, removeDropListener, removeFocusListener, removeLongPressListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, removeStateChangeListener, repaint, repaint, requestFocus, resetFocusable, respondsToPointerEvents, scrollRectToVisible, scrollRectToVisible, setAlwaysTensile, setBlockLead, setBoundPropertyValue, setCellRenderer, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setCursor, setDefaultDragTransparency, setDirtyRegion, setDisabledStyle, setDraggable, setDragTransparency, setDropTarget, setEditingDelegate, setEnabled, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHeight, setHidden, setHidden, setHideInLandscape, setHideInPortrait, setIgnorePointerEvents, setInitialized, setInlineAllStyles, setInlineDisabledStyles, setInlinePressedStyles, setInlineSelectedStyles, setInlineStylesTheme, setInlineUnselectedStyles, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setOpaque, setOwner, setPinchBlocksDragAndDrop, setPreferredH, setPreferredSize, setPreferredSizeStr, setPreferredTabIndex, setPreferredW, setPressedStyle, setRippleEffect, setRTL, setSameHeight, setSameSize, setSameWidth, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setShouldCalcPreferredSize, setSize, setSmoothScrolling, setSnapToGrid, setTabIndex, setTactileTouch, setTensileDragEnabled, setTensileLength, setTooltip, setTraversable, setUIID, setUIID, setUnselectedStyle, setVisible, setWidth, setX, setY, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, shouldRenderComponentSelection, showNativeOverlay, startEditingAsync, stopEditing, stripMarginAndPadding, styleChanged, toImage, toString, unbindProperty, updateNativeOverlay, visibleBoundsContains
public InfiniteProgress()
public static boolean isDefaultMaterialDesignMode()
public static void setDefaultMaterialDesignMode(boolean aDefaultMaterialDesignMode)
aDefaultMaterialDesignMode
- the defaultMaterialDesignMode to setpublic static int getDefaultMaterialDesignColor()
public static void setDefaultMaterialDesignColor(int aDefaultMaterialDesignColor)
aDefaultMaterialDesignColor
- the defaultMaterialDesignColor to setpublic Dialog showInifiniteBlocking()
showInfiniteBlocking()
insteaddispose()
on the returned Dialog
.
public Dialog showInfiniteBlocking()
dispose()
on the returned Dialog
.
protected void initComponent()
initComponent
in class Component
protected void deinitialize()
deinitialize
in class Component
public boolean animate()
animate(boolean)
.public boolean animate(boolean force)
force
- If false, then the animation is only updated if the progress is visible and on
the current form. True will force the update.protected Dimension calcPreferredSize()
calcPreferredSize
in class Component
public void paint(Graphics g)
public Image getAnimation()
public void setAnimation(Image animation)
animation
- the animation to setpublic String[] getPropertyNames()
getPropertyNames
in class Component
public Class[] getPropertyTypes()
getPropertyTypes
in class Component
public Object getPropertyValue(String name)
getPropertyValue
in class Component
name
- the name of the propertypublic String setPropertyValue(String name, Object value)
setPropertyValue
in class Component
name
- the name of the propertyvalue
- new value for the propertypublic int getTintColor()
public void setTintColor(int tintColor)
tintColor
- the tintColor to setpublic int getTickCount()
public void setTickCount(int tickCount)
tickCount
- the tickCount to setpublic int getAngleIncrease()
public void setAngleIncrease(int angleIncrease)
angleIncrease
- the angleIncrease to setpublic boolean isMaterialDesignMode()
public void setMaterialDesignMode(boolean materialDesignMode)
materialDesignMode
- the materialDesignMode to setpublic int getMaterialDesignColor()
public void setMaterialDesignColor(int materialDesignColor)
materialDesignColor
- the materialDesignColor to set