Author: lgiessmann
Date: Thu Aug 25 06:32:05 2011
New Revision: 785
Log:
gdl-frontend: Widgets: deleted the interface IGdlHasValueGroup; moved all methods from GdlText that are necessary to comnsume Topic Maps to GdlVisibleObject; added the abstract method addSubItem(String value) to GdlVisibleObject, so each derived class must implement it, the advantage of this method is the consuming of Topic Maps, it can be done in one place, at the GdlVisibleObject implementation, while calling addSubItem to add new data
Deleted:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlHasValueGroup.java
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlSpace.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/button/GdlActionButton.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCheckBox.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlInputButton.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlRadioButton.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/GdlDatePicker.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDateTimePicker.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlImage.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlTimePicker.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/text/GdlInfo.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/GdlTitle.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/GdlSpace.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlSpace.java Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlSpace.java Thu Aug 25 06:32:05 2011 (r785)
@@ -16,4 +16,11 @@
super(tmRepresentative, receivedData);
this.setGdlStyle(this);
}
+
+
+ @Override
+ @Deprecated
+ public void addSubItem(String value){
+ // this method has no effect on GdlSpace instances
+ }
}
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 Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Aug 25 06:32:05 2011 (r785)
@@ -6,6 +6,8 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Name;
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;
@@ -19,6 +21,7 @@
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.environment.MultipleHandlerRegistration;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pattern;
import us.isidor.gdl.anaToMia.Widgets.text.GdlInfo;
import us.isidor.gdl.anaToMia.Widgets.value.AbsoluteNumValue;
import us.isidor.gdl.anaToMia.Widgets.value.AutoNumUnitValue;
@@ -79,6 +82,24 @@
protected ArrayList<Pair<Topic, Integer>> actionButtonsAndPositions = null;
protected ArrayList<GdlInfo> infoElements = new ArrayList<GdlInfo>();
protected Construct receivedData = null;
+ protected Topic valueGroupTopic = null;
+ protected boolean valueGroupTopicSet = false;
+ protected Topic constraintTopic = null;
+ protected boolean constraintTopicSet = false;
+ protected Topic rootConstraintTopic = null;
+ protected boolean rootConstraintTopicSet = false;
+ protected Topic defaultTmValueTopic = null;
+ protected boolean defaultTmValueTopicSet = false;
+ protected Topic defaultLiteralValueTopic = null;
+ protected boolean defaultLiteralValueTopicSet = false;
+ protected ArrayList<Topic> tmValueTopics = new ArrayList<Topic>();
+ 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
@@ -87,6 +108,11 @@
DOM.setStyleAttribute(this.mainPanel.getElement(), "overflow", "visible");
}
+
+ // this method takes a string and creates a new sub-element within
+ // an instance of GdlVisibleObject with the passed string value
+ public abstract void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException;
+
public GdlVisibleObject(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
this();
@@ -1829,4 +1855,238 @@
e.printStackTrace();
}
}
+
+
+ // sets the fields for the received data
+ protected void setReceivedData() throws InvalidGdlSchemaException, ExecutionException {
+ if(receivedData == null) return;
+
+ if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclSubjectIdentifierConstraint)){
+ if(!(receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
+
+ Pattern rex = new Pattern(this.getLiteralValueForConstraint());
+ for(int i = 0; i != ((Topic)receivedData).getSubjectIdentifiers().length(); ++i){
+ String psi = ((Topic)receivedData).getSubjectIdentifiers().get(i).getReference();
+ if(rex.matches(psi)){
+ this.addSubItem(psi);
+ }
+ }
+ } else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclSubjectLocatorConstraint)){
+ if(!(receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
+
+ Pattern rex = new Pattern(this.getLiteralValueForConstraint());
+ for(int i = 0; i != ((Topic)receivedData).getSubjectLocators().length(); ++i){
+ String sl = ((Topic)receivedData).getSubjectLocators().get(i).getReference();
+ if(rex.matches(sl)){
+ this.addSubItem(sl);
+ }
+ }
+ } else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclItemIdentifierConstraint)){
+ if(!(this.receivedData instanceof Reifiable)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Reifiable, but is: " + receivedData.getClass());
+
+ Pattern rex = new Pattern(this.getLiteralValueForConstraint());
+ for(int i = 0; i != ((ReifiableStub)receivedData).getItemIdentifiers().length(); ++i){
+ String ii = ((Topic)receivedData).getItemIdentifiers().get(i).getReference();
+ if(rex.matches(ii)){
+ this.addSubItem(ii);
+ }
+ }
+ } else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclTopicNameConstraint)){
+ if(!(receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
+
+ Topic nameType = TmHelper.getConstrainedStatement(this.getConstraint());
+ for(int i = 0; i != ((Topic)this.receivedData).getNames(nameType).length(); ++i)
+ this.addSubItem(((Topic)this.receivedData).getNames(nameType).get(i).getValue());
+ } else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclTopicOccurrenceConstraint)){
+ if(!(receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
+
+ Topic occurrenceType = TmHelper.getConstrainedStatement(this.getConstraint());
+ for(int i = 0; i != ((Topic)this.receivedData).getOccurrences(occurrenceType).length(); ++i)
+ this.addSubItem(((Topic)this.receivedData).getOccurrences(occurrenceType).get(i).getValue());
+ } else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.GDL.TopicType.gdlRolePlayer)){
+ 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.addSubItem(this.getTopicRepresentation(assocRoles.get(i).getPlayer(), this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup()));
+ }
+ }
+ }
+ // TODO: implement type, variant, datatype, associations, roles, ... constraints
+ }
+
+
+ // 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");
+
+ if(this.getDefaultLiteralValue() != null){
+ TopicMap tm = this.getDefaultLiteralValue().getTopicMap();
+ 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.GDL.OccurrenceType.gdlLiteralValue + " occurrence, but is: " + vals.length());
+
+ this.addSubItem(vals.get(0).getValue());
+ } else if(this.getDefaultTmValue() != null){
+ // TODO: set default-tm-value
+ } else {
+ this.addSubItem("");
+ }
+ }
+
+
+ public Topic getValueGroup() throws InvalidGdlSchemaException {
+ if(this.valueGroupTopicSet){
+ return this.valueGroupTopic;
+ } else {
+ this.valueGroupTopic = TmHelper.getValueGroupOf(this.tmRepresentative);
+ this.valueGroupTopicSet = true;
+ return this.valueGroupTopic;
+ }
+ }
+
+
+ public Topic getConstraint() throws InvalidGdlSchemaException {
+ if(this.constraintTopicSet){
+ return this.constraintTopic;
+ } else {
+ this.constraintTopic = TmHelper.getConstraintOfValueGroup(this.getValueGroup());
+ this.constraintTopicSet = true;
+ return this.constraintTopic;
+ }
+ }
+
+
+ public Topic getRootConstraint() throws InvalidGdlSchemaException {
+ if(this.rootConstraintTopicSet){
+ return this.rootConstraintTopic;
+ } else {
+ this.rootConstraintTopic = TmHelper.getRootConstraintOfValueGroup(this.getValueGroup(), this.getConstraint());
+ this.rootConstraintTopicSet = true;
+ return this.rootConstraintTopic;
+ }
+ }
+
+
+ public Topic getDefaultTmValue() throws InvalidGdlSchemaException {
+ if(this.defaultTmValueTopicSet){
+ return this.defaultTmValueTopic;
+ } else {
+ this.defaultTmValueTopic = TmHelper.getDefaultTmValue(this.getValueGroup());
+ this.defaultTmValueTopicSet = true;
+ return this.defaultTmValueTopic;
+ }
+ }
+
+
+ public Topic getDefaultLiteralValue() throws InvalidGdlSchemaException {
+ if(this.defaultLiteralValueTopicSet){
+ return this.defaultLiteralValueTopic;
+ } else {
+ this.defaultLiteralValueTopic = TmHelper.getDefaultLiteralValue(this.getValueGroup());
+ this.defaultLiteralValueTopicSet = true;
+ return this.defaultLiteralValueTopic;
+ }
+ }
+
+
+ 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.GDL.TopicType.gdlDefaultValue + ", but is: 2");
+ else if(this.getDefaultLiteralValue() != null) return this.getDefaultLiteralValue();
+ else return this.getDefaultTmValue();
+ }
+
+
+ public boolean fixedDefaultValue() throws InvalidGdlSchemaException{
+ Topic defVal = this.getDefaultValue();
+
+ if(defVal == null) return false;
+
+ TopicMap tm = defVal.getTopicMap();
+ 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.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;
+ }
+ }
+
+
+ public ArrayList<Topic> getTmValues() throws InvalidGdlSchemaException {
+ if(this.tmValueTopicsSet){
+ return this.tmValueTopics;
+ } else {
+ this.tmValueTopics = TmHelper.getTmValues(this.getValueGroup());
+ this.tmValueTopicsSet = true;
+ return this.tmValueTopics;
+ }
+ }
+
+
+ public ArrayList<Topic> getLiteralValues() throws InvalidGdlSchemaException {
+ if(this.literalValueTopicsSet){
+ return this.literalValueTopics;
+ } else {
+ this.literalValueTopics = TmHelper.getLiteralValues(this.getValueGroup());
+ this.literalValueTopicsSet = true;
+ return this.literalValueTopics;
+ }
+ }
+
+
+ public String getSetLiteralValue() throws InvalidGdlSchemaException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public Construct getSetTmValue() throws InvalidGdlSchemaException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public ArrayList<Topic> getTmValuesForConstraint() throws InvalidGdlSchemaException, ExecutionException {
+ return TmHelper.getTmValuesForConstraint(this.getConstraint(), this.getValueGroup());
+ }
+
+
+ public String getLiteralValueForConstraint() throws InvalidGdlSchemaException {
+ return TmHelper.getLiteralValueForConstraint(this.getConstraint());
+ }
+
+
+ public Topic getDisplayByOfValueGroup() throws InvalidGdlSchemaException {
+ if(this.displayByConstraintSet){
+ return this.displayByConstraint;
+ } else {
+ this.displayByConstraintSet = true;
+ this.displayByConstraint = TmHelper.getDisplayByTopicOf(this.getValueGroup());
+ return this.displayByConstraint;
+ }
+ }
+
+
+ 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;
+ }
+ }
+
+
+ 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/button/GdlActionButton.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlActionButton.java Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlActionButton.java Thu Aug 25 06:32:05 2011 (r785)
@@ -31,13 +31,18 @@
super(tmRepresentative, receivedData);
// TODO: set all tm values
- this.createButton().setText("Action-Button"); // TODO: remove set text
+ this.createNewButton().setText("Action-Button"); // TODO: remove set text
this.setClickHandlers();
}
+ public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
+ this.createNewButton().setText(value);
+ }
+
+
// creates a new button if no one exist, otherwise returns the existing button
- protected Button createButton() throws InvalidGdlSchemaException, ExecutionException{
+ protected Button createNewButton() throws InvalidGdlSchemaException, ExecutionException{
if(this.subElements.size() != 0) return (Button)this.subElements.get(0);
Button btn = new Button();
this.subElements.add(btn);
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCheckBox.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCheckBox.java Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCheckBox.java Thu Aug 25 06:32:05 2011 (r785)
@@ -31,4 +31,10 @@
this.setGdlStyle(cb);
return cb;
}
+
+
+ @Override
+ public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
+ // TODO: implement
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlInputButton.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlInputButton.java Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlInputButton.java Thu Aug 25 06:32:05 2011 (r785)
@@ -5,7 +5,7 @@
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
-public class GdlInputButton extends GdlButton {
+public abstract class GdlInputButton extends GdlButton {
protected GdlInputButton(){
super();
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlRadioButton.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlRadioButton.java Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlRadioButton.java Thu Aug 25 06:32:05 2011 (r785)
@@ -30,4 +30,10 @@
this.setGdlStyle(rb);
return rb;
}
+
+
+ @Override
+ public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
+ // TODO: implement
+ }
}
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 Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlAudio.java Thu Aug 25 06:32:05 2011 (r785)
@@ -16,4 +16,10 @@
public GdlAudio(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
this();
}
+
+
+ @Override
+ public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
+ // TODO: implement
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDatePicker.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDatePicker.java Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDatePicker.java Thu Aug 25 06:32:05 2011 (r785)
@@ -1,6 +1,8 @@
package us.isidor.gdl.anaToMia.Widgets.complexData;
+import java.util.Date;
+
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.FocusEvent;
@@ -45,13 +47,13 @@
public GdlDatePicker(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
super(tmRepresentative, receivedData);
// create a date widget for each tm-construct
- this.createDateWidget();
+ this.createNewDateWidget();
this.setNthButtons();
}
- public void createDateWidget() throws InvalidGdlSchemaException, ExecutionException {
+ public DateWidget createNewDateWidget() throws InvalidGdlSchemaException, ExecutionException {
// this object is able to own only one sub-element
DateWidget date = new DateWidget();
@@ -70,12 +72,23 @@
super.addToContainerPanel(date);
this.setGdlStyle(date);
+ return date;
}
public ButtonableObject removeDatePicker(DateWidget elem) throws InvalidGdlSchemaException, ExecutionException{
return this.removeFromContainer(elem);
- }
+ }
+
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
+ DateWidget dateWidget = this.createNewDateWidget();
+ Date dateValue = new Date();
+ dateValue.setTime(Date.parse(value));
+ dateWidget.setValue(dateValue);
+ }
protected class DateWidget extends DatePicker implements HasFocusHandlers, HasBlurHandlers, HasMouseDownHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers {
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDateTimePicker.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDateTimePicker.java Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDateTimePicker.java Thu Aug 25 06:32:05 2011 (r785)
@@ -19,4 +19,11 @@
super(tmRepresentative, receivedData);
// create a date-time widget for each tm-construct
}
+
+
+ @Override
+ public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
+ // TODO: implement
+
+ }
}
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 Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlImage.java Thu Aug 25 06:32:05 2011 (r785)
@@ -16,4 +16,11 @@
public GdlImage(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
this();
}
+
+
+ @Override
+ public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
+ // TODO: implement
+
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlTimePicker.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlTimePicker.java Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlTimePicker.java Thu Aug 25 06:32:05 2011 (r785)
@@ -19,4 +19,11 @@
super(tmRepresentative, receivedData);
// create a time widget for each tm-construct
}
+
+
+ @Override
+ public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
+ // TODO: implement
+
+ }
}
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 Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlVideo.java Thu Aug 25 06:32:05 2011 (r785)
@@ -16,4 +16,11 @@
public GdlVideo(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
this();
}
+
+
+ @Override
+ public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
+ // TODO: implement
+
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java Thu Aug 25 06:32:05 2011 (r785)
@@ -53,14 +53,14 @@
// some constructors
protected GdlList() throws InvalidGdlSchemaException, ExecutionException {
super();
- this.createList();
+ this.createNewList();
this.setNthButtons();
}
public GdlList(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
super(tmRepresentative, receivedData);
- this.createList();
+ this.createNewList();
ArrayList<Topic> objectsContained = this.contains();
@@ -75,10 +75,16 @@
}
+ @Override
+ public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
+ // this method has no effect on this class
+ }
+
+
// sets the list Element to either ol or ul depending on the gdl:ordered property
- public void createList() throws InvalidGdlSchemaException, ExecutionException {
+ public ListWidget createNewList() throws InvalidGdlSchemaException, ExecutionException {
// this object is able to own only one sub-element
- if(super.subElements != null && super.subElements.size() == 1)return;
+ if(this.subElements != null && this.subElements.size() == 1) return (ListWidget)this.subElements.get(0);
ListWidget list = new ListWidget(this.getOrdered());
ActiveStyleHandler asHandler = new ActiveStyleHandler(this);
@@ -95,6 +101,7 @@
list.addBlurHandler(fsHandler);
super.addToContainerPanel(list);
this.setGdlStyle(list);
+ return list;
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java Thu Aug 25 06:32:05 2011 (r785)
@@ -225,6 +225,12 @@
}
+ @Override
+ public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
+ // this method has no effect on this class
+ }
+
+
protected class UnitWidget extends Composite implements HasFocusHandlers, HasBlurHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseDownHandlers, HasMouseUpHandlers{
private CaptionPanel basePanel = new CaptionPanel();
private AbsolutePanel containerPanel = new AbsolutePanel();
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlInfo.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlInfo.java Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlInfo.java Thu Aug 25 06:32:05 2011 (r785)
@@ -36,6 +36,12 @@
}
+ @Override
+ public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
+ this.createNewInfo().setText(value);
+ }
+
+
private Label createNewInfo() throws ExecutionException, InvalidGdlSchemaException{
Label lbl = new Label();
this.addToContainerPanel(lbl);
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 Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlListBox.java Thu Aug 25 06:32:05 2011 (r785)
@@ -33,6 +33,12 @@
}
+ @Override
+ public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
+ // TODO: implement
+ }
+
+
// creates a new ListBox item, adds it to the subElements array,
// and applies the styles on it
protected ListBox createNewListBox() throws InvalidGdlSchemaException, ExecutionException {
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 Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java Thu Aug 25 06:32:05 2011 (r785)
@@ -43,6 +43,12 @@
}
+ @Override
+ public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
+ // TODO: implement
+ }
+
+
private ReferenceWidget createReference() throws InvalidGdlSchemaException, ExecutionException {
ReferenceWidget reference = new ReferenceWidget();
DOM.setElementAttribute(reference.getElement(), "id", this.getId() + "__GDL_" + this.subElements.size());
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 Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Aug 25 06:32:05 2011 (r785)
@@ -1,8 +1,6 @@
package us.isidor.gdl.anaToMia.Widgets.text;
import java.util.ArrayList;
-
-import com.google.gwt.core.client.JsArray;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
@@ -14,26 +12,17 @@
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;
import us.isidor.gdl.anaToMia.Widgets.base.PSIs;
-import us.isidor.gdl.anaToMia.Widgets.base.IGdlHasValueGroup;
-import us.isidor.gdl.anaToMia.Widgets.base.TmHelper;
import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
-import us.isidor.gdl.anaToMia.Widgets.environment.Pattern;
import us.isidor.gdl.anaToMia.Widgets.value.AbsoluteNumValue;
import us.isidor.gdl.anaToMia.Widgets.value.BorderStyleValue;
import us.isidor.gdl.anaToMia.Widgets.value.ColorValue;
@@ -43,28 +32,9 @@
-public class GdlText extends GdlTextObject implements IGdlHasValueGroup {
+public class GdlText extends GdlTextObject {
protected ArrayList<PasswordKeyPressHandler> passwordKeyPressHandler = null;
protected ArrayList<HandlerRegistration> passwordKeyPressRegistrations = null;
- protected Topic valueGroupTopic = null;
- protected boolean valueGroupTopicSet = false;
- protected Topic constraintTopic = null;
- protected boolean constraintTopicSet = false;
- protected Topic rootConstraintTopic = null;
- protected boolean rootConstraintTopicSet = false;
- protected Topic defaultTmValueTopic = null;
- protected boolean defaultTmValueTopicSet = false;
- protected Topic defaultLiteralValueTopic = null;
- protected boolean defaultLiteralValueTopicSet = false;
- protected ArrayList<Topic> tmValueTopics = new ArrayList<Topic>();
- 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 {
@@ -86,86 +56,9 @@
}
- // sets the fields for the received data
- protected void setReceivedData() throws InvalidGdlSchemaException, ExecutionException {
- if(receivedData == null) return;
-
- if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclSubjectIdentifierConstraint)){
- if(!(receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
-
- Pattern rex = new Pattern(this.getLiteralValueForConstraint());
- for(int i = 0; i != ((Topic)receivedData).getSubjectIdentifiers().length(); ++i){
- String psi = ((Topic)receivedData).getSubjectIdentifiers().get(i).getReference();
- if(rex.matches(psi)){
- this.createNewTextArea().setText(psi);
- }
- }
- } else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclSubjectLocatorConstraint)){
- if(!(receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
-
- Pattern rex = new Pattern(this.getLiteralValueForConstraint());
- for(int i = 0; i != ((Topic)receivedData).getSubjectLocators().length(); ++i){
- String sl = ((Topic)receivedData).getSubjectLocators().get(i).getReference();
- if(rex.matches(sl)){
- this.createNewTextArea().setText(sl);
- }
- }
- } else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclItemIdentifierConstraint)){
- if(!(this.receivedData instanceof Reifiable)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Reifiable, but is: " + receivedData.getClass());
-
- Pattern rex = new Pattern(this.getLiteralValueForConstraint());
- for(int i = 0; i != ((ReifiableStub)receivedData).getItemIdentifiers().length(); ++i){
- String ii = ((Topic)receivedData).getItemIdentifiers().get(i).getReference();
- if(rex.matches(ii)){
- this.createNewTextArea().setText(ii);
- }
- }
- } else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclTopicNameConstraint)){
- if(!(receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
-
- Topic nameType = TmHelper.getConstrainedStatement(this.getConstraint());
- for(int i = 0; i != ((Topic)this.receivedData).getNames(nameType).length(); ++i)
- this.createNewTextArea().setText(((Topic)this.receivedData).getNames(nameType).get(i).getValue());
- } else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclTopicOccurrenceConstraint)){
- if(!(receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
-
- 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.GDL.TopicType.gdlRolePlayer)){
- 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 => add a new interface that encupsulates
- // createNewTextArea etc. an call this method in the GdlVisibleObject
- }
-
-
- // 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");
-
- if(this.getDefaultLiteralValue() != null){
- TopicMap tm = this.getDefaultLiteralValue().getTopicMap();
- 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.GDL.OccurrenceType.gdlLiteralValue + " occurrence, but is: " + vals.length());
-
- this.createNewTextArea().setText(vals.get(0).getValue());
- } else if(this.getDefaultTmValue() != null){
- // TODO: set default-tm-value
- } else {
- this.createNewTextArea();
- }
+ @Override
+ public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
+ this.createNewTextArea().setText(value);
}
@@ -924,171 +817,4 @@
}
}
-
- @Override
- public Topic getValueGroup() throws InvalidGdlSchemaException {
- if(this.valueGroupTopicSet){
- return this.valueGroupTopic;
- } else {
- this.valueGroupTopic = TmHelper.getValueGroupOf(this.tmRepresentative);
- this.valueGroupTopicSet = true;
- return this.valueGroupTopic;
- }
- }
-
-
- @Override
- public Topic getConstraint() throws InvalidGdlSchemaException {
- if(this.constraintTopicSet){
- return this.constraintTopic;
- } else {
- this.constraintTopic = TmHelper.getConstraintOfValueGroup(this.getValueGroup());
- this.constraintTopicSet = true;
- return this.constraintTopic;
- }
- }
-
-
- @Override
- public Topic getRootConstraint() throws InvalidGdlSchemaException {
- if(this.rootConstraintTopicSet){
- return this.rootConstraintTopic;
- } else {
- this.rootConstraintTopic = TmHelper.getRootConstraintOfValueGroup(this.getValueGroup(), this.getConstraint());
- this.rootConstraintTopicSet = true;
- return this.rootConstraintTopic;
- }
- }
-
-
- @Override
- public Topic getDefaultTmValue() throws InvalidGdlSchemaException {
- if(this.defaultTmValueTopicSet){
- return this.defaultTmValueTopic;
- } else {
- this.defaultTmValueTopic = TmHelper.getDefaultTmValue(this.getValueGroup());
- this.defaultTmValueTopicSet = true;
- return this.defaultTmValueTopic;
- }
- }
-
-
- @Override
- public Topic getDefaultLiteralValue() throws InvalidGdlSchemaException {
- if(this.defaultLiteralValueTopicSet){
- return this.defaultLiteralValueTopic;
- } else {
- this.defaultLiteralValueTopic = TmHelper.getDefaultLiteralValue(this.getValueGroup());
- this.defaultLiteralValueTopicSet = true;
- return this.defaultLiteralValueTopic;
- }
- }
-
-
- @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.GDL.TopicType.gdlDefaultValue + ", but is: 2");
- else if(this.getDefaultLiteralValue() != null) return this.getDefaultLiteralValue();
- else return this.getDefaultTmValue();
- }
-
-
- public boolean fixedDefaultValue() throws InvalidGdlSchemaException{
- Topic defVal = this.getDefaultValue();
-
- if(defVal == null) return false;
-
- TopicMap tm = defVal.getTopicMap();
- 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.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;
- }
- }
-
-
- @Override
- public ArrayList<Topic> getTmValues() throws InvalidGdlSchemaException {
- if(this.tmValueTopicsSet){
- return this.tmValueTopics;
- } else {
- this.tmValueTopics = TmHelper.getTmValues(this.getValueGroup());
- this.tmValueTopicsSet = true;
- return this.tmValueTopics;
- }
- }
-
-
- @Override
- public ArrayList<Topic> getLiteralValues() throws InvalidGdlSchemaException {
- if(this.literalValueTopicsSet){
- return this.literalValueTopics;
- } else {
- this.literalValueTopics = TmHelper.getLiteralValues(this.getValueGroup());
- this.literalValueTopicsSet = true;
- return this.literalValueTopics;
- }
- }
-
-
- @Override
- public String getSetLiteralValue() throws InvalidGdlSchemaException {
- // TODO Auto-generated method stub
- return null;
- }
-
-
- @Override
- public Construct getSetTmValue() throws InvalidGdlSchemaException {
- // TODO Auto-generated method stub
- return null;
- }
-
-
- @Override
- public ArrayList<Topic> getTmValuesForConstraint() throws InvalidGdlSchemaException, ExecutionException {
- return TmHelper.getTmValuesForConstraint(this.getConstraint(), this.getValueGroup());
- }
-
-
- @Override
- public String getLiteralValueForConstraint() throws InvalidGdlSchemaException {
- return TmHelper.getLiteralValueForConstraint(this.getConstraint());
- }
-
-
- @Override
- public Topic getDisplayByOfValueGroup() 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/text/GdlTitle.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java Thu Aug 25 06:32:05 2011 (r785)
@@ -60,13 +60,19 @@
public GdlTitle(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
super(tmRepresentative, receivedData);
// TODO: create a Title element for each TM-elem
- this.createTitle().setText("Title");
+ this.createNewTitle().setText("Title");
this.setNthButtons();
}
+ @Override
+ public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
+ this.createNewTitle().setText(value);
+ }
+
+
// sets the list Element to either ol or ul depending on the gdl:ordered property
- public TitleWidget createTitle() throws InvalidGdlSchemaException, ExecutionException {
+ public TitleWidget createNewTitle() throws InvalidGdlSchemaException, ExecutionException {
// this object is able to own only one sub-element
TitleWidget title = new TitleWidget(this.getTitleOrder());
ActiveStyleHandler asHandler = new ActiveStyleHandler(this);
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java Thu Aug 25 05:51:35 2011 (r784)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java Thu Aug 25 06:32:05 2011 (r785)
@@ -31,6 +31,11 @@
}
+ @Override
+ public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
+ //this method has no effect on this class
+ }
+
public String getViewName()throws InvalidGdlSchemaException {
JsArray<Name> viewNames = super.tmRepresentative.getNames(tm.getTopicBySubjectIdentifier(tm.createLocator(PSIs.GDL.NameType.gdlViewName)));