gistoolkit.display.drawmodel
Class EditNodesDrawModel

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

public class EditNodesDrawModel
extends SimpleDrawModel

A model used for highlighting features on the map as the pointer is moved over it. Creation date: (4/18/2001 3:20:16 PM)


Field Summary
static int ADD
           
static int DELETE
           
static int MOVE
          Modes in which this draw model may operate.
static int MOVE_SHAPE
           
 
Fields inherited from class gistoolkit.display.drawmodel.SimpleDrawModel
myCommand, myGISDisplay
 
Constructor Summary
EditNodesDrawModel()
          Create a new EditNodesDrawModel.
EditNodesDrawModel(Command inCommand)
          Create a new EditNodesDrawModel, with a connection to the command.
 
Method Summary
 void addEditNodesDrawModelListener(EditNodesDrawModelListener inListener)
          Add a listener to this draw model to recieve events when they happen.
 void done()
          Ends the editing of the polygon, and updates the record.
 void draw()
          The function which is called to draw the image on the map.
 void drawPoint(Point inPoint)
          The function which is called to draw the point on the screen.
protected  void fireEvent(EditNodesDrawModelEvent inEvent)
          notify the listeners of an event
protected  void firePointAdded(Point inPoint)
          Fire an event when a point is added.
protected  void firePointMoved(Point inPoint)
          Fire an event when a point is moved.
protected  void firePointRemoved(Point inPoint)
          Fire an event when a point is deleted.
 Layer getLayer()
          Returns the layer associated with the record.
 int getMode()
          Get the state of the model, Add = add nodes, Move = move nodes, Delete = delete nodes.
 Record getRecord()
          Returns the last selected record.
 boolean isSelected()
          Determines if the draw model has a selection to operate on.
 void mouseDragged(java.awt.event.MouseEvent e)
          Invoked when the mouse button has been moved on a component (with no buttons down).
 void mousePressed(java.awt.event.MouseEvent e)
          Called when the user presses the mouse button.
 void mouseReleased(java.awt.event.MouseEvent e)
          Called when the user releases the mouse butotn.
 void removeEditNodesDrawModelListener(EditNodesDrawModelListener inListener)
          Remove this listsner.
 void setLayer(Layer newLayer)
          Sets the layer that goes along with the record.
 void setMode(int inState)
          Set the state of the model, Add = add nodes, Move = move nodes, Delete = delete nodes.
 void setRecord(Record inRecord)
          Returns the last selected record.
 void setShader(Shader inShader)
          Set the shader used for shading the highlighted shapes.
 
Methods inherited from class gistoolkit.display.drawmodel.SimpleDrawModel
getGISDisplay, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mouseMoved, remove, reset, setCommand, setGISDisplay
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MOVE

public static int MOVE
Modes in which this draw model may operate.


ADD

public static int ADD

DELETE

public static int DELETE

MOVE_SHAPE

public static int MOVE_SHAPE
Constructor Detail

EditNodesDrawModel

public EditNodesDrawModel()
Create a new EditNodesDrawModel. This constructor does not attach to a command.


EditNodesDrawModel

public EditNodesDrawModel(Command inCommand)
Create a new EditNodesDrawModel, with a connection to the command.

Method Detail

addEditNodesDrawModelListener

public void addEditNodesDrawModelListener(EditNodesDrawModelListener inListener)
Add a listener to this draw model to recieve events when they happen.


removeEditNodesDrawModelListener

public void removeEditNodesDrawModelListener(EditNodesDrawModelListener inListener)
Remove this listsner.


firePointAdded

protected void firePointAdded(Point inPoint)
Fire an event when a point is added.


firePointMoved

protected void firePointMoved(Point inPoint)
Fire an event when a point is moved.


firePointRemoved

protected void firePointRemoved(Point inPoint)
Fire an event when a point is deleted.


fireEvent

protected void fireEvent(EditNodesDrawModelEvent inEvent)
notify the listeners of an event


done

public void done()
          throws java.lang.Exception
Ends the editing of the polygon, and updates the record.

Throws:
java.lang.Exception

draw

public void draw()
The function which is called to draw the image on the map.

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

drawPoint

public void drawPoint(Point inPoint)
The function which is called to draw the point on the screen.


getLayer

public Layer getLayer()
Returns the layer associated with the record.


getMode

public int getMode()
Get the state of the model, Add = add nodes, Move = move nodes, Delete = delete nodes.


getRecord

public Record getRecord()
Returns the last selected record. If there is not record selected, then it returns null.


isSelected

public boolean isSelected()
Determines if the draw model has a selection to operate on.


mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Invoked when the mouse button has been moved on a component (with no buttons down).

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

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Called when the user presses the mouse button.

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

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Called when the user releases the mouse butotn.

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

setLayer

public void setLayer(Layer newLayer)
Sets the layer that goes along with the record. Creation date: (4/27/2001 4:08:05 PM)

Parameters:
newLayer - gistoolkit.display.Layer

setMode

public void setMode(int inState)
Set the state of the model, Add = add nodes, Move = move nodes, Delete = delete nodes.


setRecord

public void setRecord(Record inRecord)
Returns the last selected record. If there is not record selected, then it returns null.


setShader

public void setShader(Shader inShader)
Set the shader used for shading the highlighted shapes.