Author: dazarov
Date: 2007-07-10 13:10:55 -0400 (Tue, 10 Jul 2007)
New Revision: 2375
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/Shape.java
Log:
http://jira.jboss.com/jira/browse/EXIN-367
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-07-10
16:57:00 UTC (rev 2374)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-07-10
17:10:55 UTC (rev 2375)
@@ -344,6 +344,7 @@
Collection collection = (Collection)property.getValue();
Value component = collection.getElement();
if (component instanceof Component) {
+ getOrCreateComponentClass(property);
} else if (collection.isOneToMany()) {
OneToMany comp = (OneToMany)((Collection)property.getValue()).getElement();
if (component != null){
@@ -363,7 +364,7 @@
elements.remove(reference);
componentShape.setReference(null);
}
- //setDirty(true);
+ removeLinks(componentShape);
firePropertyChange(REFRESH, null, null);
}
@@ -372,18 +373,16 @@
for(int i=shape.getSourceConnections().size()-1;i>=0;i--){
con = shape.getSourceConnections().get(i);
con.getTarget().getTargetConnections().remove(con);
- shape.getSourceConnections().remove(i);
+ shape.getSourceConnections().remove(con);
}
for(int i=shape.getTargetConnections().size()-1;i>=0;i--){
con = shape.getTargetConnections().get(i);
con.getSource().getSourceConnections().remove(con);
- shape.getTargetConnections().remove(i);
+ shape.getTargetConnections().remove(con);
}
for(int i=shape.getChildren().size()-1;i>=0;i--){
removeLinks((Shape)shape.getChildren().get(i));
}
- //if(shape.getParent() != null)shape.getParent().getChildren().remove(shape);
- //elements.remove(shape);
}
protected void refreshComponentReferences(ComponentShape componentShape) {
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/Shape.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/Shape.java 2007-07-10
16:57:00 UTC (rev 2374)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/Shape.java 2007-07-10
17:10:55 UTC (rev 2375)
@@ -43,11 +43,11 @@
public List<Connection> getSourceConnections() {
- return new ArrayList<Connection>(sourceConnections);
+ return sourceConnections;
}
public List<Connection> getTargetConnections() {
- return new ArrayList<Connection>(targetConnections);
+ return targetConnections;
}
public Object getOrmElement() {