com.alee.extended.progress
Class WebStepProgress

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.alee.extended.progress.WebStepProgress
All Implemented Interfaces:
ShapeProvider, SizeMethods<WebStepProgress>, SwingMethods, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.swing.SwingConstants

public class WebStepProgress
extends javax.swing.JComponent
implements javax.swing.SwingConstants, ShapeProvider, SizeMethods<WebStepProgress>

User: mgarin Date: 14.01.13 Time: 13:52

See Also:
Serialized Form

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
static int PROGRESS_SELECTION
           
static int STEP_SELECTION
           
 
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 javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WebStepProgress()
           
WebStepProgress(java.awt.Component... steps)
           
WebStepProgress(int steps)
           
WebStepProgress(java.util.List<StepData> steps)
           
WebStepProgress(StepData... steps)
           
WebStepProgress(java.lang.String... steps)
           
 
Method Summary
 void addSteps(java.awt.Component... steps)
           
 void addSteps(java.util.List<StepData> steps)
           
 void addSteps(java.lang.String... steps)
           
static java.util.List<StepData> createDefaultData(int stepsAmount)
           
static java.util.List<StepData> createSteps(java.awt.Component[] steps)
           
static java.util.List<StepData> createSteps(java.lang.String[] steps)
          Additional useful methods
 int getFillPathSize()
           
 int getLabelsPosition()
          Step labels positioning
 java.awt.Insets getMargin()
          Component global margin
 int getMinimumHeight()
          Returns component minimum height.
 int getMinimumWidth()
          Returns component minimum width.
 int getOrientation()
          Step progress bar orientation
 int getPathSize()
          Progress path sizes
 int getPreferredHeight()
          Returns component preferred height.
 java.awt.Dimension getPreferredSize()
          Returns component preferred size.
 int getPreferredWidth()
          Returns component preferred width.
 float getProgress()
          Progress operations
 int getSelectedStep()
          Step operations
 int getSelectionMode()
           
 int getShadeWidth()
          Shade width
 int getSpacing()
          Spacing between labels and progress
 StepData getStep(int index)
           
 int getStepCircleAt(java.awt.Point point)
           
 int getStepControlFillRound()
           
 int getStepControlFillSize()
           
 int getStepControlRound()
           
 int getStepControlSize()
          Step control sizes
 java.util.List<StepData> getSteps()
           
 int getStepsAmount()
          Steps modification methods
 float getTotalProgress()
          Total progress change
 float getTotalProgressAt(java.awt.Point point)
           
 boolean isSelectionEnabled()
          Selection
 boolean isShowLabels()
          Show step labels
protected  void paintComponent(java.awt.Graphics g)
          Custom painting method
 java.awt.Shape provideShape()
          Basic component shape
 void removeStep(int index)
           
 void removeStep(StepData stepData)
           
 void setFillPathSize(int fillPathSize)
           
 void setLabelsPosition(int labelsPosition)
           
 void setMargin(java.awt.Insets margin)
           
 void setMargin(int spacing)
           
 void setMargin(int top, int left, int bottom, int right)
           
 WebStepProgress setMinimumHeight(int minimumHeight)
          Sets component minimum height.
 WebStepProgress setMinimumWidth(int minimumWidth)
          Sets component minimum width.
 void setOrientation(int orientation)
           
 void setPathSize(int pathSize)
           
 WebStepProgress setPreferredHeight(int preferredHeight)
          Sets component preferred height.
 WebStepProgress setPreferredWidth(int preferredWidth)
          Sets component preferred width.
 void setProgress(float progress)
           
 void setSelectedStep(int selectedStep)
           
 void setSelectionEnabled(boolean selectionEnabled)
           
 void setSelectionMode(int selectionMode)
           
 void setShadeWidth(int shadeWidth)
           
 void setShowLabels(boolean showLabels)
           
 void setSpacing(int spacing)
           
 void setStepControlFillRound(int stepControlFillRound)
           
 void setStepControlFillSize(int stepControlFillSize)
           
 void setStepControlRound(int stepControlRound)
           
 void setStepControlSize(int stepControlSize)
           
 void setSteps(java.awt.Component... steps)
           
 void setSteps(java.util.List<StepData> steps)
           
 void setSteps(java.lang.String... steps)
           
 void setStepsAmount(int stepsAmount)
           
 void setTotalProgress(float totalProgress)
           
protected  void updateBorderShape()
          Shapes cache update methods
protected  void updateFillShape()
           
protected  void updateShapes()
           
 
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, 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

STEP_SELECTION

public static final int STEP_SELECTION
See Also:
Constant Field Values

PROGRESS_SELECTION

public static final int PROGRESS_SELECTION
See Also:
Constant Field Values
Constructor Detail

WebStepProgress

public WebStepProgress()

WebStepProgress

public WebStepProgress(int steps)

WebStepProgress

public WebStepProgress(java.lang.String... steps)

WebStepProgress

public WebStepProgress(java.awt.Component... steps)

WebStepProgress

public WebStepProgress(StepData... steps)

WebStepProgress

public WebStepProgress(java.util.List<StepData> steps)
Method Detail

getMargin

public java.awt.Insets getMargin()
Component global margin


setMargin

public void setMargin(java.awt.Insets margin)

setMargin

public void setMargin(int top,
                      int left,
                      int bottom,
                      int right)

setMargin

public void setMargin(int spacing)

getShadeWidth

public int getShadeWidth()
Shade width


setShadeWidth

public void setShadeWidth(int shadeWidth)

getStepControlSize

public int getStepControlSize()
Step control sizes


setStepControlSize

