Author: lgiessmann Date: Thu Jul 14 02:42:52 2011 New Revision: 617
Log: gdl-frontend: Widgets: implemented getStartEement for GdlView, GdlUnit and GdlList
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlContainer.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlCreatorAssociationView.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlDefaultCreatorTopicView.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlEditorAssociationView.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialCreatorTopicView.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialEditorTopicView.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlContainer.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlContainer.java Thu Jul 14 02:40:28 2011 (r616) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlContainer.java Thu Jul 14 02:42:52 2011 (r617) @@ -6,6 +6,6 @@
public interface IGdlContainer { - public void append(GdlVisibleObject widget) throws InvalidGdlSchemaException; + public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException; public ArrayList<Topic> contains() throws InvalidGdlSchemaException; }
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Thu Jul 14 02:40:28 2011 (r616) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Thu Jul 14 02:42:52 2011 (r617) @@ -314,17 +314,28 @@
// returns the topic that represetns the first item of a container, that means this item is // not bound to an association o fthe type position in a role of the type descendant - public static Topic getFirstContainee(ArrayList<Topic> containees) throws InvalidGdlSchemaException { - if(containees == null || containees.size() == 0) return null; + public static Topic getFirstContainee(Topic container, ArrayList<Topic> containees) throws InvalidGdlSchemaException { + if(containees == null || containees.size() == 0 || container == null) return null; ArrayList<Topic> topicsWithoutAncestor = new ArrayList<Topic>(); TopicMap tm = containees.get(0).getTopicMap(); - Topic descendant = getTopicByPsi(GdlPsis.RoleType.gdlDescendant, tm); + Topic descendantRoleType = getTopicByPsi(GdlPsis.RoleType.gdlDescendant, tm); Topic position = getTopicByPsi(GdlPsis.AssociationType.gdlPosition, tm); Topic visibleObject = getTopicByPsi(GdlPsis.TopicType.gdlVisibleObject, tm); - Topic ancestor = getTopicByPsi(GdlPsis.RoleType.gdlAncestor, tm); - for (Topic containee : containees) - if(null == getOtherPlayerOfBinaryAssociation(containee, descendant, position, null, visibleObject, ancestor)) topicsWithoutAncestor.add(containee); + Topic ancestorRoleType = getTopicByPsi(GdlPsis.RoleType.gdlAncestor, tm); + for (Topic containee : containees){ + ArrayList<Topic> ancestors = getOtherPlayerOfBinaryAssociation(containee, descendantRoleType, position, null, visibleObject, ancestorRoleType); + if(ancestors.size() != 1){ + String top = getAnyIdOfTopic(container); + String bindings = ""; + for (Topic topic : ancestors) bindings += ", " + getAnyIdOfTopic(topic); + if(bindings.length() == 0) bindings = "[]"; + else bindings = bindings.substring(2); + throw new InvalidGdlSchemaException("the topic " + top + " must be boundto exaclty one ancestor element, but found " + bindings); + } else { + if(ancestors.get(0).equals(container))topicsWithoutAncestor.add(containee); + } + } if(topicsWithoutAncestor.size() > 1){ String values = "";
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java Thu Jul 14 02:40:28 2011 (r616) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java Thu Jul 14 02:42:52 2011 (r617) @@ -377,9 +377,10 @@
@Override - public void append(GdlVisibleObject widget) throws InvalidGdlSchemaException { + public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException { // TODO Auto-generated method stub + return null; }
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java Thu Jul 14 02:40:28 2011 (r616) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java Thu Jul 14 02:42:52 2011 (r617) @@ -1253,8 +1253,9 @@ @Override - public void append(GdlVisibleObject widget) throws InvalidGdlSchemaException { + public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException { // TODO: implement + return null; }
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlCreatorAssociationView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlCreatorAssociationView.java Thu Jul 14 02:40:28 2011 (r616) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlCreatorAssociationView.java Thu Jul 14 02:42:52 2011 (r617) @@ -429,12 +429,4 @@ // TODO Auto-generated method stub return null; } - - @Override - public void append(GdlVisibleObject widget) - throws InvalidGdlSchemaException { - // TODO Auto-generated method stub - - } - }
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlDefaultCreatorTopicView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlDefaultCreatorTopicView.java Thu Jul 14 02:40:28 2011 (r616) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlDefaultCreatorTopicView.java Thu Jul 14 02:42:52 2011 (r617) @@ -473,12 +473,4 @@ // TODO Auto-generated method stub return null; } - - - @Override - public void append(GdlVisibleObject widget) - throws InvalidGdlSchemaException { - // TODO Auto-generated method stub - - } }
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlEditorAssociationView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlEditorAssociationView.java Thu Jul 14 02:40:28 2011 (r616) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlEditorAssociationView.java Thu Jul 14 02:42:52 2011 (r617) @@ -474,15 +474,4 @@ // TODO Auto-generated method stub return null; } - - - @Override - public void append(GdlVisibleObject widget) - throws InvalidGdlSchemaException { - // TODO Auto-generated method stub - - } - - - }
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialCreatorTopicView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialCreatorTopicView.java Thu Jul 14 02:40:28 2011 (r616) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialCreatorTopicView.java Thu Jul 14 02:42:52 2011 (r617) @@ -477,13 +477,4 @@ // TODO Auto-generated method stub return null; } - - - @Override - public void append(GdlVisibleObject widget) - throws InvalidGdlSchemaException { - // TODO Auto-generated method stub - - } - }
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialEditorTopicView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialEditorTopicView.java Thu Jul 14 02:40:28 2011 (r616) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialEditorTopicView.java Thu Jul 14 02:42:52 2011 (r617) @@ -478,14 +478,5 @@ public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() { // TODO Auto-generated method stub return null; - } - - - @Override - public void append(GdlVisibleObject widget) - throws InvalidGdlSchemaException { - // TODO Auto-generated method stub - - } - + } }
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java Thu Jul 14 02:40:28 2011 (r616) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java Thu Jul 14 02:42:52 2011 (r617) @@ -81,14 +81,17 @@ } - public void append(GdlVisibleObject widget) throws InvalidGdlSchemaException{ + // creates a GdlVisbleObject instance of the passed topic current and inserts it + // by using it's defined position style depending on the GdlVisibleObject + // represented by ancestor. If ancestor is null current is the first topic + @Override + public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException { + // TODO: getFirstContainee => change the behavior of getting the first topic + // TODO: implement - } - - - public void append(Topic widget) throws InvalidGdlSchemaException { - // TODO: implement - // TODO: use GdlInstantiator + + + return null; }