[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Instance.java, 1.9, 1.10 Component.j
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2009-06-26 14:06:22
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9672/src/net/sourceforge/bprocessor/model Modified Files: Instance.java Component.java Log Message: Instance work Index: Instance.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Instance.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Instance.java 25 Jun 2009 22:17:29 -0000 1.9 --- Instance.java 26 Jun 2009 12:39:50 -0000 1.10 *************** *** 56,66 **** */ public void setProto(Space space) { ! this.proto = space; ! if (proto != null) { ! if (anchor == null) { ! this.anchor = Project.getInstance().getActiveCoordinateSystem().copy(); ! } ! } else { ! this.anchor = null; } } --- 56,62 ---- */ public void setProto(Space space) { ! proto = space; ! if (anchor == null) { ! this.anchor = Project.getInstance().getActiveCoordinateSystem().copy(); } } *************** *** 71,82 **** */ public CoordinateSystem getInstanceAnchor() { ! if (isInstance()) { ! if (anchor == null) { ! anchor = Project.getInstance().getActiveCoordinateSystem().copy(); ! } ! return anchor; ! } else { ! return null; ! } } --- 67,71 ---- */ public CoordinateSystem getInstanceAnchor() { ! return anchor; } Index: Component.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Component.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Component.java 25 Jun 2009 22:17:30 -0000 1.7 --- Component.java 26 Jun 2009 12:39:50 -0000 1.8 *************** *** 105,108 **** --- 105,118 ---- this.isLocked = isLocked; } + + /** + * Create an instance of this component + * @return new instance + */ + public Instance makeInstance() { + Instance instance = new Instance(space.getName() + " instance "); + instance.setProto(space); + return instance; + } /** *************** *** 202,205 **** --- 212,218 ---- public void setName(String name) { this.name = name; + if (space != null) { + space.setName(name); + } } |