public class WebStepProgress extends javax.swing.JComponent implements javax.swing.SwingConstants, ShapeProvider, SizeMethods<WebStepProgress>
Progress display is based on two main things: selected step and progress value. Selected step determines which step from the list of added steps is currently selected. Progress determines the progress value acomplished to reach next step.
| Modifier and Type | Class and Description |
|---|---|
protected class |
WebStepProgress.ProgressLayout
Custom WebStepProgress layout that places progress labels properly.
|
protected class |
WebStepProgress.ProgressMouseAdapter
Custom mouse adapter that handles steps and progress changes.
|
javax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
protected java.awt.Shape |
borderShape |
protected java.awt.Color |
disabledProgressColor |
protected boolean |
displayLabels |
protected java.awt.LinearGradientPaint |
fillPaint |
protected java.awt.Shape |
fillShape |
protected int |
labelsPosition |
protected java.awt.Insets |
margin
Style and other settings.
|
protected int |
orientation |
protected int |
pathFillWidth |
protected int |
pathWidth |
protected float |
progress |
protected java.awt.Color |
progressColor |
protected int |
selectedStep |
protected boolean |
selecting
Runtime variables.
|
protected boolean |
selectionEnabled |
protected StepSelectionMode |
selectionMode |
protected int |
shadeWidth |
protected int |
sideWidth |
protected int |
spacing |
protected int |
stepControlFillRound |
protected int |
stepControlFillWidth |
protected int |
stepControlRound |
protected int |
stepControlWidth |
protected java.util.List<StepData> |
steps
Progress data.
|
protected int |
stepsSpacing |
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_ALIGNMENTBOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WESTUNDEFINED| Constructor and Description |
|---|
WebStepProgress()
Constructs new WebStepProgress with three default steps.
|
WebStepProgress(java.awt.Component... labels)
Constructs new WebStepProgress with steps using specified labels.
|
WebStepProgress(int amount)
Constructs new WebStepProgress with the specified amount of default steps.
|
WebStepProgress(java.util.List<StepData> steps)
Constructs new WebStepProgress with the specified steps.
|
WebStepProgress(StepData... steps)
Constructs new WebStepProgress with the specified steps.
|
WebStepProgress(java.lang.String... names)
Constructs new WebStepProgress with steps using specified names in labels.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSteps(java.awt.Component... steps)
Adds steps with the specified label components.
|
void |
addSteps(java.util.List<StepData> steps)
Adds new steps.
|
void |
addSteps(java.lang.String... steps)
Adds new steps with the specified names.
|
protected void |
clearStep(StepData step)
Clears specified step.
|
protected void |
clearSteps()
Clears steps.
|
protected java.awt.Shape |
createBorderShape()
Creates and returns border shape.
|
static java.util.List<StepData> |
createDefaultData(int amount)
Returns specified amount of default steps with empty label components.
|
protected java.awt.LinearGradientPaint |
createFillPaint()
Creates and returns fill paint.
|
protected java.awt.Shape |
createFillShape()
Creates and returns progress shape.
|
static java.util.List<StepData> |
createSteps(java.awt.Component... labels)
Returns steps with the specified label components.
|
static java.util.List<StepData> |
createSteps(java.lang.String... names)
Returns steps with WebLabel components using the specified step names.
|
WebStepProgress.ProgressLayout |
getActualLayout()
Returns actual component layout.
|
protected java.awt.Shape |
getBorderShape()
Returns border shape.
|
java.awt.Color |
getDisabledProgressColor()
Returns disabled progress fill color.
|
protected java.awt.LinearGradientPaint |
getFillPaint()
Returns fill paint.
|
int |
getLabelsPosition()
Returns labels position relative to progress.
|
java.awt.Insets |
getMargin()
Returns sides margin.
|
int |
getMaximumHeight()
Returns component maximum height.
|
int |
getMaximumWidth()
Returns component maximum width.
|
int |
getMinimumHeight()
Returns component minimum height.
|
int |
getMinimumWidth()
Returns component minimum width.
|
int |
getOrientation()
Returns progress orientation.
|
protected java.awt.Point |
getPathEnd()
Returns path end point.
|
protected java.awt.Shape |
getPathFillShape()
Creates and returns path fill shape.
|
int |
getPathFillWidth()
Returns path fill width.
|
protected int |
getPathLength()
Returns path length.
|
protected java.awt.Shape |
getPathShape()
Creates and returns path shape.
|
protected java.awt.Point |
getPathStart()
Returns path start point.
|
int |
getPathWidth()
Returns path width.
|
int |
getPreferredHeight()
Returns component preferred height.
|
java.awt.Dimension |
getPreferredSize()
Returns component preferred size.
|
int |
getPreferredWidth()
Returns component preferred width.
|
float |
getProgress()
Returns progress value.
|
java.awt.Color |
getProgressColor()
Returns progress fill color.
|
protected java.awt.Shape |
getProgressShape()
Returns progress shape.
|
StepData |
getSelectedStep()
Returns selected step.
|
int |
getSelectedStepIndex()
Returns selected step index.
|
StepSelectionMode |
getSelectionMode()
Returns progress selection mode.
|
int |
getShadeWidth()
Returns decoration shade width.
|
int |
getSpacing()
Returns spacing between labels and progress.
|
StepData |
getStep(int index)
Returns step at the specified index.
|
protected java.awt.Shape |
getStepBorderShape(int step)
Creates and returns step border shape.
|
protected java.awt.Point |
getStepCenter(int step)
Returns step center point.
|
int |
getStepControlFillRound()
Returns step control fill round.
|
int |
getStepControlFillWidth()
Returns step control fill width.
|
int |
getStepControlRound()
Returns step control round.
|
int |
getStepControlWidth()
Returns step control width.
|
protected java.awt.Shape |
getStepFillShape(int step)
Creates and returns step fill shape.
|
java.util.List<StepData> |
getSteps()
Returns list of existing steps.
|
int |
getStepsAmount()
Returns amount of steps.
|
int |
getStepShapeIndexAt(java.awt.Point point)
Returns step shape index at the specified point or -1 if none found.
|
int |
getStepsSpacing()
Returns spacing between step labels.
|
float |
getTotalProgress()
Returns total progress.
|
float |
getTotalProgressAt(java.awt.Point point)
Returns total progress for the specified point on progress component.
|
boolean |
isDisplayLabels()
Returns whether step labels should be displayed or not.
|
boolean |
isSelectionEnabled()
Returns whether progress selection is allowed or not.
|
protected void |
paintComponent(java.awt.Graphics g) |
java.awt.Shape |
provideShape()
Returns component shape.
|
void |
removeStep(int index)
Removes step under the specified index.
|
void |
removeStep(StepData stepData)
Removes specified step.
|
void |
setDisabledProgressColor(java.awt.Color color)
Sets disabled progress fill color.
|
void |
setDisplayLabels(boolean displayLabels)
Sets whether step labels should be displayed or not.
|
void |
setLabelsPosition(int position)
Sets labels position relative to progress.
|
void |
setMargin(java.awt.Insets margin)
Sets sides margin.
|
void |
setMargin(int spacing)
Sets sides margin.
|
void |
setMargin(int top,
int left,
int bottom,
int right)
Sets sides margin.
|
WebStepProgress |
setMaximumHeight(int maximumHeight)
Sets component maximum height.
|
WebStepProgress |
setMaximumWidth(int maximumWidth)
Sets component maximum width.
|
WebStepProgress |
setMinimumHeight(int minimumHeight)
Sets component minimum height.
|
WebStepProgress |
setMinimumWidth(int minimumWidth)
Sets component minimum width.
|
void |
setOrientation(int orientation)
Sets progress orientation.
|
void |
setPathFillWidth(int width)
Sets path fill width.
|
void |
setPathWidth(int width)
Sets path width.
|
WebStepProgress |
setPreferredHeight(int preferredHeight)
Sets component preferred height.
|
WebStepProgress |
setPreferredSize(int width,
int height)
Sets component preferred size.
|
WebStepProgress |
setPreferredWidth(int preferredWidth)
Sets component preferred width.
|
void |
setProgress(float progress)
Sets progress value.
|
void |
setProgressColor(java.awt.Color color)
Sets progress fill color.
|
void |
setSelectedStep(StepData step)
Sets selected step.
|
void |
setSelectedStepIndex(int index)
Sets selected step index.
|
void |
setSelectionEnabled(boolean enabled)
Sets whether progress selection is allowed or not.
|
void |
setSelectionMode(StepSelectionMode mode)
Sets progress selection mode.
|
void |
setShadeWidth(int shadeWidth)
Sets decoration shade width.
|
void |
setSpacing(int spacing)
Sets spacing between labels and progress.
|
void |
setStepControlFillRound(int round)
Sets step control fill round.
|
void |
setStepControlFillWidth(int width)
Sets step control fill width.
|
void |
setStepControlRound(int round)
Sets step control round.
|
void |
setStepControlWidth(int width)
Sets step control width.
|
void |
setSteps(java.awt.Component... labels)
Sets steps with the specified label components.
|
void |
setSteps(int amount)
Sets specified amount of new default steps with empty label components.
|
void |
setSteps(java.util.List<StepData> steps)
Sets new steps.
|
void |
setSteps(java.lang.String... names)
Sets new steps with the specified names.
|
void |
setStepsSpacing(int spacing)
Sets spacing between step labels.
|
void |
setTotalProgress(float progress)
Sets total progress.
|
protected void |
updateBorderShape()
Updates border shape.
|
protected void |
updateFillShape()
Updates fill shape.
|
protected void |
updateShapes()
Updates all shapes.
|
protected void |
validateSelectedStep()
Revalidates selected step.
|
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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, updateUIadd, 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, getAccessibleContext, 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, 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, transferFocusUpCycleprotected java.awt.Insets margin
protected int shadeWidth
protected int stepControlWidth
protected int stepControlRound
protected int stepControlFillWidth
protected int stepControlFillRound
protected int pathWidth
protected int pathFillWidth
protected java.awt.Color progressColor
protected java.awt.Color disabledProgressColor
protected boolean displayLabels
protected int orientation
protected int labelsPosition
protected int spacing
protected int stepsSpacing
protected boolean selectionEnabled
protected StepSelectionMode selectionMode
protected final java.util.List<StepData> steps
protected int selectedStep
protected float progress
protected boolean selecting
protected int sideWidth
protected java.awt.Shape borderShape
protected java.awt.LinearGradientPaint fillPaint
protected java.awt.Shape fillShape
public WebStepProgress()
public WebStepProgress(int amount)
amount - amount of default stepspublic WebStepProgress(java.lang.String... names)
names - label namespublic WebStepProgress(java.awt.Component... labels)
labels - step labelspublic WebStepProgress(StepData... steps)
steps - stepspublic WebStepProgress(java.util.List<StepData> steps)
steps - stepspublic java.awt.Insets getMargin()
public void setMargin(java.awt.Insets margin)
margin - new sides marginpublic void setMargin(int top,
int left,
int bottom,
int right)
top - top side marginleft - left side marginbottom - bottom side marginright - right side marginpublic void setMargin(int spacing)
spacing - sides marginpublic int getShadeWidth()
public void setShadeWidth(int shadeWidth)
shadeWidth - decoration shade widthpublic int getStepControlWidth()
public void setStepControlWidth(int width)
width - step control widthpublic int getStepControlRound()
public void setStepControlRound(int round)
round - step control roundpublic int getStepControlFillWidth()
public void setStepControlFillWidth(int width)
width - new step control fill widthpublic int getStepControlFillRound()
public void setStepControlFillRound(int round)
round - new step control fill roundpublic int getPathWidth()
public void setPathWidth(int width)
width - new path widthpublic int getPathFillWidth()
public void setPathFillWidth(int width)
width - new path fill widthpublic java.awt.Color getProgressColor()
public void setProgressColor(java.awt.Color color)
color - new progress fill colorpublic java.awt.Color getDisabledProgressColor()
public void setDisabledProgressColor(java.awt.Color color)
color - new disabled progress fill colorpublic boolean isDisplayLabels()
public void setDisplayLabels(boolean displayLabels)
displayLabels - whether step labels should be displayed or notpublic int getOrientation()
public void setOrientation(int orientation)
orientation - new progress orientationpublic int getLabelsPosition()
public void setLabelsPosition(int position)
position - new labels position relative to progresspublic int getSpacing()
public void setSpacing(int spacing)
spacing - new spacing between labels and progresspublic int getStepsSpacing()
public void setStepsSpacing(int spacing)
spacing - new spacing between step labelspublic boolean isSelectionEnabled()
public void setSelectionEnabled(boolean enabled)
enabled - whether progress selection is allowed or notpublic StepSelectionMode getSelectionMode()
StepSelectionModepublic void setSelectionMode(StepSelectionMode mode)
mode - new progress selection modeStepSelectionModepublic int getStepsAmount()
public java.util.List<StepData> getSteps()
public StepData getStep(int index)
index - step indexpublic void setSteps(java.lang.String... names)
names - new steps namespublic void setSteps(java.awt.Component... labels)
labels - new steps label componentspublic void setSteps(java.util.List<StepData> steps)
steps - new stepspublic void addSteps(java.lang.String... steps)
steps - new steps namespublic void addSteps(java.awt.Component... steps)
steps - new steps label componentspublic void addSteps(java.util.List<StepData> steps)
steps - new stepspublic void removeStep(int index)
index - step indexpublic void removeStep(StepData stepData)
stepData - step to removepublic void setSteps(int amount)
amount - default steps amountprotected void clearSteps()
protected void clearStep(StepData step)
step - step to clearpublic StepData getSelectedStep()
public void setSelectedStep(StepData step)
step - new selected steppublic int getSelectedStepIndex()
public void setSelectedStepIndex(int index)
index - new selected step indexprotected void validateSelectedStep()
public float getProgress()
public void setProgress(float progress)
progress - new progress valuepublic float getTotalProgress()
public float getTotalProgressAt(java.awt.Point point)
point - point to retrive total progress forpublic void setTotalProgress(float progress)
progress - total progressprotected void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponentpublic java.awt.Shape provideShape()
ShapeProviderprovideShape in interface ShapeProviderprotected void updateBorderShape()
protected void updateFillShape()
protected void updateShapes()
protected java.awt.Shape getBorderShape()
protected java.awt.Shape createBorderShape()
protected java.awt.Shape getStepBorderShape(int step)
step - step indexprotected java.awt.LinearGradientPaint getFillPaint()
protected java.awt.LinearGradientPaint createFillPaint()
protected java.awt.Shape getProgressShape()
protected java.awt.Shape createFillShape()
protected java.awt.Shape getStepFillShape(int step)
step - step indexprotected java.awt.Shape getPathShape()
protected java.awt.Shape getPathFillShape()
protected java.awt.Point getPathStart()
protected java.awt.Point getPathEnd()
protected java.awt.Point getStepCenter(int step)
step - step indexprotected int getPathLength()
public int getStepShapeIndexAt(java.awt.Point point)
point - point to retrive shape index forpublic int getPreferredWidth()
SizeMethodsgetPreferredWidth in interface SizeMethods<WebStepProgress>public WebStepProgress setPreferredWidth(int preferredWidth)
SizeMethodsSizeMethods.UNDEFINED to let component choose preferred width on its own.setPreferredWidth in interface SizeMethods<WebStepProgress>preferredWidth - new component preferred widthpublic int getPreferredHeight()
SizeMethodsgetPreferredHeight in interface SizeMethods<WebStepProgress>public WebStepProgress setPreferredHeight(int preferredHeight)
SizeMethodsSizeMethods.UNDEFINED to let component choose preferred height on its own.setPreferredHeight in interface SizeMethods<WebStepProgress>preferredHeight - new component preferred heightpublic int getMinimumWidth()
SizeMethodsgetMinimumWidth in interface SizeMethods<WebStepProgress>public WebStepProgress setMinimumWidth(int minimumWidth)
SizeMethodsSizeMethods.UNDEFINED to let component choose minimum width on its own.setMinimumWidth in interface SizeMethods<WebStepProgress>minimumWidth - new component minimum widthpublic int getMinimumHeight()
SizeMethodsgetMinimumHeight in interface SizeMethods<WebStepProgress>public WebStepProgress setMinimumHeight(int minimumHeight)
SizeMethodsSizeMethods.UNDEFINED to let component choose minimum height on its own.setMinimumHeight in interface SizeMethods<WebStepProgress>minimumHeight - new component minimum heightpublic int getMaximumWidth()
SizeMethodsgetMaximumWidth in interface SizeMethods<WebStepProgress>public WebStepProgress setMaximumWidth(int maximumWidth)
SizeMethodsSizeMethods.UNDEFINED to let component choose maximum width on its own.setMaximumWidth in interface SizeMethods<WebStepProgress>maximumWidth - new component maximum widthpublic int getMaximumHeight()
SizeMethodsgetMaximumHeight in interface SizeMethods<WebStepProgress>public WebStepProgress setMaximumHeight(int maximumHeight)
SizeMethodsSizeMethods.UNDEFINED to let component choose maximum height on its own.setMaximumHeight in interface SizeMethods<WebStepProgress>maximumHeight - new component maximum heightpublic java.awt.Dimension getPreferredSize()
SizeMethodsgetPreferredSize in interface SizeMethods<WebStepProgress>getPreferredSize in class javax.swing.JComponentpublic WebStepProgress setPreferredSize(int width, int height)
SizeMethodssetPreferredSize in interface SizeMethods<WebStepProgress>width - component preferred widthheight - component preferred heightpublic WebStepProgress.ProgressLayout getActualLayout()
public static java.util.List<StepData> createSteps(java.lang.String... names)
names - step namespublic static java.util.List<StepData> createSteps(java.awt.Component... labels)
labels - label componentspublic static java.util.List<StepData> createDefaultData(int amount)
amount - steps amount