|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--vscript.interpreter.TagInterpreter
The TagInterpreter object interprets the tag.
It creates the object corresponding to the TAG.
It also constructs the message tree transparent to the user.
TagInterpreter contains a number of helper methods that help in interpreting the tag.
Most of the interpreters have to override only the interpretObject method to create an suitable
interpreter.
Constructor Summary | |
TagInterpreter()
|
Method Summary | |
protected void |
addComponent(javax.swing.JComponent comp,
javax.swing.JPanel currentObject,
vscript.GUI.ScreenPos pos,
java.lang.String name)
Metod called if the interpreted child object is a Component and the interpreted object is a Container. This method is to be overridden by Interpreters that interpret Container objects with different behaviour.Default behaviour sets the Layout of the container to PercentLayout if it is not PercentLayout. If the tag does not contain the pos attribute the component is not added. |
java.awt.Image |
getImage(java.lang.String baseStr,
java.lang.String imgStr)
The methods helps interpreters to load images. If the baseStr is null then the imgStr is treated as representing a absolute URL. If imgStr is not an absolute URL then the methods tries to load the image from the code base. |
protected java.util.List |
getSubTagList()
Any interpreter that wants to control which subtags it can allow must override this method.Method that returns a list containing list of subtags that are to be processed. |
static void |
handleMessageGUI(javax.swing.JComponent comp,
vscript.message.Message message)
Helper methods that handles messages to be understood by all GUI components. |
java.lang.Object |
interpret(vscript.Tag tag,
vscript.message.MessageNode parent,
int workingLevel)
Interprets the Tag and returns the interpreted object. Working level is the level at which the interpreter is working. |
protected abstract java.lang.Object |
interpretObject(vscript.Tag tag)
For subclasses to override. |
protected boolean |
nameReqd()
To check if the tag requires an identifier or not.By default true is returned.If a tag does not have a identifier return false. |
static void |
processAttributes(java.awt.Component comp,
vscript.Tag tag)
Process bcolor,fcolor,border,enable,disable attributes. |
static void |
processAttributes(java.awt.Component comp,
vscript.Tag tag,
boolean color,
boolean enabled,
boolean visible,
boolean border)
Process bcolor,fcolor,border,enable,disable attributes. |
static void |
processBColor(java.awt.Component comp,
java.lang.String arg)
Helper method that helps to handle bcolor attribute.If arg is null then default color form VSRHelper is taken. |
static void |
processBorder(java.awt.Component comp,
java.lang.String arg)
Helper method that helps to handle border attribute.If arg is null then default border form VSRHelper is taken. |
static void |
processEnabled(java.awt.Component comp,
java.lang.String arg)
Helper method that helps to handle Enabled attribute. |
static void |
processFColor(java.awt.Component comp,
java.lang.String arg)
Helper method that helps to handle fcolor attribute.If arg is null then default color form VSRHelper is taken. |
protected void |
processObject(java.lang.Object object)
Method should be overridden by interpreters to do some processing on child objects like adding as listeners..ect. |
static void |
processVisible(java.awt.Component comp,
java.lang.String arg)
Helper method that helps to handle Visible attribute. |
static void |
setBorder(javax.swing.JComponent comp,
java.lang.String borderStr)
This method is a helper method that helps to set border around passes component based on the number passed as a string object. |
protected void |
setInterpretOrder(java.util.List list)
Called to change the order of interpretation if required. |
boolean |
validLevel(int level)
This method should be overridden by interpreters to indiciate if it is valid for the interpreter to work at a perticular level. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TagInterpreter()
Method Detail |
public java.lang.Object interpret(vscript.Tag tag, vscript.message.MessageNode parent, int workingLevel)
tag
- The tag to be interpreted.parent
- The parent message node.workingLevel
- The working level of the interpreter.protected java.util.List getSubTagList()
protected boolean nameReqd()
protected void processObject(java.lang.Object object)
object
- The child object created after interpreting the subtags if any.protected void addComponent(javax.swing.JComponent comp, javax.swing.JPanel currentObject, vscript.GUI.ScreenPos pos, java.lang.String name)
comp
- Component to be added.currentObject
- The container to which the component will be added.pos
- The ScreenPos object created based on the pos attribute.name
- The name of the component as specified in the tag identifier.protected abstract java.lang.Object interpretObject(vscript.Tag tag)
tag
- The tag to interpret.protected void setInterpretOrder(java.util.List list)
list
- The list of tag tag objects.public boolean validLevel(int level)
level
- The level at which the interpreter is working.public java.awt.Image getImage(java.lang.String baseStr, java.lang.String imgStr)
baseStr
- String representing the base url.imgStr
- String representing the name of the image.public static void setBorder(javax.swing.JComponent comp, java.lang.String borderStr)
public static void handleMessageGUI(javax.swing.JComponent comp, vscript.message.Message message)
public static void processAttributes(java.awt.Component comp, vscript.Tag tag)
public static void processAttributes(java.awt.Component comp, vscript.Tag tag, boolean color, boolean enabled, boolean visible, boolean border)
public static void processBColor(java.awt.Component comp, java.lang.String arg)
public static void processFColor(java.awt.Component comp, java.lang.String arg)
public static void processBorder(java.awt.Component comp, java.lang.String arg)
public static void processVisible(java.awt.Component comp, java.lang.String arg)
public static void processEnabled(java.awt.Component comp, java.lang.String arg)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |