org.jscience.awt.pots
Class SlidePot

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by org.jscience.awt.pots.PotBase
              extended by org.jscience.awt.pots.SlidePot
All Implemented Interfaces:
java.awt.Adjustable, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
BoostCutSlidePot, IntValuedSlidePot, RealValuedSlidePot

public class SlidePot
extends PotBase

DOCUMENT ME!

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
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 java.lang.String DEFAULTFONT
          DOCUMENT ME!
static int DEFAULTGRADWIDTH
          DOCUMENT ME!
static int DEFAULTKNOBHEIGHT
          DOCUMENT ME!
static int DEFAULTKNOBWIDTH
          DOCUMENT ME!
static int DEFAULTLABELWIDTH
          DOCUMENT ME!
static int DEFAULTLENGTH
          DOCUMENT ME!
static int DEFAULTSECTIONS
          DOCUMENT ME!
static int DEFAULTWIDTH
          DOCUMENT ME!
static int KNOBWAISTWIDTHPERCENT
          DOCUMENT ME!
static java.lang.String SECTIONLABELS
          DOCUMENT ME!
 
Fields inherited from class org.jscience.awt.pots.PotBase
adjustmentListener, blockIncrement, brighterPanelColor, caption, DEFAULTFONTNAME, DEFAULTFONTSIZE, DEFAULTFONTSTYLE, downPt, font, fontName, fontSize, fontStyle, gradColor, GRADCOLOR, hasFocus, hasHighlight, hasLabels, highlightBrighterColor, highlightDarkerColor, knobColor, KNOBCOLOR, labels, mouseDown, mouseInKnob, numberOfSections, panelColor, PANELCOLOR, potImage, POTRANGE, textColor, TEXTCOLOR, ticColor, TICCOLOR, unitIncrement, value, xCenter, yCenter
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.Adjustable
HORIZONTAL, NO_ORIENTATION, VERTICAL
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SlidePot()
          Creates a new SlidePot object.
SlidePot(int length, int width, int knobWidthPercent, int knobLengthPercent, int gradWidthPercent, int labelPercent, int fontStyle, int fontSize, java.lang.String caption, boolean hasLabels, java.lang.String labelsString, int value, boolean hasHighlight, int numberOfSections, java.awt.Color panelColor, java.awt.Color knobColor, java.awt.Color textColor, java.awt.Color ticColor, java.awt.Color gradColor)
          Creates a new SlidePot object.
SlidePot(int length, int width, java.lang.String caption, int value)
          Creates a new SlidePot object.
 
Method Summary
 void drawCaption(java.awt.Graphics g, int x, int y, int cw, int ch, java.lang.String text)
          DOCUMENT ME!
protected  void drawKnob(java.awt.Graphics g, int xOffset, int yOffset)
          DOCUMENT ME!
 int getGradWidthPercent()
          DOCUMENT ME!
 int getKnobLengthPercent()
          DOCUMENT ME!
 int getKnobWidthPercent()
          DOCUMENT ME!
 int getLabelPercent()
          DOCUMENT ME!
 int getLength()
          DOCUMENT ME!
 java.awt.Dimension getPreferredSize()
          DOCUMENT ME!
 int getWidth()
          DOCUMENT ME!
protected  int makeEven(int n)
          DOCUMENT ME!
 void paint(java.awt.Graphics g)
          DOCUMENT ME!
protected  void processKeyEvent(java.awt.event.KeyEvent e)
          DOCUMENT ME!
protected  void processMouseEvent(java.awt.event.MouseEvent e)
          DOCUMENT ME!
protected  void processMouseMotionEvent(java.awt.event.MouseEvent e)
          DOCUMENT ME!
 void setGradWidthPercent(int percent)
          DOCUMENT ME!
 void setKnobLengthPercent(int percent)
          DOCUMENT ME!
 void setKnobWidthPercent(int percent)
          DOCUMENT ME!
 void setLabelPercent(int percent)
          DOCUMENT ME!
 void setLength(int length)
          DOCUMENT ME!
 void setWidth(int width)
          DOCUMENT ME!
 
Methods inherited from class org.jscience.awt.pots.PotBase
addAdjustmentListener, fireAdjustmentEvent, getAttenuation, getBlockIncrement, getCaption, getFont, getFontName, getFontSize, getFontStyle, getGradColor, getHasLabels, getHighlight, getKnobColor, getLabelsString, getMaximum, getMinimum, getNumberOfSections, getOrientation, getPanelColor, getTextColor, getTicColor, getUnitIncrement, getValue, getVisibleAmount, removeAdjustmentListener, round, setBlockIncrement, setCaption, setFont, setFontName, setFontSize, setFontStyle, setGradColor, setHasLabels, setHighlight, setKnobColor, setLabelsString, setMaximum, setMinimum, setNumberOfSections, setPanelColor, setTextColor, setTicColor, setUnitIncrement, setValue, setVisibleAmount, sizeToFit
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULTWIDTH

public static final int DEFAULTWIDTH
DOCUMENT ME!

See Also:
Constant Field Values

DEFAULTLENGTH

public static final int DEFAULTLENGTH
DOCUMENT ME!

See Also:
Constant Field Values

KNOBWAISTWIDTHPERCENT

public static final int KNOBWAISTWIDTHPERCENT
DOCUMENT ME!

See Also:
Constant Field Values

DEFAULTKNOBWIDTH

public static final int DEFAULTKNOBWIDTH
DOCUMENT ME!

See Also:
Constant Field Values

DEFAULTKNOBHEIGHT

