View Javadoc
1 package com.bonevich.erj.ui; 2 3 import com.bonevich.erj.model.*; 4 import com.bonevich.erj.diagram.*; 5 6 import org.tigris.gef.base.*; 7 import org.tigris.gef.graph.*; 8 9 import java.util.*; 10 11 public class CmdCreateRelation extends CmdCreateNode 12 { 13 //////////////////////////////////////////////////////////////// 14 // constants 15 public CmdCreateRelation(Hashtable args, String name) 16 { 17 super(args,name); 18 } 19 public CmdCreateRelation(Class nodeClass, String name) 20 { 21 super(nodeClass,name); 22 } 23 public CmdCreateRelation(Class nodeClass, boolean sticky, String name) 24 { 25 super(nodeClass,sticky,name); 26 } 27 public CmdCreateRelation() 28 { 29 this(Relation.class, "Relation"); 30 } 31 32 public void doIt() 33 { 34 super.doIt(); 35 Globals.mode(new ModeCreateRelation(this), true); 36 } 37 38 public Object makeNode() 39 { 40 Editor ce = Globals.curEditor(); 41 GraphModel gm = ce.getGraphModel(); 42 if ( !(gm instanceof ERDiagramGraphModel) ) 43 { 44 return null; 45 } 46 47 Schema s = ((ERDiagramGraphModel)gm).getSchema(); 48 Object newNode = s.createRelation(); 49 return newNode; 50 } 51 52 }

This page was automatically generated by Maven