|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
com.tecnick.jadc.DisplayPanel
public class DisplayPanel
Title: DisplayPanel Class
Description: Class to create digital display
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Panel |
---|
java.awt.Panel.AccessibleAWTPanel |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
private int |
bh
background image height |
private java.awt.Graphics |
bufferGraphics
graphics for double buffering |
private int |
bw
background image width |
private int |
bx
background image X start coordinate |
private int |
by
background image Y start coordinate |
private java.lang.String |
current_info
current string to display |
private int |
dh
digits height |
private java.awt.Image[] |
dig
digit images |
private java.awt.Image[] |
display_digits
images to display in order. |
private int |
dw
digits width |
private int |
dx
digits X start coordinate |
private int |
dy
digits Y start coordinate |
private int |
h
total display height |
private java.awt.Image |
img_bg
background image |
private int |
num_digits
number of display digits |
private java.awt.Image |
offscreen
offscreen image to handle double buffering |
private static long |
serialVersionUID
serialVersionUID |
private int |
w
total display width |
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 | |
---|---|
DisplayPanel()
Build a void panel. |
|
DisplayPanel(int numdig,
java.lang.String info,
java.awt.Image image,
java.awt.Image[] dimg,
int aw,
int ah)
Build a display panel. |
Method Summary | |
---|---|
void |
addNotify()
Creates the Panel's peer. |
void |
paint(java.awt.Graphics g)
draw button elements (border, image and label) at calculated positions |
protected void |
paintImage(java.awt.Graphics gbuffer,
java.awt.Image img,
int x,
int y)
Paint image at specified position |
void |
resize()
Resize the display |
void |
setBackgroundImage(java.awt.Image image)
Set the display background |
void |
setDigitsImages(java.awt.Image[] images)
Set the display digits |
void |
setInfo(java.lang.String info)
Set string to display |
void |
setNumDigits(int numdig)
Set number of display digits |
void |
update(java.awt.Graphics g)
overwrite update method for double buffering |
Methods inherited from class java.awt.Panel |
---|
getAccessibleContext |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private java.awt.Graphics bufferGraphics
private java.awt.Image offscreen
private java.awt.Image img_bg
private java.awt.Image[] dig
private java.awt.Image[] display_digits
private java.lang.String current_info
private int num_digits
private int w
private int h
private int dw
private int dh
private int dx
private int dy
private int bw
private int bh
private int bx
private int by
Constructor Detail |
---|
public DisplayPanel()
public DisplayPanel(int numdig, java.lang.String info, java.awt.Image image, java.awt.Image[] dimg, int aw, int ah)
numdig
- number of display digitsinfo
- string to displayimage
- background imagedimg
- array of digits imagesaw
- applet widthah
- applet heightMethod Detail |
---|
public void update(java.awt.Graphics g)
update
in class java.awt.Container
g
- graphicspublic void setInfo(java.lang.String info)
info
- string to displaypublic void setBackgroundImage(java.awt.Image image)
image
- background imagepublic void setNumDigits(int numdig)
numdig
- number of digits on displaypublic void setDigitsImages(java.awt.Image[] images)
images
- array of digits imagespublic void addNotify()
addNotify
in class java.awt.Panel
public void resize()
protected void paintImage(java.awt.Graphics gbuffer, java.awt.Image img, int x, int y)
gbuffer
- graphic contextimg
- image to paintx
- X coordinatey
- Y coordinatepublic void paint(java.awt.Graphics g)
paint
in class java.awt.Container
g
- the graphic area when diplay button elements
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |