lib.java
Class Clock

java.lang.Object
  extended by types.WidgetDef
      extended by lib.java.Clock

public class Clock
extends WidgetDef


Nested Class Summary
 
Nested classes/interfaces inherited from class types.WidgetDef
WidgetDef.Abstract, WidgetDef.Contained, WidgetDef.Derived
 
Field Summary
 
Fields inherited from class types.WidgetDef
id, parent, widget
 
Constructor Summary
Clock(Widget widget, WidgetDef parent)
           
 
Method Summary
 String addAttributes(GUIAttributes attributes)
          The addAttributes code does two things; it creates the lib.java code necessary for the attributes and it type checks for all attributes.
 Map<String,List<String>> getDefaults()
          Every attribute in our language has to have a default setting.
 Set<String> getImports()
          getImports keeps a Set of import lines that are pertinent to the code generated in the other methods.
 Set<String> getInnerClasses()
          getInnerClasses returns a set of strings corresponding to any inner classes utilized by the widget at runtime.
 String getLanguage()
          Accessor method for the Widget language.
 List<String> getModifiers()
          getModifiers returns a list of methods designed to modify various attributes of the widget type in question.
 List<String> getVariables()
          Returns a chunk of code intended to declare variables which the backend code may need access to and therefore should be declared outside of the constructor code.
 String preamble()
          Get the chunk of initialization code to be run first.
 
Methods inherited from class types.WidgetDef
addChild, commentForm, defineWidget, defineWidget, equals, getAncestry, getBaseWidgetDefClasses, getBaseWidgetDefClasses, getBaseWidgetDefClasses, getBaseWidgetDefs, getChildDefaults, getChildModifiers, getCommentName, getMultisynonymousAttributes, getSynonymousAttributes, hashCode, isAbstract, isAbstract, isContained, isContained, isContained, isDerivedFrom, isDerivedFrom, isDerivedFrom, isDerivedFrom, isDerivedFrom, isDerivedFrom, isDerivedFrom, isDerivedFrom, postamble, processAttributes
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Clock

public Clock(Widget widget,
             WidgetDef parent)
Method Detail

getVariables

public List<String> getVariables()
Description copied from class: WidgetDef
Returns a chunk of code intended to declare variables which the backend code may need access to and therefore should be declared outside of the constructor code.

Specified by:
getVariables in class WidgetDef
Returns:
Variable Declaration for the widget.

getLanguage

public String getLanguage()
Description copied from class: WidgetDef
Accessor method for the Widget language.

Specified by:
getLanguage in class WidgetDef
Returns:
language

preamble

public String preamble()
Description copied from class: WidgetDef
Get the chunk of initialization code to be run first. Typically this code will declare a local variable for the widget.

Note that, by its nature, a preamble should only be called once; therefore the preamble is not inherited.

Specified by:
preamble in class WidgetDef
Returns:
Instatiation code.

getDefaults

public Map<String,List<String>> getDefaults()
Description copied from class: WidgetDef
Every attribute in our language has to have a default setting. This returns all the defaults in a map of Strings to Lists of Strings.

Specified by:
getDefaults in class WidgetDef
Returns:
Map of attribute defaults

addAttributes

public String addAttributes(GUIAttributes attributes)
                     throws BadAttributeException
Description copied from class: WidgetDef
The addAttributes code does two things; it creates the lib.java code necessary for the attributes and it type checks for all attributes. A BadAttributeException is thrown if the names or the values are erroneous. If an attribute is not found in the GUIAttributes, a BadAttributeNameException is thrown from GUIAttributes.

Specified by:
addAttributes in class WidgetDef
Parameters:
attributes - The attributes to set for the widget.
Returns:
The generated code to set the attributes.
Throws:
BadAttributeException

getModifiers

public List<String> getModifiers()
Description copied from class: WidgetDef
getModifiers returns a list of methods designed to modify various attributes of the widget type in question. When getModifiers is called, the accessors and mutators for all attributes are returned.

Specified by:
getModifiers in class WidgetDef
Returns:
List of mutators and accessors for the widget type.

getImports

public Set<String> getImports()
Description copied from class: WidgetDef
getImports keeps a Set of import lines that are pertinent to the code generated in the other methods.

Specified by:
getImports in class WidgetDef
Returns:
Set of import strings.

getInnerClasses

public Set<String> getInnerClasses()
Description copied from class: WidgetDef
getInnerClasses returns a set of strings corresponding to any inner classes utilized by the widget at runtime. This is primarily intended to make defining and manipulating (at runtime) non swing elements more straightforward and flexible. Since the majority of definitions will most likely not be utilizing this functionality, the default action is to return an empty set. This can be overridden where appropriate.

Overrides:
getInnerClasses in class WidgetDef
Returns:
Set of Inner Classes.