// File: ActionCreateConstEdge.java // Classes: ActionCreateConstEdge // Original Author:Kedar Patankar - Alberto Medina // Date 21 Jan 1997 package uci.graphedit; import gjt.DialogClient; import java.awt.Dialog; public class ActionCreateConstEdge extends Action implements DialogClient { private NetArc _edge; private NetNode _s,_d; public ActionCreateConstEdge(Editor editor,NetArc n,NetNode s,NetNode d) { super(editor); _edge=n; _s=s;_d=d; } public String name() { return "Create Construction Edge"; } /** Actually instanciate the NetNode and Perspective objects and * set the global next mode to ModePlace */ public void doIt() { ConstEdgeDialog dialog = new ConstEdgeDialog(_editor,this,"Enter Edge Info"); dialog.show(); } public void undoIt() { } public void dialogDismissed (Dialog dl) { Document _document=_editor.curDocument(); String _name = ((ConstEdgeDialog)dl).get_edge_name(); String _card = ((ConstEdgeDialog)dl).get_cardinality(); _edge.connect(_s,_d); _edge.setId(_document.nextId()); ArcPerspective ap= new ArcPerspective(_edge,_name,_card); _document.add(ap); ap.reorder(ActionReorder.SEND_TO_BACK, _document.view()); _document.selectItem(ap); } } /* end class ActionCreateConstEdge */