isidorus-cvs
Threads by month
- ----- 2025 -----
- 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
August 2011
- 1 participants
- 117 discussions

[isidorus-cvs] r793 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button
by lgiessmann@common-lisp.net 26 Aug '11
by lgiessmann@common-lisp.net 26 Aug '11
26 Aug '11
Author: lgiessmann
Date: Fri Aug 26 01:59:14 2011
New Revision: 793
Log:
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlDeleteButton.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlDeleteButton.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlDeleteButton.java Fri Aug 26 01:58:36 2011 (r792)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlDeleteButton.java Fri Aug 26 01:59:14 2011 (r793)
@@ -38,7 +38,7 @@
@Override
public void onClick(ClickEvent event) {
-
+
}
}
}
1
0

[isidorus-cvs] r792 - 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 26 Aug '11
by lgiessmann@common-lisp.net 26 Aug '11
26 Aug '11
Author: lgiessmann
Date: Fri Aug 26 01:58:36 2011
New Revision: 792
Log:
gdl-frontend: Widgets: implemented a method that return the parental GdlVisibleObject of each element; implmented a recusrive method that returns the actual GdlPanel that is the root panel of each GdlVisible-Element
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/GdlPanel.java
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/GdlButton.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/GdlCommitButton.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCreateButton.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlDeleteButton.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/button/GdlValidateButton.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/GdlComplexData.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/environment/GdlInstantiator.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/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/GdlCreatorAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlDefaultCreatorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlDefaultEditorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlDefaultTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlEditorAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialCreatorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialEditorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialTopicView.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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/TODO.txt Fri Aug 26 01:58:36 2011 (r792)
@@ -7,7 +7,7 @@
* GdlButton
* GdlComplexData
* GdlListBox
-* implement the ahndling of default-values
+* implement the handling of default-values
* Implement TopicMaps data consumption
* Implement TopicMaps data generation
* Implement HiddenValue
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPanel.java Fri Aug 26 01:58:36 2011 (r792)
@@ -276,9 +276,9 @@
public void createView(){
try{
if(this.requestedTopicsToCreate != null && this.requestedTopicsToCreate.size() != 0)
- this.view = GdlInstantiator.instantiateDefaultCreatorTopicView(this.requestedTopicsToCreate, this.requestedSchemaTm);
+ this.view = GdlInstantiator.instantiateDefaultCreatorTopicView(this);
else if(this.requestedTopicToEdit != null)
- this.view = GdlInstantiator.instantiateDefaultEditorTopicView(this.requestedTopicToEdit, this.requestedSchemaTm);
+ this.view = GdlInstantiator.instantiateDefaultEditorTopicView(this);
mainPanel.add(view);
}catch(Exception e){
Window.alert("could not create a view (" + e.getClass() + "): " + e.getMessage());
@@ -294,4 +294,14 @@
public void clear(){
this.mainPanel.clear();
}
+
+
+ public ArrayList<Pair<String, TopicIdentifierTypes>> getReqeustedTopicsToCreate(){
+ return this.requestedTopicsToCreate;
+ }
+
+
+ public Pair<String, TopicIdentifierTypes> getRequestedTopicToEdit(){
+ return this.requestedTopicToEdit;
+ }
}
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlSpace.java Fri Aug 26 01:58:36 2011 (r792)
@@ -12,8 +12,8 @@
}
- public GdlSpace(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlSpace(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
this.setGdlStyle(this);
}
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Fri Aug 26 01:58:36 2011 (r792)
@@ -70,6 +70,7 @@
public abstract class GdlVisibleObject extends Composite implements GdlDescriptor, HasClickHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasFocusHandlers, HasMouseDownHandlers, HasMouseUpHandlers, HasBlurHandlers{
+ private GdlVisibleObject gdlParent = null;
protected AbsolutePanel mainPanel = new AbsolutePanel();
protected Panel containerPanel = null;
protected Topic tmRepresentative = null;
@@ -109,17 +110,13 @@
initWidget(this.mainPanel);
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{
+ public GdlVisibleObject(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
this();
this.tmRepresentative = tmRepresentative;
this.tm = this.tmRepresentative.getTopicMap();
+ this.gdlParent = gdlParent;
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());
this.receivedData = receivedData;
@@ -128,6 +125,27 @@
this.setGdlStyle();
}
+
+ public GdlVisibleObject getGdlParent(){
+ return this.gdlParent;
+ }
+
+
+ public int getSubElementsCount(){
+ if(this.subElements == null) return 0;
+ return this.subElements.size();
+ }
+
+
+ public GdlPanel getRoot(){
+ return this.getGdlParent().getRoot();
+ }
+
+
+ // 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;
+
// returns the topic that represents this element
public Topic getTmRepresentative(){
@@ -140,7 +158,7 @@
ArrayList<Topic> infos = TmHelper.topicContainsInfo(this.tmRepresentative);
for (Topic info : infos){
- GdlInfo elem = (GdlInfo)GdlInstantiator.instantiate(info, this.receivedData);
+ GdlInfo elem = (GdlInfo)GdlInstantiator.instantiate(info, this.receivedData, this);
this.infoElements.add(elem);
elem.setPosition(this);
}
@@ -189,7 +207,7 @@
// add buttons that are not bound to the current sub element, but belong to it
for (Topic currentButton : currentButtons)
- if(!((ButtonableObject)this.subElements.get(i)).containsButton(currentButton)) ((ButtonableObject)this.subElements.get(i)).addButton((GdlActionButton)GdlInstantiator.instantiate(currentButton, null));
+ if(!((ButtonableObject)this.subElements.get(i)).containsButton(currentButton)) ((ButtonableObject)this.subElements.get(i)).addButton((GdlActionButton)GdlInstantiator.instantiate(currentButton, null, this));
}
}
@@ -1925,6 +1943,8 @@
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");
+ // TODO: check if the valus is fixed => fix the element, so that the
+ // user cannot change the value => implement an abstract method therefore
if(this.getDefaultLiteralValue() != null){
TopicMap tm = this.getDefaultLiteralValue().getTopicMap();
Topic occType = TmHelper.getTopicByPsi(PSIs.GDL.OccurrenceType.gdlLiteralValue, tm);
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlActionButton.java Fri Aug 26 01:58:36 2011 (r792)
@@ -4,11 +4,11 @@
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Button;
-
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.Widgets.base.GdlPanel;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.PSIs;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
@@ -21,16 +21,15 @@
import us.isidor.gdl.anaToMia.Widgets.value.TextAlignValue;
public class GdlActionButton extends GdlButton {
-
+
protected GdlActionButton(){
super();
}
- public GdlActionButton(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlActionButton(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
- // TODO: set all tm values
this.createNewButton().setText("Action-Button"); // TODO: remove set text
this.setClickHandlers();
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlButton.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlButton.java Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlButton.java Fri Aug 26 01:58:36 2011 (r792)
@@ -2,6 +2,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.text.GdlTextObject;
@@ -12,7 +13,7 @@
}
- public GdlButton(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlButton(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
}
}
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCheckBox.java Fri Aug 26 01:58:36 2011 (r792)
@@ -4,6 +4,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
@@ -13,8 +14,8 @@
}
- public GdlCheckBox(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlCheckBox(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
// TODO: create a check box for each tm construct
this.createcheckBox().setText("Check Box 1");
this.createcheckBox().setText("Check Box 2");
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCommitButton.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCommitButton.java Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCommitButton.java Fri Aug 26 01:58:36 2011 (r792)
@@ -2,6 +2,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import com.google.gwt.user.client.ui.Button;
@@ -14,8 +15,8 @@
}
- public GdlCommitButton(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlCommitButton(Topic tmRepresentative, Construct receivedData, GdlVisibleObject parent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, parent);
((Button)this.subElements.get(0)).setText("commit");
}
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCreateButton.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCreateButton.java Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCreateButton.java Fri Aug 26 01:58:36 2011 (r792)
@@ -2,6 +2,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import com.google.gwt.user.client.ui.Button;
@@ -14,8 +15,8 @@
}
- public GdlCreateButton(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlCreateButton(Topic tmRepresentative, Construct receivedData, GdlVisibleObject parent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, parent);
((Button)this.subElements.get(0)).setText("create");
}
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlDeleteButton.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlDeleteButton.java Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlDeleteButton.java Fri Aug 26 01:58:36 2011 (r792)
@@ -1,10 +1,15 @@
package us.isidor.gdl.anaToMia.Widgets.button;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
@@ -16,8 +21,24 @@
}
- public GdlDeleteButton(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlDeleteButton(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
((Button)this.subElements.get(0)).setText("delete");
+ this.getButton().addClickHandler(new DeleteButtonClickHandler(this));
+ }
+
+
+ protected class DeleteButtonClickHandler implements ClickHandler {
+ private GdlDeleteButton owner = null;
+
+ public DeleteButtonClickHandler(GdlDeleteButton owner){
+ this.owner = owner;
+ }
+
+
+ @Override
+ public void onClick(ClickEvent event) {
+
+ }
}
}
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlInputButton.java Fri Aug 26 01:58:36 2011 (r792)
@@ -2,6 +2,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
@@ -11,8 +12,8 @@
}
- public GdlInputButton(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlInputButton(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
}
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlRadioButton.java Fri Aug 26 01:58:36 2011 (r792)
@@ -5,6 +5,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
@@ -14,8 +15,8 @@
}
- public GdlRadioButton(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlRadioButton(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
// TODO: create a radio button for each tm construct
this.createRadioButton().setText("Radio Button 1");
this.createRadioButton().setText("Radio Button 2");
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlValidateButton.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlValidateButton.java Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlValidateButton.java Fri Aug 26 01:58:36 2011 (r792)
@@ -4,6 +4,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
@@ -15,8 +16,8 @@
}
- public GdlValidateButton(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlValidateButton(Topic tmRepresentative, Construct receivedData, GdlVisibleObject parent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, parent);
((Button)this.subElements.get(0)).setText("validate");
}
}
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlAudio.java Fri Aug 26 01:58:36 2011 (r792)
@@ -2,6 +2,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.PSIs;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
@@ -13,7 +14,7 @@
}
- public GdlAudio(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
+ public GdlAudio(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
this();
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlComplexData.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlComplexData.java Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlComplexData.java Fri Aug 26 01:58:36 2011 (r792)
@@ -13,7 +13,7 @@
}
- public GdlComplexData(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlComplexData(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
}
}
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDatePicker.java Fri Aug 26 01:58:36 2011 (r792)
@@ -28,6 +28,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.Widgets.base.ButtonableObject;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
@@ -44,8 +45,8 @@
}
- public GdlDatePicker(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlDatePicker(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
// create a date widget for each tm-construct
this.createNewDateWidget();
this.setNthButtons();
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDateTimePicker.java Fri Aug 26 01:58:36 2011 (r792)
@@ -2,6 +2,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
@@ -15,8 +16,8 @@
}
- public GdlDateTimePicker(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlDateTimePicker(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
// create a date-time widget for each tm-construct
}
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlImage.java Fri Aug 26 01:58:36 2011 (r792)
@@ -2,6 +2,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.PSIs;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
@@ -13,7 +14,7 @@
}
- public GdlImage(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
+ public GdlImage(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
this();
}
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlTimePicker.java Fri Aug 26 01:58:36 2011 (r792)
@@ -2,6 +2,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
@@ -15,8 +16,8 @@
}
- public GdlTimePicker(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlTimePicker(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
// create a time widget for each tm-construct
}
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlVideo.java Fri Aug 26 01:58:36 2011 (r792)
@@ -2,6 +2,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.PSIs;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
@@ -13,7 +14,7 @@
}
- public GdlVideo(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
+ public GdlVideo(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
this();
}
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java Fri Aug 26 01:58:36 2011 (r792)
@@ -58,8 +58,8 @@
}
- public GdlList(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlList(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
this.createNewList();
ArrayList<Topic> objectsContained = this.contains();
@@ -416,7 +416,7 @@
for (Pair<Topic, Integer> pair : this.storedItems) if(pair.getFirst().equals(current)) idx = pair.getSecond();
ListWidget list = (ListWidget)((ButtonableObject)this.subElements.get(0)).getMainObject();
- GdlVisibleObject newObj = GdlInstantiator.instantiate(current, this.receivedData);
+ GdlVisibleObject newObj = GdlInstantiator.instantiate(current, this.receivedData, GdlList.this);
list.insertWidget(newObj, idx);
return newObj;
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java Fri Aug 26 01:58:36 2011 (r792)
@@ -60,8 +60,8 @@
}
- public GdlUnit(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlUnit(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
// create a unit for each tm-element and set the current element, e.g. current topic, occurrence, name, ...
this.createUnit(null);
this.setNthButtons();
@@ -262,7 +262,7 @@
if(ancestor == null || current == null) throw new ExecutionException("to append \"" + TmHelper.getAnyIdOfTopic(current) + "\" on \"" + TmHelper.getAnyIdOfTopic(ancestor) + "\" both topics must be present");
GdlPosition position = new GdlPosition(TmHelper.getPositionOf(ancestor, current));
- GdlVisibleObject newObj = GdlInstantiator.instantiate(current, this.currentElement);
+ GdlVisibleObject newObj = GdlInstantiator.instantiate(current, this.currentElement, GdlUnit.this);
GdlVisibleObject oldObj = null;
for (Widget widget : this.subElements){
if(((GdlVisibleObject)widget).getTmRepresentative().equals(ancestor)){
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/GdlInstantiator.java Fri Aug 26 01:58:36 2011 (r792)
@@ -10,6 +10,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Variant;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlPanel;
import us.isidor.gdl.anaToMia.Widgets.base.GdlSpace;
import us.isidor.gdl.anaToMia.Widgets.base.PSIs;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
@@ -46,63 +47,63 @@
public class GdlInstantiator {
// returns a java instance of a GdlVisibleObject that corresponds to the
// set topic type of the passed topic instance
- public static GdlVisibleObject instantiate(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
+ public static GdlVisibleObject instantiate(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) 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.GDL.TopicType.gdlSpace)){
- return new GdlSpace(tmRepresentative, receivedData);
+ return new GdlSpace(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlTitle)){
- return new GdlTitle(tmRepresentative, receivedData);
+ return new GdlTitle(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlInfo)){
- return new GdlInfo(tmRepresentative, receivedData);
+ return new GdlInfo(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlReference)){
- return new GdlReference(tmRepresentative, receivedData);
+ return new GdlReference(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlRadioButton)){
- return new GdlRadioButton(tmRepresentative, receivedData);
+ return new GdlRadioButton(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlCheckBox)){
- return new GdlCheckBox(tmRepresentative, receivedData);
+ return new GdlCheckBox(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlValidateButton)){
- return new GdlValidateButton(tmRepresentative, receivedData);
+ return new GdlValidateButton(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlCreateButton)){
- return new GdlCreateButton(tmRepresentative, receivedData);
+ return new GdlCreateButton(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlDeleteButton)){
- return new GdlDeleteButton(tmRepresentative, receivedData);
+ return new GdlDeleteButton(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlCommitButton)){
- return new GdlCommitButton(tmRepresentative, receivedData);
+ return new GdlCommitButton(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlActionButton)){
- return new GdlActionButton(tmRepresentative, receivedData);
+ return new GdlActionButton(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlImage)){
- return new GdlImage(tmRepresentative, receivedData);
+ return new GdlImage(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlVideo)){
- return new GdlVideo(tmRepresentative, receivedData);
+ return new GdlVideo(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlAudio)){
- return new GdlAudio(tmRepresentative, receivedData);
+ return new GdlAudio(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlDatePicker)){
- return new GdlDatePicker(tmRepresentative, receivedData);
+ return new GdlDatePicker(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlTimePicker)){
- return new GdlTimePicker(tmRepresentative, receivedData);
+ return new GdlTimePicker(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlDateTimePicker)){
- return new GdlDateTimePicker(tmRepresentative, receivedData);
+ return new GdlDateTimePicker(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlUnit)){
- return new GdlUnit(tmRepresentative, receivedData);
+ return new GdlUnit(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlText)){
- return new GdlText(tmRepresentative, receivedData);
+ return new GdlText(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlList)){
- return new GdlList(tmRepresentative, receivedData);
+ return new GdlList(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlListBox)){
- return new GdlListBox(tmRepresentative, receivedData);
+ return new GdlListBox(tmRepresentative, receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlDefaultCreatorTopicView)){
- return new GdlDefaultCreatorTopicView(tmRepresentative);
+ return new GdlDefaultCreatorTopicView(tmRepresentative, gdlParent, null);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlDefaultEditorTopicView)){
- return new GdlDefaultEditorTopicView(tmRepresentative, (Topic)receivedData);
+ return new GdlDefaultEditorTopicView(tmRepresentative, (Topic)receivedData, gdlParent, null);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlSpecialCreatorTopicView)){
- return new GdlSpecialCreatorTopicView(tmRepresentative);
+ return new GdlSpecialCreatorTopicView(tmRepresentative, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlSpecialEditorTopicView)){
- return new GdlSpecialEditorTopicView(tmRepresentative, (Topic)receivedData);
+ return new GdlSpecialEditorTopicView(tmRepresentative, (Topic)receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlCreatorAssociationview)){
- return new GdlCreatorAssociationView(tmRepresentative, (Topic)receivedData);
+ return new GdlCreatorAssociationView(tmRepresentative, (Topic)receivedData, gdlParent);
}else if(TmHelper.isInstanceOf(tmRepresentative, PSIs.GDL.TopicType.gdlEditorAssociationView)){
- return new GdlEditorAssociationView(tmRepresentative, (Topic)receivedData);
+ return new GdlEditorAssociationView(tmRepresentative, (Topic)receivedData, gdlParent);
}else{
String values = "";
for(int i = 0; i != tmRepresentative.getTypes().length(); ++i){
@@ -118,12 +119,13 @@
// 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.GDL.TopicType.gdlDefaultCreatorTopicView, schemaTm), schemaTm);
+ public static GdlDefaultCreatorTopicView instantiateDefaultCreatorTopicView(GdlPanel panel) throws InvalidGdlSchemaException, ExecutionException{
+ if(panel == null) return null;
+ ArrayList<Topic> views = getViewTopics(panel.getReqeustedTopicsToCreate(), TmHelper.getTopicByPsi(PSIs.GDL.TopicType.gdlDefaultCreatorTopicView, panel.getSchemaTm()), panel.getSchemaTm());
if(views.size() != 1){
String values = "";
- for (Pair<String, TopicIdentifierTypes> pair : requestedTopics)
+ for (Pair<String, TopicIdentifierTypes> pair : panel.getReqeustedTopicsToCreate())
values += ", " + pair.getFirst();
if(values.length() >= 2 )values = values.substring(2);
String bindings = "";
@@ -134,7 +136,7 @@
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));
+ return new GdlDefaultCreatorTopicView(views.get(0), null, panel);
}
@@ -188,24 +190,24 @@
// returns a GdlDefaultEditorTopicView that corresponds to the passed arguments
- public static GdlDefaultEditorTopicView instantiateDefaultEditorTopicView(Pair<String, TopicIdentifierTypes> requestedTopic, TopicMap schemaTm) throws InvalidGdlSchemaException, ExecutionException{
- if(requestedTopic == null || schemaTm == null) return null;
+ public static GdlDefaultEditorTopicView instantiateDefaultEditorTopicView(GdlPanel panel) throws InvalidGdlSchemaException, ExecutionException{
+ if(panel == null) return null;
// request the topic that is passed by the user
- Topic requestedTop = TmHelper.getTopicByAnyIdentifier(requestedTopic, schemaTm);
- if(requestedTop == null) throw new InvalidGdlSchemaException("the topic " + requestedTopic.getFirst() + " was not found!");
+ Topic requestedTop = TmHelper.getTopicByAnyIdentifier(panel.getRequestedTopicToEdit(), panel.getSchemaTm());
+ if(requestedTop == null) throw new InvalidGdlSchemaException("the topic " + panel.getRequestedTopicToEdit().getFirst() + " was not found!");
// get all tm-instance-value topics bound to the requested topic
- 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 tmConstruct = TmHelper.getTopicByPsi(PSIs.GDL.RoleType.gdlTmConstruct, panel.getSchemaTm());
+ Topic tmBinding = TmHelper.getTopicByPsi(PSIs.GDL.AssociationType.gdlTmBinding, panel.getSchemaTm());
+ Topic descriptor = TmHelper.getTopicByPsi(PSIs.GDL.RoleType.gdlDescriptor, panel.getSchemaTm());
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.GDL.TopicType.gdlDefaultEditorTopicView, schemaTm);
- Topic tmValue = TmHelper.getTopicByPsi(PSIs.GDL.RoleType.gdlTmValue, schemaTm);
- Topic topicViewBinding = TmHelper.getTopicByPsi(PSIs.GDL.AssociationType.gdlTopicViewBinding, schemaTm);
+ Topic defaultEditorTopicView = TmHelper.getTopicByPsi(PSIs.GDL.TopicType.gdlDefaultEditorTopicView, panel.getSchemaTm());
+ Topic tmValue = TmHelper.getTopicByPsi(PSIs.GDL.RoleType.gdlTmValue, panel.getSchemaTm());
+ Topic topicViewBinding = TmHelper.getTopicByPsi(PSIs.GDL.AssociationType.gdlTopicViewBinding, panel.getSchemaTm());
ArrayList<Topic> views = new ArrayList<Topic>();
for (Topic tmInstanceValue : tmInstanceValues) {
ArrayList<Topic> tmpViews = TmHelper.getOtherPlayerOfBinaryAssociation(tmInstanceValue, tmValue, topicViewBinding, null, defaultEditorTopicView, descriptor);
@@ -213,19 +215,19 @@
}
if(views.size() == 1){
- return new GdlDefaultEditorTopicView(views.get(0), requestedTop);
+ return new GdlDefaultEditorTopicView(views.get(0), requestedTop, null, panel);
}else if(views.size() > 1){
String bindings = "";
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.GDL.TopicType.gdlDefaultEditorTopicView + ", but is bound to " + bindings);
+ throw new InvalidGdlSchemaException("the topic " + panel.getRequestedTopicToEdit().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)
typesOfRequestedTopic.add(TmHelper.getAnyIdenditfierOfTopic(requestedTop.getTypes().get(i)));
- views = getViewTopics(typesOfRequestedTopic, defaultEditorTopicView, schemaTm);
+ views = getViewTopics(typesOfRequestedTopic, defaultEditorTopicView, panel.getSchemaTm());
if(views.size() != 1){
String values = "";
@@ -237,10 +239,10 @@
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.GDL.TopicType.gdlDefaultEditorTopicView + " but is bound to " + bindings);
+ throw new InvalidGdlSchemaException("the combination of topic types (" + values + ") for the requested topic " + panel.getRequestedTopicToEdit().getFirst() + " must be bound exactly once to a " + PSIs.GDL.TopicType.gdlDefaultEditorTopicView + " but is bound to " + bindings);
}
- return new GdlDefaultEditorTopicView(views.get(0), requestedTop);
+ return new GdlDefaultEditorTopicView(views.get(0), requestedTop, null, panel);
}
}
}
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlInfo.java Fri Aug 26 01:58:36 2011 (r792)
@@ -25,8 +25,8 @@
}
- public GdlInfo(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlInfo(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
RootPanel.get().add(this);
super.setGdlStyle();
// TODO: create an info element for each tm construct
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlListBox.java Fri Aug 26 01:58:36 2011 (r792)
@@ -8,6 +8,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.PSIs;
import us.isidor.gdl.anaToMia.Widgets.base.TmHelper;
import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
@@ -24,8 +25,8 @@
}
- public GdlListBox(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlListBox(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
if(receivedData != null && this.getConstraint() != null) this.setReceivedData();
else this.setDefaultValue();
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java Fri Aug 26 01:58:36 2011 (r792)
@@ -16,6 +16,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.PSIs;
import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
@@ -33,8 +34,8 @@
super();
}
- public GdlReference(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlReference(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
// TODO: create a Reference element for each TM-elem
ReferenceWidget ref = this.createReference(); // TODO: remove
ref.setText("Reference"); // TODO: remove
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Fri Aug 26 01:58:36 2011 (r792)
@@ -16,6 +16,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.Widgets.base.ButtonableObject;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.PSIs;
import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
@@ -42,8 +43,8 @@
}
- public GdlText(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlText(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
// If the receivedData is set and the tmRepresentative is bound to a value-group
// that is bound to a constraint, the received data is consumed.
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java Fri Aug 26 01:58:36 2011 (r792)
@@ -27,8 +27,8 @@
}
- public GdlTextObject(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlTextObject(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
super.setGdlStyle();
}
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java Fri Aug 26 01:58:36 2011 (r792)
@@ -5,6 +5,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.PSIs;
import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
@@ -57,8 +58,8 @@
}
- public GdlTitle(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlTitle(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
// TODO: create a Title element for each TM-elem
this.createNewTitle().setText("Title");
this.setNthButtons();
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java Fri Aug 26 01:58:36 2011 (r792)
@@ -11,6 +11,7 @@
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.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.PSIs;
import us.isidor.gdl.anaToMia.Widgets.base.TmHelper;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
@@ -39,8 +40,8 @@
}
- public GdlAssociationView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException {
- super(tmRepresentative, receivedData);
+ public GdlAssociationView(Topic tmRepresentative, Topic receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException {
+ super(tmRepresentative, receivedData, gdlParent);
}
@@ -195,9 +196,9 @@
}
- public AssociationItem(Topic tmRepresentative, Association receivedData, int indexInParent) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
- this.indexInParent = indexInParent;
+ public AssociationItem(Topic tmRepresentative, Association receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
+ this.indexInParent = this.getGdlParent().getSubElementsCount();
ArrayList<Topic> objectsContained = this.contains();
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlCreatorAssociationView.java Fri Aug 26 01:58:36 2011 (r792)
@@ -2,14 +2,15 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
public class GdlCreatorAssociationView extends GdlAssociationView {
- public GdlCreatorAssociationView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException {
- super(tmRepresentative, receivedData);
+ public GdlCreatorAssociationView(Topic tmRepresentative, Topic receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException {
+ super(tmRepresentative, receivedData, gdlParent);
// TODO Auto-generated constructor stub
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlDefaultCreatorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlDefaultCreatorTopicView.java Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlDefaultCreatorTopicView.java Fri Aug 26 01:58:36 2011 (r792)
@@ -3,15 +3,18 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlPanel;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
public class GdlDefaultCreatorTopicView extends GdlDefaultTopicView{
- // TODO: implement
+ private GdlPanel rootPanel = null;
- public GdlDefaultCreatorTopicView(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException {
- super(tmRepresentative, null);
+ public GdlDefaultCreatorTopicView(Topic tmRepresentative, GdlVisibleObject gdlParent, GdlPanel rootPanel) throws InvalidGdlSchemaException, ExecutionException {
+ super(tmRepresentative, null, gdlParent);
+ this.rootPanel = rootPanel;
// TODO Auto-generated constructor stub
}
@@ -21,4 +24,10 @@
// TODO Auto-generated method stub
return null;
}
+
+
+ @Override
+ public GdlPanel getRoot(){
+ return this.rootPanel;
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlDefaultEditorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlDefaultEditorTopicView.java Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlDefaultEditorTopicView.java Fri Aug 26 01:58:36 2011 (r792)
@@ -2,14 +2,18 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlPanel;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
public class GdlDefaultEditorTopicView extends GdlDefaultTopicView {
+ private GdlPanel rootPanel = null;
- public GdlDefaultEditorTopicView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException {
- super(tmRepresentative, receivedData);
+ public GdlDefaultEditorTopicView(Topic tmRepresentative, Topic receivedData, GdlVisibleObject gdlParent, GdlPanel rootPanel) throws InvalidGdlSchemaException, ExecutionException {
+ super(tmRepresentative, receivedData, gdlParent);
+ this.rootPanel = rootPanel;
// TODO Auto-generated constructor stub
}
@@ -18,4 +22,10 @@
// TODO Auto-generated method stub
return null;
}
+
+
+ @Override
+ public GdlPanel getRoot(){
+ return this.rootPanel;
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlDefaultTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlDefaultTopicView.java Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlDefaultTopicView.java Fri Aug 26 01:58:36 2011 (r792)
@@ -1,13 +1,14 @@
package us.isidor.gdl.anaToMia.Widgets.view;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
public abstract class GdlDefaultTopicView extends GdlTopicView {
- public GdlDefaultTopicView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException {
- super(tmRepresentative, receivedData);
+ public GdlDefaultTopicView(Topic tmRepresentative, Topic receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException {
+ super(tmRepresentative, receivedData, gdlParent);
// TODO Auto-generated constructor stub
}
// TODO: implement
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlEditorAssociationView.java Fri Aug 26 01:58:36 2011 (r792)
@@ -7,6 +7,7 @@
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.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.TmHelper;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
@@ -18,13 +19,13 @@
protected boolean associationsToRepresentSet = false;
- public GdlEditorAssociationView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException {
- super(tmRepresentative, receivedData);
+ public GdlEditorAssociationView(Topic tmRepresentative, Topic receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException {
+ super(tmRepresentative, receivedData, gdlParent);
// 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));
+ this.addToContainerPanel(new AssociationItem(this.tmRepresentative, this.getAssociationsToRepresent().get(i), this));
}
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialCreatorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialCreatorTopicView.java Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialCreatorTopicView.java Fri Aug 26 01:58:36 2011 (r792)
@@ -3,14 +3,15 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
public class GdlSpecialCreatorTopicView extends GdlSpecialTopicView{
// TODO: implement
- public GdlSpecialCreatorTopicView(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException {
- super(tmRepresentative, null);
+ public GdlSpecialCreatorTopicView(Topic tmRepresentative, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException {
+ super(tmRepresentative, null, gdlParent);
// TODO Auto-generated constructor stub
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialEditorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialEditorTopicView.java Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialEditorTopicView.java Fri Aug 26 01:58:36 2011 (r792)
@@ -2,6 +2,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
@@ -10,8 +11,8 @@
// TODO: implement
- public GdlSpecialEditorTopicView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException {
- super(tmRepresentative, receivedData);
+ public GdlSpecialEditorTopicView(Topic tmRepresentative, Topic receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException {
+ super(tmRepresentative, receivedData, gdlParent);
// TODO Auto-generated constructor stub
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialTopicView.java Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialTopicView.java Fri Aug 26 01:58:36 2011 (r792)
@@ -1,13 +1,14 @@
package us.isidor.gdl.anaToMia.Widgets.view;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
public abstract class GdlSpecialTopicView extends GdlTopicView {
- public GdlSpecialTopicView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException {
- super(tmRepresentative, receivedData);
+ public GdlSpecialTopicView(Topic tmRepresentative, Topic receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException {
+ super(tmRepresentative, receivedData, gdlParent);
// TODO Auto-generated constructor stub
}
// TODO: implement
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlTopicView.java Fri Aug 26 01:58:36 2011 (r792)
@@ -4,6 +4,7 @@
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.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.TmHelper;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
@@ -12,8 +13,8 @@
public abstract class GdlTopicView extends GdlView {
- public GdlTopicView(Topic tmRepresentative, Topic receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlTopicView(Topic tmRepresentative, Topic receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
ArrayList<Topic> objectsContained = this.contains();
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 Fri Aug 26 00:15:10 2011 (r791)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java Fri Aug 26 01:58:36 2011 (r792)
@@ -25,8 +25,8 @@
}
- public GdlView(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative, receivedData);
+ public GdlView(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative, receivedData, gdlParent);
}
@@ -70,7 +70,7 @@
if(ancestor == null || current == null) throw new ExecutionException("to append \"" + TmHelper.getAnyIdOfTopic(current) + "\" on \"" + TmHelper.getAnyIdOfTopic(ancestor) + "\" both topics must be present");
GdlPosition position = new GdlPosition(TmHelper.getPositionOf(ancestor, current));
- GdlVisibleObject newObj = GdlInstantiator.instantiate(current, this.receivedData);
+ GdlVisibleObject newObj = GdlInstantiator.instantiate(current, this.receivedData, this);
GdlVisibleObject oldObj = null;
for (Widget widget : super.subElements){
if(((GdlVisibleObject)widget).getTmRepresentative().equals(ancestor)){
1
0

[isidorus-cvs] r791 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text
by lgiessmann@common-lisp.net 26 Aug '11
by lgiessmann@common-lisp.net 26 Aug '11
26 Aug '11
Author: lgiessmann
Date: Fri Aug 26 00:15:10 2011
New Revision: 791
Log:
gdl-frontend: Widgets: finalised addSubItem of the class GdlListBox
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlListBox.java
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 Fri Aug 26 00:06:26 2011 (r790)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlListBox.java Fri Aug 26 00:15:10 2011 (r791)
@@ -47,9 +47,16 @@
} else if(exLiteralValues.size() != 0){
options = exLiteralValues;
} else if(exTmValues.size() != 0){
- // TODO: get all Topics that are represented by a TM-Value
- // TODO: get its string-representation
- // TODO: add it to the options ArrayList
+ ArrayList<Topic> validValues = new ArrayList<Topic>();
+
+ for (Topic tmValue : exTmValues){
+ for (Topic topicInstance : TmHelper.getValuesForTmValue(tmValue)){
+ if(!validValues.contains(topicInstance)){
+ validValues.add(topicInstance);
+ options.add(this.getTopicRepresentation(topicInstance, this.getDisplayByOfTmValue(tmValue), this.getPreferredScopeOfTmValue(tmValue)));
+ }
+ }
+ }
} else {
ArrayList<Topic> tmValues = this.getTmValuesForConstraint();
if(tmValues.size() != 0){
@@ -62,23 +69,12 @@
ListBox lb = this.createNewListBox();
for(String item : options) lb.addItem(item);
- int i = 0;
- for( ; i != lb.getItemCount(); ++i){
+ for(int i = 0; i != lb.getItemCount(); ++i){
if(lb.getItemText(i).equals(value)){
lb.setSelectedIndex(i);
break;
}
}
-
- if(i == lb.getItemCount()){
- lb.addItem(value);
- for(i = 0 ; i != lb.getItemCount(); ++i){
- if(lb.getItemText(i).equals(value)){
- lb.setSelectedIndex(i);
- break;
- }
- }
- }
}
1
0

[isidorus-cvs] r790 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base
by lgiessmann@common-lisp.net 26 Aug '11
by lgiessmann@common-lisp.net 26 Aug '11
26 Aug '11
Author: lgiessmann
Date: Fri Aug 26 00:06:26 2011
New Revision: 790
Log:
gdl-frontend: Widgets: implemented the method "getVyluesforTmValue(Topic tmValue)" that returns all valid topics which are selected via the passed (Default-)TM-Value topic
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.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 Thu Aug 25 15:05:01 2011 (r789)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Fri Aug 26 00:06:26 2011 (r790)
@@ -1192,4 +1192,62 @@
}
}
}
+
+
+ // returns the actual list of values for a TM-Value instance, i.e.
+ // *(Default-)TM-Type-Value: returns all topic instances that are
+ // of the type bound to the TM-Type-Value topic
+ // *(Default-)TM-Single-Type-Value: returns all topics that are
+ // of the type bound to the TM-Single-Type-Value and are not
+ // of the type of any other topic
+ // *(Default-)TM-Multiple-Type-Value: returns all topics that are
+ // instances of all types that are bound to the
+ // TM-Multiple-Type-Value topic
+ // *(Default-)TM-Instance-Value: returns the topic that is bound
+ // to the TM-Instance-Value topics
+ public static ArrayList<Topic> getValuesForTmValue(Topic tmValue) throws InvalidGdlSchemaException {
+ ArrayList<Topic> result = new ArrayList<Topic>();
+ if(tmValue == null) return result;
+
+ TopicMap tm = tmValue.getTopicMap();
+ Topic descriptorRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlDescriptor, tm);
+ Topic tmBindingAssocType = getTopicByPsi(PSIs.GDL.AssociationType.gdlTmBinding, tm);
+ Topic tmConstructRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlTmConstruct, tm);
+ if(isInstanceOf(tmValue, PSIs.GDL.TopicType.gdlTmTypeValue) || isInstanceOf(tmValue, PSIs.GDL.TopicType.gdlDefaultTmTypeValue)){
+ ArrayList<Topic> topicTypes = getOtherPlayerOfBinaryAssociation(tmValue, descriptorRoleType, tmBindingAssocType, null, tmConstructRoleType);
+ if(topicTypes.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(tmValue) + " must be bound exactly once to a topic type value via a " + PSIs.GDL.AssociationType.gdlTmBinding + " association, but is: " + topicTypes.size());
+ Topic topicType = topicTypes.get(0);
+
+ JsArray<Topic> allTopics = tm.getTopics();
+ for(int i = 0; i != allTopics.length(); ++i)
+ if(isInstanceOf(allTopics.get(i), topicType)) result.add(allTopics.get(i));
+ } else if(isInstanceOf(tmValue, PSIs.GDL.TopicType.gdlTmSingleTypeValue) || isInstanceOf(tmValue, PSIs.GDL.TopicType.gdlDefaultTmSingleTypeValue)){
+ ArrayList<Topic> topicTypes = getOtherPlayerOfBinaryAssociation(tmValue, descriptorRoleType, tmBindingAssocType, null, tmConstructRoleType);
+ if(topicTypes.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(tmValue) + " must be bound exactly once to a topic type value via a " + PSIs.GDL.AssociationType.gdlTmBinding + " association, but is: " + topicTypes.size());
+ Topic topicType = topicTypes.get(0);
+
+ JsArray<Topic> allTopics = tm.getTopics();
+ for(int i = 0; i != allTopics.length(); ++i)
+ if(isInstanceOf(allTopics.get(i), topicType) && allTopics.get(i).getTypes().length() == 1) result.add(allTopics.get(i));
+ } else if(isInstanceOf(tmValue, PSIs.GDL.TopicType.gdlTmMultipleTypeValue) || isInstanceOf(tmValue, PSIs.GDL.TopicType.gdlDefaultTmMultipleTypeValue)){
+ ArrayList<Topic> topicTypes = getOtherPlayerOfBinaryAssociation(tmValue, descriptorRoleType, tmBindingAssocType, null, tmConstructRoleType);
+ if(topicTypes.size() == 0) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(tmValue) + " must be bound at least once to a topic type value via a " + PSIs.GDL.AssociationType.gdlTmBinding + " association, but is: 0");
+
+ JsArray<Topic> allTopics = tm.getTopics();
+ for(int i = 0; i != allTopics.length(); ++i){
+ int j = 0;
+ for( ; j != topicTypes.size(); ++j)
+ if(!isInstanceOf(allTopics.get(i), topicTypes.get(j)) || allTopics.get(i).getTypes().length() > topicTypes.size()) break;
+
+ if(j == topicTypes.size()) result.add(allTopics.get(i));
+ }
+ } else if(isInstanceOf(tmValue, PSIs.GDL.TopicType.gdlTmInstanceValue) || isInstanceOf(tmValue, PSIs.GDL.TopicType.gdlDefaultTmInstanceValue)){
+ result = getOtherPlayerOfBinaryAssociation(tmValue, descriptorRoleType, tmBindingAssocType, null, tmConstructRoleType);
+ if(result.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(tmValue) + " must be bound exactly once to a topic value via a " + PSIs.GDL.AssociationType.gdlTmBinding + " association, but is: " + result.size());
+ } else {
+ throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(tmValue) + " must be an instance of " + PSIs.GDL.TopicType.gdlTmValue);
+ }
+
+ return result;
+ }
}
1
0

[isidorus-cvs] r789 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets: src/us/isidor/gdl/anaToMia/Widgets src/us/isidor/gdl/anaToMia/Widgets/base src/us/isidor/gdl/anaToMia/Widgets/text war/gdl_widgets
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 15:05:01 2011
New Revision: 789
Log:
gdl-frontend: Widgets: implemented addSubItem for GdlListBox => explicitly set Literal-Values, literal-values and tm-values of the constraint bound to the element's value-group are set; currently explecitely set TM-Values are not handled
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/GdlVisibleObject.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlListBox.java
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/src/us/isidor/gdl/anaToMia/Widgets/TODO.txt
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/TODO.txt Thu Aug 25 14:25:06 2011 (r788)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/TODO.txt Thu Aug 25 15:05:01 2011 (r789)
@@ -7,6 +7,7 @@
* GdlButton
* GdlComplexData
* GdlListBox
+* implement the ahndling of default-values
* Implement TopicMaps data consumption
* Implement TopicMaps data generation
* Implement HiddenValue
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 14:25:06 2011 (r788)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Aug 25 15:05:01 2011 (r789)
@@ -2115,6 +2115,13 @@
}
+ // returns the display-by schema that is defined for the passed
+ // TM-Value that is bound to this element
+ public Topic getDisplayByOfTmValue(Topic tmValue) throws InvalidGdlSchemaException{
+ return TmHelper.getDisplayByTopicOf(tmValue);
+ }
+
+
// returns the preferred scope that is bound to the value-group of
// this element - or an empty ArrayList
public ArrayList<Topic> getPreferredScopeOfValueGroup() throws InvalidGdlSchemaException {
@@ -2127,6 +2134,13 @@
}
}
+
+ // returns the preferred scope that is bound to the passed TM-Value topic
+ // this element - or an empty ArrayList
+ public ArrayList<Topic> getPreferredScopeOfTmValue(Topic tmValue) throws InvalidGdlSchemaException{
+ return TmHelper.getPrefferedScopesForTopicOf(tmValue);
+ }
+
// returns the string that represents the topic topicToRepresent corresponding
// to the passed displayBy and prefferedScopes arguments
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 14:25:06 2011 (r788)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlListBox.java Thu Aug 25 15:05:01 2011 (r789)
@@ -1,16 +1,15 @@
package us.isidor.gdl.anaToMia.Widgets.text;
import java.util.ArrayList;
-
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.Widget;
-
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
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.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
@@ -27,15 +26,59 @@
public GdlListBox(Topic tmRepresentative, Construct receivedData) throws InvalidGdlSchemaException, ExecutionException{
super(tmRepresentative, receivedData);
- // TODO: create a ListBox element for each TM-elem
- this.createNewListBox().addItem("List-Box");
+
+ if(receivedData != null && this.getConstraint() != null) this.setReceivedData();
+ else this.setDefaultValue();
+
this.setNthButtons();
}
@Override
public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException {
- // TODO: implement
+ ArrayList<String> options = new ArrayList<String>();
+
+ // get the explicitly set TM-Values and Literal-Values.
+ // if no values were set explecitly, get the values for the constraint
+ ArrayList<String> exLiteralValues = this.getLiterals();
+ ArrayList<Topic> exTmValues = this.getTmValues();
+ if(exLiteralValues.size() != 0 && exTmValues.size() != 0){
+ throw new InvalidGdlSchemaException("found literal values and tm values for the value group " + TmHelper.getAnyIdOfTopic(this.getValueGroup()) + ", but mixin literal and tm-values for a value group is not allowed!");
+ } else if(exLiteralValues.size() != 0){
+ options = exLiteralValues;
+ } else if(exTmValues.size() != 0){
+ // TODO: get all Topics that are represented by a TM-Value
+ // TODO: get its string-representation
+ // TODO: add it to the options ArrayList
+ } else {
+ ArrayList<Topic> tmValues = this.getTmValuesForConstraint();
+ if(tmValues.size() != 0){
+ for (Topic topic : tmValues) options.add(this.getTopicRepresentation(topic, this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup()));
+ } else {
+ throw new InvalidGdlSchemaException("found no value to display for the value-group" + TmHelper.getAnyIdOfTopic(this.getValueGroup()));
+ }
+ }
+
+ ListBox lb = this.createNewListBox();
+ for(String item : options) lb.addItem(item);
+
+ int i = 0;
+ for( ; i != lb.getItemCount(); ++i){
+ if(lb.getItemText(i).equals(value)){
+ lb.setSelectedIndex(i);
+ break;
+ }
+ }
+
+ if(i == lb.getItemCount()){
+ lb.addItem(value);
+ for(i = 0 ; i != lb.getItemCount(); ++i){
+ if(lb.getItemText(i).equals(value)){
+ lb.setSelectedIndex(i);
+ break;
+ }
+ }
+ }
}
@@ -91,25 +134,6 @@
}
- // 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.GDL.OccurrenceType.gdlOnePerGroup);
-
- if(onePerGroupOcc != null){
- String boolStr = onePerGroupOcc.getValue().toUpperCase();
- if(boolStr.equals("TRUE")){
- return true;
- } else if(boolStr.equals("FALSE")) {
- return false;
- } else {
- 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;
- }
- }
-
-
// 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 {
@@ -142,12 +166,7 @@
// directly when calling the ListBox constructor
}
-
- public void setOnePerGroup(Widget widget, boolean value){
- // TODO: implement => http://code.google.com/p/gwt-traction/source/browse/src/com/tractionsoftwar…
- }
-
-
+
// sets the css properties, by calling the super class's method and the local
// method, which sets some specific properties for the GdlText instance
@Override
@@ -155,6 +174,5 @@
super.setGdlStyle(widget);
this.setSize(widget, this.getSize());
- this.setOnePerGroup(widget, this.getOnePerGroup());
}
}
\ No newline at end of file
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 Thu Aug 25 14:25:06 2011 (r788)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema_with_test_data.jtm Thu Aug 25 15:05:01 2011 (r789)
@@ -1280,7 +1280,7 @@
],
"subject_locators":null,
"item_identifiers":null,
- "instance_of":["si:[pref_2:Text]"
+ "instance_of":["si:[pref_2:List-Box]"
],
"names":null,
"occurrences":[{
1
0

[isidorus-cvs] r788 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base
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 14:25:06 2011
New Revision: 788
Log:
gdl-frontend: Widgets: added some methods to get the raw string of gdlt:Literal-Value 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/TmHelper.java
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 07:41:29 2011 (r787)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Aug 25 14:25:06 2011 (r788)
@@ -100,6 +100,8 @@
protected boolean prefferedScopesSet = false;
protected Topic displayByConstraint = null;
protected boolean displayByConstraintSet = false;
+ protected ArrayList<String> literals = new ArrayList<String>();
+ protected boolean literalsSet = false;
// some constructors
@@ -2059,6 +2061,18 @@
}
}
+
+ // returns an ArrayList of strings that are set to a value group as literal values
+ public ArrayList<String> getLiterals() throws InvalidGdlSchemaException {
+ if(this.literalsSet){
+ return this.literals;
+ } else {
+ this.literalsSet = true;
+ this.literals = TmHelper.getLiterals(this.getValueGroup());
+ return this.literals;
+ }
+ }
+
// returns the set literal value or null
public String getSetLiteralValue() throws InvalidGdlSchemaException {
@@ -2074,7 +2088,7 @@
}
- // returns the valid topic maps value for the constraint that is bound
+ // returns the valid topic maps value for the constraint bound
// to the value-group that is bound to this element - or an empty ArrayList
public ArrayList<Topic> getTmValuesForConstraint() throws InvalidGdlSchemaException, ExecutionException {
return TmHelper.getTmValuesForConstraint(this.getConstraint(), this.getValueGroup());
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Thu Aug 25 07:41:29 2011 (r787)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Thu Aug 25 14:25:06 2011 (r788)
@@ -846,7 +846,7 @@
}
- // returns the topics that represent the literal value for the passed value group
+ // returns the topics that represent the literal values for the passed value group
public static ArrayList<Topic> getLiteralValues(Topic valueGroup){
ArrayList<Topic> result = new ArrayList<Topic>();
if(valueGroup == null) return result;
@@ -861,6 +861,26 @@
}
+ // returns a string that is the literal value of the literal-value-topic
+ public static String getLiteral (Topic literalValue) throws InvalidGdlSchemaException {
+ if(literalValue == null) return null;
+
+ Occurrence occ = getSingleOccurrence(literalValue, getTopicByPsi(PSIs.GDL.OccurrenceType.gdlLiteralValue, literalValue.getTopicMap()));
+ if(occ == null) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(literalValue) + " must be bound exactly once to an occurrence of the type " + PSIs.GDL.OccurrenceType.gdlLiteralValue + ", but is: 0");
+ else return occ.getValue();
+ }
+
+
+ // returns an ArrayList of strings that are set to a value group as literal values
+ public static ArrayList<String> getLiterals(Topic valueGroup) throws InvalidGdlSchemaException {
+ ArrayList<Topic> literalTopics = getLiteralValues(valueGroup);
+
+ ArrayList<String> result = new ArrayList<String>();
+ for (Topic topic : literalTopics) result.add(getLiteral(topic));
+
+ return result;
+ }
+
// returns the topic that can be used to satisfy the passed constraint.
public static ArrayList<Topic> getTmValuesForConstraint(Topic constraint, Topic valueGroup) throws InvalidGdlSchemaException, ExecutionException {
ArrayList<Topic> result = new ArrayList<Topic>();
@@ -873,7 +893,7 @@
} else if(isInstanceOf(constraint, PSIs.GDL.TopicType.gdlVariantNameScope)){
return getTmValuesForVariantNameScopeConstraint(constraint);
} else if(isInstanceOf(constraint, PSIs.GDL.TopicType.gdlRolePlayer)){
- return getTmValuesForRolePlayerConstraint(constraint);
+ return getTmValuesForRolePlayerConstraint(constraint, valueGroup);
} else if(isInstanceOf(constraint, PSIs.TMCL.tmclReifierConstraint)){
return getTmValuesForReifierConstraint(constraint);
} else if(isInstanceOf(constraint, PSIs.TMCL.tmclScopeConstraint)){
@@ -928,8 +948,20 @@
// returns the topic that can be used to satisfy the passed role-player-constraint.
- public static ArrayList<Topic> getTmValuesForRolePlayerConstraint(Topic rolePlayerConstraint) throws ExecutionException{
- throw new ExecutionException("this method is currently not implemented");
+ public static ArrayList<Topic> getTmValuesForRolePlayerConstraint(Topic rolePlayerConstraint, Topic valueGroup) throws ExecutionException, InvalidGdlSchemaException {
+ ArrayList<Topic> result = new ArrayList<Topic>();
+ if(rolePlayerConstraint == null || valueGroup == null) return result;
+
+ Topic topicRoleConstraint = getRootConstraintOfValueGroup(valueGroup, rolePlayerConstraint);
+ if(!isInstanceOf(topicRoleConstraint, PSIs.TMCL.tmclTopicRoleConstraint)) throw new InvalidGdlSchemaException("the root constraint of the topic " + getAnyIdOfTopic(rolePlayerConstraint) + " must be an instance of " + PSIs.TMCL.tmclTopicRoleConstraint + ", but is: " + getAnyIdOfTopic(topicRoleConstraint));
+
+ Pair<Topic, Topic> roleAndPlayerType = getConstrainedRoleAndPlayerTypeOfConstraint(topicRoleConstraint);
+ Topic playerType = roleAndPlayerType.getSecond();
+ JsArray<Topic> allTopics = rolePlayerConstraint.getTopicMap().getTopics();
+ for(int i = 0; i != allTopics.length(); ++i)
+ if(isInstanceOf(allTopics.get(i), playerType)) result.add(allTopics.get(i));
+
+ return result;
}
@@ -963,8 +995,10 @@
for(int i = 0; i != allTopics.length(); ++i) if(isSupertypeOf(allTopics.get(i), typeTopics.get(0))) result.add(allTopics.get(i));
}
} else if(isInstanceOf(rootConstraint, PSIs.TMCL.tmclAssociationRoleConstraint)){
+ // TODO: implement
throw new ExecutionException(PSIs.TMCL.tmclAssociationRoleConstraint + " is not implemented yet");
} else if(isInstanceOf(rootConstraint, PSIs.TMCL.tmclTopicRoleConstraint)){
+ // TODO: implement
throw new ExecutionException(PSIs.TMCL.tmclTopicRoleConstraint + " is not implemented yet");
}
@@ -974,12 +1008,14 @@
// returns the topic that can be used to satisfy the passed variant-name-reifier-constraint.
public static ArrayList<Topic> getTmValuesForVariantNameReifierConstraint(Topic variantNameReifierConstraint) throws ExecutionException {
+ // TODO: implement
throw new ExecutionException("this mehtod is currently not implemented");
}
// returns the topic that can be used to satisfy the passed variant-name-scope-constraint.
public static ArrayList<Topic> getTmValuesForVariantNameScopeConstraint(Topic variantNameScopeConstraint) throws ExecutionException{
+ // TODO: implement
throw new ExecutionException("this method is currently not implemented");
}
1
0

[isidorus-cvs] r787 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base environment isidorus
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 07:41:29 2011
New Revision: 787
Log:
gdl-frontend: Widgets: implemented a sample CommitCallback
Added:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/CommitCallback.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/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/ICommitCallback.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 Thu Aug 25 06:56:56 2011 (r786)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPanel.java Thu Aug 25 07:41:29 2011 (r787)
@@ -137,24 +137,21 @@
// some setters for callback instances
- public void setLoadSchemaCallback(ILoadSchemaCallback callback){
- if(callback != null){
- this.loadSchemaCallback = callback;
- }
+ public void setLoadSchemaCallback(ILoadSchemaCallback callback) throws ExecutionException{
+ if(callback == null) throw new ExecutionException("callback must not be null");
+ this.loadSchemaCallback = callback;
}
- public void setCommitCallback(ICommitCallback callback){
- if(callback != null){
- this.commitCallback = callback;
- }
+ public void setCommitCallback(ICommitCallback callback) throws ExecutionException{
+ if(callback == null) throw new ExecutionException("callback must not be null");
+ this.commitCallback = callback;
}
- public void setDeleteCallback(IDeleteCallback callback){
- if(callback != null){
- this.deleteCallback = callback;
- }
+ public void setDeleteCallback(IDeleteCallback callback) throws ExecutionException{
+ if(callback == null) throw new ExecutionException("callback must not be null");
+ this.deleteCallback = callback;
}
@@ -173,6 +170,7 @@
return this.deleteCallback;
}
+
// a getter for the internal topic map
public TopicMap getSchemaTm(){
return this.requestedSchemaTm;
@@ -210,7 +208,7 @@
if(this.commitCallback == null){
throw new ExecutionException("No CommitCallback was set yet");
}
- this.commitCallback.commitTmConstruct(requestedSchemaTm, TopicMapsTypes.TopicMap);
+ this.commitCallback.commitTmConstruct(this.requestedSchemaTm, TopicMapsTypes.TopicMap, this.tmEngine);
}catch(Exception e){
for (IOnErrorCallback handler : localOnErrorContainer) {
handler.onError(GdlErrorTypes.CommitError, e);
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 Thu Aug 25 06:56:56 2011 (r786)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Thu Aug 25 07:41:29 2011 (r787)
@@ -5,6 +5,7 @@
import us.isidor.gdl.anaToMia.TmEngine.jtmsBasedEngine.JtmsTmEngine;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
import us.isidor.gdl.anaToMia.Widgets.environment.TopicIdentifierTypes;
+import us.isidor.gdl.anaToMia.Widgets.isidorus.CommitCallback;
import us.isidor.gdl.anaToMia.Widgets.isidorus.LoadSchemaCallback;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
@@ -45,7 +46,7 @@
mainPanel.add(gdlPanel);
gdlPanel.setTmEngine(new JtmsTmEngine());
gdlPanel.setLoadSchemaCallback(new LoadSchemaCallback());
-
+ gdlPanel.setCommitCallback(new CommitCallback());
Button requestButton = new Button("load schema");
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/ICommitCallback.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/ICommitCallback.java Thu Aug 25 06:56:56 2011 (r786)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/ICommitCallback.java Thu Aug 25 07:41:29 2011 (r787)
@@ -1,9 +1,10 @@
package us.isidor.gdl.anaToMia.Widgets.environment;
+import us.isidor.gdl.anaToMia.TopicMaps.TmEngineModel.TmEngine;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
public interface ICommitCallback {
- public void commitTmConstruct(Construct construct, TopicMapsTypes constructType);
+ public void commitTmConstruct(Construct construct, TopicMapsTypes constructType, TmEngine tmengine);
}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/CommitCallback.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/CommitCallback.java Thu Aug 25 07:41:29 2011 (r787)
@@ -0,0 +1,45 @@
+package us.isidor.gdl.anaToMia.Widgets.isidorus;
+
+import com.google.gwt.user.client.Window;
+
+import us.isidor.gdl.anaToMia.TopicMaps.TmEngineModel.ExporterException;
+import us.isidor.gdl.anaToMia.TopicMaps.TmEngineModel.TmEngine;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Name;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Variant;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Role;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
+import us.isidor.gdl.anaToMia.Widgets.environment.ICommitCallback;
+
+public class CommitCallback implements ICommitCallback{
+
+ @Override
+ public void commitTmConstruct(Construct construct, TopicMapsTypes constructType, TmEngine tmEngine) {
+ try{
+ String jtm = null;
+
+ switch(constructType){
+ case Association: jtm = tmEngine.exportTm((Association)construct);
+ break;
+ case Role: jtm = tmEngine.exportTm((Role)construct);
+ break;
+ case Topic: jtm = tmEngine.exportTm((Topic)construct);
+ break;
+ case Name: jtm = tmEngine.exportTm((Name)construct);
+ break;
+ case Variant: jtm = tmEngine.exportTm((Variant)construct);
+ break;
+ case Occurrence: jtm = tmEngine.exportTm((Occurrence)construct);
+ break;
+ }
+
+ Window.alert(jtm);
+ // TODO: implement
+ }catch(ExporterException ee){
+ Window.alert("faild to commit the Topic Maps data, because: " + ee.getMessage());
+ }
+ }
+}
1
0

[isidorus-cvs] r786 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base
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 06:56:56 2011
New Revision: 786
Log:
gdl-frontend: Widgets: finalised the implementeation of gdl:preferred-scope in the display-by schema
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/TmHelper.java
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 06:32:05 2011 (r785)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Aug 25 06:56:56 2011 (r786)
@@ -1938,6 +1938,8 @@
}
+ // returns the topic instance of gdlt:Value-Group that is bound to this
+ // visible element, or null if it is unbound
public Topic getValueGroup() throws InvalidGdlSchemaException {
if(this.valueGroupTopicSet){
return this.valueGroupTopic;
@@ -1949,6 +1951,8 @@
}
+ // returns the direct (first) constraint that is bound to the value-group
+ // of this element - or null if it is unbound
public Topic getConstraint() throws InvalidGdlSchemaException {
if(this.constraintTopicSet){
return this.constraintTopic;
@@ -1960,6 +1964,8 @@
}
+ // returns the root (last) constraint that is bound to the value-group
+ // of this element - or null if it is unbound
public Topic getRootConstraint() throws InvalidGdlSchemaException {
if(this.rootConstraintTopicSet){
return this.rootConstraintTopic;
@@ -1971,6 +1977,8 @@
}
+ // returns the topic that represents the default topic maps value of
+ // the value-group that is bound to this element - null if it is unbound
public Topic getDefaultTmValue() throws InvalidGdlSchemaException {
if(this.defaultTmValueTopicSet){
return this.defaultTmValueTopic;
@@ -1982,6 +1990,8 @@
}
+ // returns the topic that represents the default literal value of the
+ // value-group that is bound to this element - or null if it is unbound
public Topic getDefaultLiteralValue() throws InvalidGdlSchemaException {
if(this.defaultLiteralValueTopicSet){
return this.defaultLiteralValueTopic;
@@ -1993,6 +2003,8 @@
}
+ // returns the topic that represents the default value of
+ // the value-group that is bound to this element - null if it is unbound
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();
@@ -2000,6 +2012,8 @@
}
+ // returns true if the default value is fixed
+ // otherwise the return value is false
public boolean fixedDefaultValue() throws InvalidGdlSchemaException{
Topic defVal = this.getDefaultValue();
@@ -2020,6 +2034,8 @@
}
+ // returns all topic maps values that are valid and declared for the value-group
+ // of this element - or an empty ArrayList
public ArrayList<Topic> getTmValues() throws InvalidGdlSchemaException {
if(this.tmValueTopicsSet){
return this.tmValueTopics;
@@ -2031,6 +2047,8 @@
}
+ // returns all topics that represents literal values for this value-group - or
+ // an empty ArrayList
public ArrayList<Topic> getLiteralValues() throws InvalidGdlSchemaException {
if(this.literalValueTopicsSet){
return this.literalValueTopics;
@@ -2042,28 +2060,36 @@
}
+ // returns the set literal value or null
public String getSetLiteralValue() throws InvalidGdlSchemaException {
// TODO Auto-generated method stub
return null;
}
+ // returns the set tm value or null
public Construct getSetTmValue() throws InvalidGdlSchemaException {
// TODO Auto-generated method stub
return null;
}
+ // returns the valid topic maps value for the constraint that is bound
+ // to the value-group that is bound to this element - or an empty ArrayList
public ArrayList<Topic> getTmValuesForConstraint() throws InvalidGdlSchemaException, ExecutionException {
return TmHelper.getTmValuesForConstraint(this.getConstraint(), this.getValueGroup());
}
+ // returns the regular expression that is set for the constraint bound to the
+ // value-group of this element
public String getLiteralValueForConstraint() throws InvalidGdlSchemaException {
return TmHelper.getLiteralValueForConstraint(this.getConstraint());
}
+ // returns the display-by schema that is defined for the value-group that
+ // is bound to this element
public Topic getDisplayByOfValueGroup() throws InvalidGdlSchemaException {
if(this.displayByConstraintSet){
return this.displayByConstraint;
@@ -2075,6 +2101,8 @@
}
+ // returns the preferred scope that is bound to the value-group of
+ // this element - or an empty ArrayList
public ArrayList<Topic> getPreferredScopeOfValueGroup() throws InvalidGdlSchemaException {
if(this.prefferedScopesSet){
return this.preferredScopes;
@@ -2086,6 +2114,8 @@
}
+ // returns the string that represents the topic topicToRepresent corresponding
+ // to the passed displayBy and prefferedScopes arguments
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/base/TmHelper.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Thu Aug 25 06:32:05 2011 (r785)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Thu Aug 25 06:56:56 2011 (r786)
@@ -1116,50 +1116,44 @@
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
+ for(int i = 0; i != topicToRepresent.getNames(nameType).length(); ++i){
+ Name name = topicToRepresent.getNames(nameType).get(i);
+ if(preferredScopes == null || preferredScopes.size() == 0){
+ return name.getValue();
+ } else {
+ for(int j = 0; j != name.getScope().length(); ++j){
+ if(preferredScopes.contains(name.getScope().get(j))) return name.getValue();
+ }
+ }
}
- if(names.size() != 0) result = names.get(0).getValue();
+ throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(topicToRepresent) + " does not contain any name that can be used for its " + PSIs.GDL.AssociationType.gdlDisplayBy + " schema");
+
} 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;
- }
+ if(rex.matches(psi)) return psi;
}
+ throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(topicToRepresent) + " does not contain any subject-identifier that can be used for its " + PSIs.GDL.AssociationType.gdlDisplayBy + " schema");
} 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;
- }
+ String sl = topicToRepresent.getSubjectLocators().get(i).getReference();
+ if(rex.matches(sl)) return sl;
}
+ throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(topicToRepresent) + " does not contain any subject-locator that can be used for its " + PSIs.GDL.AssociationType.gdlDisplayBy + " schema");
} 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;
- }
+ String ii = topicToRepresent.getItemIdentifiers().get(i).getReference();
+ if(rex.matches(ii)) return ii;
}
+ throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(topicToRepresent) + " does not contain any item-identifier that can be used for its " + PSIs.GDL.AssociationType.gdlDisplayBy + " schema");
} else {
throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(displayBy) + " is not a valid representation schema type");
}
-
- if(result == null) throw new InvalidGdlSchemaException("");
- else return result;
}
}
}
1
0

[isidorus-cvs] r785 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base button complexData container 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 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)));
1
0

[isidorus-cvs] r784 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets: src/us/isidor/gdl/anaToMia/Widgets/base war/gdl_widgets
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 05:51:35 2011
New Revision: 784
Log:
gdl-frontend: Widgets: changed the GDL-Schema => gdl:display-by associations currently own always a role of the type gdl:descriptor with a player of the type gdlt:Value-Group or gdlt:TM-Value. The type gdl:value-group is not used any more in this association!
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java
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_full_TMCL_and_GDL_Schema.xtm
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.xtm
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/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Thu Aug 25 04:55:40 2011 (r783)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Thu Aug 25 05:51:35 2011 (r784)
@@ -1077,10 +1077,10 @@
// 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;
+ public static Topic getDisplayByTopicOf(Topic tmValueOrValueGroup) throws InvalidGdlSchemaException{
+ if(tmValueOrValueGroup == null) return null;
- TopicMap tm = tmValueOrvalueGroup.getTopicMap();
+ TopicMap tm = tmValueOrValueGroup.getTopicMap();
Topic displayByAssocType = getTopicByPsi(PSIs.GDL.AssociationType.gdlDisplayBy, tm);
Topic descriptorRoleType = getTopicByPsi(PSIs.GDL.RoleType.gdlDescriptor, tm);
Topic tmConstruct = getTopicByPsi(PSIs.GDL.RoleType.gdlTmConstruct, tm);
@@ -1088,14 +1088,14 @@
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> resultPsi = getOtherPlayerOfBinaryAssociation(tmValueOrValueGroup, descriptorRoleType, displayByAssocType, null, subjectIdentifierConstraintType, tmConstruct);
+ ArrayList<Topic> resultSl = getOtherPlayerOfBinaryAssociation(tmValueOrValueGroup, descriptorRoleType, displayByAssocType, null, subjectLocatorConstraintType, tmConstruct);
+ ArrayList<Topic> resultIi = getOtherPlayerOfBinaryAssociation(tmValueOrValueGroup, descriptorRoleType, displayByAssocType, null, itemIdentifierConstraintType, tmConstruct);
+ ArrayList<Topic> resultName = getOtherPlayerOfBinaryAssociation(tmValueOrValueGroup, descriptorRoleType, displayByAssocType, null, topicNameConstraintType, tmConstruct);
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.GDL.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;
}
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 Thu Aug 25 04:55:40 2011 (r783)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_GDL_Create_HashObject.jtm Thu Aug 25 05:51:35 2011 (r784)
@@ -187,7 +187,7 @@
{"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:display-by]", "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:[tgm:environment-name-constraint]"}]},
+ {"type":"si:[gdl:display-by]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[tgg:hash-object-creator-text-list-box-env-value-group]"}, {"type":"si:[gdl:tm-construct]", "player":"si:[tgm:environment-name-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 Thu Aug 25 04:55:40 2011 (r783)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_GDL_Edit_HashObject.jtm Thu Aug 25 05:51:35 2011 (r784)
@@ -180,7 +180,7 @@
{"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:display-by]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[tgg:hash-object-editor-text-env-value-group]"}, {"type":"si:[gdl:tm-construct]", "player":"si:[tgm:environment-name-constraint]"}]},
+ {"type":"si:[gdl:display-by]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[tgg:hash-object-editor-text-env-value-group]"}, {"type":"si:[gdl:tm-construct]", "player":"si:[tgm:environment-name-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 Thu Aug 25 04:55:40 2011 (r783)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_full_TMCL_and_GDL_Schema.jtm Thu Aug 25 05:51:35 2011 (r784)
@@ -10496,7 +10496,7 @@
"scope":null,
"roles":[{
"item_identifiers":null,
- "type":"si:[pref_3:value-group]",
+ "type":"si:[pref_3:descriptor]",
"reifier":null,
"player":"si:[pref_1:hash-object-editor-text-env-value-group]"
},
@@ -11880,7 +11880,7 @@
"scope":null,
"roles":[{
"item_identifiers":null,
- "type":"si:[pref_3:value-group]",
+ "type":"si:[pref_3:descriptor]",
"reifier":null,
"player":"si:[pref_1:hash-object-creator-text-list-box-env-value-group]"
},
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_full_TMCL_and_GDL_Schema.xtm
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_full_TMCL_and_GDL_Schema.xtm Thu Aug 25 04:55:40 2011 (r783)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_full_TMCL_and_GDL_Schema.xtm Thu Aug 25 05:51:35 2011 (r784)
@@ -8944,7 +8944,7 @@
</t:type>
<t:role>
<t:type>
- <t:topicRef href="#t2661" />
+ <t:topicRef href="#t2656" />
</t:type>
<t:topicRef href="#t6068" />
</t:role>
@@ -10258,7 +10258,7 @@
</t:type>
<t:role>
<t:type>
- <t:topicRef href="#t2661" />
+ <t:topicRef href="#t2656" />
</t:type>
<t:topicRef href="#t2946" />
</t:role>
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 Thu Aug 25 04:55:40 2011 (r783)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema.jtm Thu Aug 25 05:51:35 2011 (r784)
@@ -4893,7 +4893,7 @@
"scope":null,
"roles":[{
"item_identifiers":null,
- "type":"si:[pref_3:value-group]",
+ "type":"si:[pref_3:descriptor]",
"reifier":null,
"player":"si:[pref_1:hash-object-editor-text-env-value-group]"
},
@@ -5764,7 +5764,7 @@
"scope":null,
"roles":[{
"item_identifiers":null,
- "type":"si:[pref_3:value-group]",
+ "type":"si:[pref_3:descriptor]",
"reifier":null,
"player":"si:[pref_1:hash-object-creator-text-list-box-env-value-group]"
},
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema.xtm
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema.xtm Thu Aug 25 04:55:40 2011 (r783)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema.xtm Thu Aug 25 05:51:35 2011 (r784)
@@ -4108,7 +4108,7 @@
</t:type>
<t:role>
<t:type>
- <t:topicRef href="#t2661" />
+ <t:topicRef href="#t2656" />
</t:type>
<t:topicRef href="#t6068" />
</t:role>
@@ -5422,7 +5422,7 @@
</t:type>
<t:role>
<t:type>
- <t:topicRef href="#t2661" />
+ <t:topicRef href="#t2656" />
</t:type>
<t:topicRef href="#t2946" />
</t:role>
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 Thu Aug 25 04:55:40 2011 (r783)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema_with_test_data.jtm Thu Aug 25 05:51:35 2011 (r784)
@@ -4949,7 +4949,7 @@
"scope":null,
"roles":[{
"item_identifiers":null,
- "type":"si:[pref_3:value-group]",
+ "type":"si:[pref_3:descriptor]",
"reifier":null,
"player":"si:[pref_1:hash-object-editor-text-env-value-group]"
},
@@ -5820,7 +5820,7 @@
"scope":null,
"roles":[{
"item_identifiers":null,
- "type":"si:[pref_3:value-group]",
+ "type":"si:[pref_3:descriptor]",
"reifier":null,
"player":"si:[pref_1:hash-object-creator-text-list-box-env-value-group]"
},
1
0