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
July 2011
- 1 participants
- 156 discussions

[isidorus-cvs] r626 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base container text
by lgiessmann@common-lisp.net 15 Jul '11
by lgiessmann@common-lisp.net 15 Jul '11
15 Jul '11
Author: lgiessmann
Date: Fri Jul 15 03:50:29 2011
New Revision: 626
Log:
gdl-frontend: Widgets: changed the overflow css property to visible for all visble objects
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/Utils.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/text/GdlTitle.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 Fri Jul 15 03:34:35 2011 (r625)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Fri Jul 15 03:50:29 2011 (r626)
@@ -11,7 +11,6 @@
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.value.AbsoluteNumValue;
import us.isidor.gdl.anaToMia.Widgets.value.AutoNumUnitValue;
import us.isidor.gdl.anaToMia.Widgets.value.AutoNumValue;
@@ -21,9 +20,7 @@
import us.isidor.gdl.anaToMia.Widgets.value.ContentOrientationValue;
import us.isidor.gdl.anaToMia.Widgets.value.CursorValue;
import us.isidor.gdl.anaToMia.Widgets.value.NumUnitValue;
-
import com.google.gwt.core.client.JsArray;
-import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.dom.client.Style.Float;
import com.google.gwt.dom.client.Style.VerticalAlign;
@@ -74,6 +71,7 @@
// some constructors
protected GdlVisibleObject() {
initWidget(this.mainPanel);
+ DOM.setStyleAttribute(this.mainPanel.getElement(), "overflow", "visible");
}
@@ -114,24 +112,6 @@
this.containerPanel.add(widget);
}
-
- public static void replaceStyleProperty(Element elem, String styleName, String styleValue){
- String oldStyle = elem.getAttribute("style");
- String newValue = styleName + ": " + styleValue + ";";
-
- Pattern pattern1 = new Pattern("(^| )" + styleName + " *:[^;]");
- Pattern pattern2 = new Pattern(";" + styleName + " *:[^;]");
- if(pattern1.matches(oldStyle)){
- elem.setAttribute("style", oldStyle.replaceFirst(pattern1.pattern(), newValue));
- }else if(pattern2.matches(oldStyle)){
- elem.setAttribute("style", oldStyle.replaceFirst(pattern1.pattern(), ";" + newValue));
- }else{
- String valueToAppend = styleName + ": " + styleValue + ";";
- if(oldStyle.length() == 0) valueToAppend = " " + valueToAppend;
- elem.setAttribute("style", oldStyle + valueToAppend);
- }
- }
-
// a helper method that returns all occurrences of the type bound to the passed PSI
protected JsArray<Occurrence> getOccurrences(String occurrenceType){
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/Utils.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/Utils.java Fri Jul 15 03:34:35 2011 (r625)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/Utils.java Fri Jul 15 03:50:29 2011 (r626)
@@ -2,6 +2,10 @@
import java.util.ArrayList;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pattern;
+
+import com.google.gwt.dom.client.Element;
+
public class Utils {
// returns true if both arrays have the same items
@@ -25,4 +29,24 @@
for(int i = 0; i != str.length(); ++i) if(!Character.isDigit(str.charAt(i))) return false;
return true;
}
+
+
+ // replaces the given style property by the passed value, if no old value
+ // for this property was found, the new valu is imply added to the style attribute
+ public static void replaceStyleProperty(Element elem, String styleName, String styleValue){
+ String oldStyle = elem.getAttribute("style");
+ String newValue = styleName + ": " + styleValue + ";";
+
+ Pattern pattern1 = new Pattern("(^| )" + styleName + " *:[^;]");
+ Pattern pattern2 = new Pattern(";" + styleName + " *:[^;]");
+ if(pattern1.matches(oldStyle)){
+ elem.setAttribute("style", oldStyle.replaceFirst(pattern1.pattern(), newValue));
+ }else if(pattern2.matches(oldStyle)){
+ elem.setAttribute("style", oldStyle.replaceFirst(pattern1.pattern(), ";" + newValue));
+ }else{
+ String valueToAppend = styleName + ": " + styleValue + ";";
+ if(oldStyle.length() == 0) valueToAppend = " " + valueToAppend;
+ elem.setAttribute("style", oldStyle + valueToAppend);
+ }
+ }
}
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 Jul 15 03:34:35 2011 (r625)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java Fri Jul 15 03:50:29 2011 (r626)
@@ -3,7 +3,6 @@
import java.util.ArrayList;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
@@ -33,6 +32,7 @@
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.IGdlContainer;
import us.isidor.gdl.anaToMia.Widgets.base.TmHelper;
+import us.isidor.gdl.anaToMia.Widgets.base.Utils;
import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
@@ -160,13 +160,13 @@
// sets the css property list-style-type
public void setListStyleType(ListWidget widget, ListStyleTypeValue value) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) super.replaceStyleProperty(widget.getListElement(), "list-style-type", value.getCssValue());
+ if(value != null) Utils.replaceStyleProperty(widget.getListElement(), "list-style-type", value.getCssValue());
}
// sets the css property list-style-position
public void setListStylePositionValue(ListWidget widget, ListStylePositionValue value) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) super.replaceStyleProperty(widget.getListElement(), "list-style-position", value.getCssValue());
+ if(value != null) Utils.replaceStyleProperty(widget.getListElement(), "list-style-position", value.getCssValue());
}
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 Jul 15 03:34:35 2011 (r625)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java Fri Jul 15 03:50:29 2011 (r626)
@@ -6,6 +6,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis;
import us.isidor.gdl.anaToMia.Widgets.base.IGdlHasValue;
+import us.isidor.gdl.anaToMia.Widgets.base.Utils;
import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
@@ -150,7 +151,7 @@
public void setDirection(Widget widget, DirectionValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null && widget.getClass().equals(TitleWidget.class)) {
if(styleClass == null){
- super.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "direction", value.getCssValue());
+ Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "direction", value.getCssValue());
}
this.addStyleToStore(styleClass, "direction", value.getCssValue());
}
@@ -162,7 +163,7 @@
public void setTextAlign(Widget widget, TextAlignValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null && widget.getClass().equals(TitleWidget.class)) {
if(styleClass == null){
- super.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "text-align", value.getCssValue());
+ Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "text-align", value.getCssValue());
}
this.addStyleToStore(styleClass, "text-align", value.getCssValue());
}
@@ -174,7 +175,7 @@
public void setLineHeight(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null && widget.getClass().equals(TitleWidget.class)) {
if(styleClass == null){
- super.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "line-height", value.getCssValue());
+ Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "line-height", value.getCssValue());
}
this.addStyleToStore(styleClass, "line-height", value.getCssValue());
}
@@ -186,7 +187,7 @@
public void setTextDecoration(Widget widget, TextDecorationValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null && widget.getClass().equals(TitleWidget.class)) {
if(styleClass == null){
- super.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "text-decoration", value.getCssValue());
+ Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "text-decoration", value.getCssValue());
}
this.addStyleToStore(styleClass, "text-decoration", value.getCssValue());
}
@@ -198,7 +199,7 @@
public void setColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null && widget.getClass().equals(TitleWidget.class)) {
if(styleClass == null){
- super.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "color", value.getCssValue());
+ Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "color", value.getCssValue());
}
this.addStyleToStore(styleClass, "color", value.getCssValue());
}
@@ -210,7 +211,7 @@
public void setFontFamily(Widget widget, String value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null && widget.getClass().equals(TitleWidget.class)) {
if(styleClass == null){
- super.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "font-family", value);
+ Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "font-family", value);
}
this.addStyleToStore(styleClass, "font-family", value);
}
@@ -222,7 +223,7 @@
public void setFontStyle(Widget widget, FontStyle value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null && widget.getClass().equals(TitleWidget.class)) {
if(styleClass == null){
- super.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "font-style", value.getCssName());
+ Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "font-style", value.getCssName());
}
this.addStyleToStore(styleClass, "font-style", value.getCssName());
}
@@ -234,7 +235,7 @@
public void setFontSize(Widget widget, PositiveNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null && widget.getClass().equals(TitleWidget.class)) {
if(styleClass == null){
- super.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "font-size", value.getCssValue());
+ Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "font-size", value.getCssValue());
}
this.addStyleToStore(styleClass, "font-size", value.getCssValue());
}
@@ -246,7 +247,7 @@
public void setFontWeight(Widget widget, FontWeightValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null && widget.getClass().equals(TitleWidget.class)) {
if(styleClass == null){
- super.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "font-weight", value.getCssValue());
+ Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "font-weight", value.getCssValue());
}
this.addStyleToStore(styleClass, "font-weight", value.getCssValue());
}
@@ -258,7 +259,7 @@
public void setLetterSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null && widget.getClass().equals(TitleWidget.class)) {
if(styleClass == null){
- super.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "letter-spacing", value.getCssValue());
+ Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "letter-spacing", value.getCssValue());
}
this.addStyleToStore(styleClass, "letter-spacing", value.getCssValue());
}
@@ -269,7 +270,7 @@
public void setWordSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null && widget.getClass().equals(TitleWidget.class)) {
if(styleClass == null){
- super.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "word-spacing", value.getCssValue());
+ Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "word-spacing", value.getCssValue());
}
this.addStyleToStore(styleClass, "word-spacing", value.getCssValue());
}
@@ -280,7 +281,7 @@
public void setWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null && widget.getClass().equals(TitleWidget.class)) {
if(styleClass == null){
- super.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "width", value.getCssValue()); // TODO: fix
+ Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "width", value.getCssValue()); // TODO: fix
}
this.addStyleToStore(styleClass, "width", value.getCssValue());
super.setCssProperty(widget, styleClass, "width", value.getCssValue());
@@ -292,7 +293,7 @@
public void setMinWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null && widget.getClass().equals(TitleWidget.class)) {
if(styleClass == null){
- super.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "min-width", value.getCssValue());
+ Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "min-width", value.getCssValue());
}
this.addStyleToStore(styleClass, "min-width", value.getCssValue());
super.setCssProperty(widget, styleClass, "minWidth", value.getCssValue());
@@ -304,7 +305,7 @@
public void setMaxWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null && widget.getClass().equals(TitleWidget.class)) {
if(styleClass == null){
- super.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "max-width", value.getCssValue());
+ Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "max-width", value.getCssValue());
}
this.addStyleToStore(styleClass, "max-width", value.getCssValue());
super.setCssProperty(widget, styleClass, "maxWidth", value.getCssValue());
@@ -316,7 +317,7 @@
public void setHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null && widget.getClass().equals(TitleWidget.class)) {
if(styleClass == null){
- super.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "height", value.getCssValue());
+ Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "height", value.getCssValue());
}
this.addStyleToStore(styleClass, "height", value.getCssValue());
super.setCssProperty(widget, styleClass, "height", value.getCssValue());
@@ -328,7 +329,7 @@
public void setMinHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null && widget.getClass().equals(TitleWidget.class)) {
if(styleClass == null){
- super.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "min-height", value.getCssValue());
+ Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "min-height", value.getCssValue());
}
this.addStyleToStore(styleClass, "min-height", value.getCssValue());
super.setCssProperty(widget, styleClass, "minHeight", value.getCssValue());
@@ -340,7 +341,7 @@
public void setMaxHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null && widget.getClass().equals(TitleWidget.class)) {
if(styleClass == null){
- super.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "max-height", value.getCssValue());
+ Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "max-height", value.getCssValue());
}
this.addStyleToStore(styleClass, "max-height", value.getCssValue());
super.setCssProperty(widget, styleClass, "maxHeight", value.getCssValue());
@@ -355,7 +356,7 @@
GdlTitle.super.onHoverStart(event, handler);
if(source.getClass().equals(TitleWidget.class)){
for (Pair<String, String> pair : this.titleHoverCssNamesAndStyles) {
- GdlTitle.super.replaceStyleProperty(((TitleWidget)source).titleElement, pair.getFirst(), pair.getSecond());
+ Utils.replaceStyleProperty(((TitleWidget)source).titleElement, pair.getFirst(), pair.getSecond());
}
}
}
@@ -367,7 +368,7 @@
GdlTitle.super.onHoverStart(widget);
if(widget.getClass().equals(TitleWidget.class)){
for (Pair<String, String> pair : this.titleHoverCssNamesAndStyles) {
- GdlTitle.super.replaceStyleProperty(((TitleWidget)widget).titleElement, pair.getFirst(), pair.getSecond());
+ Utils.replaceStyleProperty(((TitleWidget)widget).titleElement, pair.getFirst(), pair.getSecond());
}
}
}
@@ -378,7 +379,7 @@
GdlTitle.super.onFocusStart(widget);
if(widget.getClass().equals(TitleWidget.class)){
for (Pair<String, String> pair : this.titleFocusCssNamesAndStyles) {
- GdlTitle.super.replaceStyleProperty(((TitleWidget)widget).titleElement, pair.getFirst(), pair.getSecond());
+ Utils.replaceStyleProperty(((TitleWidget)widget).titleElement, pair.getFirst(), pair.getSecond());
}
}
}
@@ -390,7 +391,7 @@
GdlTitle.super.onFocusStart(event, handler);
if(source.getClass().equals(TitleWidget.class)){
for (Pair<String, String> pair : this.titleFocusCssNamesAndStyles) {
- GdlTitle.super.replaceStyleProperty(((TitleWidget)source).titleElement, pair.getFirst(), pair.getSecond());
+ Utils.replaceStyleProperty(((TitleWidget)source).titleElement, pair.getFirst(), pair.getSecond());
}
}
}
@@ -401,7 +402,7 @@
GdlTitle.super.onActiveStart(widget);
if(widget.getClass().equals(TitleWidget.class)){
for (Pair<String, String> pair : this.titleActiveCssNamesAndStyles) {
- GdlTitle.super.replaceStyleProperty(((TitleWidget)widget).titleElement, pair.getFirst(), pair.getSecond());
+ Utils.replaceStyleProperty(((TitleWidget)widget).titleElement, pair.getFirst(), pair.getSecond());
}
}
}
@@ -413,7 +414,7 @@
GdlTitle.super.onActiveStart(event, handler);
if(source.getClass().equals(TitleWidget.class)){
for (Pair<String, String> pair : this.titleActiveCssNamesAndStyles) {
- GdlTitle.super.replaceStyleProperty(((TitleWidget)source).titleElement, pair.getFirst(), pair.getSecond());
+ Utils.replaceStyleProperty(((TitleWidget)source).titleElement, pair.getFirst(), pair.getSecond());
}
}
}
@@ -484,7 +485,7 @@
default: throw new ExecutionException("The title order of a GDL Title element must be 1, 2, 3 or 4");
}
this.basePanel.getElement().insertFirst(this.titleElement);
- GdlTitle.super.replaceStyleProperty(this.titleElement, "margin", "0px");
+ Utils.replaceStyleProperty(this.titleElement, "margin", "0px");
}
1
0

