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.
-
ResizableFrame(Glyph, Color, Color)
-
-
allocate(Allocation)
-
-
disableHandles()
- Disable the handles.
-
draw(Painter)
-
-
enableHandles()
- Enable the handles.
-
lockSides()
- Make the outline always square no matter where the mouse goes.
-
mouseDrag(GraphicsEvent, float, float)
- Called when the mouse is dragged (the mouse button is down).
-
mouseUp(GraphicsEvent, float, float)
- Called when the mouse is released.
-
pick(Picker)
- Checks for hits.
-
setConstraints(float, float, float, float)
- Constrain the ammount the outline can grow or shrink.
-
unlockSides()
- Allow the outline to be rectangle.
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.
allocate
public void allocate(Allocation a)
- Overrides:
- allocate in class MonoGlyph
pick
public void pick(Picker pick)
- Checks for hits.
- Overrides:
- pick in class ViewerImpl
draw
public void draw(Painter painter)
- Overrides:
- draw in class MonoGlyph
mouseUp
public boolean mouseUp(GraphicsEvent evt,
float x,
float y)
- Called when the mouse is released.
- Overrides:
- mouseUp in class ViewerImpl
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
enableHandles
public void enableHandles()
- Enable the handles.
disableHandles
public void disableHandles()
- Disable the handles.
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.
lockSides
public void lockSides()
- Make the outline always square no matter where the mouse goes.
unlockSides
public void unlockSides()
- Allow the outline to be rectangle.
All Packages Class Hierarchy This Package Previous Next Index