JBCSolutions - JbcBeans v1.5

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


jbc.beans
Class JbcLongSpinButton

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

public class JbcLongSpinButton
extends javax.swing.JComponent
implements javax.swing.SwingConstants

This spin button handles longs. It allows applications to get numbers whose values are certified as minimum and maximum.

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 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
JbcLongSpinButton()
          Default JbcLongSpinButton constructor.
JbcLongSpinButton(int columns)
          Constructs a new empty JbcLongSpinButton with the specified number of columns.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
          Adds a ChangeListener to the list that is notified each time the spin Button'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.
 java.awt.Color getBackgroundTextField()
          Gets the background color of TextField component.
 java.awt.Color getCaretColor()
          Fetches the current color used to render the caret.
 java.awt.Color getDisabledTextColor()
          Fetches the current color used to render the disabled text.
 java.awt.Color getForegroundTextField()
          Gets the foreground color of TextField component.
 int getHorizontalAlignment()
          Returns the alignment of the textField's contents along the X axis.
 long getMaximum()
          Returns the maximum value supported by the spin button.
 long getMinimum()
          Returns the minimum value supported by the spin button.
 java.awt.Color getSelectionColor()
          Fetches the current color used to render the selection.
 int getSleep()
          Gets the current sleep time value
 javax.swing.JTextField getTextField()
          Returns the JTextField associated to the spin button.
 long getValue()
          Returns the spin button value.
 boolean isEditable()
          Returns true if the JbcLongSpinButton is editable.
 boolean isLinear()
          Returns whether the spin button has a linear speed of rotation or not.
 boolean isWrapped()
          Returns whether the list of the spin button is wrapped or not.
 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 spin button's value has changed.
 void requestFocus()
          Requests that this component get the input focus.
 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 setBackgroundTextField(java.awt.Color color)
          Sets the background color of TextField component.
 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 setCaretColor(java.awt.Color c)
          Sets the current color used to render the caret.
 void setDisabledTextColor(java.awt.Color c)
          Sets the current color used to render the disabled text.
 void setEditable(boolean aFlag)
          Determines whether the JbcLongSpinButton field is editable.
 void setEnabled(boolean b)
          Sets whether or not this component is enabled.
 void setFont(java.awt.Font f)
          Gets the font of this component.
 void setForegroundTextField(java.awt.Color color)
          Sets the foreground color of TextField component.
 void setHorizontalAlignment(int alignment)
          Sets the alignment of the textField's contents along the X axis.
 void setLinear(boolean newLinear)
          Sets whether the spin button has linear speed of rotation.
 void setMaximum(long upper)
          Sets the maximum value supported by the spin button.
 void setMinimum(long lower)
          Sets the minimum value supported by the spin button.
 void setSelectionColor(java.awt.Color c)
          Sets the current color used to render the selection.
 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 setSleep(int sleepTime)
          To run the spin button, the main component will use multithread facilities.
 void setToolTipText(java.lang.String text)
          Registers the text to display in a tool tip.
 void setValue(long value)
          Sets the spin button current value.
 void setWrapped(boolean b)
          Sets whether the list of the spin button is wrapped.
 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, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, 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, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, 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

JbcLongSpinButton

public JbcLongSpinButton()
Default JbcLongSpinButton constructor.

Creates a JbcLongSpinButton instance.


JbcLongSpinButton

public JbcLongSpinButton(int columns)
Constructs a new empty JbcLongSpinButton with the specified number of columns.

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.


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

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()

requestFocus

public void requestFocus()
Requests that this component get the input focus. The component ide be visible on the screen for this request to be granted

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

setEditable

public void setEditable(boolean aFlag)
Determines whether the JbcLongSpinButton field is editable. An editable JbcLongSpinButton allows the user to type into the field.

Parameters:
aFlag - a boolean value, where true indicates that the field is editable
See Also:
isEditable()

isEditable

public boolean isEditable()
Returns true if the JbcLongSpinButton is editable. By default, a JbcLongSpinButton is editable.

Returns:
true if the JbcLongSpinButton is editable, else false
See Also:
setEditable(boolean)

setToolTipText

public void setToolTipText(java.lang.String text)
Registers the text to display in a tool tip. The text displays when the cursor lingers over the component.

Overrides:
setToolTipText in class javax.swing.JComponent
Parameters:
text - the string to display; if the text is null, the tool tip is turned off for this component

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()

setBackgroundTextField

public void setBackgroundTextField(java.awt.Color color)
Sets the background color of TextField component.

Parameters:
color - The color to become TextField component's background color.
See Also:
getBackgroundTextField()

setForegroundTextField

public void setForegroundTextField(java.awt.Color color)
Sets the foreground color of TextField component.

Parameters:
color - The color to become TextField component's foreground color.
See Also:
getForegroundTextField()

setCaretColor