[isidorus-cvs] r625 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets: src/us/isidor/gdl/anaToMia/Widgets/container war/gdl_widgets
by lgiessmann@common-lisp.net 15 Jul '11
by lgiessmann@common-lisp.net 15 Jul '11
15 Jul '11
Author: lgiessmann
Date: Fri Jul 15 03:34:35 2011
New Revision: 625
Log:
gdl-frontend: Widgets: extended the gdl xtm test file, so currently a list is also defined in the default-creator-topic-view
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm
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 Jul 15 03:00:51 2011 (r624)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java Fri Jul 15 03:34:35 2011 (r625)
@@ -3,6 +3,7 @@
import java.util.ArrayList;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
@@ -60,14 +61,12 @@
ArrayList<Topic> objectsContained = this.contains();
- Topic currentTopic = objectsContained.size() == 0 ? null : objectsContained.get(0);
Topic lastTopic = null;
if(objectsContained.size() != 0){
- for(int i = 1; i != objectsContained.size(); ++i){
- this.append(lastTopic, currentTopic);
- lastTopic = currentTopic;
- currentTopic = objectsContained.get(i);
+ for(int i = 0; i != objectsContained.size(); ++i){
+ this.append(lastTopic, objectsContained.get(i));
+ lastTopic = objectsContained.get(i);
}
}
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm Fri Jul 15 03:00:51 2011 (r624)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm Fri Jul 15 03:34:35 2011 (r625)
@@ -27,10 +27,15 @@
{"subject_identifiers":["[gdl:Text-Object]"]},
{"subject_identifiers":["[gdl:Position]"]},
{"subject_identifiers":["[gdl:position]"], "instance_of":["si:[tmcl:association-type]"]},
+ {"subject_identifiers":["[gdl:nth-element]"], "instance_of":["si:[tmcl:role-type]"]},
{"subject_identifiers":["[gdl:View]"]},
{"subject_identifiers":["[gdl:Text]"]},
{"subject_identifiers":["[gdl:Title]"]},
{"subject_identifiers":["[gdl:Reference]"]},
+ {"subject_identifiers":["[gdl:List]"]},
+ {"subject_identifiers":["[doc:list-item-1]"], "instance_of":["si:[gdl:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"list_item_1_id", "datatype":"[xsd:ID]"}]},
+ {"subject_identifiers":["[doc:list-item-3]"], "instance_of":["si:[gdl:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"list_item_3_id", "datatype":"[xsd:ID]"}]},
+ {"subject_identifiers":["[doc:list-item-2]"], "instance_of":["si:[gdl:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"list_item_2_id", "datatype":"[xsd:ID]"}]},
{"subject_identifiers":["[gdl:List-Box]"]},
{"subject_identifiers":["[doc:text-1]"], "instance_of":["si:[gdl:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"text_1_id", "datatype":"[xsd:ID]"}]},
{"subject_identifiers":["[doc:title-1]"], "instance_of":["si:[gdl:Title]"], "occurrences":[{"type":"si:[gdl:id]", "value":"title_1_id", "datatype":"[xsd:ID]"}]},
@@ -41,14 +46,21 @@
{"subject_identifiers":["[doc:pos-of-text-1]"], "instance_of":["si:[gdl:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"relative"}, {"type":"si:[gdl:top]", "value":"40px"}, {"type":"si:[gdl:left]", "value": "5%"}]},
{"subject_identifiers":["[doc:pos-of-reference-1]"], "instance_of":["si:[gdl:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"static"}]},
{"subject_identifiers":["[doc:pos-of-list-box-1]"], "instance_of":["si:[gdl:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:bottom]", "value":"5px"}, {"type":"si:[gdl:right]", "value":"5px"}]},
+ {"subject_identifiers":["[doc:pos-of-person-list]"], "instance_of":["si:[gdl:Position]"]},
{"subject_identifiers":["[gdl:position-style]"], "instance_of":["si:[tmcl:occurrence-type]"]},
{"subject_identifiers":["[gdl:top]"], "instance_of":["si:[tmcl:occurrence-type]"]},
{"subject_identifiers":["[gdl:right]"], "instance_of":["si:[tmcl:occurrence-type]"]},
{"subject_identifiers":["[gdl:bottom]"], "instance_of":["si:[tmcl:occurrence-type]"]},
{"subject_identifiers":["[gdl:left]"], "instance_of":["si:[tmcl:occurrence-type]"]},
{"subject_identifiers":["[gdl:TM-Value]"]},
+ {"subject_identifiers":["[gdl:Nth-Element]"]},
+ {"subject_identifiers":["[gdl:nth-value]"], "instance_of":["si:[tmcl:occurrence-type]"]},
+ {"subject_identifiers":["[doc:nth-elem-1]"], "instance_of":["si:[gdl:Nth-Element]"], "occurrences":[{"type":"si:[gdl:nth-value]", "value":"0"}]},
+ {"subject_identifiers":["[doc:nth-elem-2]"], "instance_of":["si:[gdl:Nth-Element]"], "occurrences":[{"type":"si:[gdl:nth-value]", "value":"7"}]},
+ {"subject_identifiers":["[doc:nth-elem-3]"], "instance_of":["si:[gdl:Nth-Element]"], "occurrences":[{"type":"si:[gdl:nth-value]", "value":"8"}]},
{"subject_identifiers":["[gdl:TM-Instance-Value]"]},
{"subject_identifiers":["[gdl:TM-Multiple-Type-Value]"]},
+ {"subject_identifiers":["[doc:person-list]"], "instance_of":["si:[gdl:List]"], "occurrences":[{"type":"si:[gdl:id]", "value":"person_list_1_id", "datatype":"[xsd:ID]"}]},
{"subject_identifiers":["[gdl:tm-binding]"], "instance_of":["si:[tmcl:association-type]"]},
{"subject_identifiers":["[gdl:id]"], "instance_of":["si:[tmcl:occurrence-type]"]},
{"subject_identifiers":["[gdl:topic-view-binding]"], "instance_of":["si:[tmcl:association-type]"]},
@@ -91,10 +103,13 @@
{"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Text-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Title]"}]},
{"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Text-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Reference]"}]},
{"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Text-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:List-Box]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Visible-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:List]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Nth-Element]"}]},
{"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:test-schema]"},{"type":"si:[gdl:containee]", "player":"si:[doc:default-creator-topic-view-1]"}]},
{"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:test-schema]"},{"type":"si:[gdl:containee]", "player":"si:[doc:default-creator-topic-view-2]"}]},
{"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:test-schema]"},{"type":"si:[gdl:containee]", "player":"si:[doc:default-editor-topic-view]"}]},
{"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:test-schema]"},{"type":"si:[gdl:containee]", "player":"si:[doc:special-creator-topic-view]"}]},
+ {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:test-schema]"},{"type":"si:[gdl:containee]", "player":"si:[doc:person-list]"}]},
{"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:instance-value]"}, {"type":"si:[gdl:tm-construct]", "player":"si:[doc:musician/John_Lennon]"}]},
{"type":"si:[gdl:topic-view-binding]", "roles":[{"type":"si:[gdl:tm-value]", "player":"si:[doc:instance-value]"}, {"type":"si:[gdl:descriptor]", "player":"si:[doc:default-editor-topic-view]"}]},
{"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:multi-type-value-1]"}, {"type":"si:[gdl:tm-construct]", "player":"si:[doc:Musician]"}]},
@@ -111,8 +126,13 @@
{"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:default-creator-topic-view-1]"},{"type":"si:[gdl:containee]", "player":"si:[doc:text-1]"}]},
{"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:default-creator-topic-view-1]"},{"type":"si:[gdl:containee]", "player":"si:[doc:reference-1]"}]},
{"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:default-creator-topic-view-1]"},{"type":"si:[gdl:containee]", "player":"si:[doc:list-box-1]"}]},
+ {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:default-creator-topic-view-1]"},{"type":"si:[gdl:containee]", "player":"si:[doc:person-list]"}]},
{"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:pos-of-title-1]"},{"type":"si:[gdl:ancestor]", "player":"si:[doc:default-creator-topic-view-1]"}, {"type":"si:[gdl:descendant]", "player":"si:[doc:title-1]"}]},
{"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:pos-of-text-1]"},{"type":"si:[gdl:ancestor]", "player":"si:[doc:title-1]"}, {"type":"si:[gdl:descendant]", "player":"si:[doc:text-1]"}]},
{"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:pos-of-reference-1]"},{"type":"si:[gdl:ancestor]", "player":"si:[doc:text-1]"}, {"type":"si:[gdl:descendant]", "player":"si:[doc:reference-1]"}]},
- {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:pos-of-list-box-1]"},{"type":"si:[gdl:ancestor]", "player":"si:[doc:reference-1]"}, {"type":"si:[gdl:descendant]", "player":"si:[doc:list-box-1]"}]}
+ {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:pos-of-list-box-1]"},{"type":"si:[gdl:ancestor]", "player":"si:[doc:reference-1]"}, {"type":"si:[gdl:descendant]", "player":"si:[doc:list-box-1]"}]},
+ {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:pos-of-person-list]"},{"type":"si:[gdl:ancestor]", "player":"si:[doc:list-box-1]"}, {"type":"si:[gdl:descendant]", "player":"si:[doc:person-list]"}]},
+ {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:person-list]"},{"type":"si:[gdl:containee]", "player":"si:[doc:list-item-1]"}, {"type":"si:[gdl:nth-element]", "player":"si:[doc:nth-elem-1]"}]},
+ {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:person-list]"},{"type":"si:[gdl:containee]", "player":"si:[doc:list-item-2]"}, {"type":"si:[gdl:nth-element]", "player":"si:[doc:nth-elem-2]"}]},
+ {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:person-list]"},{"type":"si:[gdl:containee]", "player":"si:[doc:list-item-3]"}, {"type":"si:[gdl:nth-element]", "player":"si:[doc:nth-elem-3]"}]}
]}
\ No newline at end of file
1
0

