public class LEDDisplay extends Canvas implements Serializable
Canvas.AccessibleAWTCanvas
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
boolean |
autoCount |
private static int |
DIGIT_HEIGHT |
private static int |
DIGIT_WIDTH |
private Image[] |
digits |
private static Frame |
frame |
private int |
numDigits |
private boolean |
raised |
private int |
value |
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
LEDDisplay()
Constructor for the LEDDisplay object
|
LEDDisplay(boolean r,
int n,
int v)
Constructor for the LEDDisplay object
|
Modifier and Type | Method and Description |
---|---|
int |
getNumDigits()
Gets the numDigits attribute of the LEDDisplay object
|
Dimension |
getPreferredSize()
Gets the preferredSize attribute of the LEDDisplay object
|
int |
getValue()
Gets the value attribute of the LEDDisplay object
|
boolean |
isRaised()
Gets the raised attribute of the LEDDisplay object
|
Image |
loadImage(String name)
Description of the Method
|
static void |
main(String[] args)
main to run/test as an app
|
void |
paint(Graphics g)
Description of the Method
|
void |
setNumDigits(int n)
Sets the numDigits attribute of the LEDDisplay object
|
void |
setRaised(boolean r)
Sets the raised attribute of the LEDDisplay object
|
void |
setValue(int v)
Sets the value attribute of the LEDDisplay object
|
private void |
sizeToFit()
Description of the Method
|
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
private static final int DIGIT_WIDTH
private static final int DIGIT_HEIGHT
private boolean raised
private int numDigits
private int value
public boolean autoCount
public LEDDisplay()
public LEDDisplay(boolean r, int n, int v)
r
- raise the numbersn
- set the number of digitsv
- the number(value) to displaypublic boolean isRaised()
public void setRaised(boolean r)
r
- The new raised valuepublic int getNumDigits()
public void setNumDigits(int n)
n
- The new numDigits valuepublic int getValue()
public void setValue(int v)
v
- The new value valuepublic Dimension getPreferredSize()
getPreferredSize
in class Component
private void sizeToFit()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses