| com.jgraph.pad.graph.JGraphpadTransferHandler
JGraphpadTransferHandler | public class JGraphpadTransferHandler extends GraphTransferHandler (Code) | | Transfer handler for graphs that accepts external files and text.
|
Field Summary | |
protected transient Object | prototype Holds the prototype which is used to create new vertices. |
Method Summary | |
public boolean | canImport(JComponent comp, DataFlavor[] flavors) Extends the parent implementation to accept text and
DataFlavor.javaFileListFlavor flavors.
Parameters: comp - The component to drop the transferable to. Parameters: flavors - The supported data flavors of the transferable. | protected Object | createCell(GraphModel model, Object userObject) Constructs a new cell from
JGraphpadTransferHandler.prototype using the specified model
and assigns it the new user object.
Parameters: model - The model to use for cloning the prototype. Parameters: userObject - The user object to be assigned to the clone. | protected Point2D | getInsertionLocation(JGraph graph) Helper method to return the insertion location for a drop operation in
the specified graph. | protected String | getString(Reader reader) Helper method to read the specified reader into a string.
Parameters: reader - The reader to read into the string. | public boolean | importDataImpl(JComponent comp, Transferable t) Overrides the parent implementation to import transferable data. | protected void | insertValues(JGraph graph, Point2D p, Object[] values) Inserts the specified list of values into the specified graph. |
prototype | protected transient Object prototype(Code) | | Holds the prototype which is used to create new vertices.
|
JGraphpadTransferHandler | public JGraphpadTransferHandler(Object prototype)(Code) | | Constructs a new transfer handler for the specified prototype.
Parameters: prototype - The prototype to be used to create new cells. |
canImport | public boolean canImport(JComponent comp, DataFlavor[] flavors)(Code) | | Extends the parent implementation to accept text and
DataFlavor.javaFileListFlavor flavors.
Parameters: comp - The component to drop the transferable to. Parameters: flavors - The supported data flavors of the transferable. Returns true if the flavor is accepted. |
createCell | protected Object createCell(GraphModel model, Object userObject)(Code) | | Constructs a new cell from
JGraphpadTransferHandler.prototype using the specified model
and assigns it the new user object.
Parameters: model - The model to use for cloning the prototype. Parameters: userObject - The user object to be assigned to the clone. Returns a prototype clone with the specified user object. |
getInsertionLocation | protected Point2D getInsertionLocation(JGraph graph)(Code) | | Helper method to return the insertion location for a drop operation in
the specified graph. This implementation returns a scaled clone of
BasicGraphUI.getInsertionLocation or a dummy point if the
insertion location is not available in the graph ui.
Parameters: graph - The graph to determine the insertion location for. Returns the insertion location for the specified graph. |
getString | protected String getString(Reader reader) throws IOException(Code) | | Helper method to read the specified reader into a string.
Parameters: reader - The reader to read into the string. Returns the string stored in the reader. |
importDataImpl | public boolean importDataImpl(JComponent comp, Transferable t)(Code) | | Overrides the parent implementation to import transferable data. Note: It
is a special rule in JGraph not to override the
GraphTransferHandler.importData(JComponentTransferable) method
because the return value has a different semantic. This implementation
silently ignores all exceptions.
Parameters: comp - The component to drop the transferable to. Parameters: t - The transferable data to be inserted into the component. Returns true if the transferable data was inserted. |
insertValues | protected void insertValues(JGraph graph, Point2D p, Object[] values)(Code) | | Inserts the specified list of values into the specified graph. If a known
image extension is seen then the icon attribute is setup accordingly.
Parameters: graph - The graph to insert the cells into. Parameters: p - The point at which to insert the cells. Parameters: values - The list of values to be inserted. |
|
|