[isidorus-cvs] r624 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base container text
by lgiessmann@common-lisp.net 15 Jul '11
by lgiessmann@common-lisp.net 15 Jul '11
15 Jul '11
Author: lgiessmann
Date: Fri Jul 15 03:00:51 2011
New Revision: 624
Log:
gdl-frontend: Widgets: implemented GDL positioning in GdlList
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/TmHelper.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/Utils.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
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 Fri Jul 15 00:55:20 2011 (r623)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Fri Jul 15 03:00:51 2011 (r624)
@@ -33,7 +33,7 @@
requestedTopicsToCreate.add(new Pair<String, TopicIdentifierTypes>("http://psi.test.org/gdl-test/Poet", TopicIdentifierTypes.SubjectIdentifier));
requestedTopicsToCreate.add(new Pair<String, TopicIdentifierTypes>("http://psi.test.org/gdl-test/Musician", TopicIdentifierTypes.SubjectIdentifier));
gdlPanel = new GdlPanel(null, requestedTopicsToCreate);
- gdlPanel.setPixelSize(100, 100);
+ gdlPanel.setPixelSize(450, 450);
DOM.setStyleAttribute(gdlPanel.getElement(), "backgroundColor", "yellow");
mainPanel.add(gdlPanel);
gdlPanel.setTmEngine(new JtmsTmEngine());
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 Fri Jul 15 00:55:20 2011 (r623)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Fri Jul 15 03:00:51 2011 (r624)
@@ -1,10 +1,12 @@
package us.isidor.gdl.anaToMia.Widgets.base;
import java.util.ArrayList;
+import java.util.List;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Locator;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Role;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.ScopedStub;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
@@ -315,14 +317,77 @@
// returns all topics that are related to the passed topic via a contains association
public static ArrayList<Topic> topicContains(Topic container) {
- if(container == null) return new ArrayList<Topic>();
-
+ if(container == null) return new ArrayList<Topic>();
TopicMap tm = container.getTopicMap();
- Topic contains = getTopicByPsi(GdlPsis.AssociationType.gdlContains, tm);
+ Topic containsAssocType = getTopicByPsi(GdlPsis.AssociationType.gdlContains, tm);
+ Topic containerRoleType = getTopicByPsi(GdlPsis.RoleType.gdlContainer, tm);
+ Topic visibleObject = getTopicByPsi(GdlPsis.TopicType.gdlVisibleObject, tm);
+ Topic containeeRoleType = getTopicByPsi(GdlPsis.RoleType.gdlContainee, tm);
+
+ return getOtherPlayerOfBinaryAssociation(container, containerRoleType, containsAssocType, null, visibleObject, containeeRoleType);
+ }
+
+
+ // returns an ordered list of the list items and their index stored in a pair instance
+ public static ArrayList<Pair<Topic, Integer>> listContains(Topic list) throws InvalidGdlSchemaException {
+ if(list == null) return new ArrayList<Pair<Topic,Integer>>();
+ TopicMap tm = list.getTopicMap();
+ Topic containsAssocType = getTopicByPsi(GdlPsis.AssociationType.gdlContains, tm);
Topic containerRoleType = getTopicByPsi(GdlPsis.RoleType.gdlContainer, tm);
Topic visibleObject = getTopicByPsi(GdlPsis.TopicType.gdlVisibleObject, tm);
Topic containeeRoleType = getTopicByPsi(GdlPsis.RoleType.gdlContainee, tm);
- return getOtherPlayerOfBinaryAssociation(container, containerRoleType, contains, null, visibleObject, containeeRoleType);
+ Topic nthElement = getTopicByPsi(GdlPsis.TopicType.gdlNthElement, tm);
+ Topic nthElementRoleType = getTopicByPsi(GdlPsis.RoleType.gdlNthElement, tm);
+
+ ArrayList<Pair<Topic, Topic>> rolePlayertypesAndTypes = new ArrayList<Pair<Topic,Topic>>();
+ rolePlayertypesAndTypes.add(new Pair<Topic, Topic>(visibleObject, containeeRoleType));
+ rolePlayertypesAndTypes.add(new Pair<Topic, Topic>(nthElement, nthElementRoleType));
+ ArrayList<Association> validAssociations = getAssociationsOfTopic(list, containerRoleType, containsAssocType, null, rolePlayertypesAndTypes);
+
+ List<Pair<Topic, Integer>> result = new ArrayList<Pair<Topic,Integer>>();
+ for (Association validAssoc : validAssociations) {
+ Topic idx = validAssoc.getRoles(nthElementRoleType).get(0).getPlayer();
+ JsArray<Occurrence> idxOccs = idx.getOccurrences(tm.getTopicBySubjectIdentifier(tm.createLocator(GdlPsis.OccurrenceType.gdlNthValue)));
+ ArrayList<Occurrence> validIdxOccs = new ArrayList<Occurrence>();
+ for(int i = 0; i != idxOccs.length(); ++i) if(idxOccs.get(i).getScope().length() == 0) validIdxOccs.add(idxOccs.get(i));
+
+ if(validIdxOccs.size() != 1){
+ throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(idx) + " must be bound exaclty once to an occurrence of the type " + GdlPsis.OccurrenceType.gdlNthValue + " but is bound " + validIdxOccs.size() + " times");
+ }else{
+ Occurrence validOcc = validIdxOccs.get(0);
+ if(!validOcc.getValue().toUpperCase().equals("LAST") && !Utils.isDecNumber(validOcc.getValue())){
+ throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(idx) + " must be bound exaclty once to an occurrence of the type " + GdlPsis.OccurrenceType.gdlNthValue + " with a the value \"last\" or <positive integer>, but is " + validOcc.getValue());
+ }
+
+ int idxValue = -1; // -1 represents last
+ if(!validOcc.getValue().toUpperCase().equals("LAST")) idxValue = Integer.valueOf(validOcc.getValue());
+ Topic item = validAssoc.getRoles(containeeRoleType).get(0).getPlayer();
+
+ if(result.size() == 0){
+ result.add(new Pair<Topic, Integer>(item, idxValue));
+ }else {
+ for(int i = 0; i != result.size(); ++i){
+ if (result.get(i).getSecond() == idxValue){
+ String idxStr = idxValue == -1 ? "last" : "" + idxValue;
+ throw new InvalidGdlSchemaException("the list " + getAnyIdOfTopic(list) + " contains more than one item with the idx " + idxStr);
+ }
+
+ if(result.get(i).getSecond() > idxValue){
+ result.add(i, new Pair<Topic, Integer>(item, idxValue));
+ break;
+ }
+
+ if(i == result.size() - 1){
+ result.add(new Pair<Topic, Integer>(item, idxValue));
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ ArrayList<Pair<Topic, Integer>> orderedResult = new ArrayList<Pair<Topic,Integer>>(result);
+ return orderedResult;
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/Utils.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/Utils.java Fri Jul 15 00:55:20 2011 (r623)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/Utils.java Fri Jul 15 03:00:51 2011 (r624)
@@ -17,4 +17,12 @@
return true;
}
+
+
+ // returns true if the string consists only of digits
+ public static boolean isDecNumber(String str){
+ if(str == null) return false;
+ for(int i = 0; i != str.length(); ++i) if(!Character.isDigit(str.charAt(i))) return false;
+ return true;
+ }
}
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 Jul 15 00:55:20 2011 (r623)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java Fri Jul 15 03:00:51 2011 (r624)
@@ -35,6 +35,7 @@
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.GdlInstantiator;
import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
@@ -43,6 +44,9 @@
public class GdlList extends GdlVisibleObject implements IGdlContainer {
+ private ArrayList<Pair<Topic, Integer>> storedItems = null;
+
+
// some constructors
protected GdlList() throws InvalidGdlSchemaException, ExecutionException {
super();
@@ -53,6 +57,19 @@
public GdlList(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
super(tmRepresentative);
this.createList();
+
+ ArrayList<Topic> objectsContained = this.contains();
+
+ Topic currentTopic = objectsContained.size() == 0 ? null : objectsContained.get(0);
+ Topic lastTopic = null;
+
+ if(objectsContained.size() != 0){
+ for(int i = 1; i != objectsContained.size(); ++i){
+ this.append(lastTopic, currentTopic);
+ lastTopic = currentTopic;
+ currentTopic = objectsContained.get(i);
+ }
+ }
}
@@ -261,7 +278,7 @@
}
- // returns the position index of the item, that was psecified when
+ // returns the position index of the item, that was specified when
// inserting the passed ListItem
public int indexOfItem(ListItem item){
for (Pair<ListItem, Integer> pair : this.itemsAndIndexes) {
@@ -314,7 +331,7 @@
}
- // this class wrapps a list item, i.e. a div element within a li element
+ // this class wraps a list item, i.e. a div element within a li element
protected class ListItem{
private Element liElement = null;
private Element divElement = null;
@@ -379,15 +396,36 @@
@Override
public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException, ExecutionException {
// TODO Auto-generated method stub
+ if(this.subElements.size() == 0) return null;
+ if(this.storedItems == null) this.storedItems = this.containsItems();
- return null;
+ // the ancestor element can be ignore, since the current idx can be looked up
+ // from the storedItem array list directly
+ int idx = -1;
+ for (Pair<Topic, Integer> pair : this.storedItems) if(pair.getFirst().equals(current)) idx = pair.getSecond();
+
+ ListWidget list = (ListWidget)this.subElements.get(0);
+ GdlVisibleObject newObj = GdlInstantiator.instantiate(current);
+ list.insertWidget(newObj, idx);
+
+ return newObj;
}
-
+
// returns all topics that are bound to this tm representative topic via a
- // contains association
+ // contains association i an ordered list
@Override
public ArrayList<Topic> contains() throws InvalidGdlSchemaException {
- return TmHelper.topicContains(this.tmRepresentative);
+ ArrayList<Topic> result = new ArrayList<Topic>();
+ for (Pair<Topic, Integer> pair : TmHelper.listContains(super.getTmRepresentative()))
+ result.add(pair.getFirst());
+
+ return result;
+ }
+
+
+ // returns an ordered list of items with their index
+ public ArrayList<Pair<Topic, Integer>> containsItems() throws InvalidGdlSchemaException{
+ return TmHelper.listContains(super.getTmRepresentative());
}
}
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 Jul 15 00:55:20 2011 (r623)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Fri Jul 15 03:00:51 2011 (r624)
@@ -48,7 +48,6 @@
super(tmRepresentative);
// TODO: create a text element for each TM-elem
this.createNewTextArea(); // TODO: remove only for debugging
- this.createNewTextArea(); // TODO: remove only for debugging
}
1
0

[isidorus-cvs] r623 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: container view
by lgiessmann@common-lisp.net 15 Jul '11
by lgiessmann@common-lisp.net 15 Jul '11
15 Jul '11
Author: lgiessmann
Date: Fri Jul 15 00:55:20 2011
New Revision: 623
Log:
gdl-frontend: Widgets: implemented GDL positioning in GdlUnit
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/view/GdlView.java
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 Jul 15 00:24:45 2011 (r622)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java Fri Jul 15 00:55:20 2011 (r623)
@@ -28,6 +28,7 @@
import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlPosition;
import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.IGdlContainer;
@@ -35,6 +36,7 @@
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.GdlInstantiator;
import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
@@ -70,7 +72,6 @@
// creates a unit element or returns the one, if there is a unit element
// in the subElements array
private void createUnit() throws InvalidGdlSchemaException, ExecutionException{
- // this object is able to own only one sub-element
UnitWidget unit = new UnitWidget();
ActiveStyleHandler asHandler = new ActiveStyleHandler(this);
FocusStyleHandler fsHandler = new FocusStyleHandler(this);
@@ -86,6 +87,16 @@
unit.addBlurHandler(fsHandler);
super.addToContainerPanel(unit);
this.setGdlStyle(unit);
+
+ // set the actual content of a unit
+ ArrayList<Topic> objectsContained = this.contains();
+ Topic currentTopic = this.getStartElement(objectsContained);
+ Topic lastTopic = super.getTmRepresentative();
+ while(currentTopic != null){
+ unit.append(lastTopic, currentTopic);
+ lastTopic = currentTopic;
+ currentTopic = TmHelper.getNextContainee(currentTopic, objectsContained);
+ }
}
@@ -1253,8 +1264,9 @@
@Override
+ @Deprecated
public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException, ExecutionException {
- // TODO: implement
+ // do nothing this method has no effect on the mainpanle
return null;
}
@@ -1264,7 +1276,15 @@
@Override
public ArrayList<Topic> contains() throws InvalidGdlSchemaException {
return TmHelper.topicContains(this.tmRepresentative);
- }
+ }
+
+
+ // Searches the topic that represents the first item that is placed within this view instance
+ // i.e. such an item must not have an association that is bound to it via a role of the type
+ // gdl:ancestor.
+ protected Topic getStartElement(ArrayList<Topic> containees) throws InvalidGdlSchemaException {
+ return TmHelper.getFirstContainee(super.getTmRepresentative(), containees);
+ }
// wraps a fieldset with a legend item that represent a group-element
@@ -1272,9 +1292,16 @@
private AbsolutePanel basePanel = new AbsolutePanel();
private Element fieldset = DOM.createFieldSet();
private Element legend = DOM.createLegend();
+ private ArrayList<Widget> subElements = new ArrayList<Widget>();
+ private Topic tmRepresentative = null;
+
+
+ private UnitWidget() {}
- public UnitWidget(){
+ public UnitWidget(Topic tmRepresentative) throws ExecutionException{
+ if(tmRepresentative == null) throw new ExecutionException("tmRepresentative must be set");
+ this.tmRepresentative = tmRepresentative;
initWidget(this.basePanel);
this.fieldset.appendChild(this.legend);
this.basePanel.getElement().appendChild(this.fieldset);
@@ -1282,7 +1309,12 @@
DOM.setStyleAttribute(this.legend, "display", "none");
DOM.setStyleAttribute(this.legend, "marginLeft", "1em");
DOM.setStyleAttribute(this.legend, "marginRight", "1em");
- }
+ }
+
+
+ public Topic getTmRepresentative(){
+ return this.tmRepresentative;
+ }
// some css style setters
@@ -1494,8 +1526,34 @@
}
- public void insert(GdlVisibleObject widget){
- // TODO: implement, change signature => positioning
+ // appends a new element in form of a topic to this unit-widget
+ public GdlVisibleObject append(Topic ancestor, Topic current) throws ExecutionException, InvalidGdlSchemaException {
+ 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);
+ GdlVisibleObject oldObj = null;
+ for (Widget widget : this.subElements){
+ if(((GdlVisibleObject)widget).getTmRepresentative().equals(ancestor)){
+ oldObj = (GdlVisibleObject)widget;
+ break;
+ }
+ }
+
+ this.subElements.add(newObj);
+ if(this.getTmRepresentative().equals(ancestor)){
+ this.fieldset.appendChild(newObj.getElement());
+ }
+ else{
+ Element elemBefore = oldObj.getElement();
+ Element elemAfter = DOM.getNextSibling(elemBefore);
+ // insert before seems to be a more accepted and stable
+ // way of inserting new child elements than insertAfter
+ if(elemAfter == null) this.fieldset.appendChild(newObj.getElement());
+ else this.fieldset.insertBefore(newObj.getElement(), elemAfter);
+ }
+ position.setAttributes(newObj);
+ return newObj;
}
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 Jul 15 00:24:45 2011 (r622)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java Fri Jul 15 00:55:20 2011 (r623)
@@ -1,11 +1,8 @@
package us.isidor.gdl.anaToMia.Widgets.view;
import java.util.ArrayList;
-
import com.google.gwt.core.client.JsArray;
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.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Name;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
1
0

[isidorus-cvs] r622 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base view
by lgiessmann@common-lisp.net 15 Jul '11
by lgiessmann@common-lisp.net 15 Jul '11
15 Jul '11
Author: lgiessmann
Date: Fri Jul 15 00:24:45 2011
New Revision: 622
Log:
gdl-frontend: Widgets: fixed a bug when appending sub-elements to a view in relation to a specific existent sub-element; changed the setters of GdlView depending the Gdl-Style-Properties
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/TestClass.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/GdlVisibleObject.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Jul 14 14:01:08 2011 (r621)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Fri Jul 15 00:24:45 2011 (r622)
@@ -91,6 +91,16 @@
public Topic getTmRepresentative(){
return this.tmRepresentative;
}
+
+
+ public void registerButtonCallback(ClickHandler handler, String id){
+ // TODO: implement
+ }
+
+
+ public void deregisterButtonCallback(ClickHandler handler, String id){
+ // TODO: implement
+ }
// this method should be invoked if a new sub-element is added to this instance
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 Jul 14 14:01:08 2011 (r621)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Fri Jul 15 00:24:45 2011 (r622)
@@ -27,7 +27,7 @@
Window.alert("TEST !!!");
RootPanel.get("GWT_Content").add(mainPanel);
mainPanel.setBorderWidth(1);
- mainPanel.setPixelSize(500, 500);
+ mainPanel.setPixelSize(1000, 600);
ArrayList<Pair<String, TopicIdentifierTypes>> requestedTopicsToCreate = new ArrayList<Pair<String,TopicIdentifierTypes>>();
requestedTopicsToCreate.add(new Pair<String, TopicIdentifierTypes>("http://psi.test.org/gdl-test/Poet", TopicIdentifierTypes.SubjectIdentifier));
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 Jul 14 14:01:08 2011 (r621)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java Fri Jul 15 00:24:45 2011 (r622)
@@ -5,6 +5,7 @@
import com.google.gwt.core.client.JsArray;
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.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Name;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
@@ -18,11 +19,10 @@
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.GdlInstantiator;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.value.ContentOrientationValue;
public abstract class GdlView extends GdlVisibleObject implements IGdlContainer, IGdlHasValue {
- // TODO: all setter from visible object must infer only the mainPanel
-
protected GdlView(){
super();
}
@@ -42,6 +42,24 @@
}
+ // this method should be invoked if a new sub-element is added to this instance.
+ // instances ov GdlView does not organize their sub-elements in
+ // tables, sub-elements are placed directly on the mainpanel
+ @Override
+ protected void addToContainerPanel(Widget widget){
+ this.subElements.add(widget);
+ this.mainPanel.add(widget);
+ }
+
+
+ // content orientation has no effect on a view
+ @Override
+ public void setContentOrientation(Widget widget, ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException {
+ // do nothing, no table is set for organizing content widgets, since a view does not organize
+ // its content in this manner
+ }
+
+
public String getViewName()throws InvalidGdlSchemaException {
JsArray<Name> viewNames = super.tmRepresentative.getNames(tm.getTopicBySubjectIdentifier(tm.createLocator(GdlPsis.NameType.gdlViewName)));
if(viewNames.length() != 1){
@@ -52,12 +70,12 @@
public void registerButtonCallback(ClickHandler handler, String id){
- //TODO: implement
+ for (Widget widget : this.subElements) ((GdlVisibleObject)widget).registerButtonCallback(handler, id);
}
public void deregisterButtonCallback(ClickHandler handler, String id){
- // TODO: implement
+ for (Widget widget : this.subElements) ((GdlVisibleObject)widget).deregisterButtonCallback(handler, id);
}
@@ -69,6 +87,20 @@
}
+ // sets all GDL styles that are defined by the topic map representative.
+ // In contrast to visible-object, the styles are applied only on the main
+ // panel, since the view's sub-elements must be formatted with their own
+ // style properties
+ @Override
+ protected void setGdlStyle() throws InvalidGdlSchemaException, ExecutionException {
+ this.setDisplay(this.getDisplay());
+ this.setZindex(this.getZindex());
+ this.setFloat(this.getFloat());
+ this.setClear(this.getClear());
+ super.setGdlStyle(this);
+ }
+
+
// creates a GdlVisbleObject instance of the passed topic current and inserts it
// by using it's defined position style depending on the GdlVisibleObject
// represented by ancestor. If ancestor is null current is the first topic
@@ -88,7 +120,7 @@
this.subElements.add(newObj);
if(super.getTmRepresentative().equals(ancestor))this.mainPanel.add(newObj);
- else DOM.insertBefore(this.mainPanel.getElement(), newObj.getElement(), oldObj.getElement());
+ else this.mainPanel.insert(newObj, this.mainPanel.getWidgetIndex(oldObj) + 1);
position.setAttributes(newObj);
return newObj;
}
1
0

[isidorus-cvs] r621 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets: src/us/isidor/gdl/anaToMia/Widgets/base src/us/isidor/gdl/anaToMia/Widgets/text src/us/isidor/gdl/anaToMia/Widgets/view war/gdl_widgets
by lgiessmann@common-lisp.net 14 Jul '11
by lgiessmann@common-lisp.net 14 Jul '11
14 Jul '11
Author: lgiessmann
Date: Thu Jul 14 14:01:08 2011
New Revision: 621
Log:
gdl-frontend: Widgets: implemented positioning in GdlView instances
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.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
branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java Thu Jul 14 09:46:35 2011 (r620)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java Thu Jul 14 14:01:08 2011 (r621)
@@ -114,10 +114,10 @@
public void setAttributes(Widget widget) throws InvalidGdlSchemaException{
if(widget == null) return;
- DOM.setStyleAttribute(widget.getElement(), "position", this.getPositionStyle().getCssValue());
+ if(this.getPositionStyle() != null) DOM.setStyleAttribute(widget.getElement(), "position", this.getPositionStyle().getCssValue());
if(this.getTop() != null) DOM.setStyleAttribute(widget.getElement(), "top", this.getTop().getCssValue());
- if(this.getRight() != null) DOM.setStyleAttribute(widget.getElement(), "right", this.getTop().getCssValue());
- if(this.getBottom() != null) DOM.setStyleAttribute(widget.getElement(), "bottom", this.getTop().getCssValue());
- if(this.getLeft() != null) DOM.setStyleAttribute(widget.getElement(), "left", this.getTop().getCssValue());
+ if(this.getRight() != null) DOM.setStyleAttribute(widget.getElement(), "right", this.getRight().getCssValue());
+ if(this.getBottom() != null) DOM.setStyleAttribute(widget.getElement(), "bottom", this.getBottom().getCssValue());
+ if(this.getLeft() != null) DOM.setStyleAttribute(widget.getElement(), "left", this.getLeft().getCssValue());
}
}
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 Jul 14 09:46:35 2011 (r620)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Thu Jul 14 14:01:08 2011 (r621)
@@ -63,6 +63,7 @@
// a helper method to return any identifier string of the topic
public static String getAnyIdOfTopic(Topic topic){
+ if(topic == null) return "";
if(topic.getSubjectIdentifiers().length() != 0){
return topic.getSubjectIdentifiers().get(0).getReference();
}else if(topic.getSubjectLocators().length() != 0) {
@@ -109,15 +110,15 @@
// returns true if the topic instance if an instance of the topic type
public static boolean isInstanceOf(Topic instance, Topic type){
- if(instance == null || type == null) return false;
+ if(instance == null || (instance.getTypes().length() != 0 && type == null)) return false;
+ if(instance.getTypes().length() == 0 && type == null) return true;
JsArray<Topic> types = instance.getTypes();
for(int i = 0; i != types.length(); ++i){
ArrayList<Topic> superTypes = getAllSuperTypes(types.get(i), null);
- superTypes.add(types.get(i));
+ superTypes.add(types.get(i));
if(superTypes.contains(type)) return true;
- }
-
+ }
return false;
}
@@ -128,7 +129,7 @@
ArrayList<Topic> localCollectedSuperTypes = new ArrayList<Topic>();
if(collectedSupertypes != null) localCollectedSuperTypes = collectedSupertypes;
-
+
ArrayList<Topic> direcSupertypes = getDirectSuperTypes(top);
for (Topic topic : localCollectedSuperTypes) direcSupertypes.remove(topic); //avoid duplicates
for (Topic topic : direcSupertypes)localCollectedSuperTypes.add(topic);
@@ -142,8 +143,7 @@
for (Topic collectedIndirectSupertype : collectedIndirectSupertypes)
if(!localCollectedSuperTypes.contains(collectedIndirectSupertype)) localCollectedSuperTypes.add(collectedIndirectSupertype);
-
-
+
return localCollectedSuperTypes;
}
@@ -169,7 +169,7 @@
// returns true if a corresponding association exists
- public static boolean hasAssociation(Topic thisTopic, Topic thisRoleType, Topic assocType, Topic otherPlayer, Topic otherRoleType){
+ public static boolean hasBinaryAssociation(Topic thisTopic, Topic thisRoleType, Topic assocType, Topic otherPlayer, Topic otherRoleType){
if(thisTopic == null || thisRoleType == null || assocType == null || otherPlayer == null || otherRoleType == null) return false;
JsArray<Role> roles = thisTopic.getRolesPlayed(thisRoleType, assocType);
@@ -234,13 +234,23 @@
for (Pair<Topic, Topic> pair : rolePlayertypesAndTypes) {
JsArray<Role> selection = assoc.getRoles(pair.getSecond());
int i = 0;
- for(; i != selection.length(); ++i){
+ for(; i != selection.length(); ++i)
if(isInstanceOf(selection.get(i).getPlayer(), pair.getFirst())) break;
- }
if(i == selection.length()) return false;
}
+ // check the reverse way => duplicates
+ JsArray<Role> roles = assoc.getRoles();
+ for(int i = 0; i != roles.length(); ++i){
+ Role currentRole = roles.get(i);
+ int j = 0;
+ for(; j != rolePlayertypesAndTypes.size(); ++j)
+ if(currentRole.getType().equals(rolePlayertypesAndTypes.get(j).getSecond()) && isInstanceOf(currentRole.getPlayer(), rolePlayertypesAndTypes.get(j).getFirst())) break;
+
+ if(j == rolePlayertypesAndTypes.size()) return false;
+ }
+
return true;
}
@@ -251,7 +261,7 @@
ScopedStub scoped = (ScopedStub)construct;
if(scoped.getScope().length() != 0 && (themes == null || themes.size() == 0)) return false;
- if(scoped.getScope().length() != themes.size()) return false;
+ if(themes != null && scoped.getScope().length() != themes.size()) return false;
for(int i = 0; i != scoped.getScope().length(); ++i){
if(!themes.contains(scoped.getScope().get(i))) return false;
@@ -285,21 +295,25 @@
// returns the associations that are bound to the topic "topic" and have the passed scope and roles
public static ArrayList<Association> getAssociationsOfTopic(Topic topic, Topic roleType, Topic assocType, ArrayList<Topic> scope, ArrayList<Pair<Topic, Topic>> rolePlayertypesAndTypes){
ArrayList<Association> result = new ArrayList<Association>();
- if(topic == null || assocType == null || rolePlayertypesAndTypes == null || rolePlayertypesAndTypes.size() == 0) return result;
+ if(topic == null || assocType == null || rolePlayertypesAndTypes == null) return result;
ArrayList<Association> allPotentialAssocs = new ArrayList<Association>();
for(int i = 0; i != topic.getRolesPlayed(roleType, assocType).length(); ++i) allPotentialAssocs.add(topic.getRolesPlayed(roleType, assocType).get(i).getParent());
ArrayList<Association> assocsWoScope = new ArrayList<Association>();
- for (Association assoc : allPotentialAssocs) if(hasRoles(assoc, rolePlayertypesAndTypes)) assocsWoScope.add(assoc);
-
+ ArrayList<Pair<Topic, Topic>> localRolePlayertypesAndTypes = rolePlayertypesAndTypes;
+ Topic typeOfTopic = topic.getTypes().length() != 0 ? topic.getTypes().get(0) : null;
+ localRolePlayertypesAndTypes.add(new Pair<Topic, Topic>(typeOfTopic, roleType));
+
+ for (Association assoc : allPotentialAssocs) if(hasRoles(assoc, localRolePlayertypesAndTypes)) assocsWoScope.add(assoc);
+
for (Association assoc : assocsWoScope) if(hasThemes(assoc, scope)) result.add(assoc);
return result;
}
- // returns all topics that are related to the passed topic via a contains assciation
+ // returns all topics that are related to the passed topic via a contains association
public static ArrayList<Topic> topicContains(Topic container) {
if(container == null) return new ArrayList<Topic>();
@@ -312,60 +326,69 @@
}
- // returns the topic that represetns the first item of a container, that means this item is
- // not bound to an association o fthe type position in a role of the type descendant
+ // returns the topic that represents the first item of a container, that means this item is
+ // bound to the container via a position association and plays the role descendant, whereas
+ // the container plays the role ancestor
public static Topic getFirstContainee(Topic container, ArrayList<Topic> containees) throws InvalidGdlSchemaException {
if(containees == null || containees.size() == 0 || container == null) return null;
- ArrayList<Topic> topicsWithoutAncestor = new ArrayList<Topic>();
TopicMap tm = containees.get(0).getTopicMap();
Topic descendantRoleType = getTopicByPsi(GdlPsis.RoleType.gdlDescendant, tm);
- Topic position = getTopicByPsi(GdlPsis.AssociationType.gdlPosition, tm);
+ Topic positionAssocType = getTopicByPsi(GdlPsis.AssociationType.gdlPosition, tm);
+ Topic position = getTopicByPsi(GdlPsis.TopicType.gdlPosition, tm);
Topic visibleObject = getTopicByPsi(GdlPsis.TopicType.gdlVisibleObject, tm);
Topic ancestorRoleType = getTopicByPsi(GdlPsis.RoleType.gdlAncestor, tm);
- for (Topic containee : containees){
- ArrayList<Topic> ancestors = getOtherPlayerOfBinaryAssociation(containee, descendantRoleType, position, null, visibleObject, ancestorRoleType);
- if(ancestors.size() != 1){
- String top = getAnyIdOfTopic(container);
- String bindings = "";
- for (Topic topic : ancestors) bindings += ", " + getAnyIdOfTopic(topic);
- if(bindings.length() == 0) bindings = "[]";
- else bindings = bindings.substring(2);
- throw new InvalidGdlSchemaException("the topic " + top + " must be boundto exaclty one ancestor element, but found " + bindings);
- } else {
- if(ancestors.get(0).equals(container))topicsWithoutAncestor.add(containee);
+ Topic descriptorRoleType = getTopicByPsi(GdlPsis.RoleType.gdlDescriptor, tm);
+
+ ArrayList<Pair<Topic, Topic>> rolePlayertypesAndTypes = new ArrayList<Pair<Topic,Topic>>();
+ rolePlayertypesAndTypes.add(new Pair<Topic, Topic>(visibleObject, descendantRoleType));
+ rolePlayertypesAndTypes.add(new Pair<Topic, Topic>(position, descriptorRoleType));
+ ArrayList<Association> descendantAssocsOfContainer = TmHelper.getAssociationsOfTopic(container, ancestorRoleType, positionAssocType, null, rolePlayertypesAndTypes);
+
+ ArrayList<Topic> validDescendants = new ArrayList<Topic>();
+ for (Association descendantAssociation : descendantAssocsOfContainer) {
+ JsArray<Role> descendantRoles = descendantAssociation.getRoles(descendantRoleType);
+ for(int i = 0; i != descendantRoles.length(); ++i){
+ Topic player = descendantRoles.get(i).getPlayer();
+ if(isInstanceOf(player, visibleObject) && !validDescendants.contains(player)) validDescendants.add(player);
}
}
-
- if(topicsWithoutAncestor.size() > 1){
- String values = "";
- for (Topic topic : topicsWithoutAncestor) values += ", " + getAnyIdOfTopic(topic);
- if(values.length() >= 2) values = values.substring(2);
- throw new InvalidGdlSchemaException("only one topic can be set as the start element of a container, but found: " + values);
- } else if(topicsWithoutAncestor.size() == 1){
- return topicsWithoutAncestor.get(0);
- } else {
- return null;
+
+ if(validDescendants.size() != 1){
+ String top = getAnyIdOfTopic(container);
+ String bindings = "";
+ for (Topic topic : validDescendants) bindings += ", " + getAnyIdOfTopic(topic);
+ if(bindings.length() == 0) bindings = "[]";
+ else bindings = bindings.substring(2);
+ throw new InvalidGdlSchemaException("the topic " + top + " must be bound to exaclty one ancestor element, but found " + bindings);
+ }else {
+ return validDescendants.get(0);
}
}
// returns the descendant of the current topic related via an contains association
- public static Topic getNextContainer(Topic current, ArrayList<Topic> containees) throws InvalidGdlSchemaException{
+ public static Topic getNextContainee(Topic current, ArrayList<Topic> containees) throws InvalidGdlSchemaException{
if (current == null || containees == null || containees.size() == 0) return null;
TopicMap tm = current.getTopicMap();
- Topic descendant = getTopicByPsi(GdlPsis.RoleType.gdlDescendant, tm);
- Topic position = getTopicByPsi(GdlPsis.AssociationType.gdlPosition, tm);
+ Topic descendantRoleType = getTopicByPsi(GdlPsis.RoleType.gdlDescendant, tm);
+ Topic positionAssocType = getTopicByPsi(GdlPsis.AssociationType.gdlPosition, tm);
Topic visibleObject = getTopicByPsi(GdlPsis.TopicType.gdlVisibleObject, tm);
- Topic ancestor = getTopicByPsi(GdlPsis.RoleType.gdlAncestor, tm);
- ArrayList<Topic> descendants = getOtherPlayerOfBinaryAssociation(current, ancestor, position, null, visibleObject, descendant);
+ Topic ancestorRoleType = getTopicByPsi(GdlPsis.RoleType.gdlAncestor, tm);
+ Topic position = getTopicByPsi(GdlPsis.TopicType.gdlPosition, tm);
+ Topic descriptorRoleType = getTopicByPsi(GdlPsis.RoleType.gdlDescriptor, tm);
+ ArrayList<Pair<Topic, Topic>> rolePlayertypesAndTypes = new ArrayList<Pair<Topic,Topic>>();
+ rolePlayertypesAndTypes.add(new Pair<Topic, Topic>(visibleObject, descendantRoleType));
+ rolePlayertypesAndTypes.add(new Pair<Topic, Topic>(position, descriptorRoleType));
+ ArrayList<Association> positionAssocs = getAssociationsOfTopic(current, ancestorRoleType, positionAssocType, null, rolePlayertypesAndTypes);
ArrayList<Topic> descendantsContainedInContainees = new ArrayList<Topic>();
- for (Topic topic : descendants)
- if(containees.contains(topic) && !descendantsContainedInContainees.contains(topic)) descendantsContainedInContainees.add(topic);
-
-
+ for (Association assoc : positionAssocs) {
+ Role role = assoc.getRoles(descendantRoleType).get(0); // it is ensured that exaclty one role is existent, due to getAssociationsOfTopic
+ if(containees.contains(role.getPlayer()) && !descendantsContainedInContainees.contains(role.getPlayer())) descendantsContainedInContainees.add(role.getPlayer());
+ }
+
if(descendantsContainedInContainees.size() > 1){
String top = getAnyIdOfTopic(current);
String bindings = "";
@@ -388,30 +411,31 @@
// get all potential valid associations that models a position association
TopicMap tm = ancestor.getTopicMap();
Topic ancestorRoleType = getTopicByPsi(GdlPsis.RoleType.gdlAncestor, tm);
- Topic position = getTopicByPsi(GdlPsis.AssociationType.gdlPosition, tm);
+ Topic positionAssocType = getTopicByPsi(GdlPsis.AssociationType.gdlPosition, tm);
ArrayList<Pair<Topic, Topic>> rolePlayertypesAndTypes = new ArrayList<Pair<Topic,Topic>>();
- Topic descriptor = getTopicByPsi(GdlPsis.RoleType.gdlDescendant, tm);
+ Topic descriptor = getTopicByPsi(GdlPsis.RoleType.gdlDescriptor, tm);
Topic descendantRoleType = getTopicByPsi(GdlPsis.RoleType.gdlDescendant, tm);
Topic visibleObject = getTopicByPsi(GdlPsis.TopicType.gdlVisibleObject, tm);
+ Topic position = getTopicByPsi(GdlPsis.TopicType.gdlPosition, tm);
rolePlayertypesAndTypes.add(new Pair<Topic, Topic>(position, descriptor));
rolePlayertypesAndTypes.add(new Pair<Topic, Topic>(visibleObject, descendantRoleType));
- ArrayList<Association> posAssocs = getAssociationsOfTopic(ancestor, ancestorRoleType, position, null, rolePlayertypesAndTypes);
+ ArrayList<Association> posAssocs = getAssociationsOfTopic(ancestor, ancestorRoleType, positionAssocType, null, rolePlayertypesAndTypes);
if(posAssocs.size() != 1){
String top1 = getAnyIdOfTopic(ancestor);
String top2 = getAnyIdOfTopic(descendant);
String bindings = "";
for (Association assoc : posAssocs)
- if(assoc.getRoles(position).length() != 0)
- for(int i = 0; i != assoc.getRoles(position).length(); ++i)
- bindings += ", " + getAnyIdOfTopic(assoc.getRoles(position).get(i).getPlayer());
+ if(assoc.getRoles(descriptor).length() != 0)
+ for(int i = 0; i != assoc.getRoles(descriptor).length(); ++i)
+ bindings += ", " + getAnyIdOfTopic(assoc.getRoles(descriptor).get(i).getPlayer());
if(bindings.length() == 0) bindings = "[]";
else bindings = bindings.substring(2);
throw new InvalidGdlSchemaException("the topics " + top1 + " and " + top2 + " must be bound to exaclty one position topic, but is bound to " + bindings);
}else {
ArrayList<Topic> positions = new ArrayList<Topic>();
for (Association assoc : posAssocs) {
- JsArray<Role> validRoles = assoc.getRoles(position);
+ JsArray<Role> validRoles = assoc.getRoles(descriptor);
for(int i = 0; i != validRoles.length(); ++i)
if(isInstanceOf(validRoles.get(i).getPlayer(), position) && !positions.contains(validRoles.get(i).getPlayer())) positions.add(validRoles.get(i).getPlayer());
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 Jul 14 09:46:35 2011 (r620)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java Thu Jul 14 14:01:08 2011 (r621)
@@ -62,7 +62,6 @@
super(tmRepresentative);
// TODO: create a Title element for each TM-elem
this.createTitle();
- this.createTitle();
}
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 Jul 14 09:46:35 2011 (r620)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java Thu Jul 14 14:01:08 2011 (r621)
@@ -6,10 +6,7 @@
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Widget;
-
-import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Name;
-import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Role;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
import us.isidor.gdl.anaToMia.Widgets.base.GdlPosition;
@@ -33,6 +30,15 @@
public GdlView(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
super(tmRepresentative);
+ ArrayList<Topic> objectsContained = this.contains();
+
+ Topic currentTopic = this.getStartElement(objectsContained);
+ Topic lastTopic = super.getTmRepresentative();
+ while(currentTopic != null){
+ this.append(lastTopic, currentTopic);
+ lastTopic = currentTopic;
+ currentTopic = TmHelper.getNextContainee(currentTopic, objectsContained);
+ }
}
@@ -58,30 +64,8 @@
// Searches the topic that represents the first item that is placed within this view instance
// i.e. such an item must not have an association that is bound to it via a role of the type
// gdl:ancestor.
- protected Topic getStartElement() throws InvalidGdlSchemaException {
- JsArray<Role> roles = this.tmRepresentative.getRolesPlayed(this.tm.getTopicBySubjectIdentifier(tm.createLocator(GdlPsis.RoleType.gdlContainer)), this.tm.getTopicBySubjectIdentifier(tm.createLocator(GdlPsis.AssociationType.gdlContains)));
- for(int i = 0; i != roles.length(); ++i){
- Association assoc = roles.get(i).getParent();
- JsArray<Role> assocRoles = assoc.getRoles(this.tm.getTopicBySubjectIdentifier(this.tm.createLocator(GdlPsis.RoleType.gdlContainee)));
- ArrayList<Topic> topsWithoutAncestorPosAssoc = new ArrayList<Topic>();
- for(int j = 0; j != assocRoles.length(); ++j){
- Topic player = assocRoles.get(j).getPlayer();
- if(player.getRolesPlayed(this.tm.getTopicBySubjectIdentifier(this.tm.createLocator(GdlPsis.RoleType.gdlAncestor)), this.tm.getTopicBySubjectIdentifier(this.tm.createLocator(GdlPsis.AssociationType.gdlPosition))).length() == 0){
- topsWithoutAncestorPosAssoc.add(player);
- }
- }
- if(topsWithoutAncestorPosAssoc.size() > 1){
- String foundTops = "";
- for (Topic topic : topsWithoutAncestorPosAssoc) {
- foundTops += TmHelper.getAnyIdOfTopic(topic) + ", ";
- }
- if(foundTops.length() >= 2)foundTops = foundTops.substring(0, foundTops.length() - 2);
- throw new InvalidGdlSchemaException("A " + GdlPsis.TopicType.gdlView + " must have maximal one item that is desiganted to tbe the first item in this view, i.e. there must be zero or one items without being bound to a " + GdlPsis.RoleType.gdlAncestor + " but found: " + foundTops);
- } else if(topsWithoutAncestorPosAssoc.size() == 1){
- return topsWithoutAncestorPosAssoc.get(0);
- }
- }
- return null;
+ protected Topic getStartElement(ArrayList<Topic> containees) throws InvalidGdlSchemaException {
+ return TmHelper.getFirstContainee(super.getTmRepresentative(), containees);
}
@@ -102,9 +86,10 @@
}
}
- if(this.getTmRepresentative().equals(ancestor))this.mainPanel.add(newObj);
+ this.subElements.add(newObj);
+ if(super.getTmRepresentative().equals(ancestor))this.mainPanel.add(newObj);
else DOM.insertBefore(this.mainPanel.getElement(), newObj.getElement(), oldObj.getElement());
- position.setAttributes(newObj);
+ position.setAttributes(newObj);
return newObj;
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm Thu Jul 14 09:46:35 2011 (r620)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm Thu Jul 14 14:01:08 2011 (r621)
@@ -32,10 +32,10 @@
{"subject_identifiers":["[gdl:Title]"]},
{"subject_identifiers":["[gdl:Reference]"]},
{"subject_identifiers":["[gdl:List-Box]"]},
- {"subject_identifiers":["[doc:text-1]"], "instance_of":["si:[gdl:Text]"]},
- {"subject_identifiers":["[doc:title-1]"], "instance_of":["si:[gdl:Title]"]},
- {"subject_identifiers":["[doc:reference-1]"], "instance_of":["si:[gdl:Reference]"]},
- {"subject_identifiers":["[doc:list-box-1]"], "instance_of":["si:[gdl:List-Box]"]},
+ {"subject_identifiers":["[doc:text-1]"], "instance_of":["si:[gdl:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"text_1_id", "datatype":"[xsd:ID]"}]},
+ {"subject_identifiers":["[doc:title-1]"], "instance_of":["si:[gdl:Title]"], "occurrences":[{"type":"si:[gdl:id]", "value":"title_1_id", "datatype":"[xsd:ID]"}]},
+ {"subject_identifiers":["[doc:reference-1]"], "instance_of":["si:[gdl:Reference]"], "occurrences":[{"type":"si:[gdl:id]", "value":"reference_1_id", "datatype":"[xsd:ID]"}]},
+ {"subject_identifiers":["[doc:list-box-1]"], "instance_of":["si:[gdl:List-Box]"], "occurrences":[{"type":"si:[gdl:id]", "value":"list_box_1_id", "datatype":"[xsd:ID]"}]},
{"subject_identifiers":["[gdl:Value]"], "instance_of":["si:[tmcl:topic-type]"]},
{"subject_identifiers":["[doc:pos-of-title-1]"], "instance_of":["si:[gdl:Position]"]},
{"subject_identifiers":["[doc:pos-of-text-1]"], "instance_of":["si:[gdl:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"relative"}, {"type":"si:[gdl:top]", "value":"40px"}, {"type":"si:[gdl:left]", "value": "5%"}]},
1
0

[isidorus-cvs] r620 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets
by lgiessmann@common-lisp.net 14 Jul '11
by lgiessmann@common-lisp.net 14 Jul '11
14 Jul '11
Author: lgiessmann
Date: Thu Jul 14 09:46:35 2011
New Revision: 620
Log:
gdl-frontend: Widgets: extended the test gdl xml file
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm Thu Jul 14 08:41:08 2011 (r619)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm Thu Jul 14 09:46:35 2011 (r620)
@@ -16,14 +16,36 @@
{"subject_identifiers":["[gdl:contains]"], "instance_of":["si:[tmcl:association-type]"]},
{"subject_identifiers":["[gdl:container]"], "instance_of":["si:[tmcl:role-type]"]},
{"subject_identifiers":["[gdl:containee]"], "instance_of":["si:[tmcl:role-type]"]},
+ {"subject_identifiers":["[gdl:ancestor]"], "instance_of":["si:[tmcl:role-type]"]},
+ {"subject_identifiers":["[gdl:descendant]"], "instance_of":["si:[tmcl:role-type]"]},
{"subject_identifiers":["[gdl:Schema]"], "instance_of":["si:[tmcl:topic-type]"]},
{"subject_identifiers":["[gdl:schema-name]"], "instance_of":["si:[tmcl:name-type]"]},
{"subject_identifiers":["[gdl:view-name]"], "instance_of":["si:[tmcl:name-type]"]},
{"subject_identifiers":["[gdl:Descriptor]"], "instance_of":["si:[tmcl:topic-type]"]},
{"subject_identifiers":["[doc:test-schema]"], "instance_of":["si:[gdl:Schema]"], "names":[{"value": "Test GDL Schema", "type":"si:[gdl:schema-name]"}]},
{"subject_identifiers":["[gdl:Visible-Object]"]},
+ {"subject_identifiers":["[gdl:Text-Object]"]},
+ {"subject_identifiers":["[gdl:Position]"]},
+ {"subject_identifiers":["[gdl:position]"], "instance_of":["si:[tmcl:association-type]"]},
{"subject_identifiers":["[gdl:View]"]},
+ {"subject_identifiers":["[gdl:Text]"]},
+ {"subject_identifiers":["[gdl:Title]"]},
+ {"subject_identifiers":["[gdl:Reference]"]},
+ {"subject_identifiers":["[gdl:List-Box]"]},
+ {"subject_identifiers":["[doc:text-1]"], "instance_of":["si:[gdl:Text]"]},
+ {"subject_identifiers":["[doc:title-1]"], "instance_of":["si:[gdl:Title]"]},
+ {"subject_identifiers":["[doc:reference-1]"], "instance_of":["si:[gdl:Reference]"]},
+ {"subject_identifiers":["[doc:list-box-1]"], "instance_of":["si:[gdl:List-Box]"]},
{"subject_identifiers":["[gdl:Value]"], "instance_of":["si:[tmcl:topic-type]"]},
+ {"subject_identifiers":["[doc:pos-of-title-1]"], "instance_of":["si:[gdl:Position]"]},
+ {"subject_identifiers":["[doc:pos-of-text-1]"], "instance_of":["si:[gdl:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"relative"}, {"type":"si:[gdl:top]", "value":"40px"}, {"type":"si:[gdl:left]", "value": "5%"}]},
+ {"subject_identifiers":["[doc:pos-of-reference-1]"], "instance_of":["si:[gdl:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"static"}]},
+ {"subject_identifiers":["[doc:pos-of-list-box-1]"], "instance_of":["si:[gdl:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:bottom]", "value":"5px"}, {"type":"si:[gdl:right]", "value":"5px"}]},
+ {"subject_identifiers":["[gdl:position-style]"], "instance_of":["si:[tmcl:occurrence-type]"]},
+ {"subject_identifiers":["[gdl:top]"], "instance_of":["si:[tmcl:occurrence-type]"]},
+ {"subject_identifiers":["[gdl:right]"], "instance_of":["si:[tmcl:occurrence-type]"]},
+ {"subject_identifiers":["[gdl:bottom]"], "instance_of":["si:[tmcl:occurrence-type]"]},
+ {"subject_identifiers":["[gdl:left]"], "instance_of":["si:[tmcl:occurrence-type]"]},
{"subject_identifiers":["[gdl:TM-Value]"]},
{"subject_identifiers":["[gdl:TM-Instance-Value]"]},
{"subject_identifiers":["[gdl:TM-Multiple-Type-Value]"]},
@@ -44,12 +66,10 @@
{"subject_identifiers":["[gdl:Default-Creator-Topic-View]"]},
{"subject_identifiers":["[gdl:Default-Editor-Topic-View]"]},
{"subject_identifiers":["[gdl:Special-Creator-Topic-View]"]},
-
{"subject_identifiers":["[doc:default-creator-topic-view-1]"], "instance_of":["si:[gdl:Default-Creator-Topic-View]"], "names":[{"value": "Def. Creator View 1", "type":"si:[gdl:view-name]"}], "occurrences":[{"type":"si:[gdl:id]", "value":"default_creator_topic_view_1_id", "datatype":"[xsd:ID]"}]},
{"subject_identifiers":["[doc:default-creator-topic-view-2]"], "instance_of":["si:[gdl:Default-Creator-Topic-View]"], "names":[{"value": "Def. Creator View 2", "type":"si:[gdl:view-name]"}], "occurrences":[{"type":"si:[gdl:id]", "value":"default_creator_topic_view_2_id", "datatype":"[xsd:ID]"}]},
{"subject_identifiers":["[doc:default-editor-topic-view]"], "instance_of":["si:[gdl:Default-Editor-Topic-View]"], "names":[{"value": "Def. Editor View", "type":"si:[gdl:view-name]"}], "occurrences":[{"type":"si:[gdl:id]", "value":"default_editor_topic_view_id", "datatype":"[xsd:ID]"}]},
{"subject_identifiers":["[doc:special-creator-topic-view]"], "instance_of":["si:[gdl:Special-Creator-Topic-View]"], "names":[{"value": "Spec. Creator View", "type":"si:[gdl:view-name]"}], "occurrences":[{"type":"si:[gdl:id]", "value":"special_creator_topic_view_id", "datatype":"[xsd:ID]"}]},
-
{"subject_identifiers":["[doc:Poet]"], "instance_of":["si:[tmcl:topic-type]"]},
{"subject_identifiers":["[doc:Musician]"], "instance_of":["si:[tmcl:topic-type]"]},
{"subject_identifiers":["[doc:Director]"], "instance_of":["si:[tmcl:topic-type]"]}
@@ -62,13 +82,19 @@
{"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Default-Topic-View]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Default-Creator-Topic-View]"}]},
{"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Default-Topic-View]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Default-Editor-Topic-View]"}]},
{"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Special-Topic-View]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Special-Creator-Topic-View]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Value]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:TM-Value]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:TM-Value]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:TM-Instance-Value]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:TM-Value]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:TM-Multiple-Type-Value]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Visible-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Text-Object]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Position]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Text-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Text]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Text-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Title]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Text-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Reference]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Text-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:List-Box]"}]},
{"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:test-schema]"},{"type":"si:[gdl:containee]", "player":"si:[doc:default-creator-topic-view-1]"}]},
{"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:test-schema]"},{"type":"si:[gdl:containee]", "player":"si:[doc:default-creator-topic-view-2]"}]},
{"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:test-schema]"},{"type":"si:[gdl:containee]", "player":"si:[doc:default-editor-topic-view]"}]},
{"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:test-schema]"},{"type":"si:[gdl:containee]", "player":"si:[doc:special-creator-topic-view]"}]},
- {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Value]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:TM-Value]"}]},
- {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:TM-Value]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:TM-Instance-Value]"}]},
- {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:TM-Value]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:TM-Multiple-Type-Value]"}]},
{"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:instance-value]"}, {"type":"si:[gdl:tm-construct]", "player":"si:[doc:musician/John_Lennon]"}]},
{"type":"si:[gdl:topic-view-binding]", "roles":[{"type":"si:[gdl:tm-value]", "player":"si:[doc:instance-value]"}, {"type":"si:[gdl:descriptor]", "player":"si:[doc:default-editor-topic-view]"}]},
{"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:multi-type-value-1]"}, {"type":"si:[gdl:tm-construct]", "player":"si:[doc:Musician]"}]},
@@ -80,5 +106,13 @@
{"type":"si:[gdl:topic-view-binding]", "roles":[{"type":"si:[gdl:tm-value]", "player":"si:[doc:multi-type-value-2]"}, {"type":"si:[gdl:descriptor]", "player":"si:[doc:default-creator-topic-view-2]"}]},
{"type":"si:[gdl:topic-view-binding]", "roles":[{"type":"si:[gdl:tm-value]", "player":"si:[doc:multi-type-value-3]"}, {"type":"si:[gdl:descriptor]", "player":"si:[doc:special-creator-topic-view]"}]},
{"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:multi-type-value-3]"}, {"type":"si:[gdl:tm-construct]", "player":"si:[doc:Musician]"}]},
- {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:multi-type-value-3]"}, {"type":"si:[gdl:tm-construct]", "player":"si:[doc:Poet]"}]}
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:multi-type-value-3]"}, {"type":"si:[gdl:tm-construct]", "player":"si:[doc:Poet]"}]},
+ {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:default-creator-topic-view-1]"},{"type":"si:[gdl:containee]", "player":"si:[doc:title-1]"}]},
+ {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:default-creator-topic-view-1]"},{"type":"si:[gdl:containee]", "player":"si:[doc:text-1]"}]},
+ {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:default-creator-topic-view-1]"},{"type":"si:[gdl:containee]", "player":"si:[doc:reference-1]"}]},
+ {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:default-creator-topic-view-1]"},{"type":"si:[gdl:containee]", "player":"si:[doc:list-box-1]"}]},
+ {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:pos-of-title-1]"},{"type":"si:[gdl:ancestor]", "player":"si:[doc:default-creator-topic-view-1]"}, {"type":"si:[gdl:descendant]", "player":"si:[doc:title-1]"}]},
+ {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:pos-of-text-1]"},{"type":"si:[gdl:ancestor]", "player":"si:[doc:title-1]"}, {"type":"si:[gdl:descendant]", "player":"si:[doc:text-1]"}]},
+ {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:pos-of-reference-1]"},{"type":"si:[gdl:ancestor]", "player":"si:[doc:text-1]"}, {"type":"si:[gdl:descendant]", "player":"si:[doc:reference-1]"}]},
+ {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:pos-of-list-box-1]"},{"type":"si:[gdl:ancestor]", "player":"si:[doc:reference-1]"}, {"type":"si:[gdl:descendant]", "player":"si:[doc:list-box-1]"}]}
]}
\ No newline at end of file
1
0

