Interface pmr.simplegraph.Drawable
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface pmr.simplegraph.Drawable

public interface Drawable
extends Object
this interface makes an object Drawable (for, say, use by ScrollableTopLevel). Examples of how to use it are in pmr.simplegraph.DrawableObject

Author:
(C) P. Murray-Rust, 1996

Method Index

 o action(Event, Object)
pass any action events to theDrawable
 o debug()
for debug
 o display(Graphics)
displays the object to a pre-selected graphics context
 o display(Graphics, Component)
this may encapsulate the above routine, as we often need the component, e.g.
 o getScaler2D()
gets the Scaler2D context from the object (object must contain this)
 o isSelected()
and find out whether it is
 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 such as MouseManager.
 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 (this helps with update, etc)
 o setHighlightable(boolean)
set the Drawable so that subaddresses are highlighted (marked) rather than take immediate action
 o setScaler2D(Scaler2D)
sets the Scaler2D context for the object (object must contain this)
 o setSelected(boolean)
tell the object it has been selected (e.g.

Methods

 o mouseUp
  public abstract boolean mouseUp(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 mouseDrag
  public abstract 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 abstract 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 abstract 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 abstract void display(Graphics g)
displays the object to a pre-selected graphics context
 o display
  public abstract void display(Graphics g,
                               Component c)
this may encapsulate the above routine, as we often need the component, e.g. for double buffering. Experimental at presnt :-)
 o getScaler2D
  public abstract Scaler2D getScaler2D()
gets the Scaler2D context from the object (object must contain this)
 o setScaler2D
  public abstract void setScaler2D(Scaler2D s)
sets the Scaler2D context for the object (object must contain this)
 o setSelected
  public abstract void setSelected(boolean selected)
tell the object it has been selected (e.g. by a mouse)
 o isSelected
  public abstract boolean isSelected()
and find out whether it is
 o action
  public abstract boolean action(Event e,
                                 Object arg)
pass any action events to theDrawable
 o setHighlightable
  public abstract void setHighlightable(boolean b)
set the Drawable so that subaddresses are highlighted (marked) rather than take immediate action
 o setComponent
  public abstract void setComponent(Component c)
set the component that the Drawable is on (this helps with update, etc)
 o debug
  public abstract void debug()
for debug

All Packages  Class Hierarchy  This Package  Previous  Next  Index