JBCSolutions - JbcBeans v1.5

This document is the API specification for the JbcBeans, version 1.5


jbc.beans
Class JbcCircularSlider

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by jbc.beans.JbcCircularSlider
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class JbcCircularSlider
extends javax.swing.JComponent

This slider is rotating. It looks like an amplifier button. It may be used to increase or reduce sound volume for a multimedia application, or used with applications that require angle data. It may also offer a simple way for indicating a direction such as North, South, East...

If bound to hardware equipment (such as an amplifier, a sound card), this slider may be secured to avoid that user changes value too quickly. The sizes of tracker and associated minibuttons, the arbitrary position of zero, as well as the maximum value accepted by the slider, may be customized, in accordance with the developer's choice.

Author:
Copyright © 1999-2004, JBC. All Rights Reserved.
Licensed Materials - Property of JBC.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JbcCircularSlider()
          Default JbcCircularSlider constructor.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
          Adds a ChangeListener to the list that is notified each time the circular slider's value has changed.
 java.lang.String getAbout()
          Application code will not use these methods explicitly.
 java.awt.Color getBackground()
          Gets the background color of this component.
 int getBevelSize()
          Gets the size of the bevel.
 java.awt.Color getForeground()
          Gets the foreground color of this component.
 int getMaximum()
          Returns the maximum value supported by the circular slider.
 int getMiniButtonsSize()
          Gets the size of the mini buttons.
 int getPositionOfZero()
          Returns the position of zero property.
 int getTrackerSize()
          Gets the size of the tracker.
 int getValue()
          Returns the current value of the circular slider.
 boolean isCircularBorder()
          Returns true if the circular border is active.
 boolean isPaintTicks()
          Returns true whether the ticks should be painted.
 boolean isSafe()
          Returns true if the component is safe.
 boolean isTrackerRaised()
          Returns true if the tracker is raised beveled.
 boolean isValuePrinted()
          Returns true if the value is printed inside the component.
 void paint(java.awt.Graphics g)
          Paints this component.
 void paintInterface(java.awt.Graphics g)
           
 void removeChangeListener(javax.swing.event.ChangeListener l)
          Removes a ChangeListener from the list that's notified each time the circular slider's value has changed.
 void repaint()
          This method repaints the component and its children.
 void setAbout(java.lang.String text)
          Application code will not use these methods explicitly.
 void setBackground(java.awt.Color color)
          Sets the background color of this component.
 void setBevelSize(int v)
          Sets the size of the bevel.
 void setBounds(int x, int y, int width, int height)
          Moves and resizes this component.
 void setBounds(java.awt.Rectangle r)
          Moves and resizes this component to conform to the new bounding rectangle r.
 void setCircularBorder(boolean b)
          Sets the circular border active or not.
 void setEnabled(boolean b)
          Sets the enabled state of the object.
 void setForeground(java.awt.Color color)
          Sets the foreground color of this component.
 void setMaximum(int value)
          Sets the maximum property.
 void setMiniButtonsSize(int v)
          Sets the size of the mini buttons.
 void setPaintTicks(boolean b)
          Sets whether the ticks should be painted or not.
 void setPositionOfZero(int value)
          Sets the position of zero property.
 void setSafe(boolean b)
          Sets whether the component ide be safe.
 void setSize(java.awt.Dimension d)
          Resizes this component so that it has width d.width and height d.height.
 void setSize(int width, int height)
          Resizes this component so that it has width width and height height.
 void setTrackerRaised(boolean b)
          Sets the tracker raised if the parameter is true, otherwise sets the tracker lowered.
 void setTrackerSize(int v)
          Sets the size of the tracker.
 void setValue(int value)
          Sets the current value of the circular slider.
 void setValuePrinted(boolean b)
          Sets whether the value is printed inside the component.
 void updateUI()
          Notification from the UIFactory that the L&F has changed.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, resize, resize, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JbcCircularSlider

public JbcCircularSlider()
Default JbcCircularSlider constructor.

Creates a JbcCircularSlider instance.

Method Detail