[isidorus-cvs] r619 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base container value view
by lgiessmann@common-lisp.net 14 Jul '11
by lgiessmann@common-lisp.net 14 Jul '11
14 Jul '11
Author: lgiessmann
Date: Thu Jul 14 08:41:08 2011
New Revision: 619
Log:
gdl-frontend: Widgets: implemented positioning of elements placed within GdlView instances
Added:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/value/PositionStyleValue.java
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/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/view/GdlView.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java Thu Jul 14 05:05:36 2011 (r618)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java Thu Jul 14 08:41:08 2011 (r619)
@@ -3,6 +3,8 @@
import java.util.ArrayList;
import com.google.gwt.core.client.JsArray;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
@@ -107,4 +109,15 @@
throw new InvalidGdlSchemaException("a position style value must be one of static, relative or absolute, but is " + positionStyleOcc.getValue());
}
}
+
+
+ public void setAttributes(Widget widget) throws InvalidGdlSchemaException{
+ if(widget == null) return;
+
+ DOM.setStyleAttribute(widget.getElement(), "position", this.getPositionStyle().getCssValue());
+ if(this.getTop() != null) DOM.setStyleAttribute(widget.getElement(), "top", this.getTop().getCssValue());
+ if(this.getRight() != null) DOM.setStyleAttribute(widget.getElement(), "right", this.getTop().getCssValue());
+ if(this.getBottom() != null) DOM.setStyleAttribute(widget.getElement(), "bottom", this.getTop().getCssValue());
+ if(this.getLeft() != null) DOM.setStyleAttribute(widget.getElement(), "left", this.getTop().getCssValue());
+ }
}
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 Jul 14 05:05:36 2011 (r618)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java Thu Jul 14 08:41:08 2011 (r619)
@@ -377,7 +377,7 @@
@Override
- public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException {
+ public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException, ExecutionException {
// TODO Auto-generated method stub
return null;
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 Jul 14 05:05:36 2011 (r618)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java Thu Jul 14 08:41:08 2011 (r619)
@@ -1253,7 +1253,7 @@
@Override
- public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException {
+ public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException, ExecutionException {
// TODO: implement
return null;
}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/value/PositionStyleValue.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/value/PositionStyleValue.java Thu Jul 14 08:41:08 2011 (r619)
@@ -0,0 +1,14 @@
+package us.isidor.gdl.anaToMia.Widgets.value;
+
+public enum PositionStyleValue implements CssValue{
+ STATIC,
+ RELATIVE,
+ ABSOLUTE;
+
+
+ @Override
+ public String getCssValue() {
+ return this.toString().toLowerCase();
+ }
+
+}
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 Jul 14 05:05:36 2011 (r618)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java Thu Jul 14 08:41:08 2011 (r619)
@@ -4,18 +4,22 @@
import com.google.gwt.core.client.JsArray;
import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Name;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Role;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlPosition;
import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.IGdlContainer;
import us.isidor.gdl.anaToMia.Widgets.base.IGdlHasValue;
import us.isidor.gdl.anaToMia.Widgets.base.TmHelper;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.GdlInstantiator;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
@@ -85,13 +89,23 @@
// by using it's defined position style depending on the GdlVisibleObject
// represented by ancestor. If ancestor is null current is the first topic
@Override
- public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException {
- // TODO: getFirstContainee => change the behavior of getting the first topic
+ public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException, ExecutionException {
+ 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));
- // TODO: implement
-
+ GdlVisibleObject newObj = GdlInstantiator.instantiate(current);
+ GdlVisibleObject oldObj = null;
+ for (Widget widget : super.subElements){
+ if(((GdlVisibleObject)widget).getTmRepresentative().equals(ancestor)){
+ oldObj = (GdlVisibleObject)widget;
+ break;
+ }
+ }
- return null;
+ if(this.getTmRepresentative().equals(ancestor))this.mainPanel.add(newObj);
+ else DOM.insertBefore(this.mainPanel.getElement(), newObj.getElement(), oldObj.getElement());
+ position.setAttributes(newObj);
+ return newObj;
}
1
0

[isidorus-cvs] r618 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base
by lgiessmann@common-lisp.net 14 Jul '11
by lgiessmann@common-lisp.net 14 Jul '11
14 Jul '11
Author: lgiessmann
Date: Thu Jul 14 05:05:36 2011
New Revision: 618
Log:
gdl-frontend: Widgets: implemented the class GdlPosition that wraps a topic of the type gdl:Position
Added:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlContainer.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java Thu Jul 14 05:05:36 2011 (r618)
@@ -0,0 +1,110 @@
+package us.isidor.gdl.anaToMia.Widgets.base;
+
+import java.util.ArrayList;
+
+import com.google.gwt.core.client.JsArray;
+
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
+import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.value.AutoNumUnitValue;
+import us.isidor.gdl.anaToMia.Widgets.value.PositionStyleValue;
+
+
+public class GdlPosition implements GdlDescriptor {
+ private Topic tmRepresentative = null;
+
+
+ @SuppressWarnings("unused")
+ private GdlPosition(){}
+
+
+ public GdlPosition(Topic tmRepresentative){
+ this.tmRepresentative = tmRepresentative;
+ }
+
+
+ // a helper method that returns all occurrences of the type bound to the passed PSI
+ private JsArray<Occurrence> getOccurrences(String occurrenceType){
+ TopicMap tm = this.tmRepresentative.getTopicMap();
+ Topic occType = tm.getTopicBySubjectIdentifier(tm.createLocator(occurrenceType));
+ if(occType == null) return null;
+ else return tmRepresentative.getOccurrences(occType);
+ }
+
+
+ // a helper method that returns one occurrence of the type bound to the passed PSI.
+ // If more than one occurrence is available an InvalidGdlSchemaException is thrown.
+ // If nor occurrence is available the return value is null
+ private Occurrence getNoneOrOneUnscopedOccurrence(String occurrenceType) throws InvalidGdlSchemaException{
+ JsArray<Occurrence> occs = getOccurrences(occurrenceType);
+ ArrayList<Occurrence> unscopedOccs = new ArrayList<Occurrence>();
+ for(int i = 0; i != occs.length(); ++i){
+ if(occs.get(i).getScope().length() == 0) unscopedOccs.add(occs.get(i));
+ }
+
+ if(unscopedOccs.size() > 1){
+ throw new InvalidGdlSchemaException("The topic " + TmHelper.getAnyIdOfTopic(this.tmRepresentative) + " must be bound to none or one unscoped occurrence of the type " + occurrenceType + ", but is bound " + unscopedOccs.size() + " times to it");
+ } else if(unscopedOccs.size() == 1){
+ return unscopedOccs.get(0);
+ } else {
+ return null;
+ }
+ }
+
+
+ @Override
+ public Topic getTmRepresentative() {
+ return this.tmRepresentative;
+ }
+
+
+ public AutoNumUnitValue getTop() throws InvalidGdlSchemaException {
+ Occurrence topOcc = null;
+ topOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlTop);
+
+ if(topOcc == null) return null;
+ else return new AutoNumUnitValue(topOcc.getValue());
+ }
+
+
+ public AutoNumUnitValue getRight() throws InvalidGdlSchemaException {
+ Occurrence rightOcc = null;
+ rightOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlRight);
+
+ if(rightOcc == null) return null;
+ else return new AutoNumUnitValue(rightOcc.getValue());
+ }
+
+
+ public AutoNumUnitValue getBottom() throws InvalidGdlSchemaException {
+ Occurrence bottomOcc = null;
+ bottomOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBottom);
+
+ if(bottomOcc == null) return null;
+ else return new AutoNumUnitValue(bottomOcc.getValue());
+ }
+
+
+ public AutoNumUnitValue getLeft() throws InvalidGdlSchemaException {
+ Occurrence leftOcc = null;
+ leftOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlLeft);
+
+ if(leftOcc == null) return null;
+ else return new AutoNumUnitValue(leftOcc.getValue());
+ }
+
+
+ public PositionStyleValue getPositionStyle()throws InvalidGdlSchemaException {
+ Occurrence positionStyleOcc = null;
+ positionStyleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlPositionStyle);
+
+ if(positionStyleOcc == null) return null;
+ else try{
+ return PositionStyleValue.valueOf(positionStyleOcc.getValue().toUpperCase());
+ }catch(IllegalArgumentException e){
+ throw new InvalidGdlSchemaException("a position style value must be one of static, relative or absolute, but is " + positionStyleOcc.getValue());
+ }
+ }
+}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlContainer.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlContainer.java Thu Jul 14 02:42:52 2011 (r617)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlContainer.java Thu Jul 14 05:05:36 2011 (r618)
@@ -1,11 +1,13 @@
package us.isidor.gdl.anaToMia.Widgets.base;
import java.util.ArrayList;
+
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
public interface IGdlContainer {
- public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException;
+ public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException, ExecutionException;
public ArrayList<Topic> contains() throws InvalidGdlSchemaException;
}
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 Jul 14 02:42:52 2011 (r617)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Thu Jul 14 05:05:36 2011 (r618)
@@ -378,4 +378,56 @@
return null;
}
}
+
+
+ // returns the topic that represents the position between the ancestor
+ // and descendant topics
+ public static Topic getPositionOf(Topic ancestor, Topic descendant) throws InvalidGdlSchemaException {
+ if(ancestor == null || descendant == null) return null;
+
+ // get all potential valid associations that models a position association
+ TopicMap tm = ancestor.getTopicMap();
+ Topic ancestorRoleType = getTopicByPsi(GdlPsis.RoleType.gdlAncestor, tm);
+ Topic position = getTopicByPsi(GdlPsis.AssociationType.gdlPosition, tm);
+ ArrayList<Pair<Topic, Topic>> rolePlayertypesAndTypes = new ArrayList<Pair<Topic,Topic>>();
+ Topic descriptor = getTopicByPsi(GdlPsis.RoleType.gdlDescendant, tm);
+ Topic descendantRoleType = getTopicByPsi(GdlPsis.RoleType.gdlDescendant, tm);
+ Topic visibleObject = getTopicByPsi(GdlPsis.TopicType.gdlVisibleObject, tm);
+ rolePlayertypesAndTypes.add(new Pair<Topic, Topic>(position, descriptor));
+ rolePlayertypesAndTypes.add(new Pair<Topic, Topic>(visibleObject, descendantRoleType));
+ ArrayList<Association> posAssocs = getAssociationsOfTopic(ancestor, ancestorRoleType, position, null, rolePlayertypesAndTypes);
+
+ if(posAssocs.size() != 1){
+ String top1 = getAnyIdOfTopic(ancestor);
+ String top2 = getAnyIdOfTopic(descendant);
+ String bindings = "";
+ for (Association assoc : posAssocs)
+ if(assoc.getRoles(position).length() != 0)
+ for(int i = 0; i != assoc.getRoles(position).length(); ++i)
+ bindings += ", " + getAnyIdOfTopic(assoc.getRoles(position).get(i).getPlayer());
+ if(bindings.length() == 0) bindings = "[]";
+ else bindings = bindings.substring(2);
+ throw new InvalidGdlSchemaException("the topics " + top1 + " and " + top2 + " must be bound to exaclty one position topic, but is bound to " + bindings);
+ }else {
+ ArrayList<Topic> positions = new ArrayList<Topic>();
+ for (Association assoc : posAssocs) {
+ JsArray<Role> validRoles = assoc.getRoles(position);
+ for(int i = 0; i != validRoles.length(); ++i)
+ if(isInstanceOf(validRoles.get(i).getPlayer(), position) && !positions.contains(validRoles.get(i).getPlayer())) positions.add(validRoles.get(i).getPlayer());
+
+ }
+
+ if(positions.size() != 1){
+ String top1 = getAnyIdOfTopic(ancestor);
+ String top2 = getAnyIdOfTopic(descendant);
+ String bindings = "";
+ for (Topic pos : positions) bindings += ", " + getAnyIdOfTopic(pos);
+ if(bindings.length() == 0) bindings = "[]";
+ else bindings = bindings.substring(2);
+ throw new InvalidGdlSchemaException("the topics " + top1 + " and " + top2 + " must be bound to exaclty one position topic, but is bound to " + bindings);
+ }else {
+ return positions.get(0);
+ }
+ }
+ }
}
1
0

