|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.sketch.demo.SketchDemo
public class SketchDemo
This application illustrates how to use the diva.sketch framework to build a sketch-based application.
The demo launches an editor for sketching and provides file saving and loading capabilities. The main purpose of this demo is to illustrate how to set up a sketch-based UI using the diva.sketch package. It does not show how to add gesture recognition to interprete the sketch. Please see SimpleDemo for more information.
The figures sketched can be selected by control-clicking on the stroke itself. When selected, a set of blue handles will appear around the figure and a red drag handle will appear in the center of the figure. To resize, drag one of the blue handles; to move, drag the red, square handle.
The following three lines are all you need to create a sketch-based user interface using the package:
JFrame f = new JFrame(); JSketch sketch = new JSketch(); f.getContentPane().add("Center", sketch);The rest of the code in the demo is mainly to add more functionality.
Constructor Summary | |
---|---|
SketchDemo(AppContext context)
Construct a new sketch-based editor. |
Method Summary | |
---|---|
static void |
main(String[] argv)
Create and run a basic sketch application. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SketchDemo(AppContext context)
Method Detail |
---|
public static void main(String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |