Class sgraphics.figure.FigureViewer
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sgraphics.figure.FigureViewer

java.lang.Object
   |
   +----sgraphics.GlyphImpl
           |
           +----sgraphics.MonoGlyph
                   |
                   +----sgraphics.ViewerImpl
                           |
                           +----sgraphics.figure.FigureViewer

public class FigureViewer
extends ViewerImpl
Make any glyph or figure usable on a canvas. This will take care of scaling and scrolling. The child glyph or figure must be able to change its size via the allocation(Allocation) call in order for scaling to work.

Note: FigureViewer wont work if double buffering is turned off in SgraphicsAdapter.


Constructor Index

 o FigureViewer(Glyph, Point)

Method Index

 o allocate(Allocation)
 o draw(Painter)
 o getMode()
 o getStyle()
 o mouseDown(GraphicsEvent, float, float)
Called when the mouse is pressed.
 o mouseDrag(GraphicsEvent, float, float)
Called when the mouse is dragged (the mouse button is down).
 o mouseUp(GraphicsEvent, float, float)
Called when the mouse is released.
 o pick(Picker)
Checks for hits.
 o requirements()
Ask for the glyph's geometry requirements.
 o setMode(int)
 o setStyle(FigureStyle)

Constructors

 o FigureViewer
  public FigureViewer(Glyph glyph,
                      Point p)
Parameters:
glyph - the adapted glyph.
p - the point where the upper left corner of the figure will be placed.

Methods

 o mouseDrag
  public boolean mouseDrag(GraphicsEvent event,
                           float X,
                           float Y)
Called when the mouse is dragged (the mouse button is down).
Overrides:
mouseDrag in class ViewerImpl
 o mouseDown
  public boolean mouseDown(GraphicsEvent event,
                           float X,
                           float Y)
Called when the mouse is pressed.
Overrides:
mouseDown in class ViewerImpl
 o mouseUp
  public boolean mouseUp(GraphicsEvent event,
                         float X,
                         float Y)
Called when the mouse is released.
Overrides:
mouseUp in class ViewerImpl
 o requirements
  public Requirements requirements()
Ask for the glyph's geometry requirements.
Overrides:
requirements in class MonoGlyph
 o allocate
  public void allocate(Allocation allocation)
Overrides:
allocate in class MonoGlyph
 o pick
  public void pick(Picker pick)
Checks for hits.
Overrides:
pick in class ViewerImpl
 o draw
  public void draw(Painter painter)
Overrides:
draw in class MonoGlyph
 o setStyle
  public void setStyle(FigureStyle style)
 o getStyle
  public FigureStyle getStyle()
 o setMode
  public void setMode(int mode)
 o getMode
  public int getMode()

All Packages  Class Hierarchy  This Package  Previous  Next  Index