setAbout

public void setAbout(java.lang.String text)
Application code will not use these methods explicitly.


getAbout

public java.lang.String getAbout()
Application code will not use these methods explicitly.


setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Moves and resizes this component. The new location of the top-left corner is specified by x and y, and the new size is specified by width and height.

Overrides:
setBounds in class java.awt.Component
Parameters:
x - The new x-coordinate of this component.
y - The new y-coordinate of this component.
width - The new width of this component.
height - The new height of this component.
See Also:
setSize(int, int), setSize(java.awt.Dimension)

setBounds

public void setBounds(java.awt.Rectangle r)
Moves and resizes this component to conform to the new bounding rectangle r. This component's new position is specified by r.x and r.y, and its new size is specified by r.width and r.height

Overrides:
setBounds in class java.awt.Component
Parameters:
r - The new bounding rectangle for this component.
See Also:
setSize(int, int), setSize(java.awt.Dimension)

setSize

public void setSize(int width,
                    int height)
Resizes this component so that it has width width and height height.

Overrides:
setSize in class java.awt.Component
Parameters:
width - The new width of this component in pixels.
height - The new height of this component in pixels.
See Also:
setBounds(int, int, int, int)

setSize

public void setSize(java.awt.Dimension d)
Resizes this component so that it has width d.width and height d.height.

Overrides:
setSize in class java.awt.Component
Parameters:
d - The dimension specifying the new size of this component.
See Also:
setBounds(int, int, int, int)

setEnabled

public void setEnabled(boolean b)
Sets the enabled state of the object.

Overrides:
setEnabled in class javax.swing.JComponent
Parameters:
b - if true, enables this object; otherwise, disables it

getBackground

public java.awt.Color getBackground()
Gets the background color of this component.

Overrides:
getBackground in class java.awt.Component
Returns:
This component's background color. If this component does not have a background color, the default background color is returned.
See Also:
setBackground(java.awt.Color)

setBackground

public void setBackground(java.awt.Color color)
Sets the background color of this component.

Overrides:
setBackground in class javax.swing.JComponent
Parameters:
color - The color to become this component's background color. If this parameter is null then this component will inherit the default background.
See Also:
getBackground()

getForeground

public java.awt.Color getForeground()
Gets the foreground color of this component.

Overrides:
getForeground in class java.awt.Component
Returns:
This component's foreground color. If this component does not have a foreground color, the default foreground color is returned.
See Also:
setForeground(java.awt.Color)

setForeground

public void setForeground(java.awt.Color color)
Sets the foreground color of this component.

Overrides:
setForeground in class javax.swing.JComponent
Parameters:
color - The color to become this component's foreground color. If this parameter is null then this component will inherit the default foreground.
See Also:
getForeground()

updateUI

public void updateUI()
Notification from the UIFactory that the L&F has changed. Called to replace the UI with the latest version from the UIFactory.

Overrides:
updateUI in class javax.swing.JComponent
See Also:
JComponent.updateUI()

repaint

public void repaint()
This method repaints the component and its children.

Overrides:
repaint in class java.awt.Component

paintInterface

public final void paintInterface(java.awt.Graphics g)

paint

public void paint(java.awt.Graphics g)
Paints this component. This method is called when the contents of the component should be painted.

Overrides:
paint in class javax.swing.JComponent
Parameters:
g - The graphics context to use for painting.

setValue

public void setValue(int value)
Sets the current value of the circular slider.

Parameters:
value - the value of the circular slider
See Also:
getValue()

getValue

public int getValue()
Returns the current value of the circular slider.

Returns:
the value property
See Also:
setValue(int)

getMaximum

public int getMaximum()
Returns the maximum value supported by the circular slider.

Returns:
the maximum property
See Also:
setMaximum(int)

setMaximum

public void setMaximum(int value)
Sets the maximum property.

Parameters:
value - the maximum value of the circular slider
See Also:
getMaximum()

getPositionOfZero

public int getPositionOfZero()
Returns the position of zero property.

