edu.mit.sketch.toolkit
Class ObjectManager

java.lang.Object
  |
  +--edu.mit.sketch.toolkit.ObjectManager
All Implemented Interfaces:
EventListener, KeyListener, MouseListener, MouseMotionListener

public class ObjectManager
extends Object
implements MouseMotionListener, MouseListener, KeyListener

This class manages the objects recognized by the Tablet. Tablet adds the recognized using the addObject method. The objects are kept in a Vector.


Field Summary
 int mode
           
 Vector paths
           
static int RECOGNITION_MODE
           
static int SELECTION_MODE
           
 boolean show_parsed_objects
          This is true if the parsed stuff is to be painted.
 Vector stroke_vertices
           
 
Constructor Summary
ObjectManager(TabletDataProcessor tablet)
          The constructor.
 
Method Summary
 void addObject(Object o)
          Adds an object to the objects vector after filtering.
 void addObject(Object o, Polygon polygonal_fit)
          Adds an object to the objects vector after checking if the polygonal fit is a spring or not.
 void addObjects(Vector input_objects)
          Adds given objects to the objects vector after filtering.
 void addPath(GeneralPath path)
          Adds given objects to the paths vector
 void addVertices(Vertex[] vertices)
          Adds an object to the objects vector after filtering.
 void changeModeTo(int mode)
          Mouse events
 void clear()
          Clear the screen
 void deriveProperties()
          Write the images that show scale space data in a single gif file.
 void deriveSnapshots()
          Write the images that show scale space data in a single gif file.
 void deselectObjects()
          Deselect the objects
 void doOpen()
          Launch a FileDialog and do a load
 void doSave()
          Launch a FileDialog and do a save
 void doSaveAs()
          Launch a FileDialog and do a save as
 String getFeatureVectors()
          Feature vectors in string format
 Vector getNeighborObjects(Point p, int r)
          Returns a vector of all the geometric objects "sufficiently close to the point passes, determined by the search radius r.
 Vector getNeighborObjectsOriginal(Point p, int r)
          Returns a vector of all the geometric objects "sufficiently close to the point passes, determined by the search radius r.
 Vector getTranslatableNeighborObjects(Point p, int r)
          Returns a vector of all the geometric objects "sufficiently close to the point passes, determined by the search radius r.
 Vector getTranslatableNeighborObjectsOriginal(Point p, int r)
          Returns a vector of all the geometric objects "sufficiently close to the point passes, determined by the search radius r.
 void keyPressed(KeyEvent k)
          Handle key stroke events
 void keyReleased(KeyEvent k)
          Handle key stroke events
 void keyTyped(KeyEvent k)
          Handle key stroke events
 void mouseClicked(MouseEvent e)
          Handle mouse events
 void mouseDragged(MouseEvent e)
          Mouse events
 void mouseEntered(MouseEvent e)
          Handle mouse events
 void mouseExited(MouseEvent e)
          Handle mouse events
 void mouseMoved(MouseEvent e)
          Mouse events
 void mousePressed(MouseEvent e)
          Handle mouse events
 void mouseReleased(MouseEvent e)
          Handle mouse events
 void paint(Graphics graphics)
          Draw the objects
 void parse()
          Call the parse method in spatial_parser
 void printFeatureVectors()
          Print the feature vectors
 boolean removeObject(Object object)
          Removes the argument object from the objects Vector.
 boolean removePath(Object object)
          Removes the argument object from the objects Vector.
 void reset()
          Removes all the objects.
 void runSVMClassifier(GeneralPath general_path)
          Save the feature vectors
 void saveFeatureVectors(String file_name)
          Save the feature vectors
 void selectInside(GeometricObject object)
          Selects all the objects inside the given object.
 void selectObjects(Translatable[] translatables)
          Select the objects in the argument vector.
 void selectObjects(Vector translatables)
          Select the objects in the argument vector.
 void undo()
          A very primitive undo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stroke_vertices

public Vector stroke_vertices

paths

public Vector paths

RECOGNITION_MODE

public static final int RECOGNITION_MODE

SELECTION_MODE

public static final int SELECTION_MODE

mode

public int mode

show_parsed_objects

public boolean show_parsed_objects
This is true if the parsed stuff is to be painted. Otherwise the original data points are displayed.
Constructor Detail

