Author: lgiessmann Date: Mon Jul 11 08:07:34 2011 New Revision: 598
Log: gdl-frontend: Widgets: implemented the method GdlView.getStartElement that returns the a topic that represents the first visible object within a GdlView instance
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDateTimePicker.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java Mon Jul 11 08:07:34 2011 (r598) @@ -0,0 +1,15 @@ +package us.isidor.gdl.anaToMia.Widgets.base; + +import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic; + +public class GdlPosition implements GdlDescriptor { + + + + @Override + public Topic getTmRepresentative() { + // TODO Auto-generated method stub + return null; + } + +}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java Mon Jul 11 06:50:59 2011 (r597) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java Mon Jul 11 08:07:34 2011 (r598) @@ -200,7 +200,7 @@ public final static String gdlPosition = gdl + "position"; public final static String gdlNthPosition = gdl + "nth-position"; public final static String gdlButtonPosition = gdl + "button-position"; - public final static String gdlTmbinding = gdl + "tm-binding"; + public final static String gdlTmBinding = gdl + "tm-binding"; public final static String gdlViewBinding = gdl + "view-binding"; }
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Mon Jul 11 06:50:59 2011 (r597) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Mon Jul 11 08:07:34 2011 (r598) @@ -1,13 +1,21 @@ package us.isidor.gdl.anaToMia.Widgets.base;
+import java.util.ArrayList; + import us.isidor.gdl.anaToMia.TmEngine.jtmsBasedEngine.JtmsTmEngine; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic; +import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap; +import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes; import us.isidor.gdl.anaToMia.Widgets.complexData.GdlDatePicker; import us.isidor.gdl.anaToMia.Widgets.container.GdlUnit; +import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException; +import us.isidor.gdl.anaToMia.Widgets.environment.Pair; import us.isidor.gdl.anaToMia.Widgets.isidorus.LoadSchemaCallback; import us.isidor.gdl.anaToMia.Widgets.values.CursorValue; +import us.isidor.gdl.anaToMia.Widgets.views.GdlView; + import com.google.gwt.core.client.EntryPoint; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; @@ -143,7 +151,38 @@ - GdlDatePicker tmp = new GdlDatePicker(tmpRepresentative); + GdlView tmp = new GdlView(tmpRepresentative) { + + @Override + public boolean validate() { + // TODO Auto-generated method stub + return false; + } + + @Override + public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() { + // TODO Auto-generated method stub + return null; + } + + @Override + public ArrayList<String> getStringValue() { + // TODO Auto-generated method stub + return null; + } + + @Override + public void append(GdlVisibleObject ancestor, GdlVisibleObject descendant)throws InvalidGdlSchemaException { + // TODO Auto-generated method stub + + } + + @Override + public TopicMap getContent() { + // TODO Auto-generated method stub + return null; + } + }; this.mainPanel.add(tmp); }catch(Exception e){ e.printStackTrace();
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDateTimePicker.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDateTimePicker.java Mon Jul 11 06:50:59 2011 (r597) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDateTimePicker.java Mon Jul 11 08:07:34 2011 (r598) @@ -2,4 +2,5 @@
public class GdlDateTimePicker extends GdlComplexData { // TODO: implement + }
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Mon Jul 11 06:50:59 2011 (r597) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Mon Jul 11 08:07:34 2011 (r598) @@ -1,5 +1,7 @@ package us.isidor.gdl.anaToMia.Widgets.views;
+import java.util.ArrayList; + import com.google.gwt.dom.client.Style.Float; import com.google.gwt.dom.client.Style.Overflow; import com.google.gwt.event.dom.client.BlurEvent; @@ -16,12 +18,14 @@ import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap; +import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes; import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject; import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler; import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException; import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler; import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler; import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException; +import us.isidor.gdl.anaToMia.Widgets.environment.Pair; import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue; import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue; import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue; @@ -420,4 +424,16 @@ }
+ @Override + public ArrayList<String> getStringValue() { + // TODO Auto-generated method stub + return null; + } + + @Override + public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() { + // TODO Auto-generated method stub + return null; + } + }
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Mon Jul 11 06:50:59 2011 (r597) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Mon Jul 11 08:07:34 2011 (r598) @@ -1,5 +1,7 @@ package us.isidor.gdl.anaToMia.Widgets.views;
+import java.util.ArrayList; + import com.google.gwt.event.dom.client.BlurEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.DomEvent; @@ -11,12 +13,14 @@ import com.google.gwt.user.client.ui.Widget; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap; +import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes; import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject; import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler; import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException; import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler; import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler; import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException; +import us.isidor.gdl.anaToMia.Widgets.environment.Pair; import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue; import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue; import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue; @@ -461,4 +465,18 @@ // TODO Auto-generated method stub } + + + @Override + public ArrayList<String> getStringValue() { + // TODO Auto-generated method stub + return null; + } + + + @Override + public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() { + // TODO Auto-generated method stub + return null; + } }
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Mon Jul 11 06:50:59 2011 (r597) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Mon Jul 11 08:07:34 2011 (r598) @@ -1,5 +1,7 @@ package us.isidor.gdl.anaToMia.Widgets.views;
+import java.util.ArrayList; + import com.google.gwt.dom.client.Style.Float; import com.google.gwt.dom.client.Style.Overflow; import com.google.gwt.event.dom.client.BlurEvent; @@ -16,12 +18,14 @@ import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap; +import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes; import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject; import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler; import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException; import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler; import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler; import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException; +import us.isidor.gdl.anaToMia.Widgets.environment.Pair; import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue; import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue; import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue; @@ -463,6 +467,20 @@ // TODO Auto-generated method stub } + + + @Override + public ArrayList<String> getStringValue() { + // TODO Auto-generated method stub + return null; + } + + + @Override + public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() { + // TODO Auto-generated method stub + return null; + }
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Mon Jul 11 06:50:59 2011 (r597) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Mon Jul 11 08:07:34 2011 (r598) @@ -1,5 +1,7 @@ package us.isidor.gdl.anaToMia.Widgets.views;
+import java.util.ArrayList; + import com.google.gwt.dom.client.Style.Float; import com.google.gwt.dom.client.Style.Overflow; import com.google.gwt.event.dom.client.BlurEvent; @@ -15,12 +17,14 @@ import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap; +import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes; import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject; import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler; import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException; import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler; import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler; import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException; +import us.isidor.gdl.anaToMia.Widgets.environment.Pair; import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue; import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue; import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue; @@ -464,5 +468,19 @@ // TODO Auto-generated method stub } + + + @Override + public ArrayList<String> getStringValue() { + // TODO Auto-generated method stub + return null; + } + + + @Override + public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() { + // TODO Auto-generated method stub + return null; + } }
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Mon Jul 11 06:50:59 2011 (r597) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Mon Jul 11 08:07:34 2011 (r598) @@ -1,5 +1,7 @@ package us.isidor.gdl.anaToMia.Widgets.views;
+import java.util.ArrayList; + import com.google.gwt.dom.client.Style.Float; import com.google.gwt.dom.client.Style.Overflow; import com.google.gwt.event.dom.client.BlurEvent; @@ -15,12 +17,14 @@ import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap; +import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes; import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject; import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler; import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException; import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler; import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler; import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException; +import us.isidor.gdl.anaToMia.Widgets.environment.Pair; import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue; import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue; import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue; @@ -466,5 +470,19 @@ // TODO Auto-generated method stub } + + + @Override + public ArrayList<String> getStringValue() { + // TODO Auto-generated method stub + return null; + } + + + @Override + public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() { + // TODO Auto-generated method stub + return null; + } }
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Mon Jul 11 06:50:59 2011 (r597) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Mon Jul 11 08:07:34 2011 (r598) @@ -1,101 +1,82 @@ package us.isidor.gdl.anaToMia.Widgets.views;
+import java.util.ArrayList; + import com.google.gwt.core.client.JsArray; -import com.google.gwt.dom.client.Style.Overflow; -import com.google.gwt.dom.client.Style.VerticalAlign; -import com.google.gwt.event.dom.client.BlurHandler; import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.event.dom.client.FocusHandler; -import com.google.gwt.event.dom.client.MouseDownHandler; -import com.google.gwt.event.dom.client.MouseOutHandler; -import com.google.gwt.event.dom.client.MouseOverHandler; -import com.google.gwt.event.dom.client.MouseUpHandler; -import com.google.gwt.user.client.ui.Widget;
-import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct; +import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Name; +import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Role; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap; import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis; import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject; import us.isidor.gdl.anaToMia.Widgets.base.IGdlContainer; +import us.isidor.gdl.anaToMia.Widgets.base.IGdlHasValue; import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException; import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException; -import us.isidor.gdl.anaToMia.Widgets.environment.MultipleHandlerRegistration; -import us.isidor.gdl.anaToMia.Widgets.values.ContentOrientationValue;
-public abstract class GdlView extends GdlVisibleObject implements IGdlContainer { - private String viewName = ""; - private TopicMap tm = null; - private Topic representative = null; - // TODO: implement - +public abstract class GdlView extends GdlVisibleObject implements IGdlContainer, IGdlHasValue { + protected GdlView(){ + super(); + } public GdlView(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{ super(tmRepresentative); - // TODO: implement } - protected void init(TopicMap tm, Topic representative) throws InvalidGdlSchemaException { - this.tm = tm; - this.representative = representative; - JsArray<Name> viewNames = representative.getNames(tm.getTopicBySubjectIdentifier(tm.createLocator(GdlPsis.NameType.gdlViewName))); + public String getViewName()throws InvalidGdlSchemaException { + JsArray<Name> viewNames = super.tmRepresentative.getNames(tm.getTopicBySubjectIdentifier(tm.createLocator(GdlPsis.NameType.gdlViewName))); if(viewNames.length() != 1){ throw new InvalidGdlSchemaException("A view must be bound to a " + GdlPsis.NameType.gdlViewName + " instance"); } - - this.viewName = viewNames.get(0).getValue(); + return viewNames.get(0).getValue(); } + - - public String getViewName(){ - return this.viewName; + public void registerButtonCallback(ClickHandler handler, String id){ + //TODO: implement } + - - public abstract boolean validate(); - - - public abstract TopicMap getContent(); - - - public abstract void registerButtonCallback(ClickHandler handler, String id); - - - public abstract void deregisterButtonCallback(ClickHandler handler, String id); - - - @Override - public void setVerticalAlign(Widget widget, VerticalAlign value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { + public void deregisterButtonCallback(ClickHandler handler, String id){ // TODO: implement } - - public void setContentOrientation(Widget widget, ContentOrientationValue value){ - // do nothing - since all content elements are positioned vie the GDL positioning concept + // Searches the topic that represents the first item that is playced within this view instance + // i.e. such an item must not have an association that is bound to it via a role of the type + // gdl:ancestor. + protected Topic getStartElement() throws InvalidGdlSchemaException { + JsArray<Role> roles = this.tmRepresentative.getRolesPlayed(this.tm.getTopicBySubjectIdentifier(tm.createLocator(GdlPsis.RoleType.gdlContainer)), this.tm.getTopicBySubjectIdentifier(tm.createLocator(GdlPsis.AssociationType.gdlContains))); + for(int i = 0; i != roles.length(); ++i){ + Association assoc = roles.get(i).getParent(); + JsArray<Role> assocRoles = assoc.getRoles(this.tm.getTopicBySubjectIdentifier(this.tm.createLocator(GdlPsis.RoleType.gdlContainee))); + ArrayList<Topic> topsWithoutAncestorPosAssoc = new ArrayList<Topic>(); + for(int j = 0; j != assocRoles.length(); ++j){ + Topic player = assocRoles.get(j).getPlayer(); + if(player.getRolesPlayed(this.tm.getTopicBySubjectIdentifier(this.tm.createLocator(GdlPsis.RoleType.gdlAncestor)), this.tm.getTopicBySubjectIdentifier(this.tm.createLocator(GdlPsis.AssociationType.gdlPosition))).length() == 0){ + topsWithoutAncestorPosAssoc.add(player); + } + } + if(topsWithoutAncestorPosAssoc.size() > 1){ + String foundTops = ""; + for (Topic topic : topsWithoutAncestorPosAssoc) { + foundTops += GdlPsis.getAnyIdOfTopic(topic) + ", "; + } + if(foundTops.length() >= 2)foundTops = foundTops.substring(0, foundTops.length() - 2); + throw new InvalidGdlSchemaException("A " + GdlPsis.TopicType.gdlView + " must have maximal one item that is desiganted to tbe the first item in this view, i.e. there must be zero or one items without being bound to a " + GdlPsis.RoleType.gdlAncestor + " but found: " + foundTops); + } else if(topsWithoutAncestorPosAssoc.size() == 1){ + return topsWithoutAncestorPosAssoc.get(0); + } + } + return null; } - - - - - // TODO: implement addXYZhandler(handler, id); - - - - // hierarchy - // - // => Default-Topic-View => Default-Creator-Topic-View - // => Default-Editor-Topic-View - // => Topic-View - // => Special-Topic-view => Special-Creator-Topic-view - // => Special-Editor-Topic-View - // Visible-Object => View - // - // => Association-view => Creator-Association-view - // => Editor-Association-View -} + + public abstract TopicMap getContent(); +} \ No newline at end of file