Class pmr.sgml.DrawableSGMLNode
All Packages Class Hierarchy This Package Previous Next Index
Class pmr.sgml.DrawableSGMLNode
java.lang.Object
|
+----pmr.sgml.SGMLNode
|
+----pmr.sgml.DrawableSGMLNode
- public class DrawableSGMLNode
- extends SGMLNode
- implements Drawable, Helpable
a minimal implementation of SGMLNode combined with the Drawable
interface - mainly for subclassing
- Author:
- (C) P. Murray-Rust, 1996
-
component
-
-
drawableHelp
-
-
helpText
-
-
highlightable
-
-
scaler2d
-
-
selected
-
-
stl
-
-
DrawableSGMLNode()
- create the DrawableSGMLNode
-
DrawableSGMLNode(String, SGMLTree)
-
-
action(Event, Object)
- pass any button actions to the object
-
addHelp(String[])
-
-
debug()
- for debug
-
display()
- Kicks off a ScrollableTopLevel which contains the object.
-
display(Graphics)
- displays the object to a pre-selected graphics context
-
display(Graphics, Component)
- dummy at present until worked out
-
getScaler2D()
- gets the Scaler2D context from the object (object must contain this)
-
isSelected()
- and find out whether it is
-
main(String[])
-
-
mouseBox(Event, int, int)
- action when mouseBox has been swept out; if not overridden, tries to
scale the object.
-
mouseDown(Event, int, int)
- traps mouse clicks; if not dealt with by theDrawable, may be passed to
other routines such as MouseManager.
-
mouseDrag(Event, int, int)
- traps mouse drags; if not dealt with by theDrawable, may be passed to
other routines such as MouseManager.
-
mouseUp(Event, int, int)
- traps mouse clicks; if not dealt with by theDrawable, may be passed to
other routines
-
postMessage(String)
- a way for the object to post the message onto its area if possible
-
process()
- complex objects may require processing; override this.
-
process(Graphics, Scaler2D)
-
-
processMouseBox(Int2Range)
- requests the Drawable to take action after a mouseBox has been swept
out .
-
setComponent(Component)
- set the component that the Drawable is on (if we know).
-
setHighlightable(boolean)
- set the Drawable so that subaddresses are highlighted (marked) rather
than take immediate action
-
setScaler2D(Scaler2D)
- occasionally need to set the Scaler2D context (e.g.
-
setSelected(boolean)
- tell the object it has been selected (e.g.
-
showHelp()
- a help file for the Node.
selected
protected boolean selected
highlightable
protected boolean highlightable
scaler2d
protected Scaler2D scaler2d
component
protected Component component
drawableHelp
protected DrawableHelp drawableHelp
helpText
protected StringList helpText
stl
protected ScrollableTopLevel stl
DrawableSGMLNode
public DrawableSGMLNode()
- create the DrawableSGMLNode
DrawableSGMLNode
public DrawableSGMLNode(String giName,
SGMLTree tree)
addHelp
public void addHelp(String s[])
setComponent
public void setComponent(Component c)
- set the component that the Drawable is on (if we know). It might be
a ScrollableTopLevel from elsewhere, so remember that as well...
(This may be superseded by display(g, c)...
mouseUp
public boolean mouseUp(Event evt,
int x,
int y)
- traps mouse clicks; if not dealt with by theDrawable, may be passed to
other routines
mouseDrag
public boolean mouseDrag(Event evt,
int x,
int y)
- traps mouse drags; if not dealt with by theDrawable, may be passed to
other routines such as MouseManager.
mouseDown
public boolean mouseDown(Event evt,
int x,
int y)
- traps mouse clicks; if not dealt with by theDrawable, may be passed to
other routines such as MouseManager.
processMouseBox
public boolean processMouseBox(Int2Range box)
- requests the Drawable to take action after a mouseBox has been swept
out . The two commonest actions are to select a portion and
zoom, or to return a set of subaddresses from the object.
display
public void display(Graphics g,
Component c)
- dummy at present until worked out
display
public void display(Graphics g)
- displays the object to a pre-selected graphics context
- Overrides:
- display in class SGMLNode
getScaler2D
public Scaler2D getScaler2D()
- gets the Scaler2D context from the object (object must contain this)
setSelected
public void setSelected(boolean selected)
- tell the object it has been selected (e.g. by a mouse)
isSelected
public boolean isSelected()
- and find out whether it is
setHighlightable
public void setHighlightable(boolean b)
- set the Drawable so that subaddresses are highlighted (marked) rather
than take immediate action
action
public boolean action(Event evt,
Object arg)
- pass any button actions to the object
process
public void process(Graphics g,
Scaler2D sc2d)
process
public void process()
- complex objects may require processing; override this.
- Overrides:
- process in class SGMLNode
display
public void display()
- Kicks off a ScrollableTopLevel which contains the object. Only one copy
allowed. This STL routes mouse calls, etc. to the DrawableObject which can
then do its own thing with them
- Overrides:
- display in class SGMLNode
showHelp
public void showHelp()
- a help file for the Node. Usually subclassed
postMessage
public void postMessage(String s)
- a way for the object to post the message onto its area if possible
mouseBox
public boolean mouseBox(Event evt,
int x,
int y)
- action when mouseBox has been swept out; if not overridden, tries to
scale the object. To disable this, override with 'return true'
setScaler2D
public void setScaler2D(Scaler2D s)
- occasionally need to set the Scaler2D context (e.g. for text)
debug
public void debug()
- for debug
- Overrides:
- debug in class SGMLNode
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index