isidorus-cvs
Threads by month
- ----- 2025 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- 1037 discussions

[isidorus-cvs] r779 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base environment text view
by lgiessmann@common-lisp.net 25 Aug '11
by lgiessmann@common-lisp.net 25 Aug '11
25 Aug '11
Author: lgiessmann
Date: Thu Aug 25 03:02:58 2011
New Revision: 779
Log:
gdl-frontend: Widgets: implemented the consumption of role playes of GdlText within GdlAssociationView instances
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlHasValueGroup.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/environment/GdlInstantiator.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.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/GdlEditorAssociationView.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlHasValueGroup.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlHasValueGroup.java Wed Aug 24 08:47:02 2011 (r778)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlHasValueGroup.java Thu Aug 25 03:02:58 2011 (r779)
@@ -40,7 +40,7 @@
// returns all possible topics that can be used as values for this value group.
// Note, since gdl:Default-TM-Value is treated as a usual value,
- // default vaues are also returned by this function
+ // default values are also returned by this function
public ArrayList<Topic> getTmValues() throws InvalidGdlSchemaException;
// returns all possible literals that can be used as values for this value group.
@@ -66,7 +66,7 @@
// returns the Topic that represents the constraint, which is used to
// determine the topic's display-schema
- public Topic getDisplayByConstraintOfValueGroup() throws InvalidGdlSchemaException;
+ public Topic getDisplayByOfValueGroup() throws InvalidGdlSchemaException;
// Returns a list of topics that represent the topic's preferred scope(s)
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 Wed Aug 24 08:47:02 2011 (r778)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Thu Aug 25 03:02:58 2011 (r779)
@@ -651,7 +651,7 @@
// returns the constrained role and player types of the passed constraint
- public static Pair<Topic, Topic> getConstraintRoleAndPlayerTypeOfConstraint(Topic topicRoleConstraint) throws InvalidGdlSchemaException {
+ public static Pair<Topic, Topic> getConstrainedRoleAndPlayerTypeOfConstraint(Topic topicRoleConstraint) throws InvalidGdlSchemaException {
if(topicRoleConstraint == null) return null;
TopicMap tm = topicRoleConstraint.getTopicMap();
@@ -668,25 +668,25 @@
// return a pair that contains again two pair instances, whereas each pair
// represents a role type and a role player. The outer pair represents a valid
// combination of roles of a role-combination-constraint.
- public static Pair<Pair<Topic, Topic>, Pair<Topic, Topic>> getRoleCombinationsOfConstraint(Topic roleCombinationconstraint) throws InvalidGdlSchemaException {
- if(roleCombinationconstraint == null) return null;
+ public static Pair<Pair<Topic, Topic>, Pair<Topic, Topic>> getRoleCombinationsOfConstraint(Topic roleCombinationConstraint) throws InvalidGdlSchemaException {
+ if(roleCombinationConstraint == null) return null;
- TopicMap tm = roleCombinationconstraint.getTopicMap();
+ TopicMap tm = roleCombinationConstraint.getTopicMap();
Topic constraintRoleType = getTopicByPsi(PSIs.TMCL.tmclConstraint, tm);
Topic constrainedRoleAssocType = getTopicByPsi(PSIs.TMCL.tmclConstrainedRole, tm);
Topic constrainedRoleType = getTopicByPsi(PSIs.TMCL.tmclConstrained, tm);
- ArrayList<Topic> roleTypes = getOtherPlayerOfBinaryAssociation(roleCombinationconstraint, constraintRoleType, constrainedRoleAssocType, null, constrainedRoleType);
- if(roleTypes.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(roleCombinationconstraint) + " must be bound exactly once to a role-type via a " + PSIs.TMCL.tmclConstrainedRole + ", but is: " + roleTypes.size());
+ ArrayList<Topic> roleTypes = getOtherPlayerOfBinaryAssociation(roleCombinationConstraint, constraintRoleType, constrainedRoleAssocType, null, constrainedRoleType);
+ if(roleTypes.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(roleCombinationConstraint) + " must be bound exactly once to a role-type via a " + PSIs.TMCL.tmclConstrainedRole + ", but is: " + roleTypes.size());
Topic constrainedTopicTypeAssocType = getTopicByPsi(PSIs.TMCL.tmclConstrainedTopicType, tm);
- ArrayList<Topic> playerTypes = getOtherPlayerOfBinaryAssociation(roleCombinationconstraint, constraintRoleType, constrainedTopicTypeAssocType, null, constrainedRoleType);
- if(playerTypes.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(roleCombinationconstraint) + " must be bound exactly once to a topic-type via a " + PSIs.TMCL.tmclConstrainedTopicType + ", but is: " + playerTypes.size());
+ ArrayList<Topic> playerTypes = getOtherPlayerOfBinaryAssociation(roleCombinationConstraint, constraintRoleType, constrainedTopicTypeAssocType, null, constrainedRoleType);
+ if(playerTypes.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(roleCombinationConstraint) + " must be bound exactly once to a topic-type via a " + PSIs.TMCL.tmclConstrainedTopicType + ", but is: " + playerTypes.size());
Topic otherConstrainedRoleAssocType = getTopicByPsi(PSIs.TMCL.tmclOtherConstrainedRole, tm);
- ArrayList<Topic> otherRoleTypes = getOtherPlayerOfBinaryAssociation(roleCombinationconstraint, constraintRoleType, otherConstrainedRoleAssocType, null, constrainedRoleType);
- if(otherRoleTypes.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(roleCombinationconstraint) + " must be bound exactly once to an other-role-type via a " + PSIs.TMCL.tmclOtherConstrainedRole + ", but is: " + otherRoleTypes.size());
+ ArrayList<Topic> otherRoleTypes = getOtherPlayerOfBinaryAssociation(roleCombinationConstraint, constraintRoleType, otherConstrainedRoleAssocType, null, constrainedRoleType);
+ if(otherRoleTypes.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(roleCombinationConstraint) + " must be bound exactly once to an other-role-type via a " + PSIs.TMCL.tmclOtherConstrainedRole + ", but is: " + otherRoleTypes.size());
Topic otherConstrainedTopicTypeRoleType = getTopicByPsi(PSIs.TMCL.tmclOtherConstrainedTopicType, tm);
- ArrayList<Topic> otherPlayerType = getOtherPlayerOfBinaryAssociation(roleCombinationconstraint, constraintRoleType, otherConstrainedTopicTypeRoleType, null, constrainedRoleType);
- if(otherPlayerType.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(roleCombinationconstraint) + " must be bound exactly once to an other-topic-type via a " + PSIs.TMCL.tmclOtherConstrainedTopicType + ", but is: " + otherPlayerType.size());
+ ArrayList<Topic> otherPlayerType = getOtherPlayerOfBinaryAssociation(roleCombinationConstraint, constraintRoleType, otherConstrainedTopicTypeRoleType, null, constrainedRoleType);
+ if(otherPlayerType.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(roleCombinationConstraint) + " must be bound exactly once to an other-topic-type via a " + PSIs.TMCL.tmclOtherConstrainedTopicType + ", but is: " + otherPlayerType.size());
Pair<Topic, Topic> firstRole = new Pair<Topic, Topic>(roleTypes.get(0), playerTypes.get(0));
Pair<Topic, Topic> secondRole = new Pair<Topic, Topic>(otherRoleTypes.get(0), otherPlayerType.get(0));
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/GdlInstantiator.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/GdlInstantiator.java Wed Aug 24 08:47:02 2011 (r778)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/GdlInstantiator.java Thu Aug 25 03:02:58 2011 (r779)
@@ -100,9 +100,9 @@
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlSpecialEditorTopicView)){
return new GdlSpecialEditorTopicView(tmRepresentative, (Topic)receivedData);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlCreatorAssociationview)){
- return new GdlCreatorAssociationView(tmRepresentative, (Association)receivedData);
+ return new GdlCreatorAssociationView(tmRepresentative, (Topic)receivedData);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlEditorAssociationView)){
- return new GdlEditorAssociationView(tmRepresentative, (Association)receivedData);
+ return new GdlEditorAssociationView(tmRepresentative, (Topic)receivedData);
}else{
String values = "";
for(int i = 0; i != tmRepresentative.getTypes().length(); ++i){
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Aug 24 08:47:02 2011 (r778)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Aug 25 03:02:58 2011 (r779)
@@ -14,10 +14,13 @@
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.Widget;
+
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Reifiable;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.ReifiableStub;
+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.ButtonableObject;
@@ -130,15 +133,23 @@
for(int i = 0; i != ((Topic)this.receivedData).getOccurrences(occurrenceType).length(); ++i)
this.createNewTextArea().setText(((Topic)this.receivedData).getOccurrences(occurrenceType).get(i).getValue());
} else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.GDL.TopicType.gdlRolePlayer)){
- this.createNewTextArea().setText("gdl:Role-Player instance");
- // TODO: search role => role-type + role-player
- // TODO: display the correponding value
+ if(!(receivedData instanceof Association)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to an Association, but is: " + receivedData.getClass());
+ if(this.getRootConstraint() == null || !TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclTopicRoleConstraint)) throw new InvalidGdlSchemaException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a root constraint of the type " + PSIs.TMCL.tmclTopicRoleConstraint + ", but ist bound to the root topic: " + (this.getRootConstraint() == null ? "null" : TmHelper.getAnyIdOfTopic(this.getRootConstraint())));
+
+ Pair<Topic, Topic> roleAndPlayerType = TmHelper.getConstrainedRoleAndPlayerTypeOfConstraint(this.getRootConstraint());
+ JsArray<Role> assocRoles = ((Association)this.receivedData).getRoles(roleAndPlayerType.getFirst());
+ for(int i = 0; i != assocRoles.length(); ++i){
+ if(TmHelper.isInstanceOf(assocRoles.get(i).getPlayer(), roleAndPlayerType.getSecond())){
+ this.createNewTextArea().setText(this.getTopicRepresentation(assocRoles.get(i).getPlayer(), this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup()));
+ }
+ }
}
// TODO: implement type, variant, datatype, associations, roles, ... constraints
+ // TODO: move method to GdlVisibleObject
}
- // sets the field for the set default value or sets at least one empty field
+ // sets the field for the set default value or sets at least one empty field (card-min)
protected void setDefaultValue() throws InvalidGdlSchemaException, ExecutionException {
if(this.getDefaultLiteralValue() != null && this.getDefaultTmValue() != null) throw new InvalidGdlSchemaException("the topic " + TmHelper.getAnyIdOfTopic(this.getValueGroup()) + " must be bound to maximal one " + PSIs.GDL.TopicType.gdlDefaultValue + ", but is: 2");
@@ -1052,7 +1063,7 @@
@Override
- public Topic getDisplayByConstraintOfValueGroup() throws InvalidGdlSchemaException {
+ public Topic getDisplayByOfValueGroup() throws InvalidGdlSchemaException {
if(this.displayByConstraintSet){
return this.displayByConstraint;
} else {
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java Wed Aug 24 08:47:02 2011 (r778)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java Thu Aug 25 03:02:58 2011 (r779)
@@ -39,7 +39,7 @@
}
- public GdlAssociationView(Topic tmRepresentative, Association receivedData) throws InvalidGdlSchemaException, ExecutionException {
+ public GdlAssociationView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException {
super(tmRepresentative, receivedData);
}
@@ -116,7 +116,7 @@
ArrayList<Pair<Topic, Topic>> roleTypesOfTopicRoleConstraints = new ArrayList<Pair<Topic, Topic>>();
for (Topic constraint : this.getTopicRoleConstraints()){
- Pair<Topic, Topic> roleAndPlayerType = TmHelper.getConstraintRoleAndPlayerTypeOfConstraint(constraint);
+ Pair<Topic, Topic> roleAndPlayerType = TmHelper.getConstrainedRoleAndPlayerTypeOfConstraint(constraint);
if(!roleTypesOfTopicRoleConstraints.contains(roleAndPlayerType)) roleTypesOfTopicRoleConstraints.add(roleAndPlayerType);
}
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 Wed Aug 24 08:47:02 2011 (r778)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlCreatorAssociationView.java Thu Aug 25 03:02:58 2011 (r779)
@@ -1,6 +1,5 @@
package us.isidor.gdl.anaToMia.Widgets.view;
-import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
@@ -9,7 +8,7 @@
public class GdlCreatorAssociationView extends GdlAssociationView {
- public GdlCreatorAssociationView(Topic tmRepresentative, Association receivedData) throws InvalidGdlSchemaException, ExecutionException {
+ public GdlCreatorAssociationView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException {
super(tmRepresentative, receivedData);
// TODO Auto-generated constructor 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 Wed Aug 24 08:47:02 2011 (r778)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlEditorAssociationView.java Thu Aug 25 03:02:58 2011 (r779)
@@ -3,7 +3,6 @@
import java.util.ArrayList;
import com.google.gwt.core.client.JsArray;
-
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Role;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
@@ -19,13 +18,14 @@
protected boolean associationsToRepresentSet = false;
- public GdlEditorAssociationView(Topic tmRepresentative, Association receivedData) throws InvalidGdlSchemaException, ExecutionException {
+ public GdlEditorAssociationView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException {
super(tmRepresentative, receivedData);
// create an association item for each association that must be represetned
// by this view
- for (int i = 0; i != this.getAssociationsToRepresent().size(); ++i)
+ for (int i = 0; i != this.getAssociationsToRepresent().size(); ++i){
this.addToContainerPanel(new AssociationItem(this.tmRepresentative, this.getAssociationsToRepresent().get(i), i));
+ }
}
@@ -103,18 +103,12 @@
// returns an array with associations that
// must be represented by this association view
private ArrayList<Association> filterAssociations() throws InvalidGdlSchemaException {
- if(this.receivedData instanceof Association){
- this.associationsToRepresent = new ArrayList<Association>();
- this.associationsToRepresent.add((Association)this.receivedData);
- return this.associationsToRepresent;
- } else {
- ArrayList<Association> filteredAssociations = this.filterAssociationsByType();
- filteredAssociations = this.filterAssociationsByRoleAndPlayerTypes(filteredAssociations);
- this.checkAssociationsByRoleCombinations(filteredAssociations);
- this.associationsToRepresent = filteredAssociations;
- this.associationsToRepresentSet = true;
- return this.associationsToRepresent;
- }
+ ArrayList<Association> filteredAssociations = this.filterAssociationsByType();
+ filteredAssociations = this.filterAssociationsByRoleAndPlayerTypes(filteredAssociations);
+ this.checkAssociationsByRoleCombinations(filteredAssociations);
+ this.associationsToRepresent = filteredAssociations;
+ this.associationsToRepresentSet = true;
+ return this.associationsToRepresent;
}
1
0

[isidorus-cvs] r778 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base button complexData container environment text view
by lgiessmann@common-lisp.net 24 Aug '11
by lgiessmann@common-lisp.net 24 Aug '11
24 Aug '11
Author: lgiessmann
Date: Wed Aug 24 08:47:02 2011
New Revision: 778
Log:
gdl-frontend: Widgets: changed the PSIs class
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPanel.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.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/button/GdlActionButton.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlAudio.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlImage.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlVideo.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/environment/GdlInstantiator.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlListBox.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.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/GdlPanel.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPanel.java Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPanel.java Wed Aug 24 08:47:02 2011 (r778)
@@ -42,7 +42,7 @@
// the topic map that is the base of the created GDL view
private TopicMap requestedSchemaTm = null;
// the locator of the topic map "requestedSchemaTm"
- private final String REQUESTED_SCHEMA_TOPIC_MAP_LOCATOR = PSIs.gdl + "topicmap/tm-1";
+ private final String REQUESTED_SCHEMA_TOPIC_MAP_LOCATOR = PSIs.GDL.gdl + "topicmap/tm-1";
// callback instance for getting/loading the GDL schema
private ILoadSchemaCallback loadSchemaCallback = null;
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java Wed Aug 24 08:47:02 2011 (r778)
@@ -64,7 +64,7 @@
public AutoNumUnitValue getTop() throws InvalidGdlSchemaException {
Occurrence topOcc = null;
- topOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlTop);
+ topOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlTop);
if(topOcc == null) return null;
else return new AutoNumUnitValue(topOcc.getValue());
@@ -73,7 +73,7 @@
public AutoNumUnitValue getRight() throws InvalidGdlSchemaException {
Occurrence rightOcc = null;
- rightOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlRight);
+ rightOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlRight);
if(rightOcc == null) return null;
else return new AutoNumUnitValue(rightOcc.getValue());
@@ -82,7 +82,7 @@
public AutoNumUnitValue getBottom() throws InvalidGdlSchemaException {
Occurrence bottomOcc = null;
- bottomOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBottom);
+ bottomOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBottom);
if(bottomOcc == null) return null;
else return new AutoNumUnitValue(bottomOcc.getValue());
@@ -91,7 +91,7 @@
public AutoNumUnitValue getLeft() throws InvalidGdlSchemaException {
Occurrence leftOcc = null;
- leftOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlLeft);
+ leftOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlLeft);
if(leftOcc == null) return null;
else return new AutoNumUnitValue(leftOcc.getValue());
@@ -100,7 +100,7 @@
public PositionStyleValue getPositionStyle()throws InvalidGdlSchemaException {
Occurrence positionStyleOcc = null;
- positionStyleOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlPositionStyle);
+ positionStyleOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlPositionStyle);
if(positionStyleOcc == null) return null;
else try{
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Wed Aug 24 08:47:02 2011 (r778)
@@ -225,9 +225,9 @@
// returns the string value of a gdl:id occurrence
public String getId() throws InvalidGdlSchemaException {
- JsArray<Occurrence> idOccs = getOccurrences(PSIs.OccurrenceType.gdlId);
+ JsArray<Occurrence> idOccs = getOccurrences(PSIs.GDL.OccurrenceType.gdlId);
if(idOccs.length() != 1){
- throw new InvalidGdlSchemaException("The topic " + TmHelper.getAnyIdOfTopic(this.tmRepresentative) + " must be bound to exactly one occurrence of the type " + PSIs.OccurrenceType.gdlId + ", but is bound " + idOccs.length() + " times to it");
+ throw new InvalidGdlSchemaException("The topic " + TmHelper.getAnyIdOfTopic(this.tmRepresentative) + " must be bound to exactly one occurrence of the type " + PSIs.GDL.OccurrenceType.gdlId + ", but is bound " + idOccs.length() + " times to it");
} else {
return idOccs.get(0).getValue();
}
@@ -237,7 +237,7 @@
// returns a Display instance of a gdl:display occurrence.
// If no gdl:display occurrence is set, the default value is returned
public Display getDisplay() throws InvalidGdlSchemaException {
- Occurrence displayOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlDisplay);
+ Occurrence displayOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlDisplay);
if(displayOcc != null){
String value = displayOcc.getValue().toLowerCase();
@@ -250,7 +250,7 @@
} else if(value.equals("block")){
return Display.BLOCK;
} else {
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlDisplay + " must be set to one of \"none\", \"inline\", \"inline-block\" or \"block\", but is \"" + displayOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlDisplay + " must be set to one of \"none\", \"inline\", \"inline-block\" or \"block\", but is \"" + displayOcc.getValue() + "\"");
}
} else {
return Display.INLINE_BLOCK;
@@ -261,7 +261,7 @@
// returns an AutoNumValue instance of a gdl:z-index occurrence.
// If no gdl:z-index occurrence is set, the default value is returned
public AutoNumValue getZindex() throws InvalidGdlSchemaException {
- Occurrence zOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlZindex);
+ Occurrence zOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlZindex);
if(zOcc != null){
return new AutoNumValue(zOcc.getValue());
} else {
@@ -273,7 +273,7 @@
// returns a Float instance of a gdl:float occurrence or the default value for
// this property if no gdl:float occurrence is available
public Float getFloat() throws InvalidGdlSchemaException {
- Occurrence floatOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlFloat);
+ Occurrence floatOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlFloat);
if(floatOcc != null){
String value = floatOcc.getValue().toLowerCase();
@@ -284,7 +284,7 @@
} else if (value.equals("right")){
return Float.RIGHT;
} else {
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlFloat + " must be set to one of \"none\", \"left\" or \"right\", but is \"" + floatOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlFloat + " must be set to one of \"none\", \"left\" or \"right\", but is \"" + floatOcc.getValue() + "\"");
}
} else {
return Float.NONE;
@@ -295,13 +295,13 @@
// returns a ClearValue instance of a gdl:clear occurrence or the default value for
// this property if no gdl:clear occurrence is available
public ClearValue getClear() throws InvalidGdlSchemaException {
- Occurrence clearOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlClear);
+ Occurrence clearOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlClear);
if(clearOcc != null){
try{
return ClearValue.valueOf(clearOcc.getValue().toUpperCase());
}catch(IllegalArgumentException e){
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlClear + " must be set to one of \"none\", \"left\", \"right\" or \"both\", but is \"" + clearOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlClear + " must be set to one of \"none\", \"left\", \"right\" or \"both\", but is \"" + clearOcc.getValue() + "\"");
}
} else {
return ClearValue.NONE;
@@ -312,13 +312,13 @@
// returns a ContentOrientationValue instance of a gdl:content-orientation occurrence or the default value for
// this property if no gdl:content-orientation occurrence is available
public ContentOrientationValue getContentOrientation() throws InvalidGdlSchemaException {
- Occurrence orientationOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlContentOrientation);
+ Occurrence orientationOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlContentOrientation);
if(orientationOcc != null){
try{
return ContentOrientationValue.valueOf(orientationOcc.getValue().toUpperCase());
}catch(IllegalArgumentException e){
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlContentOrientation + " must be set to one of \"horizontal\" or \"vertical\", but is \"" + orientationOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlContentOrientation + " must be set to one of \"horizontal\" or \"vertical\", but is \"" + orientationOcc.getValue() + "\"");
}
} else {
return ContentOrientationValue.VERTICAL;
@@ -333,9 +333,9 @@
public VerticalAlign getVerticalAlign(String styleClass) throws InvalidGdlSchemaException {
Occurrence vaOcc = null;
if(styleClass != null){
- vaOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlVerticalAlign, styleClass);
+ vaOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlVerticalAlign, styleClass);
} else {
- vaOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlVerticalAlign);
+ vaOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlVerticalAlign);
}
if(vaOcc == null && styleClass != null){
@@ -361,7 +361,7 @@
}else if(value.equals("text-bottom")) {
return VerticalAlign.TEXT_BOTTOM;
} else {
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlVerticalAlign + " must be set to one of \"baseline\", \"sub\", \"super\", \"top\", \"text-top\", \"middle\", \"bottom\" or \"text-bottom\", but is \"" + vaOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlVerticalAlign + " must be set to one of \"baseline\", \"sub\", \"super\", \"top\", \"text-top\", \"middle\", \"bottom\" or \"text-bottom\", but is \"" + vaOcc.getValue() + "\"");
}
}
}
@@ -374,9 +374,9 @@
public NumUnitValue getMargin(String styleClass) throws InvalidGdlSchemaException {
Occurrence marginOcc = null;
if(styleClass != null){
- marginOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlMargin, styleClass);
+ marginOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlMargin, styleClass);
} else {
- marginOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlMargin);
+ marginOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlMargin);
}
if(marginOcc == null && styleClass != null){
@@ -395,9 +395,9 @@
public NumUnitValue getMarginTop(String styleClass) throws InvalidGdlSchemaException {
Occurrence marginOcc = null;
if(styleClass != null){
- marginOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlMarginTop, styleClass);
+ marginOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlMarginTop, styleClass);
} else {
- marginOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlMarginTop);
+ marginOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlMarginTop);
}
if(marginOcc == null){
@@ -414,9 +414,9 @@
public NumUnitValue getMarginRight(String styleClass) throws InvalidGdlSchemaException {
Occurrence marginOcc = null;
if(styleClass != null){
- marginOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlMarginRight, styleClass);
+ marginOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlMarginRight, styleClass);
} else {
- marginOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlMarginRight);
+ marginOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlMarginRight);
}
if(marginOcc == null){
@@ -433,9 +433,9 @@
public NumUnitValue getMarginBottom(String styleClass) throws InvalidGdlSchemaException {
Occurrence marginOcc = null;
if(styleClass != null){
- marginOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlMarginBottom, styleClass);
+ marginOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlMarginBottom, styleClass);
} else {
- marginOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlMarginBottom);
+ marginOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlMarginBottom);
}
if(marginOcc == null){
@@ -452,9 +452,9 @@
public NumUnitValue getMarginLeft(String styleClass) throws InvalidGdlSchemaException {
Occurrence marginOcc = null;
if(styleClass != null){
- marginOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlMarginLeft, styleClass);
+ marginOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlMarginLeft, styleClass);
} else {
- marginOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlMarginLeft);
+ marginOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlMarginLeft);
}
if(marginOcc == null){
@@ -472,9 +472,9 @@
public ColorValue getBorderColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
- colorOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderColor, styleClass);
+ colorOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderColor, styleClass);
} else {
- colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderColor);
+ colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderColor);
}
if(colorOcc == null && styleClass != null){
@@ -493,9 +493,9 @@
public ColorValue getBorderTopColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
- colorOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderTopColor, styleClass);
+ colorOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopColor, styleClass);
} else {
- colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderTopColor);
+ colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopColor);
}
if(colorOcc == null ){
@@ -512,9 +512,9 @@
public ColorValue getBorderRightColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
- colorOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderRightColor, styleClass);
+ colorOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRightColor, styleClass);
} else {
- colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderRightColor);
+ colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRightColor);
}
if(colorOcc == null ){
@@ -531,9 +531,9 @@
public ColorValue getBorderBottomColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
- colorOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomColor, styleClass);
+ colorOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomColor, styleClass);
} else {
- colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomColor);
+ colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomColor);
}
if(colorOcc == null ){
@@ -550,9 +550,9 @@
public ColorValue getBorderLeftColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
- colorOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderLeftColor, styleClass);
+ colorOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderLeftColor, styleClass);
} else {
- colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderLeftColor);
+ colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderLeftColor);
}
if(colorOcc == null ){
@@ -570,9 +570,9 @@
public BorderStyleValue getBorderStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
- styleOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderStyle, styleClass);
+ styleOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderStyle, styleClass);
} else {
- styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderStyle);
+ styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderStyle);
}
if(styleOcc == null && styleClass != null){
@@ -596,9 +596,9 @@
public BorderStyleValue getBorderTopStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
- styleOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderTopStyle, styleClass);
+ styleOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopStyle, styleClass);
} else {
- styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderTopStyle);
+ styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopStyle);
}
if(styleOcc == null){
@@ -620,9 +620,9 @@
public BorderStyleValue getBorderRightStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
- styleOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderRightStyle, styleClass);
+ styleOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRightStyle, styleClass);
} else {
- styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderRightStyle);
+ styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRightStyle);
}
if(styleOcc == null){
@@ -644,9 +644,9 @@
public BorderStyleValue getBorderBottomStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
- styleOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomStyle, styleClass);
+ styleOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomStyle, styleClass);
} else {
- styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomStyle);
+ styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomStyle);
}
if(styleOcc == null){
@@ -668,9 +668,9 @@
public BorderStyleValue getBorderLeftStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
- styleOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderLeftStyle, styleClass);
+ styleOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderLeftStyle, styleClass);
} else {
- styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderLeftStyle);
+ styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderLeftStyle);
}
if(styleOcc == null){
@@ -693,9 +693,9 @@
public AbsoluteNumValue getBorderWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
- widthOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderWidth, styleClass);
+ widthOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderWidth, styleClass);
} else {
- widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderWidth);
+ widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderWidth);
}
if(widthOcc == null && styleClass != null){
@@ -714,9 +714,9 @@
public AbsoluteNumValue getBorderTopWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
- widthOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderTopWidth, styleClass);
+ widthOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopWidth, styleClass);
} else {
- widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderTopWidth);
+ widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopWidth);
}
if(widthOcc == null){
@@ -733,9 +733,9 @@
public AbsoluteNumValue getBorderRightWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
- widthOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderRightWidth, styleClass);
+ widthOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRightWidth, styleClass);
} else {
- widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderRightWidth);
+ widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRightWidth);
}
if(widthOcc == null){
@@ -752,9 +752,9 @@
public AbsoluteNumValue getBorderBottomWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
- widthOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomWidth, styleClass);
+ widthOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomWidth, styleClass);
} else {
- widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomWidth);
+ widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomWidth);
}
if(widthOcc == null){
@@ -771,9 +771,9 @@
public AbsoluteNumValue getBorderLeftWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
- widthOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderLeftWidth, styleClass);
+ widthOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderLeftWidth, styleClass);
} else {
- widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderLeftWidth);
+ widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderLeftWidth);
}
if(widthOcc == null){
@@ -791,9 +791,9 @@
public NumUnitValue getBorderRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
- radiusOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderRadius, styleClass);
+ radiusOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRadius, styleClass);
} else {
- radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderRadius);
+ radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRadius);
}
if(radiusOcc == null && styleClass != null){
@@ -812,9 +812,9 @@
public NumUnitValue getBorderTopLeftRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
- radiusOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderTopLeftRadius, styleClass);
+ radiusOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopLeftRadius, styleClass);
} else {
- radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderTopLeftRadius);
+ radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopLeftRadius);
}
if(radiusOcc == null && styleClass != null){
@@ -833,9 +833,9 @@
public NumUnitValue getBorderTopRightRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
- radiusOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderTopRightRadius, styleClass);
+ radiusOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopRightRadius, styleClass);
} else {
- radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderTopRightRadius);
+ radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopRightRadius);
}
if(radiusOcc == null && styleClass != null){
@@ -854,9 +854,9 @@
public NumUnitValue getBorderBottomLeftRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
- radiusOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomLeftRadius, styleClass);
+ radiusOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomLeftRadius, styleClass);
} else {
- radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomLeftRadius);
+ radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomLeftRadius);
}
if(radiusOcc == null && styleClass != null){
@@ -875,9 +875,9 @@
public NumUnitValue getBorderBottomRightRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
- radiusOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomRightRadius, styleClass);
+ radiusOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomRightRadius, styleClass);
} else {
- radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomRightRadius);
+ radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomRightRadius);
}
if(radiusOcc == null && styleClass != null){
@@ -897,9 +897,9 @@
public NumUnitValue getPadding(String styleClass) throws InvalidGdlSchemaException {
Occurrence paddingOcc = null;
if(styleClass != null){
- paddingOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlPadding, styleClass);
+ paddingOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlPadding, styleClass);
} else {
- paddingOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlPadding);
+ paddingOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlPadding);
}
if(paddingOcc == null && styleClass != null){
@@ -918,9 +918,9 @@
public NumUnitValue getPaddingTop(String styleClass) throws InvalidGdlSchemaException {
Occurrence paddingOcc = null;
if(styleClass != null){
- paddingOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlPaddingTop, styleClass);
+ paddingOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlPaddingTop, styleClass);
} else {
- paddingOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlPaddingTop);
+ paddingOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlPaddingTop);
}
if(paddingOcc == null){
@@ -937,9 +937,9 @@
public NumUnitValue getPaddingRight(String styleClass) throws InvalidGdlSchemaException {
Occurrence paddingOcc = null;
if(styleClass != null){
- paddingOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlPaddingRight, styleClass);
+ paddingOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlPaddingRight, styleClass);
} else {
- paddingOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlPaddingRight);
+ paddingOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlPaddingRight);
}
if(paddingOcc == null){
@@ -956,9 +956,9 @@
public NumUnitValue getPaddingBottom(String styleClass) throws InvalidGdlSchemaException {
Occurrence paddingOcc = null;
if(styleClass != null){
- paddingOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlPaddingBottom, styleClass);
+ paddingOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlPaddingBottom, styleClass);
} else {
- paddingOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlPaddingBottom);
+ paddingOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlPaddingBottom);
}
if(paddingOcc == null){
@@ -975,9 +975,9 @@
public NumUnitValue getPaddingLeft(String styleClass) throws InvalidGdlSchemaException {
Occurrence paddingOcc = null;
if(styleClass != null){
- paddingOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlPaddingLeft, styleClass);
+ paddingOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlPaddingLeft, styleClass);
} else {
- paddingOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlPaddingLeft);
+ paddingOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlPaddingLeft);
}
if(paddingOcc == null){
@@ -995,9 +995,9 @@
public AutoNumUnitValue getWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
- widthOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlWidth, styleClass);
+ widthOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlWidth, styleClass);
} else {
- widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlWidth);
+ widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlWidth);
}
if(widthOcc == null && styleClass != null){
@@ -1017,9 +1017,9 @@
public AutoNumUnitValue getMinWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
- widthOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlMinWidth, styleClass);
+ widthOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlMinWidth, styleClass);
} else {
- widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlMinWidth);
+ widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlMinWidth);
}
if(widthOcc == null && styleClass != null){
@@ -1039,9 +1039,9 @@
public AutoNumUnitValue getMaxWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
- widthOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlMaxWidth, styleClass);
+ widthOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlMaxWidth, styleClass);
} else {
- widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlMaxWidth);
+ widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlMaxWidth);
}
if(widthOcc == null && styleClass != null){
@@ -1061,9 +1061,9 @@
public AutoNumUnitValue getHeight(String styleClass) throws InvalidGdlSchemaException {
Occurrence heightOcc = null;
if(styleClass != null){
- heightOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlHeight, styleClass);
+ heightOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlHeight, styleClass);
} else {
- heightOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlHeight);
+ heightOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlHeight);
}
if(heightOcc == null && styleClass != null){
@@ -1083,9 +1083,9 @@
public AutoNumUnitValue getMinHeight(String styleClass) throws InvalidGdlSchemaException {
Occurrence heightOcc = null;
if(styleClass != null){
- heightOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlMinHeight, styleClass);
+ heightOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlMinHeight, styleClass);
} else {
- heightOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlMinHeight);
+ heightOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlMinHeight);
}
if(heightOcc == null && styleClass != null){
@@ -1105,9 +1105,9 @@
public AutoNumUnitValue getMaxHeight(String styleClass) throws InvalidGdlSchemaException {
Occurrence heightOcc = null;
if(styleClass != null){
- heightOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlMaxHeight, styleClass);
+ heightOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlMaxHeight, styleClass);
} else {
- heightOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlMaxHeight);
+ heightOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlMaxHeight);
}
if(heightOcc == null && styleClass != null){
@@ -1127,9 +1127,9 @@
public CursorValue getCursor(String styleClass) throws InvalidGdlSchemaException {
Occurrence cursorOcc = null;
if(styleClass != null){
- cursorOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlCursor, styleClass);
+ cursorOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlCursor, styleClass);
} else {
- cursorOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlCursor);
+ cursorOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlCursor);
}
if(cursorOcc == null && styleClass != null){
@@ -1156,9 +1156,9 @@
public ColorValue getBackgroundColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
- colorOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBackgroundColor, styleClass);
+ colorOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBackgroundColor, styleClass);
} else {
- colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBackgroundColor);
+ colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBackgroundColor);
}
if(colorOcc == null && styleClass != null){
@@ -1464,14 +1464,14 @@
if(styleClass == null){
DOM.setStyleAttribute(this.getElement(), cssProperty, cssValue);
- } else if(styleClass.equals(PSIs.Scope.gdlActive)){
+ } else if(styleClass.equals(PSIs.GDL.Scope.gdlActive)){
this.activeCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
- } else if(styleClass.equals(PSIs.Scope.gdlFocus)){
+ } else if(styleClass.equals(PSIs.GDL.Scope.gdlFocus)){
this.focusCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
- } else if (styleClass.equals(PSIs.Scope.gdlHover)){
+ } else if (styleClass.equals(PSIs.GDL.Scope.gdlHover)){
this.hoverCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
} else {
- String values = PSIs.Scope.gdlActive + ", " + PSIs.Scope.gdlFocus + ", " + PSIs.Scope.gdlHover;
+ String values = PSIs.GDL.Scope.gdlActive + ", " + PSIs.GDL.Scope.gdlFocus + ", " + PSIs.GDL.Scope.gdlHover;
throw new InvalidGdlSchemaException("GDL defines only the style classes " + values + ", but found " + styleClass);
}
}
@@ -1483,14 +1483,14 @@
if(styleClass == null){
DOM.setStyleAttribute(elem.getElement(), cssProperty, cssValue);
- } else if(styleClass.equals(PSIs.Scope.gdlActive)){
+ } else if(styleClass.equals(PSIs.GDL.Scope.gdlActive)){
this.activeCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
- } else if(styleClass.equals(PSIs.Scope.gdlFocus)){
+ } else if(styleClass.equals(PSIs.GDL.Scope.gdlFocus)){
this.focusCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
- } else if (styleClass.equals(PSIs.Scope.gdlHover)){
+ } else if (styleClass.equals(PSIs.GDL.Scope.gdlHover)){
this.hoverCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
} else {
- String values = PSIs.Scope.gdlActive + ", " + PSIs.Scope.gdlFocus + ", " + PSIs.Scope.gdlHover;
+ String values = PSIs.GDL.Scope.gdlActive + ", " + PSIs.GDL.Scope.gdlFocus + ", " + PSIs.GDL.Scope.gdlHover;
throw new InvalidGdlSchemaException("GDL defines only the style classes " + values + ", but found " + styleClass);
}
}
@@ -1502,14 +1502,14 @@
if(styleClass == null){
DOM.setStyleAttribute(elem, cssProperty, cssValue);
- } else if(styleClass.equals(PSIs.Scope.gdlActive)){
+ } else if(styleClass.equals(PSIs.GDL.Scope.gdlActive)){
this.activeCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
- } else if(styleClass.equals(PSIs.Scope.gdlFocus)){
+ } else if(styleClass.equals(PSIs.GDL.Scope.gdlFocus)){
this.focusCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
- } else if (styleClass.equals(PSIs.Scope.gdlHover)){
+ } else if (styleClass.equals(PSIs.GDL.Scope.gdlHover)){
this.hoverCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
} else {
- String values = PSIs.Scope.gdlActive + ", " + PSIs.Scope.gdlFocus + ", " + PSIs.Scope.gdlHover;
+ String values = PSIs.GDL.Scope.gdlActive + ", " + PSIs.GDL.Scope.gdlFocus + ", " + PSIs.GDL.Scope.gdlHover;
throw new InvalidGdlSchemaException("GDL defines only the style classes " + values + ", but found " + styleClass);
}
}
@@ -1517,7 +1517,7 @@
// sets all GDL styles that are defined by the topic map representative to tha passed widget
public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
- String[] styleClasses = new String[]{null, PSIs.Scope.gdlActive, PSIs.Scope.gdlFocus, PSIs.Scope.gdlHover};
+ String[] styleClasses = new String[]{null, PSIs.GDL.Scope.gdlActive, PSIs.GDL.Scope.gdlFocus, PSIs.GDL.Scope.gdlHover};
for (String styleClass : styleClasses) {
this.setVerticalAlign(widget, this.getVerticalAlign(styleClass), styleClass);
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java Wed Aug 24 08:47:02 2011 (r778)
@@ -3,8 +3,6 @@
public class PSIs {
- public final static String gdl = "http://psi.isidor.us/gdl/";
-
// some psis of the TMDM
public class TMDM{
public final static String tmdm = "http://psi.topicmaps.org/iso13250/model/";
@@ -51,204 +49,208 @@
}
- // topic types
- public class TopicType{
- public final static String gdlt = gdl + "types/";
- public final static String gdlSchema = gdlt + "Schema";
- public final static String gdlView = gdlt + "View";
- public final static String gdlAssociationView = gdlt + "Association-View";
- public final static String gdlCreatorAssociationview = gdlt + "Creator-Association-View";
- public final static String gdlEditorAssociationView = gdlt + "Editor-Association-View";
- public final static String gdlTopicView = gdlt + "Topic-View";
- public final static String gdlDefaultTopicView = gdlt + "Default-Topic-View";
- public final static String gdlDefaultCreatorTopicView = gdlt + "Default-Creator-Topic-View";
- public final static String gdlDefaultEditorTopicView = gdlt + "Default-Editor-Topic-View";
- public final static String gdlSpecialTopicView = gdlt + "Special-Topic-View";
- public final static String gdlSpecialCreatorTopicView = gdlt + "Special-Creator-TopicView";
- public final static String gdlSpecialEditorTopicView = gdlt + "SpecialEditorTopicView";
- public final static String gdlVisibleObject = gdlt + "Visible-Object";
- public final static String gdlStyleClass = gdlt + "Style-Class";
- public final static String gdlDescriptor = gdlt + "Descriptor";
- public final static String gdlSpace = gdlt + "Space";
- public final static String gdlList = gdlt + "List";
- public final static String gdlPosition = gdlt + "Position";
- public final static String gdlNthElement = gdlt + "Nth-Element";
- public final static String gdlValue = gdlt + "Value";
- public final static String gdlDefaultValue = gdlt + "Default-Value";
- public final static String gdlLiteralValue = gdlt + "Literal-Value";
- public final static String gdlDefaultLiteralValue = gdlt + "Default-Literal-Value";
- public final static String gdlTmValue = gdlt + "TM-Value";
- public final static String gdlTmTypeValue = gdlt + "TM-Type-Value";
- public final static String gdlTmSingleTypeValue = gdlt + "TM-Single-Type-Value";
- public final static String gdlTmMultipleTypeValue = gdlt + "TM-Multiple-Type-Value";
- public final static String gdlTmInstanceValue = gdlt + "TM-Instance-Value";
- public final static String gdlDefaultTmValue = gdlt + "Default-TM-Value";
- public final static String gdlDefaultTmTypeValue = gdlt + "Default-TM-Type-Value";
- public final static String gdlDefaultTmSingleTypeValue = gdlt + "Default-TM-Single-Type-Value";
- public final static String gdlDefaultTmMultipleTypeValue = gdlt + "Default-TM-Multiple-Type-Value";
- public final static String gdlDefaultTmInstanceValue = gdlt + "Default-TM-Instance-Value";
- public final static String gdlDatatype = gdlt + "Datatype";
- public final static String gdlType = gdlt + "Type";
- public final static String gdlInfo = gdlt + "Info";
- public final static String gdlVariantNameScope = gdlt + "Variant-Name-Scope";
- public final static String gdlVariantNameReifier = gdlt + "Variant-Name-Reifier";
- public final static String gdlVariantNameIdentifiers = gdlt + "Variant-Name-Identifiers";
- public final static String gdlRolePlayer = gdlt + "Role-Player";
- public final static String gdlAssociationRole = gdlt + "Association-Role";
- public final static String gdlHiddenValue = gdlt + "Hidden-Value";
- public final static String gdlValueGroup = gdlt + "Value-Group";
- public final static String gdlTextObject = gdlt + "Text-Object";
- public final static String gdlTitle = gdlt + "Title";
- public final static String gdlReference = gdlt + "Reference";
- public final static String gdlListBox = gdlt + "List-Box";
- public final static String gdlCompleData = gdlt + "Complex-Data";
- public final static String gdlImage = gdlt + "Image";
- public final static String gdlAudio = gdlt + "Audio";
- public final static String gdlVideo = gdlt + "Video";
- public final static String gdlTimePicker = gdlt + "Time-Picker";
- public final static String gdlDatePicker = gdlt + "Date-Picker";
- public final static String gdlDateTimePicker = gdlt + "Date-Time-Picker";
- public final static String gdlText = gdlt + "Text";
- public final static String gdlUnit = gdlt + "Unit";
- public final static String gdlButton = gdlt + "Button";
- public final static String gdlInputbutton = gdlt + "Input-Button";
- public final static String gdlRadioButton = gdlt + "Radio-Button";
- public final static String gdlCheckBox = gdlt + "Check-Box";
- public final static String gdlActionButton = gdlt + "Action-Button";
- public final static String gdlValidateButton = gdlt + "Validate-Button";
- public final static String gdlCreateButton = gdlt + "Create-Button";
- public final static String gdlDeleteButton = gdlt + "Delete-Button";
- public final static String gdlCommitButton = gdlt + "Commit-Button";
+ // all psis of the GDL
+ public class GDL {
+ public final static String gdl = "http://psi.isidor.us/gdl/";
+
+ // topic types
+ public class TopicType{
+ public final static String gdlt = gdl + "types/";
+ public final static String gdlSchema = gdlt + "Schema";
+ public final static String gdlView = gdlt + "View";
+ public final static String gdlAssociationView = gdlt + "Association-View";
+ public final static String gdlCreatorAssociationview = gdlt + "Creator-Association-View";
+ public final static String gdlEditorAssociationView = gdlt + "Editor-Association-View";
+ public final static String gdlTopicView = gdlt + "Topic-View";
+ public final static String gdlDefaultTopicView = gdlt + "Default-Topic-View";
+ public final static String gdlDefaultCreatorTopicView = gdlt + "Default-Creator-Topic-View";
+ public final static String gdlDefaultEditorTopicView = gdlt + "Default-Editor-Topic-View";
+ public final static String gdlSpecialTopicView = gdlt + "Special-Topic-View";
+ public final static String gdlSpecialCreatorTopicView = gdlt + "Special-Creator-TopicView";
+ public final static String gdlSpecialEditorTopicView = gdlt + "SpecialEditorTopicView";
+ public final static String gdlVisibleObject = gdlt + "Visible-Object";
+ public final static String gdlStyleClass = gdlt + "Style-Class";
+ public final static String gdlDescriptor = gdlt + "Descriptor";
+ public final static String gdlSpace = gdlt + "Space";
+ public final static String gdlList = gdlt + "List";
+ public final static String gdlPosition = gdlt + "Position";
+ public final static String gdlNthElement = gdlt + "Nth-Element";
+ public final static String gdlValue = gdlt + "Value";
+ public final static String gdlDefaultValue = gdlt + "Default-Value";
+ public final static String gdlLiteralValue = gdlt + "Literal-Value";
+ public final static String gdlDefaultLiteralValue = gdlt + "Default-Literal-Value";
+ public final static String gdlTmValue = gdlt + "TM-Value";
+ public final static String gdlTmTypeValue = gdlt + "TM-Type-Value";
+ public final static String gdlTmSingleTypeValue = gdlt + "TM-Single-Type-Value";
+ public final static String gdlTmMultipleTypeValue = gdlt + "TM-Multiple-Type-Value";
+ public final static String gdlTmInstanceValue = gdlt + "TM-Instance-Value";
+ public final static String gdlDefaultTmValue = gdlt + "Default-TM-Value";
+ public final static String gdlDefaultTmTypeValue = gdlt + "Default-TM-Type-Value";
+ public final static String gdlDefaultTmSingleTypeValue = gdlt + "Default-TM-Single-Type-Value";
+ public final static String gdlDefaultTmMultipleTypeValue = gdlt + "Default-TM-Multiple-Type-Value";
+ public final static String gdlDefaultTmInstanceValue = gdlt + "Default-TM-Instance-Value";
+ public final static String gdlDatatype = gdlt + "Datatype";
+ public final static String gdlType = gdlt + "Type";
+ public final static String gdlInfo = gdlt + "Info";
+ public final static String gdlVariantNameScope = gdlt + "Variant-Name-Scope";
+ public final static String gdlVariantNameReifier = gdlt + "Variant-Name-Reifier";
+ public final static String gdlVariantNameIdentifiers = gdlt + "Variant-Name-Identifiers";
+ public final static String gdlRolePlayer = gdlt + "Role-Player";
+ public final static String gdlAssociationRole = gdlt + "Association-Role";
+ public final static String gdlHiddenValue = gdlt + "Hidden-Value";
+ public final static String gdlValueGroup = gdlt + "Value-Group";
+ public final static String gdlTextObject = gdlt + "Text-Object";
+ public final static String gdlTitle = gdlt + "Title";
+ public final static String gdlReference = gdlt + "Reference";
+ public final static String gdlListBox = gdlt + "List-Box";
+ public final static String gdlCompleData = gdlt + "Complex-Data";
+ public final static String gdlImage = gdlt + "Image";
+ public final static String gdlAudio = gdlt + "Audio";
+ public final static String gdlVideo = gdlt + "Video";
+ public final static String gdlTimePicker = gdlt + "Time-Picker";
+ public final static String gdlDatePicker = gdlt + "Date-Picker";
+ public final static String gdlDateTimePicker = gdlt + "Date-Time-Picker";
+ public final static String gdlText = gdlt + "Text";
+ public final static String gdlUnit = gdlt + "Unit";
+ public final static String gdlButton = gdlt + "Button";
+ public final static String gdlInputbutton = gdlt + "Input-Button";
+ public final static String gdlRadioButton = gdlt + "Radio-Button";
+ public final static String gdlCheckBox = gdlt + "Check-Box";
+ public final static String gdlActionButton = gdlt + "Action-Button";
+ public final static String gdlValidateButton = gdlt + "Validate-Button";
+ public final static String gdlCreateButton = gdlt + "Create-Button";
+ public final static String gdlDeleteButton = gdlt + "Delete-Button";
+ public final static String gdlCommitButton = gdlt + "Commit-Button";
+ }
+
+
+ // name types
+ public class NameType{
+ public final static String gdlViewName = gdl + "view-name";
+ public final static String gdlSchemaName = gdl + "schema-name";
+ }
+
+
+ // occurrence types
+ public class OccurrenceType {
+ public final static String gdlVerticalAlign = gdl + "vertical-align";
+ public final static String gdlDisplay = gdl + "display";
+ public final static String gdlId = gdl + "id";
+ public final static String gdlMargin = gdl + "margin";
+ public final static String gdlMarginTop = gdl + "margin-top";
+ public final static String gdlMarginRight = gdl + "margin-right";
+ public final static String gdlMarginBottom = gdl + "margin-bottom";
+ public final static String gdlMarginLeft = gdl + "margin-left";
+ public final static String gdlBorderColor = gdl + "border-color";
+ public final static String gdlBorderTopColor = gdl + "border-top-color";
+ public final static String gdlBorderRightColor = gdl + "border-right-color";
+ public final static String gdlBorderBottomColor = gdl + "border-bottom-color";
+ public final static String gdlBorderLeftColor = gdl + "border-left-color";
+ public final static String gdlBorderStyle = gdl + "border-style";
+ public final static String gdlBorderTopStyle = gdl + "border-top-style";
+ public final static String gdlBorderRightStyle = gdl + "border-right-style";
+ public final static String gdlBorderBottomStyle = gdl + "border-bottom-style";
+ public final static String gdlBorderLeftStyle = gdl + "border-left-style";
+ public final static String gdlBorderWidth = gdl + "border-width";
+ public final static String gdlBorderTopWidth = gdl + "border-top-width";
+ public final static String gdlBorderRightWidth = gdl + "border-right-width";
+ public final static String gdlBorderBottomWidth = gdl + "border-bottom-width";
+ public final static String gdlBorderLeftWidth = gdl + "border-left-width";
+ public final static String gdlBorderRadius = gdl + "border-radius";
+ public final static String gdlBorderTopRightRadius = gdl + "border-top-right-radius";
+ public final static String gdlBorderBottomRightRadius = gdl + "border-bottom-right-radius";
+ public final static String gdlBorderBottomLeftRadius = gdl + "border-bottom-left-radius";
+ public final static String gdlBorderTopLeftRadius = gdl + "border-top-left-radius";
+ public final static String gdlCursor = gdl + "cursor";
+ public final static String gdlZindex = gdl + "z-index";
+ public final static String gdlWidth = gdl + "width";
+ public final static String gdlMinWidth = gdl + "min-width";
+ public final static String gdlMaxWidth = gdl + "max-width";
+ public final static String gdlHeight = gdl + "height";
+ public final static String gdlMinHeight = gdl + "min-height";
+ public final static String gdlMaxHeight = gdl + "max-height";
+ public final static String gdlPadding = gdl + "padding";
+ public final static String gdlPaddingTop = gdl + "padding-top";
+ public final static String gdlPaddingRight = gdl + "padding-right";
+ public final static String gdlPaddingBottom = gdl + "padding-bottom";
+ public final static String gdlPaddingLeft = gdl + "padding-left";
+ public final static String gdlClear = gdl + "clear";
+ public final static String gdlFloat = gdl + "float";
+ public final static String gdlBackgroundColor = gdl + "background-color";
+ public final static String gdlOrdered = gdl + "ordered";
+ public final static String gdlListStyleType = gdl + "list-style-type";
+ public final static String gdlListStylePosition = gdl + "list-style-position";
+ public final static String gdlPositionStyle = gdl + "position-style";
+ public final static String gdlNthValue = gdl + "nth-value";
+ public final static String gdlTop = gdl + "top";
+ public final static String gdlRight = gdl + "right";
+ public final static String gdlBottom = gdl + "bottom";
+ public final static String gdlLeft = gdl + "left";
+ public final static String gdlFixed = gdl + "fixed";
+ public final static String gdlLiteralValue = gdl + "literal-value";
+ public final static String gdlDirection = gdl + "direction";
+ public final static String gdlTextAlign = gdl + "text-align";
+ public final static String gdlLineHeight = gdl + "line-height";
+ public final static String gdlTextDecoration = gdl + "text-decoration";
+ public final static String gdlColor = gdl + "color";
+ public final static String gdlFontfamily = gdl + "font-family";
+ public final static String gdlFontStyle = gdl + "font-style";
+ public final static String gdlFontSize = gdl + "font-size";
+ public final static String gdlFontWeight = gdl + "font-weight";
+ public final static String gdlLetterSpacing = gdl + "letter-spacing";
+ public final static String gdlWordSpacing = gdl + "word-spacing";
+ public final static String gdlMultiple = gdl + "multiple";
+ public final static String gdlSize = gdl + "size";
+ public final static String gdlOnePerGroup = gdl + "one-per-group";
+ public final static String gdlTextType = gdl + "text-type";
+ public final static String gdlReadonly = gdl + "readonly";
+ public final static String gdlRows = gdl + "rows";
+ public final static String gdlCols = gdl + "cols";
+ public final static String gdlResize = gdl + "resize";
+ public final static String gdlTitleOrder = gdl + "title-order";
+ public final static String gdlUnitName = gdl + "unit-name";
+ public final static String gdlContentOrientation = gdl + "content-orientation";
+ }
+
+
+ // association types
+ public class AssociationType {
+ public final static String gdlContains = gdl + "contains";
+ 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 gdlViewBinding = gdl + "view-binding";
+ public final static String gdlTopicViewBinding = gdl + "topic-view-binding";
+ public final static String gdlAssociationViewBinding = gdl + "association-view-binding";
+ public final static String gdlValueBinding = gdl + "value-binding";
+ public final static String gdlDisplayBy = gdl + "display-by";
+ public final static String gdlPrefferedScope = gdl + "preferred-scope";
+ }
+
+
+ // role types
+ public class RoleType {
+ public final static String gdlContainer = gdl + "container";
+ public final static String gdlContainee = gdl + "containee";
+ public final static String gdlTmConstruct = gdl + "tm-construct";
+ public final static String gdlDescriptor = gdl + "descriptor";
+ public final static String gdlDescendant = gdl + "descendant";
+ public final static String gdlAncestor = gdl + "ancestor";
+ public final static String gdlNthElement = gdl + "nth-element";
+ public final static String gdlHiddenValue = gdl + "hidden-value";
+ public final static String gdlValueGroup = gdl + "value-group";
+ public final static String gdlTmValue = gdl + "tm-value";
+ public final static String gdlActionButton = gdl + "action-button";
+ public final static String gdlValue = gdl + "value";
+ }
+
+
+ // themes (topic instances)
+ public class Scope {
+ public final static String gdlHover = gdl + "hover";
+ public final static String gdlFocus = gdl + "focus";
+ public final static String gdlActive = gdl + "active";
+ }
}
-
-
- // name types
- public class NameType{
- public final static String gdlViewName = gdl + "view-name";
- public final static String gdlSchemaName = gdl + "schema-name";
- }
-
-
- // occurrence types
- public class OccurrenceType {
- public final static String gdlVerticalAlign = gdl + "vertical-align";
- public final static String gdlDisplay = gdl + "display";
- public final static String gdlId = gdl + "id";
- public final static String gdlMargin = gdl + "margin";
- public final static String gdlMarginTop = gdl + "margin-top";
- public final static String gdlMarginRight = gdl + "margin-right";
- public final static String gdlMarginBottom = gdl + "margin-bottom";
- public final static String gdlMarginLeft = gdl + "margin-left";
- public final static String gdlBorderColor = gdl + "border-color";
- public final static String gdlBorderTopColor = gdl + "border-top-color";
- public final static String gdlBorderRightColor = gdl + "border-right-color";
- public final static String gdlBorderBottomColor = gdl + "border-bottom-color";
- public final static String gdlBorderLeftColor = gdl + "border-left-color";
- public final static String gdlBorderStyle = gdl + "border-style";
- public final static String gdlBorderTopStyle = gdl + "border-top-style";
- public final static String gdlBorderRightStyle = gdl + "border-right-style";
- public final static String gdlBorderBottomStyle = gdl + "border-bottom-style";
- public final static String gdlBorderLeftStyle = gdl + "border-left-style";
- public final static String gdlBorderWidth = gdl + "border-width";
- public final static String gdlBorderTopWidth = gdl + "border-top-width";
- public final static String gdlBorderRightWidth = gdl + "border-right-width";
- public final static String gdlBorderBottomWidth = gdl + "border-bottom-width";
- public final static String gdlBorderLeftWidth = gdl + "border-left-width";
- public final static String gdlBorderRadius = gdl + "border-radius";
- public final static String gdlBorderTopRightRadius = gdl + "border-top-right-radius";
- public final static String gdlBorderBottomRightRadius = gdl + "border-bottom-right-radius";
- public final static String gdlBorderBottomLeftRadius = gdl + "border-bottom-left-radius";
- public final static String gdlBorderTopLeftRadius = gdl + "border-top-left-radius";
- public final static String gdlCursor = gdl + "cursor";
- public final static String gdlZindex = gdl + "z-index";
- public final static String gdlWidth = gdl + "width";
- public final static String gdlMinWidth = gdl + "min-width";
- public final static String gdlMaxWidth = gdl + "max-width";
- public final static String gdlHeight = gdl + "height";
- public final static String gdlMinHeight = gdl + "min-height";
- public final static String gdlMaxHeight = gdl + "max-height";
- public final static String gdlPadding = gdl + "padding";
- public final static String gdlPaddingTop = gdl + "padding-top";
- public final static String gdlPaddingRight = gdl + "padding-right";
- public final static String gdlPaddingBottom = gdl + "padding-bottom";
- public final static String gdlPaddingLeft = gdl + "padding-left";
- public final static String gdlClear = gdl + "clear";
- public final static String gdlFloat = gdl + "float";
- public final static String gdlBackgroundColor = gdl + "background-color";
- public final static String gdlOrdered = gdl + "ordered";
- public final static String gdlListStyleType = gdl + "list-style-type";
- public final static String gdlListStylePosition = gdl + "list-style-position";
- public final static String gdlPositionStyle = gdl + "position-style";
- public final static String gdlNthValue = gdl + "nth-value";
- public final static String gdlTop = gdl + "top";
- public final static String gdlRight = gdl + "right";
- public final static String gdlBottom = gdl + "bottom";
- public final static String gdlLeft = gdl + "left";
- public final static String gdlFixed = gdl + "fixed";
- public final static String gdlLiteralValue = gdl + "literal-value";
- public final static String gdlDirection = gdl + "direction";
- public final static String gdlTextAlign = gdl + "text-align";
- public final static String gdlLineHeight = gdl + "line-height";
- public final static String gdlTextDecoration = gdl + "text-decoration";
- public final static String gdlColor = gdl + "color";
- public final static String gdlFontfamily = gdl + "font-family";
- public final static String gdlFontStyle = gdl + "font-style";
- public final static String gdlFontSize = gdl + "font-size";
- public final static String gdlFontWeight = gdl + "font-weight";
- public final static String gdlLetterSpacing = gdl + "letter-spacing";
- public final static String gdlWordSpacing = gdl + "word-spacing";
- public final static String gdlMultiple = gdl + "multiple";
- public final static String gdlSize = gdl + "size";
- public final static String gdlOnePerGroup = gdl + "one-per-group";
- public final static String gdlTextType = gdl + "text-type";
- public final static String gdlReadonly = gdl + "readonly";
- public final static String gdlRows = gdl + "rows";
- public final static String gdlCols = gdl + "cols";
- public final static String gdlResize = gdl + "resize";
- public final static String gdlTitleOrder = gdl + "title-order";
- public final static String gdlUnitName = gdl + "unit-name";
- public final static String gdlContentOrientation = gdl + "content-orientation";
- }
-
-
- // association types
- public class AssociationType {
- public final static String gdlContains = gdl + "contains";
- 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 gdlViewBinding = gdl + "view-binding";
- public final static String gdlTopicViewBinding = gdl + "topic-view-binding";
- public final static String gdlAssociationViewBinding = gdl + "association-view-binding";
- public final static String gdlValueBinding = gdl + "value-binding";
- public final static String gdlDisplayBy = gdl + "display-by";
- public final static String gdlPrefferedScope = gdl + "preferred-scope";
- }
-
-
- // role types
- public class RoleType {
- public final static String gdlContainer = gdl + "container";
- public final static String gdlContainee = gdl + "containee";
- public final static String gdlTmConstruct = gdl + "tm-construct";
- public final static String gdlDescriptor = gdl + "descriptor";
- public final static String gdlDescendant = gdl + "descendant";
- public final static String gdlAncestor = gdl + "ancestor";
- public final static String gdlNthElement = gdl + "nth-element";
- public final static String gdlHiddenValue = gdl + "hidden-value";
- public final static String gdlValueGroup = gdl + "value-group";
- public final static String gdlTmValue = gdl + "tm-value";
- public final static String gdlActionButton = gdl + "action-button";
- public final static String gdlValue = gdl + "value";
- }
-
-
- // themes (topic instances)
- public class Scope {
- public final static String gdlHover = gdl + "hover";
- public final static String gdlFocus = gdl + "focus";
- public final static String gdlActive = gdl + "active";
- }
-
}
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 Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Wed Aug 24 08:47:02 2011 (r778)
@@ -314,10 +314,10 @@
public static ArrayList<Topic> topicContains(Topic container) {
if(container == null) return new ArrayList<Topic>();
TopicMap tm = container.getTopicMap();
- Topic containsAssocType = getTopicByPsi(PSIs.AssociationType.gdlContains, tm);
- Topic containerRoleType = getTopicByPsi(PSIs.RoleType.gdlContainer, tm);
- Topic visibleObject = getTopicByPsi(PSIs.TopicType.gdlVisibleObject, tm);
- Topic containeeRoleType = getTopicByPsi(PSIs.RoleType.gdlContainee, tm);
+ Topic containsAssocType = getTopicByPsi(PSIs.GDL.AssociationType.gdlContains, tm);
+ Topic containerRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlContainer, tm);
+ Topic visibleObject = getTopicByPsi(PSIs.GDL.TopicType.gdlVisibleObject, tm);
+ Topic containeeRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlContainee, tm);
return getOtherPlayerOfBinaryAssociation(container, containerRoleType, containsAssocType, null, visibleObject, containeeRoleType);
}
@@ -327,10 +327,10 @@
public static ArrayList<Topic> topicContainsInfo(Topic container) {
if(container == null) return new ArrayList<Topic>();
TopicMap tm = container.getTopicMap();
- Topic containsAssocType = getTopicByPsi(PSIs.AssociationType.gdlContains, tm);
- Topic containerRoleType = getTopicByPsi(PSIs.RoleType.gdlContainer, tm);
- Topic info = getTopicByPsi(PSIs.TopicType.gdlInfo, tm);
- Topic containeeRoleType = getTopicByPsi(PSIs.RoleType.gdlContainee, tm);
+ Topic containsAssocType = getTopicByPsi(PSIs.GDL.AssociationType.gdlContains, tm);
+ Topic containerRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlContainer, tm);
+ Topic info = getTopicByPsi(PSIs.GDL.TopicType.gdlInfo, tm);
+ Topic containeeRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlContainee, tm);
return getOtherPlayerOfBinaryAssociation(container, containerRoleType, containsAssocType, null, info, containeeRoleType);
}
@@ -347,27 +347,27 @@
if(container == null) return result;
TopicMap tm = container.getTopicMap();
- Topic containsAssocType = getTopicByPsi(PSIs.AssociationType.gdlContains, tm);
- Topic containerRoleType = getTopicByPsi(PSIs.RoleType.gdlContainer, tm);
- Topic actionButtonType = getTopicByPsi(PSIs.TopicType.gdlActionButton, tm);
- Topic containeeRoleType = getTopicByPsi(PSIs.RoleType.gdlContainee, tm);
+ Topic containsAssocType = getTopicByPsi(PSIs.GDL.AssociationType.gdlContains, tm);
+ Topic containerRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlContainer, tm);
+ Topic actionButtonType = getTopicByPsi(PSIs.GDL.TopicType.gdlActionButton, tm);
+ Topic containeeRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlContainee, tm);
ArrayList<Topic> actionButtons = getOtherPlayerOfBinaryAssociation(container, containerRoleType, containsAssocType, null, actionButtonType, containeeRoleType);
- Topic actionButtonRoleType = getTopicByPsi(PSIs.RoleType.gdlActionButton, tm);
- Topic buttonPosition = getTopicByPsi(PSIs.AssociationType.gdlButtonPosition, tm);
- Topic nthElementType = getTopicByPsi(PSIs.TopicType.gdlNthElement, tm);
- Topic nthElementRoleType = getTopicByPsi(PSIs.RoleType.gdlNthElement, tm);
- Topic nthValueOccType = getTopicByPsi(PSIs.OccurrenceType.gdlNthValue, tm);
+ Topic actionButtonRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlActionButton, tm);
+ Topic buttonPosition = getTopicByPsi(PSIs.GDL.AssociationType.gdlButtonPosition, tm);
+ Topic nthElementType = getTopicByPsi(PSIs.GDL.TopicType.gdlNthElement, tm);
+ Topic nthElementRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlNthElement, tm);
+ Topic nthValueOccType = getTopicByPsi(PSIs.GDL.OccurrenceType.gdlNthValue, tm);
ArrayList<Pair<Topic, Topic>> rolePlayertypesAndTypes = new ArrayList<Pair<Topic,Topic>>();
rolePlayertypesAndTypes.add(new Pair<Topic, Topic>(nthElementType, nthElementRoleType));
for (Topic actionButton : actionButtons) {
ArrayList<Association> assocs = getAssociationsOfTopic(actionButton, actionButtonRoleType, buttonPosition, null, rolePlayertypesAndTypes);
if(assocs.size() == 0) continue;
- if(assocs.size() > 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(actionButton) + " must be bound none or once to a " + PSIs.AssociationType.gdlButtonPosition + " association, but is: " + assocs.size());
+ if(assocs.size() > 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(actionButton) + " must be bound none or once to a " + PSIs.GDL.AssociationType.gdlButtonPosition + " association, but is: " + assocs.size());
if(assocs.size() == 1) {
Topic nthElem = assocs.get(0).getRoles(nthElementRoleType).get(0).getPlayer();
JsArray<Occurrence> occs = nthElem.getOccurrences(nthValueOccType);
- if(occs.length() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(nthElem) + " must be bound exactly once to a " + PSIs.OccurrenceType.gdlNthValue + " occurrence, but is: " + occs.length());
+ if(occs.length() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(nthElem) + " must be bound exactly once to a " + PSIs.GDL.OccurrenceType.gdlNthValue + " occurrence, but is: " + occs.length());
int val = 0;
try{
if(occs.get(0).getValue().toLowerCase().equals("last")){
@@ -376,7 +376,7 @@
Integer.valueOf(occs.get(0).getValue());
}
}catch(NumberFormatException e){
- throw new InvalidGdlSchemaException("The topic " + getAnyIdOfTopic(nthElem) + " must contain a value of the form <positive-integer>|\"last\" in the occurrence " + PSIs.OccurrenceType.gdlNthValue + ", but it contains: " + occs.get(0).getValue());
+ throw new InvalidGdlSchemaException("The topic " + getAnyIdOfTopic(nthElem) + " must contain a value of the form <positive-integer>|\"last\" in the occurrence " + PSIs.GDL.OccurrenceType.gdlNthValue + ", but it contains: " + occs.get(0).getValue());
}
result.add(new Pair<Topic, Integer>(actionButton, val));
@@ -391,12 +391,12 @@
public static ArrayList<Pair<Topic, Integer>> listContains(Topic list) throws InvalidGdlSchemaException {
if(list == null) return new ArrayList<Pair<Topic,Integer>>();
TopicMap tm = list.getTopicMap();
- Topic containsAssocType = getTopicByPsi(PSIs.AssociationType.gdlContains, tm);
- Topic containerRoleType = getTopicByPsi(PSIs.RoleType.gdlContainer, tm);
- Topic visibleObject = getTopicByPsi(PSIs.TopicType.gdlVisibleObject, tm);
- Topic containeeRoleType = getTopicByPsi(PSIs.RoleType.gdlContainee, tm);
- Topic nthElement = getTopicByPsi(PSIs.TopicType.gdlNthElement, tm);
- Topic nthElementRoleType = getTopicByPsi(PSIs.RoleType.gdlNthElement, tm);
+ Topic containsAssocType = getTopicByPsi(PSIs.GDL.AssociationType.gdlContains, tm);
+ Topic containerRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlContainer, tm);
+ Topic visibleObject = getTopicByPsi(PSIs.GDL.TopicType.gdlVisibleObject, tm);
+ Topic containeeRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlContainee, tm);
+ Topic nthElement = getTopicByPsi(PSIs.GDL.TopicType.gdlNthElement, tm);
+ Topic nthElementRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlNthElement, tm);
ArrayList<Pair<Topic, Topic>> rolePlayertypesAndTypes = new ArrayList<Pair<Topic,Topic>>();
rolePlayertypesAndTypes.add(new Pair<Topic, Topic>(visibleObject, containeeRoleType));
@@ -406,16 +406,16 @@
List<Pair<Topic, Integer>> result = new ArrayList<Pair<Topic,Integer>>();
for (Association validAssoc : validAssociations) {
Topic idx = validAssoc.getRoles(nthElementRoleType).get(0).getPlayer();
- JsArray<Occurrence> idxOccs = idx.getOccurrences(tm.getTopicBySubjectIdentifier(tm.createLocator(PSIs.OccurrenceType.gdlNthValue)));
+ JsArray<Occurrence> idxOccs = idx.getOccurrences(tm.getTopicBySubjectIdentifier(tm.createLocator(PSIs.GDL.OccurrenceType.gdlNthValue)));
ArrayList<Occurrence> validIdxOccs = new ArrayList<Occurrence>();
for(int i = 0; i != idxOccs.length(); ++i) if(idxOccs.get(i).getScope().length() == 0) validIdxOccs.add(idxOccs.get(i));
if(validIdxOccs.size() != 1){
- throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(idx) + " must be bound exaclty once to an occurrence of the type " + PSIs.OccurrenceType.gdlNthValue + " but is bound " + validIdxOccs.size() + " times");
+ throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(idx) + " must be bound exaclty once to an occurrence of the type " + PSIs.GDL.OccurrenceType.gdlNthValue + " but is bound " + validIdxOccs.size() + " times");
}else{
Occurrence validOcc = validIdxOccs.get(0);
if(!validOcc.getValue().toUpperCase().equals("LAST") && !Utils.isDecNumber(validOcc.getValue())){
- throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(idx) + " must be bound exaclty once to an occurrence of the type " + PSIs.OccurrenceType.gdlNthValue + " with a the value \"last\" or <positive integer>, but is " + validOcc.getValue());
+ throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(idx) + " must be bound exaclty once to an occurrence of the type " + PSIs.GDL.OccurrenceType.gdlNthValue + " with a the value \"last\" or <positive integer>, but is " + validOcc.getValue());
}
int idxValue = -1; // -1 represents last
@@ -457,12 +457,12 @@
if(containees == null || containees.size() == 0 || container == null) return null;
TopicMap tm = containees.get(0).getTopicMap();
- Topic descendantRoleType = getTopicByPsi(PSIs.RoleType.gdlDescendant, tm);
- Topic positionAssocType = getTopicByPsi(PSIs.AssociationType.gdlPosition, tm);
- Topic position = getTopicByPsi(PSIs.TopicType.gdlPosition, tm);
- Topic visibleObject = getTopicByPsi(PSIs.TopicType.gdlVisibleObject, tm);
- Topic ancestorRoleType = getTopicByPsi(PSIs.RoleType.gdlAncestor, tm);
- Topic descriptorRoleType = getTopicByPsi(PSIs.RoleType.gdlDescriptor, tm);
+ Topic descendantRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlDescendant, tm);
+ Topic positionAssocType = getTopicByPsi(PSIs.GDL.AssociationType.gdlPosition, tm);
+ Topic position = getTopicByPsi(PSIs.GDL.TopicType.gdlPosition, tm);
+ Topic visibleObject = getTopicByPsi(PSIs.GDL.TopicType.gdlVisibleObject, tm);
+ Topic ancestorRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlAncestor, tm);
+ Topic descriptorRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlDescriptor, tm);
ArrayList<Pair<Topic, Topic>> rolePlayertypesAndTypes = new ArrayList<Pair<Topic,Topic>>();
rolePlayertypesAndTypes.add(new Pair<Topic, Topic>(visibleObject, descendantRoleType));
@@ -496,12 +496,12 @@
if (current == null || containees == null || containees.size() == 0) return null;
TopicMap tm = current.getTopicMap();
- Topic descendantRoleType = getTopicByPsi(PSIs.RoleType.gdlDescendant, tm);
- Topic positionAssocType = getTopicByPsi(PSIs.AssociationType.gdlPosition, tm);
- Topic visibleObject = getTopicByPsi(PSIs.TopicType.gdlVisibleObject, tm);
- Topic ancestorRoleType = getTopicByPsi(PSIs.RoleType.gdlAncestor, tm);
- Topic position = getTopicByPsi(PSIs.TopicType.gdlPosition, tm);
- Topic descriptorRoleType = getTopicByPsi(PSIs.RoleType.gdlDescriptor, tm);
+ Topic descendantRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlDescendant, tm);
+ Topic positionAssocType = getTopicByPsi(PSIs.GDL.AssociationType.gdlPosition, tm);
+ Topic visibleObject = getTopicByPsi(PSIs.GDL.TopicType.gdlVisibleObject, tm);
+ Topic ancestorRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlAncestor, tm);
+ Topic position = getTopicByPsi(PSIs.GDL.TopicType.gdlPosition, tm);
+ Topic descriptorRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlDescriptor, tm);
ArrayList<Pair<Topic, Topic>> rolePlayertypesAndTypes = new ArrayList<Pair<Topic,Topic>>();
rolePlayertypesAndTypes.add(new Pair<Topic, Topic>(visibleObject, descendantRoleType));
rolePlayertypesAndTypes.add(new Pair<Topic, Topic>(position, descriptorRoleType));
@@ -534,13 +534,13 @@
// get all potential valid associations that models a position association
TopicMap tm = ancestor.getTopicMap();
- Topic ancestorRoleType = getTopicByPsi(PSIs.RoleType.gdlAncestor, tm);
- Topic positionAssocType = getTopicByPsi(PSIs.AssociationType.gdlPosition, tm);
+ Topic ancestorRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlAncestor, tm);
+ Topic positionAssocType = getTopicByPsi(PSIs.GDL.AssociationType.gdlPosition, tm);
ArrayList<Pair<Topic, Topic>> rolePlayertypesAndTypes = new ArrayList<Pair<Topic,Topic>>();
- Topic descriptor = getTopicByPsi(PSIs.RoleType.gdlDescriptor, tm);
- Topic descendantRoleType = getTopicByPsi(PSIs.RoleType.gdlDescendant, tm);
- Topic visibleObject = getTopicByPsi(PSIs.TopicType.gdlVisibleObject, tm);
- Topic position = getTopicByPsi(PSIs.TopicType.gdlPosition, tm);
+ Topic descriptor = getTopicByPsi(PSIs.GDL.RoleType.gdlDescriptor, tm);
+ Topic descendantRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlDescendant, tm);
+ Topic visibleObject = getTopicByPsi(PSIs.GDL.TopicType.gdlVisibleObject, tm);
+ Topic position = getTopicByPsi(PSIs.GDL.TopicType.gdlPosition, tm);
rolePlayertypesAndTypes.add(new Pair<Topic, Topic>(position, descriptor));
rolePlayertypesAndTypes.add(new Pair<Topic, Topic>(visibleObject, descendantRoleType));
ArrayList<Association> possiblePosAssocs = getAssociationsOfTopic(ancestor, ancestorRoleType, positionAssocType, null, rolePlayertypesAndTypes);
@@ -599,10 +599,10 @@
if(visibleElement == null) throw null;
TopicMap tm = visibleElement.getTopicMap();
- Topic descriptorRoleType = getTopicByPsi(PSIs.RoleType.gdlDescriptor, tm);
- Topic viewBindingAssocType = getTopicByPsi(PSIs.AssociationType.gdlViewBinding, tm);
- Topic valueGroupType = getTopicByPsi(PSIs.TopicType.gdlValueGroup, tm);
- Topic valueGroupRoleType = getTopicByPsi(PSIs.RoleType.gdlValueGroup, tm);
+ Topic descriptorRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlDescriptor, tm);
+ Topic viewBindingAssocType = getTopicByPsi(PSIs.GDL.AssociationType.gdlViewBinding, tm);
+ Topic valueGroupType = getTopicByPsi(PSIs.GDL.TopicType.gdlValueGroup, tm);
+ Topic valueGroupRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlValueGroup, tm);
ArrayList<Topic> valueGroups = getOtherPlayerOfBinaryAssociation(visibleElement, descriptorRoleType, viewBindingAssocType, null, valueGroupType, valueGroupRoleType);
if(valueGroups.size() == 1) return valueGroups.get(0);
@@ -616,11 +616,11 @@
if(valueGroup == null) return null;
TopicMap tm = valueGroup.getTopicMap();
- Topic valueGroupRoleType = getTopicByPsi(PSIs.RoleType.gdlValueGroup, tm);
- Topic descriptorType = getTopicByPsi(PSIs.TopicType.gdlDescriptor, tm);
- Topic tmBindingAssocType = getTopicByPsi(PSIs.AssociationType.gdlTmBinding, tm);
+ Topic valueGroupRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlValueGroup, tm);
+ Topic descriptorType = getTopicByPsi(PSIs.GDL.TopicType.gdlDescriptor, tm);
+ Topic tmBindingAssocType = getTopicByPsi(PSIs.GDL.AssociationType.gdlTmBinding, tm);
Topic tmclConstraintType = getTopicByPsi(PSIs.TMCL.tmclConstraint, tm);
- Topic tmConstructRoleType = getTopicByPsi(PSIs.RoleType.gdlTmConstruct, tm);
+ Topic tmConstructRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlTmConstruct, tm);
ArrayList<Topic> tmclConstraints = getOtherPlayerOfBinaryAssociation(valueGroup, valueGroupRoleType, tmBindingAssocType, null, tmclConstraintType, tmConstructRoleType);
ArrayList<Topic> gdlConstraints = getOtherPlayerOfBinaryAssociation(valueGroup, valueGroupRoleType, tmBindingAssocType, null, descriptorType, tmConstructRoleType);
@@ -736,9 +736,9 @@
if(viewRepresentative == null) new ArrayList<Topic>();
TopicMap tm = viewRepresentative.getTopicMap();
- Topic descriptorRoleType = getTopicByPsi(PSIs.RoleType.gdlDescriptor, tm);
- Topic associationViewBindingAssocType = getTopicByPsi(PSIs.AssociationType.gdlAssociationViewBinding, tm);
- Topic tmConstructRoleType = getTopicByPsi(PSIs.RoleType.gdlTmConstruct, tm);
+ Topic descriptorRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlDescriptor, tm);
+ Topic associationViewBindingAssocType = getTopicByPsi(PSIs.GDL.AssociationType.gdlAssociationViewBinding, tm);
+ Topic tmConstructRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlTmConstruct, tm);
Topic associationRoleConstraintType = getTopicByPsi(PSIs.TMCL.tmclAssociationRoleConstraint, tm);
ArrayList<Topic> result = getOtherPlayerOfBinaryAssociation(viewRepresentative, descriptorRoleType, associationViewBindingAssocType, null, associationRoleConstraintType, tmConstructRoleType);
@@ -753,9 +753,9 @@
if(viewRepresentative == null) new ArrayList<Topic>();
TopicMap tm = viewRepresentative.getTopicMap();
- Topic descriptorRoleType = getTopicByPsi(PSIs.RoleType.gdlDescriptor, tm);
- Topic associationViewBindingAssocType = getTopicByPsi(PSIs.AssociationType.gdlAssociationViewBinding, tm);
- Topic tmConstructRoleType = getTopicByPsi(PSIs.RoleType.gdlTmConstruct, tm);
+ Topic descriptorRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlDescriptor, tm);
+ Topic associationViewBindingAssocType = getTopicByPsi(PSIs.GDL.AssociationType.gdlAssociationViewBinding, tm);
+ Topic tmConstructRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlTmConstruct, tm);
Topic topicRoleConstraintType = getTopicByPsi(PSIs.TMCL.tmclTopicRoleConstraint, tm);
ArrayList<Topic> result = getOtherPlayerOfBinaryAssociation(viewRepresentative, descriptorRoleType, associationViewBindingAssocType, null, topicRoleConstraintType, tmConstructRoleType);
@@ -777,10 +777,10 @@
if(isInstanceOf(localCurrentConstraint, tmclConstraintType)) return localCurrentConstraint;
else {
// get next constraint and invoke this method recursively
- Topic descriptorRoleType = getTopicByPsi(PSIs.RoleType.gdlDescriptor, tm);
- Topic tmBindingAssocType = getTopicByPsi(PSIs.AssociationType.gdlTmBinding, tm);
- Topic tmConstructRoleType = getTopicByPsi(PSIs.RoleType.gdlTmConstruct, tm);
- Topic gdlDescriptor = getTopicByPsi(PSIs.TopicType.gdlDescriptor, tm);
+ Topic descriptorRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlDescriptor, tm);
+ Topic tmBindingAssocType = getTopicByPsi(PSIs.GDL.AssociationType.gdlTmBinding, tm);
+ Topic tmConstructRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlTmConstruct, tm);
+ Topic gdlDescriptor = getTopicByPsi(PSIs.GDL.TopicType.gdlDescriptor, tm);
ArrayList<Topic> nextTmclConstraints = getOtherPlayerOfBinaryAssociation(localCurrentConstraint, descriptorRoleType, tmBindingAssocType, null, tmclConstraintType, tmConstructRoleType);
ArrayList<Topic> nextGdlConstraints = getOtherPlayerOfBinaryAssociation(localCurrentConstraint, descriptorRoleType, tmBindingAssocType, null, gdlDescriptor, tmConstructRoleType);
@@ -800,16 +800,16 @@
if(valueGroup == null) return null;
TopicMap tm = valueGroup.getTopicMap();
- Topic valueBindingAssocTopic = getTopicByPsi(PSIs.AssociationType.gdlValueBinding, tm);
- Topic valueGroupRoleType = getTopicByPsi(PSIs.RoleType.gdlValueGroup, tm);
- Topic valueRoleType = getTopicByPsi(PSIs.RoleType.gdlValue, tm);
- Topic defaultTmValueType = getTopicByPsi(PSIs.TopicType.gdlDefaultTmValue, tm);
+ Topic valueBindingAssocTopic = getTopicByPsi(PSIs.GDL.AssociationType.gdlValueBinding, tm);
+ Topic valueGroupRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlValueGroup, tm);
+ Topic valueRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlValue, tm);
+ Topic defaultTmValueType = getTopicByPsi(PSIs.GDL.TopicType.gdlDefaultTmValue, tm);
ArrayList<Topic> defaultTmValues = getOtherPlayerOfBinaryAssociation(valueGroup, valueGroupRoleType, valueBindingAssocTopic, null, defaultTmValueType, valueRoleType);
if(defaultTmValues.size() == 1) return defaultTmValues.get(0);
else if(defaultTmValues.size() == 0) return null;
- else throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(valueGroup) + " must be bound none or once to a " + PSIs.TopicType.gdlDefaultTmValue + ", but is: " + defaultTmValues.size());
+ else throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(valueGroup) + " must be bound none or once to a " + PSIs.GDL.TopicType.gdlDefaultTmValue + ", but is: " + defaultTmValues.size());
}
@@ -818,16 +818,16 @@
if(valueGroup == null) return null;
TopicMap tm = valueGroup.getTopicMap();
- Topic valueBindingAssocTopic = getTopicByPsi(PSIs.AssociationType.gdlValueBinding, tm);
- Topic valueGroupRoleType = getTopicByPsi(PSIs.RoleType.gdlValueGroup, tm);
- Topic valueRoleType = getTopicByPsi(PSIs.RoleType.gdlValue, tm);
- Topic defaultLiteralValueType = getTopicByPsi(PSIs.TopicType.gdlDefaultLiteralValue, tm);
+ Topic valueBindingAssocTopic = getTopicByPsi(PSIs.GDL.AssociationType.gdlValueBinding, tm);
+ Topic valueGroupRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlValueGroup, tm);
+ Topic valueRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlValue, tm);
+ Topic defaultLiteralValueType = getTopicByPsi(PSIs.GDL.TopicType.gdlDefaultLiteralValue, tm);
ArrayList<Topic> defaultTmValues = getOtherPlayerOfBinaryAssociation(valueGroup, valueGroupRoleType, valueBindingAssocTopic, null, defaultLiteralValueType, valueRoleType);
if(defaultTmValues.size() == 1) return defaultTmValues.get(0);
else if(defaultTmValues.size() == 0) return null;
- else throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(valueGroup) + " must be bound none or once to a " + PSIs.TopicType.gdlDefaultLiteralValue + ", but is: " + defaultTmValues.size());
+ else throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(valueGroup) + " must be bound none or once to a " + PSIs.GDL.TopicType.gdlDefaultLiteralValue + ", but is: " + defaultTmValues.size());
}
@@ -837,10 +837,10 @@
if(valueGroup == null) return result;
TopicMap tm = valueGroup.getTopicMap();
- Topic valueBindingAssocTopic = getTopicByPsi(PSIs.AssociationType.gdlValueBinding, tm);
- Topic valueGroupRoleType = getTopicByPsi(PSIs.RoleType.gdlValueGroup, tm);
- Topic valueRoleType = getTopicByPsi(PSIs.RoleType.gdlValue, tm);
- Topic tmValueType = getTopicByPsi(PSIs.TopicType.gdlTmValue, tm);
+ Topic valueBindingAssocTopic = getTopicByPsi(PSIs.GDL.AssociationType.gdlValueBinding, tm);
+ Topic valueGroupRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlValueGroup, tm);
+ Topic valueRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlValue, tm);
+ Topic tmValueType = getTopicByPsi(PSIs.GDL.TopicType.gdlTmValue, tm);
return getOtherPlayerOfBinaryAssociation(valueGroup, valueGroupRoleType, valueBindingAssocTopic, null, tmValueType, valueRoleType);
}
@@ -852,10 +852,10 @@
if(valueGroup == null) return result;
TopicMap tm = valueGroup.getTopicMap();
- Topic valueBindingAssocTopic = getTopicByPsi(PSIs.AssociationType.gdlValueBinding, tm);
- Topic valueGroupRoleType = getTopicByPsi(PSIs.RoleType.gdlValueGroup, tm);
- Topic valueRoleType = getTopicByPsi(PSIs.RoleType.gdlValue, tm);
- Topic literalValueType = getTopicByPsi(PSIs.TopicType.gdlLiteralValue, tm);
+ Topic valueBindingAssocTopic = getTopicByPsi(PSIs.GDL.AssociationType.gdlValueBinding, tm);
+ Topic valueGroupRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlValueGroup, tm);
+ Topic valueRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlValue, tm);
+ Topic literalValueType = getTopicByPsi(PSIs.GDL.TopicType.gdlLiteralValue, tm);
return getOtherPlayerOfBinaryAssociation(valueGroup, valueGroupRoleType, valueBindingAssocTopic, null, literalValueType, valueRoleType);
}
@@ -866,13 +866,13 @@
ArrayList<Topic> result = new ArrayList<Topic>();
if(constraint == null || valueGroup == null) return result;
- if(isInstanceOf(constraint, PSIs.TopicType.gdlType)){
+ if(isInstanceOf(constraint, PSIs.GDL.TopicType.gdlType)){
return getTmValuesForTypeConstraint(constraint, valueGroup);
- } else if(isInstanceOf(constraint, PSIs.TopicType.gdlVariantNameReifier)){
+ } else if(isInstanceOf(constraint, PSIs.GDL.TopicType.gdlVariantNameReifier)){
return getTmValuesForVariantNameReifierConstraint(constraint);
- } else if(isInstanceOf(constraint, PSIs.TopicType.gdlVariantNameScope)){
+ } else if(isInstanceOf(constraint, PSIs.GDL.TopicType.gdlVariantNameScope)){
return getTmValuesForVariantNameScopeConstraint(constraint);
- } else if(isInstanceOf(constraint, PSIs.TopicType.gdlRolePlayer)){
+ } else if(isInstanceOf(constraint, PSIs.GDL.TopicType.gdlRolePlayer)){
return getTmValuesForRolePlayerConstraint(constraint);
} else if(isInstanceOf(constraint, PSIs.TMCL.tmclReifierConstraint)){
return getTmValuesForReifierConstraint(constraint);
@@ -1068,9 +1068,9 @@
if(tmValueOrValueGroup == null) return new ArrayList<Topic>();
TopicMap tm = tmValueOrValueGroup.getTopicMap();
- Topic descriptorRoleType = getTopicByPsi(PSIs.RoleType.gdlDescriptor, tm);
- Topic preferredScopeAssocType = getTopicByPsi(PSIs.AssociationType.gdlPrefferedScope, tm);
- Topic tmConstructRoleType = getTopicByPsi(PSIs.RoleType.gdlTmConstruct, tm);
+ Topic descriptorRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlDescriptor, tm);
+ Topic preferredScopeAssocType = getTopicByPsi(PSIs.GDL.AssociationType.gdlPrefferedScope, tm);
+ Topic tmConstructRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlTmConstruct, tm);
return getOtherPlayerOfBinaryAssociation(tmValueOrValueGroup, descriptorRoleType, preferredScopeAssocType, null, tmConstructRoleType);
}
@@ -1081,9 +1081,9 @@
if(tmValueOrvalueGroup == null) return null;
TopicMap tm = tmValueOrvalueGroup.getTopicMap();
- Topic displayByAssocType = getTopicByPsi(PSIs.AssociationType.gdlDisplayBy, tm);
- Topic descriptorRoleType = getTopicByPsi(PSIs.RoleType.gdlDescriptor, tm);
- Topic tmConstruct = getTopicByPsi(PSIs.RoleType.gdlTmConstruct, tm);
+ Topic displayByAssocType = getTopicByPsi(PSIs.GDL.AssociationType.gdlDisplayBy, tm);
+ Topic descriptorRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlDescriptor, tm);
+ Topic tmConstruct = getTopicByPsi(PSIs.GDL.RoleType.gdlTmConstruct, tm);
Topic subjectIdentifierConstraintType = getTopicByPsi(PSIs.TMCL.tmclSubjectIdentifierConstraint, tm);
Topic subjectLocatorConstraintType = getTopicByPsi(PSIs.TMCL.tmclSubjectLocatorConstraint, tm);
Topic itemIdentifierConstraintType = getTopicByPsi(PSIs.TMCL.tmclItemIdentifierConstraint, tm);
@@ -1095,7 +1095,7 @@
ArrayList<Topic> result = Utils.union(Utils.union(Utils.union(resultPsi, resultSl), resultIi), resultName);
- if(result.size() > 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(tmValueOrvalueGroup) + " must be bound none or once to a tmcl:constraint via a " + PSIs.AssociationType.gdlDisplayBy + " assciation, but is: " + result.size());
+ if(result.size() > 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(tmValueOrvalueGroup) + " must be bound none or once to a tmcl:constraint via a " + PSIs.GDL.AssociationType.gdlDisplayBy + " assciation, but is: " + result.size());
else if(result.size() == 1) return result.get(0);
else return null;
}
@@ -1107,7 +1107,7 @@
if(topicToRepresent == null) return null;
if(displayBy == null){
- if(topicToRepresent.getSubjectIdentifiers().length() == 0) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(topicToRepresent) + " is not bound to a " + PSIs.AssociationType.gdlDisplayBy + " association and is not bound to a Subject-Identifier - but one of them must be set");
+ if(topicToRepresent.getSubjectIdentifiers().length() == 0) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(topicToRepresent) + " is not bound to a " + PSIs.GDL.AssociationType.gdlDisplayBy + " association and is not bound to a Subject-Identifier - but one of them must be set");
else return topicToRepresent.getSubjectIdentifiers().get(0).getReference();
} else {
TopicMap tm = topicToRepresent.getTopicMap();
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlActionButton.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlActionButton.java Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlActionButton.java Wed Aug 24 08:47:02 2011 (r778)
@@ -79,9 +79,9 @@
public TextAlignValue getTextAlign(String styleClass) throws InvalidGdlSchemaException {
Occurrence textAlignOcc = null;
if(styleClass != null){
- textAlignOcc = super.getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlTextAlign, styleClass);
+ textAlignOcc = super.getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlTextAlign, styleClass);
} else {
- textAlignOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlTextAlign);
+ textAlignOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlTextAlign);
}
if(textAlignOcc == null && styleClass != null){
@@ -92,7 +92,7 @@
try{
return TextAlignValue.valueOf(textAlignOcc.getValue().toUpperCase());
}catch(IllegalArgumentException e){
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlTextAlign + " must be set to one of \"left\", \"right\", \"center\" or \"justify\", but is \"" + textAlignOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlTextAlign + " must be set to one of \"left\", \"right\", \"center\" or \"justify\", but is \"" + textAlignOcc.getValue() + "\"");
}
}
}
@@ -105,9 +105,9 @@
public AbsoluteNumValue getBorderWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
- widthOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderWidth, styleClass);
+ widthOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderWidth, styleClass);
} else {
- widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderWidth);
+ widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderWidth);
}
if(widthOcc == null && styleClass != null){
@@ -128,9 +128,9 @@
public NumUnitValue getPadding(String styleClass) throws InvalidGdlSchemaException {
Occurrence paddingOcc = null;
if(styleClass != null){
- paddingOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlPadding, styleClass);
+ paddingOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlPadding, styleClass);
} else {
- paddingOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlPadding);
+ paddingOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlPadding);
}
if(paddingOcc == null && styleClass != null){
@@ -151,9 +151,9 @@
public ColorValue getBorderColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
- colorOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderColor, styleClass);
+ colorOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderColor, styleClass);
} else {
- colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderColor);
+ colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderColor);
}
if(colorOcc == null && styleClass != null){
@@ -174,9 +174,9 @@
public BorderStyleValue getBorderStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
- styleOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderStyle, styleClass);
+ styleOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderStyle, styleClass);
} else {
- styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderStyle);
+ styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderStyle);
}
if(styleOcc == null && styleClass != null){
@@ -201,9 +201,9 @@
public CursorValue getCursor(String styleClass) throws InvalidGdlSchemaException {
Occurrence cursorOcc = null;
if(styleClass != null){
- cursorOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlCursor, styleClass);
+ cursorOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlCursor, styleClass);
} else {
- cursorOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlCursor);
+ cursorOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlCursor);
}
if(cursorOcc == null && styleClass != null){
@@ -231,9 +231,9 @@
public NumUnitValue getBorderRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
- radiusOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderRadius, styleClass);
+ radiusOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRadius, styleClass);
} else {
- radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderRadius);
+ radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRadius);
}
if(radiusOcc == null && styleClass != null){
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlAudio.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlAudio.java Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlAudio.java Wed Aug 24 08:47:02 2011 (r778)
@@ -9,7 +9,7 @@
public class GdlAudio extends GdlComplexData {
// some constructors
protected GdlAudio() throws ExecutionException {
- throw new ExecutionException(PSIs.TopicType.gdlAudio + " is not implemented by anaToMia yet");
+ throw new ExecutionException(PSIs.GDL.TopicType.gdlAudio + " is not implemented by anaToMia yet");
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlImage.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlImage.java Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlImage.java Wed Aug 24 08:47:02 2011 (r778)
@@ -9,7 +9,7 @@
public class GdlImage extends GdlComplexData {
// some constructors
protected GdlImage() throws ExecutionException {
- throw new ExecutionException(PSIs.TopicType.gdlImage + " is not implemented by anaToMia yet");
+ throw new ExecutionException(PSIs.GDL.TopicType.gdlImage + " is not implemented by anaToMia yet");
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlVideo.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlVideo.java Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlVideo.java Wed Aug 24 08:47:02 2011 (r778)
@@ -9,7 +9,7 @@
public class GdlVideo extends GdlComplexData {
// some constructors
protected GdlVideo() throws ExecutionException {
- throw new ExecutionException(PSIs.TopicType.gdlVideo + " is not implemented by anaToMia yet");
+ throw new ExecutionException(PSIs.GDL.TopicType.gdlVideo + " is not implemented by anaToMia yet");
}
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 Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java Wed Aug 24 08:47:02 2011 (r778)
@@ -100,7 +100,7 @@
// returns the property of a gdl:ordered occurrence, otherwise the default value if no occurrence is set
public boolean getOrdered() throws InvalidGdlSchemaException{
- Occurrence orderedOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlOrdered);
+ Occurrence orderedOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlOrdered);
if(orderedOcc != null){
String boolStr = orderedOcc.getValue().toUpperCase();
@@ -109,7 +109,7 @@
} else if(boolStr.equals("FALSE")) {
return false;
} else {
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlOrdered + " must be set to one of \"true\" or \"false\", but is \"" + orderedOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlOrdered + " must be set to one of \"true\" or \"false\", but is \"" + orderedOcc.getValue() + "\"");
}
} else {
return false;
@@ -119,7 +119,7 @@
// returns a ListStyleTypeValeu instance that describes this instance's list style type property
public ListStyleTypeValue getListStyleType() throws InvalidGdlSchemaException {
- Occurrence typeOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlListStyleType);
+ Occurrence typeOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlListStyleType);
if(typeOcc != null){
try{
@@ -127,7 +127,7 @@
}catch(IllegalArgumentException e){
String values = "deciaml, decimal-leading-zero, lower-greek, lower-roman, armenian, georgian, upper-roman, " +
"lower-alpha, upper-alpha, lower-latin, upper-latin, disc, circle, square or none";
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlListStyleType + " must be set to one of " + values + " , but is \"" + typeOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlListStyleType + " must be set to one of " + values + " , but is \"" + typeOcc.getValue() + "\"");
}
} else if(this.getOrdered()){
return ListStyleTypeValue.DECIMAL;
@@ -139,13 +139,13 @@
// returns a ListStylePositionValue instance that describes this instance's list style position property
public ListStylePositionValue getListStylePosition() throws InvalidGdlSchemaException {
- Occurrence positionOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlListStylePosition);
+ Occurrence positionOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlListStylePosition);
if(positionOcc != null){
try{
return ListStylePositionValue.valueOf(positionOcc.getValue().toUpperCase());
}catch(IllegalArgumentException e){
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlListStylePosition + " must be set to one of inside or outside, but is \"" + positionOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlListStylePosition + " must be set to one of inside or outside, but is \"" + positionOcc.getValue() + "\"");
}
} else{
return ListStylePositionValue.OUTSIDE;
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 Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java Wed Aug 24 08:47:02 2011 (r778)
@@ -107,7 +107,7 @@
// returns a String instance that represents the literal value of this elements name.
public String getUnitName() throws InvalidGdlSchemaException {
- Occurrence nameOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlUnitName);
+ Occurrence nameOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlUnitName);
if(nameOcc == null){
return "";
@@ -131,9 +131,9 @@
public BorderStyleValue getBorderStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
- styleOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderStyle, styleClass);
+ styleOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderStyle, styleClass);
} else {
- styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderStyle);
+ styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderStyle);
}
if(styleOcc == null && styleClass != null){
@@ -205,9 +205,9 @@
} else {
this.constraintTopicSet = true;
TopicMap tm = this.tmRepresentative.getTopicMap();
- Topic descriptorRoleType = TmHelper.getTopicByPsi(PSIs.RoleType.gdlDescriptor, tm);
- Topic tmBindingAssocType = TmHelper.getTopicByPsi(PSIs.AssociationType.gdlTmBinding, tm);
- Topic tmConstructRoleType = TmHelper.getTopicByPsi(PSIs.RoleType.gdlTmConstruct, tm);
+ Topic descriptorRoleType = TmHelper.getTopicByPsi(PSIs.GDL.RoleType.gdlDescriptor, tm);
+ Topic tmBindingAssocType = TmHelper.getTopicByPsi(PSIs.GDL.AssociationType.gdlTmBinding, tm);
+ Topic tmConstructRoleType = TmHelper.getTopicByPsi(PSIs.GDL.RoleType.gdlTmConstruct, tm);
Topic tmclTopicNameConstraintType = TmHelper.getTopicByPsi(PSIs.TMCL.tmclTopicNameConstraint, tm);
Topic tmclVariantNameConstraintType = TmHelper.getTopicByPsi(PSIs.TMCL.tmclVariantNameConstraint, tm);
Topic tmclTopicOccurrenceConstraintType = TmHelper.getTopicByPsi(PSIs.TMCL.tmclTopicOccurrenceConstraint, tm);
@@ -343,7 +343,7 @@
public void onAttach(){
super.onAttach();
try{
- String[] styleClasses = new String[]{null, PSIs.Scope.gdlActive, PSIs.Scope.gdlFocus, PSIs.Scope.gdlHover};
+ String[] styleClasses = new String[]{null, PSIs.GDL.Scope.gdlActive, PSIs.GDL.Scope.gdlFocus, PSIs.GDL.Scope.gdlHover};
for (String styleClass : styleClasses) {
GdlUnit.this.setTextDecoration(this, GdlUnit.this.getTextDecoration(styleClass), styleClass);
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/GdlInstantiator.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/GdlInstantiator.java Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/GdlInstantiator.java Wed Aug 24 08:47:02 2011 (r778)
@@ -49,59 +49,59 @@
public static GdlVisibleObject instantiate(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
if(!(receivedData instanceof Topic) && !(receivedData instanceof Association) && !(receivedData instanceof Name) && !(receivedData instanceof Variant) && !(receivedData instanceof Occurrence) && !(receivedData instanceof Role) && receivedData != null) throw new ExecutionException("receivedData must be either a Topic, Association, Topic-Name, Name-Variant, Topic-Occurrence or Association-Role, but is: " + receivedData.getClass());
- if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlSpace)){
+ if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlSpace)){
return new GdlSpace(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlTitle)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlTitle)){
return new GdlTitle(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlInfo)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlInfo)){
return new GdlInfo(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlReference)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlReference)){
return new GdlReference(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlRadioButton)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlRadioButton)){
return new GdlRadioButton(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlCheckBox)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlCheckBox)){
return new GdlCheckBox(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlValidateButton)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlValidateButton)){
return new GdlValidateButton(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlCreateButton)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlCreateButton)){
return new GdlCreateButton(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlDeleteButton)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlDeleteButton)){
return new GdlDeleteButton(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlCommitButton)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlCommitButton)){
return new GdlCommitButton(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlActionButton)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlActionButton)){
return new GdlActionButton(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlImage)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlImage)){
return new GdlImage(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlVideo)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlVideo)){
return new GdlVideo(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlAudio)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlAudio)){
return new GdlAudio(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlDatePicker)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlDatePicker)){
return new GdlDatePicker(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlTimePicker)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlTimePicker)){
return new GdlTimePicker(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlDateTimePicker)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlDateTimePicker)){
return new GdlDateTimePicker(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlUnit)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlUnit)){
return new GdlUnit(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlText)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlText)){
return new GdlText(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlList)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlList)){
return new GdlList(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlListBox)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlListBox)){
return new GdlListBox(tmRepresentative, receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlDefaultCreatorTopicView)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlDefaultCreatorTopicView)){
return new GdlDefaultCreatorTopicView(tmRepresentative);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlDefaultEditorTopicView)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlDefaultEditorTopicView)){
return new GdlDefaultEditorTopicView(tmRepresentative, (Topic)receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlSpecialCreatorTopicView)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlSpecialCreatorTopicView)){
return new GdlSpecialCreatorTopicView(tmRepresentative);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlSpecialEditorTopicView)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlSpecialEditorTopicView)){
return new GdlSpecialEditorTopicView(tmRepresentative, (Topic)receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlCreatorAssociationview)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlCreatorAssociationview)){
return new GdlCreatorAssociationView(tmRepresentative, (Association)receivedData);
- }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlEditorAssociationView)){
+ }else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlEditorAssociationView)){
return new GdlEditorAssociationView(tmRepresentative, (Association)receivedData);
}else{
String values = "";
@@ -119,7 +119,7 @@
// returns a GdlDefaultCreatorTopicView that corresponds to the passed arguments
public static GdlDefaultCreatorTopicView instantiateDefaultCreatorTopicView(ArrayList<Pair<String, TopicIdentifierTypes>> requestedTopics, TopicMap schemaTm) throws InvalidGdlSchemaException, ExecutionException{
- ArrayList<Topic> views = getViewTopics(requestedTopics, TmHelper.getTopicByPsi(PSIs.TopicType.gdlDefaultCreatorTopicView, schemaTm), schemaTm);
+ ArrayList<Topic> views = getViewTopics(requestedTopics, TmHelper.getTopicByPsi(PSIs.GDL.TopicType.gdlDefaultCreatorTopicView, schemaTm), schemaTm);
if(views.size() != 1){
String values = "";
@@ -131,7 +131,7 @@
bindings += ", " + TmHelper.getAnyIdOfTopic(top);
if(bindings.length() >= 2)bindings = bindings.substring(2);
else bindings = "[]";
- throw new InvalidGdlSchemaException("the combination of topics requested (" + values + ") must be bound exactly once to a " + PSIs.TopicType.gdlDefaultCreatorTopicView + " but is bound to " + bindings);
+ throw new InvalidGdlSchemaException("the combination of topics requested (" + values + ") must be bound exactly once to a " + PSIs.GDL.TopicType.gdlDefaultCreatorTopicView + " but is bound to " + bindings);
}
return new GdlDefaultCreatorTopicView(views.get(0));
@@ -154,11 +154,11 @@
// get all TM-Values, i.e. TM-Multiple-Type-Value and TM-Single-Type-Value (only if requstedTops.sie() == 1)
ArrayList<Topic> tmValues = new ArrayList<Topic>();
- Topic tmConstruct = TmHelper.getTopicByPsi(PSIs.RoleType.gdlTmConstruct, schemaTm);
- Topic tmBinding = TmHelper.getTopicByPsi(PSIs.AssociationType.gdlTmBinding, schemaTm);
- Topic descriptor = TmHelper.getTopicByPsi(PSIs.RoleType.gdlDescriptor, schemaTm);
- Topic tmMultipleTypeValue = TmHelper.getTopicByPsi(PSIs.TopicType.gdlTmMultipleTypeValue, schemaTm);
- Topic tmSingleTypeValue = TmHelper.getTopicByPsi(PSIs.TopicType.gdlTmSingleTypeValue, schemaTm);
+ Topic tmConstruct = TmHelper.getTopicByPsi(PSIs.GDL.RoleType.gdlTmConstruct, schemaTm);
+ Topic tmBinding = TmHelper.getTopicByPsi(PSIs.GDL.AssociationType.gdlTmBinding, schemaTm);
+ Topic descriptor = TmHelper.getTopicByPsi(PSIs.GDL.RoleType.gdlDescriptor, schemaTm);
+ Topic tmMultipleTypeValue = TmHelper.getTopicByPsi(PSIs.GDL.TopicType.gdlTmMultipleTypeValue, schemaTm);
+ Topic tmSingleTypeValue = TmHelper.getTopicByPsi(PSIs.GDL.TopicType.gdlTmSingleTypeValue, schemaTm);
for (Topic requestedTopic : requestedTops) {
ArrayList<Topic> allTmValues = TmHelper.getOtherPlayerOfBinaryAssociation(requestedTopic, tmConstruct, tmBinding, null, descriptor);
// filter only the valid tm-values for this scenario
@@ -175,8 +175,8 @@
// get all views that are bound to the found tm-values
ArrayList<Topic> views = new ArrayList<Topic>();
- Topic tmValueRoleType = TmHelper.getTopicByPsi(PSIs.RoleType.gdlTmValue, schemaTm);
- Topic topicViewBinding = TmHelper.getTopicByPsi(PSIs.AssociationType.gdlTopicViewBinding, schemaTm);
+ Topic tmValueRoleType = TmHelper.getTopicByPsi(PSIs.GDL.RoleType.gdlTmValue, schemaTm);
+ Topic topicViewBinding = TmHelper.getTopicByPsi(PSIs.GDL.AssociationType.gdlTopicViewBinding, schemaTm);
for (Topic tmValue : tmValues) {
ArrayList<Topic> allViews = TmHelper.getOtherPlayerOfBinaryAssociation(tmValue, tmValueRoleType, topicViewBinding, null, viewSupertype, descriptor);
for (Topic view : allViews)
@@ -197,15 +197,15 @@
if(requestedTop == null) throw new InvalidGdlSchemaException("the topic " + requestedTopic.getFirst() + " was not found!");
// get all tm-instance-value topics bound to the requested topic
- Topic tmConstruct = TmHelper.getTopicByPsi(PSIs.RoleType.gdlTmConstruct, schemaTm);
- Topic tmBinding = TmHelper.getTopicByPsi(PSIs.AssociationType.gdlTmBinding, schemaTm);
- Topic descriptor = TmHelper.getTopicByPsi(PSIs.RoleType.gdlDescriptor, schemaTm);
+ Topic tmConstruct = TmHelper.getTopicByPsi(PSIs.GDL.RoleType.gdlTmConstruct, schemaTm);
+ Topic tmBinding = TmHelper.getTopicByPsi(PSIs.GDL.AssociationType.gdlTmBinding, schemaTm);
+ Topic descriptor = TmHelper.getTopicByPsi(PSIs.GDL.RoleType.gdlDescriptor, schemaTm);
ArrayList<Topic> tmInstanceValues = TmHelper.getOtherPlayerOfBinaryAssociation(requestedTop, tmConstruct, tmBinding, null, descriptor);
// get all views bound to the found tm-instance-values
- Topic defaultEditorTopicView = TmHelper.getTopicByPsi(PSIs.TopicType.gdlDefaultEditorTopicView, schemaTm);
- Topic tmValue = TmHelper.getTopicByPsi(PSIs.RoleType.gdlTmValue, schemaTm);
- Topic topicViewBinding = TmHelper.getTopicByPsi(PSIs.AssociationType.gdlTopicViewBinding, schemaTm);
+ Topic defaultEditorTopicView = TmHelper.getTopicByPsi(PSIs.GDL.TopicType.gdlDefaultEditorTopicView, schemaTm);
+ Topic tmValue = TmHelper.getTopicByPsi(PSIs.GDL.RoleType.gdlTmValue, schemaTm);
+ Topic topicViewBinding = TmHelper.getTopicByPsi(PSIs.GDL.AssociationType.gdlTopicViewBinding, schemaTm);
ArrayList<Topic> views = new ArrayList<Topic>();
for (Topic tmInstanceValue : tmInstanceValues) {
ArrayList<Topic> tmpViews = TmHelper.getOtherPlayerOfBinaryAssociation(tmInstanceValue, tmValue, topicViewBinding, null, defaultEditorTopicView, descriptor);
@@ -219,7 +219,7 @@
for (Topic top : views)
bindings += ", " + TmHelper.getAnyIdOfTopic(top);
if(bindings.length() >= 2)bindings = bindings.substring(2);
- throw new InvalidGdlSchemaException("the topic " + requestedTopic.getFirst() + " requested for editing must be bound to exaclty one " + PSIs.TopicType.gdlDefaultEditorTopicView + ", but is bound to " + bindings);
+ throw new InvalidGdlSchemaException("the topic " + requestedTopic.getFirst() + " requested for editing must be bound to exaclty one " + PSIs.GDL.TopicType.gdlDefaultEditorTopicView + ", but is bound to " + bindings);
}else {
ArrayList<Pair<String, TopicIdentifierTypes>> typesOfRequestedTopic = new ArrayList<Pair<String,TopicIdentifierTypes>>();
for(int i = 0; i != requestedTop.getTypes().length(); ++i)
@@ -237,7 +237,7 @@
bindings += ", " + TmHelper.getAnyIdOfTopic(top);
if(bindings.length() >= 2)bindings = bindings.substring(2) + "]";
else bindings = "[ ]";
- throw new InvalidGdlSchemaException("the combination of topic types (" + values + ") for the requested topic " + requestedTopic.getFirst() + " must be bound exactly once to a " + PSIs.TopicType.gdlDefaultEditorTopicView + " but is bound to " + bindings);
+ throw new InvalidGdlSchemaException("the combination of topic types (" + values + ") for the requested topic " + requestedTopic.getFirst() + " must be bound exactly once to a " + PSIs.GDL.TopicType.gdlDefaultEditorTopicView + " but is bound to " + bindings);
}
return new GdlDefaultEditorTopicView(views.get(0), requestedTop);
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlListBox.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlListBox.java Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlListBox.java Wed Aug 24 08:47:02 2011 (r778)
@@ -68,7 +68,7 @@
// returns the gdl:multiple property - if no value is set the default value is returned
public boolean getMultiple() throws InvalidGdlSchemaException {
- Occurrence multipleOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlMultiple);
+ Occurrence multipleOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlMultiple);
if(multipleOcc != null){
String boolStr = multipleOcc.getValue().toUpperCase();
@@ -77,7 +77,7 @@
} else if(boolStr.equals("FALSE")) {
return false;
} else {
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlMargin + " must be set to one of \"true\" or \"false\", but is \"" + multipleOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlMargin + " must be set to one of \"true\" or \"false\", but is \"" + multipleOcc.getValue() + "\"");
}
} else {
return false;
@@ -87,7 +87,7 @@
// returns the gdl:one-per-group property - if no value is set the default value is returned
public boolean getOnePerGroup() throws InvalidGdlSchemaException {
- Occurrence onePerGroupOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlOnePerGroup);
+ Occurrence onePerGroupOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlOnePerGroup);
if(onePerGroupOcc != null){
String boolStr = onePerGroupOcc.getValue().toUpperCase();
@@ -96,7 +96,7 @@
} else if(boolStr.equals("FALSE")) {
return false;
} else {
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlOnePerGroup + " must be set to one of \"true\" or \"false\", but is \"" + onePerGroupOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlOnePerGroup + " must be set to one of \"true\" or \"false\", but is \"" + onePerGroupOcc.getValue() + "\"");
}
} else {
return false;
@@ -107,15 +107,15 @@
// returns an int instance of a gdl:size occurrence.
// If no gdl:size occurrence is set, the default value is returned
public int getSize() throws InvalidGdlSchemaException {
- Occurrence rowsOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlSize);
+ Occurrence rowsOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlSize);
if(rowsOcc != null){
try{
int value = Integer.valueOf(rowsOcc.getValue());
- if(value < 0) throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlSize + " must be set to a positive integer, but is \"" + rowsOcc.getValue() + "\"");
+ if(value < 0) throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlSize + " must be set to a positive integer, but is \"" + rowsOcc.getValue() + "\"");
else return value;
}catch(NumberFormatException e){
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlSize + " must be set to a positive integer, but is \"" + rowsOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlSize + " must be set to a positive integer, but is \"" + rowsOcc.getValue() + "\"");
}
} else {
return 1;
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java Wed Aug 24 08:47:02 2011 (r778)
@@ -74,14 +74,14 @@
public ColorValue getColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
- colorOcc = super.getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlColor, styleClass);
+ colorOcc = super.getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlColor, styleClass);
} else {
- colorOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlColor);
+ colorOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlColor);
}
- if(colorOcc == null && (styleClass == null || styleClass.equals(PSIs.Scope.gdlFocus) || styleClass.equals(PSIs.Scope.gdlHover))){
+ if(colorOcc == null && (styleClass == null || styleClass.equals(PSIs.GDL.Scope.gdlFocus) || styleClass.equals(PSIs.GDL.Scope.gdlHover))){
return new ColorValue("#0000FF");
- }else if(colorOcc == null && styleClass.equals(PSIs.Scope.gdlActive)){
+ }else if(colorOcc == null && styleClass.equals(PSIs.GDL.Scope.gdlActive)){
return null;
}else {
return new ColorValue(colorOcc.getValue());
@@ -97,9 +97,9 @@
public CursorValue getCursor(String styleClass) throws InvalidGdlSchemaException {
Occurrence cursorOcc = null;
if(styleClass != null){
- cursorOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlCursor, styleClass);
+ cursorOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlCursor, styleClass);
} else {
- cursorOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlCursor);
+ cursorOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlCursor);
}
if(cursorOcc == null && styleClass != null){
@@ -126,9 +126,9 @@
public TextDecorationValue getTextDecoration(String styleClass) throws InvalidGdlSchemaException {
Occurrence decorationOcc = null;
if(styleClass != null){
- decorationOcc = super.getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlTextDecoration, styleClass);
+ decorationOcc = super.getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlTextDecoration, styleClass);
} else {
- decorationOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlTextDecoration);
+ decorationOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlTextDecoration);
}
if(decorationOcc == null && styleClass != null){
@@ -139,7 +139,7 @@
try{
return TextDecorationValue.valueOf(decorationOcc.getValue().toUpperCase());
}catch(IllegalArgumentException e){
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlTextDecoration + " must be set to one of \"underline\", \"overline\", \"line-through\", \"blink\" or \"none\", but is \"" + decorationOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlTextDecoration + " must be set to one of \"underline\", \"overline\", \"line-through\", \"blink\" or \"none\", but is \"" + decorationOcc.getValue() + "\"");
}
}
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Aug 24 08:47:02 2011 (r778)
@@ -129,7 +129,7 @@
Topic occurrenceType = TmHelper.getConstrainedStatement(this.getConstraint());
for(int i = 0; i != ((Topic)this.receivedData).getOccurrences(occurrenceType).length(); ++i)
this.createNewTextArea().setText(((Topic)this.receivedData).getOccurrences(occurrenceType).get(i).getValue());
- } else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TopicType.gdlRolePlayer)){
+ } else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.GDL.TopicType.gdlRolePlayer)){
this.createNewTextArea().setText("gdl:Role-Player instance");
// TODO: search role => role-type + role-player
// TODO: display the correponding value
@@ -140,13 +140,13 @@
// sets the field for the set default value or sets at least one empty field
protected void setDefaultValue() throws InvalidGdlSchemaException, ExecutionException {
- if(this.getDefaultLiteralValue() != null && this.getDefaultTmValue() != null) throw new InvalidGdlSchemaException("the topic " + TmHelper.getAnyIdOfTopic(this.getValueGroup()) + " must be bound to maximal one " + PSIs.TopicType.gdlDefaultValue + ", but is: 2");
+ if(this.getDefaultLiteralValue() != null && this.getDefaultTmValue() != null) throw new InvalidGdlSchemaException("the topic " + TmHelper.getAnyIdOfTopic(this.getValueGroup()) + " must be bound to maximal one " + PSIs.GDL.TopicType.gdlDefaultValue + ", but is: 2");
if(this.getDefaultLiteralValue() != null){
TopicMap tm = this.getDefaultLiteralValue().getTopicMap();
- Topic occType = TmHelper.getTopicByPsi(PSIs.OccurrenceType.gdlLiteralValue, tm);
+ Topic occType = TmHelper.getTopicByPsi(PSIs.GDL.OccurrenceType.gdlLiteralValue, tm);
JsArray<Occurrence> vals = this.getDefaultLiteralValue().getOccurrences(occType);
- if(vals.length() != 1) throw new InvalidGdlSchemaException("the topic " + TmHelper.getAnyIdOfTopic(this.getDefaultLiteralValue()) + " must be bound exactly once to a " + PSIs.OccurrenceType.gdlLiteralValue + " occurrence, but is: " + vals.length());
+ if(vals.length() != 1) throw new InvalidGdlSchemaException("the topic " + TmHelper.getAnyIdOfTopic(this.getDefaultLiteralValue()) + " must be bound exactly once to a " + PSIs.GDL.OccurrenceType.gdlLiteralValue + " occurrence, but is: " + vals.length());
this.createNewTextArea().setText(vals.get(0).getValue());
} else if(this.getDefaultTmValue() != null){
@@ -195,9 +195,9 @@
public AbsoluteNumValue getBorderWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
- widthOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderWidth, styleClass);
+ widthOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderWidth, styleClass);
} else {
- widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderWidth);
+ widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderWidth);
}
if(widthOcc == null) return null;
@@ -210,9 +210,9 @@
public AbsoluteNumValue getBorderTopWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
- widthOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderTopWidth, styleClass);
+ widthOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopWidth, styleClass);
} else {
- widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderTopWidth);
+ widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopWidth);
}
if(widthOcc == null) return null;
@@ -225,9 +225,9 @@
public AbsoluteNumValue getBorderRightWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
- widthOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderRightWidth, styleClass);
+ widthOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRightWidth, styleClass);
} else {
- widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderRightWidth);
+ widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRightWidth);
}
if(widthOcc == null) return null;
@@ -240,9 +240,9 @@
public AbsoluteNumValue getBorderBottomWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
- widthOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomWidth, styleClass);
+ widthOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomWidth, styleClass);
} else {
- widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomWidth);
+ widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomWidth);
}
if(widthOcc == null) return null;
@@ -255,9 +255,9 @@
public AbsoluteNumValue getBorderLeftWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
- widthOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderLeftWidth, styleClass);
+ widthOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderLeftWidth, styleClass);
} else {
- widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderLeftWidth);
+ widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderLeftWidth);
}
if(widthOcc == null) return null;
@@ -269,9 +269,9 @@
public NumUnitValue getBorderRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
- radiusOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderRadius, styleClass);
+ radiusOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRadius, styleClass);
} else {
- radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderRadius);
+ radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRadius);
}
if(radiusOcc == null) return null;
@@ -283,9 +283,9 @@
public NumUnitValue getBorderTopLeftRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
- radiusOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderTopLeftRadius, styleClass);
+ radiusOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopLeftRadius, styleClass);
} else {
- radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderTopLeftRadius);
+ radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopLeftRadius);
}
if(radiusOcc == null) return null;
@@ -297,9 +297,9 @@
public NumUnitValue getBorderTopRightRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
- radiusOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderTopRightRadius, styleClass);
+ radiusOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopRightRadius, styleClass);
} else {
- radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderTopRightRadius);
+ radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopRightRadius);
}
if(radiusOcc == null) return null;
@@ -311,9 +311,9 @@
public NumUnitValue getBorderBottomLeftRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
- radiusOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomLeftRadius, styleClass);
+ radiusOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomLeftRadius, styleClass);
} else {
- radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomLeftRadius);
+ radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomLeftRadius);
}
if(radiusOcc == null) return null;
@@ -325,9 +325,9 @@
public NumUnitValue getBorderBottomRightRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
- radiusOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomRightRadius, styleClass);
+ radiusOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomRightRadius, styleClass);
} else {
- radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomRightRadius);
+ radiusOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomRightRadius);
}
if(radiusOcc == null) return null;
@@ -339,9 +339,9 @@
public ColorValue getBorderColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
- colorOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderColor, styleClass);
+ colorOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderColor, styleClass);
} else {
- colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderColor);
+ colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderColor);
}
if(colorOcc == null ) return null;
@@ -353,9 +353,9 @@
public ColorValue getBorderTopColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
- colorOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderTopColor, styleClass);
+ colorOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopColor, styleClass);
} else {
- colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderTopColor);
+ colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopColor);
}
if(colorOcc == null ) return null;
@@ -367,9 +367,9 @@
public ColorValue getBorderRightColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
- colorOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderRightColor, styleClass);
+ colorOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRightColor, styleClass);
} else {
- colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderRightColor);
+ colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRightColor);
}
if(colorOcc == null ) return null;
@@ -381,9 +381,9 @@
public ColorValue getBorderBottomColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
- colorOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomColor, styleClass);
+ colorOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomColor, styleClass);
} else {
- colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomColor);
+ colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomColor);
}
if(colorOcc == null ) return null;
@@ -395,9 +395,9 @@
public ColorValue getBorderLeftColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
- colorOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderLeftColor, styleClass);
+ colorOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderLeftColor, styleClass);
} else {
- colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderLeftColor);
+ colorOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderLeftColor);
}
if(colorOcc == null ) return null;
@@ -409,9 +409,9 @@
public BorderStyleValue getBorderStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
- styleOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderStyle, styleClass);
+ styleOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderStyle, styleClass);
} else {
- styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderStyle);
+ styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderStyle);
}
if(styleOcc == null) {
@@ -431,9 +431,9 @@
public BorderStyleValue getBorderTopStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
- styleOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderTopStyle, styleClass);
+ styleOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopStyle, styleClass);
} else {
- styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderTopStyle);
+ styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderTopStyle);
}
if(styleOcc == null) {
@@ -453,9 +453,9 @@
public BorderStyleValue getBorderRightStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
- styleOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderRightStyle, styleClass);
+ styleOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRightStyle, styleClass);
} else {
- styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderRightStyle);
+ styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderRightStyle);
}
if(styleOcc == null) {
@@ -475,9 +475,9 @@
public BorderStyleValue getBorderBottomStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
- styleOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomStyle, styleClass);
+ styleOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomStyle, styleClass);
} else {
- styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderBottomStyle);
+ styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderBottomStyle);
}
if(styleOcc == null) {
@@ -497,9 +497,9 @@
public BorderStyleValue getBorderLeftStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
- styleOcc = getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlBorderLeftStyle, styleClass);
+ styleOcc = getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderLeftStyle, styleClass);
} else {
- styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlBorderLeftStyle);
+ styleOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlBorderLeftStyle);
}
if(styleOcc == null) {
@@ -518,13 +518,13 @@
// returns a TextType instance of a gdl:text-type occurrence.
// If no gdl:text-type occurrence is set, the default value is returned
public TextTypeValue getTextType() throws InvalidGdlSchemaException {
- Occurrence typeOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlTextType);
+ Occurrence typeOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlTextType);
if(typeOcc != null){
try{
return TextTypeValue.valueOf(typeOcc.getValue().toUpperCase());
}catch(IllegalArgumentException e){
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlTextType + " must be set to one of \"text\" or \"password\", but is \"" + typeOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlTextType + " must be set to one of \"text\" or \"password\", but is \"" + typeOcc.getValue() + "\"");
}
} else {
return TextTypeValue.Text;
@@ -535,7 +535,7 @@
// returns a boolean instance of a gdl:readonly occurrence.
// If no gdl:readonly occurrence is set, the default value is returned
public boolean getReadonly() throws InvalidGdlSchemaException {
- Occurrence readOnlyOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlReadonly);
+ Occurrence readOnlyOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlReadonly);
if(readOnlyOcc != null){
String boolStr = readOnlyOcc.getValue().toUpperCase();
@@ -544,7 +544,7 @@
} else if(boolStr.equals("FALSE")) {
return false;
} else {
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlReadonly + " must be set to one of \"true\" or \"false\", but is \"" + readOnlyOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlReadonly + " must be set to one of \"true\" or \"false\", but is \"" + readOnlyOcc.getValue() + "\"");
}
} else {
return true;
@@ -555,15 +555,15 @@
// returns an int instance of a gdl:rows occurrence.
// If no gdl:rows occurrence is set, the default value is returned
public int getRows() throws InvalidGdlSchemaException {
- Occurrence rowsOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlRows);
+ Occurrence rowsOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlRows);
if(rowsOcc != null){
try{
int value = Integer.valueOf(rowsOcc.getValue());
- if(value < 0) throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlRows + " must be set to a positive integer, but is \"" + rowsOcc.getValue() + "\"");
+ if(value < 0) throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlRows + " must be set to a positive integer, but is \"" + rowsOcc.getValue() + "\"");
else return value;
}catch(NumberFormatException e){
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlRows + " must be set to a positive integer, but is \"" + rowsOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlRows + " must be set to a positive integer, but is \"" + rowsOcc.getValue() + "\"");
}
} else {
return 1;
@@ -574,15 +574,15 @@
// returns a boolean instance of a gdl:cols occurrence.
// If no gdl:cols occurrence is set, the default value is returned
public int getCols() throws InvalidGdlSchemaException {
- Occurrence colsOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlCols);
+ Occurrence colsOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlCols);
if(colsOcc != null){
try{
int value = Integer.valueOf(colsOcc.getValue());
- if(value < 0) throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlCols + " must be set to a positive integer, but is \"" + colsOcc.getValue() + "\"");
+ if(value < 0) throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlCols + " must be set to a positive integer, but is \"" + colsOcc.getValue() + "\"");
else return value;
}catch(NumberFormatException e){
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlCols + " must be set to a positive integer, but is \"" + colsOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlCols + " must be set to a positive integer, but is \"" + colsOcc.getValue() + "\"");
}
} else {
return 5;
@@ -593,13 +593,13 @@
// returns a boolean instance of a gdl:resize occurrence.
// If no gdl:resize occurrence is set, the default value is returned
public ResizeValue getResize() throws InvalidGdlSchemaException {
- Occurrence resizeOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlResize);
+ Occurrence resizeOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlResize);
if(resizeOcc != null){
try{
return ResizeValue.valueOf(resizeOcc.getValue().toUpperCase());
}catch(IllegalArgumentException e){
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlResize + " must be set to one of \"both\", \"vertical\", \"horizontal\" or \"none\", but is \"" + resizeOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlResize + " must be set to one of \"both\", \"vertical\", \"horizontal\" or \"none\", but is \"" + resizeOcc.getValue() + "\"");
}
} else {
return ResizeValue.NONE;
@@ -655,8 +655,8 @@
// sets the rows property if gdl:width is not set
public void setRows(Widget widget, int value) throws InvalidGdlSchemaException, ExecutionException {
- if(value < 0) throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlRows + " must be set to a positive integer, but is \"" + value + "\"");
- Occurrence heightOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlHeight);
+ if(value < 0) throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlRows + " must be set to a positive integer, but is \"" + value + "\"");
+ Occurrence heightOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlHeight);
// rows is only treated if height is not set
if(heightOcc == null) ((TextArea)widget).setVisibleLines(value);
@@ -665,8 +665,8 @@
// sets the cols property if gdl:height is not set
public void setCols(Widget widget, int value) throws InvalidGdlSchemaException, ExecutionException {
- if(value < 0) throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlRows + " must be set to a positive integer, but is \"" + value + "\"");
- Occurrence widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlWidth);
+ if(value < 0) throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlRows + " must be set to a positive integer, but is \"" + value + "\"");
+ Occurrence widthOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlWidth);
// cols is only treated if width is not set
if(widthOcc == null) DOM.setElementAttribute(widget.getElement(), "cols", String.valueOf(value));
@@ -975,7 +975,7 @@
@Override
public Topic getDefaultValue() throws InvalidGdlSchemaException {
- if(this.getDefaultLiteralValue() != null && this.getDefaultTmValue() != null) throw new InvalidGdlSchemaException("the topic " + TmHelper.getAnyIdOfTopic(this.getValueGroup()) + " must be bound to maximal one " + PSIs.TopicType.gdlDefaultValue + ", but is: 2");
+ if(this.getDefaultLiteralValue() != null && this.getDefaultTmValue() != null) throw new InvalidGdlSchemaException("the topic " + TmHelper.getAnyIdOfTopic(this.getValueGroup()) + " must be bound to maximal one " + PSIs.GDL.TopicType.gdlDefaultValue + ", but is: 2");
else if(this.getDefaultLiteralValue() != null) return this.getDefaultLiteralValue();
else return this.getDefaultTmValue();
}
@@ -987,13 +987,13 @@
if(defVal == null) return false;
TopicMap tm = defVal.getTopicMap();
- Occurrence fixedOcc = TmHelper.getSingleOccurrence(defVal, TmHelper.getTopicByPsi(PSIs.OccurrenceType.gdlFixed, tm));
+ Occurrence fixedOcc = TmHelper.getSingleOccurrence(defVal, TmHelper.getTopicByPsi(PSIs.GDL.OccurrenceType.gdlFixed, tm));
if(fixedOcc != null){
try{
return Boolean.valueOf(fixedOcc.getValue().toLowerCase());
}catch(Exception e){
- throw new InvalidGdlSchemaException("the occurrence of type " + PSIs.OccurrenceType.gdlFixed + " bound to the topic " + TmHelper.getAnyIdOfTopic(defVal) + " must be set to either true or false, but is: " + fixedOcc.getValue());
+ throw new InvalidGdlSchemaException("the occurrence of type " + PSIs.GDL.OccurrenceType.gdlFixed + " bound to the topic " + TmHelper.getAnyIdOfTopic(defVal) + " must be set to either true or false, but is: " + fixedOcc.getValue());
}
} else {
return false;
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java Wed Aug 24 08:47:02 2011 (r778)
@@ -39,9 +39,9 @@
public DirectionValue getDirection(String styleClass) throws InvalidGdlSchemaException {
Occurrence directionOcc = null;
if(styleClass != null){
- directionOcc = super.getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlDirection, styleClass);
+ directionOcc = super.getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlDirection, styleClass);
} else {
- directionOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlDirection);
+ directionOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlDirection);
}
if(directionOcc == null && styleClass != null){
@@ -52,7 +52,7 @@
try{
return DirectionValue.valueOf(directionOcc.getValue().toUpperCase());
}catch(IllegalArgumentException e){
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlDirection + " must be set to one of \"ltr\" or \"rtl\", but is \"" + directionOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlDirection + " must be set to one of \"ltr\" or \"rtl\", but is \"" + directionOcc.getValue() + "\"");
}
}
}
@@ -64,9 +64,9 @@
public TextAlignValue getTextAlign(String styleClass) throws InvalidGdlSchemaException {
Occurrence textAlignOcc = null;
if(styleClass != null){
- textAlignOcc = super.getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlTextAlign, styleClass);
+ textAlignOcc = super.getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlTextAlign, styleClass);
} else {
- textAlignOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlTextAlign);
+ textAlignOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlTextAlign);
}
if(textAlignOcc == null && styleClass != null){
@@ -77,7 +77,7 @@
try{
return TextAlignValue.valueOf(textAlignOcc.getValue().toUpperCase());
}catch(IllegalArgumentException e){
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlTextAlign + " must be set to one of \"left\", \"right\", \"center\" or \"justify\", but is \"" + textAlignOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlTextAlign + " must be set to one of \"left\", \"right\", \"center\" or \"justify\", but is \"" + textAlignOcc.getValue() + "\"");
}
}
}
@@ -89,9 +89,9 @@
public NormalNumUnitValue getLineHeight(String styleClass) throws InvalidGdlSchemaException {
Occurrence lineHeightOcc = null;
if(styleClass != null){
- lineHeightOcc = super.getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlLineHeight, styleClass);
+ lineHeightOcc = super.getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlLineHeight, styleClass);
} else {
- lineHeightOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlLineHeight);
+ lineHeightOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlLineHeight);
}
if(lineHeightOcc == null && styleClass != null){
@@ -110,9 +110,9 @@
public TextDecorationValue getTextDecoration(String styleClass) throws InvalidGdlSchemaException {
Occurrence decorationOcc = null;
if(styleClass != null){
- decorationOcc = super.getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlTextDecoration, styleClass);
+ decorationOcc = super.getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlTextDecoration, styleClass);
} else {
- decorationOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlTextDecoration);
+ decorationOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlTextDecoration);
}
if(decorationOcc == null && styleClass != null){
@@ -123,7 +123,7 @@
try{
return TextDecorationValue.valueOf(decorationOcc.getValue().toUpperCase().replace("-", "_"));
}catch(IllegalArgumentException e){
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlTextDecoration + " must be set to one of \"underline\", \"overline\", \"line-through\", \"blink\" or \"none\", but is \"" + decorationOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlTextDecoration + " must be set to one of \"underline\", \"overline\", \"line-through\", \"blink\" or \"none\", but is \"" + decorationOcc.getValue() + "\"");
}
}
}
@@ -135,9 +135,9 @@
public ColorValue getColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
- colorOcc = super.getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlColor, styleClass);
+ colorOcc = super.getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlColor, styleClass);
} else {
- colorOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlColor);
+ colorOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlColor);
}
if(colorOcc == null && styleClass != null){
@@ -154,9 +154,9 @@
public String getFontFamily(String styleClass) throws InvalidGdlSchemaException {
Occurrence fontOcc = null;
if(styleClass != null){
- fontOcc = super.getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlFontfamily, styleClass);
+ fontOcc = super.getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlFontfamily, styleClass);
} else {
- fontOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlFontfamily);
+ fontOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlFontfamily);
}
if(fontOcc == null){
@@ -173,9 +173,9 @@
public FontStyle getFontStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
- styleOcc = super.getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlFontStyle, styleClass);
+ styleOcc = super.getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlFontStyle, styleClass);
} else {
- styleOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlFontStyle);
+ styleOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlFontStyle);
}
if(styleOcc == null && styleClass != null){
@@ -186,7 +186,7 @@
try{
return FontStyle.valueOf(styleOcc.getValue().toUpperCase());
}catch(IllegalArgumentException e){
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlFontStyle + " must be set to one of \"normal\", \"italic\" or \"oblique\", but is \"" + styleOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlFontStyle + " must be set to one of \"normal\", \"italic\" or \"oblique\", but is \"" + styleOcc.getValue() + "\"");
}
}
}
@@ -198,9 +198,9 @@
public PositiveNumUnitValue getFontSize(String styleClass) throws InvalidGdlSchemaException {
Occurrence sizeOcc = null;
if(styleClass != null){
- sizeOcc = super.getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlFontSize, styleClass);
+ sizeOcc = super.getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlFontSize, styleClass);
} else {
- sizeOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlFontSize);
+ sizeOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlFontSize);
}
if(sizeOcc == null && styleClass != null){
@@ -219,9 +219,9 @@
public FontWeightValue getFontWeight(String styleClass) throws InvalidGdlSchemaException {
Occurrence weightOcc = null;
if(styleClass != null){
- weightOcc = super.getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlFontWeight, styleClass);
+ weightOcc = super.getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlFontWeight, styleClass);
} else {
- weightOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlFontWeight);
+ weightOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlFontWeight);
}
if(weightOcc == null && styleClass != null){
@@ -233,7 +233,7 @@
return FontWeightValue.fromString(weightOcc.getValue());
}catch(IllegalArgumentException e){
String values = "normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800 or 900";
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlFontWeight + " must be set to one of " + values + ", but found " + weightOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlFontWeight + " must be set to one of " + values + ", but found " + weightOcc.getValue() + "\"");
}
}
}
@@ -245,9 +245,9 @@
public NormalNumUnitValue getLetterSpacing(String styleClass) throws InvalidGdlSchemaException {
Occurrence spacingOcc = null;
if(styleClass != null){
- spacingOcc = super.getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlLetterSpacing, styleClass);
+ spacingOcc = super.getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlLetterSpacing, styleClass);
} else {
- spacingOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlLetterSpacing);
+ spacingOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlLetterSpacing);
}
if(spacingOcc == null && styleClass != null){
@@ -266,9 +266,9 @@
public NormalNumUnitValue getWordSpacing(String styleClass) throws InvalidGdlSchemaException {
Occurrence spacingOcc = null;
if(styleClass != null){
- spacingOcc = super.getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlWordSpacing, styleClass);
+ spacingOcc = super.getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlWordSpacing, styleClass);
} else {
- spacingOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlWordSpacing);
+ spacingOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlWordSpacing);
}
if(spacingOcc == null && styleClass != null){
@@ -349,7 +349,7 @@
public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
super.setGdlStyle(widget);
- String[] styleClasses = new String[]{null, PSIs.Scope.gdlActive, PSIs.Scope.gdlFocus, PSIs.Scope.gdlHover};
+ String[] styleClasses = new String[]{null, PSIs.GDL.Scope.gdlActive, PSIs.GDL.Scope.gdlFocus, PSIs.GDL.Scope.gdlHover};
for (String styleClass : styleClasses) {
this.setColor(widget, this.getColor(styleClass), styleClass);
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java Wed Aug 24 08:47:02 2011 (r778)
@@ -100,9 +100,9 @@
public PositiveNumUnitValue getFontSize(String styleClass) throws InvalidGdlSchemaException {
Occurrence sizeOcc = null;
if(styleClass != null){
- sizeOcc = super.getNoneOrOneScopedOccurrence(PSIs.OccurrenceType.gdlFontSize, styleClass);
+ sizeOcc = super.getNoneOrOneScopedOccurrence(PSIs.GDL.OccurrenceType.gdlFontSize, styleClass);
} else {
- sizeOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlFontSize);
+ sizeOcc = super.getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlFontSize);
}
if(sizeOcc == null && styleClass != null){
@@ -122,14 +122,14 @@
// returns the property of a gdl:title-order occurrence, otherwise the default value if no occurrence is set
public int getTitleOrder() throws InvalidGdlSchemaException{
- Occurrence orderOcc = getNoneOrOneUnscopedOccurrence(PSIs.OccurrenceType.gdlTitleOrder);
+ Occurrence orderOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlTitleOrder);
if(orderOcc != null){
try{
int titleOrder = Integer.valueOf(orderOcc.getValue());
return titleOrder;
}catch(NumberFormatException e){
- throw new InvalidGdlSchemaException("The occurrence " + PSIs.OccurrenceType.gdlTitleOrder + " must be set to one of \"1\", \"2\", \"3\" or \"4\", but is \"" + orderOcc.getValue() + "\"");
+ throw new InvalidGdlSchemaException("The occurrence " + PSIs.GDL.OccurrenceType.gdlTitleOrder + " must be set to one of \"1\", \"2\", \"3\" or \"4\", but is \"" + orderOcc.getValue() + "\"");
}
} else {
return 1;
@@ -147,9 +147,9 @@
// adds a stly property and value as a pair to the corresponding array list
private void addStyleToStore(String styleClass, String property, String value){
if(styleClass == null) return;
- else if(styleClass.equals(PSIs.Scope.gdlActive)) this.titleActiveCssNamesAndStyles.add(new Pair<String, String>(property, value));
- else if(styleClass.equals(PSIs.Scope.gdlFocus)) this.titleFocusCssNamesAndStyles.add(new Pair<String, String>(property, value));
- else if(styleClass.equals(PSIs.Scope.gdlHover)) this.titleHoverCssNamesAndStyles.add(new Pair<String, String>(property, value));
+ else if(styleClass.equals(PSIs.GDL.Scope.gdlActive)) this.titleActiveCssNamesAndStyles.add(new Pair<String, String>(property, value));
+ else if(styleClass.equals(PSIs.GDL.Scope.gdlFocus)) this.titleFocusCssNamesAndStyles.add(new Pair<String, String>(property, value));
+ else if(styleClass.equals(PSIs.GDL.Scope.gdlHover)) this.titleHoverCssNamesAndStyles.add(new Pair<String, String>(property, value));
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java Wed Aug 24 08:47:02 2011 (r778)
@@ -224,9 +224,9 @@
// returns the string value of a gdl:id occurrence
public String getId() throws InvalidGdlSchemaException {
- JsArray<Occurrence> idOccs = getOccurrences(PSIs.OccurrenceType.gdlId);
+ JsArray<Occurrence> idOccs = getOccurrences(PSIs.GDL.OccurrenceType.gdlId);
if(idOccs.length() != 1){
- throw new InvalidGdlSchemaException("The topic " + TmHelper.getAnyIdOfTopic(this.tmRepresentative) + " must be bound to exactly one occurrence of the type " + PSIs.OccurrenceType.gdlId + ", but is bound " + idOccs.length() + " times to it");
+ throw new InvalidGdlSchemaException("The topic " + TmHelper.getAnyIdOfTopic(this.tmRepresentative) + " must be bound to exactly one occurrence of the type " + PSIs.GDL.OccurrenceType.gdlId + ", but is bound " + idOccs.length() + " times to it");
} else {
return idOccs.get(0).getValue() + "__GDL_" + this.indexInParent;
}
@@ -244,7 +244,7 @@
// sets all GDL styles that are defined by the topic map representative to tha passed widget
@Override
public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
- String[] styleClasses = new String[]{null, PSIs.Scope.gdlActive, PSIs.Scope.gdlFocus, PSIs.Scope.gdlHover};
+ String[] styleClasses = new String[]{null, PSIs.GDL.Scope.gdlActive, PSIs.GDL.Scope.gdlFocus, PSIs.GDL.Scope.gdlHover};
for (String styleClass : styleClasses) {
this.setVerticalAlign(widget, this.getVerticalAlign(styleClass), styleClass);
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 Wed Aug 24 08:24:57 2011 (r777)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java Wed Aug 24 08:47:02 2011 (r778)
@@ -33,9 +33,9 @@
public String getViewName()throws InvalidGdlSchemaException {
- JsArray<Name> viewNames = super.tmRepresentative.getNames(tm.getTopicBySubjectIdentifier(tm.createLocator(PSIs.NameType.gdlViewName)));
+ JsArray<Name> viewNames = super.tmRepresentative.getNames(tm.getTopicBySubjectIdentifier(tm.createLocator(PSIs.GDL.NameType.gdlViewName)));
if(viewNames.length() != 1){
- throw new InvalidGdlSchemaException("A view must be bound to a " + PSIs.NameType.gdlViewName + " instance");
+ throw new InvalidGdlSchemaException("A view must be bound to a " + PSIs.GDL.NameType.gdlViewName + " instance");
}
return viewNames.get(0).getValue();
}
1
0

[isidorus-cvs] r777 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: . base container environment text view
by lgiessmann@common-lisp.net 24 Aug '11
by lgiessmann@common-lisp.net 24 Aug '11
24 Aug '11
Author: lgiessmann
Date: Wed Aug 24 08:24:57 2011
New Revision: 777
Log:
gdl-frontend: Widgets: implementedthe consulption of association in GdlEditorAssociationView => Changed the behavior of the GdlView-hierarchy
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/TODO.txt
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/Utils.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/environment/GdlInstantiator.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.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/GdlEditorAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlTopicView.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/TODO.txt
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/TODO.txt Tue Aug 23 11:06:14 2011 (r776)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/TODO.txt Wed Aug 24 08:24:57 2011 (r777)
@@ -1,4 +1,4 @@
-* finalise the GDL-Schema for creating and editing instances of tgm:Hash-Object => AssociationView + Hidden-Value (type-occurrence)
+* finalise the GDL-Schema for creating and editing instances of tgm:Hash-Object => Hidden-Value (type-occurrence) + otherrole
* Implement all IHasValueGroup to:
* GdlText
* GdlInfo
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 Tue Aug 23 11:06:14 2011 (r776)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Wed Aug 24 08:24:57 2011 (r777)
@@ -710,7 +710,7 @@
ArrayList<Topic> constrainedNameTypes = getOtherPlayerOfBinaryAssociation(constraintTopic, constraintRoleType, constrainedStatementAssocType, null, nameType, constrainedRoleType);
ArrayList<Topic> constrainedOccurrenceTypes = getOtherPlayerOfBinaryAssociation(constraintTopic, constraintRoleType, constrainedStatementAssocType, null, occurrenceType, constrainedRoleType);
ArrayList<Topic> constrainedAssociationTypes = getOtherPlayerOfBinaryAssociation(constraintTopic, constraintRoleType, constrainedStatementAssocType, null, associationType, constrainedRoleType);
- ArrayList<Topic> constrainedStatements = Utils.merge(Utils.merge(constrainedNameTypes, constrainedOccurrenceTypes), constrainedAssociationTypes);
+ ArrayList<Topic> constrainedStatements = Utils.union(Utils.union(constrainedNameTypes, constrainedOccurrenceTypes), constrainedAssociationTypes);
if(constrainedStatements.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(constraintTopic) + " must be bound exactly once to a statement topic via a " + PSIs.TMCL.tmclConstrainedStatement + " association, but is: " + constrainedStatements.size());
else return constrainedStatements.get(0);
@@ -950,7 +950,7 @@
Topic constrainedStatementAssocType = getTopicByPsi(PSIs.TMCL.tmclConstrainedStatement, tm);
ArrayList<Topic> nameTypeTopics = getOtherPlayerOfBinaryAssociation(rootConstraint, constraintRoleType, constrainedStatementAssocType, null, nameType, constrainedRoleType);
ArrayList<Topic> occurrenceTypeTopics = getOtherPlayerOfBinaryAssociation(rootConstraint, constraintRoleType, constrainedStatementAssocType, null, occurrenceType, constrainedRoleType);
- ArrayList<Topic> typeTopics = Utils.merge(nameTypeTopics, occurrenceTypeTopics);
+ ArrayList<Topic> typeTopics = Utils.union(nameTypeTopics, occurrenceTypeTopics);
if(typeTopics.size() != 1){
throw new InvalidGdlSchemaException("the constraint " + getAnyIdOfTopic(rootConstraint) + " must be bound extactly once to an occurrence or name type, but is: " + typeTopics.size());
@@ -998,7 +998,7 @@
Topic occurrenceType = getTopicByPsi(PSIs.TMCL.tmclOccurrenceType, tm);
ArrayList<Topic> nameTypes = getOtherPlayerOfBinaryAssociation(constraint, constraintRoleType, constrainedStatementAssocType, null, nameType, constrainedRoleType);
ArrayList<Topic> occurrenceTypes = getOtherPlayerOfBinaryAssociation(constraint, constraintRoleType, constrainedStatementAssocType, null, occurrenceType, constrainedRoleType);
- ArrayList<Topic> nameOrOccurrenceTypes = Utils.merge(nameTypes, occurrenceTypes);
+ ArrayList<Topic> nameOrOccurrenceTypes = Utils.union(nameTypes, occurrenceTypes);
if(nameOrOccurrenceTypes.size() == 0){
return result;
@@ -1030,7 +1030,7 @@
JsArray<Topic> topicTypes = topicInstance.getTypes();
for(int i = 0; i != topicTypes.length(); ++i){
ArrayList<Topic> resultForType = getTopicRoleConstraintsForTopicType(topicTypes.get(i));
- result = Utils.merge(result, resultForType);
+ result = Utils.union(result, resultForType);
}
return result;
@@ -1093,7 +1093,7 @@
ArrayList<Topic> resultIi = getOtherPlayerOfBinaryAssociation(tmValueOrvalueGroup, descriptorRoleType, displayByAssocType, null, tmConstruct, itemIdentifierConstraintType);
ArrayList<Topic> resultName = getOtherPlayerOfBinaryAssociation(tmValueOrvalueGroup, descriptorRoleType, displayByAssocType, null, tmConstruct, topicNameConstraintType);
- ArrayList<Topic> result = Utils.merge(Utils.merge(Utils.merge(resultPsi, resultSl), resultIi), resultName);
+ ArrayList<Topic> result = Utils.union(Utils.union(Utils.union(resultPsi, resultSl), resultIi), resultName);
if(result.size() > 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(tmValueOrvalueGroup) + " must be bound none or once to a tmcl:constraint via a " + PSIs.AssociationType.gdlDisplayBy + " assciation, but is: " + result.size());
else if(result.size() == 1) return result.get(0);
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/Utils.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/Utils.java Tue Aug 23 11:06:14 2011 (r776)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/Utils.java Wed Aug 24 08:24:57 2011 (r777)
@@ -23,7 +23,7 @@
// returns a list that contains a union of both lists
- public static <T> ArrayList<T> union(ArrayList<T> fst, ArrayList<T> snd){
+ public static <T> ArrayList<T> intersection(ArrayList<T> fst, ArrayList<T> snd){
ArrayList<T> result = new ArrayList<T>();
if(fst == null || snd == null) return result;
@@ -34,7 +34,7 @@
// returns an ArrayList that is a merged ArrayList of fst and snd
- public static <T> ArrayList<T> merge(ArrayList<T> fst, ArrayList<T> snd){
+ public static <T> ArrayList<T> union(ArrayList<T> fst, ArrayList<T> snd){
ArrayList<T> result = new ArrayList<T>();
if(fst != null) for (T t : fst) if(!result.contains(t)) result.add(t);
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 Tue Aug 23 11:06:14 2011 (r776)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java Wed Aug 24 08:24:57 2011 (r777)
@@ -215,7 +215,7 @@
ArrayList<Topic> nameConstraints = TmHelper.getOtherPlayerOfBinaryAssociation(this.tmRepresentative, descriptorRoleType, tmBindingAssocType, null, tmclTopicNameConstraintType, tmConstructRoleType);
ArrayList<Topic> variantConstraints = TmHelper.getOtherPlayerOfBinaryAssociation(this.tmRepresentative, descriptorRoleType, tmBindingAssocType, null, tmclVariantNameConstraintType, tmConstructRoleType);
ArrayList<Topic> occurrenceConstraints = TmHelper.getOtherPlayerOfBinaryAssociation(this.tmRepresentative, descriptorRoleType, tmBindingAssocType, null, tmclTopicOccurrenceConstraintType, tmConstructRoleType);
- ArrayList<Topic> allConstraints = Utils.merge(Utils.merge(nameConstraints, variantConstraints), occurrenceConstraints);
+ ArrayList<Topic> allConstraints = Utils.union(Utils.union(nameConstraints, variantConstraints), occurrenceConstraints);
if(allConstraints.size() > 1)
throw new InvalidGdlSchemaException("the topic " + TmHelper.getAnyIdOfTopic(this.tmRepresentative) + " can be bound only to one constraint, but is " + allConstraints.size());
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/GdlInstantiator.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/GdlInstantiator.java Tue Aug 23 11:06:14 2011 (r776)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/GdlInstantiator.java Wed Aug 24 08:24:57 2011 (r777)
@@ -94,20 +94,15 @@
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlDefaultCreatorTopicView)){
return new GdlDefaultCreatorTopicView(tmRepresentative);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlDefaultEditorTopicView)){
- if(!(receivedData instanceof Topic) && receivedData != null) throw new ExecutionException("receivedData must be of type Topic when used with " + PSIs.TopicType.gdlDefaultEditorTopicView);
return new GdlDefaultEditorTopicView(tmRepresentative, (Topic)receivedData);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlSpecialCreatorTopicView)){
- if(!(receivedData instanceof Topic) && receivedData != null) throw new ExecutionException("receivedData must be of type Topic when used with " + PSIs.TopicType.gdlSpecialCreatorTopicView);
return new GdlSpecialCreatorTopicView(tmRepresentative);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlSpecialEditorTopicView)){
- if(!(receivedData instanceof Topic) && receivedData != null) throw new ExecutionException("receivedData must be of type Topic when used with " + PSIs.TopicType.gdlSpecialEditorTopicView);
return new GdlSpecialEditorTopicView(tmRepresentative, (Topic)receivedData);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlCreatorAssociationview)){
- if(!(receivedData instanceof Topic) && receivedData != null) throw new ExecutionException("receivedData must be of type Association when used with " + PSIs.TopicType.gdlCreatorAssociationview);
- return new GdlCreatorAssociationView(tmRepresentative, (Topic)receivedData);
+ return new GdlCreatorAssociationView(tmRepresentative, (Association)receivedData);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.TopicType.gdlEditorAssociationView)){
- if(!(receivedData instanceof Topic) && receivedData != null) throw new ExecutionException("receivedData must be of type Associaiton when used with " + PSIs.TopicType.gdlEditorAssociationView);
- return new GdlEditorAssociationView(tmRepresentative, (Topic)receivedData);
+ return new GdlEditorAssociationView(tmRepresentative, (Association)receivedData);
}else{
String values = "";
for(int i = 0; i != tmRepresentative.getTypes().length(); ++i){
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Tue Aug 23 11:06:14 2011 (r776)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Aug 24 08:24:57 2011 (r777)
@@ -131,6 +131,8 @@
this.createNewTextArea().setText(((Topic)this.receivedData).getOccurrences(occurrenceType).get(i).getValue());
} else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TopicType.gdlRolePlayer)){
this.createNewTextArea().setText("gdl:Role-Player instance");
+ // TODO: search role => role-type + role-player
+ // TODO: display the correponding value
}
// TODO: implement type, variant, datatype, associations, roles, ... constraints
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java Tue Aug 23 11:06:14 2011 (r776)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java Wed Aug 24 08:24:57 2011 (r777)
@@ -1,19 +1,25 @@
package us.isidor.gdl.anaToMia.Widgets.view;
import java.util.ArrayList;
+
import com.google.gwt.core.client.JsArray;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
-import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Role;
+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.Widgets.base.ButtonableObject;
+import us.isidor.gdl.anaToMia.Widgets.base.PSIs;
import us.isidor.gdl.anaToMia.Widgets.base.TmHelper;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
+import us.isidor.gdl.anaToMia.Widgets.value.ContentOrientationValue;
public abstract class GdlAssociationView extends GdlView {
- protected ArrayList<Association> associationsToRepresent = null;
- protected boolean associationsToRepresentSet = false;
private ArrayList<Topic> associationRoleConstraints = new ArrayList<Topic>();
private boolean associationRoleConstraintsSet = false;
private ArrayList<Topic> topicRoleConstraints = new ArrayList<Topic>();
@@ -32,25 +38,28 @@
super();
}
-
- public GdlAssociationView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException {
- this();
- this.tmRepresentative = tmRepresentative;
- this.tm = this.tmRepresentative.getTopicMap();
- this.receivedData = receivedData;
- this.setId(this.getId());
- this.setGdlStyle();
- if(this instanceof GdlEditorAssociationView) this.associationsToRepresent = this.filterAssociations();
-
- ArrayList<Topic> objectsContained = this.contains();
-
- Topic currentTopic = this.getStartElement(objectsContained);
- Topic lastTopic = super.getTmRepresentative();
- while(currentTopic != null){
- this.append(lastTopic, currentTopic);
- lastTopic = currentTopic;
- currentTopic = TmHelper.getNextContainee(currentTopic, objectsContained);
- }
+
+ public GdlAssociationView(Topic tmRepresentative, Association receivedData) throws InvalidGdlSchemaException, ExecutionException {
+ super(tmRepresentative, receivedData);
+ }
+
+
+ // content orientation has no effect on a view, so here must the original method
+ // defined in GdlVisibleObject implemented
+ @Override
+ public void setContentOrientation(ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException {
+ if(value == ContentOrientationValue.HORIZONTAL && this.containerPanel == null) this.containerPanel = new HorizontalPanel();
+ else if(this.containerPanel == null) this.containerPanel = new VerticalPanel();
+
+ this.mainPanel.add(this.containerPanel);
+ }
+
+
+ // Searches the topic that represents the first item that is placed 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(ArrayList<Topic> containees) throws InvalidGdlSchemaException {
+ return TmHelper.getFirstContainee(super.getTmRepresentative(), containees);
}
@@ -155,77 +164,6 @@
}
- // returns all associations of the received topicthat have a
- // correct type determined by this association-view
- private ArrayList<Association> filterAssociationsByType() throws InvalidGdlSchemaException {
- ArrayList<Association> allAssociations = new ArrayList<Association>();
- if(this.receivedData != null)
- for(int i = 0; i != ((Topic)this.receivedData).getRolesPlayed().length(); ++i)
- allAssociations.add(((Topic)this.receivedData).getRolesPlayed().get(i).getParent());
-
- // collect only the associations that match the correct association type
- ArrayList<Association> filteredAssociationsByType = new ArrayList<Association>();
- for (Association assoc : allAssociations)
- if(assoc.getType().equals(this.getAssociationType())) filteredAssociationsByType.add(assoc);
-
- return filteredAssociationsByType;
- }
-
-
- // returns all associations contained in the ArrayList allAssociations
- // that have the only permitted role types
- private ArrayList<Association> filterAssociationsByRoleAndPlayerTypes(ArrayList<Association> allAssociations) throws InvalidGdlSchemaException {
- if(allAssociations == null) return new ArrayList<Association>();
-
- ArrayList<Association> filteredAssociationsByAssociationRoleConstraints = new ArrayList<Association>();
- for (Association assoc : allAssociations){
- JsArray<Role> roles = assoc.getRoles();
- int i = 0;
- for( ; i != roles.length(); ++i){
- Topic rt = roles.get(i).getType();
- Topic rp = roles.get(i).getPlayer();
-
- int j = 0;
- for( ; j != this.getRoleAndPlayerTypes().size(); ++j){
- Pair<Topic, Topic> pair = this.getRoleAndPlayerTypes().get(j);
- if(pair.getFirst().equals(rt) && TmHelper.isInstanceOf(rp, pair.getSecond())) break;
- }
-
- if(j == this.getRoleAndPlayerTypes().size()) break;
- }
-
- if(i == roles.length())filteredAssociationsByAssociationRoleConstraints.add(assoc);
- }
-
- return filteredAssociationsByAssociationRoleConstraints;
- }
-
-
- // throws an InvalidGdlSchemaException if passed one association does not satisfy
- // any defined role-combination-constraint
- private void checkAssociationsByRoleCombinations(ArrayList<Association> allAssociations) throws InvalidGdlSchemaException {
- if(this.getRoleCombinationConstraints().size() == 0) return;
-
- for (Association assoc : allAssociations) {
- JsArray<Role> roles = assoc.getRoles();
- if(roles.length() != 2) throw new InvalidGdlSchemaException("the association " + assoc + " violates the defined role-combination-constrains");
- Role fstRole = roles.get(0);
- Role sndRole = roles.get(1);
-
- int i = 0;
- for ( ; i != this.getValidRoleCombinations().size(); ++i) {
- Pair<Topic, Topic> fstCombi = this.getValidRoleCombinations().get(i).getFirst();
- Pair<Topic, Topic> sndCombi = this.getValidRoleCombinations().get(i).getSecond();
-
- if(fstRole.getType().equals(fstCombi.getFirst()) && TmHelper.isInstanceOf(fstRole.getPlayer(), fstCombi.getSecond()) && sndRole.getType().equals(sndCombi.getFirst()) && TmHelper.isInstanceOf(sndRole.getPlayer(), sndCombi.getSecond())) break;
- if(sndRole.getType().equals(fstCombi.getFirst()) && TmHelper.isInstanceOf(sndRole.getPlayer(), fstCombi.getSecond()) && fstRole.getType().equals(sndCombi.getFirst()) && TmHelper.isInstanceOf(fstRole.getPlayer(), sndCombi.getSecond())) break;
- }
-
- if(i == this.getValidRoleCombinations().size()) throw new InvalidGdlSchemaException("the association " + assoc + " violates the defined role-combination-constrains");
- }
- }
-
-
// Returns all valid role-player combinations for this association-view
public ArrayList<Pair<Pair<Topic, Topic>, Pair<Topic, Topic>>> getValidRoleCombinations() throws InvalidGdlSchemaException {
if(this.validRoleCombinationsSet){
@@ -241,23 +179,120 @@
return this.validRoleCombinations;
}
}
-
+
+
+ // This class represents a single association that is displayed.
+ // Further elements are created by caling the GdlInstantiator.instantiate
+ // method, the passed received argument is set ot the association that is
+ // represented by this class
+ protected class AssociationItem extends GdlView {
+ private int indexInParent = -1;
+
+
+ @SuppressWarnings("unused")
+ private AssociationItem(){
+ super();
+ }
+
+
+ public AssociationItem(Topic tmRepresentative, Association receivedData, int indexInParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData);
+ this.indexInParent = indexInParent;
+
+ ArrayList<Topic> objectsContained = this.contains();
+
+ Topic currentTopic = this.getStartElement(objectsContained);
+ Topic lastTopic = super.getTmRepresentative();
+ while(currentTopic != null){
+ this.append(lastTopic, currentTopic);
+ lastTopic = currentTopic;
+ currentTopic = TmHelper.getNextContainee(currentTopic, objectsContained);
+ }
+ }
+
+
+ // this method should be invoked if a new sub-element is added to this instance.
+ // instances of GdlView does not organize their sub-elements in
+ // tables, sub-elements are placed directly on the mainpanel
+ @Override
+ protected ButtonableObject addToContainerPanel(Widget widget){
+ this.subElements.add(widget);
+ this.mainPanel.add(widget);
+ return null;
+ }
+
+
+ // returns the string value of a gdl:id occurrence
+ public String getId() throws InvalidGdlSchemaException {
+ JsArray<Occurrence> idOccs = getOccurrences(PSIs.OccurrenceType.gdlId);
+ if(idOccs.length() != 1){
+ throw new InvalidGdlSchemaException("The topic " + TmHelper.getAnyIdOfTopic(this.tmRepresentative) + " must be bound to exactly one occurrence of the type " + PSIs.OccurrenceType.gdlId + ", but is bound " + idOccs.length() + " times to it");
+ } else {
+ return idOccs.get(0).getValue() + "__GDL_" + this.indexInParent;
+ }
+ }
+
+
+ // sets all GDL styles that are defined by the topic map representative
+ @Override
+ protected void setGdlStyle() throws InvalidGdlSchemaException, ExecutionException {
+ // do nothing: all properties are set in the parent element
+ // and are ignored for this element
+ }
+
+
+ // sets all GDL styles that are defined by the topic map representative to tha passed widget
+ @Override
+ public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
+ String[] styleClasses = new String[]{null, PSIs.Scope.gdlActive, PSIs.Scope.gdlFocus, PSIs.Scope.gdlHover};
+ for (String styleClass : styleClasses) {
+ this.setVerticalAlign(widget, this.getVerticalAlign(styleClass), styleClass);
+
+ this.setBorderColor(widget, this.getBorderColor(styleClass), styleClass);
+ this.setBorderTopColor(widget, this.getBorderTopColor(styleClass), styleClass);
+ this.setBorderRightColor(widget, this.getBorderRightColor(styleClass), styleClass);
+ this.setBorderBottomColor(widget, this.getBorderBottomColor(styleClass), styleClass);
+ this.setBorderLeftColor(widget, this.getBorderLeftColor(styleClass), styleClass);
+
+ this.setBorderStyle(widget, this.getBorderStyle(styleClass), styleClass);
+ this.setBorderTopStyle(widget, this.getBorderTopStyle(styleClass), styleClass);
+ this.setBorderRightStyle(widget, this.getBorderRightStyle(styleClass), styleClass);
+ this.setBorderBottomStyle(widget, this.getBorderBottomStyle(styleClass), styleClass);
+ this.setBorderLeftStyle(widget, this.getBorderLeftStyle(styleClass), styleClass);
+
+ this.setBorderWidth(widget, this.getBorderWidth(styleClass), styleClass);
+ this.setBorderTopWidth(widget, this.getBorderTopWidth(styleClass), styleClass);
+ this.setBorderRightWidth(widget, this.getBorderRightWidth(styleClass), styleClass);
+ this.setBorderBottomWidth(widget, this.getBorderBottomWidth(styleClass), styleClass);
+ this.setBorderLeftWidth(widget, this.getBorderLeftWidth(styleClass), styleClass);
+
+ this.setBorderRadius(widget, this.getBorderRadius(styleClass), styleClass);
+ this.setBorderTopRightRadius(widget, this.getBorderTopRightRadius(styleClass), styleClass);
+ this.setBorderBottomRightRadius(widget, this.getBorderBottomRightRadius(styleClass), styleClass);
+ this.setBorderBottomLeftRadius(widget, this.getBorderBottomLeftRadius(styleClass), styleClass);
+ this.setBorderTopLeftRadius(widget, this.getBorderTopLeftRadius(styleClass), styleClass);
+
+ this.setCursor(widget, this.getCursor(styleClass), styleClass);
+
+ this.setWidth(widget, this.getWidth(styleClass), styleClass);
+ this.setMaxWidth(widget, this.getMaxWidth(styleClass), styleClass);
+ this.setMinWidth(widget, this.getMinWidth(styleClass), styleClass);
+
+ this.setHeight(widget, this.getHeight(styleClass), styleClass);
+ this.setMaxHeight(widget, this.getMaxHeight(styleClass), styleClass);
+ this.setMinHeight(widget, this.getMinHeight(styleClass), styleClass);
+
+ this.setBackgroundColor(widget, this.getBackgroundColor(styleClass), styleClass);
+ }
+ }
+
+
+ @Override
+ @Deprecated
+ public TopicMap getContent() {
+ // this item has no content that is a Topic Map item!
+ return null;
+ }
- // returns an array with associations that
- // must be represented by this association view
- private ArrayList<Association> filterAssociations() throws InvalidGdlSchemaException {
- ArrayList<Association> filteredAssociations = this.filterAssociationsByType();
- filteredAssociations = this.filterAssociationsByRoleAndPlayerTypes(filteredAssociations);
- this.checkAssociationsByRoleCombinations(filteredAssociations);
- this.associationsToRepresent = filteredAssociations;
- this.associationsToRepresentSet = true;
- return this.associationsToRepresent;
- }
-
-
- // Returns the associations that are represented by this associaton-view
- public ArrayList<Association> getAssociationsToRepresent() throws InvalidGdlSchemaException {
- if(this.associationsToRepresentSet) return this.associationsToRepresent;
- else return this.filterAssociations();
}
}
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 Tue Aug 23 11:06:14 2011 (r776)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlCreatorAssociationView.java Wed Aug 24 08:24:57 2011 (r777)
@@ -1,5 +1,6 @@
package us.isidor.gdl.anaToMia.Widgets.view;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
@@ -8,11 +9,11 @@
public class GdlCreatorAssociationView extends GdlAssociationView {
- public GdlCreatorAssociationView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException {
+ public GdlCreatorAssociationView(Topic tmRepresentative, Association receivedData) throws InvalidGdlSchemaException, ExecutionException {
super(tmRepresentative, receivedData);
// TODO Auto-generated constructor stub
}
-
+
@Override
public TopicMap getContent() {
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 Tue Aug 23 11:06:14 2011 (r776)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlEditorAssociationView.java Wed Aug 24 08:24:57 2011 (r777)
@@ -1,19 +1,129 @@
package us.isidor.gdl.anaToMia.Widgets.view;
+import java.util.ArrayList;
+import com.google.gwt.core.client.JsArray;
+
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
+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.TmHelper;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
public class GdlEditorAssociationView extends GdlAssociationView {
+ protected ArrayList<Association> associationsToRepresent = null;
+ protected boolean associationsToRepresentSet = false;
+
- public GdlEditorAssociationView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException {
+ public GdlEditorAssociationView(Topic tmRepresentative, Association receivedData) throws InvalidGdlSchemaException, ExecutionException {
super(tmRepresentative, receivedData);
- // TODO Auto-generated constructor stub
+
+ // create an association item for each association that must be represetned
+ // by this view
+ for (int i = 0; i != this.getAssociationsToRepresent().size(); ++i)
+ this.addToContainerPanel(new AssociationItem(this.tmRepresentative, this.getAssociationsToRepresent().get(i), i));
+ }
+
+
+ // returns all associations of the received topic that have a
+ // correct type determined by this association-view
+ private ArrayList<Association> filterAssociationsByType() throws InvalidGdlSchemaException {
+ ArrayList<Association> allAssociations = new ArrayList<Association>();
+ if(this.receivedData != null)
+ for(int i = 0; i != ((Topic)this.receivedData).getRolesPlayed().length(); ++i)
+ allAssociations.add(((Topic)this.receivedData).getRolesPlayed().get(i).getParent());
+
+ // collect only the associations that match the correct association type
+ ArrayList<Association> filteredAssociationsByType = new ArrayList<Association>();
+ for (Association assoc : allAssociations)
+ if(assoc.getType().equals(this.getAssociationType())) filteredAssociationsByType.add(assoc);
+
+ return filteredAssociationsByType;
+ }
+
+
+ // returns all associations contained in the ArrayList allAssociations
+ // that have the only permitted role types
+ private ArrayList<Association> filterAssociationsByRoleAndPlayerTypes(ArrayList<Association> allAssociations) throws InvalidGdlSchemaException {
+ if(allAssociations == null) return new ArrayList<Association>();
+
+ ArrayList<Association> filteredAssociationsByAssociationRoleConstraints = new ArrayList<Association>();
+ for (Association assoc : allAssociations){
+ JsArray<Role> roles = assoc.getRoles();
+ int i = 0;
+ for( ; i != roles.length(); ++i){
+ Topic rt = roles.get(i).getType();
+ Topic rp = roles.get(i).getPlayer();
+
+ int j = 0;
+ for( ; j != this.getRoleAndPlayerTypes().size(); ++j){
+ Pair<Topic, Topic> pair = this.getRoleAndPlayerTypes().get(j);
+ if(pair.getFirst().equals(rt) && TmHelper.isInstanceOf(rp, pair.getSecond())) break;
+ }
+
+ if(j == this.getRoleAndPlayerTypes().size()) break;
+ }
+
+ if(i == roles.length())filteredAssociationsByAssociationRoleConstraints.add(assoc);
+ }
+
+ return filteredAssociationsByAssociationRoleConstraints;
}
+
+ // throws an InvalidGdlSchemaException if passed one association does not satisfy
+ // any defined role-combination-constraint
+ private void checkAssociationsByRoleCombinations(ArrayList<Association> allAssociations) throws InvalidGdlSchemaException {
+ if(this.getRoleCombinationConstraints().size() == 0) return;
+
+ for (Association assoc : allAssociations) {
+ JsArray<Role> roles = assoc.getRoles();
+ if(roles.length() != 2) throw new InvalidGdlSchemaException("the association " + assoc + " violates the defined role-combination-constrains");
+ Role fstRole = roles.get(0);
+ Role sndRole = roles.get(1);
+
+ int i = 0;
+ for ( ; i != this.getValidRoleCombinations().size(); ++i) {
+ Pair<Topic, Topic> fstCombi = this.getValidRoleCombinations().get(i).getFirst();
+ Pair<Topic, Topic> sndCombi = this.getValidRoleCombinations().get(i).getSecond();
+
+ if(fstRole.getType().equals(fstCombi.getFirst()) && TmHelper.isInstanceOf(fstRole.getPlayer(), fstCombi.getSecond()) && sndRole.getType().equals(sndCombi.getFirst()) && TmHelper.isInstanceOf(sndRole.getPlayer(), sndCombi.getSecond())) break;
+ if(sndRole.getType().equals(fstCombi.getFirst()) && TmHelper.isInstanceOf(sndRole.getPlayer(), fstCombi.getSecond()) && fstRole.getType().equals(sndCombi.getFirst()) && TmHelper.isInstanceOf(fstRole.getPlayer(), sndCombi.getSecond())) break;
+ }
+
+ if(i == this.getValidRoleCombinations().size()) throw new InvalidGdlSchemaException("the association " + assoc + " violates the defined role-combination-constrains");
+ }
+ }
+
+
+ // returns an array with associations that
+ // must be represented by this association view
+ private ArrayList<Association> filterAssociations() throws InvalidGdlSchemaException {
+ if(this.receivedData instanceof Association){
+ this.associationsToRepresent = new ArrayList<Association>();
+ this.associationsToRepresent.add((Association)this.receivedData);
+ return this.associationsToRepresent;
+ } else {
+ ArrayList<Association> filteredAssociations = this.filterAssociationsByType();
+ filteredAssociations = this.filterAssociationsByRoleAndPlayerTypes(filteredAssociations);
+ this.checkAssociationsByRoleCombinations(filteredAssociations);
+ this.associationsToRepresent = filteredAssociations;
+ this.associationsToRepresentSet = true;
+ return this.associationsToRepresent;
+ }
+ }
+
+
+ // Returns the associations that are represented by this associaton-view
+ public ArrayList<Association> getAssociationsToRepresent() throws InvalidGdlSchemaException {
+ if(this.associationsToRepresentSet) return this.associationsToRepresent;
+ else return this.filterAssociations();
+ }
+
@Override
public String getViewName() {
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlTopicView.java Tue Aug 23 11:06:14 2011 (r776)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlTopicView.java Wed Aug 24 08:24:57 2011 (r777)
@@ -1,13 +1,69 @@
package us.isidor.gdl.anaToMia.Widgets.view;
+import java.util.ArrayList;
+import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.ButtonableObject;
+import us.isidor.gdl.anaToMia.Widgets.base.TmHelper;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.value.ContentOrientationValue;
public abstract class GdlTopicView extends GdlView {
public GdlTopicView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException{
super(tmRepresentative, receivedData);
+
+ ArrayList<Topic> objectsContained = this.contains();
+
+ Topic currentTopic = this.getStartElement(objectsContained);
+ Topic lastTopic = super.getTmRepresentative();
+ while(currentTopic != null){
+ this.append(lastTopic, currentTopic);
+ lastTopic = currentTopic;
+ currentTopic = TmHelper.getNextContainee(currentTopic, objectsContained);
+ }
+ }
+
+
+ // this method should be invoked if a new sub-element is added to this instance.
+ // instances of GdlView does not organize their sub-elements in
+ // tables, sub-elements are placed directly on the mainpanel
+ @Override
+ protected ButtonableObject addToContainerPanel(Widget widget){
+ this.subElements.add(widget);
+ this.mainPanel.add(widget);
+ return null;
+ }
+
+
+ // content orientation has no effect on a view
+ @Override
+ public void setContentOrientation(ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException {
+ // do nothing, no table is set for organizing content widgets, since a view does not organize
+ // its content in this manner
+ }
+
+
+ // Searches the topic that represents the first item that is placed 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(ArrayList<Topic> containees) throws InvalidGdlSchemaException {
+ return TmHelper.getFirstContainee(super.getTmRepresentative(), containees);
+ }
+
+
+ // sets all GDL styles that are defined by the topic map representative.
+ // In contrast to visible-object, the styles are applied only on the main
+ // panel, since the view's sub-elements must be formatted with their own
+ // style properties
+ @Override
+ protected void setGdlStyle() throws InvalidGdlSchemaException, ExecutionException {
+ this.setDisplay(this.getDisplay());
+ this.setZindex(this.getZindex());
+ this.setFloat(this.getFloat());
+ this.setClear(this.getClear());
+ this.setGdlStyle(this.mainPanel);
}
}
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 Tue Aug 23 11:06:14 2011 (r776)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java Wed Aug 24 08:24:57 2011 (r777)
@@ -1,5 +1,6 @@
package us.isidor.gdl.anaToMia.Widgets.view;
+
import java.util.ArrayList;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.user.client.ui.Widget;
@@ -7,11 +8,10 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Name;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
-import us.isidor.gdl.anaToMia.Widgets.base.ButtonableObject;
import us.isidor.gdl.anaToMia.Widgets.base.GdlPosition;
-import us.isidor.gdl.anaToMia.Widgets.base.PSIs;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.IGdlContainer;
+import us.isidor.gdl.anaToMia.Widgets.base.PSIs;
import us.isidor.gdl.anaToMia.Widgets.base.TmHelper;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.GdlInstantiator;
@@ -27,26 +27,17 @@
public GdlView(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
super(tmRepresentative, receivedData);
- ArrayList<Topic> objectsContained = this.contains();
- Topic currentTopic = this.getStartElement(objectsContained);
- Topic lastTopic = super.getTmRepresentative();
- while(currentTopic != null){
- this.append(lastTopic, currentTopic);
- lastTopic = currentTopic;
- currentTopic = TmHelper.getNextContainee(currentTopic, objectsContained);
- }
}
- // this method should be invoked if a new sub-element is added to this instance.
- // instances ov GdlView does not organize their sub-elements in
- // tables, sub-elements are placed directly on the mainpanel
- @Override
- protected ButtonableObject addToContainerPanel(Widget widget){
- this.subElements.add(widget);
- this.mainPanel.add(widget);
- return null;
+
+ public String getViewName()throws InvalidGdlSchemaException {
+ JsArray<Name> viewNames = super.tmRepresentative.getNames(tm.getTopicBySubjectIdentifier(tm.createLocator(PSIs.NameType.gdlViewName)));
+ if(viewNames.length() != 1){
+ throw new InvalidGdlSchemaException("A view must be bound to a " + PSIs.NameType.gdlViewName + " instance");
+ }
+ return viewNames.get(0).getValue();
}
@@ -56,15 +47,6 @@
// do nothing, no table is set for organizing content widgets, since a view does not organize
// its content in this manner
}
-
-
- public String getViewName()throws InvalidGdlSchemaException {
- JsArray<Name> viewNames = super.tmRepresentative.getNames(tm.getTopicBySubjectIdentifier(tm.createLocator(PSIs.NameType.gdlViewName)));
- if(viewNames.length() != 1){
- throw new InvalidGdlSchemaException("A view must be bound to a " + PSIs.NameType.gdlViewName + " instance");
- }
- return viewNames.get(0).getValue();
- }
// Searches the topic that represents the first item that is placed within this view instance
@@ -75,20 +57,6 @@
}
- // sets all GDL styles that are defined by the topic map representative.
- // In contrast to visible-object, the styles are applied only on the main
- // panel, since the view's sub-elements must be formatted with their own
- // style properties
- @Override
- protected void setGdlStyle() throws InvalidGdlSchemaException, ExecutionException {
- this.setDisplay(this.getDisplay());
- this.setZindex(this.getZindex());
- this.setFloat(this.getFloat());
- this.setClear(this.getClear());
- this.setGdlStyle(this.mainPanel);
- }
-
-
// 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
1
0

[isidorus-cvs] r776 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base text view
by lgiessmann@common-lisp.net 23 Aug '11
by lgiessmann@common-lisp.net 23 Aug '11
23 Aug '11
Author: lgiessmann
Date: Tue Aug 23 11:06:14 2011
New Revision: 776
Log:
gdl-frontend: Widgets: implemented the topic representation => gdl:display-by + gdl:preferred-scope
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlHasValueGroup.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.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/text/GdlText.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlHasValueGroup.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlHasValueGroup.java Tue Aug 23 09:03:08 2011 (r775)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlHasValueGroup.java Tue Aug 23 11:06:14 2011 (r776)
@@ -58,7 +58,22 @@
// returns all topics of a topic map that can be used for a defined constraint
public ArrayList<Topic> getTmValuesForConstraint() throws InvalidGdlSchemaException, ExecutionException;
+
// returns a regular expression that must be satisfied to satisfy the
// constraint, that is bound to the element's value group instance
public String getLiteralValueForConstraint() throws InvalidGdlSchemaException;
+
+
+ // returns the Topic that represents the constraint, which is used to
+ // determine the topic's display-schema
+ public Topic getDisplayByConstraintOfValueGroup() throws InvalidGdlSchemaException;
+
+
+ // Returns a list of topics that represent the topic's preferred scope(s)
+ public ArrayList<Topic> getPreferredScopeOfValueGroup() throws InvalidGdlSchemaException;
+
+
+ // Returns a string that represents the topic as a string corresponding
+ // to the defined display-by and preferred-scope topics
+ public String getTopicRepresentation(Topic topicToRepresent, Topic displayBy, ArrayList<Topic> preferredScopes) throws InvalidGdlSchemaException;
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java Tue Aug 23 09:03:08 2011 (r775)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java Tue Aug 23 11:06:14 2011 (r776)
@@ -222,6 +222,8 @@
public final static String gdlTopicViewBinding = gdl + "topic-view-binding";
public final static String gdlAssociationViewBinding = gdl + "association-view-binding";
public final static String gdlValueBinding = gdl + "value-binding";
+ public final static String gdlDisplayBy = gdl + "display-by";
+ public final static String gdlPrefferedScope = gdl + "preferred-scope";
}
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 Tue Aug 23 09:03:08 2011 (r775)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Tue Aug 23 11:06:14 2011 (r776)
@@ -5,6 +5,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Locator;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Name;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Role;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.ScopedStub;
@@ -13,6 +14,7 @@
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pattern;
import us.isidor.gdl.anaToMia.Widgets.environment.TopicIdentifierTypes;
import com.google.gwt.core.client.JsArray;
@@ -1058,4 +1060,106 @@
else if(occs.length() == 0) return null;
else return occs.get(0);
}
+
+
+ // Returns an array of topics that represent the preffered scope that is set
+ // to a tm-value or value-group instance
+ public static ArrayList<Topic> getPrefferedScopesForTopicOf(Topic tmValueOrValueGroup){
+ if(tmValueOrValueGroup == null) return new ArrayList<Topic>();
+
+ TopicMap tm = tmValueOrValueGroup.getTopicMap();
+ Topic descriptorRoleType = getTopicByPsi(PSIs.RoleType.gdlDescriptor, tm);
+ Topic preferredScopeAssocType = getTopicByPsi(PSIs.AssociationType.gdlPrefferedScope, tm);
+ Topic tmConstructRoleType = getTopicByPsi(PSIs.RoleType.gdlTmConstruct, tm);
+ return getOtherPlayerOfBinaryAssociation(tmValueOrValueGroup, descriptorRoleType, preferredScopeAssocType, null, tmConstructRoleType);
+ }
+
+
+ // Returns the topic that is bound to the passed tm-value or value-group topic
+ // and represents the representation schema of the topics that must be displayed
+ public static Topic getDisplayByTopicOf(Topic tmValueOrvalueGroup) throws InvalidGdlSchemaException{
+ if(tmValueOrvalueGroup == null) return null;
+
+ TopicMap tm = tmValueOrvalueGroup.getTopicMap();
+ Topic displayByAssocType = getTopicByPsi(PSIs.AssociationType.gdlDisplayBy, tm);
+ Topic descriptorRoleType = getTopicByPsi(PSIs.RoleType.gdlDescriptor, tm);
+ Topic tmConstruct = getTopicByPsi(PSIs.RoleType.gdlTmConstruct, tm);
+ Topic subjectIdentifierConstraintType = getTopicByPsi(PSIs.TMCL.tmclSubjectIdentifierConstraint, tm);
+ Topic subjectLocatorConstraintType = getTopicByPsi(PSIs.TMCL.tmclSubjectLocatorConstraint, tm);
+ Topic itemIdentifierConstraintType = getTopicByPsi(PSIs.TMCL.tmclItemIdentifierConstraint, tm);
+ Topic topicNameConstraintType = getTopicByPsi(PSIs.TMCL.tmclTopicNameConstraint, tm);
+ ArrayList<Topic> resultPsi = getOtherPlayerOfBinaryAssociation(tmValueOrvalueGroup, descriptorRoleType, displayByAssocType, null, tmConstruct, subjectIdentifierConstraintType);
+ ArrayList<Topic> resultSl = getOtherPlayerOfBinaryAssociation(tmValueOrvalueGroup, descriptorRoleType, displayByAssocType, null, tmConstruct, subjectLocatorConstraintType);
+ ArrayList<Topic> resultIi = getOtherPlayerOfBinaryAssociation(tmValueOrvalueGroup, descriptorRoleType, displayByAssocType, null, tmConstruct, itemIdentifierConstraintType);
+ ArrayList<Topic> resultName = getOtherPlayerOfBinaryAssociation(tmValueOrvalueGroup, descriptorRoleType, displayByAssocType, null, tmConstruct, topicNameConstraintType);
+
+ ArrayList<Topic> result = Utils.merge(Utils.merge(Utils.merge(resultPsi, resultSl), resultIi), resultName);
+
+ if(result.size() > 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(tmValueOrvalueGroup) + " must be bound none or once to a tmcl:constraint via a " + PSIs.AssociationType.gdlDisplayBy + " assciation, but is: " + result.size());
+ else if(result.size() == 1) return result.get(0);
+ else return null;
+ }
+
+
+ // Returns a string that represents the topic. The returned string must
+ // correspond to the passed diplayBy and preferredScopes data.
+ public static String getTopicRepresentation(Topic topicToRepresent, Topic displayBy, ArrayList<Topic> preferredScopes) throws InvalidGdlSchemaException {
+ if(topicToRepresent == null) return null;
+
+ if(displayBy == null){
+ if(topicToRepresent.getSubjectIdentifiers().length() == 0) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(topicToRepresent) + " is not bound to a " + PSIs.AssociationType.gdlDisplayBy + " association and is not bound to a Subject-Identifier - but one of them must be set");
+ else return topicToRepresent.getSubjectIdentifiers().get(0).getReference();
+ } else {
+ TopicMap tm = topicToRepresent.getTopicMap();
+ Topic subjectIdentifierConstraint = getTopicByPsi(PSIs.TMCL.tmclSubjectIdentifierConstraint, tm);
+ Topic subjectLocatorConstraint = getTopicByPsi(PSIs.TMCL.tmclSubjectLocatorConstraint, tm);
+ Topic itemIdentifierConstraint = getTopicByPsi(PSIs.TMCL.tmclItemIdentifierConstraint, tm);
+ Topic topicNameConstraint = getTopicByPsi(PSIs.TMCL.tmclTopicNameConstraint, tm);
+
+ String result = null;
+ if(isInstanceOf(displayBy, topicNameConstraint)){
+ Topic nameType = TmHelper.getConstrainedStatement(displayBy);
+ ArrayList<Name> names = new ArrayList<Name>();
+ for(int i = 0; i != topicToRepresent.getNames(nameType).length(); ++i)
+ names.add(topicToRepresent.getNames(nameType).get(i));
+
+ if(preferredScopes != null && preferredScopes.size() != 0){
+ // TODO: implement
+ }
+ if(names.size() != 0) result = names.get(0).getValue();
+ } else if(isInstanceOf(displayBy, subjectIdentifierConstraint)){
+ Pattern rex = new Pattern(TmHelper.getLiteralValueForConstraint(displayBy));
+ for(int i = 0; i != topicToRepresent.getSubjectIdentifiers().length(); ++i){
+ String psi = topicToRepresent.getSubjectIdentifiers().get(i).getReference();
+ if(rex.matches(psi)){
+ result = psi;
+ break;
+ }
+ }
+ } else if(isInstanceOf(displayBy, subjectLocatorConstraint)){
+ Pattern rex = new Pattern(TmHelper.getLiteralValueForConstraint(displayBy));
+ for(int i = 0; i != topicToRepresent.getSubjectLocators().length(); ++i){
+ String psi = topicToRepresent.getSubjectLocators().get(i).getReference();
+ if(rex.matches(psi)){
+ result = psi;
+ break;
+ }
+ }
+ } else if(isInstanceOf(displayBy, itemIdentifierConstraint)){
+ Pattern rex = new Pattern(TmHelper.getLiteralValueForConstraint(displayBy));
+ for(int i = 0; i != topicToRepresent.getItemIdentifiers().length(); ++i){
+ String psi = topicToRepresent.getItemIdentifiers().get(i).getReference();
+ if(rex.matches(psi)){
+ result = psi;
+ break;
+ }
+ }
+ } else {
+ throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(displayBy) + " is not a valid representation schema type");
+ }
+
+ if(result == null) throw new InvalidGdlSchemaException("");
+ else return result;
+ }
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Tue Aug 23 09:03:08 2011 (r775)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Tue Aug 23 11:06:14 2011 (r776)
@@ -57,6 +57,11 @@
protected boolean tmValueTopicsSet = false;
protected ArrayList<Topic> literalValueTopics = new ArrayList<Topic>();
protected boolean literalValueTopicsSet = false;
+ protected ArrayList<Topic> preferredScopes = new ArrayList<Topic>();
+ protected boolean prefferedScopesSet = false;
+ protected Topic displayByConstraint = null;
+ protected boolean displayByConstraintSet = false;
+
// some constructors
protected GdlText() throws InvalidGdlSchemaException, ExecutionException {
@@ -124,13 +129,15 @@
Topic occurrenceType = TmHelper.getConstrainedStatement(this.getConstraint());
for(int i = 0; i != ((Topic)this.receivedData).getOccurrences(occurrenceType).length(); ++i)
this.createNewTextArea().setText(((Topic)this.receivedData).getOccurrences(occurrenceType).get(i).getValue());
+ } else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TopicType.gdlRolePlayer)){
+ this.createNewTextArea().setText("gdl:Role-Player instance");
}
- // TODO: implement type, variant, datatype, association, ... constraints
+ // TODO: implement type, variant, datatype, associations, roles, ... constraints
}
// sets the field for the set default value or sets at least one empty field
- public void setDefaultValue() throws InvalidGdlSchemaException, ExecutionException {
+ protected void setDefaultValue() throws InvalidGdlSchemaException, ExecutionException {
if(this.getDefaultLiteralValue() != null && this.getDefaultTmValue() != null) throw new InvalidGdlSchemaException("the topic " + TmHelper.getAnyIdOfTopic(this.getValueGroup()) + " must be bound to maximal one " + PSIs.TopicType.gdlDefaultValue + ", but is: 2");
if(this.getDefaultLiteralValue() != null){
@@ -1040,4 +1047,34 @@
public String getLiteralValueForConstraint() throws InvalidGdlSchemaException {
return TmHelper.getLiteralValueForConstraint(this.getConstraint());
}
+
+
+ @Override
+ public Topic getDisplayByConstraintOfValueGroup() throws InvalidGdlSchemaException {
+ if(this.displayByConstraintSet){
+ return this.displayByConstraint;
+ } else {
+ this.displayByConstraintSet = true;
+ this.displayByConstraint = TmHelper.getDisplayByTopicOf(this.getValueGroup());
+ return this.displayByConstraint;
+ }
+ }
+
+
+ @Override
+ public ArrayList<Topic> getPreferredScopeOfValueGroup() throws InvalidGdlSchemaException {
+ if(this.prefferedScopesSet){
+ return this.preferredScopes;
+ } else {
+ this.prefferedScopesSet = true;
+ this.preferredScopes = TmHelper.getPrefferedScopesForTopicOf(this.getValueGroup());
+ return this.preferredScopes;
+ }
+ }
+
+
+ @Override
+ public String getTopicRepresentation(Topic topicToRepresent, Topic displayBy, ArrayList<Topic> preferredScopes) throws InvalidGdlSchemaException {
+ return TmHelper.getTopicRepresentation(topicToRepresent, displayBy, preferredScopes);
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java Tue Aug 23 09:03:08 2011 (r775)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java Tue Aug 23 11:06:14 2011 (r776)
@@ -1,7 +1,6 @@
package us.isidor.gdl.anaToMia.Widgets.view;
import java.util.ArrayList;
-
import com.google.gwt.core.client.JsArray;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Role;
@@ -28,10 +27,30 @@
private ArrayList<Pair<Pair<Topic, Topic>, Pair<Topic, Topic>>> validRoleCombinations = new ArrayList<Pair<Pair<Topic,Topic>,Pair<Topic,Topic>>>();
private boolean validRoleCombinationsSet = false;
+
+ protected GdlAssociationView(){
+ super();
+ }
+
public GdlAssociationView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException {
- super(tmRepresentative, receivedData);
+ this();
+ this.tmRepresentative = tmRepresentative;
+ this.tm = this.tmRepresentative.getTopicMap();
+ this.receivedData = receivedData;
+ this.setId(this.getId());
+ this.setGdlStyle();
if(this instanceof GdlEditorAssociationView) this.associationsToRepresent = this.filterAssociations();
+
+ ArrayList<Topic> objectsContained = this.contains();
+
+ Topic currentTopic = this.getStartElement(objectsContained);
+ Topic lastTopic = super.getTmRepresentative();
+ while(currentTopic != null){
+ this.append(lastTopic, currentTopic);
+ lastTopic = currentTopic;
+ currentTopic = TmHelper.getNextContainee(currentTopic, objectsContained);
+ }
}
1
0

[isidorus-cvs] r775 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets
by lgiessmann@common-lisp.net 23 Aug '11
by lgiessmann@common-lisp.net 23 Aug '11
23 Aug '11
Author: lgiessmann
Date: Tue Aug 23 09:03:08 2011
New Revision: 775
Log:
gdl-frontend: Widgets: changed the binding of elements within Association-Views to the association constraints => it is suffifient to bind these elements to a tmcl:topic-role-constraint
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_GDL_Create_HashObject.jtm
branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_GDL_Edit_HashObject.jtm
branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_full_TMCL_and_GDL_Schema.jtm
branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema.jtm
branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema_with_test_data.jtm
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_GDL_Create_HashObject.jtm
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_GDL_Create_HashObject.jtm Mon Aug 22 13:52:07 2011 (r774)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_GDL_Create_HashObject.jtm Tue Aug 23 09:03:08 2011 (r775)
@@ -183,7 +183,6 @@
{"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[tgg:hash-object-creator-text-list-box-env-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[tgg:hash-object-creator-text-list-box-env]"}]},
{"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[tgg:hash-object-creator-text-list-box-env-value-group]"}, {"type":"si:[gdl:tm-construct]", "player":"si:[tgg:hash-object-has-environment-environment-role-player]"}]},
{"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[tgg:hash-object-has-environment-environment-role-player]"}, {"type":"si:[gdl:tm-construct]", "player":"si:[tgm:has-environment-environment-role-constraint]"}]},
- {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[tgg:hash-object-has-environment-environment-role-player]"}, {"type":"si:[gdl:tm-construct]", "player":"si:[tgm:has-environment-environment-association-role-constraint]"}]},
{"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[tgg:hash-object-default-creator-topic-view]"},{"type":"si:[gdl:containee]", "player":"si:[tgg:hash-object-creator-text-label-key]"}]},
{"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[tgg:hash-object-creator-text-label-key-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[tgg:has-environment-creator-association-view]"},{"type":"si:[gdl:descendant]", "player":"si:[tgg:hash-object-creator-text-label-key]"}]},
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_GDL_Edit_HashObject.jtm
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_GDL_Edit_HashObject.jtm Mon Aug 22 13:52:07 2011 (r774)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_GDL_Edit_HashObject.jtm Tue Aug 23 09:03:08 2011 (r775)
@@ -176,7 +176,6 @@
{"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[tgg:hash-object-editor-text-env-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[tgg:hash-object-editor-text-env]"}]},
{"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[tgg:hash-object-editor-text-env-value-group]"}, {"type":"si:[gdl:tm-construct]", "player":"si:[tgg:hash-object-has-environment-environment-role-player]"}]},
{"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[tgg:hash-object-has-environment-environment-role-player]"}, {"type":"si:[gdl:tm-construct]", "player":"si:[tgm:has-environment-environment-role-constraint]"}]},
- {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[tgg:hash-object-has-environment-environment-role-player]"}, {"type":"si:[gdl:tm-construct]", "player":"si:[tgm:has-environment-environment-association-role-constraint]"}]},
{"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[tgg:hash-object-default-editor-topic-view]"},{"type":"si:[gdl:containee]", "player":"si:[tgg:hash-object-editor-text-label-key]"}]},
{"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[tgg:hash-object-editor-text-label-key-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[tgg:has-environment-editor-association-view]"},{"type":"si:[gdl:descendant]", "player":"si:[tgg:hash-object-editor-text-label-key]"}]},
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_full_TMCL_and_GDL_Schema.jtm
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_full_TMCL_and_GDL_Schema.jtm Mon Aug 22 13:52:07 2011 (r774)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_full_TMCL_and_GDL_Schema.jtm Tue Aug 23 09:03:08 2011 (r775)
@@ -8646,25 +8646,6 @@
"item_identifiers":null,
"type":"si:[pref_3:tm-construct]",
"reifier":null,
- "player":"si:[pref_4:has-environment-environment-association-role-constraint]"
- }
- ]
- },
- {
- "item_identifiers":null,
- "type":"si:[pref_3:association-view-binding]",
- "reifier":null,
- "scope":null,
- "roles":[{
- "item_identifiers":null,
- "type":"si:[pref_3:descriptor]",
- "reifier":null,
- "player":"si:[pref_1:has-environment-editor-association-view]"
- },
- {
- "item_identifiers":null,
- "type":"si:[pref_3:tm-construct]",
- "reifier":null,
"player":"si:[pref_4:has-environment-environment-role-constraint]"
}
]
@@ -9363,25 +9344,6 @@
}
]
},
- {
- "item_identifiers":null,
- "type":"si:[pref_3:tm-binding]",
- "reifier":null,
- "scope":null,
- "roles":[{
- "item_identifiers":null,
- "type":"si:[pref_3:descriptor]",
- "reifier":null,
- "player":"si:[pref_1:hash-object-has-environment-environment-role-player]"
- },
- {
- "item_identifiers":null,
- "type":"si:[pref_3:tm-construct]",
- "reifier":null,
- "player":"si:[pref_4:has-environment-environment-association-role-constraint]"
- }
- ]
- },
{
"item_identifiers":null,
"type":"si:[pref_3:tm-binding]",
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema.jtm
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema.jtm Mon Aug 22 13:52:07 2011 (r774)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema.jtm Tue Aug 23 09:03:08 2011 (r775)
@@ -5675,25 +5675,6 @@
"item_identifiers":null,
"type":"si:[pref_3:tm-construct]",
"reifier":null,
- "player":"si:[pref_4:has-environment-environment-association-role-constraint]"
- }
- ]
- },
- {
- "item_identifiers":null,
- "type":"si:[pref_3:tm-binding]",
- "reifier":null,
- "scope":null,
- "roles":[{
- "item_identifiers":null,
- "type":"si:[pref_3:descriptor]",
- "reifier":null,
- "player":"si:[pref_1:hash-object-has-environment-environment-role-player]"
- },
- {
- "item_identifiers":null,
- "type":"si:[pref_3:tm-construct]",
- "reifier":null,
"player":"si:[pref_4:has-environment-environment-role-constraint]"
}
]
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema_with_test_data.jtm
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema_with_test_data.jtm Mon Aug 22 13:52:07 2011 (r774)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema_with_test_data.jtm Tue Aug 23 09:03:08 2011 (r775)
@@ -5731,25 +5731,6 @@
"item_identifiers":null,
"type":"si:[pref_3:tm-construct]",
"reifier":null,
- "player":"si:[pref_4:has-environment-environment-association-role-constraint]"
- }
- ]
- },
- {
- "item_identifiers":null,
- "type":"si:[pref_3:tm-binding]",
- "reifier":null,
- "scope":null,
- "roles":[{
- "item_identifiers":null,
- "type":"si:[pref_3:descriptor]",
- "reifier":null,
- "player":"si:[pref_1:hash-object-has-environment-environment-role-player]"
- },
- {
- "item_identifiers":null,
- "type":"si:[pref_3:tm-construct]",
- "reifier":null,
"player":"si:[pref_4:has-environment-environment-role-constraint]"
}
]
1
0

[isidorus-cvs] r774 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base view
by lgiessmann@common-lisp.net 22 Aug '11
by lgiessmann@common-lisp.net 22 Aug '11
22 Aug '11
Author: lgiessmann
Date: Mon Aug 22 13:52:07 2011
New Revision: 774
Log:
gdl-frontend: Widgets: finalised the filtering of consuming user data in GdlAssociationView
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.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/base/TmHelper.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java Mon Aug 22 10:53:48 2011 (r773)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java Mon Aug 22 13:52:07 2011 (r774)
@@ -46,6 +46,8 @@
public final static String tmclConstrainedTopicType = tmcl + "constrained-topic-type";
public final static String tmclConstrainedRole = tmcl + "constrained-role";
public final static String tmclRoleCombinationConstraint = tmcl + "role-combination-constraint";
+ public final static String tmclOtherConstrainedTopicType = tmcl + "other-constrained-topic-type";
+ public final static String tmclOtherConstrainedRole = tmcl + "other-constrained-role";
}
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 Aug 22 10:53:48 2011 (r773)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Mon Aug 22 13:52:07 2011 (r774)
@@ -1,7 +1,6 @@
package us.isidor.gdl.anaToMia.Widgets.base;
-import java.util.ArrayList;
import us.isidor.gdl.anaToMia.TmEngine.jtmsBasedEngine.JtmsTmEngine;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
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 Mon Aug 22 10:53:48 2011 (r773)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Mon Aug 22 13:52:07 2011 (r774)
@@ -656,14 +656,42 @@
Topic constraintRoleType = getTopicByPsi(PSIs.TMCL.tmclConstraint, tm);
Topic constrainedTopicTypeAssocType = getTopicByPsi(PSIs.TMCL.tmclConstrainedTopicType, tm);
Topic constrainedRoleType = getTopicByPsi(PSIs.TMCL.tmclConstrained, tm);
- Topic topicType = getTopicByPsi(PSIs.TMCL.tmclTopictype, tm);
- ArrayList<Topic> result = getOtherPlayerOfBinaryAssociation(topicRoleConstraint, constraintRoleType, constrainedTopicTypeAssocType, null, topicType, constrainedRoleType);
+ ArrayList<Topic> result = getOtherPlayerOfBinaryAssociation(topicRoleConstraint, constraintRoleType, constrainedTopicTypeAssocType, null, constrainedRoleType);
if(result.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(topicRoleConstraint) + " must be bound exactly once to a topic-type via a " + PSIs.TMCL.tmclConstrainedTopicType + " association, but is bound: " + result.size());
else return new Pair<Topic, Topic>(getConstraintRoleOfConstraint(topicRoleConstraint), result.get(0));
}
+ // return a pair that contains again two pair instances, whereas each pair
+ // represents a role type and a role player. The outer pair represents a valid
+ // combination of roles of a role-combination-constraint.
+ public static Pair<Pair<Topic, Topic>, Pair<Topic, Topic>> getRoleCombinationsOfConstraint(Topic roleCombinationconstraint) throws InvalidGdlSchemaException {
+ if(roleCombinationconstraint == null) return null;
+
+ TopicMap tm = roleCombinationconstraint.getTopicMap();
+ Topic constraintRoleType = getTopicByPsi(PSIs.TMCL.tmclConstraint, tm);
+ Topic constrainedRoleAssocType = getTopicByPsi(PSIs.TMCL.tmclConstrainedRole, tm);
+ Topic constrainedRoleType = getTopicByPsi(PSIs.TMCL.tmclConstrained, tm);
+ ArrayList<Topic> roleTypes = getOtherPlayerOfBinaryAssociation(roleCombinationconstraint, constraintRoleType, constrainedRoleAssocType, null, constrainedRoleType);
+ if(roleTypes.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(roleCombinationconstraint) + " must be bound exactly once to a role-type via a " + PSIs.TMCL.tmclConstrainedRole + ", but is: " + roleTypes.size());
+ Topic constrainedTopicTypeAssocType = getTopicByPsi(PSIs.TMCL.tmclConstrainedTopicType, tm);
+ ArrayList<Topic> playerTypes = getOtherPlayerOfBinaryAssociation(roleCombinationconstraint, constraintRoleType, constrainedTopicTypeAssocType, null, constrainedRoleType);
+ if(playerTypes.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(roleCombinationconstraint) + " must be bound exactly once to a topic-type via a " + PSIs.TMCL.tmclConstrainedTopicType + ", but is: " + playerTypes.size());
+
+ Topic otherConstrainedRoleAssocType = getTopicByPsi(PSIs.TMCL.tmclOtherConstrainedRole, tm);
+ ArrayList<Topic> otherRoleTypes = getOtherPlayerOfBinaryAssociation(roleCombinationconstraint, constraintRoleType, otherConstrainedRoleAssocType, null, constrainedRoleType);
+ if(otherRoleTypes.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(roleCombinationconstraint) + " must be bound exactly once to an other-role-type via a " + PSIs.TMCL.tmclOtherConstrainedRole + ", but is: " + otherRoleTypes.size());
+ Topic otherConstrainedTopicTypeRoleType = getTopicByPsi(PSIs.TMCL.tmclOtherConstrainedTopicType, tm);
+ ArrayList<Topic> otherPlayerType = getOtherPlayerOfBinaryAssociation(roleCombinationconstraint, constraintRoleType, otherConstrainedTopicTypeRoleType, null, constrainedRoleType);
+ if(otherPlayerType.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(roleCombinationconstraint) + " must be bound exactly once to an other-topic-type via a " + PSIs.TMCL.tmclOtherConstrainedTopicType + ", but is: " + otherPlayerType.size());
+
+ Pair<Topic, Topic> firstRole = new Pair<Topic, Topic>(roleTypes.get(0), playerTypes.get(0));
+ Pair<Topic, Topic> secondRole = new Pair<Topic, Topic>(otherRoleTypes.get(0), otherPlayerType.get(0));
+ return new Pair<Pair<Topic,Topic>, Pair<Topic,Topic>>(firstRole, secondRole);
+ }
+
+
// returns the topic that plays the role of tmcl:constrained in an association
// of the type tmcl:constrained-statement that is bound to the passed topic
// constrinatTopic that plays the role of tmcl:constraint
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java Mon Aug 22 10:53:48 2011 (r773)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java Mon Aug 22 13:52:07 2011 (r774)
@@ -3,7 +3,6 @@
import java.util.ArrayList;
import com.google.gwt.core.client.JsArray;
-import com.google.gwt.user.client.Window;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Role;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
@@ -26,6 +25,8 @@
private boolean roleAndPlayerTypesSet = false;
private ArrayList<Topic> roleCombinationConstraints = new ArrayList<Topic>();
private boolean roleCombinationConstraintsSet = false;
+ private ArrayList<Pair<Pair<Topic, Topic>, Pair<Topic, Topic>>> validRoleCombinations = new ArrayList<Pair<Pair<Topic,Topic>,Pair<Topic,Topic>>>();
+ private boolean validRoleCombinationsSet = false;
public GdlAssociationView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException {
@@ -181,11 +182,45 @@
}
- // returns all associations contained in the ArrayList allAssociations
- // that are valid to the role-combination-constraints that belongs to this view
- private ArrayList<Association> filterAssociationsByRoleCombinations(ArrayList<Association> allAssociations) throws InvalidGdlSchemaException {
- // TODO: implement
- return null;
+ // throws an InvalidGdlSchemaException if passed one association does not satisfy
+ // any defined role-combination-constraint
+ private void checkAssociationsByRoleCombinations(ArrayList<Association> allAssociations) throws InvalidGdlSchemaException {
+ if(this.getRoleCombinationConstraints().size() == 0) return;
+
+ for (Association assoc : allAssociations) {
+ JsArray<Role> roles = assoc.getRoles();
+ if(roles.length() != 2) throw new InvalidGdlSchemaException("the association " + assoc + " violates the defined role-combination-constrains");
+ Role fstRole = roles.get(0);
+ Role sndRole = roles.get(1);
+
+ int i = 0;
+ for ( ; i != this.getValidRoleCombinations().size(); ++i) {
+ Pair<Topic, Topic> fstCombi = this.getValidRoleCombinations().get(i).getFirst();
+ Pair<Topic, Topic> sndCombi = this.getValidRoleCombinations().get(i).getSecond();
+
+ if(fstRole.getType().equals(fstCombi.getFirst()) && TmHelper.isInstanceOf(fstRole.getPlayer(), fstCombi.getSecond()) && sndRole.getType().equals(sndCombi.getFirst()) && TmHelper.isInstanceOf(sndRole.getPlayer(), sndCombi.getSecond())) break;
+ if(sndRole.getType().equals(fstCombi.getFirst()) && TmHelper.isInstanceOf(sndRole.getPlayer(), fstCombi.getSecond()) && fstRole.getType().equals(sndCombi.getFirst()) && TmHelper.isInstanceOf(fstRole.getPlayer(), sndCombi.getSecond())) break;
+ }
+
+ if(i == this.getValidRoleCombinations().size()) throw new InvalidGdlSchemaException("the association " + assoc + " violates the defined role-combination-constrains");
+ }
+ }
+
+
+ // Returns all valid role-player combinations for this association-view
+ public ArrayList<Pair<Pair<Topic, Topic>, Pair<Topic, Topic>>> getValidRoleCombinations() throws InvalidGdlSchemaException {
+ if(this.validRoleCombinationsSet){
+ return this.validRoleCombinations;
+ } else {
+ this.validRoleCombinationsSet = true;
+ ArrayList<Pair<Pair<Topic, Topic>, Pair<Topic, Topic>>> roleCombinations = new ArrayList<Pair<Pair<Topic,Topic>,Pair<Topic,Topic>>>();
+ for (Topic constraint : this.getRoleCombinationConstraints()) {
+ Pair<Pair<Topic, Topic>, Pair<Topic, Topic>> combination = TmHelper.getRoleCombinationsOfConstraint(constraint);
+ if(!roleCombinations.contains(combination)) roleCombinations.add(combination);
+ }
+ this.validRoleCombinations = roleCombinations;
+ return this.validRoleCombinations;
+ }
}
@@ -193,9 +228,8 @@
// must be represented by this association view
private ArrayList<Association> filterAssociations() throws InvalidGdlSchemaException {
ArrayList<Association> filteredAssociations = this.filterAssociationsByType();
- filteredAssociations = filterAssociationsByRoleAndPlayerTypes(filteredAssociations);
- filteredAssociations = filterAssociationsByRoleCombinations(filteredAssociations);
-
+ filteredAssociations = this.filterAssociationsByRoleAndPlayerTypes(filteredAssociations);
+ this.checkAssociationsByRoleCombinations(filteredAssociations);
this.associationsToRepresent = filteredAssociations;
this.associationsToRepresentSet = true;
return this.associationsToRepresent;
@@ -204,7 +238,7 @@
// Returns the associations that are represented by this associaton-view
public ArrayList<Association> getAssociationsToRepresent() throws InvalidGdlSchemaException {
- if(this.associationsToRepresentSet) return this.associationsToRepresent;
+ if(this.associationsToRepresentSet) return this.associationsToRepresent;
else return this.filterAssociations();
}
}
1
0

[isidorus-cvs] r773 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base view
by lgiessmann@common-lisp.net 22 Aug '11
by lgiessmann@common-lisp.net 22 Aug '11
22 Aug '11
Author: lgiessmann
Date: Mon Aug 22 10:53:48 2011
New Revision: 773
Log:
gdl-frontend: Widgets: implemented filtering for GdlAssociationView, so only associations that are valid to the defined constraints of the GdlAssociationView are represented by this view, currently role-combination-constraints are not examined
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/Utils.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java
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 Mon Aug 22 09:00:17 2011 (r772)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Mon Aug 22 10:53:48 2011 (r773)
@@ -633,7 +633,7 @@
// returns the constrained role-types of the passed constraint
- public static Topic getConstraintRolesOfConstraint(Topic topicRoleOrAssociationRoleConstraint) throws InvalidGdlSchemaException {
+ public static Topic getConstraintRoleOfConstraint(Topic topicRoleOrAssociationRoleConstraint) throws InvalidGdlSchemaException {
if(topicRoleOrAssociationRoleConstraint == null) return null;
TopicMap tm = topicRoleOrAssociationRoleConstraint.getTopicMap();
@@ -648,6 +648,22 @@
}
+ // returns the constrained role and player types of the passed constraint
+ public static Pair<Topic, Topic> getConstraintRoleAndPlayerTypeOfConstraint(Topic topicRoleConstraint) throws InvalidGdlSchemaException {
+ if(topicRoleConstraint == null) return null;
+
+ TopicMap tm = topicRoleConstraint.getTopicMap();
+ Topic constraintRoleType = getTopicByPsi(PSIs.TMCL.tmclConstraint, tm);
+ Topic constrainedTopicTypeAssocType = getTopicByPsi(PSIs.TMCL.tmclConstrainedTopicType, tm);
+ Topic constrainedRoleType = getTopicByPsi(PSIs.TMCL.tmclConstrained, tm);
+ Topic topicType = getTopicByPsi(PSIs.TMCL.tmclTopictype, tm);
+ ArrayList<Topic> result = getOtherPlayerOfBinaryAssociation(topicRoleConstraint, constraintRoleType, constrainedTopicTypeAssocType, null, topicType, constrainedRoleType);
+
+ if(result.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(topicRoleConstraint) + " must be bound exactly once to a topic-type via a " + PSIs.TMCL.tmclConstrainedTopicType + " association, but is bound: " + result.size());
+ else return new Pair<Topic, Topic>(getConstraintRoleOfConstraint(topicRoleConstraint), result.get(0));
+ }
+
+
// returns the topic that plays the role of tmcl:constrained in an association
// of the type tmcl:constrained-statement that is bound to the passed topic
// constrinatTopic that plays the role of tmcl:constraint
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/Utils.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/Utils.java Mon Aug 22 09:00:17 2011 (r772)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/Utils.java Mon Aug 22 10:53:48 2011 (r773)
@@ -7,7 +7,6 @@
import com.google.gwt.dom.client.Element;
public class Utils {
-
// returns true if both arrays have the same items
public static <T> boolean compareLists(ArrayList<T> lft, ArrayList<T> rgt){
if(lft == null && rgt == null) return true;
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java Mon Aug 22 09:00:17 2011 (r772)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java Mon Aug 22 10:53:48 2011 (r773)
@@ -2,45 +2,44 @@
import java.util.ArrayList;
+import com.google.gwt.core.client.JsArray;
import com.google.gwt.user.client.Window;
-
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Role;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
-import us.isidor.gdl.anaToMia.Widgets.base.PSIs;
import us.isidor.gdl.anaToMia.Widgets.base.TmHelper;
-import us.isidor.gdl.anaToMia.Widgets.base.Utils;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
public abstract class GdlAssociationView extends GdlView {
protected ArrayList<Association> associationsToRepresent = null;
+ protected boolean associationsToRepresentSet = false;
private ArrayList<Topic> associationRoleConstraints = new ArrayList<Topic>();
- private boolean associationRoleconstraintsSet = false;
+ private boolean associationRoleConstraintsSet = false;
private ArrayList<Topic> topicRoleConstraints = new ArrayList<Topic>();
private boolean topicRoleConstraintsSet = false;
private Topic associationType = null;
private boolean associationTypeSet = false;
- private ArrayList<Topic> roleTypes = new ArrayList<Topic>();
- private boolean roleTypesSet = false;
+ private ArrayList<Pair<Topic, Topic>> roleAndPlayerTypes = new ArrayList<Pair<Topic, Topic>>();
+ private boolean roleAndPlayerTypesSet = false;
private ArrayList<Topic> roleCombinationConstraints = new ArrayList<Topic>();
private boolean roleCombinationConstraintsSet = false;
public GdlAssociationView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException {
super(tmRepresentative, receivedData);
- Window.alert("constraints: " +this.getRoleTypes().size() + " >> " + (this instanceof GdlEditorAssociationView));
-
if(this instanceof GdlEditorAssociationView) this.associationsToRepresent = this.filterAssociations();
}
// Return the association-role-constraints this view is bound to
public ArrayList<Topic> getAssociationRoleConstraints() throws InvalidGdlSchemaException {
- if(this.associationRoleconstraintsSet){
+ if(this.associationRoleConstraintsSet){
return this.associationRoleConstraints;
} else {
- this.associationRoleconstraintsSet = true;
+ this.associationRoleConstraintsSet = true;
this.associationRoleConstraints = TmHelper.getAssociationRoleConstraintsForView(this.tmRepresentative);
return this.associationRoleConstraints;
}
@@ -75,24 +74,30 @@
// returns the role-types that are valid to be used
// in associations of the type that is bound to this view
- public ArrayList<Topic> getRoleTypes() throws InvalidGdlSchemaException {
- if(this.roleTypesSet){
- return this.roleTypes;
+ public ArrayList<Pair<Topic, Topic>> getRoleAndPlayerTypes() throws InvalidGdlSchemaException {
+ if(this.roleAndPlayerTypesSet){
+ return this.roleAndPlayerTypes;
} else {
- this.roleTypesSet = true;
+ this.roleAndPlayerTypesSet = true;
ArrayList<Topic> roleTypesOfAssociationRoleConstraints = new ArrayList<Topic>();
for (Topic constraint : this.getAssociationRoleConstraints()){
- Topic top = TmHelper.getConstraintRolesOfConstraint(constraint);
+ Topic top = TmHelper.getConstraintRoleOfConstraint(constraint);
if(!roleTypesOfAssociationRoleConstraints.contains(top)) roleTypesOfAssociationRoleConstraints.add(top);
}
- ArrayList<Topic> roleTypesOfTopicRoleConstraints = new ArrayList<Topic>();
+ ArrayList<Pair<Topic, Topic>> roleTypesOfTopicRoleConstraints = new ArrayList<Pair<Topic, Topic>>();
for (Topic constraint : this.getTopicRoleConstraints()){
- Topic top = TmHelper.getConstraintRolesOfConstraint(constraint);
- if(!roleTypesOfTopicRoleConstraints.contains(top)) roleTypesOfTopicRoleConstraints.add(top);
+ Pair<Topic, Topic> roleAndPlayerType = TmHelper.getConstraintRoleAndPlayerTypeOfConstraint(constraint);
+ if(!roleTypesOfTopicRoleConstraints.contains(roleAndPlayerType)) roleTypesOfTopicRoleConstraints.add(roleAndPlayerType);
+ }
+
+ ArrayList<Pair<Topic, Topic>> result = new ArrayList<Pair<Topic,Topic>>();
+ for (Pair<Topic, Topic> roleAndPlayerType : roleTypesOfTopicRoleConstraints) {
+ if(roleTypesOfAssociationRoleConstraints.contains(roleAndPlayerType.getFirst())) result.add(roleAndPlayerType);
}
- return Utils.union(roleTypesOfAssociationRoleConstraints, roleTypesOfTopicRoleConstraints);
+ this.roleAndPlayerTypes = result;
+ return this.roleAndPlayerTypes;
}
}
@@ -130,10 +135,76 @@
}
+ // returns all associations of the received topicthat have a
+ // correct type determined by this association-view
+ private ArrayList<Association> filterAssociationsByType() throws InvalidGdlSchemaException {
+ ArrayList<Association> allAssociations = new ArrayList<Association>();
+ if(this.receivedData != null)
+ for(int i = 0; i != ((Topic)this.receivedData).getRolesPlayed().length(); ++i)
+ allAssociations.add(((Topic)this.receivedData).getRolesPlayed().get(i).getParent());
+
+ // collect only the associations that match the correct association type
+ ArrayList<Association> filteredAssociationsByType = new ArrayList<Association>();
+ for (Association assoc : allAssociations)
+ if(assoc.getType().equals(this.getAssociationType())) filteredAssociationsByType.add(assoc);
+
+ return filteredAssociationsByType;
+ }
+
+
+ // returns all associations contained in the ArrayList allAssociations
+ // that have the only permitted role types
+ private ArrayList<Association> filterAssociationsByRoleAndPlayerTypes(ArrayList<Association> allAssociations) throws InvalidGdlSchemaException {
+ if(allAssociations == null) return new ArrayList<Association>();
+
+ ArrayList<Association> filteredAssociationsByAssociationRoleConstraints = new ArrayList<Association>();
+ for (Association assoc : allAssociations){
+ JsArray<Role> roles = assoc.getRoles();
+ int i = 0;
+ for( ; i != roles.length(); ++i){
+ Topic rt = roles.get(i).getType();
+ Topic rp = roles.get(i).getPlayer();
+
+ int j = 0;
+ for( ; j != this.getRoleAndPlayerTypes().size(); ++j){
+ Pair<Topic, Topic> pair = this.getRoleAndPlayerTypes().get(j);
+ if(pair.getFirst().equals(rt) && TmHelper.isInstanceOf(rp, pair.getSecond())) break;
+ }
+
+ if(j == this.getRoleAndPlayerTypes().size()) break;
+ }
+
+ if(i == roles.length())filteredAssociationsByAssociationRoleConstraints.add(assoc);
+ }
+
+ return filteredAssociationsByAssociationRoleConstraints;
+ }
+
- public ArrayList<Association> filterAssociations(){
- // TODO: implement => returns an array with associations that
- // must be represetned by this association view
+ // returns all associations contained in the ArrayList allAssociations
+ // that are valid to the role-combination-constraints that belongs to this view
+ private ArrayList<Association> filterAssociationsByRoleCombinations(ArrayList<Association> allAssociations) throws InvalidGdlSchemaException {
+ // TODO: implement
return null;
}
+
+
+ // returns an array with associations that
+ // must be represented by this association view
+ private ArrayList<Association> filterAssociations() throws InvalidGdlSchemaException {
+ ArrayList<Association> filteredAssociations = this.filterAssociationsByType();
+ filteredAssociations = filterAssociationsByRoleAndPlayerTypes(filteredAssociations);
+ filteredAssociations = filterAssociationsByRoleCombinations(filteredAssociations);
+
+ this.associationsToRepresent = filteredAssociations;
+ this.associationsToRepresentSet = true;
+ return this.associationsToRepresent;
+ }
+
+
+ // Returns the associations that are represented by this associaton-view
+ public ArrayList<Association> getAssociationsToRepresent() throws InvalidGdlSchemaException {
+ if(this.associationsToRepresentSet) return this.associationsToRepresent;
+ else return this.filterAssociations();
+ }
}
1
0

[isidorus-cvs] r772 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets
by lgiessmann@common-lisp.net 22 Aug '11
by lgiessmann@common-lisp.net 22 Aug '11
22 Aug '11
Author: lgiessmann
Date: Mon Aug 22 09:00:17 2011
New Revision: 772
Log:
gdl-frontend: Widgets: fixed a bug in the test data
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema_with_test_data.jtm
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema_with_test_data.jtm
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema_with_test_data.jtm Mon Aug 22 07:26:37 2011 (r771)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema_with_test_data.jtm Mon Aug 22 09:00:17 2011 (r772)
@@ -3889,7 +3889,7 @@
}
],
"associations":[{"item_identifiers":null,
- "type":"si:[pref_4:has-hash]",
+ "type":"si:[pref_4:has-environment]",
"reifier":null,
"scope":null,
"roles":[{
@@ -3907,7 +3907,7 @@
]
},
{"item_identifiers":null,
- "type":"si:[pref_4:has-hash]",
+ "type":"si:[pref_4:has-environment]",
"reifier":null,
"scope":null,
"roles":[{
1
0

[isidorus-cvs] r771 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base view
by lgiessmann@common-lisp.net 22 Aug '11
by lgiessmann@common-lisp.net 22 Aug '11
22 Aug '11
Author: lgiessmann
Date: Mon Aug 22 07:26:37 2011
New Revision: 771
Log:
gdl-frontend: Widgets: implemented some helpers to comsume associations by GdlAssociationView instances
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.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/base/TmHelper.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/Utils.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java Mon Aug 22 06:51:31 2011 (r770)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java Mon Aug 22 07:26:37 2011 (r771)
@@ -21,7 +21,7 @@
public final static String tmclNameType = tmcl + "name-type";
public final static String tmclOccurrenceType = tmcl + "occurrence-type";
public final static String tmclAssociationType = tmcl + "association-type";
- public final static String tmclRoleType = "tmcl" + "role-type";
+ public final static String tmclRoleType = tmcl + "role-type";
public final static String tmclConstraint = tmcl + "constraint";
public final static String tmclConstrained = tmcl + "constrained";
public final static String tmclConstrainedStatement = tmcl + "constrained-statement";
@@ -45,6 +45,7 @@
public final static String tmclItemIdentifierConstraint = tmcl + "item-identifier-constraint";
public final static String tmclConstrainedTopicType = tmcl + "constrained-topic-type";
public final static String tmclConstrainedRole = tmcl + "constrained-role";
+ public final static String tmclRoleCombinationConstraint = tmcl + "role-combination-constraint";
}
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 Aug 22 06:51:31 2011 (r770)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Mon Aug 22 07:26:37 2011 (r771)
@@ -27,22 +27,22 @@
mainPanel.setBorderWidth(1);
mainPanel.setPixelSize(1000, 600);
- ArrayList<Pair<String, TopicIdentifierTypes>> requestedTopicsToCreate = new ArrayList<Pair<String,TopicIdentifierTypes>>();
- requestedTopicsToCreate.add(new Pair<String, TopicIdentifierTypes>("http://textgrid.org/serviceregistry/model/types/Hash-Object", TopicIdentifierTypes.SubjectIdentifier));
+ //ArrayList<Pair<String, TopicIdentifierTypes>> requestedTopicsToCreate = new ArrayList<Pair<String,TopicIdentifierTypes>>();
+ //requestedTopicsToCreate.add(new Pair<String, TopicIdentifierTypes>("http://textgrid.org/serviceregistry/model/types/Hash-Object", TopicIdentifierTypes.SubjectIdentifier));
//requestedTopicsToCreate.add(new Pair<String, TopicIdentifierTypes>("http://textgrid.org/serviceregistry/model/types/Environment", TopicIdentifierTypes.SubjectIdentifier));
//requestedTopicsToCreate.add(new Pair<String, TopicIdentifierTypes>("http://psi.test.org/gdl-test/Poet", TopicIdentifierTypes.SubjectIdentifier));
//requestedTopicsToCreate.add(new Pair<String, TopicIdentifierTypes>("http://psi.test.org/gdl-test/Musician", TopicIdentifierTypes.SubjectIdentifier));
//Pair<String, TopicIdentifierTypes> requestedTopicToEdit = new Pair<String, TopicIdentifierTypes>("http://textgrid.org/serviceregistry/model/types/test-env", TopicIdentifierTypes.SubjectIdentifier);
//Pair<String, TopicIdentifierTypes> requestedTopicToEdit = new Pair<String, TopicIdentifierTypes>("http://textgrid.org/serviceregistry/model/types/test-hash", TopicIdentifierTypes.SubjectIdentifier);
- //Pair<String, TopicIdentifierTypes> requestedTopicToEdit = new Pair<String, TopicIdentifierTypes>("http://textgrid.org/serviceregistry/test-hash-2", TopicIdentifierTypes.SubjectIdentifier);
+ Pair<String, TopicIdentifierTypes> requestedTopicToEdit = new Pair<String, TopicIdentifierTypes>("http://textgrid.org/serviceregistry/test-hash-2", TopicIdentifierTypes.SubjectIdentifier);
GdlPanel.addClickHandler("unit_1_text_create_button_id", new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Window.alert("you clicked " + ((Button)event.getSource()).getText());
}
});
- gdlPanel = new GdlPanel(null, requestedTopicsToCreate);
+ gdlPanel = new GdlPanel(requestedTopicToEdit, null);
mainPanel.add(gdlPanel);
gdlPanel.setTmEngine(new JtmsTmEngine());
gdlPanel.setLoadSchemaCallback(new LoadSchemaCallback());
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 Mon Aug 22 06:51:31 2011 (r770)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Mon Aug 22 07:26:37 2011 (r771)
@@ -10,7 +10,6 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.ScopedStub;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
-import us.isidor.gdl.anaToMia.Widgets.base.PSIs.TMDM;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
@@ -167,9 +166,9 @@
ArrayList<Topic> result = new ArrayList<Topic>();
if(top == null) return result;
TopicMap tm = top.getTopicMap();
- Topic subtype = getTopicByPsi(TMDM.subtype, tm);
- Topic supertype = getTopicByPsi(TMDM.supertype, tm);
- Topic supertypeSubtype = getTopicByPsi(TMDM.supertypeSubtype, tm);
+ Topic subtype = getTopicByPsi(PSIs.TMDM.subtype, tm);
+ Topic supertype = getTopicByPsi(PSIs.TMDM.supertype, tm);
+ Topic supertypeSubtype = getTopicByPsi(PSIs.TMDM.supertypeSubtype, tm);
if(subtype == null || supertype == null || supertypeSubtype == null) return result;
@@ -633,6 +632,22 @@
}
+ // returns the constrained role-types of the passed constraint
+ public static Topic getConstraintRolesOfConstraint(Topic topicRoleOrAssociationRoleConstraint) throws InvalidGdlSchemaException {
+ if(topicRoleOrAssociationRoleConstraint == null) return null;
+
+ TopicMap tm = topicRoleOrAssociationRoleConstraint.getTopicMap();
+ Topic constraintRoleType = getTopicByPsi(PSIs.TMCL.tmclConstraint, tm);
+ Topic constrainedRoleAssocType = getTopicByPsi(PSIs.TMCL.tmclConstrainedRole, tm);
+ Topic constrainedRoleType = getTopicByPsi(PSIs.TMCL.tmclConstrained, tm);
+ Topic roleType = getTopicByPsi(PSIs.TMCL.tmclRoleType, tm);
+ ArrayList<Topic> result = getOtherPlayerOfBinaryAssociation(topicRoleOrAssociationRoleConstraint, constraintRoleType, constrainedRoleAssocType, null, roleType, constrainedRoleType);
+
+ if(result.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(topicRoleOrAssociationRoleConstraint) + " must be bound exactly once to a role-type via a " + PSIs.TMCL.tmclConstrainedRole + " association, but is bound: " + result.size());
+ else return result.get(0);
+ }
+
+
// returns the topic that plays the role of tmcl:constrained in an association
// of the type tmcl:constrained-statement that is bound to the passed topic
// constrinatTopic that plays the role of tmcl:constraint
@@ -649,13 +664,59 @@
ArrayList<Topic> constrainedNameTypes = getOtherPlayerOfBinaryAssociation(constraintTopic, constraintRoleType, constrainedStatementAssocType, null, nameType, constrainedRoleType);
ArrayList<Topic> constrainedOccurrenceTypes = getOtherPlayerOfBinaryAssociation(constraintTopic, constraintRoleType, constrainedStatementAssocType, null, occurrenceType, constrainedRoleType);
ArrayList<Topic> constrainedAssociationTypes = getOtherPlayerOfBinaryAssociation(constraintTopic, constraintRoleType, constrainedStatementAssocType, null, associationType, constrainedRoleType);
-
- ArrayList<Topic> constrainedStatements = Utils.merge(Utils.merge(constrainedNameTypes, constrainedOccurrenceTypes), constrainedAssociationTypes);
+ ArrayList<Topic> constrainedStatements = Utils.merge(Utils.merge(constrainedNameTypes, constrainedOccurrenceTypes), constrainedAssociationTypes);
if(constrainedStatements.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(constraintTopic) + " must be bound exactly once to a statement topic via a " + PSIs.TMCL.tmclConstrainedStatement + " association, but is: " + constrainedStatements.size());
else return constrainedStatements.get(0);
}
+
+ // Returns the role-combination-constraints for the passed association-type
+ public static ArrayList<Topic> getRoleCombinationConstraints(Topic associationType){
+ if(associationType == null) return new ArrayList<Topic>();
+
+ TopicMap tm = associationType.getTopicMap();
+ Topic constrainedRoleType = getTopicByPsi(PSIs.TMCL.tmclConstraint, tm);
+ Topic constrainedStatementAssocType = getTopicByPsi(PSIs.TMCL.tmclConstrainedStatement, tm);
+ Topic constraintRoleType = getTopicByPsi(PSIs.TMCL.tmclConstraint, tm);
+ Topic roleCombinationConstraintType = getTopicByPsi(PSIs.TMCL.tmclRoleCombinationConstraint, tm);
+ return getOtherPlayerOfBinaryAssociation(associationType, constrainedRoleType, constrainedStatementAssocType, null, roleCombinationConstraintType, constraintRoleType);
+ }
+
+
+ // Returns the tmcl:association-role-constraints that are bound to the passed topic, that is
+ // the Topic Maps representative of an gdl:association-view
+ public static ArrayList<Topic> getAssociationRoleConstraintsForView(Topic viewRepresentative) throws InvalidGdlSchemaException {
+ if(viewRepresentative == null) new ArrayList<Topic>();
+
+ TopicMap tm = viewRepresentative.getTopicMap();
+ Topic descriptorRoleType = getTopicByPsi(PSIs.RoleType.gdlDescriptor, tm);
+ Topic associationViewBindingAssocType = getTopicByPsi(PSIs.AssociationType.gdlAssociationViewBinding, tm);
+ Topic tmConstructRoleType = getTopicByPsi(PSIs.RoleType.gdlTmConstruct, tm);
+ Topic associationRoleConstraintType = getTopicByPsi(PSIs.TMCL.tmclAssociationRoleConstraint, tm);
+ ArrayList<Topic> result = getOtherPlayerOfBinaryAssociation(viewRepresentative, descriptorRoleType, associationViewBindingAssocType, null, associationRoleConstraintType, tmConstructRoleType);
+
+ if(result.size() == 0) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(viewRepresentative) + " must be bound to at least one " + PSIs.TMCL.tmclAssociationRoleConstraint + ", but is unbound");
+ else return result;
+ }
+
+
+ // Returns the tmcl:topic-role-constraints that are bound to the passed topic, that is
+ // the Topic Maps representative of an gdl:association-view
+ public static ArrayList<Topic> getTopicRoleConstraintsForView(Topic viewRepresentative) throws InvalidGdlSchemaException {
+ if(viewRepresentative == null) new ArrayList<Topic>();
+
+ TopicMap tm = viewRepresentative.getTopicMap();
+ Topic descriptorRoleType = getTopicByPsi(PSIs.RoleType.gdlDescriptor, tm);
+ Topic associationViewBindingAssocType = getTopicByPsi(PSIs.AssociationType.gdlAssociationViewBinding, tm);
+ Topic tmConstructRoleType = getTopicByPsi(PSIs.RoleType.gdlTmConstruct, tm);
+ Topic topicRoleConstraintType = getTopicByPsi(PSIs.TMCL.tmclTopicRoleConstraint, tm);
+ ArrayList<Topic> result = getOtherPlayerOfBinaryAssociation(viewRepresentative, descriptorRoleType, associationViewBindingAssocType, null, topicRoleConstraintType, tmConstructRoleType);
+
+ if(result.size() == 0) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(viewRepresentative) + " must be bound to at least one " + PSIs.TMCL.tmclTopicRoleConstraint + ", but is unbound");
+ else return result;
+ }
+
// returns the root constraint of a gdl:Value-Group instance, i.e. a tmcl constraint.
// E.g. a value group may be bound to a gdl:Type constraint and this constraint may be bound
@@ -914,6 +975,35 @@
}
+ // Returns all tmcl:topic-role-constraint that the types of this topic
+ // are bound to
+ public static ArrayList<Topic> getTopicRoleConstraintsForTopicInstance(Topic topicInstance){
+ ArrayList<Topic> result = new ArrayList<Topic>();
+ if(topicInstance == null) return result;
+
+ JsArray<Topic> topicTypes = topicInstance.getTypes();
+ for(int i = 0; i != topicTypes.length(); ++i){
+ ArrayList<Topic> resultForType = getTopicRoleConstraintsForTopicType(topicTypes.get(i));
+ result = Utils.merge(result, resultForType);
+ }
+
+ return result;
+ }
+
+
+ // Returns all tmcl:topic-role-constraints the the passed topic is bound to
+ public static ArrayList<Topic> getTopicRoleConstraintsForTopicType(Topic topicType){
+ if(topicType == null) return new ArrayList<Topic>();
+
+ TopicMap tm = topicType.getTopicMap();
+ Topic constrainedRoleType = getTopicByPsi(PSIs.TMCL.tmclConstrained, tm);
+ Topic constrainedTopicTypeAssocType = getTopicByPsi(PSIs.TMCL.tmclConstrainedTopicType, tm);
+ Topic constraintRoleType = getTopicByPsi(PSIs.TMCL.tmclConstraint, tm);
+ Topic topicRoleConstraintType = getTopicByPsi(PSIs.TMCL.tmclTopicRoleConstraint, tm);
+ return getOtherPlayerOfBinaryAssociation(topicType, constrainedRoleType, constrainedTopicTypeAssocType, null, topicRoleConstraintType, constraintRoleType);
+ }
+
+
// return the occurrence of the passed type, if the topic contains more than one such occurrences,
// this function throws a InvalidgdlSchemaException
public static Occurrence getSingleOccurrence(Topic topic, Topic occurrenceType) throws InvalidGdlSchemaException {
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/Utils.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/Utils.java Mon Aug 22 06:51:31 2011 (r770)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/Utils.java Mon Aug 22 07:26:37 2011 (r771)
@@ -21,6 +21,17 @@
return true;
}
+
+
+ // returns a list that contains a union of both lists
+ public static <T> ArrayList<T> union(ArrayList<T> fst, ArrayList<T> snd){
+ ArrayList<T> result = new ArrayList<T>();
+ if(fst == null || snd == null) return result;
+
+ for (T t : fst) if(snd.contains(t)) result.add(t);
+
+ return result;
+ }
// returns an ArrayList that is a merged ArrayList of fst and snd
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java Mon Aug 22 06:51:31 2011 (r770)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java Mon Aug 22 07:26:37 2011 (r771)
@@ -2,40 +2,138 @@
import java.util.ArrayList;
+import com.google.gwt.user.client.Window;
+
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.PSIs;
+import us.isidor.gdl.anaToMia.Widgets.base.TmHelper;
+import us.isidor.gdl.anaToMia.Widgets.base.Utils;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
public abstract class GdlAssociationView extends GdlView {
protected ArrayList<Association> associationsToRepresent = null;
+ private ArrayList<Topic> associationRoleConstraints = new ArrayList<Topic>();
+ private boolean associationRoleconstraintsSet = false;
+ private ArrayList<Topic> topicRoleConstraints = new ArrayList<Topic>();
+ private boolean topicRoleConstraintsSet = false;
+ private Topic associationType = null;
+ private boolean associationTypeSet = false;
+ private ArrayList<Topic> roleTypes = new ArrayList<Topic>();
+ private boolean roleTypesSet = false;
+ private ArrayList<Topic> roleCombinationConstraints = new ArrayList<Topic>();
+ private boolean roleCombinationConstraintsSet = false;
+
public GdlAssociationView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException {
- super(tmRepresentative, null);
- // TODO: set the associationsToRepresent array by using
- // the associations the passed topic is a player of
- // and the constraints that are bound to this element's
- // value-group instance
+ super(tmRepresentative, receivedData);
+ Window.alert("constraints: " +this.getRoleTypes().size() + " >> " + (this instanceof GdlEditorAssociationView));
+
+ if(this instanceof GdlEditorAssociationView) this.associationsToRepresent = this.filterAssociations();
}
- // return the association-type that this element is bound to through the
- // set association-role- and topic-role- constraints
- public Topic getAssociationType() throws InvalidGdlSchemaException {
- // TODO: implement
- return null;
+ // Return the association-role-constraints this view is bound to
+ public ArrayList<Topic> getAssociationRoleConstraints() throws InvalidGdlSchemaException {
+ if(this.associationRoleconstraintsSet){
+ return this.associationRoleConstraints;
+ } else {
+ this.associationRoleconstraintsSet = true;
+ this.associationRoleConstraints = TmHelper.getAssociationRoleConstraintsForView(this.tmRepresentative);
+ return this.associationRoleConstraints;
+ }
}
- public ArrayList<Topic> getAssociationRoleConstraints(){
- // TODO: implement
- return null;
+ // Return the topic-role-constraints this view is bound to
+ public ArrayList<Topic> getTopicRoleConstraints() throws InvalidGdlSchemaException {
+ if(this.topicRoleConstraintsSet){
+ return this.topicRoleConstraints;
+ } else {
+ this.topicRoleConstraintsSet = true;
+ this.topicRoleConstraints = TmHelper.getTopicRoleConstraintsForView(this.tmRepresentative);
+ return this.topicRoleConstraints;
+ }
+ }
+
+
+ // Returns the role-combination-constraints of the association-
+ // type that is bound to this association-view via the bound
+ // constraints
+ public ArrayList<Topic> getRoleCombinationConstraints() throws InvalidGdlSchemaException {
+ if(this.roleCombinationConstraintsSet){
+ return this.roleCombinationConstraints;
+ } else {
+ this.roleCombinationConstraintsSet = true;
+ this.roleCombinationConstraints = TmHelper.getRoleCombinationConstraints(this.getAssociationType());
+ return this.roleCombinationConstraints;
+ }
}
- public ArrayList<Topic> getTopicRoleConstraints(){
- // TODO: implement
+ // returns the role-types that are valid to be used
+ // in associations of the type that is bound to this view
+ public ArrayList<Topic> getRoleTypes() throws InvalidGdlSchemaException {
+ if(this.roleTypesSet){
+ return this.roleTypes;
+ } else {
+ this.roleTypesSet = true;
+ ArrayList<Topic> roleTypesOfAssociationRoleConstraints = new ArrayList<Topic>();
+ for (Topic constraint : this.getAssociationRoleConstraints()){
+ Topic top = TmHelper.getConstraintRolesOfConstraint(constraint);
+ if(!roleTypesOfAssociationRoleConstraints.contains(top)) roleTypesOfAssociationRoleConstraints.add(top);
+ }
+
+ ArrayList<Topic> roleTypesOfTopicRoleConstraints = new ArrayList<Topic>();
+ for (Topic constraint : this.getTopicRoleConstraints()){
+ Topic top = TmHelper.getConstraintRolesOfConstraint(constraint);
+ if(!roleTypesOfTopicRoleConstraints.contains(top)) roleTypesOfTopicRoleConstraints.add(top);
+ }
+
+ return Utils.union(roleTypesOfAssociationRoleConstraints, roleTypesOfTopicRoleConstraints);
+ }
+ }
+
+
+ // returns the association type that is valid with respect to the
+ // topic- and the association-role-constraints that are bound to this view
+ public Topic getAssociationType() throws InvalidGdlSchemaException {
+ if(this.associationTypeSet){
+ return this.associationType;
+ } else {
+ this.associationTypeSet = true;
+ ArrayList<Topic> assocTypes = new ArrayList<Topic>();
+ for (Topic constraint : this.getAssociationRoleConstraints()){
+ Topic top = TmHelper.getConstrainedStatement(constraint);
+ if(!assocTypes.contains(top)) assocTypes.add(top);
+ }
+
+ for (Topic constraint : this.getTopicRoleConstraints()){
+ Topic top = TmHelper.getConstrainedStatement(constraint);
+ if(!assocTypes.contains(top)) assocTypes.add(top);
+ }
+
+ if(assocTypes.size() != 1){
+ String bindings = "[";
+ for (Topic topic : assocTypes)
+ bindings += TmHelper.getAnyIdOfTopic(topic) + ", ";
+ if(bindings.length() == 1) bindings = "[ ]";
+ else bindings = bindings.substring(0, bindings.length() - 2) + "]";
+ throw new InvalidGdlSchemaException("the association-view " + TmHelper.getAnyIdOfTopic(this.tmRepresentative) + " must be bound to topic-role-constraints and association-rle-constraints that own the same constrained-statement, but found the constrained-statements: " + bindings);
+ }
+
+ this.associationType = assocTypes.get(0);
+ return this.associationType;
+ }
+ }
+
+
+
+ public ArrayList<Association> filterAssociations(){
+ // TODO: implement => returns an array with associations that
+ // must be represetned by this association view
return null;
}
}
1
0

[isidorus-cvs] r770 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base
by lgiessmann@common-lisp.net 22 Aug '11
by lgiessmann@common-lisp.net 22 Aug '11
22 Aug '11
Author: lgiessmann
Date: Mon Aug 22 06:51:31 2011
New Revision: 770
Log:
gdl-frontend: Widgets: fixed a bug in the tmcl:association-type PSI
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java Mon Aug 22 06:29:32 2011 (r769)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java Mon Aug 22 06:51:31 2011 (r770)
@@ -20,7 +20,8 @@
public final static String tmclTopictype = tmcl + "topic-type";
public final static String tmclNameType = tmcl + "name-type";
public final static String tmclOccurrenceType = tmcl + "occurrence-type";
- public final static String tmclAssociationType = "tmcl" + "association-type";
+ public final static String tmclAssociationType = tmcl + "association-type";
+ public final static String tmclRoleType = "tmcl" + "role-type";
public final static String tmclConstraint = tmcl + "constraint";
public final static String tmclConstrained = tmcl + "constrained";
public final static String tmclConstrainedStatement = tmcl + "constrained-statement";
@@ -42,6 +43,8 @@
public final static String tmclSubjectIdentifierConstraint = tmcl + "subject-identifier-constraint";
public final static String tmclSubjectLocatorConstraint = tmcl + "subject-locator-constraint";
public final static String tmclItemIdentifierConstraint = tmcl + "item-identifier-constraint";
+ public final static String tmclConstrainedTopicType = tmcl + "constrained-topic-type";
+ public final static String tmclConstrainedRole = tmcl + "constrained-role";
}
1
0