edu.mit.sketch.clocksketch.model
Class PenDrawing

java.lang.Object
  extended by edu.mit.sketch.clocksketch.model.Drawing
      extended by edu.mit.sketch.clocksketch.model.PenDrawing
All Implemented Interfaces:
java.lang.Comparable

public class PenDrawing
extends Drawing
implements java.lang.Comparable

Author:
David Pitman May 7, 2005

Constructor Summary
PenDrawing(java.util.Collection<Symbol> symbols)
           
PenDrawing(java.util.Collection<Symbol> symbols, ClockSymbols.Drawings typeArg)
           
PenDrawing(Symbol symbol)
           
PenDrawing(Symbol symbol, ClockSymbols.Drawings typeArg)
           
 
Method Summary
 boolean addSymbol(Symbol newSymbol)
          Adds a symbol to the drawing.
 boolean addSymbols(java.util.Collection<Symbol> newSymbols)
           
 boolean addUnclassifiedSymbol(Symbol newSymbol)
           
 void clearSymbols()
          Clears the drawing of any symbols.
 int compareTo(java.lang.Object arg0)
           
 java.awt.image.BufferedImage createBufferedImageDrawing()
           
 void extrapolateMissingValues()
          For use w/ the Anoto Pen, which cleverly drops any points along a straight line to conserver memory.
 void forceResorting()
           
 java.lang.String getActualData()
          Returns the actual, unaltered data from the string (if it is put in the drawing)
 ClockFaceSymbol getClockFaceSymbol()
           
 ClockSymbols.Drawings getDrawingType()
           
 long getEndOfDrawing()
           
 double getHeight()
          Returns the height of the drawing for an image
 double getMaxX()
          Returns the maximum X coordinate of the Drawing
 double getMaxY()
          Returns the maximum Y coordinate of the Drawing
 double getMinX()
          Returns the minimum X coordinate of the Drawing
 double getMinY()
          Returns the minimum Y coordinate of the Drawing
 long getStartOfDrawing()
           
 java.util.TreeSet<Stroke> getStrokes()
          Returns all strokes in the drawing in the natural ordering of Stroke
 java.util.TreeSet<Symbol> getSymbols()
           
 double getWidth()
          Returns the width of the drawing for an image
 void refreshCoordinateCache()
           
 boolean removeSymbol(Symbol symbolIn)
          Removes a symbol from the drawing.
 void rotateDrawing()
          Converts the drawing from a portrait profile to a landscape profile.
 void setActualData(java.lang.String actualDataArg)
          Stores a copy of data which represents the actual data from the pen.
 void setDrawingType(ClockSymbols.Drawings typeArg)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PenDrawing

public PenDrawing(Symbol symbol)

PenDrawing

public PenDrawing(Symbol symbol,
                  ClockSymbols.Drawings typeArg)

PenDrawing

public PenDrawing(java.util.Collection<Symbol> symbols)

PenDrawing

public PenDrawing(java.util.Collection<Symbol> symbols,
                  ClockSymbols.Drawings typeArg)
Method Detail

addSymbol

public boolean addSymbol(Symbol newSymbol)
Description copied from class: Drawing
Adds a symbol to the drawing. Returns true iff the symbol is successfully added.

Specified by:
addSymbol in class Drawing

addSymbols

public boolean addSymbols(java.util.Collection<Symbol> newSymbols)

addUnclassifiedSymbol

public boolean addUnclassifiedSymbol(Symbol newSymbol)

forceResorting

public void forceResorting()

removeSymbol

public boolean removeSymbol(Symbol symbolIn)
Description copied from class: Drawing
Removes a symbol from the drawing. Returns true iff the symbol is successfully removed.

Specified by:
removeSymbol in class Drawing

clearSymbols

public void clearSymbols()
Description copied from class: Drawing
Clears the drawing of any symbols.

Specified by:
clearSymbols in class Drawing

getSymbols

public java.util.TreeSet<Symbol> getSymbols()

refreshCoordinateCache

public void refreshCoordinateCache()

getWidth

public double getWidth()
Returns the width of the drawing for an image


getHeight

public double getHeight()
Returns the height of the drawing for an image


getStrokes

public java.util.TreeSet<Stroke> getStrokes()
Returns all strokes in the drawing in the natural ordering of Stroke


extrapolateMissingValues

public void extrapolateMissingValues()
For use w/ the Anoto Pen, which cleverly drops any points along a straight line to conserver memory. Since we know the sampling rate of the pen, we can infer where those values must have been on any line.


getActualData

public java.lang.String getActualData()
Returns the actual, unaltered data from the string (if it is put in the drawing)


setActualData

public void setActualData(java.lang.String actualDataArg)
Stores a copy of data which represents the actual data from the pen.

Parameters:
actualDataArg -

getMinX

public double getMinX()
Returns the minimum X coordinate of the Drawing


getMinY

public double getMinY()
Returns the minimum Y coordinate of the Drawing


getMaxX

public double getMaxX()
Returns the maximum X coordinate of the Drawing


getMaxY

public double getMaxY()
Returns the maximum Y coordinate of the Drawing


getDrawingType

public ClockSymbols.Drawings getDrawingType()

setDrawingType

public void setDrawingType(ClockSymbols.Drawings typeArg)

getStartOfDrawing

public long getStartOfDrawing()

getEndOfDrawing

public long getEndOfDrawing()

createBufferedImageDrawing

public java.awt.image.BufferedImage createBufferedImageDrawing()

rotateDrawing

public void rotateDrawing()
Converts the drawing from a portrait profile to a landscape profile.


getClockFaceSymbol

public ClockFaceSymbol getClockFaceSymbol()

compareTo

public int compareTo(java.lang.Object arg0)
Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object