gistoolkit.display.drawmodel
Class NewShapeDrawModel

java.lang.Object
  extended bygistoolkit.display.drawmodel.SimpleDrawModel
      extended bygistoolkit.display.drawmodel.NewShapeDrawModel
All Implemented Interfaces:
DrawModel, java.util.EventListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public class NewShapeDrawModel
extends SimpleDrawModel

Draw model to handle the creation of new shapes.


Field Summary
static int LINE
          Constant for drawing a Line
static int POINT
          Constant for drawing a Point
static int POLYGON
          Constant for drawing a Polygon
 
Fields inherited from class gistoolkit.display.drawmodel.SimpleDrawModel
myGISDisplay
 
Constructor Summary
NewShapeDrawModel()
          Creates new NewShapeDrawModel
NewShapeDrawModel(Command inCommand)
          Creates new NewShapeDrawModel with the given command
 
Method Summary
 void done()
          Called to finish drawing
 void draw()
          Draw the shape on the screen
 Shape getShape()
          Retrieve the shape from the draw model
 Shape getShapeLine()
          Return the line from the arrays
 Shape getShapePoint()
          Return the point from the arrays
 Shape getShapePolygon()
          Return the polygon from the arrrays
 void keyPressed(java.awt.event.KeyEvent inKeyEvent)
          Called when a key is pressed
 void mouseDragged(java.awt.event.MouseEvent e)
          Drag the point
 void mousePressed(java.awt.event.MouseEvent e)
          add a new point to the shape, listens to the gis editor.
 void reset()
          Reset the draw model to the initial state
 void setShapeType(int inShapeType)
          Set the type of shape this draw model is to create
 
Methods inherited from class gistoolkit.display.drawmodel.SimpleDrawModel
getGISDisplay, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mouseMoved, mouseReleased, remove, setCommand, setGISDisplay
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POLYGON

public static final int POLYGON
Constant for drawing a Polygon

See Also:
Constant Field Values

LINE

public static final int LINE
Constant for drawing a Line

See Also:
Constant Field Values

POINT

public static final int POINT
Constant for drawing a Point

See Also:
Constant Field Values
Constructor Detail

NewShapeDrawModel

public NewShapeDrawModel()
Creates new NewShapeDrawModel


NewShapeDrawModel

public NewShapeDrawModel(Command inCommand)
Creates new NewShapeDrawModel with the given command

Method Detail

setShapeType

public void setShapeType(int inShapeType)
Set the type of shape this draw model is to create


mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
add a new point to the shape, listens to the gis editor.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class SimpleDrawModel

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Drag the point

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Overrides:
mouseDragged in class SimpleDrawModel

draw

public void draw()
Draw the shape on the screen

Specified by:
draw in interface DrawModel
Overrides:
draw in class SimpleDrawModel

getShape

public Shape getShape()
Retrieve the shape from the draw model


getShapePoint

public Shape getShapePoint()
Return the point from the arrays


getShapeLine

public Shape getShapeLine()
Return the line from the arrays


getShapePolygon

public Shape getShapePolygon()
Return the polygon from the arrrays


done

public void done()
Called to finish drawing


keyPressed

public void keyPressed(java.awt.event.KeyEvent inKeyEvent)
Called when a key is pressed

Specified by:
keyPressed in interface java.awt.event.KeyListener
Overrides:
keyPressed in class SimpleDrawModel

reset

public void reset()
Reset the draw model to the initial state

Specified by:
reset in interface DrawModel
Overrides:
reset in class SimpleDrawModel