Groovy Documentation

eu.hansolo.custom
[Java] Class Counter

java.lang.Object
  java.awt.Component
      java.awt.Container
          javax.swing.JComponent
              eu.hansolo.custom.Counter
All Implemented Interfaces:
ComponentListener

public class Counter
extends JComponent

Authors:
hansolo


Field Summary
private Rectangle CLIP

protected static String DEC_PROPERTY

private Rectangle DIGIT_CLIP

private ArrayList DIGIT_STACK

protected static String INC_PROPERTY

private org.pushingpixels.trident.ease.Linear LINEAR_EASING

private Point POS

private org.pushingpixels.trident.ease.Spline SPLINE_EASING

private org.pushingpixels.trident.Timeline TIMELINE_DECREMENT

private org.pushingpixels.trident.callback.TimelineCallback TIMELINE_DECREMENT_CALLBACK

private org.pushingpixels.trident.Timeline TIMELINE_INCREMENT

private org.pushingpixels.trident.callback.TimelineCallback TIMELINE_INCREMENT_CALLBACK

protected static String ZERO_PROPERTY

private Color backgroundColor

private BufferedImage backgroundImage

private boolean decFired

private int fireDecrementThreshold

private int fireIncrementThreshold

private boolean incFired

private BufferedImage lenseImage

private int maxValue

private int offset0

private int offset1

private int offsetDecrement

private int offsetIncrement

private int oldOffsetDecrement

private int oldOffsetIncrement

private BufferedImage stackImage

private long switchTime

private Theme theme

private boolean zero

 
Fields inherited from class JComponent
WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_WINDOW, UNDEFINED_CONDITION, TOOL_TIP_TEXT_KEY, TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT
 
Fields inherited from class Container
TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT
 
Constructor Summary
Counter()

 
Method Summary
void componentHidden(ComponentEvent EVENT)

void componentMoved(ComponentEvent EVENT)

void componentResized(ComponentEvent EVENT)

void componentShown(ComponentEvent EVENT)

private BufferedImage create_BACKGROUND_Image(int WIDTH)

private BufferedImage create_DIGIT_Image(int WIDTH, int DIGIT)

private BufferedImage create_LENSE_Image(int WIDTH)

private BufferedImage create_STACK_Image(int WIDTH)

void decrement()

Color getBackgroundColor()

private double getLuminance(Color COLOR)

int getMaxValue()

int getOffsetDecrement()

int getOffsetIncrement()

long getSwitchTime()

Theme getTheme()

void increment()

private void init(int WIDTH, int HEIGHT)

boolean isZero()

protected void paintComponent(Graphics g)

void reset()

void setBackgroundColor(Color BACKGROUND_COLOR)

void setMaxValue(int MAX_VALUE)

void setOffsetDecrement(int OFFSET_DECREMENT)

void setOffsetIncrement(int OFFSET_INCREMENT)

void setSwitchTime(long SWITCH_TIME)

void setTheme(Theme THEME)

