Package org.apache.airavata.xbaya.component.registry

Examples of org.apache.airavata.xbaya.component.registry.ComponentReference


     * @param treePath
     *            The path of the selected selectedComponent.
     */
    private void select(TreePath treePath) {
        final ComponentTreeNode selectedNode = (ComponentTreeNode) treePath.getLastPathComponent();
        final ComponentReference componentReference = selectedNode.getComponentReference();
        selectComponent(null);
        this.selectedComponentReference = null;
        if (componentReference != null) {
            this.selectedComponentReference = componentReference;
            new Thread() {
                @Override
                public void run() {
                    try {
                        // get all components and check the number of
                        // components. If there are multiple, expand the tree.
                        final List<? extends Component> components = componentReference.getComponents();
                        if (components.size() == 1) {
                            selectComponent(components.get(0));
                        } else {
                            SwingUtilities.invokeLater(new Runnable() {
                                public void run() {
View Full Code Here


        }
    }

    private void expandTreeLeaf(ComponentTreeNode selectedNode, List<? extends Component> components) {
        ComponentReference componentReference = selectedNode.getComponentReference();
        ComponentTreeNode newNode = new ComponentTreeNode(componentReference.getName());

        ComponentTreeNode parent = (ComponentTreeNode) selectedNode.getParent();
        int index = this.treeModel.getIndexOfChild(parent, selectedNode);
        this.treeModel.removeNodeFromParent(selectedNode);
        this.treeModel.insertNodeInto(newNode, parent, index);
View Full Code Here

    private void drop(final DropTargetDropEvent event) {
        logger.debug("Event:" + event);
        Transferable transferable = event.getTransferable();
        try {
            // Cannot cast transferable.
            final ComponentReference componentReference = (ComponentReference) transferable
                    .getTransferData(ComponentSourceTransferable.FLAVOR);
            final Point location = event.getLocation();

            // The component might not have loaded if the network is slow.
            new Thread() {
                @Override
                public void run() {
                    try {
                        Component component = componentReference.getComponent();
                        addNode(component, location);
                        // To be able to delete the added node by the keyboard.
                        GraphCanvas.this.panel.requestFocusInWindow();
                        // XXX this sometimes throws exception.
                        event.dropComplete(true);
View Full Code Here

TOP

Related Classes of org.apache.airavata.xbaya.component.registry.ComponentReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.