synergynetframework.appsystem.contentsystem.items
Class SketchPad

java.lang.Object
  extended by synergynetframework.appsystem.contentsystem.items.ContentItem
      extended by synergynetframework.appsystem.contentsystem.items.OrthoContentItem
          extended by synergynetframework.appsystem.contentsystem.items.QuadContentItem
              extended by synergynetframework.appsystem.contentsystem.items.Frame
                  extended by synergynetframework.appsystem.contentsystem.items.SketchPad
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<OrthoContentItem>, IContentItemImplementation, IFrameImplementation, IOrthoContentItemImplementation, IQuadContentItemImplementation, ISketchPadImplementation, BringToTopListener, ItemListener, OrthoControlPointRotateTranslateScaleListener, OrthoFlickListener, OrthoScaleMotionListener, OrthoSnapListener, OrthoSpinListener
Direct Known Subclasses:
MathPad

public class SketchPad
extends Frame
implements ISketchPadImplementation

The Class SketchPad.

See Also:
Serialized Form

Nested Class Summary
static interface SketchPad.DrawListener
          The listener interface for receiving draw events.
 
Field Summary
 
Fields inherited from class synergynetframework.appsystem.contentsystem.items.OrthoContentItem
removable
 
Fields inherited from class synergynetframework.appsystem.contentsystem.items.ContentItem
name
 
Constructor Summary
SketchPad(ContentSystem contentSystem, java.lang.String name)
          Instantiates a new sketch pad.
 
Method Summary
 void addDrawListener(SketchPad.DrawListener listener)
          Adds the draw listener.
 void clear(DrawData drawData)
          Clear.
 void clearAll()
          Clear all.
 void draw(DrawData drawData)
          Draw.
 void draw(java.util.List<DrawData> drawData)
          Draw.
 void drawLine(long cursorId, java.awt.Point startPoint, java.awt.Point endPoint, java.awt.Color color, float width)
          Draw line.
 void drawString(java.lang.String string, int x, int y)
          Draw string.
 void fillRectangle(java.awt.Rectangle rectangle, java.awt.Color color)
          Fill rectangle.
 java.awt.Color getBackgroundColour()
          Gets the background colour.
 java.awt.Rectangle getClearArea()
          Gets the clear area.
 java.util.List<DrawData> getDrawData()
          Gets the draw data.
 float getLineWidth()
          Gets the line width.
 java.awt.Rectangle getSketchArea()
          Gets the sketch area.
 java.awt.Color getTextColor()
          Gets the text color.
 boolean isDrawEnabled()
          Checks if is draw enabled.
 void removeDrawListener(SketchPad.DrawListener listener)
          Removes the draw listener.
 void removeDrawListeners()
          Removes the draw listeners.
 void setBackgroundColour(java.awt.Color color)
          Sets the background colour.
 void setClearArea(java.awt.Rectangle rectangle)
          Sets the clear area.
 void setDrawEnabled(boolean isDrawEnabled)
          Sets the draw enabled.
 void setHeight(int height)
          Sets the height.
 void setLineWidth(float width)
          Sets the line width.
 void setSketchArea(java.awt.Rectangle rectangle)
          Sets the sketch area.
 void setTextColor(java.awt.Color color)
          Sets the text color.
 void setWidth(int width)
          Sets the width.
 
Methods inherited from class synergynetframework.appsystem.contentsystem.items.Frame
drawImage, drawImage, flushGraphics, getGraphicsContext, getImageResources, getImages, removeAllImages, removeImage
 
Methods inherited from class synergynetframework.appsystem.contentsystem.items.QuadContentItem
addSizeChangeListener, clone, getHeight, getWidth, isAutoFitSize, removeSizeChangeListener, setAutoFit, setAutoFitSize
 
Methods inherited from class synergynetframework.appsystem.contentsystem.items.OrthoContentItem
addBringToTopListener, addFlickListener, addItemListener, addOrthoControlPointRotateTranslateScaleListener, addScreenCursorListener, addSnapListener, allowMoreThanTwoToRotateAndScale, allowSingleTouchFreeMove, allowSnapToOccupiedLocation, bindImplementationOjbect, centerItem, compareTo, cursorChanged, cursorClicked, cursorDoubleClicked, cursorLongHeld, cursorPressed, cursorReleased, cursorRightClicked, enableMultiTouchElementListeners, fireCursorChanged, fireCursorClicked, fireCursorDoubleClicked, fireCursorLongHeld, fireCursorPressed, fireCursorReleased, fireCursorRightClicked, fireScreenCursorChanged, fireScreenCursorClicked, fireScreenCursorPressed, fireScreenCursorReleased, flick, getBringToTopListeners, getFlickDeceleration, getFlickListeners, getItemListeners, getLocation, getMaxScale, getMinScale, getOrder, getOrthoControlPointRotateTranslateScaleListeners, getOrthoSnapListeners, getParent, getScaleMotionDeceleration, getScaleMotionListeners, getSpinListeners, isBringToTopEnabled, isFlickable, isRotateTranslateScaleEnabled, isSingleTouchRotateTranslate, isSnapEnabled, itemBringToToped, itemFlicked, itemRotated, itemScaled, itemScaleMotioned, itemSnapped, itemSpun, itemTranslated, makeFlickable, makeUnflickable, placeRandom, removeBringToTopListeners, removeBringToTopListeners, removeFlickListeners, removeFlickListeners, removeItemListerner, removeItemListerners, removeOrthoControlPointRotateTranslateScaleListeners, removeOrthoControlPointRotateTranslateScaleListeners, removeScreenCursorListeners, removeSnapListeners, removeSnapListeners, reset, rotateRandom, setAsBottomObject, setAsTopObject, setAsTopObjectAndBroadCastEvent, setBringToTopable, setBringToTopListeners, setFixLocations, setFlickListeners, setItemListeners, setLocation, setLocation, setName, setOrder, setOrthoControlPointRotateTranslateScaleListeners, setOrthoSnapListeners, setRightClickDistance, setRotateTranslateScalable, setRotateTranslateScalable, setScaleLimit, setScaleMotionListeners, setSingleTouchRotateTranslate, setSnapable, setSpinListeners, setTolerance, setZRotateLimit, turnOffEventDispatcher
 
