synergynetframework.appsystem.contentsystem.jme.items
Class JMESketchPad

java.lang.Object
  extended by synergynetframework.appsystem.contentsystem.jme.items.JMEContentItem
      extended by synergynetframework.appsystem.contentsystem.jme.items.JMEOrthoContentItem
          extended by synergynetframework.appsystem.contentsystem.jme.items.JMEQuadContentItem
              extended by synergynetframework.appsystem.contentsystem.jme.items.JMEFrame
                  extended by synergynetframework.appsystem.contentsystem.jme.items.JMESketchPad
All Implemented Interfaces:
IContentItemImplementation, IFrameImplementation, IOrthoContentItemImplementation, IQuadContentItemImplementation, ISketchPadImplementation, ScreenCursorListener, OrthoBringToTop.OrthoBringToTopListener, OrthoControlPointRotateTranslateScale.RotateTranslateScaleListener, OrthoCursorEventDispatcher.CommonCursorEventListener, OrthoSnap.SnapListener, FlickMover.FlickListener
Direct Known Subclasses:
JMEMathPad

public class JMESketchPad
extends JMEFrame
implements ISketchPadImplementation

The Class JMESketchPad.


Constructor Summary
JMESketchPad(ContentItem contentItem)
          Instantiates a new JME sketch pad.
 
Method Summary
 void addDrawListener(SketchPad.DrawListener listener)
          Adds the draw listener.
 void clear(DrawData drawData)
          Clear.
 void clearAll()
          Clear all.
 void cursorClicked(long cursorID, int x, int y)
          Cursor clicked.
 void cursorDragged(long id, int x, int y)
          Cursor dragged.
 void cursorPressed(long cursorID, int x, int y)
          Cursor pressed.
 void cursorReleased(long cursorID, int x, int y)
          Cursor released.
 void draw(DrawData data)
          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.
 int getHeight()
          Gets the height.
 int getImageHeight()
          Gets the image height.
 int getImageWidth()
          Gets the image width.
 float getLineWidth()
          Gets the line width.
 java.awt.Rectangle getSketchArea()
          Gets the sketch area.
 java.awt.Color getTextColor()
          Gets the text color.
 int getWidth()
          Gets the width.
 void init()
          Inits the.
 boolean isDrawEnabled()
          Checks if is draw enabled.
 void makeFlickable(float deceleration)
          Make flickable.
 void removeDrawListener(SketchPad.DrawListener listener)
          Removes the draw listener.
 void removeDrawListeners()
          Removes the draw listeners.
 void renderSketch()
          Render sketch.
 void setBackGround(Background backGround)
          Sets the back ground.
 void setBackgroundColour(java.awt.Color color)
          Sets the background colour.
 void setBorder(Border border)
          Sets the border.
 void setClearArea(java.awt.Rectangle rectangle)
          Sets the clear area.
 void setDrawEnabled(boolean isWriteEnabled)
          Sets the draw enabled.
 void setHeight(int height)
          Sets the height.
 void setLineWidth(float width)
          Sets the line width.
 void setRotateTranslateScalable(boolean isEnabled)
          Sets the rotate translate scalable.
 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.jme.items.JMEFrame
drawImage, drawImage, flushGraphics, getGraphicsContext, getImages, removeAllImages, removeImage, setAutoFitSize
 
Methods inherited from class synergynetframework.appsystem.contentsystem.jme.items.JMEQuadContentItem
cursorChanged, cursorClicked, cursorPressed, cursorReleased
 
Methods inherited from class synergynetframework.appsystem.contentsystem.jme.items.JMEOrthoContentItem
addBringToTopListener, addFlickListener, addItemListener, addMultitouchListener, addOrthoControlPointRotateTranslateScaleListener, addScreenCursorListener, addSnapListener, allowMoreThanTwoToRotateAndScale, allowSingleTouchFreeMove, allowSnapToOccupiedLocation, centerItem, cursorRightClicked, flick, getMaxScale, getMinScale, isFlickable, ItemBringToTop, itemFlicked, itemMoved, itemRotated, itemScaled, itemSnapped, makeUnflickable, placeRandom, removeBringToTopListeners, removeFlickListeners, removeItemListerner, removeOrthoControlPointRotateTranslateScaleListeners, removeScreenCursorListeners, removeSnapListeners, reset, rotateRandom, screenCursorChanged, screenCursorClicked, screenCursorPressed, screenCursorReleased, setAsBottomObject, setAsTopObject, setAsTopObjectAndBroadCastEvent, setBringToTopable, setFixLocations, setLocalLocation, setName, setOrder, setRightClickDistance, setRotateTranslateScalable, setScaleLimit, setSingleTouchRotateTranslate, setSnapable, setTolerance, setZRotateLimit, turnOffEventDispatcher, update, update
 
