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

Class pmr.simplegraph.SimpleText

java.lang.Object
   |
   +----pmr.simplegraph.SimpleText

public class SimpleText
extends Object
implements Drawable
A text area which can be drawn onto a Graphics area (as opposed to a TextArea which is a component. SimpleTexts are composed of one or more Paragraphs, which are generic containers for paragrahps, list items, etc. (A paragraph is the smallest coherent chunk of text - yes, I'm sure there's a better name (?Block)
Author:
(C) P. Murray-Rust, 1996

Variable Index

 o BOTTOM
 o LEFT
 o RIGHT
 o TOP

Constructor Index

 o SimpleText(String)
create the SimpleText and remember what component it is being drawn on

Method Index

 o action(Event, Object)
pass any action events to theDrawable
 o addElement(Paragraph)
add a Paragraph child to a SimpleText.
 o debug()
for debug
 o display(Graphics)
displays the object to a pre-selected graphics context
 o display(Graphics, Component)
dummy at present until worked out
 o getCurrentY()
gets the y value after display
 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
 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 (recursively) so that graphics can be updated
 o setHighlightable(boolean)
set the Drawable so that subaddresses are highlighted (marked) rather than take immediate action
 o setScaler2D(Scaler2D)
set the scaling module
 o setSelected(boolean)
tell the object it has been selected (e.g.

Variables

 o TOP
  public final static int TOP
 o LEFT
  public final static int LEFT
 o BOTTOM
  public final static int BOTTOM
 o RIGHT
  public final static int RIGHT

Constructors

 o SimpleText
  public SimpleText(String title)
create the SimpleText and remember what component it is being drawn on

Methods

 o setComponent
  public void setComponent(Component c)
set the component (recursively) so that graphics can be updated
 o addElement
  public void addElement(Paragraph p)
add a Paragraph child to a SimpleText.
 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 setScaler2D
  public void setScaler2D(Scaler2D s)
set the scaling module
 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
 o getCurrentY
  public int getCurrentY()
gets the y value after display
 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 action
  public boolean action(Event e,
                        Object arg)
pass any action events to theDrawable
 o setHighlightable
  public void setHighlightable(boolean b)
set the Drawable so that subaddresses are highlighted (marked) rather than take immediate action
 o process
  public void process(Graphics g,
                      Scaler2D sc2d)
 o debug
  public void debug()
for debug

All Packages  Class Hierarchy  This Package  Previous  Next  Index