Methods inherited from class synergynetframework.appsystem.contentsystem.items.ContentItem
addMultitouchListener, canManipulate, contains, generateUniqueName, getAngle, getBackGround, getBorder, getBorderColour, getBorderSize, getContentSystem, getId, getImplementationObject, getLocalLocation, getName, getNote, getResource, getScale, hasCollision, init, initImplementationObjet, isBoundaryEnabled, isVisible, setAngle, setBackGround, setBorder, setBorderColour, setBorderSize, setBoundaryEnabled, setContentSystem, setId, setLocalLocation, setLocalLocation, setLocalLocation, setManipulate, setNote, setResource, setScale, setScale, setVisible, setVisible, update, update
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface synergynetframework.appsystem.contentsystem.items.implementation.interfaces.IFrameImplementation
drawImage, drawImage, flushGraphics, getGraphicsContext, getImages, removeAllImages, removeImage
 
Methods inherited from interface synergynetframework.appsystem.contentsystem.items.implementation.interfaces.IQuadContentItemImplementation
setAutoFitSize
 
Methods inherited from interface synergynetframework.appsystem.contentsystem.items.implementation.interfaces.IOrthoContentItemImplementation
addBringToTopListener, addFlickListener, addItemListener, addOrthoControlPointRotateTranslateScaleListener, addScreenCursorListener, addSnapListener, allowMoreThanTwoToRotateAndScale, allowSingleTouchFreeMove, allowSnapToOccupiedLocation, centerItem, flick, getMaxScale, getMinScale, isFlickable, makeFlickable, makeUnflickable, placeRandom, removeBringToTopListeners, removeFlickListeners, removeItemListerner, removeOrthoControlPointRotateTranslateScaleListeners, removeScreenCursorListeners, removeSnapListeners, reset, rotateRandom, setAsBottomObject, setAsTopObject, setAsTopObjectAndBroadCastEvent, setBringToTopable, setFixLocations, setOrder, setRightClickDistance, setRotateTranslateScalable, setRotateTranslateScalable, setScaleLimit, setSingleTouchRotateTranslate, setSnapable, setTolerance, setZRotateLimit, turnOffEventDispatcher
 
Methods inherited from interface synergynetframework.appsystem.contentsystem.items.implementation.interfaces.IContentItemImplementation
addMultitouchListener, contains, getImplementationObject, hasCollision, init, setAngle, setBackGround, setBorder, setBoundaryEnabled, setId, setLocalLocation, setLocation, setManipulate, setName, setScale, setScale, setVisible, setVisible, update, update
 

Constructor Detail

SketchPad

public SketchPad(ContentSystem contentSystem,
                 java.lang.String name)
Instantiates a new sketch pad.

Parameters:
contentSystem - the content system
name - the name
Method Detail

addDrawListener

public void addDrawListener(SketchPad.DrawListener listener)
Description copied from interface: ISketchPadImplementation
Adds the draw listener.

Specified by:
addDrawListener in interface ISketchPadImplementation
Parameters:
listener - the listener

clear

public void clear(DrawData drawData)
Description copied from interface: ISketchPadImplementation
Clear.

Specified by:
clear in interface ISketchPadImplementation
Parameters:
drawData - the draw data

clearAll

public void clearAll()
Description copied from interface: ISketchPadImplementation
Clear all.

Specified by:
clearAll in interface ISketchPadImplementation

draw

public void draw(DrawData drawData)
Description copied from interface: ISketchPadImplementation
Draw.

Specified by:
draw in interface ISketchPadImplementation
Parameters:
drawData - the draw data

draw

public void draw(java.util.List<DrawData> drawData)
Description copied from interface: ISketchPadImplementation
Draw.

Specified by:
draw in interface ISketchPadImplementation
Parameters:
drawData - the draw data

drawLine