Returns:
position of zero.
See Also:
setPositionOfZero(int)

setPositionOfZero

public void setPositionOfZero(int value)
Sets the position of zero property.

Parameters:
value - the position of zero of the circular slider
See Also:
getPositionOfZero()

isTrackerRaised

public boolean isTrackerRaised()
Returns true if the tracker is raised beveled. Otherwise, it returns false if the tracker is lowered beveled.

Returns:
true if the tracker should be raised beveled, false otherwise
See Also:
setTrackerRaised(boolean)

setTrackerRaised

public void setTrackerRaised(boolean b)
Sets the tracker raised if the parameter is true, otherwise sets the tracker lowered.

Parameters:
b - true if the tracker should be raised beveled, false otherwise
See Also:
isTrackerRaised()

isPaintTicks

public boolean isPaintTicks()
Returns true whether the ticks should be painted. Otherwise, it returns false.

Returns:
if true the ticks should be painted, false otherwise
See Also:
setPaintTicks(boolean)

setPaintTicks

public void setPaintTicks(boolean b)
Sets whether the ticks should be painted or not.

Parameters:
b - if true the ticks should be painted, false otherwise
See Also:
isPaintTicks()

isSafe

public boolean isSafe()
Returns true if the component is safe. Otherwise, it returns false

Returns:
if true the component should be safe, false otherwise
See Also:
setSafe(boolean)

setSafe

public void setSafe(boolean b)
Sets whether the component ide be safe. If a component is safe, the margin allowing to drag the tracker is limited to the edge. This feature forbids to drag through the middle of the circular slider : that might cause a quick, dangerous modification of the value.

the default value is true

See Also:
isSafe()

isValuePrinted

public boolean isValuePrinted()
Returns true if the value is printed inside the component. Otherwise, it returns false.

Parameters:
if - true the value should be painted, false otherwise
See Also:
setValuePrinted(boolean)

setValuePrinted

public void setValuePrinted(boolean b)
Sets whether the value is printed inside the component.

Parameters:
b - if true the value should be painted, false otherwise
See Also:
isValuePrinted()

isCircularBorder

public boolean isCircularBorder()
Returns true if the circular border is active. Otherwise, it returns false.

Parameters:
if - true the circular border should be painted, false otherwise
See Also:
setCircularBorder(boolean)

setCircularBorder

public void setCircularBorder(boolean b)
Sets the circular border active or not.

Parameters:
b - if true the circular border should be painted, false otherwise
See Also:
isCircularBorder()

setBevelSize

public void setBevelSize(int v)
Sets the size of the bevel.

Parameters:
v - the bevel size of the circular slider
See Also:
getBevelSize()

getBevelSize

public int getBevelSize()
Gets the size of the bevel.

Returns:
the bevel size of the circular slider
See Also:
setBevelSize(int)

setTrackerSize

public void setTrackerSize(int v)
Sets the size of the tracker.

Parameters:
v - the tracker size of the circular slider
See Also:
getTrackerSize()

getTrackerSize

public int getTrackerSize()
Gets the size of the tracker.

Returns:
the tracker size of the circular slider
See Also:
setTrackerSize(int)

setMiniButtonsSize

public void setMiniButtonsSize(int v)
Sets the size of the mini buttons.

Parameters:
v - the mini buttons size of the circular slider
See Also:
getMiniButtonsSize()

getMiniButtonsSize

public int getMiniButtonsSize()
Gets the size of the mini buttons.

Returns:
the mini buttons size of the circular slider
See Also:
setMiniButtonsSize(int)

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener l)
Adds a ChangeListener to the list that is notified each time the circular slider's value has changed.

Parameters:
l - the ChangeListener to add
See Also:
removeChangeListener(javax.swing.event.ChangeListener)

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener l)
Removes a ChangeListener from the list that's notified each time the circular slider's value has changed.

Parameters:
l - the ChangeListener to remove
See Also:
addChangeListener(javax.swing.event.ChangeListener)

JBCSolutions - JbcBeans v1.5

JBCSolutions - JbcBeans v1.5