public class InfiniteProgress
ImplementsAnimation, Editable, StyleListener
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:
myContainer.add(new InfiniteProgress());
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:
Dialog ip = new InfiniteProgress().showInifiniteBlocking();
// do some long operation here using invokeAndBlock or do something in a separate thread and callback later
// when you are done just call
ip.dispose();
Constructors
public InfiniteProgress() | Default constructor to define the UIID |
Methods
public static boolean isDefaultMaterialDesignMode() | Indicates whether infinite progress and pull to refresh work in the material design mode by default |
public static void setDefaultMaterialDesignMode(boolean aDefaultMaterialDesignMode) | Indicates whether infinite progress and pull to refresh work in the material design mode by default |
public static int getDefaultMaterialDesignColor() | The default color of the current material design progress spinner |
public static void setDefaultMaterialDesignColor(int aDefaultMaterialDesignColor) | The default color of the current material design progress spinner |
public Dialog showInifiniteBlocking() | Deprecated Shows the infinite progress over the whole screen, the blocking can be competed by calling dispose() on the returned Dialog. |
public Dialog showInfiniteBlocking() | Shows the infinite progress over the whole screen, the blocking can be competed by calling dispose() on the returned Dialog. |
protected void initComponent() | Allows subclasses to bind functionality that relies on fully initialized and “ready for action” component state |
protected void deinitialize() | Invoked to indicate that the component initialization is being reversed since the component was detached from the container hierarchy. |
public boolean animate() | Updates the progress animation. |
public boolean animate(boolean force) | Updates the progress animation. |
protected Dimension calcPreferredSize() | Calculates the preferred size based on component content. |
public 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. |
public Image getAnimation() | |
public void setAnimation(Image animation) | Allows setting the image that will be rotated as part of this effect |
public 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 |
public Class[] getPropertyTypes() | Matches the property names method (see that method for further details). |
public Object getPropertyValue(String name) | Returns the current value of the property name, this method is used by the GUI builder |
public String setPropertyValue(String name, Object value) | Sets a new value to the given property, returns an error message if failed and null if successful. |
public int getTintColor() | The tinting color of the screen when the showInfiniteBlocking method is invoked |
public void setTintColor(int tintColor) | The tinting color of the screen when the showInfiniteBlocking method is invoked |
public int getTickCount() | The animation rotates with EDT ticks, but not for every tick. |
public void setTickCount(int tickCount) | The animation rotates with EDT ticks, but not for every tick. |
public 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. |
public 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. |
public boolean isMaterialDesignMode() | Indicates whether this instance of infinite progress works in the material design mode by default |
public void setMaterialDesignMode(boolean materialDesignMode) | Indicates whether this instance of infinite progress works in the material design mode by default |
public int getMaterialDesignColor() | The color of the current material design progress spinner |
public void setMaterialDesignColor(int materialDesignColor) | The color of the current material design progress spinner |
Inherited fields
From Component
DEFAULT_CURSOR, CROSSHAIR_CURSOR, TEXT_CURSOR, WAIT_CURSOR, SW_RESIZE_CURSOR, SE_RESIZE_CURSOR, NW_RESIZE_CURSOR, NE_RESIZE_CURSOR, N_RESIZE_CURSOR, S_RESIZE_CURSOR, W_RESIZE_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, MOVE_CURSOR, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_Y, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_IMMEDIATELY_DRAG_XY, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_CENTER_OFFSET, BRB_OTHER, CENTER, TOP, LEFT, BOTTOM, RIGHT, BASELINE
Inherited methods
From Component
setSameSize, isSetCursorSupported, parsePreferredSize, getDefaultDragTransparency, setDefaultDragTransparency, getEditingDelegate, setEditingDelegate, getCursor, setCursor, showNativeOverlay, hideNativeOverlay, updateNativeOverlay, getNativeOverlay, getAllStyles, getSameWidth, setSameWidth, getSameHeight, setSameHeight, initLaf, getUIManager, getX, setX, getOuterX, getInnerX, getY, setY, getOuterY, getInnerY, isVisible, setVisible, getClientProperty, stripMarginAndPadding, clearClientProperties, putClientProperty, getDirtyRegion, setDirtyRegion, isOpaque, setOpaque, getWidth, setWidth, getOuterWidth, getInnerWidth, getHeight, setHeight, getOuterHeight, getInnerHeight, isDragRegion, getDragRegionStatus, getBaseline, getBaselineResizeBehavior, getPreferredSizeStr, setPreferredSizeStr, getPreferredSize, setPreferredSize, getScrollDimension, calcScrollSize, setScrollSize, getPreferredW, setPreferredW, getPreferredH, setPreferredH, getOuterPreferredH, getInnerPreferredH, getOuterPreferredW, getInnerPreferredW, setSize, getUIID, setUIID, setUIIDFinal, setUIID, getInlineAllStyles, setInlineAllStyles, getInlineSelectedStyles, setInlineSelectedStyles, getInlineUnselectedStyles, setInlineUnselectedStyles, getInlineDisabledStyles, setInlineDisabledStyles, getInlinePressedStyles, setInlinePressedStyles, remove, getParent, getOwner, setOwner, isOwnedBy, containsOrOwns, addFocusListener, removeFocusListener, addScrollListener, removeScrollListener, fireClicked, isSelectableInteraction, getSelectCommandText, setSelectCommandText, getLabelForComponent, setLabelForComponent, focusGained, focusLost, paintBackgrounds, paintShadows, getAbsoluteX, getAbsoluteY, isInClippingRegion, paintIntersectingComponentsAbove, paintScrollbars, paintScrollbarX, getScrollOpacity, getSelectedRect, paintScrollbarY, paintComponent, paintComponent, getBorder, getScrollable, paintBackground, isScrollable, isScrollableX, isScrollableY, getScrollX, setScrollX, getScrollY, setScrollY, onScrollX, onScrollY, getDraggedx, getDraggedy, getBottomGap, getSideGap, contains, visibleBoundsContains, hasFixedPreferredSize, getBounds, getBounds, getVisibleBounds, getVisibleBounds, isFocusable, setFocusable, onSetFocusable, resetFocusable, getTabIndex, setTabIndex, getPreferredTabIndex, setPreferredTabIndex, isTraversable, setTraversable, setShouldCalcPreferredSize, handlesInput, setHandlesInput, consumesRawTextInput, hasFocus, setFocus, getComponentForm, getTopLevelContainer, repaint, repaint, longKeyPress, keyPressed, keyReleased, keyRepeated, registerForAnimation, deregisterFromAnimation, getAnimationManager, getScrollAnimationSpeed, setScrollAnimationSpeed, isBlockLead, setBlockLead, isIgnorePointerEvents, setIgnorePointerEvents, isRippleEffect, setRippleEffect, getInlineStylesTheme, setInlineStylesTheme, shouldRenderComponentSelection, isHideInLandscape, setHideInLandscape, createStyleAnimation, isSmoothScrolling, setSmoothScrolling, pointerHover, stopScrollMomentum, pointerHoverReleased, pointerHoverPressed, pinch, pinchReleased, pinch, rotation, isPinchBlocksDragAndDrop, setPinchBlocksDragAndDrop, pointerDragged, getDragImage, getDragTransparency, setDragTransparency, toImage, dragInitiated, drawDraggedImage, draggingOver, dragEnter, dragExit, drop, addPullToRefresh, setPullToRefresh, respondsToPointerEvents, pointerDragged, isStickyDrag, pointerPressed, isDragAndDropOperation, pointerPressed, pointerReleased, longPointerPress, pointerReleased, setVerticalScrollBounds, setHorizontalScrollBounds, isVScrollThumbGrabbed, isHScrollThumbGrabbed, isVScrollThumbHover, isHScrollThumbHover, isTensileDragEnabled, setTensileDragEnabled, getTextSelectionSupport, addDropListener, removeDropListener, addDragOverListener, removeDragOverListener, isNativeDragSource, setNativeDragSource, getNativeDragOperation, setNativeDragOperation, createNativeDragOperation, isNativeDropTarget, setNativeDropTarget, getAcceptedDropMimeTypes, setAcceptedDropMimeTypes, getAcceptedDropActions, setAcceptedDropActions, canAcceptNativeDrop, nativeDragEnter, nativeDragOver, nativeDragExit, nativeDrop, addNativeDropListener, removeNativeDropListener, addNativeDragOverListener, removeNativeDragOverListener, dragFinished, addDragFinishedListener, addStateChangeListener, removeStateChangeListener, addPointerPressedListener, addLongPressListener, addContextMenuListener, removeContextMenuListener, addMouseWheelListener, removeMouseWheelListener, addStylusListener, removeStylusListener, mouseWheel, paintRippleOverlay, removePointerPressedListener, removeLongPressListener, removeDragFinishedListener, addPointerReleasedListener, removePointerReleasedListener, addPointerDraggedListener, removePointerDraggedListener, getDragSpeed, getStyle, getPressedStyle, setPressedStyle, initUnselectedStyle, initPressedStyle, initDisabledStyle, initSelectedStyle, getUnselectedStyle, setUnselectedStyle, getSelectedStyle, setSelectedStyle, getDisabledStyle, setDisabledStyle, installDefaultPainter, requestFocus, toString, paramString, refreshTheme, refreshTheme, refreshTheme, isDragActivated, getGridPosY, getGridPosX, scrollRectToVisible, scrollRectToVisible, paintBorder, paintBorderBackground, isCellRenderer, setCellRenderer, isScrollVisible, setScrollVisible, setIsScrollVisible, startEditingAsync, stopEditing, isEditing, isEditable, laidOut, isInitialized, setInitialized, styleChanged, getNextFocusDown, setNextFocusDown, getNextFocusUp, setNextFocusUp, getNextFocusLeft, setNextFocusLeft, getNextFocusRight, setNextFocusRight, isEnabled, setEnabled, getName, setName, initCustomStyle, deinitializeCustomStyle, isRTL, setRTL, isTactileTouch, isTactileTouch, setTactileTouch, getPropertyTypeNames, paintLockRelease, paintLock, isSnapToGrid, setSnapToGrid, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, blocksSideSwipe, isFlatten, setFlatten, getTensileLength, setTensileLength, isGrabsPointerEvents, setGrabsPointerEvents, getScrollOpacityChangeSpeed, setScrollOpacityChangeSpeed, growShrink, isAlwaysTensile, setAlwaysTensile, isDraggable, setDraggable, isDropTarget, setDropTarget, isChildOf, isHideInPortrait, setHideInPortrait, cancelRepaints, getBindablePropertyNames, getBindablePropertyTypes, bindProperty, unbindProperty, getBoundPropertyValue, setBoundPropertyValue, getCloudBoundProperty, setCloudBoundProperty, getCloudDestinationProperty, setCloudDestinationProperty, getComponentState, setComponentState, setHidden, isHidden, setHidden, isHidden, announceForAccessibility, getAccessibilityText, setAccessibilityText, getSemantics, getAccessibilityNode, accessibilityChanged, accessibilityChanged, getTooltip, setTooltip
Constructor details
InfiniteProgress
public InfiniteProgress()Method details
isDefaultMaterialDesignMode
public static boolean isDefaultMaterialDesignMode()Returns
setDefaultMaterialDesignMode
public static void setDefaultMaterialDesignMode(boolean aDefaultMaterialDesignMode)Parameters
aDefaultMaterialDesignModeboolean- the defaultMaterialDesignMode to set
getDefaultMaterialDesignColor
public static int getDefaultMaterialDesignColor()Returns
setDefaultMaterialDesignColor
public static void setDefaultMaterialDesignColor(int aDefaultMaterialDesignColor)Parameters
aDefaultMaterialDesignColorint- the defaultMaterialDesignColor to set
showInifiniteBlocking
public Dialog showInifiniteBlocking()#showInfiniteBlocking() insteadShows the infinite progress over the whole screen, the blocking can be competed by calling dispose()
on the returned Dialog.
Dialog ip = new InfiniteProgress().showInifiniteBlocking();
// do some long operation here using invokeAndBlock or do something in a separate thread and callback later
// when you are done just call
ip.dispose();
Returns
showInfiniteBlocking
public Dialog showInfiniteBlocking()Shows the infinite progress over the whole screen, the blocking can be competed by calling dispose()
on the returned Dialog.
Dialog ip = new InfiniteProgress().showInifiniteBlocking();
// do some long operation here using invokeAndBlock or do something in a separate thread and callback later
// when you are done just call
ip.dispose();
Returns
initComponent
protected void initComponent()deinitialize
protected void deinitialize()animate
public boolean animate()#animate(boolean).Returns
animate
public boolean animate(boolean force)Parameters
forceboolean- If false, then the animation is only updated if the progress is visible and on the current form. True will force the update.
Returns
calcPreferredSize
protected Dimension calcPreferredSize()Returns
paint
public void paint(Graphics g)Parameters
gGraphics- the component graphics
getAnimation
public Image getAnimation()Returns
setAnimation
public void setAnimation(Image animation)Parameters
animationImage- the animation to set
getPropertyNames
public String[] getPropertyNames()Returns
getPropertyTypes
public Class[] getPropertyTypes()Returns
getPropertyValue
public Object getPropertyValue(String name)Parameters
nameString- the name of the property
Returns
setPropertyValue
public String setPropertyValue(String name, Object value)Parameters
nameString- the name of the property
valueObject- new value for the property
Returns
getTintColor
public int getTintColor()Returns
setTintColor
public void setTintColor(int tintColor)Parameters
tintColorint- the tintColor to set
getTickCount
public int getTickCount()Returns
setTickCount
public void setTickCount(int tickCount)Parameters
tickCountint- the tickCount to set
getAngleIncrease
public int getAngleIncrease()Returns
setAngleIncrease
public void setAngleIncrease(int angleIncrease)Parameters
angleIncreaseint- the angleIncrease to set
isMaterialDesignMode
public boolean isMaterialDesignMode()Returns
setMaterialDesignMode
public void setMaterialDesignMode(boolean materialDesignMode)Parameters
materialDesignModeboolean- the materialDesignMode to set
getMaterialDesignColor
public int getMaterialDesignColor()Returns
setMaterialDesignColor
public void setMaterialDesignColor(int materialDesignColor)Parameters
materialDesignColorint- the materialDesignColor to set