Package ca.nengo.ui.lib.actions

Examples of ca.nengo.ui.lib.actions.ActionException


        }
        try {
          nodes.add(nodeUI.getModel().clone());
          offsets.add(new Point2D.Double(nodeUI.getOffset().getX() - averagePoint.getX(), nodeUI.getOffset().getY() - averagePoint.getY()));
        } catch (CloneNotSupportedException e) {
          throw new ActionException("Could not clone node: ", e);
        }
      }

        NengoGraphics.getInstance().getClipboard().setContents(nodes, offsets, world);
    }
View Full Code Here


    protected void action() throws ActionException {

        try {
            probeCreated = myNode.addProbe(state.getKey());
        } catch (SimulationException e) {
            throw new ActionException("Probe could not be added: " + e.getMessage(), true, e);
        }
    }
View Full Code Here

              if (isFromTopMenu) {
                try {
                  CreateModelAction.ensureNonConflictingName(node, ((NodeContainer)clipboardSrcWorld));
                  ((NodeContainer)clipboardSrcWorld).addNodeModel(node);
                } catch (ContainerException ex) {
                  throw new ActionException(ex);
                }
              } else {
                throw new ActionException(e);
              }
            }
          }
        } else {
            throw new ActionException("Clipboard is empty");
        }
    }
View Full Code Here

        }
        try {
          nodes.add(nodeUI.getModel().clone());
          offsets.add(new Point2D.Double(nodeUI.getOffset().getX() - averagePoint.getX(), nodeUI.getOffset().getY() - averagePoint.getY()));
        } catch (CloneNotSupportedException e) {
          throw new ActionException("Could not clone node: ", e);
        }
      }

        /*
         * This removes the node from its parent and externalities
View Full Code Here

    protected void action() throws ActionException {
        try {

            Object model = ModelFactory.constructModel(constructable);
            if (model == null) {
              throw new ActionException("No model was created");
            } else if (model instanceof Node) {
                final Node node = (Node) model;

                SwingUtilities.invokeAndWait(new Runnable() {
                    public void run() {
                        try {
                            ensureNonConflictingName(node, container);
                            try {
                                nodeCreated = container.addNodeModel(node,posX,posY);
                                if (nodeCreated instanceof UINodeViewable) {
                                    if (nodeCreated instanceof ca.nengo.ui.models.nodes.UINEFEnsemble) {
                                        // don't open NEFEnsembles
                                    } else {
                                        ((UINodeViewable) (nodeCreated)).openViewer();
                                    }
                                }
                            } catch (ContainerException e) {
                                UserMessages.showWarning("Could not add node: " + e.getMessage());
                            }
                        } catch (UserCancelledException e) {
                            e.defaultHandleBehavior();
                        }

                    }
                });

            } else {
                throw new ActionException("Can not add model of the type: "
                        + model.getClass().getSimpleName());
            }

        } catch (ConfigException e) {
            e.defaultHandleBehavior();
        } catch (Exception e) {
            e.printStackTrace();
            throw new ActionException(e.getMessage(), e);
        }
    }
View Full Code Here

            try {
                for (ModelObject model : objectsToRemove) {
                    model.destroyModel();
                }
            } catch (Exception e) {
                throw new ActionException("Could not remove all objects: " + e.getMessage(), e);
            }
        } else {
            throw new ActionException("Action cancelled by user", false);
        }
    }
View Full Code Here

            RunSimulatorAction runAction = new RunSimulatorAction("run", selectedNetwork);
            runAction.doAction();

        } else {
            throw new ActionException("No parent network to run, please select a node");
        }
    }
View Full Code Here

            SaveNodeAction saveNodeAction = new SaveNodeAction(selectedNetwork);
            saveNodeAction.doAction();

        } else {
            throw new ActionException("No parent network to save, please select a node");
        }
    }
View Full Code Here

            GeneratePythonScriptAction generatePythonScriptAction = new GeneratePythonScriptAction(selectedNetwork);
            generatePythonScriptAction.doAction();

        } else {
            throw new ActionException("No parent network to save, please select a node");
        }
    }
View Full Code Here

        ArrayList<DataPath> dataFilePaths = new ArrayList<DataPath>();
        findDataItemsRecursive(getRootNode(), new ArrayList<String>(), dataFilePaths);

        if (dataFilePaths.size() == 0) {
            throw new ActionException("Nothing to export");
        } else {
            for (DataPath dataPath : dataFilePaths) {

                Collection<String> folderPath = dataPath.getPath();
                DataTreeNode dataNode = dataPath.getDataNode();

                File dataFile = folder;
                for (String folderName : folderPath) {
                    dataFile = new File(dataFile, folderName);
                    dataFile.mkdir();

                    if (!dataFile.exists()) {
                        throw new ActionException("Problem creating folder: " + dataFile.toString());
                    }
                }

                dataFile = new File(dataFile, dataNode.toString() + "."
                        + DataListView.DATA_FILE_EXTENSION);
View Full Code Here

TOP

Related Classes of ca.nengo.ui.lib.actions.ActionException

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.