Class sgraphics.wrapper.ResizableFrame
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sgraphics.wrapper.ResizableFrame

java.lang.Object
   |
   +----sgraphics.GlyphImpl
           |
           +----sgraphics.MonoGlyph
                   |
                   +----sgraphics.ViewerImpl
                           |
                           +----sgraphics.wrapper.ResizableFrame

public class ResizableFrame
extends ViewerImpl
ResizableFrame draws a black box with handles around its body when clicked by MB1. Pressing MB1 on a handle will allow the user to stretch the box. Letting go of MB1 will then change the size of the body to that of the box.

Note: This viewer does not hide its children like a Viewer!

If a child is hit the frame is not hit; therefore, the frame only toggles when when clicked over an area that does not hit any children.

After resizing (mouseUP) a FrameResizeEvent is posted to the body.


Constructor Index

 o ResizableFrame(Glyph, Color, Color)

Method Index

 o allocate(Allocation)
 o disableHandles()
Disable the handles.
 o draw(Painter)
 o enableHandles()
Enable the handles.
 o lockSides()
Make the outline always square no matter where the mouse goes.
 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 setConstraints(float, float, float, float)
Constrain the ammount the outline can grow or shrink.
 o unlockSides()
Allow the outline to be rectangle.

Constructors

 o ResizableFrame
  public ResizableFrame(Glyph child,
                        Color highlight,
                        Color background)
Parameters:
child - the child glyph.
highlight - the frame color.
background - the color when the frame is not showing.

Methods

 o allocate
  public void allocate(Allocation a)
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 mouseUp
  public boolean mouseUp(GraphicsEvent evt,
                         float x,
                         float y)
Called when the mouse is released.
Overrides:
mouseUp in class ViewerImpl
 o mouseDrag
  public boolean mouseDrag(GraphicsEvent evt,
                           float x,
                           float y)
Called when the mouse is dragged (the mouse button is down).
Overrides:
mouseDrag in class ViewerImpl
 o enableHandles
  public void enableHandles()
Enable the handles.
 o disableHandles
  public void disableHandles()
Disable the handles.
 o setConstraints
  public void setConstraints(float minWidth,
                             float maxWidth,
                             float minHeight,
                             float maxHeight)
Constrain the ammount the outline can grow or shrink.
Parameters:
minWidth - the minimum width.
maxWidth - the maximum width.
minHeight - the maximum height.
maxHeight - the maximum height.
 o lockSides
  public void lockSides()
Make the outline always square no matter where the mouse goes.
 o unlockSides
  public void unlockSides()
Allow the outline to be rectangle.

All Packages  Class Hierarchy  This Package  Previous  Next  Index