Author: lgiessmann Date: Wed Jul 6 01:51:53 2011 New Revision: 565
Log: gdl-frontend: Widgets: added the property gdl:content-orientation
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ContentOrientationValue.java Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java Tue Jul 5 13:46:09 2011 (r564) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java Wed Jul 6 01:51:53 2011 (r565) @@ -190,8 +190,7 @@ public final static String gdlUnitBorderBottomRightRadius = gdl + "unit-border-bottom-right-radius"; public final static String gdlUnitBoderBottomLeftRadius = gdl + "unit-border-bottom-left-radius"; public final static String gdlUnitBorderTopLeftRadius = gdl + "unit-border-top-left-radius"; - public final static String gdlContentFloat = gdl + "content-float"; - public final static String gdlContentClear = gdl + "content-clear"; + public final static String gdlContentOrientation = gdl + "content-orientation"; }
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 Tue Jul 5 13:46:09 2011 (r564) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Wed Jul 6 01:51:53 2011 (r565) @@ -13,6 +13,7 @@ import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue; import us.isidor.gdl.anaToMia.Widgets.values.ClearValue; import us.isidor.gdl.anaToMia.Widgets.values.ColorValue; +import us.isidor.gdl.anaToMia.Widgets.values.ContentOrientationValue; import us.isidor.gdl.anaToMia.Widgets.values.CursorValue; import us.isidor.gdl.anaToMia.Widgets.values.NumUnitValue; import com.google.gwt.core.client.JsArray; @@ -211,28 +212,6 @@ } - // returns a Float instance of a gdl:conetnt-float occurrence or the default value for - // this property if no gdl:content-float occurrence is available - public Float getContentFloat() throws InvalidGdlSchemaException { - Occurrence floatOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlContentFloat); - - if(floatOcc != null){ - String value = floatOcc.getValue().toLowerCase(); - if(value.equals("none")){ - return Float.NONE; - } else if (value.equals("left")){ - return Float.LEFT; - } else if (value.equals("right")){ - return Float.RIGHT; - } else { - throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlContentFloat + " must be set to one of "none", "left" or "right", but is "" + floatOcc.getValue() + """); - } - } else { - return Float.NONE; - } - } - - // returns a ClearValue instance of a gdl:clear occurrence or the default value for // this property if no gdl:clear occurrence is available public ClearValue getClear() throws InvalidGdlSchemaException { @@ -250,23 +229,25 @@ } - // returns a ClearValue instance of a gdl:content-clear occurrence or the default value for - // this property if no gdl:content-clear occurrence is available - public ClearValue getContentClear() throws InvalidGdlSchemaException { - Occurrence clearOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlContentClear); + // returns a ContentOrientationValue instance of a gdl:content-orientation occurrence or the default value for + // this property if no gdl:content-orientation occurrence is available + public ContentOrientationValue getContentOrientation() throws InvalidGdlSchemaException { + Occurrence orientationOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlContentOrientation);
- if(clearOcc != null){ + if(orientationOcc != null){ try{ - return ClearValue.valueOf(clearOcc.getValue().toUpperCase()); + return ContentOrientationValue.valueOf(orientationOcc.getValue().toUpperCase()); }catch(IllegalArgumentException e){ - throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlContentClear + " must be set to one of "none", "left", "right" or "both", but is "" + clearOcc.getValue() + """); + throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlContentOrientation + " must be set to one of "horizontal" or "vertical", but is "" + orientationOcc.getValue() + """); } } else { - return ClearValue.NONE; + return ContentOrientationValue.Vertical; } } + +
- + // returns a VerticalAlign instance of a gdl:vertical-align occurrence // or the default value for this property if no gdl:vertical-align occurrence // is available. The styleClass attribute is used as scope for expressing @@ -1166,7 +1147,7 @@ // sets the float style property of all sub elements by using the GWT DOM class - public abstract void setContentFloat(Widget widget, Float value) throws InvalidGdlSchemaException, ExecutionException; + public abstract void setContentOrientation(Widget widget, ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException;
// sets the clear style property of this element by using the GWT DOM class @@ -1176,10 +1157,6 @@ } } - - // sets the clear style property of all sub elements by using the GWT DOM class - public abstract void setContentClear(Widget widget, ClearValue value) throws InvalidGdlSchemaException, ExecutionException; -
// sets the vertical-align style property of this element by using the GWT DOM class public void setVerticalAlign(VerticalAlign value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Tue Jul 5 13:46:09 2011 (r564) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 01:51:53 2011 (r565) @@ -31,6 +31,7 @@ import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue; import us.isidor.gdl.anaToMia.Widgets.values.ClearValue; import us.isidor.gdl.anaToMia.Widgets.values.ColorValue; +import us.isidor.gdl.anaToMia.Widgets.values.ContentOrientationValue; import us.isidor.gdl.anaToMia.Widgets.values.CursorValue; import us.isidor.gdl.anaToMia.Widgets.values.DirectionValue; import us.isidor.gdl.anaToMia.Widgets.values.FontWeightValue; @@ -791,14 +792,10 @@
@Override - public void setContentFloat(Widget widget, Float value) throws InvalidGdlSchemaException, ExecutionException { - this.setCssProperty((TextArea)widget, null, "float", value.getCssName()); - } - - - @Override - public void setContentClear(Widget widget, ClearValue value) throws InvalidGdlSchemaException, ExecutionException { - this.setCssProperty((TextArea)widget, null, "clear", value.getCssValue()); + public void setContentOrientation(Widget widget, ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException { + String valueStr = "inline"; + if(value == ContentOrientationValue.Vertical) valueStr = "block"; + this.setCssProperty((TextArea)widget, null, "display", valueStr); }
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ContentOrientationValue.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/values/ContentOrientationValue.java Wed Jul 6 01:51:53 2011 (r565) @@ -0,0 +1,13 @@ +package us.isidor.gdl.anaToMia.Widgets.values; + +public enum ContentOrientationValue implements CssValue{ + Horizontal, + Vertical; + + @Override + public String getCssValue() { + return this.toString().toLowerCase(); + } + + +}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Tue Jul 5 13:46:09 2011 (r564) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Wed Jul 6 01:51:53 2011 (r565) @@ -17,6 +17,7 @@ import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue; import us.isidor.gdl.anaToMia.Widgets.values.ClearValue; import us.isidor.gdl.anaToMia.Widgets.values.ColorValue; +import us.isidor.gdl.anaToMia.Widgets.values.ContentOrientationValue; import us.isidor.gdl.anaToMia.Widgets.values.CursorValue; import us.isidor.gdl.anaToMia.Widgets.values.NumUnitValue;
@@ -71,18 +72,6 @@ // TODO Auto-generated method stub } - - @Override - public void setContentFloat(Widget widget, Float value) throws InvalidGdlSchemaException, ExecutionException { - // TODO Auto-generated method stub - - } - - @Override - public void setContentClear(Widget widget, ClearValue value) throws InvalidGdlSchemaException, ExecutionException { - // TODO Auto-generated method stub - - }
@Override public void setMargin(Widget widget, NumUnitValue value, String styleClass)
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Tue Jul 5 13:46:09 2011 (r564) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Wed Jul 6 01:51:53 2011 (r565) @@ -1,11 +1,7 @@ package us.isidor.gdl.anaToMia.Widgets.views;
-import com.google.gwt.dom.client.Style.Float; -import com.google.gwt.dom.client.Style.Overflow; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.user.client.ui.Widget; - -import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap; import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject; @@ -16,6 +12,7 @@ import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue; import us.isidor.gdl.anaToMia.Widgets.values.ClearValue; import us.isidor.gdl.anaToMia.Widgets.values.ColorValue; +import us.isidor.gdl.anaToMia.Widgets.values.ContentOrientationValue; import us.isidor.gdl.anaToMia.Widgets.values.CursorValue; import us.isidor.gdl.anaToMia.Widgets.values.NumUnitValue;
@@ -74,19 +71,6 @@ }
- @Override - public void setContentFloat(Widget widget, Float value) throws InvalidGdlSchemaException, ExecutionException { - // TODO Auto-generated method stub - - } - - - @Override - public void setContentClear(Widget widget, ClearValue value) throws InvalidGdlSchemaException, ExecutionException { - // TODO Auto-generated method stub - - } -
@Override public void setMargin(Widget widget, NumUnitValue value, String styleClass)
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Tue Jul 5 13:46:09 2011 (r564) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Wed Jul 6 01:51:53 2011 (r565) @@ -74,21 +74,6 @@ }
- - @Override - public void setContentFloat(Widget widget, Float value) throws InvalidGdlSchemaException, ExecutionException { - // TODO Auto-generated method stub - - } - - - @Override - public void setContentClear(Widget widget, ClearValue value) throws InvalidGdlSchemaException, ExecutionException { - // TODO Auto-generated method stub - - } - - @Override public void setMargin(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Tue Jul 5 13:46:09 2011 (r564) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Wed Jul 6 01:51:53 2011 (r565) @@ -73,18 +73,6 @@ }
- @Override - public void setContentFloat(Widget widget, Float value) throws InvalidGdlSchemaException, ExecutionException { - // TODO Auto-generated method stub - - } - - - @Override - public void setContentClear(Widget widget, ClearValue value) throws InvalidGdlSchemaException, ExecutionException { - // TODO Auto-generated method stub - - }
@Override
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Tue Jul 5 13:46:09 2011 (r564) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Wed Jul 6 01:51:53 2011 (r565) @@ -75,18 +75,6 @@ }
- @Override - public void setContentFloat(Widget widget, Float value) throws InvalidGdlSchemaException, ExecutionException { - // TODO Auto-generated method stub - - } - - - @Override - public void setContentClear(Widget widget, ClearValue value) throws InvalidGdlSchemaException, ExecutionException { - // TODO Auto-generated method stub - - }
@Override
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Tue Jul 5 13:46:09 2011 (r564) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Wed Jul 6 01:51:53 2011 (r565) @@ -2,6 +2,7 @@
import com.google.gwt.core.client.JsArray; import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Name; @@ -12,6 +13,7 @@ import us.isidor.gdl.anaToMia.Widgets.base.IGdlContainer; import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException; import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException; +import us.isidor.gdl.anaToMia.Widgets.values.ContentOrientationValue;
public abstract class GdlView extends GdlVisibleObject implements IGdlContainer { @@ -56,6 +58,15 @@ public abstract void deregisterButtonCallback(ClickHandler handler, String id); + + + public void setContentOrientation(Widget widget, ContentOrientationValue value){ + // do nothing - since all content elements are positioned vie the GDL positioning concept + } + + + + // TODO: implement addXYZhandler(handler, id);