public void setCaretColor(java.awt.Color c)
Sets the current color used to render the caret. Setting to null effectively restores the default color.

Parameters:
c - the color
See Also:
getCaretColor()

setDisabledTextColor

public void setDisabledTextColor(java.awt.Color c)
Sets the current color used to render the disabled text.

Parameters:
c - the color
See Also:
getDisabledTextColor()

setSelectionColor

public void setSelectionColor(java.awt.Color c)
Sets the current color used to render the selection. Setting the color to null is the same as setting Color.white.

Parameters:
c - the color
See Also:
getSelectionColor()

getCaretColor

public java.awt.Color getCaretColor()
Fetches the current color used to render the caret.

Returns:
the color

getDisabledTextColor

public java.awt.Color getDisabledTextColor()
Fetches the current color used to render the disabled text.

Returns:
the color

getSelectionColor

public java.awt.Color getSelectionColor()
Fetches the current color used to render the selection.

Returns:
the color

getBackgroundTextField

public java.awt.Color getBackgroundTextField()
Gets the background color of TextField component.

Returns:
TextField component's background color.
See Also:
setBackgroundTextField(java.awt.Color)

getForegroundTextField

public java.awt.Color getForegroundTextField()
Gets the foreground color of TextField component.

Returns:
This component's foreground color.
See Also:
setForegroundTextField(java.awt.Color)

setFont

public void setFont(java.awt.Font f)
Gets the font of this component.

Overrides:
setFont in class javax.swing.JComponent
See Also:
Component.getFont()

setEnabled

public void setEnabled(boolean b)
Sets whether or not this component is enabled.

Overrides:
setEnabled in class javax.swing.JComponent
See Also:
Component.isEnabled()

setSleep

public void setSleep(int sleepTime)
To run the spin button, the main component will use multithread facilities. The sleep time is used as "time slicing" value. This parameter affects the speed of rotation. This method sets the time slicing value. By default, the sleep time is set at 30 milliseconds at initialization.

Parameters:
sleepTime - The sleep time value
See Also:
getSleep()

getSleep

public int getSleep()
Gets the current sleep time value

Returns:
The current sleep time value
See Also:
setSleep(int)

setMinimum

public void setMinimum(long lower)
Sets the minimum value supported by the spin button.

See Also:
getMinimum()

getMinimum

public long getMinimum()
Returns the minimum value supported by the spin button.

Returns:
the value of the minimum property
See Also:
setMinimum(long)

getMaximum

public long getMaximum()
Returns the maximum value supported by the spin button.

Returns:
the value of the maximum property
See Also:
setMaximum(long)

setMaximum

public void setMaximum(long upper)
Sets the maximum value supported by the spin button.

See Also:
getMaximum()

setValue

public void setValue(long value)
Sets the spin button current value.

See Also:
getValue()

getValue

public long getValue()
Returns the spin button value.

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

isLinear

public boolean isLinear()
Returns whether the spin button has a linear speed of rotation or not.

Returns:
true if the spin button has a linear rotation, otherwise false.
See Also:
setLinear(boolean)

setLinear

public void setLinear(boolean newLinear)
Sets whether the spin button has linear speed of rotation. Otherwise it has an exponential speed.

Parameters:
newLinear - true if the spin button has a linear rotation, otherwise false.
See Also:
isLinear()

isWrapped

public boolean isWrapped()
Returns whether the list of the spin button is wrapped or not.

Returns:
true if the list of the spin button is wrapped, otherwise false.
See Also:
setWrapped(boolean)

setWrapped

public void setWrapped(boolean b)
Sets whether the list of the spin button is wrapped. Otherwise, spin buttons will stop at the minimum or maximum value.

Parameters:
b - true if the list of the spin button is wrapped, otherwise false.
See Also:
isWrapped()

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.

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.

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:
JComponent.getSize(java.awt.Dimension), 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:
setSize(int, int), setBounds(int, int, int, int)

getTextField

public javax.swing.JTextField getTextField()
Returns the JTextField associated to the spin button.

Returns:
the JTextField associated to the spin button.

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener l)
Adds a ChangeListener to the list that is notified each time the spin Button'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 spin button's value has changed.

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

setHorizontalAlignment

public void setHorizontalAlignment(int alignment)
Sets the alignment of the textField's contents along the X axis.

Parameters:
alignment - One of the following constants defined in SwingConstants: LEFT, CENTER (the default), RIGHT, LEADING or TRAILING.
See Also:
SwingConstants, getHorizontalAlignment()

getHorizontalAlignment

public int getHorizontalAlignment()
Returns the alignment of the textField's contents along the X axis.

Returns:
The value of the horizontalAlignment property, one of the following constants defined in SwingConstants: LEFT, CENTER, RIGHT, LEADING or TRAILING.
See Also:
setHorizontalAlignment(int), SwingConstants

JBCSolutions - JbcBeans v1.5

JBCSolutions - JbcBeans v1.5