Examples of MoMLChangeRequest


Examples of ptolemy.moml.MoMLChangeRequest

            // handle the event dispatch specially:  An event is only
            // dispatched if both the head and the tail are attached.
            // This rather obnoxious hack is here because edge creation
            // is tricky and we can't rerender the edge while we are dragging
            // it.
            MoMLChangeRequest request = new MoMLChangeRequest(
                    ActorGraphModel.this, container, moml.toString()) {
                protected void _execute() throws Exception {
                    // If nonEmptyMoML is false, then the MoML code is empty.
                    // Do not execute it, as this will put spurious empty
                    // junk on the undo stack.
                    if (nonEmptyMoML) {
                        super._execute();
                    }

                    link.setTail(newLinkTail);

                    if (relationNameToAdd != null) {
                        ComponentRelation relation = container
                                .getRelation(relationNameToAdd);

                        if (relation == null) {
                            throw new InternalErrorException(
                                    "Tried to find relation with name "
                                            + relationNameToAdd
                                            + " in context " + container);
                        }

                        link.setRelation(relation);
                    } else {
                        link.setRelation(null);
                    }
                }
            };

            // Handle what happens if the mutation fails.
            request.addChangeListener(new LinkChangeListener(link, container,
                    failmoml));

            request.setUndoable(true);
            container.requestChange(request);
        }
View Full Code Here

Examples of ptolemy.moml.MoMLChangeRequest

            moml.append("<vertex name=\"" + vertexName + "\" value=\"{");
            moml.append(point[0] + ", " + point[1]);
            moml.append("}\"/>\n");
            moml.append("</relation>");

            MoMLChangeRequest request = new MoMLChangeRequest(this, toplevel,
                    moml.toString());
            request.setUndoable(true);
            toplevel.requestChange(request);
        }
View Full Code Here

Examples of ptolemy.moml.MoMLChangeRequest

                        + "\" class=\"" + object.getName() + "\"/>");
            }

            moml.append("</group>");

            MoMLChangeRequest request = new OffsetMoMLChangeRequest(this,
                    container, moml.toString());
            container.requestChange(request);
        }
    }
View Full Code Here

Examples of ptolemy.moml.MoMLChangeRequest

                        + names.toString());
                return;
            }

            String moml = "<entity name=\"" + object.getName() + "\"/>";
            MoMLChangeRequest request = new MoMLChangeRequest(this, container,
                    moml);
            container.requestChange(request);
        }
View Full Code Here

Examples of ptolemy.moml.MoMLChangeRequest

                // and queue a new change request to clean up the model
                // Note: JDK1.2.2 requires that this variable not be
                // called request or we get a compile error.
                // Note the source is NOT the graph model
                MoMLChangeRequest changeRequest = new MoMLChangeRequest(this,
                        _container, _failMoML.toString());

                // fail moml not undoable
                _container.requestChange(changeRequest);
            }
View Full Code Here

Examples of ptolemy.moml.MoMLChangeRequest

            // Delete the port.
            String moml = "<deletePort name=\"" + port.getName() + "\"/>\n";

            // Note: The source is NOT the graph model.
            MoMLChangeRequest request = new MoMLChangeRequest(this, container,
                    moml);
            request.setUndoable(true);
            container.requestChange(request);
        }
View Full Code Here

Examples of ptolemy.moml.MoMLChangeRequest

            // Delete the relation.
            String moml = "<deleteRelation name=\"" + relation.getName()
                    + "\"/>\n";

            // Note: The source is NOT the graph mode.
            MoMLChangeRequest request = new MoMLChangeRequest(this, container,
                    moml);
            request.setUndoable(true);
            container.requestChange(request);
        }
View Full Code Here

Examples of ptolemy.moml.MoMLChangeRequest

    private void _setPatternObject(NamedObj replacementObject,
            String patternObjectName, boolean mergeWithPrevious) {
        String moml = "<property name=\"patternObject\" value=\""
                + patternObjectName + "\"/>";
        MoMLChangeRequest request = new MoMLChangeRequest(this,
                replacementObject, moml);
        request.setUndoable(true);
        request.setMergeWithPreviousUndo(mergeWithPrevious);
        replacementObject.requestChange(request);
    }
View Full Code Here

Examples of ptolemy.moml.MoMLChangeRequest

                    // other link.  This avoids turning a direct connection
                    // into a half connection with a diamond.
                    // Note that the source is NOT the graphmodel, so this
                    // will trigger the changerequest listener to
                    // redraw the graph again.
                    MoMLChangeRequest request = new MoMLChangeRequest(
                            container, container, "<deleteRelation name=\""
                                    + relation.getName(container) + "\"/>\n");
                    request.setUndoable(true);

                    // Need to merge the undo for this request in with one that
                    // triggered it
                    request.setMergeWithPreviousUndo(true);
                    container.requestChange(request);

                    // If updating requires further updates to the model
                    // i.e. the above change request, then return false.
                    // this is so that rerendering doesn't happen until the
View Full Code Here

Examples of ptolemy.moml.MoMLChangeRequest

                .attributeList(MatchResultTableau.Factory.class);
        for (Object attributeObject : factoryList) {
            MatchResultTableau.Factory factory = (MatchResultTableau.Factory) attributeObject;
            String momlTxt = "<deleteProperty name=\"" + factory.getName()
                    + "\"/>";
            MoMLChangeRequest request = new MoMLChangeRequest(originator,
                    entity, momlTxt);
            entity.requestChange(request);
        }
        for (Object subentity : entity.entityList(CompositeEntity.class)) {
            _unsetTableauFactory(originator, (CompositeEntity) subentity);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.