String toString()

 
Methods inherited from class JComponent
contains, getLocation, print, getSize, isOpaque, enable, disable, update, getY, getX, getInsets, getInsets, setFont, getPreferredSize, getMinimumSize, getMaximumSize, getAlignmentX, getAlignmentY, paint, getListeners, addNotify, removeNotify, setFocusTraversalKeys, requestFocus, requestFocus, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, setEnabled, isDoubleBuffered, setVisible, setForeground, setBackground, getBounds, reshape, getWidth, getHeight, setPreferredSize, setMinimumSize, setMaximumSize, getBaseline, getBaselineResizeBehavior, getGraphics, getFontMetrics, repaint, repaint, printAll, requestFocusInWindow, updateUI, getUIClassID, addAncestorListener, setInheritsPopupMenu, getInheritsPopupMenu, setComponentPopupMenu, getComponentPopupMenu, isPaintingTile, isPaintingForPrint, isManagingFocus, setNextFocusableComponent, getNextFocusableComponent, setRequestFocusEnabled, isRequestFocusEnabled, grabFocus, setVerifyInputWhenFocusTarget, getVerifyInputWhenFocusTarget, setBorder, getBorder, setAlignmentY, setAlignmentX, setInputVerifier, getInputVerifier, setDebugGraphicsOptions, getDebugGraphicsOptions, registerKeyboardAction, registerKeyboardAction, unregisterKeyboardAction, getRegisteredKeyStrokes, getConditionForKeyStroke, getActionForKeyStroke, resetKeyboardActions, setInputMap, getInputMap, getInputMap, setActionMap, getActionMap, requestDefaultFocus, getDefaultLocale, setDefaultLocale, setToolTipText, getToolTipText, getToolTipText, getToolTipLocation, getPopupLocation, createToolTip, scrollRectToVisible, setAutoscrolls, getAutoscrolls, setTransferHandler, getTransferHandler, getClientProperty, putClientProperty, isLightweightComponent, setOpaque, computeVisibleRect, getVisibleRect, addVetoableChangeListener, removeVetoableChangeListener, getVetoableChangeListeners, getTopLevelAncestor, removeAncestorListener, getAncestorListeners, revalidate, isValidateRoot, isOptimizedDrawingEnabled, paintImmediately, paintImmediately, setDoubleBuffered, getRootPane, add, add, add, add, add, remove, remove, list, list, removeAll, getComponent, invalidate, validate, getComponentCount, countComponents, getComponents, insets, setComponentZOrder, getComponentZOrder, getLayout, setLayout, doLayout, layout, preferredSize, minimumSize, paintComponents, printComponents, addContainerListener, removeContainerListener, getContainerListeners, deliverEvent, getComponentAt, getComponentAt, locate, getMousePosition, findComponentAt, findComponentAt, isAncestorOf, getFocusTraversalKeys, areFocusTraversalKeysSet, isFocusCycleRoot, isFocusCycleRoot, transferFocusBackward, setFocusTraversalPolicy, getFocusTraversalPolicy, isFocusTraversalPolicySet, setFocusCycleRoot, setFocusTraversalPolicyProvider, isFocusTraversalPolicyProvider, transferFocusDownCycle, applyComponentOrientation, addPropertyChangeListener, addPropertyChangeListener, add, toString, getName, contains, size, getParent, getLocation, remove, setName, list, list, list, getSize, resize, resize, setSize, setSize, enable, location, isValid, setLocale, action, getMousePosition, getGraphicsConfiguration, dispatchEvent, isVisible, isEnabled, isDisplayable, isFocusable, getTreeLock, isLightweight, getPeer, isFocusOwner, transferFocus, getFont, isPreferredSizeSet, isMinimumSizeSet, isMaximumSizeSet, isShowing, handleEvent, postEvent, getFocusCycleRootAncestor, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, setDropTarget, getDropTarget, getToolkit, enableInputMethods, show, show, hide, getForeground, isForegroundSet, getBackground, isBackgroundSet, isFontSet, getLocale, getColorModel, getLocationOnScreen, setLocation, setLocation, move, getBounds, bounds, setBounds, setBounds, setCursor, getCursor, isCursorSet, paintAll, repaint, repaint, repaint, imageUpdate, createImage, createImage, createVolatileImage, createVolatileImage, prepareImage, prepareImage, checkImage, checkImage, setIgnoreRepaint, getIgnoreRepaint, inside, addComponentListener, removeComponentListener, getComponentListeners, addFocusListener, removeFocusListener, getFocusListeners, addHierarchyListener, removeHierarchyListener, getHierarchyListeners, addHierarchyBoundsListener, removeHierarchyBoundsListener, getHierarchyBoundsListeners, addKeyListener, removeKeyListener, getKeyListeners, addMouseListener, removeMouseListener, getMouseListeners, addMouseMotionListener, removeMouseMotionListener, getMouseMotionListeners, addMouseWheelListener, removeMouseWheelListener, getMouseWheelListeners, addInputMethodListener, removeInputMethodListener, getInputMethodListeners, getInputMethodRequests, getInputContext, mouseDown, mouseDrag, mouseUp, mouseMove, mouseEnter, mouseExit, keyDown, keyUp, gotFocus, lostFocus, isFocusTraversable, setFocusable, setFocusTraversalKeysEnabled, getFocusTraversalKeysEnabled, nextFocus, transferFocusUpCycle, hasFocus, removePropertyChangeListener, removePropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, setComponentOrientation, getComponentOrientation, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll
 
Methods inherited from class Container
add, add, add, add, add, remove, remove, list, list, print, removeAll, update, getComponent, invalidate, validate, getComponentCount, countComponents, getComponents, getInsets, insets, setComponentZOrder, getComponentZOrder, getLayout, setLayout, doLayout, layout, setFont, getPreferredSize, preferredSize, getMinimumSize, minimumSize, getMaximumSize, getAlignmentX, getAlignmentY, paint, paintComponents, printComponents, addContainerListener, removeContainerListener, getContainerListeners, getListeners, deliverEvent, getComponentAt, getComponentAt, locate, getMousePosition, findComponentAt, findComponentAt, addNotify, removeNotify, isAncestorOf, setFocusTraversalKeys, getFocusTraversalKeys, areFocusTraversalKeysSet, isFocusCycleRoot, isFocusCycleRoot, transferFocusBackward, setFocusTraversalPolicy, getFocusTraversalPolicy, isFocusTraversalPolicySet, setFocusCycleRoot, setFocusTraversalPolicyProvider, isFocusTraversalPolicyProvider, transferFocusDownCycle, applyComponentOrientation, addPropertyChangeListener, addPropertyChangeListener, add, toString, getName, contains, contains, size, getParent, getLocation, getLocation, remove, setName, list, list, list, getSize, getSize, resize, resize, setSize, setSize, isOpaque, enable, enable, disable, location, isValid, setLocale, getY, getX, action, getMousePosition, getGraphicsConfiguration, dispatchEvent, isVisible, isEnabled, isDisplayable, isFocusable, getTreeLock, isLightweight, getPeer, isFocusOwner, transferFocus, getFont, isPreferredSizeSet, isMinimumSizeSet, isMaximumSizeSet, isShowing, handleEvent, postEvent, getFocusCycleRootAncestor, requestFocus, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, setDropTarget, getDropTarget, getToolkit, setEnabled, isDoubleBuffered, enableInputMethods, setVisible, show, show, hide, getForeground, setForeground, isForegroundSet, getBackground, setBackground, isBackgroundSet, isFontSet, getLocale, getColorModel, getLocationOnScreen, setLocation, setLocation, move, getBounds, getBounds, bounds, setBounds, setBounds, reshape, getWidth, getHeight, setPreferredSize, setMinimumSize, setMaximumSize, getBaseline, getBaselineResizeBehavior, getGraphics, getFontMetrics, setCursor, getCursor, isCursorSet, paintAll, repaint, repaint, repaint, repaint, printAll, imageUpdate, createImage, createImage, createVolatileImage, createVolatileImage, prepareImage, prepareImage, checkImage, checkImage, setIgnoreRepaint, getIgnoreRepaint, inside, addComponentListener, removeComponentListener, getComponentListeners, addFocusListener, removeFocusListener, getFocusListeners, addHierarchyListener, removeHierarchyListener, getHierarchyListeners, addHierarchyBoundsListener, removeHierarchyBoundsListener, getHierarchyBoundsListeners, addKeyListener, removeKeyListener, getKeyListeners, addMouseListener, removeMouseListener, getMouseListeners, addMouseMotionListener, removeMouseMotionListener, getMouseMotionListeners, addMouseWheelListener, removeMouseWheelListener, getMouseWheelListeners, addInputMethodListener, removeInputMethodListener, getInputMethodListeners, getInputMethodRequests, getInputContext, mouseDown, mouseDrag, mouseUp, mouseMove, mouseEnter, mouseExit, keyDown, keyUp, gotFocus, lostFocus, isFocusTraversable, setFocusable, setFocusTraversalKeysEnabled, getFocusTraversalKeysEnabled, requestFocusInWindow, nextFocus, transferFocusUpCycle, hasFocus, removePropertyChangeListener, removePropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, setComponentOrientation, getComponentOrientation, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll
 

Field Detail

CLIP

private final Rectangle CLIP


DEC_PROPERTY

protected static final String DEC_PROPERTY


DIGIT_CLIP

private final Rectangle DIGIT_CLIP


DIGIT_STACK

private final ArrayList DIGIT_STACK


INC_PROPERTY

protected static final String INC_PROPERTY


LINEAR_EASING

private final org.pushingpixels.trident.ease.Linear LINEAR_EASING


POS

private final Point POS


SPLINE_EASING

private final org.pushingpixels.trident.ease.Spline SPLINE_EASING


TIMELINE_DECREMENT

private final org.pushingpixels.trident.Timeline TIMELINE_DECREMENT


TIMELINE_DECREMENT_CALLBACK

private final org.pushingpixels.trident.callback.TimelineCallback TIMELINE_DECREMENT_CALLBACK


TIMELINE_INCREMENT

private final org.pushingpixels.trident.Timeline TIMELINE_INCREMENT


TIMELINE_INCREMENT_CALLBACK

private final org.pushingpixels.trident.callback.TimelineCallback TIMELINE_INCREMENT_CALLBACK


ZERO_PROPERTY

protected static final String ZERO_PROPERTY


backgroundColor

private Color backgroundColor


backgroundImage

private BufferedImage backgroundImage


decFired

private boolean decFired


fireDecrementThreshold

private int fireDecrementThreshold


fireIncrementThreshold

private int fireIncrementThreshold


incFired

private boolean incFired


lenseImage

private BufferedImage lenseImage


maxValue

private int maxValue


offset0

private int offset0


offset1

private int offset1


offsetDecrement

private int offsetDecrement


offsetIncrement

private int offsetIncrement


oldOffsetDecrement

private int oldOffsetDecrement


oldOffsetIncrement

private int oldOffsetIncrement


stackImage

private BufferedImage stackImage


switchTime

private long switchTime


theme

private Theme theme


zero

private boolean zero


 
Constructor Detail

Counter

public Counter()


 
Method Detail

componentHidden

@Override
public void componentHidden(ComponentEvent EVENT)


componentMoved

@Override
public void componentMoved(ComponentEvent EVENT)


componentResized

@Override
public void componentResized(ComponentEvent EVENT)


componentShown

@Override
public void componentShown(ComponentEvent EVENT)


create_BACKGROUND_Image

private BufferedImage create_BACKGROUND_Image(int WIDTH)


create_DIGIT_Image

private BufferedImage create_DIGIT_Image(int WIDTH, int DIGIT)


create_LENSE_Image

private BufferedImage create_LENSE_Image(int WIDTH)


create_STACK_Image

private BufferedImage create_STACK_Image(int WIDTH)


decrement

public void decrement()


getBackgroundColor

public Color getBackgroundColor()


getLuminance

private double getLuminance(Color COLOR)


getMaxValue

public int getMaxValue()


getOffsetDecrement

public int getOffsetDecrement()


getOffsetIncrement

public int getOffsetIncrement()


getSwitchTime

public long getSwitchTime()


getTheme

public Theme getTheme()


increment

public void increment()


init

private void init(int WIDTH, int HEIGHT)


isZero

public boolean isZero()


paintComponent

@Override
protected void paintComponent(Graphics g)


reset

public void reset()


setBackgroundColor

public void setBackgroundColor(Color BACKGROUND_COLOR)


setMaxValue

public void setMaxValue(int MAX_VALUE)


setOffsetDecrement

public void setOffsetDecrement(int OFFSET_DECREMENT)


setOffsetIncrement

public void setOffsetIncrement(int OFFSET_INCREMENT)


setSwitchTime

public void setSwitchTime(long SWITCH_TIME)


setTheme

public void setTheme(Theme THEME)


toString

@Override
public String toString()


 

Groovy Documentation