Package ca.nengo.ui.lib.objects.models

Examples of ca.nengo.ui.lib.objects.models.ModelObject$ModelListener


        super(world);
    }

    @Override
    protected String getStatusMessage(PInputEvent event) {
        ModelObject wo = (ModelObject) Util.getNodeFromPickPath(event, ModelObject.class);

        StringBuilder statusStr = new StringBuilder(200);
        if (getWorld().getGround().isElasticMode()) {
            statusStr.append("Elastic layout enabled | ");
        }
        statusStr.append(getWorld().getViewerParent().getFullName() + " -> ");

        if (getWorld().getSelection().size() > 1) {
            statusStr.append(getWorld().getSelection().size() + " Objects selected");

        } else {

            if (wo != null) {
                statusStr.append(wo.getFullName());
            } else {
                statusStr.append("No Model Selected");
            }
        }
        return statusStr.toString();
View Full Code Here


     * sort the selection by class type, so that for each class type a
     * collection of models are of the same type (homogeneous)
     */
    for (WorldObject object : selectedObjects) {
      if (object instanceof ModelObject) {
        ModelObject modelUI = (ModelObject) object;

        LinkedList<ModelObject> objects = selectionMap.get(modelUI.getClass());

        if (objects == null) {
          objects = new LinkedList<ModelObject>();
          selectionMap.put(modelUI.getClass(), objects);
        }

        objects.add(modelUI);

      }
View Full Code Here

        // add listeners
        getWorld().getGround().addChildrenListener(new WorldObject.ChildListener() {

            public void childAdded(WorldObject wo) {
                if (wo instanceof ModelObject) {
                    final ModelObject modelObject = ((ModelObject) wo);
                    //                    final Object model = modelObject.getModel();
                    final String modelName = modelObject.getName();

                    try {
                        //scriptConsole.addVariable(modelName, model);

                        modelObject.addPropertyChangeListener(Property.REMOVED_FROM_WORLD,
                                new WorldObject.Listener() {
                            public void propertyChanged(Property event) {
                                scriptConsole.removeVariable(modelName);
                                modelObject.removePropertyChangeListener(Property.REMOVED_FROM_WORLD,
                                        this);
                            }
                        });

                    } catch (Exception e) {
View Full Code Here

    /**
     * @param node TODO
     * @return TODO
     */
    public boolean removeNodeModel(Node node) {
        ModelObject modelToDestroy = null;
        for (WorldObject wo : getWorld().getGround().getChildren()) {
            if (wo instanceof ModelObject) {
                ModelObject modelObject = (ModelObject) wo;

                if (modelObject.getModel() == node) {
                    modelToDestroy = modelObject;
                    break;
                }
            }
        }
View Full Code Here

TOP

Related Classes of ca.nengo.ui.lib.objects.models.ModelObject$ModelListener

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.