public void drawLine(long cursorId,
                     java.awt.Point startPoint,
                     java.awt.Point endPoint,
                     java.awt.Color color,
                     float width)
Description copied from interface: ISketchPadImplementation
Draw line.

Specified by:
drawLine in interface ISketchPadImplementation
Parameters:
cursorId - the cursor id
startPoint - the start point
endPoint - the end point
color - the color
width - the width

drawString

public void drawString(java.lang.String string,
                       int x,
                       int y)
Description copied from interface: ISketchPadImplementation
Draw string.

Specified by:
drawString in interface ISketchPadImplementation
Parameters:
string - the string
x - the x
y - the y

fillRectangle

public void fillRectangle(java.awt.Rectangle rectangle,
                          java.awt.Color color)
Description copied from interface: ISketchPadImplementation
Fill rectangle.

Specified by:
fillRectangle in interface ISketchPadImplementation
Parameters:
rectangle - the rectangle
color - the color

getBackgroundColour

public java.awt.Color getBackgroundColour()
Description copied from class: ContentItem
Gets the background colour.

Specified by:
getBackgroundColour in interface ISketchPadImplementation
Overrides:
getBackgroundColour in class ContentItem
Returns:
the background colour

getClearArea

public java.awt.Rectangle getClearArea()
Description copied from interface: ISketchPadImplementation
Gets the clear area.

Specified by:
getClearArea in interface ISketchPadImplementation
Returns:
the clear area

getDrawData

public java.util.List<DrawData> getDrawData()
Description copied from interface: ISketchPadImplementation
Gets the draw data.

Specified by:
getDrawData in interface ISketchPadImplementation
Returns:
the draw data

getLineWidth

public float getLineWidth()
Description copied from interface: ISketchPadImplementation
Gets the line width.

Specified by:
getLineWidth in interface ISketchPadImplementation
Returns:
the line width

getSketchArea

public java.awt.Rectangle getSketchArea()
Description copied from interface: ISketchPadImplementation
Gets the sketch area.

Specified by:
getSketchArea in interface ISketchPadImplementation
Returns:
the sketch area

getTextColor

public java.awt.Color getTextColor()
Description copied from interface: ISketchPadImplementation
Gets the text color.

Specified by:
getTextColor in interface ISketchPadImplementation
Returns:
the text color

isDrawEnabled

public boolean isDrawEnabled()
Description copied from interface: ISketchPadImplementation
Checks if is draw enabled.

Specified by:
isDrawEnabled in interface ISketchPadImplementation
Returns:
true, if is draw enabled

removeDrawListener

public void removeDrawListener(SketchPad.DrawListener listener)
Description copied from interface: ISketchPadImplementation
Removes the draw listener.

Specified by:
removeDrawListener in interface ISketchPadImplementation
Parameters:
listener - the listener

removeDrawListeners

public void removeDrawListeners()
Description copied from interface: ISketchPadImplementation
Removes the draw listeners.

Specified by:
removeDrawListeners in interface ISketchPadImplementation

setBackgroundColour

public void setBackgroundColour(java.awt.Color color)
Description copied from class: ContentItem
Sets the background colour.

Specified by:
setBackgroundColour in interface ISketchPadImplementation
Overrides:
setBackgroundColour in class ContentItem
Parameters:
color - the new background colour

setClearArea

public void setClearArea(java.awt.Rectangle rectangle)
Description copied from interface: ISketchPadImplementation
Sets the clear area.

Specified by:
setClearArea in interface ISketchPadImplementation
Parameters:
rectangle - the new clear area

setDrawEnabled

public void setDrawEnabled(boolean isDrawEnabled)
Description copied from interface: ISketchPadImplementation
Sets the draw enabled.

Specified by:
setDrawEnabled in interface ISketchPadImplementation
Parameters:
isDrawEnabled - the new draw enabled

setHeight

public void setHeight(int height)
Description copied from interface: IQuadContentItemImplementation
Sets the height.

Specified by:
setHeight in interface IQuadContentItemImplementation
Overrides:
setHeight in class QuadContentItem
Parameters:
height - the new height

setLineWidth

public void setLineWidth(float width)
Description copied from interface: ISketchPadImplementation
Sets the line width.

Specified by:
setLineWidth in interface ISketchPadImplementation
Parameters:
width - the new line width

setSketchArea

public void setSketchArea(java.awt.Rectangle rectangle)
Description copied from interface: ISketchPadImplementation
Sets the sketch area.

Specified by:
setSketchArea in interface ISketchPadImplementation
Parameters:
rectangle - the new sketch area

setTextColor

public void setTextColor(java.awt.Color color)
Description copied from interface: ISketchPadImplementation
Sets the text color.

Specified by:
setTextColor in interface ISketchPadImplementation
Parameters:
color - the new text color

setWidth

public void setWidth(int width)
Description copied from interface: IQuadContentItemImplementation
Sets the width.

Specified by:
setWidth in interface IQuadContentItemImplementation
Overrides:
setWidth in class QuadContentItem
Parameters:
width - the new width