org.zaval.lw
Class LwProgress

java.lang.Object
  |
  +--org.zaval.util.ValidationObject
        |
        +--org.zaval.lw.LwCanvas
              |
              +--org.zaval.lw.LwProgress
All Implemented Interfaces:
Drawable, Layoutable, LwComponent, Validationable

public class LwProgress
extends LwCanvas

This is progress bar light weight component that can be used to display progress status for some processes. The progress status is changed starting from zero to a maxiaml value. The maximal value can be set by setMaxValue method and current status can be controlled by getValue and setValue methods. Use addActionListener and removeActionListener methods to listen whenever the current progress status has been changed. The action event returns previous value (that is represented with java.lang.Integer class) by getData method.

The progress bar component can be oriented by two manners:

Use setOrientation method to define the progress bar orientation.

Use setTitleView method to define title view for the component. The view will be rendered at the center of the progress bar component.


Fields inherited from class org.zaval.lw.LwCanvas
bits, height, insets, parent, psHeight, psWidth, skins, width, x, y
 
Fields inherited from class org.zaval.util.ValidationObject
isValidFlag
 
Constructor Summary
LwProgress()
          Constructs the progress bar.
 
Method Summary
 void addActionListener(LwActionListener l)
          Adds the specified action listener to receive action events from this component.
protected  java.awt.Dimension calcPreferredSize()
          Gets the "pure" preferred size for this component.
 LwView getTitleView()
          Gets the title view.
 int getValue()
          Gets the current progress value.
 void paint(java.awt.Graphics g)
          Paints this component.
 void removeActionListener(LwActionListener l)
          Removes the specified action listener.
 void setBundleColor(java.awt.Color c)
          Sets the bundle color.
 void setBundleSize(int size)
          Sets the bundle size.
 void setGap(int g)
          Sets the gap.
 void setMaxValue(int m)
          Sets the maximal value.
 void setOrientation(int o)
          Sets the specified orientation for the component.
 void setTitleView(LwView v)
          Sets the specified title view.
 void setValue(int p)
          Sets the current value.
 
Methods inherited from class org.zaval.lw.LwCanvas
canHaveFocus, getBackground, getBounds, getHeight, getInsets, getLocation, getLwComponentAt, getLwParent, getOrigin, getPreferredSize, getSize, getViewMan, getVisiblePart, getWidth, getX, getY, hasFocus, invalidate, isEnabled, isOpaque, isVisible, recalc, repaint, repaint, requestFocus, setBackground, setEnabled, setInsets, setLocation, setLwParent, setOpaque, setPSSize, setSize, setViewMan, setVisible, toString, update, validate, viewManChanged, vrp
 
Methods inherited from class org.zaval.util.ValidationObject
isValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.zaval.util.Validationable
isValid
 

Constructor Detail

LwProgress

public LwProgress()
Constructs the progress bar.
Method Detail

setOrientation

public void setOrientation(int o)
Sets the specified orientation for the component. Use LwToolkit.HORIZONTAL or LwToolkit.VERTICAL constants as the orientation value.
Parameters:
o - the specified orientation.

getValue

public int getValue()
Gets the current progress value.
Returns:
a current progress value.

setBundleSize

public void setBundleSize(int size)
Sets the bundle size.
Parameters:
size - the bundle size.

setBundleColor

public void setBundleColor(java.awt.Color c)
Sets the bundle color.
Parameters:
c - the bundle color.

setMaxValue

public void setMaxValue(int m)
Sets the maximal value.
Parameters:
m - the maximal value.

setValue

public void setValue(int p)
Sets the current value.
Parameters:
p - the current value.

setGap

public void setGap(int g)
Sets the gap. The gap defines indent between progress bar bundles.
Parameters:
g - the gap.

getTitleView

public LwView getTitleView()
Gets the title view.
Returns:
a title view.

setTitleView

public void setTitleView(LwView v)
Sets the specified title view.
Parameters:
v - the specified title view.

paint

public void paint(java.awt.Graphics g)
Description copied from class: LwCanvas
Paints this component. You can use the method to define a face of the component
Overrides:
paint in class LwCanvas
Following copied from class: org.zaval.lw.LwCanvas
Parameters:
g - the graphics context to be used for painting.

addActionListener

public void addActionListener(LwActionListener l)
Adds the specified action listener to receive action events from this component.
Parameters:
l - the specified action listener.

removeActionListener

public void removeActionListener(LwActionListener l)
Removes the specified action listener.
Parameters:
l - the specified action listener.

calcPreferredSize

protected java.awt.Dimension calcPreferredSize()
Description copied from class: LwCanvas
Gets the "pure" preferred size for this component. The method should be overrided to define the component preferred size. Don't use insets to calculate the preferred size, the insets will be added with getPreferredSize method.
Overrides:
calcPreferredSize in class LwCanvas
Following copied from class: org.zaval.lw.LwCanvas
Returns:
a "pure" preferred size.


Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org