Methods inherited from class synergynetframework.appsystem.contentsystem.jme.items.JMEContentItem
contains, getImplementationObject, getLocalLocation, hasCollision, setAngle, setBoundaryEnabled, setId, setLocation, setManipulate, setScale, setScale, setVisible, setVisible
 
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, makeUnflickable, placeRandom, removeBringToTopListeners, removeFlickListeners, removeItemListerner, removeOrthoControlPointRotateTranslateScaleListeners, removeScreenCursorListeners, removeSnapListeners, reset, rotateRandom, setAsBottomObject, setAsTopObject, setAsTopObjectAndBroadCastEvent, setBringToTopable, setFixLocations, setOrder, setRightClickDistance, setRotateTranslateScalable, setScaleLimit, setSingleTouchRotateTranslate, setSnapable, setTolerance, setZRotateLimit, turnOffEventDispatcher
 
Methods inherited from interface synergynetframework.appsystem.contentsystem.items.implementation.interfaces.IContentItemImplementation
addMultitouchListener, contains, getImplementationObject, hasCollision, setAngle, setBoundaryEnabled, setId, setLocalLocation, setLocation, setManipulate, setName, setScale, setScale, setVisible, setVisible, update, update
 

Constructor Detail

JMESketchPad

public JMESketchPad(ContentItem contentItem)
Instantiates a new JME sketch pad.

Parameters:
contentItem - the content item
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

cursorClicked

public void cursorClicked(long cursorID,
                          int x,
                          int y)
Cursor clicked.

Parameters:
cursorID - the cursor id
x - the x
y - the y

cursorDragged

public void cursorDragged(long id,
                          int x,
                          int y)
Cursor dragged.

Parameters:
id - the id
x - the x
y - the y

cursorPressed

public void cursorPressed(long cursorID,
                          int x,
                          int y)
Cursor pressed.

Parameters:
cursorID - the cursor id
x - the x
y - the y

cursorReleased

public void cursorReleased(long cursorID,
                           int x,
                           int y)
Cursor released.

Parameters:
cursorID - the cursor id
x - the x
y - the y

draw

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

Specified by:
draw in interface ISketchPadImplementation
Parameters:
data - 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 interface: ISketchPadImplementation
Gets the background colour.

Specified by:
getBackgroundColour in interface ISketchPadImplementation
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

getHeight

public int getHeight()
Gets the height.

Returns:
the height

getImageHeight

public int getImageHeight()
Gets the image height.

Returns:
the image height

getImageWidth

public int getImageWidth()
Gets the image width.

Returns:
the image width

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

getWidth

public int getWidth()
Gets the width.

Returns:
the width

init

public void init()
Description copied from interface: IContentItemImplementation
Inits the.

Specified by:
init in interface IContentItemImplementation
Overrides:
init in class JMEFrame

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

makeFlickable

public void makeFlickable(float deceleration)
Description copied from interface: IOrthoContentItemImplementation
Make flickable.

Specified by:
makeFlickable in interface IOrthoContentItemImplementation
Overrides:
makeFlickable in class JMEOrthoContentItem
Parameters:
deceleration - the deceleration

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

renderSketch

public void renderSketch()
Render sketch.


setBackGround

public void setBackGround(Background backGround)
Description copied from interface: IContentItemImplementation
Sets the back ground.

Specified by:
setBackGround in interface IContentItemImplementation
Overrides:
setBackGround in class JMEFrame
Parameters:
backGround - the new back ground

setBackgroundColour

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

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

setBorder

public void setBorder(Border border)
Description copied from interface: IContentItemImplementation
Sets the border.

Specified by:
setBorder in interface IContentItemImplementation
Overrides:
setBorder in class JMEFrame
Parameters:
border - the new border

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 isWriteEnabled)
Description copied from interface: ISketchPadImplementation
Sets the draw enabled.

Specified by:
setDrawEnabled in interface ISketchPadImplementation
Parameters:
isWriteEnabled - 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 JMEFrame
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

setRotateTranslateScalable

public void setRotateTranslateScalable(boolean isEnabled)
Description copied from interface: IOrthoContentItemImplementation
Sets the rotate translate scalable.

Specified by:
setRotateTranslateScalable in interface IOrthoContentItemImplementation
Overrides:
setRotateTranslateScalable in class JMEOrthoContentItem
Parameters:
isEnabled - the new rotate translate scalable

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 JMEFrame
Parameters:
width - the new width