public static final int DEFAULTKNOBHEIGHT
DOCUMENT ME!

See Also:
Constant Field Values

DEFAULTGRADWIDTH

public static final int DEFAULTGRADWIDTH
DOCUMENT ME!

See Also:
Constant Field Values

DEFAULTLABELWIDTH

public static final int DEFAULTLABELWIDTH
DOCUMENT ME!

See Also:
Constant Field Values

DEFAULTFONT

public static final java.lang.String DEFAULTFONT
DOCUMENT ME!

See Also:
Constant Field Values

DEFAULTSECTIONS

public static final int DEFAULTSECTIONS
DOCUMENT ME!

See Also:
Constant Field Values

SECTIONLABELS

public static final java.lang.String SECTIONLABELS
DOCUMENT ME!

See Also:
Constant Field Values
Constructor Detail

SlidePot

public SlidePot(int length,
                int width,
                int knobWidthPercent,
                int knobLengthPercent,
                int gradWidthPercent,
                int labelPercent,
                int fontStyle,
                int fontSize,
                java.lang.String caption,
                boolean hasLabels,
                java.lang.String labelsString,
                int value,
                boolean hasHighlight,
                int numberOfSections,
                java.awt.Color panelColor,
                java.awt.Color knobColor,
                java.awt.Color textColor,
                java.awt.Color ticColor,
                java.awt.Color gradColor)
Creates a new SlidePot object.

Parameters:
length - DOCUMENT ME!
width - DOCUMENT ME!
knobWidthPercent - DOCUMENT ME!
knobLengthPercent - DOCUMENT ME!
gradWidthPercent - DOCUMENT ME!
labelPercent - DOCUMENT ME!
fontStyle - DOCUMENT ME!
fontSize - DOCUMENT ME!
caption - DOCUMENT ME!
hasLabels - DOCUMENT ME!
labelsString - DOCUMENT ME!
value - DOCUMENT ME!
hasHighlight - DOCUMENT ME!
numberOfSections - DOCUMENT ME!
panelColor - DOCUMENT ME!
knobColor - DOCUMENT ME!
textColor - DOCUMENT ME!
ticColor - DOCUMENT ME!
gradColor - DOCUMENT ME!

SlidePot

public SlidePot(int length,
                int width,
                java.lang.String caption,
                int value)
Creates a new SlidePot object.

Parameters:
length - DOCUMENT ME!
width - DOCUMENT ME!
caption - DOCUMENT ME!
value - DOCUMENT ME!

SlidePot

public SlidePot()
Creates a new SlidePot object.

Method Detail

getPreferredSize

public java.awt.Dimension getPreferredSize()
DOCUMENT ME!

Specified by:
getPreferredSize in class PotBase
Returns:
DOCUMENT ME!

drawKnob

protected void drawKnob(java.awt.Graphics g,
                        int xOffset,
                        int yOffset)
DOCUMENT ME!

Parameters:
g - DOCUMENT ME!
xOffset - DOCUMENT ME!
yOffset - DOCUMENT ME!

drawCaption

public void drawCaption(java.awt.Graphics g,
                        int x,
                        int y,
                        int cw,
                        int ch,
                        java.lang.String text)
DOCUMENT ME!

Parameters:
g - DOCUMENT ME!
x - DOCUMENT ME!
y - DOCUMENT ME!
cw - DOCUMENT ME!
ch - DOCUMENT ME!
text - DOCUMENT ME!

paint

public void paint(java.awt.Graphics g)
DOCUMENT ME!

Specified by:
paint in class PotBase
Parameters:
g - DOCUMENT ME!

processMouseEvent

protected void processMouseEvent(java.awt.event.MouseEvent e)
DOCUMENT ME!

Overrides:
processMouseEvent in class java.awt.Component
Parameters:
e - DOCUMENT ME!

processMouseMotionEvent

protected void processMouseMotionEvent(java.awt.event.MouseEvent e)
DOCUMENT ME!

Overrides:
processMouseMotionEvent in class java.awt.Component
Parameters:
e - DOCUMENT ME!

processKeyEvent

protected void processKeyEvent(java.awt.event.KeyEvent e)
DOCUMENT ME!

Overrides:
processKeyEvent in class java.awt.Component
Parameters:
e - DOCUMENT ME!

makeEven

protected int makeEven(int n)
DOCUMENT ME!

Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!

getLength

public int getLength()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setLength

public void setLength(int length)
DOCUMENT ME!

Parameters:
length - DOCUMENT ME!

getWidth

public int getWidth()
DOCUMENT ME!

Overrides:
getWidth in class java.awt.Component
Returns:
DOCUMENT ME!

setWidth

public void setWidth(int width)
DOCUMENT ME!

Parameters:
width - DOCUMENT ME!

getKnobWidthPercent

public int getKnobWidthPercent()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setKnobWidthPercent

public void setKnobWidthPercent(int percent)
DOCUMENT ME!

Parameters:
percent - DOCUMENT ME!

getKnobLengthPercent

public int getKnobLengthPercent()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setKnobLengthPercent

public void setKnobLengthPercent(int percent)
DOCUMENT ME!

Parameters:
percent - DOCUMENT ME!

getGradWidthPercent

public int getGradWidthPercent()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setGradWidthPercent

public void setGradWidthPercent(int percent)
DOCUMENT ME!

Parameters:
percent - DOCUMENT ME!

getLabelPercent

public int getLabelPercent()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setLabelPercent

public void setLabelPercent(int percent)
DOCUMENT ME!

Parameters:
percent - DOCUMENT ME!