com.tecnick.jadc
Class Jadc

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by com.tecnick.jadc.Jadc
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Runnable, javax.accessibility.Accessible

public class Jadc
extends java.applet.Applet
implements java.lang.Runnable

Title: JADC (Advanced Digital Clock)
Description: Applet to display digital clock or timer

Copyright (c) 2002-2006 Tecnick.com S.r.l (www.tecnick.com) Via Ugo Foscolo n.19 - 09045 Quartu Sant'Elena (CA) - ITALY - www.tecnick.com - info@tecnick.com
Project homepage: http://jxhtmledit.sourceforge.net
License: http://www.gnu.org/copyleft/gpl.html GPL 2

Version:
1.0.007
Author:
Nicola Asuni [www.tecnick.com].
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
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
(package private)  java.applet.Applet a
          only final variables can be used in inner anonymous classes
private  DisplayPanel dpanel
          display panel
private  java.text.SimpleDateFormat formatter
          date formatter
private  boolean isStandalone
          when false indicate that this is not a standalone application
private static java.lang.String JADC_VERSION
          Software version
private  java.util.Date now
          current time
private  java.awt.Color p_background_color
          background color (RRGGBB)
private  java.awt.Image p_background_image
          background image
private  boolean p_counter_mode
          if true display time counter
private  java.lang.String p_counter_time
          target time for counter
private  java.lang.String p_display_pattern
          if true display year
private  java.awt.Image[] p_img
          number and symbols images
private  java.lang.String p_input_pattern
          if true display year
private  boolean p_local_time
          if true use local timezone
private  int p_timezone_hours
          This is the hours offset to add to UTC to get local time.
private  int p_timezone_minutes
          This is the minutes offset to add to UTC to get local time.
private static int SECONDS_IN_DAY
          CONSTANT: number of seconds in one day
private static int SECONDS_IN_HOUR
          CONSTANT: number of seconds in one hour
private static int SECONDS_IN_MINUTE
          CONSTANT: number of seconds in one minute
private static int SECONDS_IN_MONTH
          CONSTANT: number of seconds in one month
private static int SECONDS_IN_YEAR
          CONSTANT: number of seconds in one year
private static long serialVersionUID
          serialVersionUID
private static int SLEEP_TIME
          sleep time in milliseconds between two successive call to display function
private  java.text.SimpleDateFormat target_formatter
          target date formatter (for counter)
(package private)  java.lang.Thread timer
          The thread that displays clock
private  java.util.TimeZone tz
          Time zone
 
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
Jadc()
          Applet void constructor
 
Method Summary
 void destroy()
          Destroy the applet
 java.lang.String getAppletInfo()
          Get Applet information
private  java.lang.String getParameter(java.lang.String key, java.lang.String def)
          get applet parameter value, return default if void
private  void getParameters()
          Get the applet parameters.
 void init()
          Initialize the applet
private static java.awt.Image loadImage(java.applet.Applet a, java.net.URL file)
          Load an image.
private  java.lang.String millisecToPattern(long millisecs)
          Convert milliseconds to date pattern format.
 void run()
          run
private  java.net.URL setURL(java.lang.String link)
          Computes full, canonical URL from a relative specification.
 void start()
          Start the applet
 void stop()
          Stop the applet
 
Methods inherited from class java.applet.Applet
getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
addNotify
 
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, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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, 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, 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

serialVersionUID

private static final long serialVersionUID
serialVersionUID

See Also:
Constant Field Values

isStandalone

private boolean isStandalone
when false indicate that this is not a standalone application


JADC_VERSION

private static final java.lang.String JADC_VERSION
Software version

See Also:
Constant Field Values

timer

java.lang.Thread timer
The thread that displays clock


dpanel

private DisplayPanel dpanel
display panel


a

final java.applet.Applet a
only final variables can be used in inner anonymous classes


p_counter_mode

private boolean p_counter_mode
if true display time counter


p_counter_time

private java.lang.String p_counter_time
target time for counter


p_local_time

private boolean p_local_time
if true use local timezone


p_timezone_hours

private int p_timezone_hours
This is the hours offset to add to UTC to get local time.


p_timezone_minutes

private int p_timezone_minutes
This is the minutes offset to add to UTC to get local time.


p_input_pattern

private java.lang.String p_input_pattern
if true display year


p_display_pattern

private java.lang.String p_display_pattern
if true display year


p_background_color

private java.awt.Color p_background_color
background color (RRGGBB)


p_background_image

private java.awt.Image p_background_image
background image


p_img

private java.awt.Image[] p_img
number and symbols images


now

private java.util.Date now
current time


formatter

private java.text.SimpleDateFormat formatter
date formatter


target_formatter

private java.text.SimpleDateFormat target_formatter
target date formatter (for counter)


tz

private java.util.TimeZone tz
Time zone


SECONDS_IN_MINUTE

private static final int SECONDS_IN_MINUTE
CONSTANT: number of seconds in one minute

See Also:
Constant Field Values

SECONDS_IN_HOUR

private static final int SECONDS_IN_HOUR
CONSTANT: number of seconds in one hour

See Also:
Constant Field Values

SECONDS_IN_DAY

private static final int SECONDS_IN_DAY
CONSTANT: number of seconds in one day

See Also:
Constant Field Values

SECONDS_IN_MONTH

private static final int SECONDS_IN_MONTH
CONSTANT: number of seconds in one month

See Also:
Constant Field Values

SECONDS_IN_YEAR

private static final int SECONDS_IN_YEAR
CONSTANT: number of seconds in one year

See Also:
Constant Field Values

SLEEP_TIME

private static final int SLEEP_TIME
sleep time in milliseconds between two successive call to display function

See Also:
Constant Field Values
Constructor Detail

Jadc

public Jadc()
Applet void constructor

Method Detail

loadImage

private static java.awt.Image loadImage(java.applet.Applet a,
                                        java.net.URL file)
Load an image.

Parameters:
a - applet
file - image file URL
Returns:
loadImage

getParameter

private java.lang.String getParameter(java.lang.String key,
                                      java.lang.String def)
get applet parameter value, return default if void

Parameters:
key - name of parameter to read
def - default value
Returns:
parameter value or default

setURL

private java.net.URL setURL(java.lang.String link)
Computes full, canonical URL from a relative specification.

Parameters:
link - string containing url
Returns:
url

getParameters

private void getParameters()
Get the applet parameters.


init

public void init()
Initialize the applet

Overrides:
init in class java.applet.Applet

start

public void start()
Start the applet

Overrides:
start in class java.applet.Applet

stop

public void stop()
Stop the applet

Overrides:
stop in class java.applet.Applet

destroy

public void destroy()
Destroy the applet

Overrides:
destroy in class java.applet.Applet

run

public void run()
run

Specified by:
run in interface java.lang.Runnable

millisecToPattern

private java.lang.String millisecToPattern(long millisecs)
Convert milliseconds to date pattern format.

Parameters:
millisecs - time to convert (milliseconds)
Returns:
String representation of time

getAppletInfo

public java.lang.String getAppletInfo()
Get Applet information

Overrides:
getAppletInfo in class java.applet.Applet
Returns:
applet information