|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--dog.gui.DContainer
|
+--dog.gui.DTextComponent
|
+--dog.gui.DSpinbox
A component that allows the editing of an integer.
You may specify an alignment (LEFT, CENTER, or RIGHT) for the text within the component.
| Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
| Field Summary | |
protected java.awt.event.ActionListener |
actionListener
|
protected java.awt.event.AdjustmentListener |
adjustmentListener
|
protected int |
align
The alignment of the value in the spinbox. |
static int |
CENTER
The center alignment. |
protected int |
down
Which button is currently being pressed? |
protected static int |
DOWN
|
protected boolean |
filled
Is this component filled? |
protected boolean |
focus
Do we currently have the focus? |
static int |
LEFT
The left alignment. |
protected int |
maximum
The maximum value of the spinbox. |
protected int |
minimum
The minimum value of the spinbox. |
protected static int |
NONE
|
static int |
RIGHT
The right alignment. |
protected int |
unitIncrement
The amount by which the spinbox increments or decrements its value. |
protected static int |
UP
|
protected int |
value
The value in the spinbox. |
| Fields inherited from class dog.gui.DTextComponent |
editable, position, selectionEnd, selectionStart, text, textListener |
| Fields inherited from class dog.gui.DContainer |
cancelButton, defaultButton, EAST, NORTH, NORTHEAST, NORTHWEST, reference, SOUTH, SOUTHEAST, SOUTHWEST, tooltip, WEST |
| 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, VERTICAL |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
DSpinbox()
Constructs a new spinbox. |
|
DSpinbox(int value)
Constructs a new spinbox initialized with the specified value. |
|
DSpinbox(int value,
int align)
Constructs a new spinbox with the specified value and alignment. |
|
DSpinbox(int value,
int minimum,
int maximum)
Constructs a new spinbox with the specified value, minimum, and maximum. |
|
DSpinbox(int value,
int minimum,
int maximum,
int align)
Constructs a new spinbox with the specified value, minimum, maximum, and alignment. |
|
| Method Summary | |
void |
addActionListener(java.awt.event.ActionListener listener)
Adds the specified action listener to receive action events from this component. |
void |
addAdjustmentListener(java.awt.event.AdjustmentListener listener)
Adds the specified adjustment listener to receive adjustment events from this component. |
int |
getAlign()
Returns the alignment of the text in this spinbox. |
int |
getBlockIncrement()
Returns the amount by which the value increases or decreases when the spinbox buttons are pressed. |
int |
getMaximum()
Returns the maximum value of this spinbox. |
int |
getMinimum()
Returns the minimum value of this spinbox. |
java.awt.Dimension |
getMinimumSize()
Returns the minimum size for this component. |
int |
getOrientation()
Don't know why this applies to Adjustables. |
java.awt.Dimension |
getPreferredSize()
Returns the preferred size for this component. |
int |
getUnitIncrement()
Returns the amount by which the value increases or decreases when the spinbox buttons are pressed. |
int |
getValue()
Returns the current value of this spinbox. |
int |
getVisibleAmount()
Don't know why this applies to Adjustables. |
boolean |
isFilled()
Indicates whether this component is filled. |
boolean |
isFocusTraversable()
This component is focus-traversable if it is not disabled. |
void |
paint(java.awt.Graphics g)
Paints this choice. |
protected java.lang.String |
paramString()
Returns a parameter string for this component. |
protected void |
processActionEvent(java.awt.event.ActionEvent event)
Processes action events occurring on this component by dispatching them to any registered ActionListener objects. |
protected void |
processAdjustmentEvent(java.awt.event.AdjustmentEvent event)
Processes adjustment events on this component by dispatching them to any registered AdjustmentListener objects. |
protected void |
processEvent(java.awt.AWTEvent event)
Processes events on this component. |
protected void |
processFocusEvent(java.awt.event.FocusEvent event)
Process focus events. |
protected void |
processKeyEvent(java.awt.event.KeyEvent event)
Process key events. |
protected void |
processMouseEvent(java.awt.event.MouseEvent event)
Process mouse events. |
protected void |
processMouseMotionEvent(java.awt.event.MouseEvent event)
Process mouse motion events. |
void |
removeActionListener(java.awt.event.ActionListener listener)
Removes the specified action listener so that it no longer receives action events from this component. |
void |
removeAdjustmentListener(java.awt.event.AdjustmentListener listener)
Removes the specified adjustment listener so that it no longer receives adjustment events from this component. |
void |
setAlign(int align)
Sets the alignment of the text in this spinbox. |
void |
setBlockIncrement(int blockIncrement)
Sets the amount by which the value increases or decreases when the spinbox buttons are pressed. |
void |
setFilled(boolean filled)
Sets whether to fill this component with the fill colour. |
void |
setMaximum(int maximum)
Sets the maximum value for this spinbox. |
void |
setMinimum(int minimum)
Sets the minimum value for this spinbox. |
void |
setOrientation(int orientation)
Don't know why this applies to Adjustables. |
void |
setUnitIncrement(int unitIncrement)
Sets the amount by which the value increases or decreases when the spinbox buttons are pressed. |
void |
setValue(int value)
Sets the value of this spinbox to the specified value. |
void |
setValues(int value,
int minimum,
int maximum)
Sets the values for this spinbox. |
void |
setVisibleAmount(int amount)
Don't know why this applies to Adjustables. |
void |
timerFired(TimerEvent event)
The timer fired, blink the caret. |
void |
update(java.awt.Graphics g)
Updates this component's graphics context. |
| Methods inherited from class dog.gui.DTextComponent |
addTextListener, copySelection, cutSelection, deleteLeft, deleteRight, deleteSelection, getCaretPosition, getSelectedText, getSelectionEnd, getSelectionStart, getText, insert, insert, isEditable, lostOwnership, moveLeft, moveLineEnd, moveLineStart, moveRight, moveWordLeft, moveWordRight, pasteSelection, processTextEvent, removeTextListener, select, selectAll, setEditable, setSelectionEnd, setSelectionStart, setText |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, transferFocus |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int CENTER
public static final int LEFT
public static final int RIGHT
protected int value
protected int maximum
protected int minimum
protected int unitIncrement
protected int align
protected boolean filled
protected transient boolean focus
protected transient int down
protected static final int NONE
protected static final int UP
protected static final int DOWN
protected transient java.awt.event.ActionListener actionListener
protected transient java.awt.event.AdjustmentListener adjustmentListener
| Constructor Detail |
public DSpinbox()
public DSpinbox(int value)
value - the value to be displayed
public DSpinbox(int value,
int align)
value - the value to be displayedalign - LEFT, CENTER, or RIGHT
public DSpinbox(int value,
int minimum,
int maximum)
value - the value to be displayedminimum - the minimum valuemaximum - the maximum value
public DSpinbox(int value,
int minimum,
int maximum,
int align)
value - the value to be displayedminimum - the minimum valuemaximum - the maximum valuealign - LEFT, CENTER, or RIGHT| Method Detail |
public int getValue()
getValue in interface java.awt.AdjustablegetMinimum(),
getMaximum()public void setValue(int value)
setValue in interface java.awt.Adjustablevalue - the new value of the spinbox. If this value is
below the current minimum or above the current maximum minus
the visible amount, it becomes the new one of those values,
respectively.getValue()public int getMinimum()
getMinimum in interface java.awt.AdjustablegetMaximum(),
getValue()public void setMinimum(int minimum)
setMinimum in interface java.awt.Adjustableminimum - the minimum value of the spinboxpublic int getMaximum()
getMaximum in interface java.awt.AdjustablegetMinimum(),
getValue()public void setMaximum(int maximum)
setMaximum in interface java.awt.Adjustablemaximum - the maximum value of the spinbox
public void setValues(int value,
int minimum,
int maximum)
value - is the position in the current window.minimum - is the minimum value of the scrollbarmaximum - is the maximum value of the scrollbarpublic int getUnitIncrement()
getUnitIncrement in interface java.awt.Adjustablepublic void setUnitIncrement(int unitIncrement)
setUnitIncrement in interface java.awt.Adjustablepublic int getBlockIncrement()
getBlockIncrement in interface java.awt.Adjustablepublic void setBlockIncrement(int blockIncrement)
setBlockIncrement in interface java.awt.Adjustablepublic int getAlign()
setAlign(int)public void setAlign(int align)
align - LEFT, CENTER, or RIGHTjava.lang.IllegalArgumentException - if the alignment is not one of the above.getAlign()public boolean isFilled()
public void setFilled(boolean filled)
public int getOrientation()
getOrientation in interface java.awt.Adjustablepublic int getVisibleAmount()
getVisibleAmount in interface java.awt.Adjustablepublic void setOrientation(int orientation)
public void setVisibleAmount(int amount)
setVisibleAmount in interface java.awt.Adjustablepublic java.awt.Dimension getMinimumSize()
getMinimumSize in class java.awt.Containerpublic java.awt.Dimension getPreferredSize()
getPreferredSize in class java.awt.Containerpublic void update(java.awt.Graphics g)
update in class java.awt.Containerpublic void paint(java.awt.Graphics g)
paint in class java.awt.Containerpublic boolean isFocusTraversable()
isFocusTraversable in class java.awt.Componentpublic void addActionListener(java.awt.event.ActionListener listener)
listener - the action listenerpublic void removeActionListener(java.awt.event.ActionListener listener)
listener - the action listenerpublic void addAdjustmentListener(java.awt.event.AdjustmentListener listener)
addAdjustmentListener in interface java.awt.Adjustablelistener - the adjustment listenerpublic void removeAdjustmentListener(java.awt.event.AdjustmentListener listener)
removeAdjustmentListener in interface java.awt.Adjustablelistener - the adjustment listenerprotected void processEvent(java.awt.AWTEvent event)
processEvent in class DTextComponentevent - the eventprotected void processActionEvent(java.awt.event.ActionEvent event)
event - the action eventprotected void processAdjustmentEvent(java.awt.event.AdjustmentEvent event)
event - the adjustment eventprotected void processFocusEvent(java.awt.event.FocusEvent event)
processFocusEvent in class java.awt.Componentprotected void processKeyEvent(java.awt.event.KeyEvent event)
processKeyEvent in class java.awt.Componentprotected void processMouseEvent(java.awt.event.MouseEvent event)
processMouseEvent in class DContainerprotected void processMouseMotionEvent(java.awt.event.MouseEvent event)
processMouseMotionEvent in class DContainerpublic void timerFired(TimerEvent event)
timerFired in interface TimerListenerprotected java.lang.String paramString()
paramString in class DTextComponent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||