public void setStepControlSize(int stepControlSize)

getStepControlRound

public int getStepControlRound()

setStepControlRound

public void setStepControlRound(int stepControlRound)

getStepControlFillSize

public int getStepControlFillSize()

setStepControlFillSize

public void setStepControlFillSize(int stepControlFillSize)

getStepControlFillRound

public int getStepControlFillRound()

setStepControlFillRound

public void setStepControlFillRound(int stepControlFillRound)

getPathSize

public int getPathSize()
Progress path sizes


setPathSize

public void setPathSize(int pathSize)

getFillPathSize

public int getFillPathSize()

setFillPathSize

public void setFillPathSize(int fillPathSize)

isShowLabels

public boolean isShowLabels()
Show step labels


setShowLabels

public void setShowLabels(boolean showLabels)

getOrientation

public int getOrientation()
Step progress bar orientation


setOrientation

public void setOrientation(int orientation)

getLabelsPosition

public int getLabelsPosition()
Step labels positioning


setLabelsPosition

public void setLabelsPosition(int labelsPosition)

getSpacing

public int getSpacing()
Spacing between labels and progress


setSpacing

public void setSpacing(int spacing)

isSelectionEnabled

public boolean isSelectionEnabled()
Selection


setSelectionEnabled

public void setSelectionEnabled(boolean selectionEnabled)

getSelectionMode

public int getSelectionMode()

setSelectionMode

public void setSelectionMode(int selectionMode)

getStepsAmount

public int getStepsAmount()
Steps modification methods


getSteps

public java.util.List<StepData> getSteps()

getStep

public StepData getStep(int index)

setSteps

public void setSteps(java.lang.String... steps)

setSteps

public void setSteps(java.awt.Component... steps)

setSteps

public void setSteps(java.util.List<StepData> steps)

addSteps

public void addSteps(java.lang.String... steps)

addSteps

public void addSteps(java.awt.Component... steps)

addSteps

public void addSteps(java.util.List<StepData> steps)

removeStep

public void removeStep(int index)

removeStep

public void removeStep(StepData stepData)

setStepsAmount

public void setStepsAmount(int stepsAmount)

getSelectedStep

public int getSelectedStep()
Step operations


setSelectedStep

public void setSelectedStep(int selectedStep)

getProgress

public float getProgress()
Progress operations


setProgress

public void setProgress(float progress)

getTotalProgress

public float getTotalProgress()
Total progress change


getTotalProgressAt

public float getTotalProgressAt(java.awt.Point point)

setTotalProgress

public void setTotalProgress(float totalProgress)

paintComponent

protected void paintComponent(java.awt.Graphics g)
Custom painting method

Overrides:
paintComponent in class javax.swing.JComponent

provideShape

public java.awt.Shape provideShape()
Basic component shape

Specified by:
provideShape in interface ShapeProvider
Returns:
component shape

updateBorderShape

protected void updateBorderShape()
Shapes cache update methods


updateFillShape

protected void updateFillShape()

updateShapes

protected void updateShapes()

getStepCircleAt

public int getStepCircleAt(java.awt.Point point)

getPreferredWidth

public int getPreferredWidth()
Returns component preferred width.

Specified by:
getPreferredWidth in interface SizeMethods<WebStepProgress>
Returns:
component preferred width

setPreferredWidth

public WebStepProgress setPreferredWidth(int preferredWidth)
Sets component preferred width. Pass -1 to let component choose preferred width on its own.

Specified by:
setPreferredWidth in interface SizeMethods<WebStepProgress>
Parameters:
preferredWidth - new component preferred width
Returns:
modified component

getPreferredHeight

public int getPreferredHeight()
Returns component preferred height.

Specified by:
getPreferredHeight in interface SizeMethods<WebStepProgress>
Returns:
component preferred height

setPreferredHeight

public WebStepProgress setPreferredHeight(int preferredHeight)
Sets component preferred height. Pass -1 to let component choose preferred height on its own.

Specified by:
setPreferredHeight in interface SizeMethods<WebStepProgress>
Parameters:
preferredHeight - new component preferred height
Returns:
modified component

getMinimumWidth

public int getMinimumWidth()
Returns component minimum width.

Specified by:
getMinimumWidth in interface SizeMethods<WebStepProgress>
Returns:
component minimum width

setMinimumWidth

public WebStepProgress setMinimumWidth(int minimumWidth)
Sets component minimum width. Pass -1 to let component choose minimum width on its own.

Specified by:
setMinimumWidth in interface SizeMethods<WebStepProgress>
Parameters:
minimumWidth - new component minimum width
Returns:
modified component

getMinimumHeight

public int getMinimumHeight()
Returns component minimum height.

Specified by:
getMinimumHeight in interface SizeMethods<WebStepProgress>
Returns:
component minimum height

setMinimumHeight

public WebStepProgress setMinimumHeight(int minimumHeight)
Sets component minimum height. Pass -1 to let component choose minimum height on its own.

Specified by:
setMinimumHeight in interface SizeMethods<WebStepProgress>
Parameters:
minimumHeight - new component minimum height
Returns:
modified component

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns component preferred size.

Specified by:
getPreferredSize in interface SizeMethods<WebStepProgress>
Overrides:
getPreferredSize in class javax.swing.JComponent
Returns:
component preferred size

createSteps

public static java.util.List<StepData> createSteps(java.lang.String[] steps)
Additional useful methods


createSteps

public static java.util.List<StepData> createSteps(java.awt.Component[] steps)

createDefaultData

public static java.util.List<StepData> createDefaultData(int stepsAmount)