ObjectManager

public ObjectManager(TabletDataProcessor tablet)
The constructor.
Method Detail

addObject

public void addObject(Object o)
Adds an object to the objects vector after filtering.

addVertices

public void addVertices(Vertex[] vertices)
Adds an object to the objects vector after filtering.

addObject

public void addObject(Object o,
                      Polygon polygonal_fit)
Adds an object to the objects vector after checking if the polygonal fit is a spring or not.

addObjects

public void addObjects(Vector input_objects)
Adds given objects to the objects vector after filtering.

addPath

public void addPath(GeneralPath path)
Adds given objects to the paths vector

removePath

public boolean removePath(Object object)
Removes the argument object from the objects Vector.

selectInside

public void selectInside(GeometricObject object)
Selects all the objects inside the given object.

removeObject

public boolean removeObject(Object object)
Removes the argument object from the objects Vector.

paint

public void paint(Graphics graphics)
Draw the objects

clear

public void clear()
Clear the screen

reset

public void reset()
Removes all the objects.

undo

public void undo()
A very primitive undo

getTranslatableNeighborObjects

public Vector getTranslatableNeighborObjects(Point p,
                                             int r)
Returns a vector of all the geometric objects "sufficiently close to the point passes, determined by the search radius r. For the moment, the only Terminals are searched.

getTranslatableNeighborObjectsOriginal

public Vector getTranslatableNeighborObjectsOriginal(Point p,
                                                     int r)
Returns a vector of all the geometric objects "sufficiently close to the point passes, determined by the search radius r. For the moment, the only Terminals are searched. This method looks at the original data points.

getNeighborObjects

public Vector getNeighborObjects(Point p,
                                 int r)
Returns a vector of all the geometric objects "sufficiently close to the point passes, determined by the search radius r. For the moment, the only Terminals are searched.

getNeighborObjectsOriginal

public Vector getNeighborObjectsOriginal(Point p,
                                         int r)
Returns a vector of all the geometric objects "sufficiently close to the point passes, determined by the search radius r. For the moment, the only Terminals are searched. This method looks at the original data points.

mouseClicked

public void mouseClicked(MouseEvent e)
Handle mouse events
Specified by:
mouseClicked in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
Handle mouse events
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Handle mouse events
Specified by:
mouseExited in interface MouseListener

mousePressed

public void mousePressed(MouseEvent e)
Handle mouse events
Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Handle mouse events
Specified by:
mouseReleased in interface MouseListener

keyPressed

public void keyPressed(KeyEvent k)
Handle key stroke events
Specified by:
keyPressed in interface KeyListener

keyReleased

public void keyReleased(KeyEvent k)
Handle key stroke events
Specified by:
keyReleased in interface KeyListener

keyTyped

public void keyTyped(KeyEvent k)
Handle key stroke events
Specified by:
keyTyped in interface KeyListener

mouseDragged

public void mouseDragged(MouseEvent e)
Mouse events
Specified by:
mouseDragged in interface MouseMotionListener

mouseMoved

public void mouseMoved(MouseEvent e)
Mouse events
Specified by:
mouseMoved in interface MouseMotionListener

changeModeTo

public void changeModeTo(int mode)
Mouse events

deselectObjects

public void deselectObjects()
Deselect the objects

selectObjects

public void selectObjects(Translatable[] translatables)
Select the objects in the argument vector.

selectObjects

public void selectObjects(Vector translatables)
Select the objects in the argument vector.

parse

public void parse()
Call the parse method in spatial_parser

doOpen

public void doOpen()
Launch a FileDialog and do a load

doSaveAs

public void doSaveAs()
Launch a FileDialog and do a save as

doSave

public void doSave()
Launch a FileDialog and do a save

deriveProperties

public void deriveProperties()
Write the images that show scale space data in a single gif file.

deriveSnapshots

public void deriveSnapshots()
Write the images that show scale space data in a single gif file.

printFeatureVectors

public void printFeatureVectors()
Print the feature vectors

getFeatureVectors

public String getFeatureVectors()
Feature vectors in string format

saveFeatureVectors

public void saveFeatureVectors(String file_name)
Save the feature vectors

runSVMClassifier

public void runSVMClassifier(GeneralPath general_path)
Save the feature vectors