public class SketchDemo extends Object
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 and Description |
---|
SketchDemo(AppContext context)
Construct a new sketch-based editor.
|
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] argv)
Create and run a basic sketch application.
|
public SketchDemo(AppContext context)
public static void main(String[] argv)
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.