|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.jhu.tmaj.client.image.draw.AbstractDrawable
edu.jhu.tmaj.client.image.draw.PolygonDrawable
public final class PolygonDrawable
A polygon
| Field Summary | |
|---|---|
(package private) static int |
SIZE_OF_POINTS_LIST_FIELD
|
| Fields inherited from class edu.jhu.tmaj.client.image.draw.AbstractDrawable |
|---|
BLACK_SQUARE_SIZE, drawableLabel, isCompleted, MARGIN, userID |
| Constructor Summary | |
|---|---|
PolygonDrawable(DrawableLabel d)
|
|
| Method Summary | |
|---|---|
(package private) static boolean |
checkPolygonLength(java.awt.Polygon polygon,
java.awt.Component component)
|
void |
createFromShapeRecord(ShapeRecord shapeRecord)
Called from subclasses that override this method, this class only sets the shapeID variable |
boolean |
createNewShapeOnMousePress()
Returns true |
void |
draw(java.awt.Graphics g)
Sets the color and draws the black squares aroudn the Drawable |
protected Point[] |
getBlackSquares()
Returns an empty array; This method is overwritten in subclasses |
InsertSQL |
getInsertSQL(int scoredImageID)
Returns a SQL statement to update an existing shape in the database. |
UpdateSQL |
getUpdateSQL()
Returns a SQL statement to insert this shape into the database. |
void |
handleMouseDragged(java.awt.event.MouseEvent e)
Moves the shape depending on difference between last point, if the user has finished drawing it. |
void |
handleMousePressed(java.awt.event.MouseEvent e)
Registers tempX and tempX if moving is allowed |
void |
handleMouseReleased(java.awt.event.MouseEvent e)
Does nothing: unlike most shapes MouseReleased() does not mean the user is done drawing the shape |
boolean |
isValid()
Returns true if the shape is "worth saving". |
protected void |
move(int xDiff,
int yDiff)
Moves the shape by adding xDiff and YDiff to it's current x and y, respectively. |
boolean |
shouldPointActivate(int xPos,
int yPos)
Returns true if the x and y are close enough to the border of the shape to "Select" the shape |
| Methods inherited from class edu.jhu.tmaj.client.image.draw.AbstractDrawable |
|---|
allowMoving, changeNormalStatusToModified, drawBlackSquare, drawBlackSquares, getColor, getDrawingX, getDrawingY, getNormalX, getNormalY, getShapeID, getStatus, getUserID, handleKeyPressed, isCompleted, isHighlighted, repaintDrawableLabel, setDrawableLabel, setIsCompleted, setIsHighlighted, setShapeID, setStatus, setUserID |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface edu.jhu.tmaj.client.image.draw.Drawable |
|---|
getShapeID, getStatus, handleKeyPressed, isCompleted, isHighlighted, setIsCompleted, setIsHighlighted, setShapeID, setStatus, setUserID |
| Field Detail |
|---|
static final int SIZE_OF_POINTS_LIST_FIELD
| Constructor Detail |
|---|
public PolygonDrawable(DrawableLabel d)
| Method Detail |
|---|
public void handleMousePressed(java.awt.event.MouseEvent e)
AbstractDrawable
handleMousePressed in interface DrawablehandleMousePressed in class AbstractDrawable
static boolean checkPolygonLength(java.awt.Polygon polygon,
java.awt.Component component)
public void handleMouseReleased(java.awt.event.MouseEvent e)
handleMouseReleased in interface DrawablehandleMouseReleased in class AbstractDrawablepublic void handleMouseDragged(java.awt.event.MouseEvent e)
AbstractDrawable
handleMouseDragged in interface DrawablehandleMouseDragged in class AbstractDrawable
protected void move(int xDiff,
int yDiff)
AbstractDrawable
move in class AbstractDrawablepublic void draw(java.awt.Graphics g)
AbstractDrawable
draw in interface Drawabledraw in class AbstractDrawable
public boolean shouldPointActivate(int xPos,
int yPos)
Drawable
shouldPointActivate in interface Drawablepublic boolean isValid()
Drawable
isValid in interface Drawablepublic void createFromShapeRecord(ShapeRecord shapeRecord)
AbstractDrawable
createFromShapeRecord in interface DrawablecreateFromShapeRecord in class AbstractDrawablepublic InsertSQL getInsertSQL(int scoredImageID)
AbstractDrawable
getInsertSQL in interface DrawablegetInsertSQL in class AbstractDrawablepublic UpdateSQL getUpdateSQL()
AbstractDrawable
getUpdateSQL in interface DrawablegetUpdateSQL in class AbstractDrawablepublic boolean createNewShapeOnMousePress()
AbstractDrawable
createNewShapeOnMousePress in interface DrawablecreateNewShapeOnMousePress in class AbstractDrawableprotected Point[] getBlackSquares()
AbstractDrawable
getBlackSquares in class AbstractDrawable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||