Drag and Drop
Ken Webb 2010-06-13T19:09:44Z
I've started adding drag and drop capabilities to Xholon.
- Text can be dragged from various sources (web pages, text editors, etc.) into the Xholon Console. This is automatically available because the Xholon Console uses a JTextPane.
- Text can now be dragged from various sources into the tree structure in the Xholon GUI. The text can be XML, or a file name, or a URI/URL, or a .png file with embedded XML text.
- It is not yet possible to drag content onto a Xholon grid.
Here's a simple example.
- Launch the Xholon Chameleon app.
- Select File --> Open.
- Locate the Chameleon node in the tree (Model --> CompositeStructureHierarchy --> chameleon_0). Try any or all of the following three alternatives.
- Highlight the following XML text, and drag it to the Chameleon node. Make sure the cursor is directly over the Chameleon node before releasing the mouse button.
<JFrame Title="A simple GUI">
<JPanel PreferredSize="Dimension,200,200" Background="BLACK">
<JButton Text="Pluto" ToolTipText="This is a Plutonian button." ActionCommand="onToPluto"/>
- Alternatively, you can highlight the following URI, and drag it to the Chameleon node. A copy of a similar simple GUI is at this URI.
- As another alternative, select the .png image here, and drag it to the Chameleon node. The XML to create the GUI is embedded inside the .png image.
You can drag any number of items to the Chameleon node. They will all become children of Chameleon. You can also drag the XML text to a text editor, edit it, and then drag the edited text to the Chameleon node. And, you can always use copy and paste instead of drag and drop.
return to main page