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

Variable Index

 o component
 o drawableHelp
 o helpText
 o highlightable
 o scaler2d
 o selected
 o stl

Constructor Index

 o DrawableSGMLNode()
create the DrawableSGMLNode
 o DrawableSGMLNode(String, SGMLTree)

Method Index

 o action(Event, Object)
pass any button actions to the object
 o addHelp(String[])
 o debug()
for debug
 o display()
Kicks off a ScrollableTopLevel which contains the object.
 o display(Graphics)
displays the object to a pre-selected graphics context
 o display(Graphics, Component)
dummy at present until worked out
 o getScaler2D()
gets the Scaler2D context from the object (object must contain this)
 o isSelected()
and find out whether it is
 o main(String[])
 o mouseBox(Event, int, int)
action when mouseBox has been swept out; if not overridden, tries to scale the object.
 o mouseDown(Event, int, int)
traps mouse clicks; if not dealt with by theDrawable, may be passed to other routines such as MouseManager.
 o mouseDrag(Event, int, int)
traps mouse drags; if not dealt with by theDrawable, may be passed to other routines such as MouseManager.
 o mouseUp(Event, int, int)
traps mouse clicks; if not dealt with by theDrawable, may be passed to other routines
 o postMessage(String)
a way for the object to post the message onto its area if possible
 o process()
complex objects may require processing; override this.
 o process(Graphics, Scaler2D)
 o processMouseBox(Int2Range)
requests the Drawable to take action after a mouseBox has been swept out .
 o setComponent(Component)
set the component that the Drawable is on (if we know).
 o setHighlightable(boolean)
set the Drawable so that subaddresses are highlighted (marked) rather than take immediate action
 o setScaler2D(Scaler2D)
occasionally need to set the Scaler2D context (e.g.
 o setSelected(boolean)
tell the object it has been selected (e.g.
 o showHelp()
a help file for the Node.

Variables

 o selected
  protected boolean selected
 o highlightable
  protected boolean highlightable
 o scaler2d
  protected Scaler2D scaler2d
 o component
  protected Component component
 o drawableHelp
  protected DrawableHelp drawableHelp
 o helpText
  protected StringList helpText
 o stl
  protected ScrollableTopLevel stl

Constructors

 o DrawableSGMLNode
  public DrawableSGMLNode()
create the DrawableSGMLNode
 o DrawableSGMLNode
  public DrawableSGMLNode(String giName,
                          SGMLTree tree)

Methods

 o addHelp
  public void addHelp(String s[])
 o 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)...
 o 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
 o 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.
 o 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.
 o 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.
 o display
  public void display(Graphics g,
                      Component c)
dummy at present until worked out
 o display
  public void display(Graphics g)
displays the object to a pre-selected graphics context
Overrides:
display in class SGMLNode
 o getScaler2D
  public Scaler2D getScaler2D()
gets the Scaler2D context from the object (object must contain this)
 o setSelected
  public void setSelected(boolean selected)
tell the object it has been selected (e.g. by a mouse)
 o isSelected
  public boolean isSelected()
and find out whether it is
 o setHighlightable
  public void setHighlightable(boolean b)
set the Drawable so that subaddresses are highlighted (marked) rather than take immediate action
 o action
  public boolean action(Event evt,
                        Object arg)
pass any button actions to the object
 o process
  public void process(Graphics g,
                      Scaler2D sc2d)
 o process
  public void process()
complex objects may require processing; override this.
Overrides:
process in class SGMLNode
 o 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
 o showHelp
  public void showHelp()
a help file for the Node. Usually subclassed
 o postMessage
  public void postMessage(String s)
a way for the object to post the message onto its area if possible
 o 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'
 o setScaler2D
  public void setScaler2D(Scaler2D s)
occasionally need to set the Scaler2D context (e.g. for text)
 o debug
  public void debug()
for debug
Overrides:
debug in class SGMLNode
 o main
  public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index