public class BinaryClockApp extends Applet implements Runnable
Applet.AccessibleApplet
Panel.AccessibleAWTPanel
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
private Image |
backBuffer
Description of the Field
|
private Graphics |
bg
Description of the Field
|
private Thread |
clockThread
Description of the Field
|
private String |
decimalTime
Description of the Field
|
private Font |
font
Description of the Field
|
private boolean |
leftToRight
Description of the Field
|
private boolean |
m_fStandAlone
Description of the Field
|
private Calendar |
newnow
Description of the Field
|
private Calendar |
now
Description of the Field
|
private Color |
offColour
The colour of an on bit.
|
private Color |
onColour
The colour of an on bit.
|
boolean |
showText
Description of the Field
|
(package private) int |
x
Description of the Field
|
(package private) int |
y
Description of the Field
|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
BinaryClockApp()
Constructor for the BinaryClockApp object
|
Modifier and Type | Method and Description |
---|---|
String |
calc_bits(int value)
Description of the Method
|
void |
destroy()
Description of the Method
|
private void |
drawBits(String bits,
Graphics g,
int x,
int y)
Draws rectangles 10 wide and 15 high representing the bit pattern passed in
|
private void |
drawBits(String bits,
Graphics g,
int x,
int y,
int dx,
int dy,
int spacing,
boolean vertical)
Draws rectangles representing the bit pattern passed in
|
String |
getAppletInfo()
Gets the appletInfo attribute of the BinaryClockApp object
|
void |
init()
Description of the Method
|
String |
lpad(int value)
Description of the Method
|
static void |
main(String[] args)
STANDALONE APPLICATION SUPPORT
The main() meth;
int height= 10od acts as the applet's entry point when it is run
as a standalone application.
|
private void |
repaintClock(Graphics g)
Description of the Method
|
void |
run()
Main processing method for the BinaryClockApp object
|
void |
start()
Description of the Method
|
void |
stop()
Description of the Method
|
String |
to_alpha_hex(int value)
Description of the Method
|
String |
to_hex(int value)
Description of the Method
|
String |
to_octal(int value)
Description of the Method
|
void |
update(Graphics g)
Description of the Method
|
getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatus
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, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, validate, validateTree
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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, 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, revalidate, 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, transferFocusBackward, transferFocusUpCycle
public boolean showText
private boolean leftToRight
int x
int y
private Image backBuffer
private String decimalTime
private Thread clockThread
private boolean m_fStandAlone
public BinaryClockApp()
public static void main(String[] args)
args
- Description of the Parameterpublic String getAppletInfo()
getAppletInfo
in class Applet
public void run()
public String calc_bits(int value)
value
- Description of the Parameterpublic String lpad(int value)
value
- Description of the Parameterpublic String to_octal(int value)
value
- Description of the Parameterpublic String to_alpha_hex(int value)
value
- Description of the Parameterpublic String to_hex(int value)
value
- Description of the Parameterprivate void repaintClock(Graphics g)
g
- Description of the Parameterprivate void drawBits(String bits, Graphics g, int x, int y)
bits
- the bit pattern to drawg
- Description of the Parameterx
- the start x positiony
- the start y positionprivate void drawBits(String bits, Graphics g, int x, int y, int dx, int dy, int spacing, boolean vertical)
bits
- the bit pattern to drawg
- Description of the Parameterx
- the start x positiony
- the start y positiondx
- delta xdy
- delta yspacing
- the distance between the blocksWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses