|
|||||||||
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 | +--javax.swing.JComponent | +--javax.swing.JPanel | +--synapsi.gui.util.SpinControl
Abstract base class for different spin controls. Extending class must provide implementation for functions protected void increase() and protected void decrease() to handle correct updating of spin control values. User should also provide functions for returning spin controls value that convert getValueInner's returnvalue to correct datatype. If direct editing of spin controls value is enabled, user should also provide public function that uses setValueInner.
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
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 |
Constructor Summary | |
SpinControl(javax.swing.text.Document document,
java.lang.String initString)
Constructs new SpinControl, assingns a document and initial String for it |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Handles increase and decrease-buttons by calling increase() or decrease() Fires also event notifying all listeners of change in SpinControls value. |
void |
addActionListener(java.awt.event.ActionListener listener)
Adds action listener to spin controls textField |
protected abstract void |
decrease()
Decrease the value of SpinControl |
void |
editAllowed(boolean enabled)
Enables or disables direct editing of spin control |
void |
fireEvent()
Fires an new ActionEvent to all listeners to notify for changes in SpinControls value. |
void |
focusGained(java.awt.event.FocusEvent e)
Just has to be here, because SpinControl implements FocusListener |
void |
focusLost(java.awt.event.FocusEvent e)
Fires event to notify all listeners, that SpinControl:s value might have changed |
protected java.lang.String |
getValueInner()
Returns spin controls value. |
protected abstract void |
increase()
Increase the value of SpinControl |
void |
setActionCommand(java.lang.String command)
Sets the actionCommand of this SpinControl |
void |
setEnabled(boolean enabled)
Enables or disables this SpinControl |
void |
setMaximumSize(java.awt.Dimension dimension)
Set's dimensions of spin controls components to match given maximum dimension |
void |
setMinimumSize(java.awt.Dimension dimension)
Set's dimensions of spin controls components to match given minimum dimension |
void |
setPreferredSize(java.awt.Dimension dimension)
Set's dimensions of spin controls components to match given preferred dimension |
protected void |
setValueInner(java.lang.String value)
Sets spin controls value. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext,
getUIClassID,
paramString,
updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getWidth,
getVisibleRect,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paint,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
print,
printAll,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setFont,
setForeground,
setNextFocusableComponent,
setOpaque,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
unregisterKeyboardAction,
update |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
processComponentEvent,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public SpinControl(javax.swing.text.Document document, java.lang.String initString)
document
- Document object defining spin controls document formatMethod Detail |
public void setPreferredSize(java.awt.Dimension dimension)
dimension
- Dimension object defining preferred size of whole spin controlpublic void setMaximumSize(java.awt.Dimension dimension)
dimension
- Dimension object defining maximum size of whole spin controlpublic void setMinimumSize(java.awt.Dimension dimension)
dimension
- Dimension object defining minimum size of whole spin controlprotected void setValueInner(java.lang.String value)
value
- new value of this spin controlprotected java.lang.String getValueInner()
public void actionPerformed(java.awt.event.ActionEvent e)
e
- ActionEvent caughtpublic void focusGained(java.awt.event.FocusEvent e)
e
- FocusEvent caughtpublic void focusLost(java.awt.event.FocusEvent e)
e
- FocusEvent caughtpublic void addActionListener(java.awt.event.ActionListener listener)
listener
- ActionListener addedpublic void setActionCommand(java.lang.String command)
comman
- New actionCommand of this SpinControlpublic void setEnabled(boolean enabled)
enabled
- boolean telling either to enable (true) or disable (false) spin controlpublic void editAllowed(boolean enabled)
enabled
- boolean telling either to enable (true) or disable (false) spin controlpublic void fireEvent()
protected abstract void increase()
protected abstract void decrease()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |