Class Digit
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible,SwingConstants
- Direct Known Subclasses:
StaticDigit,ValueDigit
An extension of
SimpleButton displaying one digit (character).- Version:
- $id$
- Author:
- Jernej Kamenik
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class xal.extension.widgets.swing.wheelswitch.comp.SimpleButton
SimpleButton.PanelFlushBorderNested classes/interfaces inherited from class xal.extension.widgets.swing.wheelswitch.comp.ResizableTextLabel
ResizableTextLabel.ResizableAdapterNested classes/interfaces inherited from class javax.swing.JLabel
JLabel.AccessibleJLabelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class xal.extension.widgets.swing.wheelswitch.comp.SimpleButton
CHAIN_ACTION_MODE, DEFAULT_ACTION_MODE, FAST_ACTION_MODE, MOUSE_CHAIN, MOUSE_CLICKED, MOUSE_PRESSED, MOUSE_RELEASED, NULL_ACTION_MODEFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether theDigitis enhanced.booleanChecks for selection of theDigit.booleanReturns the tilting.voidThis method was overriden to implement enhanced anti-aliasing display features as well as animated transitions.protected voidpaintDigitTransition(BufferedImage oldImage, BufferedImage newImage, Graphics g, float parameter) The method combines two images and paints them onto the selectedGraphicsobject based on the value of parameter between 0 and 1.f.voidsetEnhanced(boolean newEnhanced) Sets the enhancment mode of theDigit.voidsetSelected(boolean newSelected) Sets or removes the selection from theDigit.voidThis method has been overriden to implement animated transitions between displayed text images.voidsetTilting(boolean tilting) Sets the tilting.Methods inherited from class xal.extension.widgets.swing.wheelswitch.comp.SimpleButton
addActionListener, addNotify, fireActionPerformed, getActionMode, getBackground, getBackgroundStart, getBorder, getFireRate, getForeground, getPressedBackground, getPressedBackgroundStart, getPressedBorder, getPressedForeground, getRolloverBackground, getRolloverBackgroundStart, getRolloverBorder, getRolloverForeground, isPressed, isRollover, isRolloverEnabled, paintBorder, removeActionListener, removeNotify, setActionMode, setBackground, setBackgroundStart, setBorder, setFireRate, setForeground, setPressed, setPressedBackground, setPressedBackgroundStart, setPressedBorder, setPressedForeground, setRollover, setRolloverBackground, setRolloverBackgroundStart, setRolloverBorder, setRolloverEnabled, setRolloverForeground, setVisibleMethods inherited from class xal.extension.widgets.swing.wheelswitch.comp.GradientLabel
isGradientEnabled, setGradientEnabled, setGradientPointsMethods inherited from class xal.extension.widgets.swing.wheelswitch.comp.ResizableTextLabel
getColumns, getMinimumSize, getPreferredSize, isResizable, resize, setColumns, setMinimumSize, setPreferredSize, setResizableMethods inherited from class javax.swing.JLabel
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setUI, setVerticalAlignment, setVerticalTextPosition, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
Digit
protected Digit()Constructor for Digit creates an empty Digit.
-
-
Method Details
-
setEnhanced
public void setEnhanced(boolean newEnhanced) Sets the enhancment mode of theDigit. When enhanced, the digit is painted using anti-aliasing rendering hints.- Overrides:
setEnhancedin classResizableTextLabel- Parameters:
newEnhanced-
-
isEnhanced
public boolean isEnhanced()Checks whether theDigitis enhanced.- Overrides:
isEnhancedin classResizableTextLabel- Returns:
- boolean
-
setSelected
public void setSelected(boolean newSelected) Sets or removes the selection from theDigit.- Parameters:
newSelected-
-
isSelected
public boolean isSelected()Checks for selection of theDigit.- Returns:
- true if the
Digitis selected, false otherwise.
-
setText
This method has been overriden to implement animated transitions between displayed text images. It sets the new text and starts the animation of the transition (if it is not already running).- Overrides:
setTextin classResizableTextLabel- Parameters:
newText- to be displayed.- See Also:
-
JLabel#setText(java.lang.String)
-
setTilting
public void setTilting(boolean tilting) Sets the tilting.- Parameters:
tilting- The tilting to set
-
isTilting
public boolean isTilting()Returns the tilting.- Returns:
- boolean
-
paintComponent
This method was overriden to implement enhanced anti-aliasing display features as well as animated transitions.- Overrides:
paintComponentin classSimpleButton- Parameters:
g- DOCUMENT ME!- See Also:
-
paintDigitTransition
protected void paintDigitTransition(BufferedImage oldImage, BufferedImage newImage, Graphics g, float parameter) The method combines two images and paints them onto the selectedGraphicsobject based on the value of parameter between 0 and 1.f. When parameter equals 0, oldImage should be painted completely and newImage not at all, and opposite when parameter equals 1.f. Descendants ofDigitshould override this method to implement different types of image transitions.- Parameters:
oldImage-newImage-g- Graphics object on which to paint the two images.parameter- float value between 0 and 1.f.
-