jcreek.gui.conceptmap.tool
Class BuildTool

java.lang.Object
  extended byjcreek.gui.conceptmap.tool.DragTool
      extended byjcreek.gui.conceptmap.tool.BuildTool
All Implemented Interfaces:
ConceptMapTool, java.util.EventListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public class BuildTool
extends DragTool


Field Summary
 
Fields inherited from class jcreek.gui.conceptmap.tool.DragTool
firstMousePos, lastMousePos, movingEntities, pressVertex, wasPressed, view
 
Constructor Summary
BuildTool()
          Creates a new BuildTool.
BuildTool(ConceptMapView conceptMapView)
          Creates a new BuildTool and registers it with this ConceptMapView.
 
Method Summary
 void attach(ConceptMapView view)
           
protected  void continueMakeRelation(int x, int y)
           
protected  void createVisualEntity(int x, int y)
           
 void detach()
           
 boolean getAllowNewEntities()
          Returns true if this tools is allowed to make new entities.
 RelationType getCurrentRelationType()
          Returns the current relation type used when making new relations.
 javax.swing.Action getRemoveAction()
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent me)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent me)
           
 void mouseReleased(java.awt.event.MouseEvent me)
           
 void paintTool(java.awt.Graphics g)
           
protected  void removeSelection()
           
 void setAllowNewEntities(boolean allowEntities)
          Sets if this tools is allowed to create new entities or not.
 void setCurrentRelationType(RelationType drawType)
          Sets the current relation type to be drawn when creating new relations.
protected  void startMakeRelation(int x, int y)
           
protected  void stopMakeRelation()
           
 
Methods inherited from class jcreek.gui.conceptmap.tool.DragTool
continueDrag, detatch, startDrag, stopDrag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildTool

public BuildTool()
Creates a new BuildTool.


BuildTool

public BuildTool(ConceptMapView conceptMapView)
Creates a new BuildTool and registers it with this ConceptMapView.

Parameters:
conceptMapView - The ConceptMapView to add this tool to.
Method Detail

attach

public void attach(ConceptMapView view)
Specified by:
attach in interface ConceptMapTool
Overrides:
attach in class DragTool

getRemoveAction

public javax.swing.Action getRemoveAction()

detach

public void detach()

setCurrentRelationType

public void setCurrentRelationType(RelationType drawType)
Sets the current relation type to be drawn when creating new relations.

Parameters:
drawType - The RelationType to make when drawing new relations.

getCurrentRelationType

public RelationType getCurrentRelationType()
Returns the current relation type used when making new relations.


setAllowNewEntities

public void setAllowNewEntities(boolean allowEntities)
Sets if this tools is allowed to create new entities or not. Default is true.

Parameters:
allowEntities - If true, new entities are allowed to be made, if false, not.

getAllowNewEntities

public boolean getAllowNewEntities()
Returns true if this tools is allowed to make new entities.


mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener
Overrides:
mouseClicked in class DragTool

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent me)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Overrides:
mouseDragged in class DragTool

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener
Overrides:
mouseEntered in class DragTool

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener
Overrides:
mouseExited in class DragTool

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Overrides:
mouseMoved in class DragTool

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class DragTool

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me)
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class DragTool

removeSelection

protected void removeSelection()

startMakeRelation

protected void startMakeRelation(int x,
                                 int y)

continueMakeRelation

protected void continueMakeRelation(int x,
                                    int y)

stopMakeRelation

protected void stopMakeRelation()

createVisualEntity

protected void createVisualEntity(int x,
                                  int y)

paintTool

public void paintTool(java.awt.Graphics g)
Specified by:
paintTool in interface ConceptMapTool
Overrides:
paintTool in class DragTool


Created at IDI, NTNU by the Artificial Intelligence and Learning group