[isidorus-cvs] r617 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base container view
by lgiessmann@common-lisp.net 14 Jul '11
by lgiessmann@common-lisp.net 14 Jul '11
14 Jul '11
Author: lgiessmann
Date: Thu Jul 14 02:42:52 2011
New Revision: 617
Log:
gdl-frontend: Widgets: implemented getStartEement for GdlView, GdlUnit and GdlList
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlContainer.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/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/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/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/GdlView.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlContainer.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlContainer.java Thu Jul 14 02:40:28 2011 (r616)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlContainer.java Thu Jul 14 02:42:52 2011 (r617)
@@ -6,6 +6,6 @@
public interface IGdlContainer {
- public void append(GdlVisibleObject widget) throws InvalidGdlSchemaException;
+ public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException;
public ArrayList<Topic> contains() throws InvalidGdlSchemaException;
}
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 Jul 14 02:40:28 2011 (r616)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Thu Jul 14 02:42:52 2011 (r617)
@@ -314,17 +314,28 @@
// returns the topic that represetns the first item of a container, that means this item is
// not bound to an association o fthe type position in a role of the type descendant
- public static Topic getFirstContainee(ArrayList<Topic> containees) throws InvalidGdlSchemaException {
- if(containees == null || containees.size() == 0) return null;
+ public static Topic getFirstContainee(Topic container, ArrayList<Topic> containees) throws InvalidGdlSchemaException {
+ if(containees == null || containees.size() == 0 || container == null) return null;
ArrayList<Topic> topicsWithoutAncestor = new ArrayList<Topic>();
TopicMap tm = containees.get(0).getTopicMap();
- Topic descendant = getTopicByPsi(GdlPsis.RoleType.gdlDescendant, tm);
+ Topic descendantRoleType = getTopicByPsi(GdlPsis.RoleType.gdlDescendant, tm);
Topic position = getTopicByPsi(GdlPsis.AssociationType.gdlPosition, tm);
Topic visibleObject = getTopicByPsi(GdlPsis.TopicType.gdlVisibleObject, tm);
- Topic ancestor = getTopicByPsi(GdlPsis.RoleType.gdlAncestor, tm);
- for (Topic containee : containees)
- if(null == getOtherPlayerOfBinaryAssociation(containee, descendant, position, null, visibleObject, ancestor)) topicsWithoutAncestor.add(containee);
+ Topic ancestorRoleType = getTopicByPsi(GdlPsis.RoleType.gdlAncestor, tm);
+ for (Topic containee : containees){
+ ArrayList<Topic> ancestors = getOtherPlayerOfBinaryAssociation(containee, descendantRoleType, position, null, visibleObject, ancestorRoleType);
+ if(ancestors.size() != 1){
+ String top = getAnyIdOfTopic(container);
+ String bindings = "";
+ for (Topic topic : ancestors) bindings += ", " + getAnyIdOfTopic(topic);
+ if(bindings.length() == 0) bindings = "[]";
+ else bindings = bindings.substring(2);
+ throw new InvalidGdlSchemaException("the topic " + top + " must be boundto exaclty one ancestor element, but found " + bindings);
+ } else {
+ if(ancestors.get(0).equals(container))topicsWithoutAncestor.add(containee);
+ }
+ }
if(topicsWithoutAncestor.size() > 1){
String values = "";
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 Jul 14 02:40:28 2011 (r616)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java Thu Jul 14 02:42:52 2011 (r617)
@@ -377,9 +377,10 @@
@Override
- public void append(GdlVisibleObject widget) throws InvalidGdlSchemaException {
+ public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException {
// TODO Auto-generated method stub
+ return null;
}
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 Jul 14 02:40:28 2011 (r616)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java Thu Jul 14 02:42:52 2011 (r617)
@@ -1253,8 +1253,9 @@
@Override
- public void append(GdlVisibleObject widget) throws InvalidGdlSchemaException {
+ public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException {
// TODO: implement
+ return null;
}
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 Thu Jul 14 02:40:28 2011 (r616)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlCreatorAssociationView.java Thu Jul 14 02:42:52 2011 (r617)
@@ -429,12 +429,4 @@
// TODO Auto-generated method stub
return null;
}
-
- @Override
- public void append(GdlVisibleObject widget)
- throws InvalidGdlSchemaException {
- // TODO Auto-generated method 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 Thu Jul 14 02:40:28 2011 (r616)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlDefaultCreatorTopicView.java Thu Jul 14 02:42:52 2011 (r617)
@@ -473,12 +473,4 @@
// TODO Auto-generated method stub
return null;
}
-
-
- @Override
- public void append(GdlVisibleObject widget)
- throws InvalidGdlSchemaException {
- // TODO Auto-generated method stub
-
- }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlEditorAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlEditorAssociationView.java Thu Jul 14 02:40:28 2011 (r616)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlEditorAssociationView.java Thu Jul 14 02:42:52 2011 (r617)
@@ -474,15 +474,4 @@
// TODO Auto-generated method stub
return null;
}
-
-
- @Override
- public void append(GdlVisibleObject widget)
- throws InvalidGdlSchemaException {
- // TODO Auto-generated method stub
-
- }
-
-
-
}
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 Thu Jul 14 02:40:28 2011 (r616)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialCreatorTopicView.java Thu Jul 14 02:42:52 2011 (r617)
@@ -477,13 +477,4 @@
// TODO Auto-generated method stub
return null;
}
-
-
- @Override
- public void append(GdlVisibleObject widget)
- throws InvalidGdlSchemaException {
- // TODO Auto-generated method 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 Thu Jul 14 02:40:28 2011 (r616)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlSpecialEditorTopicView.java Thu Jul 14 02:42:52 2011 (r617)
@@ -478,14 +478,5 @@
public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() {
// TODO Auto-generated method stub
return null;
- }
-
-
- @Override
- public void append(GdlVisibleObject widget)
- throws InvalidGdlSchemaException {
- // TODO Auto-generated method stub
-
- }
-
+ }
}
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 Jul 14 02:40:28 2011 (r616)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java Thu Jul 14 02:42:52 2011 (r617)
@@ -81,14 +81,17 @@
}
- public void append(GdlVisibleObject widget) throws InvalidGdlSchemaException{
+ // creates a GdlVisbleObject instance of the passed topic current and inserts it
+ // by using it's defined position style depending on the GdlVisibleObject
+ // represented by ancestor. If ancestor is null current is the first topic
+ @Override
+ public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException {
+ // TODO: getFirstContainee => change the behavior of getting the first topic
+
// TODO: implement
- }
-
-
- public void append(Topic widget) throws InvalidGdlSchemaException {
- // TODO: implement
- // TODO: use GdlInstantiator
+
+
+ return null;
}
1
0