|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--com.klg.jclass.util.swing.AbstractSpinBox
Abstract base for creating spinboxes.
Nested Class Summary | |
class |
AbstractSpinBox.ArrowButton
Arrow button used to match look and feel. |
class |
AbstractSpinBox.MetalArrowButton
Arrow button for Metal look and feel. |
static class |
AbstractSpinBox.MetalBorder
Generates a border for the Metal look and feel. |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
protected boolean |
arrowKeySpinningAllowed
|
protected Timer |
buttonTimer
|
protected boolean |
continuousScroll
|
protected JButton |
currentButton
|
protected static int |
DECREMENT
|
protected JButton |
downArrow
|
protected boolean |
editable
|
protected com.klg.jclass.util.swing.JCSpinBoxEditor |
editor
|
protected static boolean |
editorIsValidateRoot
|
protected static int |
INCREMENT
|
protected com.klg.jclass.util.swing.AbstractSpinBox.Listener |
l
|
protected static Border |
metalBorder
|
protected static int |
minimumHeight
|
protected static int |
NONE
|
protected com.klg.jclass.util.swing.JCSpinBoxRenderer |
renderer
|
protected JPanel |
renderPanel
|
protected com.klg.jclass.util.swing.AbstractSpinBox.RendererListener |
rl
|
protected JButton |
upArrow
|
protected Font |
userFont
|
protected com.klg.jclass.util.JCListenerList |
valueListeners
|
protected com.klg.jclass.util.value.JCValueModel |
valueModel
|
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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 | |
AbstractSpinBox()
Creates an empty Spin Control. |
|
AbstractSpinBox(com.klg.jclass.util.value.JCValueModel model,
com.klg.jclass.util.swing.JCSpinBoxEditor editor)
Creates an empty Spin Control. |
|
AbstractSpinBox(com.klg.jclass.util.value.JCValueModel model,
com.klg.jclass.util.swing.JCSpinBoxEditor editor,
com.klg.jclass.util.swing.JCSpinBoxRenderer renderer)
Constructor for the abstract protion of the spinbox. |
Method Summary | |
void |
addValueListener(com.klg.jclass.util.value.JCValueListener listener)
Adds a listener to listen for changes to the value. |
protected abstract void |
checkArrowButtons()
Abstract method that check if arrows should be enabled or disabled. |
boolean |
compareToValue(Object compare_value)
Compares any object to the stored value. |
void |
configureArrowButtons()
Creates and sets up the spin arrows. |
protected JButton |
createDecrArrow()
Creates the decrement arrow. |
protected JButton |
createIncrArrow()
Creates the increment arrow. |
protected void |
doBorder()
|
protected void |
doFocusedLook(Graphics g)
|
void |
doLayout()
Positions the text field and arrow buttons. |
protected void |
doNonFocusedLook(Graphics g)
|
JButton |
getDecrementArrow()
Gets the decrement (down) button. |
com.klg.jclass.util.swing.JCSpinBoxEditor |
getEditor()
Get the editor being used by this spinbox. |
JButton |
getIncrementArrow()
Gets the increment (up) button. |
Dimension |
getPreferredSize()
Returns the preferred size of the Spin Field. |
com.klg.jclass.util.swing.JCSpinBoxRenderer |
getRenderer()
Get the renderer being used by this spinbox |
com.klg.jclass.util.value.JCValueModel |
getValueModel()
Get the value model. |
protected void |
handleKeyPressed(KeyEvent e)
Overridden in JCSpinBox to add keySelectionManager functionality |
boolean |
isArrowKeySpinningAllowed()
Returns whether or not the up/down arrow keys can be used for spinning. |
boolean |
isContinuousScroll()
Return the continuousScroll property. |
boolean |
isEditable()
Returns true if the JCSpinBox is editable. |
boolean |
isEnabled()
Test to see if the component is enabled. |
boolean |
isFocusTraversable()
Test to see if this component is focus traversable |
void |
paint(Graphics g)
Paint the spinbox. |
protected int |
preferredHeightOfView()
Returns the text field's preferred height. |
protected int |
preferredWidthOfView()
Returns the sum of the text field's and arrow button's preferred widths. |
protected void |
processFocusLost(FocusEvent e)
|
protected void |
processValueChanged(com.klg.jclass.util.value.JCValueEvent ev)
This method can be overridded by the subclass |
protected void |
processValueChanging(com.klg.jclass.util.value.JCValueEvent ev)
This method can be overridded by the subclass |
void |
removeValueListener(com.klg.jclass.util.value.JCValueListener listener)
Removes a listener that listens for changes to the value. |
void |
requestFocus()
Request the focus for this component. |
void |
setArrowEnabled(JButton arrow,
boolean enabled)
For use by concrete implementations of the checkArrowButtons to
safely disable the buttons as necessary. |
void |
setArrowKeySpinningAllowed(boolean value)
Sets whether or not the up/down arrow keys can be used for spinning. |
void |
setBackground(Color background)
Sets background of the Spin field |
void |
setContinuousScroll(boolean continuousScroll)
Should arrow buttons continuously scroll when the the mouse button is held down, or discretely (jump) scroll on each mouse click? |
void |
setEditable(boolean aFlag)
Determines whether the JCSpinBox field is editable. |
void |
setEditor(com.klg.jclass.util.swing.JCSpinBoxEditor editor)
Sets the editor used to paint and edit the selected item in the JCSpinBox field. |
void |
setEnabled(boolean b)
Set the enable state of this component. |
void |
setFont(Font f)
Sets the font for this component. |
void |
setForeground(Color foreground)
Sets foreground color of the Spin field |
void |
setLayout(LayoutManager mgr)
Sets the layout manager for this container. |
void |
setLocale(Locale l)
Sets the locale of this component. |
void |
setRenderer(com.klg.jclass.util.swing.JCSpinBoxRenderer aRenderer)
Set the renderer for this spinbox to use. |
void |
setUI(ComponentUI ui)
Set UI. |
void |
setValue(Object o)
Set the value displayed by the spin box. |
void |
setValueModel(com.klg.jclass.util.value.JCValueModel model)
Set the value model. |
protected abstract Object |
spinDown()
Return the new value generated when spinning down a notch |
protected abstract Object |
spinUp()
Return the new value generated when spinning up a notch |
protected void |
swapEditorRenderer()
|
void |
updateUI()
Update UI. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected boolean continuousScroll
protected com.klg.jclass.util.swing.JCSpinBoxEditor editor
protected com.klg.jclass.util.swing.JCSpinBoxRenderer renderer
protected Font userFont
protected JPanel renderPanel
protected JButton downArrow
protected JButton upArrow
protected boolean arrowKeySpinningAllowed
protected com.klg.jclass.util.swing.AbstractSpinBox.Listener l
protected com.klg.jclass.util.swing.AbstractSpinBox.RendererListener rl
protected Timer buttonTimer
protected JButton currentButton
protected com.klg.jclass.util.value.JCValueModel valueModel
protected com.klg.jclass.util.JCListenerList valueListeners
protected boolean editable
protected static int minimumHeight
protected static boolean editorIsValidateRoot
protected static final Border metalBorder
protected static final int NONE
protected static final int INCREMENT
protected static final int DECREMENT
Constructor Detail |
public AbstractSpinBox(com.klg.jclass.util.value.JCValueModel model, com.klg.jclass.util.swing.JCSpinBoxEditor editor, com.klg.jclass.util.swing.JCSpinBoxRenderer renderer)
public AbstractSpinBox(com.klg.jclass.util.value.JCValueModel model, com.klg.jclass.util.swing.JCSpinBoxEditor editor)
public AbstractSpinBox()
Method Detail |
public void setContinuousScroll(boolean continuousScroll)
continuousScroll
- a boolean, true
means scroll continuously while the mouse is held down,
false (the default) means scroll one value per mouse click.public boolean isContinuousScroll()
public void setUI(ComponentUI ui)
setUI
in class JComponent
public void updateUI()
updateUI
in class JComponent
public void addValueListener(com.klg.jclass.util.value.JCValueListener listener)
public void removeValueListener(com.klg.jclass.util.value.JCValueListener listener)
public void setValueModel(com.klg.jclass.util.value.JCValueModel model)
public com.klg.jclass.util.value.JCValueModel getValueModel()
public void setValue(Object o)
o
- The new valuepublic boolean compareToValue(Object compare_value)
protected JButton createIncrArrow()
protected JButton createDecrArrow()
public void configureArrowButtons()
public void requestFocus()
requestFocus
in class JComponent
public void setEditable(boolean aFlag)
JCSpinBox
field is editable. An editable
JCSpinBox
allows the user to type into the field or selected an
item from the list to initialize the field, after which it can be edited.
(The editing affects only the field, the list item remains intact.) A non
editable JCSpinBox
displays the selected item inthe field, but
the selection cannot be modified.
aFlag
- A boolean value, where true indicates that the field is editablepublic boolean isEditable()
public void setEnabled(boolean b)
setEnabled
in class JComponent
public boolean isEnabled()
isEnabled
in class Component
public boolean isFocusTraversable()
isFocusTraversable
in class Component
public void setEditor(com.klg.jclass.util.swing.JCSpinBoxEditor editor)
JCSpinBox
field. The editor is used only if the receiving
JCSpinBox is editable. If not editable, the combo box uses the renderer to
paint the selected item.
editor
- that displays the selected itemsetRenderer(com.klg.jclass.util.swing.JCSpinBoxRenderer)
public com.klg.jclass.util.swing.JCSpinBoxEditor getEditor()
public void setRenderer(com.klg.jclass.util.swing.JCSpinBoxRenderer aRenderer)
public com.klg.jclass.util.swing.JCSpinBoxRenderer getRenderer()
protected void swapEditorRenderer()
public JButton getDecrementArrow()
public JButton getIncrementArrow()
public boolean isArrowKeySpinningAllowed()
setArrowKeySpinningAllowed(boolean)
public void setArrowKeySpinningAllowed(boolean value)
true
by default, and useful to turn off if you wish
to use the arrow keys for traversal.
protected int preferredWidthOfView()
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
protected int preferredHeightOfView()
public void setBackground(Color background)
setBackground
in class JComponent
public void setForeground(Color foreground)
setForeground
in class JComponent
public void setFont(Font f)
setFont
in class JComponent
f
- The desired Font
for this componentJComponent.setFont(java.awt.Font)
public void setLocale(Locale l)
setLocale
in class Component
l
- the locale to become this component's localeComponent.setLocale(java.util.Locale)
public void doLayout()
doLayout
in class Container
protected void doFocusedLook(Graphics g)
protected void doNonFocusedLook(Graphics g)
protected void doBorder()
public void paint(Graphics g)
paint
in class JComponent
public void setArrowEnabled(JButton arrow, boolean enabled)
checkArrowButtons
to
safely disable the buttons as necessary.
protected abstract void checkArrowButtons()
setArrowEnabled(javax.swing.JButton, boolean)
protected abstract Object spinUp()
protected abstract Object spinDown()
protected void processValueChanging(com.klg.jclass.util.value.JCValueEvent ev)
protected void processValueChanged(com.klg.jclass.util.value.JCValueEvent ev)
protected void handleKeyPressed(KeyEvent e)
public final void setLayout(LayoutManager mgr)
setLayout
in class Container
protected void processFocusLost(FocusEvent e)
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |