org.tbee.swing.ledpanel
Class Led

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by org.tbee.swing.ledpanel.Led
All Implemented Interfaces:
ComponentListener, ImageObserver, MenuContainer, Serializable, EventListener

public class Led
extends JComponent
implements ComponentListener

Author:
hansolo
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Led()
           
 
Method Summary
 void componentHidden(ComponentEvent event)
           
 void componentMoved(ComponentEvent event)
           
 void componentResized(ComponentEvent event)
           
 void componentShown(ComponentEvent event)
           
 Color getColor()
          Returns the color of led.
 BufferedImage getCurrentLedImage()
          Returns the image of the currently used led image.
 BufferedImage getLedImageOff()
          Returns the image of the switched off threshold led with the currently active ledcolor.
 BufferedImage getLedImageOn()
          Returns the image of the switched on threshold led with the currently active ledcolor.
 Dimension getMinimumSize()
           
 boolean isLedOn()
          Returns true if the led is on
protected  void paintComponent(Graphics g)
           
 void setBounds(int X, int Y, int WIDTH, int HEIGHT)
           
 void setBounds(Rectangle BOUNDS)
           
 void setColor(Color COLOR)
          Sets the color of the threshold led.
 void setLedOn(boolean LED_ON)
          Sets the state of the led
 void setPreferredSize(Dimension DIM)
           
 void setSize(Dimension DIM)
           
 void setSize(int WIDTH, int HEIGHT)
           
 String toString()
           
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, 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, hide, imageUpdate, 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, resize, resize, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Led

public Led()
Method Detail

paintComponent

protected void paintComponent(Graphics g)
Overrides:
paintComponent in class JComponent

getColor

public Color getColor()
Returns the color of led. The LedColor is not a standard color but defines a color scheme for the led. The default ledcolor is RED

Returns:
the selected the color for the led

setColor

public void setColor(Color COLOR)
Sets the color of the threshold led. The LedColor is not a standard color but defines a color scheme for the led. The default ledcolor is RED

Parameters:
COLOR -

isLedOn

public boolean isLedOn()
Returns true if the led is on

Returns:
true if the led is on

setLedOn

public void setLedOn(boolean LED_ON)
Sets the state of the led

Parameters:
LED_ON -

getLedImageOn

public BufferedImage getLedImageOn()
Returns the image of the switched on threshold led with the currently active ledcolor.

Returns:
the image of the led with the state active and the selected led color

getLedImageOff

public BufferedImage getLedImageOff()
Returns the image of the switched off threshold led with the currently active ledcolor.

Returns:
the image of the led with the state inactive and the selected led color

getCurrentLedImage

public BufferedImage getCurrentLedImage()
Returns the image of the currently used led image.

Returns:
the led image at the moment (depends on blinking)

getMinimumSize

public Dimension getMinimumSize()
Overrides:
getMinimumSize in class JComponent

setPreferredSize

public void setPreferredSize(Dimension DIM)
Overrides:
setPreferredSize in class JComponent

setSize

public void setSize(int WIDTH,
                    int HEIGHT)
Overrides:
setSize in class Component

setSize

public void setSize(Dimension DIM)
Overrides:
setSize in class Component

setBounds

public void setBounds(Rectangle BOUNDS)
Overrides:
setBounds in class Component

setBounds

public void setBounds(int X,
                      int Y,
                      int WIDTH,
                      int HEIGHT)
Overrides:
setBounds in class Component

componentResized

public void componentResized(ComponentEvent event)
Specified by:
componentResized in interface ComponentListener

componentMoved

public void componentMoved(ComponentEvent event)
Specified by:
componentMoved in interface ComponentListener

componentShown

public void componentShown(ComponentEvent event)
Specified by:
componentShown in interface ComponentListener

componentHidden

public void componentHidden(ComponentEvent event)
Specified by:
componentHidden in interface ComponentListener

toString

public String toString()
Overrides:
toString in class Component


Copyright © 2011 KnowledgePlaza. All Rights Reserved.