DOC PREVIEW
MIT 6 893 - How To Build a Sketch Based Interface

This preview shows page 1-2-21-22 out of 22 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14Slide 15Slide 16Slide 17Slide 18Slide 19Slide 20Slide 21Slide 22MIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Lecture Introduction How To Build a Sketch Based InterfaceTevfik Metin Sezgin, Michael Oltmans, Randall DavisMIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching2Consider This Device...MIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching3Our VisionMIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching4Our Model•The designer sketches with pen and paper•The observer interprets the sketch•The observer and designer interactMIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching5Demo•Conceptual mechanical design•Client–Low level sketch understanding–Recognize sketch as mechanical device•Server–Simulate the recognized deviceMIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching6How did we get here?•Low level sketch processing•Domain level recognition•Connection to existing design toolsMIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching7Today’s goals•Learn to use the low level recognition toolkit•Learn how to build a simple sketching interface with the toolkit•Build your own interface to XfigAnd now, on to the Toolkit…MIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching8•Given a freehand stroke, generate a geometric primitive –Lines–Circles–CurvesToolkit functionalityMIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching9The Toolkit doesn’t do…•Higher level recognition (i.e., can’t recognize squares, rectangles, domain specific shapes)•Gesture recognitionMIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching10TerminologySketch: Informal,messy diagramsconsisting of several strokesStroke: Array of timestampedpoints collected between pendown and pen up eventsMIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching11Structure of an applicationSketchP anelStrokeDa taListenerSimpleClassifierStrokeDataApplicatio nGeometricObjectMIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching12Package hierarchy•edu.mit.sketch.fig (SketchFig.java)•edu.mit.sketch.toolkit–Recognition related classes are here•edu.mit.sketch.geom–The geometry package •edu.mit.sketch.ui–User interface related classesMIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching13Classes you will use most often•edu.mit.sketch.ui–SketchPanel•edu.mit.sketch.toolkit–StrokeData–SimpleClassifier• edu.mit.sketch.geom– GeneralPath– Polygon– Line– Ellipse– Point– RectangleMIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching14edu.mit.sketch.ui•SketchPanel–extends javax.swing.JPanel–Gathers stroke data–Displays raw strokes as they are drawn–Has methods for adding and removing StrokeDataListenersMIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching15edu.mit.sketch.toolkit.StrokeData•This class holds and computes stroke related information such as points in the stroke, pen speed, curvature…•The constructor takes an array of points•SketchPanel creates this object after each mouse up eventMIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching16edu.mit.sketch.toolkit.SimpleClassifer•Constructor takes a StrokeData object•Has a method int classify()•This method returns an int indicating the type of the approximation generated by the toolkit•Compare the result against the following using a switch statement–SimpleClassifier.LINE–SimpleClassifier.ELLIPSE–SimpleClassifier.POLYGON–SimpleClassifier.COMPLEXMIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching17edu.mit.sketch.toolkit.SimpleClassifer•One can also check for a particular type by–SimpleClassifier.isLine()–SimpleClassifier.isEllipse()–SimpleClassifier.isPolygon()–SimpleClassifier.isComplex()MIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching18edu.mit.sketch.toolkit.SimpleClassifer •Once the type is determined, the approximation can be accessed by–Line getLineApproximation()–Ellipse getEllipseApproximation()–Polygon getPolygonApproximation()–GeneralPath getComplexApproximation()MIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching19Putting it all togetherpublic class XFigFrontendextends SketchPanelimplements StrokeDataListener {public XFigFrontend ( ) {addStrokeDataListener( this );}public void handleStroke( StrokeData stroke_data ){SimpleClassifier classifier = new SimpleClassifier( stroke_data );switch( classifier.classify() ) {case SimpleClassifier.LINE:...}}}MIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching20How to get started•Compile and run–“make classpath” – only need to do this once for each shell window–“make” – compiles the java files–java SketchTest•See how it uses the toolkit and the SimpleClassifier•Best strategy for understanding the control flow: find the handleStroke() method in TicTacToe.javaMIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching21How to get started•Compile and run–javac SketchTest.java*Java is not Python! ALWAYS recompile after making changes–<correct any errors!>–java SketchTest*don’t include the “.class” part of the name when running•Try compiling and running MyTTT (assuming I can find it)•See how it uses the toolkit and the SimpleClassifier•Best strategy for understanding the control flow: find the handleStroke() method in TicTacToe.javaMIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Tutorial 10: Sketching22Resources•Javadoc documentation is included with toolkit–mozilla


View Full Document

MIT 6 893 - How To Build a Sketch Based Interface

Documents in this Course
Toolkits

Toolkits

16 pages

Cricket

Cricket

29 pages

Quiz 1

Quiz 1

8 pages

Security

Security

28 pages

Load more
Download How To Build a Sketch Based Interface
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view How To Build a Sketch Based Interface and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view How To Build a Sketch Based Interface 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?