Groovy Documentation

eu.hansolo.custom
[Java] Class FlipChar

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

public class FlipChar
extends JComponent

Authors:
hansolo


Field Summary
private Rectangle2D BOTTOM_CLIP

private float[] BOTTOM_FONT_GRADIENT_FRACTIONS

private Point2D BOTTOM_FONT_GRADIENT_START

private Point2D BOTTOM_FONT_GRADIENT_STOP

private Rectangle2D CLIP

private ComponentListener COMPONENT_LISTENER

private Rectangle INNER_BOUNDS

private static String PROPERTY_CHARACTER

private BasicStroke THIN_STROKE

private Rectangle2D TOP_CLIP

private float[] TOP_FONT_GRADIENT_FRACTIONS

private Point2D TOP_FONT_GRADIENT_START

private Point2D TOP_FONT_GRADIENT_STOP

private BufferedImage backgroundImage

private Color[] bottomFontGradientColors

private String character

private char currentChar

private int currentFlipSequenceImage

private boolean flipComplete

private BufferedImage flipSequenceImage

private Font font

private Color fontColor

private BufferedImage foregroundImage

private char lastChar

private boolean reachedChar

private Color[] topFontGradientColors

 
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
FlipChar()

 
Method Summary
void actionPerformed(ActionEvent EVENT)

private void calcInnerBounds()

Calculates the area that is available for painting the display

private BufferedImage createBackgroundImage(int WIDTH, int HEIGHT)

private BufferedImage createForegroundImage(int WIDTH, int HEIGHT)

String getCharacter()

Color getFontColor()

private Rectangle getInnerBounds()

Returns a rectangle2d representing the available space for drawing the component taking the insets into account (e.g. given through borders etc.)

Dimension getMinimumSize()

private void init(int WIDTH, int HEIGHT)

protected void paintComponent(Graphics g)

void setBounds(Rectangle BOUNDS)

void setBounds(int X, int Y, int WIDTH, int HEIGHT)

void setCharacter(String CHARACTER)

void setFontColor(Color FONT_COLOR)

void setPreferredSize(Dimension DIM)

void setSize(int WIDTH, int HEIGHT)

void setSize(Dimension DIM)

 
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

BOTTOM_CLIP

private final Rectangle2D BOTTOM_CLIP


BOTTOM_FONT_GRADIENT_FRACTIONS

private final float[] BOTTOM_FONT_GRADIENT_FRACTIONS


BOTTOM_FONT_GRADIENT_START

private final Point2D BOTTOM_FONT_GRADIENT_START


BOTTOM_FONT_GRADIENT_STOP

private final Point2D BOTTOM_FONT_GRADIENT_STOP


CLIP

private final Rectangle2D CLIP


COMPONENT_LISTENER

private final ComponentListener COMPONENT_LISTENER


INNER_BOUNDS

private final Rectangle INNER_BOUNDS


PROPERTY_CHARACTER

private static final String PROPERTY_CHARACTER


THIN_STROKE

private final BasicStroke THIN_STROKE


TOP_CLIP

private final Rectangle2D TOP_CLIP


TOP_FONT_GRADIENT_FRACTIONS

private final float[] TOP_FONT_GRADIENT_FRACTIONS


TOP_FONT_GRADIENT_START

private final Point2D TOP_FONT_GRADIENT_START


TOP_FONT_GRADIENT_STOP

private final Point2D TOP_FONT_GRADIENT_STOP


backgroundImage

private BufferedImage backgroundImage


bottomFontGradientColors

private Color[] bottomFontGradientColors


character

private String character


currentChar

private char currentChar


currentFlipSequenceImage

private int currentFlipSequenceImage


flipComplete

private boolean flipComplete


flipSequenceImage

private BufferedImage flipSequenceImage


font

private Font font


fontColor

private Color fontColor


foregroundImage

private BufferedImage foregroundImage


lastChar

private char lastChar


reachedChar

private boolean reachedChar


topFontGradientColors

private Color[] topFontGradientColors


 
Constructor Detail

FlipChar

public FlipChar()


 
Method Detail

actionPerformed

@Override
public void actionPerformed(ActionEvent EVENT)


calcInnerBounds

private void calcInnerBounds()
Calculates the area that is available for painting the display


createBackgroundImage

private BufferedImage createBackgroundImage(int WIDTH, int HEIGHT)


createForegroundImage

private BufferedImage createForegroundImage(int WIDTH, int HEIGHT)


getCharacter

public String getCharacter()


getFontColor

public Color getFontColor()


getInnerBounds

private Rectangle getInnerBounds()
Returns a rectangle2d representing the available space for drawing the component taking the insets into account (e.g. given through borders etc.)
Returns:
rectangle2d that represents the area available for rendering the component


getMinimumSize

@Override
public Dimension getMinimumSize()


init

private void init(int WIDTH, int HEIGHT)


paintComponent

@Override
protected void paintComponent(Graphics g)


setBounds

@Override
public void setBounds(Rectangle BOUNDS)


setBounds

@Override
public void setBounds(int X, int Y, int WIDTH, int HEIGHT)


setCharacter

public void setCharacter(String CHARACTER)


setFontColor

public void setFontColor(Color FONT_COLOR)


setPreferredSize

@Override
public void setPreferredSize(Dimension DIM)


setSize

@Override
public void setSize(int WIDTH, int HEIGHT)


setSize

@Override
public void setSize(Dimension DIM)


 

Groovy Documentation