public class SketchTransducer extends Object implements Transducer
Modifier and Type | Field and Description |
---|---|
static DataFlavor |
SKETCH_FLAVOR
The data flavor corresponding to sketch strokes
serialized in XML.
|
Constructor and Description |
---|
SketchTransducer()
This constructor should only be called once, to create
the prototype object.
|
SketchTransducer(SketchModel model)
This constructor is called by the newInstance() method,
which builds a new transducer for the given sketch
model.
|
Modifier and Type | Method and Description |
---|---|
Object |
getTransferData(DataFlavor flavor)
Perform recognition on the sketch model and return the
transfer data as a string, or as plain text (based on
StringSelection's implementation of getTransferData();
|
DataFlavor[] |
getTransferDataFlavors()
Return StringSelection's data flavors.
|
boolean |
isDataFlavorSupported(DataFlavor in)
Call StringSelection's predicate.
|
void |
lostOwnership(Clipboard clipboard,
Transferable contents)
Do nothing.
|
Transducer |
newInstance(SketchModel in)
Apply the transducer to the given set of strokes by
performing sketch recognition on the given strokes.
|
public static final DataFlavor SKETCH_FLAVOR
public SketchTransducer()
public SketchTransducer(SketchModel model)
public DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors
in interface Transferable
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
getTransferData
in interface Transferable
UnsupportedFlavorException
IOException
public boolean isDataFlavorSupported(DataFlavor in)
isDataFlavorSupported
in interface Transferable
public void lostOwnership(Clipboard clipboard, Transferable contents)
lostOwnership
in interface ClipboardOwner
public Transducer newInstance(SketchModel in)
newInstance
in interface Transducer
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.