Class pmr.cml.TERMENTRYNode
All Packages Class Hierarchy This Package Previous Next Index
Class pmr.cml.TERMENTRYNode
java.lang.Object
|
+----pmr.sgml.SGMLNode
|
+----pmr.sgml.DrawableSGMLNode
|
+----pmr.cml.DrawableX_Node
|
+----pmr.cml.TERMENTRYNode
- public class TERMENTRYNode
- extends DrawableX_Node
a glossary entry - not yet completed
- Author:
- copyright P.Murray-Rust, 1996
-
TERMENTRYNode(String, SGMLTree)
-
-
action(Event, Object)
- pass any button actions to the object
-
addSubordinateTerm(TERMENTRYNode)
- add subordinate class.
-
addSuperordinateTerm(TERMENTRYNode)
- add superordinate class.
-
addURL(String, String, String)
- add a URL (e.g.
-
createADMINNode()
-
-
createAndAdd(SGMLTree, int, String)
-
-
createTERMENTRYNode(CMLTree, String)
- standalone TERMENTRYNode (i.e.
-
debug()
- for debug
-
display()
- Kicks off a ScrollableTopLevel which contains the object.
-
display(Graphics)
- called from the display() routine of DrawableX_Node
-
drawIcon(Graphics, int, int)
- draw a CML icon
-
getDefinition()
- TERMENTRYs *may* have a DEFINITION (which can contain HTML)
-
getID()
- all TERMENTRYs *must* have an ID (without spaces or dubious punctuation);
any attempt to alter ID once set will fail
-
getKeywords()
- TERMENTRYs usually have keywords (ideally taken from ISO 12620); some may
be repeated (e.g.
-
getKeywordsWithName(String)
- get values of all the keywords with a given name (e.g.
-
getOwner()
- TERMENTRYs *may* have an Owner/Title
-
getTerm()
- all TERMENTRYs *must* have a TERM (which can have any punctuation, but is
case-sensitive).
-
getTitle()
- get title from TITLE, DICTNAME, BUILTIN if present, else TITLE
-
mayContain(SGMLNode)
- can this node contain others.
-
mouseUp(Event, int, int)
- action when mouse is unclicked; if not overridden, no action
-
process()
- complex objects may require processing; override this.
-
processMouseBox(Int2Range)
- action when mouseBox has been swept out; if not overridden, tries to
scale the object.
-
setDefinition(String)
- set the definition (at present HTML markup is NOT honoured).
-
setFontScale(double)
-
-
setHTMLKeyword(String, String)
- set a keyword with a given HTML value; no check is made on duplication;
(At present the HTML is only a String); name must be "NOTE" or "EXAMPLE"
-
setID(String)
-
-
setISO12620(String, String)
- set the directory and suffix for the 12620 keywords
-
setISO12620Keywords()
- adds the ISO12620 standard terms to the keywords.
-
setKeyword(String, String)
- set a keyword with a given value; no check is made on duplication;
-
setKeywordDefinition(String, String)
- set a keyword definition (by pointing to a file name)
-
setOwner(String)
-
-
setSuffix(String)
- set the suffix for the entries
-
setTerm(String)
-
-
setTitle(String)
-
-
showHelp()
- display Help
-
toHTML()
- returns (maybe recursively) the HTML representation of the node.
-
toString()
- output as SGML , making sure that children and parents are not included
TERMENTRYNode
public TERMENTRYNode(String giName,
SGMLTree tree)
createTERMENTRYNode
public static int createTERMENTRYNode(CMLTree tree,
String title)
- standalone TERMENTRYNode (i.e. single glossary entry). You must create
a tree (CMLTree) and then create the subnodes using this routine. It returns
the index of the TERMENTRYNode in the tree.
createAndAdd
public static int createAndAdd(SGMLTree tree,
int parentIndex,
String title)
getID
public String getID()
- all TERMENTRYs *must* have an ID (without spaces or dubious punctuation);
any attempt to alter ID once set will fail
setID
public void setID(String id)
getTitle
public String getTitle()
- get title from TITLE, DICTNAME, BUILTIN if present, else TITLE
- Overrides:
- getTitle in class DrawableX_Node
setTitle
public void setTitle(String title)
- Overrides:
- setTitle in class SGMLNode
addSuperordinateTerm
public void addSuperordinateTerm(TERMENTRYNode sup)
- add superordinate class. More than one is allowed (not everyone will
agree with this). The order of addition is irrelevant. 'this' is
automatically added as a subordinate term. Not everyone will agree with
this either!
addSubordinateTerm
public void addSubordinateTerm(TERMENTRYNode sub)
- add subordinate class. More than one is allowed
The order of addition is irrelevant. 'this' is
automatically added as a superordinate term.
Either this or the preceding routine can be used - the effect is the same -
to ensure consistency. Note, however, that usually the children are listed
after the parents so this routine is more likely to reference null.
getTerm
public String getTerm()
- all TERMENTRYs *must* have a TERM (which can have any punctuation, but is
case-sensitive).
any attempt to alter Term once set will fail
setTerm
public void setTerm(String term)
getOwner
public String getOwner()
- TERMENTRYs *may* have an Owner/Title
setOwner
public void setOwner(String owner)
getDefinition
public XHTMLNode getDefinition()
- TERMENTRYs *may* have a DEFINITION (which can contain HTML)
setDefinition
public boolean setDefinition(String def)
- set the definition (at present HTML markup is NOT honoured).
At present a duplicate definition is ignored and false is returned.
getKeywords
public String[] getKeywords()
- TERMENTRYs usually have keywords (ideally taken from ISO 12620); some may
be repeated (e.g. synonyms). This returns a String[] of all keywords in the
order they were added
getKeywordsWithName
public String[] getKeywordsWithName(String name)
- get values of all the keywords with a given name (e.g. synonym). The
name is case-insensitive
setISO12620
public static void setISO12620(String directory,
String suffix)
- set the directory and suffix for the 12620 keywords
setSuffix
public static void setSuffix(String sufx)
- set the suffix for the entries
setISO12620Keywords
public void setISO12620Keywords()
- adds the ISO12620 standard terms to the keywords. This requires the
directory that contains them and their suffices (e.g. "cml") be set by
the above routine
setHTMLKeyword
public void setHTMLKeyword(String name,
String value)
- set a keyword with a given HTML value; no check is made on duplication;
(At present the HTML is only a String); name must be "NOTE" or "EXAMPLE"
setKeyword
public void setKeyword(String name,
String value)
- set a keyword with a given value; no check is made on duplication;
setKeywordDefinition
public void setKeywordDefinition(String keyword,
String filename)
- set a keyword definition (by pointing to a file name)
createADMINNode
public void createADMINNode()
showHelp
public void showHelp()
- display Help
- Overrides:
- showHelp in class DrawableX_Node
mayContain
public boolean mayContain(SGMLNode n)
- can this node contain others.
- Overrides:
- mayContain in class DrawableX_Node
process
public void process()
- complex objects may require processing; override this.
- Overrides:
- process in class DrawableSGMLNode
addURL
public int addURL(String title,
String target,
String builtin)
- add a URL (e.g. for SEE or SEEALSO; target must be a valid file or URL;
builtin can be "XREF", "SEE" or "SEEALSO"
action
public boolean action(Event e,
Object arg)
- pass any button actions to the object
- Overrides:
- action in class DrawableX_Node
setFontScale
public static void setFontScale(double s)
display
public void display()
- Kicks off a ScrollableTopLevel which contains the object.
- Overrides:
- display in class DrawableSGMLNode
display
public void display(Graphics g)
- called from the display() routine of DrawableX_Node
- Overrides:
- display in class DrawableX_Node
mouseUp
public boolean mouseUp(Event e,
int x,
int y)
- action when mouse is unclicked; if not overridden, no action
- Overrides:
- mouseUp in class DrawableX_Node
processMouseBox
public boolean processMouseBox(Int2Range box)
- action when mouseBox has been swept out; if not overridden, tries to
scale the object.
- Overrides:
- processMouseBox in class DrawableX_Node
toString
public String toString()
- output as SGML , making sure that children and parents are not included
- Overrides:
- toString in class SGMLNode
toHTML
public String toHTML()
- returns (maybe recursively) the HTML representation of the node.
- Overrides:
- toHTML in class SGMLNode
debug
public void debug()
- for debug
- Overrides:
- debug in class DrawableX_Node
drawIcon
public int drawIcon(Graphics g,
int x,
int y)
- draw a CML icon
- Overrides:
- drawIcon in class DrawableX_Node
All Packages Class Hierarchy This Package Previous Next Index