edu.jhu.tmaj.client.image.draw
Interface Drawable

All Known Implementing Classes:
ArrowDrawable, FreeHandDrawable, LineDrawable, OvalDrawable, PolygonDrawable, RectangleDrawable, TextDrawable

public interface Drawable

All shapes that are drawn onto a DrawableLabel implement this interface


Method Summary
 void createFromShapeRecord(ShapeRecord shapeRecord)
          Creates a shape from a single record in the Shapes table
 boolean createNewShapeOnMousePress()
           
 void draw(java.awt.Graphics g)
          Draws the shape
 InsertSQL getInsertSQL(int scoredImageID)
          Returns a SQL statement to insert this shape into the database
 int getShapeID()
          Returns the ShapeID of the shape in the database
 DrawableStatus getStatus()
           
 UpdateSQL getUpdateSQL()
          Returns a SQL statement to update the shape in the database
 void handleKeyPressed(java.awt.event.KeyEvent e)
           
 void handleMouseDragged(java.awt.event.MouseEvent e)
           
 void handleMousePressed(java.awt.event.MouseEvent e)
           
 void handleMouseReleased(java.awt.event.MouseEvent e)
           
 boolean isCompleted()
          Returns true if the user is finished drawing the shape.
 boolean isHighlighted()
          Returns true if the shape is selected
 boolean isValid()
          Returns true if the shape is "worth saving".
 void setIsCompleted(boolean b)
           
 void setIsHighlighted(boolean b)
           
 void setShapeID(int i)
           
 void setStatus(DrawableStatus s)
           
 void setUserID(int userID)
          Used only for setting the InputLog in the shapes table
 boolean shouldPointActivate(int x, int y)
          Returns true if the x and y are close enough to the border of the shape to "Select" the shape
 

Method Detail

getStatus

DrawableStatus getStatus()

setStatus

void setStatus(DrawableStatus s)

draw

void draw(java.awt.Graphics g)
Draws the shape


handleMousePressed

void handleMousePressed(java.awt.event.MouseEvent e)

handleMouseReleased

void handleMouseReleased(java.awt.event.MouseEvent e)

handleMouseDragged

void handleMouseDragged(java.awt.event.MouseEvent e)

handleKeyPressed

void handleKeyPressed(java.awt.event.KeyEvent e)

shouldPointActivate

boolean shouldPointActivate(int x,
                            int y)
Returns true if the x and y are close enough to the border of the shape to "Select" the shape


setIsHighlighted

void setIsHighlighted(boolean b)

isHighlighted

boolean isHighlighted()
Returns true if the shape is selected


getShapeID

int getShapeID()
Returns the ShapeID of the shape in the database


setShapeID

void setShapeID(int i)

createFromShapeRecord

void createFromShapeRecord(ShapeRecord shapeRecord)
Creates a shape from a single record in the Shapes table


getInsertSQL

InsertSQL getInsertSQL(int scoredImageID)
Returns a SQL statement to insert this shape into the database


getUpdateSQL

UpdateSQL getUpdateSQL()
Returns a SQL statement to update the shape in the database


isCompleted

boolean isCompleted()
Returns true if the user is finished drawing the shape. Usually indicated when the mouse is released


setIsCompleted

void setIsCompleted(boolean b)

isValid

boolean isValid()
Returns true if the shape is "worth saving". A line of zero length of text with 0 characters is not valid


createNewShapeOnMousePress

boolean createNewShapeOnMousePress()

setUserID

void setUserID(int userID)
Used only for setting the InputLog in the shapes table