public class PJSpinButton extends JComponent implements ActionListener, KeyListener, FocusListener, DocumentListener, MouseWheelListener
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
PJSpinButton(PControl owner,
int columns,
String originalString,
int masterIndex,
PPanel panel,
boolean hasBorder,
double scaleButtonWidth)
Creates a new visual SpinButton, with the specified number of columns.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e)
Handles
ActionEvent generated by the timer. |
void |
addKeyListener(KeyListener kl)
Remap add key listener to the actual entry field.
|
void |
changedUpdate(DocumentEvent e)
The entry field item has changed.
|
void |
doLayout()
Lays out the SpinButton with all its subcomponents.
|
void |
focusGained(FocusEvent e)
Focus gained message: from FocusListener interface.
|
void |
focusLost(FocusEvent e)
Focus lost message: from FocusListener interface.
|
Color |
getBackground() |
Font |
getFont()
Gets the font used in the text field.
|
Color |
getForeground() |
Dimension |
getMinimumSize() |
Dimension |
getPreferredSize() |
PJEntryField |
getTextField()
Gets a handle to the text field.
|
void |
grabFocus()
Override grab focus and try to set focus to text area.
|
void |
insertUpdate(DocumentEvent e)
The entry field item is changed due to an insertion of text.
|
boolean |
isFocusTraversable()
This component handles focus, so return true.
|
void |
itemStateChanged(ItemEvent e)
Notifies that a combobox list item have been selected.
|
void |
keyPressed(KeyEvent e) |
void |
keyReleased(KeyEvent e) |
void |
keyTyped(KeyEvent e) |
void |
mouseWheelMoved(MouseWheelEvent e)
Mouse wheel support.
|
void |
removeNotify()
Make sure timer is killed.
|
void |
removeUpdate(DocumentEvent e)
The entry field item is changed due to text removal.
|
void |
requestFocus()
Override request focus and try to set focus to text area.
|
void |
setBackground(Color c) |
void |
setEnabled(boolean isEnabled)
Set JtextField enable/disable and set enabled to text area.
|
void |
setFont(Font font)
Sets the font for the text field.
|
void |
setForeground(Color c) |
void |
setHorizontalAlignment(int alignment)
Sets the horizontal alignment in the text field.
|
void |
setToolTipText(String s)
Sets the tool-tip text entry field and spin buttons.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, 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, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public PJSpinButton(PControl owner, int columns, String originalString, int masterIndex, PPanel panel, boolean hasBorder, double scaleButtonWidth)
public void addKeyListener(KeyListener kl)
addKeyListener
in class Component
public PJEntryField getTextField()
public void setHorizontalAlignment(int alignment)
alignment
- The new alignment.public void setFont(Font font)
setFont
in class JComponent
font
- The new font to be used in the text field.public Font getFont()
getFont
in interface MenuContainer
getFont
in class Component
public void setForeground(Color c)
setForeground
in class JComponent
public void setBackground(Color c)
setBackground
in class JComponent
public Color getForeground()
getForeground
in class Component
public Color getBackground()
getBackground
in class Component
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public Dimension getMinimumSize()
getMinimumSize
in class JComponent
public void doLayout()
public void removeNotify()
removeNotify
in class JComponent
public void actionPerformed(ActionEvent e)
ActionEvent
generated by the timer.actionPerformed
in interface ActionListener
e
- The ActionEvent from the timer.public void keyPressed(KeyEvent e)
keyPressed
in interface KeyListener
public void keyTyped(KeyEvent e)
keyTyped
in interface KeyListener
public void keyReleased(KeyEvent e)
keyReleased
in interface KeyListener
public void mouseWheelMoved(MouseWheelEvent e)
mouseWheelMoved
in interface MouseWheelListener
public void focusLost(FocusEvent e)
focusLost
in interface FocusListener
public void focusGained(FocusEvent e)
focusGained
in interface FocusListener
public void setEnabled(boolean isEnabled)
setEnabled
in class JComponent
public void grabFocus()
grabFocus
in class JComponent
public void requestFocus()
requestFocus
in class JComponent
public boolean isFocusTraversable()
isFocusTraversable
in class Component
public void setToolTipText(String s)
setToolTipText
in class JComponent
public void itemStateChanged(ItemEvent e)
public void changedUpdate(DocumentEvent e)
changedUpdate
in interface DocumentListener
public void insertUpdate(DocumentEvent e)
insertUpdate
in interface DocumentListener
public void removeUpdate(DocumentEvent e)
removeUpdate
in interface DocumentListener
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.