Changeset 1011 for trunk/src/anaToMia/GDL_Widgets
- Timestamp:
- 10/20/11 07:14:01 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java ¶
r1010 r1011 1921 1921 // get type 1922 1922 Topic constrainedTopicType = TmHelper.getConstrainedTopicType(this.getConstraint()); 1923 1923 1924 1924 // search for the topic type 1925 1925 Reifiable ref = (Reifiable)this.receivedData; 1926 1926 1927 1927 // search for the characteristics type 1928 1928 if(this.receivedData instanceof Topic){ … … 1938 1938 if(roles.length() != 0) ref = roles.get(0); 1939 1939 } 1940 1940 1941 1941 // search for item-identifiers of the found topic type or characteristics 1942 1942 Pattern rex = new Pattern(this.getLiteralValueForConstraint()); … … 1961 1961 } else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclReifierConstraint)){ 1962 1962 Topic type = TmHelper.getConstrainedStatement(this.getConstraint()); 1963 1963 1964 1964 Topic reifier = null; 1965 1965 if(this.receivedData instanceof Topic){ … … 1975 1975 throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a topic or association, but is: " + this.receivedData.getClass()); 1976 1976 } 1977 1977 1978 1978 String str = this.getTopicRepresentation(reifier, this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup()); 1979 1979 if(str == null) str = ""; … … 1981 1981 } else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclVariantNameConstraint)){ 1982 1982 if(!(this.receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass()); 1983 1983 1984 1984 Topic nameType = TmHelper.getConstrainedStatement(this.getRootConstraint()); 1985 1985 JsArray<Name> names = ((Topic)this.receivedData).getNames(nameType); 1986 1986 Topic scope = TmHelper.getConstrainedScopeTopic(this.getRootConstraint()); 1987 1987 JsArray<Variant> variants = names.get(0).getVariants(); 1988 1989 if(variants.get(0).getScope().length() != 0){ 1990 JsArray<Topic> scopes = variants.get(0).getScope(); 1991 int i = 0; 1992 for( ; i != scopes.length(); ++i) if(scopes.get(i).equals(scope)) break; 1993 1994 if(i != scopes.length()){ 1995 for(i = 0; i != scopes.length(); ++i) this.addSubItem(this.getTopicRepresentation(scopes.get(i), this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup())); 1988 1989 for(int varIdx = 0; varIdx != variants.length(); ++varIdx){ 1990 if(variants.get(varIdx).getScope().length() != 0){ 1991 JsArray<Topic> scopes = variants.get(varIdx).getScope(); 1992 int scopeIdx = 0; 1993 for( ; scopeIdx != scopes.length(); ++scopeIdx) if(scopes.get(scopeIdx).equals(scope)) break; 1994 1995 if(scopeIdx != scopes.length()){ 1996 this.addSubItem(variants.get(varIdx).getValue()); 1997 break; 1998 } 1996 1999 } 1997 2000 } 1998 2001 } else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclScopeConstraint)){ 1999 2002 Topic type = TmHelper.getConstrainedStatement(this.getConstraint()); 2000 2003 2001 2004 JsArray<Topic> scope = null; 2002 2005 if(this.receivedData instanceof Topic){ … … 2012 2015 throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a topic or association, but is: " + this.receivedData.getClass()); 2013 2016 } 2014 2017 2015 2018 if(scope != null){ 2016 2019 for(int i = 0; i != scope.length(); ++i) this.addSubItem(this.getTopicRepresentation(scope.get(i), this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup())); … … 2045 2048 throw new ExecutionException("The topic " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to the following root constraints: " + constraints); 2046 2049 } 2047 2050 2048 2051 String str = this.getTopicRepresentation(type, this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup()); 2049 2052 if(str == null) str = ""; … … 2056 2059 // TODO: implement: Variant-Name-Reifier 2057 2060 } else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.GDL.TopicType.gdlVariantNameScope)){ 2058 // TODO: implement: Variant-Name-Scope 2061 if(!(this.receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass()); 2062 2063 Topic nameType = TmHelper.getConstrainedStatement(this.getRootConstraint()); 2064 JsArray<Name> names = ((Topic)this.receivedData).getNames(nameType); 2065 Topic scope = TmHelper.getConstrainedScopeTopic(this.getRootConstraint()); 2066 JsArray<Variant> variants = names.get(0).getVariants(); 2067 2068 for(int varIdx = 0; varIdx != variants.length(); ++varIdx){ 2069 if(variants.get(varIdx).getScope().length() != 0){ 2070 JsArray<Topic> scopes = variants.get(varIdx).getScope(); 2071 int scopeIdx = 0; 2072 for( ; scopeIdx != scopes.length(); ++scopeIdx) if(scopes.get(scopeIdx).equals(scope)) break; 2073 2074 if(scopeIdx != scopes.length()){ 2075 for(int i = 0; i != scopes.length(); ++i) this.addSubItem(this.getTopicRepresentation(scopes.get(i), this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup())); 2076 } 2077 } 2078 } 2059 2079 } else { 2060 2080 throw new InvalidGdlSchemaException("The constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " is not suported to be bound to the value group instance " + TmHelper.getAnyIdOfTopic(this.getValueGroup()));
Note: See TracChangeset
for help on using the changeset viewer.