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] r556 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base values
by lgiessmann@common-lisp.net 04 Jul '11
by lgiessmann@common-lisp.net 04 Jul '11
04 Jul '11
Author: lgiessmann
Date: Mon Jul 4 08:29:44 2011
New Revision: 556
Log:
gdl-frontend: Widgets: added the class GdlTextObject, derived from GdlVisibleObject
Added:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlTextObject.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/DirectionValue.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/NormalNumUnitValue.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/TextAlignValue.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/TextDecorationValue.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/TestClass.java
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlTextObject.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/GdlTextObject.java Mon Jul 4 08:29:44 2011 (r556)
@@ -0,0 +1,150 @@
+package us.isidor.gdl.anaToMia.Widgets.base;
+
+
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.values.DirectionValue;
+import us.isidor.gdl.anaToMia.Widgets.values.NormalNumUnitValue;
+import us.isidor.gdl.anaToMia.Widgets.values.TextAlignValue;
+import us.isidor.gdl.anaToMia.Widgets.values.TextDecorationValue;
+
+public abstract class GdlTextObject extends GdlVisibleObject {
+
+ // some constructors
+ protected GdlTextObject(){
+ super();
+ }
+
+
+ public GdlTextObject(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative);
+ }
+
+
+ // returns a DirectionValue instance that represents the text direction of this element.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // or null.
+ public DirectionValue getDirection(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence directionOcc = null;
+ if(styleClass != null){
+ directionOcc = super.getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlDirection, styleClass);
+ } else {
+ directionOcc = super.getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlDirection);
+ }
+
+ if(directionOcc == null && styleClass != null){
+ return null;
+ } else if(directionOcc == null) {
+ return DirectionValue.LTR;
+ } else {
+ try{
+ return DirectionValue.valueOf(directionOcc.getValue().toUpperCase());
+ }catch(IllegalArgumentException e){
+ throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlDirection + " must be set to one of \"ltr\" or \"rtl\", but is \"" + directionOcc.getValue() + "\"");
+ }
+ }
+ }
+
+
+ // returns a TextAlingvalue instance that represents the text-align of this element.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // or null.
+ public TextAlignValue getTextAlign(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence textAlignOcc = null;
+ if(styleClass != null){
+ textAlignOcc = super.getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlDirection, styleClass);
+ } else {
+ textAlignOcc = super.getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlDirection);
+ }
+
+ if(textAlignOcc == null && styleClass != null){
+ return null;
+ } else if(textAlignOcc == null) {
+ return TextAlignValue.LEFT;
+ } else {
+ try{
+ return TextAlignValue.valueOf(textAlignOcc.getValue().toUpperCase());
+ }catch(IllegalArgumentException e){
+ throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlTextAlign + " must be set to one of \"left\", \"right\", \"center\" or \"justify\", but is \"" + textAlignOcc.getValue() + "\"");
+ }
+ }
+ }
+
+
+ // returns a NormalNumUnitValue instance that represents the line-height of this element.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // or null.
+ public NormalNumUnitValue getLineHeight(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence lineHeightOcc = null;
+ if(styleClass != null){
+ lineHeightOcc = super.getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlDirection, styleClass);
+ } else {
+ lineHeightOcc = super.getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlDirection);
+ }
+
+ if(lineHeightOcc == null && styleClass != null){
+ return null;
+ } else if(lineHeightOcc == null) {
+ return new NormalNumUnitValue();
+ } else {
+ return new NormalNumUnitValue(lineHeightOcc.getValue());
+ }
+ }
+
+
+ // returns a TextDecoarionValue instance that represents the text-decoration of this element.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // or null.
+ public TextDecorationValue getGdlTextDecoration(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence decorationOcc = null;
+ if(styleClass != null){
+ decorationOcc = super.getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlTextDecoration, styleClass);
+ } else {
+ decorationOcc = super.getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlTextDecoration);
+ }
+
+ if(decorationOcc == null && styleClass != null){
+ return null;
+ } else if(decorationOcc == null) {
+ return TextDecorationValue.NONE;
+ } else {
+ try{
+ return TextDecorationValue.valueOf(decorationOcc.getValue().toUpperCase());
+ }catch(IllegalArgumentException e){
+ throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlTextDecoration + " must be set to one of \"underline\", \"overline\", \"line-through\", \"blink\" or \"none\", but is \"" + decorationOcc.getValue() + "\"");
+ }
+ }
+ }
+
+
+ // calls the super class's setGdlStyle and additionally calls local statements
+ // to fulfill the style settings
+ @Override
+ protected void setGdlStyle() throws InvalidGdlSchemaException, ExecutionException{
+ super.setGdlStyle();
+
+ // TODO: implement
+
+ // direction [hover | active | focus]
+ // text-align [hover | active | focus]
+ // line-height [hover | active | focus]
+ // text-decoration [hover | active | focus]
+ // color [hover | active | focus]
+ // font-family [hover | active | focus]
+ // font-style [hover | active | focus]
+ // font-size [hover | active | focus]
+ // font-weight [hover | active | focus]
+ // letter-spacing [hover | active | focus]
+ // word-spacing [hover | active | focus]
+
+
+ // TODO: implement
+ // css pseudo class handlers => register additional handlers for this class ???
+ }
+
+
+ // shall return the objects textual value
+ public abstract String getText();
+}
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 Mon Jul 4 07:26:24 2011 (r555)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Mon Jul 4 08:29:44 2011 (r556)
@@ -33,6 +33,7 @@
import com.google.gwt.event.dom.client.HasMouseOutHandlers;
import com.google.gwt.event.dom.client.HasMouseOverHandlers;
import com.google.gwt.event.dom.client.HasMouseUpHandlers;
+import com.google.gwt.event.dom.client.HasScrollHandlers;
import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.dom.client.MouseOutEvent;
@@ -41,13 +42,15 @@
import com.google.gwt.event.dom.client.MouseOverHandler;
import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.event.dom.client.MouseUpHandler;
+import com.google.gwt.event.dom.client.ScrollEvent;
+import com.google.gwt.event.dom.client.ScrollHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Composite;
-public abstract class GdlVisibleObject extends Composite implements GdlDescriptor, HasClickHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasFocusHandlers, HasMouseDownHandlers, HasMouseUpHandlers, HasBlurHandlers{
+public abstract class GdlVisibleObject extends Composite implements GdlDescriptor, HasClickHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasFocusHandlers, HasMouseDownHandlers, HasMouseUpHandlers, HasBlurHandlers, HasScrollHandlers{
protected AbsolutePanel mainPanel = new AbsolutePanel();
protected Topic tmRepresentative = null;
protected TopicMap tm = null;
@@ -59,7 +62,8 @@
protected boolean isHovered = false;
- private GdlVisibleObject() {
+ // some constructors
+ protected GdlVisibleObject() {
initWidget(this.mainPanel);
}
@@ -81,7 +85,7 @@
// a helper method that returns all occurrences of the type bound to the passed PSI
- private JsArray<Occurrence> getOccurrences(String occurrenceType){
+ protected JsArray<Occurrence> getOccurrences(String occurrenceType){
Topic occType = tm.getTopicBySubjectIdentifier(tm.createLocator(occurrenceType));
if(occType == null) return null;
else return tmRepresentative.getOccurrences(occType);
@@ -91,7 +95,7 @@
// 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{
+ protected 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){
@@ -110,7 +114,7 @@
// a helper method that returns one occurrence of the type bound to the passed PSI and scoped
// by the theme bound to the passed PSI. If no such occurrence exist, the default value is null
- private Occurrence getNoneOrOneScopedOccurrence(String occurrenceType, String theme) throws InvalidGdlSchemaException{
+ protected Occurrence getNoneOrOneScopedOccurrence(String occurrenceType, String theme) throws InvalidGdlSchemaException{
Topic themeTopic = tm.getTopicBySubjectIdentifier(tm.createLocator(theme));
if(themeTopic == null){
return null;
@@ -1390,7 +1394,7 @@
// sets all GDL styles that are defined by the topic map representative
- public void setGdlStyle() throws InvalidGdlSchemaException, ExecutionException {
+ protected void setGdlStyle() throws InvalidGdlSchemaException, ExecutionException {
this.setDisplay(this.getDisplay());
this.setZindex(this.getZindex());
this.setFloat(this.getFloat());
@@ -1485,6 +1489,13 @@
}
+ // registers a scroll handler on this element
+ @Override
+ public HandlerRegistration addScrollHandler(ScrollHandler handler) {
+ return this.addDomHandler(handler, ScrollEvent.getType());
+ }
+
+
// registers a mouse down handler on this element
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
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 Mon Jul 4 07:26:24 2011 (r555)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Mon Jul 4 08:29:44 2011 (r556)
@@ -100,7 +100,11 @@
bgcFocus.addTheme(gdlFocus);
- GdlVisibleObject tmp = new GdlVisibleObject(tmpRepresentative){};
+ GdlTextObject tmp = new GdlTextObject(tmpRepresentative){
+ @Override
+ public String getText() {
+ return "tmp";
+ }};
this.mainPanel.add(tmp);
}catch(Exception e){
e.printStackTrace();
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/DirectionValue.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/DirectionValue.java Mon Jul 4 08:29:44 2011 (r556)
@@ -0,0 +1,11 @@
+package us.isidor.gdl.anaToMia.Widgets.values;
+
+public enum DirectionValue implements CssValue {
+ LTR,
+ RTL;
+
+
+ public String getCssValue(){
+ return this.toString().toLowerCase();
+ }
+}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/NormalNumUnitValue.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/NormalNumUnitValue.java Mon Jul 4 08:29:44 2011 (r556)
@@ -0,0 +1,46 @@
+package us.isidor.gdl.anaToMia.Widgets.values;
+
+import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+
+public class NormalNumUnitValue extends NumUnitValue{
+ public NormalNumUnitValue(){
+ super.unit = null; // if unit is null, the default value is normal
+ super.value = 0f;
+ }
+
+
+ public NormalNumUnitValue(String value) throws InvalidGdlSchemaException{
+ String upperString = value.trim().toUpperCase();
+ if(upperString.equals("NORMAL")){
+ super.unit = null; // if unit is null, the default value is normal
+ super.value = 0f;
+ }else if(upperString.endsWith("PX")){
+ this.value = makeFloat(upperString, 2);
+ this.unit = CssUnit.PIXEL;
+ }else if (upperString.endsWith("PT")){
+ this.value = makeFloat(upperString, 2);
+ this.unit = CssUnit.POINT;
+ } else if(upperString.endsWith("%")){
+ this.value = makeFloat(upperString, 1);
+ this.unit = CssUnit.PERCENTAGE;
+ } else {
+ throw new InvalidGdlSchemaException("normal numeric values supported by the GDL containing a unit definition must be of the form <numeric-value>(pt|px|%)|normal, but found: " + value);
+ }
+ }
+
+
+ @Override
+ public String getCssValue() {
+ if(super.unit == null){
+ return "normal";
+ } else {
+ return super.getCssValue();
+ }
+ }
+
+
+ // this method returns true, if the value must be treated as "auto"
+ public boolean isNormal(){
+ return super.unit == null;
+ }
+}
\ No newline at end of file
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/TextAlignValue.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/TextAlignValue.java Mon Jul 4 08:29:44 2011 (r556)
@@ -0,0 +1,14 @@
+package us.isidor.gdl.anaToMia.Widgets.values;
+
+public enum TextAlignValue implements CssValue{
+ LEFT,
+ RIGHT,
+ CENTER,
+ JUSTIFY;
+
+
+ @Override
+ public String getCssValue() {
+ return this.toString().toLowerCase();
+ }
+}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/TextDecorationValue.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/TextDecorationValue.java Mon Jul 4 08:29:44 2011 (r556)
@@ -0,0 +1,15 @@
+package us.isidor.gdl.anaToMia.Widgets.values;
+
+public enum TextDecorationValue implements CssValue {
+ UNDERLINE,
+ OVERLINE,
+ LINE_THROUGH,
+ BLINK,
+ NONE;
+
+
+ @Override
+ public String getCssValue() {
+ return this.toString().toLowerCase().replace("_", "-");
+ }
+}
1
0

[isidorus-cvs] r555 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base views
by lgiessmann@common-lisp.net 04 Jul '11
by lgiessmann@common-lisp.net 04 Jul '11
04 Jul '11
Author: lgiessmann
Date: Mon Jul 4 07:26:24 2011
New Revision: 555
Log:
gdl-frontend: Widgets: finalised the behavior for setting all css style attributes that depend on the css pseudo classes hover, active, focus; added methods for registering the following handlers to GdlVisibleObject: ClickHandler, MouseOutHandler, MouseMoveHandler
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/views/GdlAssociationView.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/GdlDefaultEditorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultTopicView.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/GdlSpecialTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlTopicView.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/GdlVisibleObject.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Sun Jul 3 23:00:30 2011 (r554)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Mon Jul 4 07:26:24 2011 (r555)
@@ -4,7 +4,9 @@
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.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumValue;
import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue;
@@ -18,46 +20,74 @@
import com.google.gwt.dom.client.Style.Float;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.VerticalAlign;
+import com.google.gwt.event.dom.client.BlurEvent;
+import com.google.gwt.event.dom.client.BlurHandler;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.FocusEvent;
+import com.google.gwt.event.dom.client.FocusHandler;
+import com.google.gwt.event.dom.client.HasBlurHandlers;
+import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.event.dom.client.HasFocusHandlers;
+import com.google.gwt.event.dom.client.HasMouseDownHandlers;
+import com.google.gwt.event.dom.client.HasMouseOutHandlers;
+import com.google.gwt.event.dom.client.HasMouseOverHandlers;
+import com.google.gwt.event.dom.client.HasMouseUpHandlers;
+import com.google.gwt.event.dom.client.MouseDownEvent;
+import com.google.gwt.event.dom.client.MouseDownHandler;
+import com.google.gwt.event.dom.client.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseOutHandler;
+import com.google.gwt.event.dom.client.MouseOverEvent;
+import com.google.gwt.event.dom.client.MouseOverHandler;
+import com.google.gwt.event.dom.client.MouseUpEvent;
+import com.google.gwt.event.dom.client.MouseUpHandler;
+import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Composite;
-public abstract class GdlVisibleObject extends Composite implements GdlDescriptor {
+public abstract class GdlVisibleObject extends Composite implements GdlDescriptor, HasClickHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasFocusHandlers, HasMouseDownHandlers, HasMouseUpHandlers, HasBlurHandlers{
protected AbsolutePanel mainPanel = new AbsolutePanel();
protected Topic tmRepresentative = null;
protected TopicMap tm = null;
-
-
+ protected ActiveStyleHandler activeStyleHandler = new ActiveStyleHandler();
+ protected FocusStyleHandler focusStyleHandler = new FocusStyleHandler();
+ protected HoverStyleHandler hoverStyleHandler = new HoverStyleHandler();
+ protected boolean isActive = false;
+ protected boolean isFocused = false;
+ protected boolean isHovered = false;
+
+
private GdlVisibleObject() {
initWidget(this.mainPanel);
}
-
-
- public GdlVisibleObject(Topic tmRepresentative) throws InvalidGdlSchemaException{
+
+
+ public GdlVisibleObject(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
this();
this.tmRepresentative = tmRepresentative;
this.tm = this.tmRepresentative.getTopicMap();
-
+
this.setId(this.getId());
this.setGdlStyle();
}
-
-
+
+
// returns the topic that represents this element
public Topic getTmRepresentative(){
return this.tmRepresentative;
}
-
-
+
+
// a helper method that returns all occurrences of the type bound to the passed PSI
private JsArray<Occurrence> getOccurrences(String occurrenceType){
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
@@ -67,7 +97,7 @@
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 " + GdlPsis.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){
@@ -77,7 +107,7 @@
}
}
-
+
// a helper method that returns one occurrence of the type bound to the passed PSI and scoped
// by the theme bound to the passed PSI. If no such occurrence exist, the default value is null
private Occurrence getNoneOrOneScopedOccurrence(String occurrenceType, String theme) throws InvalidGdlSchemaException{
@@ -95,7 +125,7 @@
}
}
}
-
+
if(matchedOccurrences.size() > 1){
throw new InvalidGdlSchemaException("The topic " + GdlPsis.getAnyIdOfTopic(this.tmRepresentative) + "must be bound to none or one occurrence of the type " + occurrenceType + " and the scope " + theme + " but is bound " + matchedOccurrences.size() + " times to it");
} else if(matchedOccurrences.size() == 1){
@@ -105,8 +135,8 @@
}
}
}
-
-
+
+
// returns the string value of a gdl:id occurrence
public String getId() throws InvalidGdlSchemaException {
JsArray<Occurrence> idOccs = getOccurrences(GdlPsis.OccurrenceType.gdlId);
@@ -116,13 +146,13 @@
return idOccs.get(0).getValue();
}
}
-
-
+
+
// returns a Display instance of a gdl:display occurrence.
// If no gdl:display occurrence is set, the default value is returned
public Display getDisplay() throws InvalidGdlSchemaException {
Occurrence displayOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlDisplay);
-
+
if(displayOcc != null){
String value = displayOcc.getValue().toLowerCase();
if(value.equals("none")){
@@ -140,8 +170,8 @@
return Display.INLINE_BLOCK;
}
}
-
-
+
+
// returns an AutoNumValue instance of a gdl:z-index occurrence.
// If no gdl:z-index occurrence is set, the default value is returned
public AutoNumValue getZindex() throws InvalidGdlSchemaException {
@@ -153,12 +183,12 @@
}
}
-
+
// returns a Float instance of a gdl:float occurrence or the default value for
// this property if no gdl:float occurrence is available
public Float getFloat() throws InvalidGdlSchemaException {
Occurrence floatOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlFloat);
-
+
if(floatOcc != null){
String value = floatOcc.getValue().toLowerCase();
if(value.equals("none")){
@@ -174,13 +204,13 @@
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 {
Occurrence clearOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlFloat);
-
+
if(clearOcc != null){
try{
return ClearValue.valueOf(clearOcc.getValue().toUpperCase());
@@ -191,8 +221,8 @@
return ClearValue.NONE;
}
}
-
-
+
+
// 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
@@ -204,7 +234,7 @@
} else {
vaOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlVerticalAlign);
}
-
+
if(vaOcc == null && styleClass != null){
return null;
} else if(vaOcc == null) {
@@ -233,7 +263,7 @@
}
}
-
+
// returns a NumUnitValue instance that represents the margin of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// or null. If the styleClass is null and no occurrence was found, the default value for this
@@ -245,7 +275,7 @@
} else {
marginOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlMargin);
}
-
+
if(marginOcc == null && styleClass != null){
return null;
} else if(marginOcc == null) {
@@ -254,8 +284,8 @@
return new NumUnitValue(marginOcc.getValue());
}
}
-
-
+
+
// returns a NumUnitValue instance that represents the margin-top of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// or null.
@@ -266,15 +296,15 @@
} else {
marginOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlMarginTop);
}
-
+
if(marginOcc == null){
return null;
} else {
return new NumUnitValue(marginOcc.getValue());
}
}
-
-
+
+
// returns a NumUnitValue instance that represents the margin-right of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// or null.
@@ -285,15 +315,15 @@
} else {
marginOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlMarginRight);
}
-
+
if(marginOcc == null){
return null;
} else {
return new NumUnitValue(marginOcc.getValue());
}
}
-
-
+
+
// returns a NumUnitValue instance that represents the margin-bottom of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// or null.
@@ -304,15 +334,15 @@
} else {
marginOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlMarginBottom);
}
-
+
if(marginOcc == null){
return null;
} else {
return new NumUnitValue(marginOcc.getValue());
}
}
-
-
+
+
// returns a NumUnitValue instance that represents the margin-left of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// or null.
@@ -323,7 +353,7 @@
} else {
marginOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlMarginLeft);
}
-
+
if(marginOcc == null){
return null;
} else {
@@ -343,15 +373,15 @@
} else {
colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderColor);
}
-
+
if(colorOcc == null ){
return null;
} else {
return new ColorValue(colorOcc.getValue());
}
}
-
-
+
+
// returns a ColorValue instance that represents the color of this element's border-top.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -362,15 +392,15 @@
} else {
colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopColor);
}
-
+
if(colorOcc == null ){
return null;
} else {
return new ColorValue(colorOcc.getValue());
}
}
-
-
+
+
// returns a ColorValue instance that represents the color of this element's border-right.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -381,15 +411,15 @@
} else {
colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderRightColor);
}
-
+
if(colorOcc == null ){
return null;
} else {
return new ColorValue(colorOcc.getValue());
}
}
-
-
+
+
// returns a ColorValue instance that represents the color of this element's border-bottom.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -400,15 +430,15 @@
} else {
colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomColor);
}
-
+
if(colorOcc == null ){
return null;
} else {
return new ColorValue(colorOcc.getValue());
}
}
-
-
+
+
// returns a ColorValue instance that represents the color of this element's border-left.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -419,7 +449,7 @@
} else {
colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderLeftColor);
}
-
+
if(colorOcc == null ){
return null;
} else {
@@ -439,7 +469,7 @@
} else {
styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderStyle);
}
-
+
if(styleOcc == null && styleClass != null){
return null;
} else if(styleOcc == null) {
@@ -453,8 +483,8 @@
}
}
}
-
-
+
+
// returns a ColorValue instance that represents the style of this element's border-top.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -465,7 +495,7 @@
} else {
styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopStyle);
}
-
+
if(styleOcc == null){
return null;
} else {
@@ -477,8 +507,8 @@
}
}
}
-
-
+
+
// returns a ColorValue instance that represents the style of this element's border-right.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -489,7 +519,7 @@
} else {
styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderRightStyle);
}
-
+
if(styleOcc == null){
return null;
} else {
@@ -501,8 +531,8 @@
}
}
}
-
-
+
+
// returns a ColorValue instance that represents the style of this element's border-bottom.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -513,7 +543,7 @@
} else {
styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomStyle);
}
-
+
if(styleOcc == null){
return null;
} else {
@@ -525,8 +555,8 @@
}
}
}
-
-
+
+
// returns a ColorValue instance that represents the style of this element's border-left.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -537,7 +567,7 @@
} else {
styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderLeftStyle);
}
-
+
if(styleOcc == null){
return null;
} else {
@@ -549,7 +579,7 @@
}
}
}
-
+
// returns a ColorValue instance that represents the width of this element's border.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
@@ -562,7 +592,7 @@
} else {
widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderWidth);
}
-
+
if(widthOcc == null && styleClass != null){
return null;
} else if(widthOcc == null) {
@@ -571,8 +601,8 @@
return new AbsoluteNumValue(widthOcc.getValue());
}
}
-
-
+
+
// returns a ColorValue instance that represents the width of this element's border-top.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -583,15 +613,15 @@
} else {
widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopWidth);
}
-
+
if(widthOcc == null){
return null;
} else {
return new AbsoluteNumValue(widthOcc.getValue());
}
}
-
-
+
+
// returns a ColorValue instance that represents the width of this element's border-right.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -602,15 +632,15 @@
} else {
widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderRightWidth);
}
-
+
if(widthOcc == null){
return null;
} else {
return new AbsoluteNumValue(widthOcc.getValue());
}
}
-
-
+
+
// returns a ColorValue instance that represents the width of this element's border-bottom.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -621,15 +651,15 @@
} else {
widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomWidth);
}
-
+
if(widthOcc == null){
return null;
} else {
return new AbsoluteNumValue(widthOcc.getValue());
}
}
-
-
+
+
// returns a ColorValue instance that represents the width of this element's border-left.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -640,14 +670,14 @@
} else {
widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderLeftWidth);
}
-
+
if(widthOcc == null){
return null;
} else {
return new AbsoluteNumValue(widthOcc.getValue());
}
}
-
+
// returns a NumUnitValue instance that represents the radius of this element's border.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
@@ -660,7 +690,7 @@
} else {
radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderRadius);
}
-
+
if(radiusOcc == null && styleClass != null){
return null;
} else if(radiusOcc == null) {
@@ -669,8 +699,8 @@
return new NumUnitValue(radiusOcc.getValue());
}
}
-
-
+
+
// returns a NumUnitValue instance that represents the radius of this element's border-top-left.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -681,15 +711,15 @@
} else {
radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopLeftRadius);
}
-
+
if(radiusOcc == null){
return null;
} else {
return new NumUnitValue(radiusOcc.getValue());
}
}
-
-
+
+
// returns a NumUnitValue instance that represents the radius of this element's border-top-right.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -700,15 +730,15 @@
} else {
radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopRightRadius);
}
-
+
if(radiusOcc == null){
return null;
} else {
return new NumUnitValue(radiusOcc.getValue());
}
}
-
-
+
+
// returns a NumUnitValue instance that represents the radius of this element's border-bottom-left.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -719,15 +749,15 @@
} else {
radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomLeftRadius);
}
-
+
if(radiusOcc == null){
return null;
} else {
return new NumUnitValue(radiusOcc.getValue());
}
}
-
-
+
+
// returns a NumUnitValue instance that represents the radius of this element's border-bottom-right.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -738,7 +768,7 @@
} else {
radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomRightRadius);
}
-
+
if(radiusOcc == null){
return null;
} else {
@@ -746,7 +776,7 @@
}
}
-
+
// returns a NumUnitValue instance that represents the padding of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
@@ -758,7 +788,7 @@
} else {
paddingOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlPadding);
}
-
+
if(paddingOcc == null && styleClass != null){
return null;
} else if(paddingOcc == null) {
@@ -767,8 +797,8 @@
return new NumUnitValue(paddingOcc.getValue());
}
}
-
-
+
+
// returns a NumUnitValue instance that represents the padding of this element's top.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -779,15 +809,15 @@
} else {
paddingOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlPaddingTop);
}
-
+
if(paddingOcc == null){
return null;
} else {
return new NumUnitValue(paddingOcc.getValue());
}
}
-
-
+
+
// returns a NumUnitValue instance that represents the padding of this element's right.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -798,7 +828,7 @@
} else {
paddingOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlPaddingRight);
}
-
+
if(paddingOcc == null){
return null;
} else {
@@ -806,7 +836,7 @@
}
}
-
+
// returns a NumUnitValue instance that represents the padding of this element's bottom.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -817,15 +847,15 @@
} else {
paddingOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlPaddingBottom);
}
-
+
if(paddingOcc == null){
return null;
} else {
return new NumUnitValue(paddingOcc.getValue());
}
}
-
-
+
+
// returns a NumUnitValue instance that represents the padding of this element's left.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
@@ -836,7 +866,7 @@
} else {
paddingOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlPaddingLeft);
}
-
+
if(paddingOcc == null){
return null;
} else {
@@ -856,7 +886,7 @@
} else {
widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlWidth);
}
-
+
if(widthOcc == null && styleClass != null){
return null;
} else if(widthOcc == null) {
@@ -865,8 +895,8 @@
return new AutoNumUnitValue(widthOcc.getValue());
}
}
-
-
+
+
// returns an AutoNumUnitValue instance that represents the min-width of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
@@ -878,7 +908,7 @@
} else {
widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlMinWidth);
}
-
+
if(widthOcc == null && styleClass != null){
return null;
} else if(widthOcc == null) {
@@ -887,8 +917,8 @@
return new AutoNumUnitValue(widthOcc.getValue());
}
}
-
-
+
+
// returns an AutoNumUnitValue instance that represents the max-width of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
@@ -900,7 +930,7 @@
} else {
widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlMaxWidth);
}
-
+
if(widthOcc == null && styleClass != null){
return null;
} else if(widthOcc == null) {
@@ -909,8 +939,8 @@
return new AutoNumUnitValue(widthOcc.getValue());
}
}
-
-
+
+
// returns an AutoNumUnitValue instance that represents the height of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
@@ -922,7 +952,7 @@
} else {
heightOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlHeight);
}
-
+
if(heightOcc == null && styleClass != null){
return null;
} else if(heightOcc == null) {
@@ -931,8 +961,8 @@
return new AutoNumUnitValue(heightOcc.getValue());
}
}
-
-
+
+
// returns an AutoNumUnitValue instance that represents the min-height of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
@@ -944,7 +974,7 @@
} else {
heightOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlMinHeight);
}
-
+
if(heightOcc == null && styleClass != null){
return null;
} else if(heightOcc == null) {
@@ -953,8 +983,8 @@
return new AutoNumUnitValue(heightOcc.getValue());
}
}
-
-
+
+
// returns an AutoNumUnitValue instance that represents the max-height of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
@@ -966,7 +996,7 @@
} else {
heightOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlMaxHeight);
}
-
+
if(heightOcc == null && styleClass != null){
return null;
} else if(heightOcc == null) {
@@ -975,7 +1005,7 @@
return new AutoNumUnitValue(heightOcc.getValue());
}
}
-
+
// returns a CursorValue instance that represents the cursor of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
@@ -988,7 +1018,7 @@
} else {
cursorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlCursor);
}
-
+
if(cursorOcc == null && styleClass != null){
return null;
} else if(cursorOcc == null) {
@@ -998,14 +1028,14 @@
return CursorValue.valueOf(cursorOcc.getValue().toUpperCase().replace("-", "_"));
}catch(IllegalArgumentException e){
String values = "auto, default, crosshair, pointer, move, n-resize, ne-resize," +
- "nw-resize, e-resize, se-resize, s-resize, sw-resize, w-resize," +
- "text, wait, help, or progress";
+ "nw-resize, e-resize, se-resize, s-resize, sw-resize, w-resize," +
+ "text, wait, help, or progress";
throw new InvalidGdlSchemaException("cursor must be set to one of " + values + ", but is " + cursorOcc.getValue());
}
}
}
-
-
+
+
// returns a ColorValue instance that represents the background-color of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
@@ -1017,7 +1047,7 @@
} else {
colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBackgroundColor);
}
-
+
if(colorOcc == null && styleClass != null){
return null;
} else if(colorOcc == null) {
@@ -1026,7 +1056,7 @@
return new ColorValue(colorOcc.getValue());
}
}
-
+
// returns an Overflow instance that represents the overflow property of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
@@ -1039,7 +1069,7 @@
} else {
overflowOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlOverflow);
}
-
+
if(overflowOcc == null && styleClass != null){
return null;
} else if(overflowOcc == null) {
@@ -1057,544 +1087,315 @@
}
}
}
-
-
+
+
// sets the id property of this element by using the GWT DOM class
public void setId(String id){
if(id != null){
DOM.setElementProperty(this.getElement(), "id", id);
}
}
-
-
+
+
// sets the display style property of this element by using the GWT DOM class
public void setDisplay(Display display){
if(display != null){
DOM.setStyleAttribute(this.getElement(), "display", display.getCssName());
}
}
-
-
+
+
// sets the z-index style property of this element by using the GWT DOM class
public void setZindex(AutoNumValue value){
if(value != null){
DOM.setStyleAttribute(this.getElement(), "zIndex", value.getCssValue());
}
}
-
-
+
+
// sets the float style property of this element by using the GWT DOM class
public void setFloat(Float value){
if(value != null){
DOM.setStyleAttribute(this.getElement(), "float", value.getCssName());
}
}
-
-
+
+
// sets the clear style property of this element by using the GWT DOM class
public void setClear(ClearValue value){
if(value != null){
DOM.setStyleAttribute(this.getElement(), "clear", value.getCssValue());
}
}
-
-
+
+
// sets the vertical-align style property of this element by using the GWT DOM class
- public void setVerticalAlign(VerticalAlign value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "verticalAlign", value.getCssName());
- } else {
- // TODO: implement
- }
- }
+ public void setVerticalAlign(VerticalAlign value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "verticalAlign", value.getCssName());
}
-
-
+
+
// sets the margin style property of this element by using the GWT DOM class
- public void setMargin(NumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "margin", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setMargin(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "margin", value.getCssValue());
}
-
-
+
+
// sets the margin-top style property of this element by using the GWT DOM class
- public void setMarginTop(NumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "marginTop", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setMarginTop(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "marginTop", value.getCssValue());
}
-
-
+
+
// sets the margin-right style property of this element by using the GWT DOM class
- public void setMarginRight(NumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "marginRight", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setMarginRight(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "marginRight", value.getCssValue());
}
-
-
+
+
// sets the margin-bottom style property of this element by using the GWT DOM class
- public void setMarginBottom(NumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "marginBottom", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setMarginBottom(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "marginBottom", value.getCssValue());
}
-
-
+
+
// sets the margin-left style property of this element by using the GWT DOM class
- public void setMarginLeft(NumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "marginLeft", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setMarginLeft(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "marginLeft", value.getCssValue());
}
-
-
+
+
// sets the border-color style property of this element by using the GWT DOM class
- public void setBorderColor(ColorValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderColor", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderColor(ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderColor", value.getCssValue());
}
-
+
// sets the border-top-color style property of this element by using the GWT DOM class
- public void setBorderTopColor(ColorValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderTopColor", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderTopColor(ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderTopColor", value.getCssValue());
}
-
-
+
+
// sets the border-right-color style property of this element by using the GWT DOM class
- public void setBorderRightColor(ColorValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderRightColor", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderRightColor(ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderRightColor", value.getCssValue());
}
-
-
+
+
// sets the border-bottom-color style property of this element by using the GWT DOM class
- public void setBorderBottomColor(ColorValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderBottomColor", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderBottomColor(ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderBottomColor", value.getCssValue());
}
-
-
+
+
// sets the border-left-color style property of this element by using the GWT DOM class
- public void setBorderLeftColor(ColorValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderLeftColor", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderLeftColor(ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderLeftColor", value.getCssValue());
}
-
-
+
+
// sets the border-style style property of this element by using the GWT DOM class
- public void setBorderStyle(BorderStyleValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderStyle", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderStyle(BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderStyle", value.getCssValue());
}
-
-
+
+
// sets the border-top-style style property of this element by using the GWT DOM class
- public void setBorderTopStyle(BorderStyleValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderTopStyle", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderTopStyle(BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderTopStyle", value.getCssValue());
}
-
-
+
+
// sets the border-right-style style property of this element by using the GWT DOM class
- public void setBorderRightStyle(BorderStyleValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderRightStyle", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderRightStyle(BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderRightStyle", value.getCssValue());
}
-
-
+
+
// sets the border-bottom-style style property of this element by using the GWT DOM class
- public void setBorderBottomStyle(BorderStyleValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderBottomStyle", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderBottomStyle(BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderBottomStyle", value.getCssValue());
}
-
-
+
+
// sets the border-left-style style property of this element by using the GWT DOM class
- public void setBorderLeftStyle(BorderStyleValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderLeftStyle", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderLeftStyle(BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderLeftStyle", value.getCssValue());
}
-
+
// sets the border-width style property of this element by using the GWT DOM class
- public void setBorderWidth(AbsoluteNumValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderWidth", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderWidth(AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderWidth", value.getCssValue());
}
-
-
+
+
// sets the border-width style property of this element by using the GWT DOM class
- public void setBorderTopWidth(AbsoluteNumValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderTopWidth", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderTopWidth(AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderTopWidth", value.getCssValue());
}
-
-
+
+
// sets the border-width style property of this element by using the GWT DOM class
- public void setBorderRightWidth(AbsoluteNumValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderRightWidth", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderRightWidth(AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderRightWidth", value.getCssValue());
}
-
-
+
+
// sets the border-width style property of this element by using the GWT DOM class
- public void setBorderBottomWidth(AbsoluteNumValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderBottomWidth", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderBottomWidth(AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderBottomWidth", value.getCssValue());
}
-
-
+
+
// sets the border-width style property of this element by using the GWT DOM class
- public void setBorderLeftWidth(AbsoluteNumValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderLeftWidth", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderLeftWidth(AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderLeftWidth", value.getCssValue());
}
-
-
+
+
// sets the border-radius style property of this element by using the GWT DOM class
- public void setBorderRadius(NumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderRadius", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderRadius(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderRadius", value.getCssValue());
}
-
-
+
+
// sets the border-top-right-radius style property of this element by using the GWT DOM class
- public void setBorderTopRightRadius(NumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderTopRightRadius", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderTopRightRadius(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderTopRightRadius", value.getCssValue());
}
-
-
+
+
// sets the border-bottom-right-radius style property of this element by using the GWT DOM class
- public void setBorderBottomRightRadius(NumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderBottomRightRadius", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderBottomRightRadius(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderBottomRightRadius", value.getCssValue());
}
-
-
+
+
// sets the border-bottom-left-radius style property of this element by using the GWT DOM class
- public void setBorderBottomLeftRadius(NumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderBottomLeftRadius", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderBottomLeftRadius(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderBottomLeftRadius", value.getCssValue());
}
-
-
+
+
// sets the border-top-left-radius style property of this element by using the GWT DOM class
- public void setBorderTopLeftRadius(NumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "borderTopLeftRadius", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBorderTopLeftRadius(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "borderTopLeftRadius", value.getCssValue());
}
-
-
+
+
// sets the padding style property of this element by using the GWT DOM class
- public void setPadding(NumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "padding", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setPadding(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "padding", value.getCssValue());
}
-
-
+
+
// sets the padding-top style property of this element by using the GWT DOM class
- public void setPaddingTop(NumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "paddingTop", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setPaddingTop(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "paddingTop", value.getCssValue());
}
-
-
+
+
// sets the padding-right style property of this element by using the GWT DOM class
- public void setPaddingRight(NumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "paddingRight", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setPaddingRight(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "paddingRight", value.getCssValue());
}
-
-
+
+
// sets the padding-bottom style property of this element by using the GWT DOM class
- public void setPaddingBottom(NumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "paddingBottom", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setPaddingBottom(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "paddingBottom", value.getCssValue());
}
-
-
+
+
// sets the padding-left style property of this element by using the GWT DOM class
- public void setPaddingLeft(NumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "paddingLeft", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setPaddingLeft(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "paddingLeft", value.getCssValue());
}
-
+
// sets the width style property of this element by using the GWT DOM class
- public void setWidth(AutoNumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "width", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setWidth(AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "width", value.getCssValue());
}
-
-
+
+
// sets the min-width style property of this element by using the GWT DOM class
- public void setMinWidth(AutoNumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "minWidth", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setMinWidth(AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "minWidth", value.getCssValue());
}
-
-
+
+
// sets the max-width style property of this element by using the GWT DOM class
- public void setMaxWidth(AutoNumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "maxWidth", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setMaxWidth(AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "maxHeight", value.getCssValue());
}
-
-
+
+
// sets the height style property of this element by using the GWT DOM class
- public void setHeight(AutoNumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "height", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setHeight(AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "height", value.getCssValue());
}
-
-
+
+
// sets the min-height style property of this element by using the GWT DOM class
- public void setMinHeight(AutoNumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "minHeight", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setMinHeight(AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "minHeight", value.getCssValue());
}
-
-
+
+
// sets the max-height style property of this element by using the GWT DOM class
- public void setMaxHeight(AutoNumUnitValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "maxHeight", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setMaxHeight(AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "maxHeight", value.getCssValue());
}
-
-
+
+
// sets the cursor style property of this element by using the GWT DOM class
- public void setCursor(CursorValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "cursor", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setCursor(CursorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "cursor", value.getCssValue());
}
-
-
+
+
// sets the background-color style property of this element by using the GWT DOM class
- public void setBackgroundColor(ColorValue value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "backgroundColor", value.getCssValue());
- } else {
- // TODO: implement
- }
- }
+ public void setBackgroundColor(ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "backgroundColor", value.getCssValue());
}
-
-
+
+
// sets the overflow style property of this element by using the GWT DOM class
- public void setOverflow(Overflow value, String styleClass){
- if(value != null){
- if(styleClass == null){
- DOM.setStyleAttribute(this.getElement(), "overlof", value.getCssName());
- } else {
- // TODO: implement
- }
+ public void setOverflow(Overflow value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "overflow", value.getCssName());
+ }
+
+
+ // sets the passed css style porperty to the passed css value.
+ // If a styleClass is given, the style is applied to either active, hover or focus
+ private void setCssProperty(String styleClass, String cssProperty, String cssValue)throws InvalidGdlSchemaException, ExecutionException{
+ if(cssValue == null || cssProperty == null) return;
+
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), cssProperty, cssValue);
+ } else if(styleClass.equals(GdlPsis.Scope.gdlActive)){
+ this.activeStyleHandler.addCssStyle(new Pair<String, String>(cssProperty, cssValue));
+ } else if(styleClass.equals(GdlPsis.Scope.gdlFocus)){
+ this.focusStyleHandler.addCssStyle(new Pair<String, String>(cssProperty, cssValue));
+ } else if (styleClass.equals(GdlPsis.Scope.gdlHover)){
+ this.hoverStyleHandler.addCssStyle(new Pair<String, String>(cssProperty, cssValue));
+ } else {
+ String values = GdlPsis.Scope.gdlActive + ", " + GdlPsis.Scope.gdlFocus + ", " + GdlPsis.Scope.gdlHover;
+ throw new InvalidGdlSchemaException("GDL defines only the style classes " + values + ", but found " + styleClass);
}
}
-
-
-
-
-
-
- // TODO: handle styleClass in the setterMethods
-
-
-
-
-
- public void setGdlStyle() throws InvalidGdlSchemaException {
+
+
+ // sets all GDL styles that are defined by the topic map representative
+ public void setGdlStyle() throws InvalidGdlSchemaException, ExecutionException {
this.setDisplay(this.getDisplay());
this.setZindex(this.getZindex());
this.setFloat(this.getFloat());
this.setClear(this.getClear());
-
+
String[] styleClasses = new String[]{null, GdlPsis.Scope.gdlActive, GdlPsis.Scope.gdlFocus, GdlPsis.Scope.gdlHover};
for (String styleClass : styleClasses) {
this.setVerticalAlign(this.getVerticalAlign(styleClass), styleClass);
@@ -1638,5 +1439,148 @@
this.setBackgroundColor(this.getBackgroundColor(styleClass), styleClass);
this.setOverflow(this.getOverflow(styleClass), styleClass);
}
+
+ // registers the handlers for the CSS pseudo classes
+ this.addMouseDownHandler(this.activeStyleHandler);
+ this.addMouseUpHandler(this.activeStyleHandler);
+ this.addFocusHandler(this.focusStyleHandler);
+ this.addBlurHandler(this.focusStyleHandler);
+ this.addMouseOutHandler(this.hoverStyleHandler);
+ this.addMouseOverHandler(this.hoverStyleHandler);
+ }
+
+
+ // registers a click handler for this element
+ @Override
+ public HandlerRegistration addClickHandler(ClickHandler handler) {
+ return this.addDomHandler(handler, ClickEvent.getType());
+ }
+
+
+ // registers a mouse out handler on this element
+ @Override
+ public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {
+ return this.addDomHandler(handler, MouseOutEvent.getType());
+ }
+
+
+ // registers a mouse over handler on this element
+ @Override
+ public HandlerRegistration addMouseOverHandler(MouseOverHandler handler) {
+ return this.addDomHandler(handler, MouseOverEvent.getType());
+ }
+
+
+ // registers a focus handler on this element
+ @Override
+ public HandlerRegistration addFocusHandler(FocusHandler handler) {
+ return this.addDomHandler(handler, FocusEvent.getType());
+ }
+
+
+ // registers a mouse down handler on this element
+ @Override
+ public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) {
+ return this.addDomHandler(handler, MouseDownEvent.getType());
+ }
+
+
+ // registers a mouse down handler on this element
+ @Override
+ public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
+ return this.addDomHandler(handler, MouseUpEvent.getType());
+ }
+
+
+ // registers a blur on this element
+ @Override
+ public HandlerRegistration addBlurHandler(BlurHandler handler) {
+ return this.addDomHandler(handler, BlurEvent.getType());
+ }
+
+
+ // this class is used as base for all style handlers, so a style property
+ // can be added to a style handler by adding a Pair<String, String> instance
+ protected class CssStyleHandler{
+ private ArrayList<Pair<String, String>> cssNameAndValues = new ArrayList<Pair<String,String>>();
+ private ArrayList<Pair<String, String>> cssPreviousNameAndValues = new ArrayList<Pair<String,String>>();
+
+
+ // adds a CSS name value pair
+ public void addCssStyle(Pair<String, String> cssNameAndValue) {
+ if(cssNameAndValue != null && cssNameAndValue.getFirst() != null && cssNameAndValue.getSecond() != null){
+ this.cssNameAndValues.add(cssNameAndValue);
+ }
+ }
+
+
+ // sets the stored CSS name/value pairs
+ public void setStyles(){
+ for (Pair<String, String> cssNameValue : this.cssNameAndValues) {
+ Pair<String, String> oldNameValue = null;
+ String oldVal = DOM.getStyleAttribute(GdlVisibleObject.this.getElement(), cssNameValue.getFirst());
+ if(oldVal != null && oldVal.length() != 0){
+ oldNameValue = new Pair<String, String>(cssNameValue.getFirst(), oldVal);
+ this.cssPreviousNameAndValues.add(oldNameValue);
+ }
+ DOM.setStyleAttribute(GdlVisibleObject.this.getElement(), cssNameValue.getFirst(), cssNameValue.getSecond());
+ }
+ }
+
+
+ // must sets the original style that is bound to the non-pseudo-class name space
+ public void unsetStyles(){
+ for (Pair<String, String> oldNameValue : this.cssPreviousNameAndValues) {
+ DOM.setStyleAttribute(GdlVisibleObject.this.getElement(), oldNameValue.getFirst(), oldNameValue.getSecond());
+ }
+ }
+ }
+
+
+ // this class is used to set the style of focused elements
+ protected class FocusStyleHandler extends CssStyleHandler implements FocusHandler, BlurHandler{
+
+ @Override
+ public void onFocus(FocusEvent event) {
+ super.setStyles();
+ }
+
+
+ @Override
+ public void onBlur(BlurEvent event) {
+ super.unsetStyles();
+ }
+ }
+
+
+ // this class is used to set the style of hovered elements
+ protected class HoverStyleHandler extends CssStyleHandler implements MouseOverHandler, MouseOutHandler {
+
+ @Override
+ public void onMouseOut(MouseOutEvent event) {
+ super.unsetStyles();
+ }
+
+ @Override
+ public void onMouseOver(MouseOverEvent event) {
+ super.setStyles();
+ }
+ }
+
+
+ // this class is used to set the style of active elements
+ protected class ActiveStyleHandler extends CssStyleHandler implements MouseDownHandler, MouseUpHandler {
+
+
+ @Override
+ public void onMouseUp(MouseUpEvent event) {
+ super.unsetStyles();
+ }
+
+ @Override
+ public void onMouseDown(MouseDownEvent event) {
+ super.setStyles();
+ }
+
}
}
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 Sun Jul 3 23:00:30 2011 (r554)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Mon Jul 4 07:26:24 2011 (r555)
@@ -1,6 +1,7 @@
package us.isidor.gdl.anaToMia.Widgets.base;
import us.isidor.gdl.anaToMia.TmEngine.jtmsBasedEngine.JtmsTmEngine;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.Widgets.isidorus.LoadSchemaCallback;
import us.isidor.gdl.anaToMia.Widgets.values.CursorValue;
@@ -20,38 +21,39 @@
@Override
public void onModuleLoad() {
- Window.alert("TEST !!!");
- RootPanel.get("GWT_Content").add(mainPanel);
- mainPanel.setBorderWidth(1);
- mainPanel.setPixelSize(500, 500);
-
- gdlPanel = new GdlPanel("");
- gdlPanel.setPixelSize(100, 100);
- DOM.setStyleAttribute(gdlPanel.getElement(), "backgroundColor", "yellow");
- mainPanel.add(gdlPanel);
- gdlPanel.setTmEngine(new JtmsTmEngine());
-
-
- Button requestButton = new Button("start request");
- requestButton.addClickHandler(new ClickHandler() {
- @Override
- public void onClick(ClickEvent event) {
- LoadSchemaCallback callback = new LoadSchemaCallback();
- try{
- callback.loadSchema(gdlPanel, "", new String[]{});
- }catch(Exception e){
- Window.alert("cought error: " + e.getLocalizedMessage());
+ try{
+ Window.alert("TEST !!!");
+ RootPanel.get("GWT_Content").add(mainPanel);
+ mainPanel.setBorderWidth(1);
+ mainPanel.setPixelSize(500, 500);
+
+ gdlPanel = new GdlPanel("");
+ gdlPanel.setPixelSize(100, 100);
+ DOM.setStyleAttribute(gdlPanel.getElement(), "backgroundColor", "yellow");
+ mainPanel.add(gdlPanel);
+ gdlPanel.setTmEngine(new JtmsTmEngine());
+
+
+ Button requestButton = new Button("start request");
+ requestButton.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ LoadSchemaCallback callback = new LoadSchemaCallback();
+ try{
+ callback.loadSchema(gdlPanel, "", new String[]{});
+ }catch(Exception e){
+ Window.alert("cought error: " + e.getLocalizedMessage());
+ }
}
- }
- });
-
- mainPanel.add(requestButton);
+ });
+
+ mainPanel.add(requestButton);
// only for testing
- try{
+
Topic tmpRepresentative = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator("http://test.org/test-top"));
Topic gdlBackgroundColor = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlBackgroundColor));
Topic gdlId = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlId));
@@ -69,6 +71,10 @@
Topic gdlBorderBottomColor = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlBorderBottomColor));
Topic gdlBorderStyle = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlBorderStyle));
Topic gdlBorderWidth = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlBorderWidth));
+ Topic gdlHover = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.Scope.gdlHover));
+ Topic gdlActive = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.Scope.gdlActive));
+ Topic gdlFocus = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.Scope.gdlFocus));
+
tmpRepresentative.createOccurrence(gdlBackgroundColor, "red", null);
tmpRepresentative.createOccurrence(gdlId, "ID_1", null);
@@ -86,15 +92,15 @@
tmpRepresentative.createOccurrence(gdlBorderBottomColor, "rgb(100%, 100%, 0%)", null);
tmpRepresentative.createOccurrence(gdlBorderStyle, "dashed", null);
tmpRepresentative.createOccurrence(gdlBorderWidth, "5px", null);
-
- GdlVisibleObject tmp = new GdlVisibleObject(tmpRepresentative){};
-
-
+ Occurrence bgcHover = tmpRepresentative.createOccurrence(gdlBackgroundColor, "green", null);
+ bgcHover.addTheme(gdlHover);
+ Occurrence bgcActive = tmpRepresentative.createOccurrence(gdlBackgroundColor, "purple", null);
+ bgcActive.addTheme(gdlActive);
+ Occurrence bgcFocus = tmpRepresentative.createOccurrence(gdlBackgroundColor, "silver", null);
+ bgcFocus.addTheme(gdlFocus);
-
-
-
+ GdlVisibleObject tmp = new GdlVisibleObject(tmpRepresentative){};
this.mainPanel.add(tmp);
}catch(Exception e){
e.printStackTrace();
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlAssociationView.java Sun Jul 3 23:00:30 2011 (r554)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlAssociationView.java Mon Jul 4 07:26:24 2011 (r555)
@@ -1,12 +1,13 @@
package us.isidor.gdl.anaToMia.Widgets.views;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
public abstract class GdlAssociationView extends GdlView {
- public GdlAssociationView(Topic tmRepresentative) throws InvalidGdlSchemaException {
+ public GdlAssociationView(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException {
super(tmRepresentative);
// TODO Auto-generated constructor stub
}
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 Sun Jul 3 23:00:30 2011 (r554)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Mon Jul 4 07:26:24 2011 (r555)
@@ -7,12 +7,13 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
public class GdlCreatorAssociationView extends GdlAssociationView {
- public GdlCreatorAssociationView(Topic tmRepresentative) throws InvalidGdlSchemaException {
+ public GdlCreatorAssociationView(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException {
super(tmRepresentative);
// TODO Auto-generated constructor stub
}
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 Sun Jul 3 23:00:30 2011 (r554)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Mon Jul 4 07:26:24 2011 (r555)
@@ -6,13 +6,14 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
public class GdlDefaultCreatorTopicView extends GdlDefaultTopicView{
// TODO: implement
- public GdlDefaultCreatorTopicView(Topic tmRepresentative) throws InvalidGdlSchemaException {
+ public GdlDefaultCreatorTopicView(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException {
super(tmRepresentative);
// TODO Auto-generated constructor stub
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultEditorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultEditorTopicView.java Sun Jul 3 23:00:30 2011 (r554)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultEditorTopicView.java Mon Jul 4 07:26:24 2011 (r555)
@@ -6,12 +6,13 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
public abstract class GdlDefaultEditorTopicView extends GdlDefaultTopicView {
- public GdlDefaultEditorTopicView(Topic tmRepresentative) throws InvalidGdlSchemaException {
+ public GdlDefaultEditorTopicView(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException {
super(tmRepresentative);
// TODO Auto-generated constructor stub
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultTopicView.java Sun Jul 3 23:00:30 2011 (r554)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultTopicView.java Mon Jul 4 07:26:24 2011 (r555)
@@ -1,11 +1,12 @@
package us.isidor.gdl.anaToMia.Widgets.views;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
public abstract class GdlDefaultTopicView extends GdlTopicView {
- public GdlDefaultTopicView(Topic tmRepresentative) throws InvalidGdlSchemaException {
+ public GdlDefaultTopicView(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException {
super(tmRepresentative);
// TODO Auto-generated constructor stub
}
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 Sun Jul 3 23:00:30 2011 (r554)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Mon Jul 4 07:26:24 2011 (r555)
@@ -7,12 +7,13 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
public class GdlEditorAssociationView extends GdlAssociationView {
- public GdlEditorAssociationView(Topic tmRepresentative) throws InvalidGdlSchemaException {
+ public GdlEditorAssociationView(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException {
super(tmRepresentative);
// TODO Auto-generated constructor stub
}
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 Sun Jul 3 23:00:30 2011 (r554)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Mon Jul 4 07:26:24 2011 (r555)
@@ -6,12 +6,13 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
public class GdlSpecialCreatorTopicView extends GdlSpecialTopicView{
// TODO: implement
- public GdlSpecialCreatorTopicView(Topic tmRepresentative) throws InvalidGdlSchemaException {
+ public GdlSpecialCreatorTopicView(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException {
super(tmRepresentative);
// TODO Auto-generated constructor stub
}
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 Sun Jul 3 23:00:30 2011 (r554)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Mon Jul 4 07:26:24 2011 (r555)
@@ -6,6 +6,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
@@ -13,7 +14,7 @@
// TODO: implement
- public GdlSpecialEditorTopicView(Topic tmRepresentative) throws InvalidGdlSchemaException {
+ public GdlSpecialEditorTopicView(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException {
super(tmRepresentative);
// TODO Auto-generated constructor stub
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialTopicView.java Sun Jul 3 23:00:30 2011 (r554)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialTopicView.java Mon Jul 4 07:26:24 2011 (r555)
@@ -1,11 +1,12 @@
package us.isidor.gdl.anaToMia.Widgets.views;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
public abstract class GdlSpecialTopicView extends GdlTopicView {
- public GdlSpecialTopicView(Topic tmRepresentative) throws InvalidGdlSchemaException {
+ public GdlSpecialTopicView(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException {
super(tmRepresentative);
// TODO Auto-generated constructor stub
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlTopicView.java Sun Jul 3 23:00:30 2011 (r554)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlTopicView.java Mon Jul 4 07:26:24 2011 (r555)
@@ -1,12 +1,13 @@
package us.isidor.gdl.anaToMia.Widgets.views;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
public abstract class GdlTopicView extends GdlView {
- public GdlTopicView(Topic tmRepresentative) throws InvalidGdlSchemaException{
+ public GdlTopicView(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
super(tmRepresentative);
// TODO Auto-generated constructor stub
}
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 Sun Jul 3 23:00:30 2011 (r554)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Mon Jul 4 07:26:24 2011 (r555)
@@ -10,6 +10,7 @@
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.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
@@ -21,7 +22,7 @@
- public GdlView(Topic tmRepresentative) throws InvalidGdlSchemaException{
+ public GdlView(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
super(tmRepresentative);
// TODO: implement
}
@@ -55,6 +56,9 @@
public abstract void deregisterButtonCallback(ClickHandler handler, String id);
+ // TODO: implement addXYZhandler(handler, id);
+
+
// hierarchy
//
1
0

[isidorus-cvs] r554 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base
by lgiessmann@common-lisp.net 04 Jul '11
by lgiessmann@common-lisp.net 04 Jul '11
04 Jul '11
Author: lgiessmann
Date: Sun Jul 3 23:00:30 2011
New Revision: 554
Log:
gdl-frontend: Widgets: started to implement style setters for the GDL/CSS pseudo style classes
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.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 1 15:01:50 2011 (r553)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Sun Jul 3 23:00:30 2011 (r554)
@@ -1100,321 +1100,481 @@
// sets the vertical-align style property of this element by using the GWT DOM class
- public void setVerticalAlign(VerticalAlign value){
+ public void setVerticalAlign(VerticalAlign value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "verticalAlign", value.getCssName());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "verticalAlign", value.getCssName());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the margin style property of this element by using the GWT DOM class
- public void setMargin(NumUnitValue value){
+ public void setMargin(NumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "margin", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "margin", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the margin-top style property of this element by using the GWT DOM class
- public void setMarginTop(NumUnitValue value){
+ public void setMarginTop(NumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "marginTop", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "marginTop", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the margin-right style property of this element by using the GWT DOM class
- public void setMarginRight(NumUnitValue value){
+ public void setMarginRight(NumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "marginRight", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "marginRight", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the margin-bottom style property of this element by using the GWT DOM class
- public void setMarginBottom(NumUnitValue value){
+ public void setMarginBottom(NumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "marginBottom", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "marginBottom", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the margin-left style property of this element by using the GWT DOM class
- public void setMarginLeft(NumUnitValue value){
+ public void setMarginLeft(NumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "marginLeft", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "marginLeft", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-color style property of this element by using the GWT DOM class
- public void setBorderColor(ColorValue value){
+ public void setBorderColor(ColorValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderColor", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderColor", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-top-color style property of this element by using the GWT DOM class
- public void setBorderTopColor(ColorValue value){
+ public void setBorderTopColor(ColorValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderTopColor", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderTopColor", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-right-color style property of this element by using the GWT DOM class
- public void setBorderRightColor(ColorValue value){
+ public void setBorderRightColor(ColorValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderRightColor", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderRightColor", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-bottom-color style property of this element by using the GWT DOM class
- public void setBorderBottomColor(ColorValue value){
+ public void setBorderBottomColor(ColorValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderBottomColor", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderBottomColor", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-left-color style property of this element by using the GWT DOM class
- public void setBorderLeftColor(ColorValue value){
+ public void setBorderLeftColor(ColorValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderLeftColor", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderLeftColor", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-style style property of this element by using the GWT DOM class
- public void setBorderStyle(BorderStyleValue value){
+ public void setBorderStyle(BorderStyleValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderStyle", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderStyle", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-top-style style property of this element by using the GWT DOM class
- public void setBorderTopStyle(BorderStyleValue value){
+ public void setBorderTopStyle(BorderStyleValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderTopStyle", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderTopStyle", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-right-style style property of this element by using the GWT DOM class
- public void setBorderRightStyle(BorderStyleValue value){
+ public void setBorderRightStyle(BorderStyleValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderRightStyle", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderRightStyle", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-bottom-style style property of this element by using the GWT DOM class
- public void setBorderBottomStyle(BorderStyleValue value){
+ public void setBorderBottomStyle(BorderStyleValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderBottomStyle", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderBottomStyle", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-left-style style property of this element by using the GWT DOM class
- public void setBorderLeftStyle(BorderStyleValue value){
+ public void setBorderLeftStyle(BorderStyleValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderLeftStyle", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderLeftStyle", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-width style property of this element by using the GWT DOM class
- public void setBorderWidth(AbsoluteNumValue value){
+ public void setBorderWidth(AbsoluteNumValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderWidth", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderWidth", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-width style property of this element by using the GWT DOM class
- public void setBorderTopWidth(AbsoluteNumValue value){
+ public void setBorderTopWidth(AbsoluteNumValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderTopWidth", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderTopWidth", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-width style property of this element by using the GWT DOM class
- public void setBorderRightWidth(AbsoluteNumValue value){
+ public void setBorderRightWidth(AbsoluteNumValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderRightWidth", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderRightWidth", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-width style property of this element by using the GWT DOM class
- public void setBorderBottomWidth(AbsoluteNumValue value){
+ public void setBorderBottomWidth(AbsoluteNumValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderBottomWidth", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderBottomWidth", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-width style property of this element by using the GWT DOM class
- public void setBorderLeftWidth(AbsoluteNumValue value){
+ public void setBorderLeftWidth(AbsoluteNumValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderLeftWidth", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderLeftWidth", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-radius style property of this element by using the GWT DOM class
- public void setBorderRadius(NumUnitValue value){
+ public void setBorderRadius(NumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderRadius", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderRadius", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-top-right-radius style property of this element by using the GWT DOM class
- public void setBorderTopRightRadius(NumUnitValue value){
+ public void setBorderTopRightRadius(NumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderTopRightRadius", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderTopRightRadius", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-bottom-right-radius style property of this element by using the GWT DOM class
- public void setBorderBottomRightRadius(NumUnitValue value){
+ public void setBorderBottomRightRadius(NumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderBottomRightRadius", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderBottomRightRadius", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-bottom-left-radius style property of this element by using the GWT DOM class
- public void setBorderBottomLeftRadius(NumUnitValue value){
+ public void setBorderBottomLeftRadius(NumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderBottomLeftRadius", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderBottomLeftRadius", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the border-top-left-radius style property of this element by using the GWT DOM class
- public void setBorderTopLeftRadius(NumUnitValue value){
+ public void setBorderTopLeftRadius(NumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "borderTopLeftRadius", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "borderTopLeftRadius", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the padding style property of this element by using the GWT DOM class
- public void setPadding(NumUnitValue value){
+ public void setPadding(NumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "padding", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "padding", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the padding-top style property of this element by using the GWT DOM class
- public void setPaddingTop(NumUnitValue value){
+ public void setPaddingTop(NumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "paddingTop", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "paddingTop", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the padding-right style property of this element by using the GWT DOM class
- public void setPaddingRight(NumUnitValue value){
+ public void setPaddingRight(NumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "paddingRight", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "paddingRight", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the padding-bottom style property of this element by using the GWT DOM class
- public void setPaddingBottom(NumUnitValue value){
+ public void setPaddingBottom(NumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "paddingBottom", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "paddingBottom", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the padding-left style property of this element by using the GWT DOM class
- public void setPaddingLeft(NumUnitValue value){
+ public void setPaddingLeft(NumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "paddingLeft", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "paddingLeft", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the width style property of this element by using the GWT DOM class
- public void setWidth(AutoNumUnitValue value){
+ public void setWidth(AutoNumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "width", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "width", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the min-width style property of this element by using the GWT DOM class
- public void setMinWidth(AutoNumUnitValue value){
+ public void setMinWidth(AutoNumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "minWidth", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "minWidth", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the max-width style property of this element by using the GWT DOM class
- public void setMaxWidth(AutoNumUnitValue value){
+ public void setMaxWidth(AutoNumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "maxWidth", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "maxWidth", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the height style property of this element by using the GWT DOM class
- public void setHeight(AutoNumUnitValue value){
+ public void setHeight(AutoNumUnitValue value, String styleClass){
if(value != null){
+ if(styleClass == null){
DOM.setStyleAttribute(this.getElement(), "height", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the min-height style property of this element by using the GWT DOM class
- public void setMinHeight(AutoNumUnitValue value){
+ public void setMinHeight(AutoNumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "minHeight", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "minHeight", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the max-height style property of this element by using the GWT DOM class
- public void setMaxHeight(AutoNumUnitValue value){
+ public void setMaxHeight(AutoNumUnitValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "maxHeight", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "maxHeight", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the cursor style property of this element by using the GWT DOM class
- public void setCursor(CursorValue value){
+ public void setCursor(CursorValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "cursor", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "cursor", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the background-color style property of this element by using the GWT DOM class
- public void setBackgroundColor(ColorValue value){
+ public void setBackgroundColor(ColorValue value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "backgroundColor", value.getCssValue());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "backgroundColor", value.getCssValue());
+ } else {
+ // TODO: implement
+ }
}
}
// sets the overflow style property of this element by using the GWT DOM class
- public void setOverflow(Overflow value){
+ public void setOverflow(Overflow value, String styleClass){
if(value != null){
- DOM.setStyleAttribute(this.getElement(), "overlof", value.getCssName());
+ if(styleClass == null){
+ DOM.setStyleAttribute(this.getElement(), "overlof", value.getCssName());
+ } else {
+ // TODO: implement
+ }
}
}
@@ -1434,45 +1594,49 @@
this.setZindex(this.getZindex());
this.setFloat(this.getFloat());
this.setClear(this.getClear());
- this.setVerticalAlign(this.getVerticalAlign(null));
- this.setMargin(this.getMargin(null));
- this.setMarginTop(this.getMarginTop(null));
- this.setMarginRight(this.getMarginRight(null));
- this.setMarginBottom(this.getMarginBottom(null));
- this.setMarginLeft(this.getMarginLeft(null));
- this.setBorderColor(this.getBorderColor(null));
- this.setBorderTopColor(this.getBorderTopColor(null));
- this.setBorderRightColor(this.getBorderRightColor(null));
- this.setBorderBottomColor(this.getBorderBottomColor(null));
- this.setBorderLeftColor(this.getBorderLeftColor(null));
- this.setBorderStyle(this.getBorderStyle(null));
- this.setBorderTopStyle(this.getBorderTopStyle(null));
- this.setBorderRightStyle(this.getBorderRightStyle(null));
- this.setBorderBottomStyle(this.getBorderBottomStyle(null));
- this.setBorderLeftStyle(this.getBorderLeftStyle(null));
- this.setBorderWidth(this.getBorderWidth(null));
- this.setBorderTopWidth(this.getBorderTopWidth(null));
- this.setBorderRightWidth(this.getBorderRightWidth(null));
- this.setBorderBottomWidth(this.getBorderBottomWidth(null));
- this.setBorderLeftWidth(this.getBorderLeftWidth(null));
- this.setBorderRadius(this.getBorderRadius(null));
- this.setBorderTopRightRadius(this.getBorderTopRightRadius(null));
- this.setBorderBottomRightRadius(this.getBorderBottomRightRadius(null));
- this.setBorderBottomLeftRadius(this.getBorderBottomLeftRadius(null));
- this.setBorderTopLeftRadius(this.getBorderTopLeftRadius(null));
- this.setPadding(this.getPadding(null));
- this.setPaddingTop(this.getPaddingTop(null));
- this.setPaddingRight(this.getPaddingRight(null));
- this.setPaddingBottom(this.getPaddingBottom(null));
- this.setPaddingLeft(this.getPaddingLeft(null));
- this.setWidth(this.getWidth(null));
- this.setMinWidth(this.getMinWidth(null));
- this.setMaxWidth(this.getMaxWidth(null));
- this.setHeight(this.getHeight(null));
- this.setMinHeight(this.getMinHeight(null));
- this.setMaxHeight(this.getMaxHeight(null));
- this.setCursor(this.getCursor(null));
- this.setBackgroundColor(this.getBackgroundColor(null));
- this.setOverflow(this.getOverflow(null));
+
+ String[] styleClasses = new String[]{null, GdlPsis.Scope.gdlActive, GdlPsis.Scope.gdlFocus, GdlPsis.Scope.gdlHover};
+ for (String styleClass : styleClasses) {
+ this.setVerticalAlign(this.getVerticalAlign(styleClass), styleClass);
+ this.setMargin(this.getMargin(styleClass), styleClass);
+ this.setMarginTop(this.getMarginTop(styleClass), styleClass);
+ this.setMarginRight(this.getMarginRight(styleClass), styleClass);
+ this.setMarginBottom(this.getMarginBottom(styleClass), styleClass);
+ this.setMarginLeft(this.getMarginLeft(styleClass), styleClass);
+ this.setBorderColor(this.getBorderColor(styleClass), styleClass);
+ this.setBorderTopColor(this.getBorderTopColor(styleClass), styleClass);
+ this.setBorderRightColor(this.getBorderRightColor(styleClass), styleClass);
+ this.setBorderBottomColor(this.getBorderBottomColor(styleClass), styleClass);
+ this.setBorderLeftColor(this.getBorderLeftColor(styleClass), styleClass);
+ this.setBorderStyle(this.getBorderStyle(styleClass), styleClass);
+ this.setBorderTopStyle(this.getBorderTopStyle(styleClass), styleClass);
+ this.setBorderRightStyle(this.getBorderRightStyle(styleClass), styleClass);
+ this.setBorderBottomStyle(this.getBorderBottomStyle(styleClass), styleClass);
+ this.setBorderLeftStyle(this.getBorderLeftStyle(styleClass), styleClass);
+ this.setBorderWidth(this.getBorderWidth(styleClass), styleClass);
+ this.setBorderTopWidth(this.getBorderTopWidth(styleClass), styleClass);
+ this.setBorderRightWidth(this.getBorderRightWidth(styleClass), styleClass);
+ this.setBorderBottomWidth(this.getBorderBottomWidth(styleClass), styleClass);
+ this.setBorderLeftWidth(this.getBorderLeftWidth(styleClass), styleClass);
+ this.setBorderRadius(this.getBorderRadius(styleClass), styleClass);
+ this.setBorderTopRightRadius(this.getBorderTopRightRadius(styleClass), styleClass);
+ this.setBorderBottomRightRadius(this.getBorderBottomRightRadius(styleClass), styleClass);
+ this.setBorderBottomLeftRadius(this.getBorderBottomLeftRadius(styleClass), styleClass);
+ this.setBorderTopLeftRadius(this.getBorderTopLeftRadius(styleClass), styleClass);
+ this.setPadding(this.getPadding(styleClass), styleClass);
+ this.setPaddingTop(this.getPaddingTop(styleClass), styleClass);
+ this.setPaddingRight(this.getPaddingRight(styleClass), styleClass);
+ this.setPaddingBottom(this.getPaddingBottom(styleClass), styleClass);
+ this.setPaddingLeft(this.getPaddingLeft(styleClass), styleClass);
+ this.setWidth(this.getWidth(styleClass), styleClass);
+ this.setMinWidth(this.getMinWidth(styleClass), styleClass);
+ this.setMaxWidth(this.getMaxWidth(styleClass), styleClass);
+ this.setHeight(this.getHeight(styleClass), styleClass);
+ this.setMinHeight(this.getMinHeight(styleClass), styleClass);
+ this.setMaxHeight(this.getMaxHeight(styleClass), styleClass);
+ this.setCursor(this.getCursor(styleClass), styleClass);
+ this.setBackgroundColor(this.getBackgroundColor(styleClass), styleClass);
+ this.setOverflow(this.getOverflow(styleClass), styleClass);
+ }
}
}
1
0

[isidorus-cvs] r553 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base values
by lgiessmann@common-lisp.net 01 Jul '11
by lgiessmann@common-lisp.net 01 Jul '11
01 Jul '11
Author: lgiessmann
Date: Fri Jul 1 15:01:50 2011
New Revision: 553
Log:
gdl-frontend: Widgets: implemented the method setGdlStyle, which sets all styles defined for a gdl:Visible-Object within a topic map
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/values/ColorValue.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 1 14:03:30 2011 (r552)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Fri Jul 1 15:01:50 2011 (r553)
@@ -121,7 +121,7 @@
// returns a Display instance of a gdl:display occurrence.
// If no gdl:display occurrence is set, the default value is returned
public Display getDisplay() throws InvalidGdlSchemaException {
- Occurrence displayOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlId);
+ Occurrence displayOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlDisplay);
if(displayOcc != null){
String value = displayOcc.getValue().toLowerCase();
@@ -258,8 +258,7 @@
// returns a NumUnitValue instance that represents the margin-top of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // or null. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // or null.
public NumUnitValue getMarginTop(String styleClass) throws InvalidGdlSchemaException {
Occurrence marginOcc = null;
if(styleClass != null){
@@ -268,10 +267,8 @@
marginOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlMarginTop);
}
- if(marginOcc == null && styleClass != null){
+ if(marginOcc == null){
return null;
- } else if(marginOcc == null) {
- return new NumUnitValue();
} else {
return new NumUnitValue(marginOcc.getValue());
}
@@ -280,8 +277,7 @@
// returns a NumUnitValue instance that represents the margin-right of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // or null. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // or null.
public NumUnitValue getMarginRight(String styleClass) throws InvalidGdlSchemaException {
Occurrence marginOcc = null;
if(styleClass != null){
@@ -290,10 +286,8 @@
marginOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlMarginRight);
}
- if(marginOcc == null && styleClass != null){
+ if(marginOcc == null){
return null;
- } else if(marginOcc == null) {
- return new NumUnitValue();
} else {
return new NumUnitValue(marginOcc.getValue());
}
@@ -302,8 +296,7 @@
// returns a NumUnitValue instance that represents the margin-bottom of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // or null. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // or null.
public NumUnitValue getMarginBottom(String styleClass) throws InvalidGdlSchemaException {
Occurrence marginOcc = null;
if(styleClass != null){
@@ -312,10 +305,8 @@
marginOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlMarginBottom);
}
- if(marginOcc == null && styleClass != null){
+ if(marginOcc == null){
return null;
- } else if(marginOcc == null) {
- return new NumUnitValue();
} else {
return new NumUnitValue(marginOcc.getValue());
}
@@ -324,8 +315,7 @@
// returns a NumUnitValue instance that represents the margin-left of this element.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // or null. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // or null.
public NumUnitValue getMarginLeft(String styleClass) throws InvalidGdlSchemaException {
Occurrence marginOcc = null;
if(styleClass != null){
@@ -334,10 +324,8 @@
marginOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlMarginLeft);
}
- if(marginOcc == null && styleClass != null){
+ if(marginOcc == null){
return null;
- } else if(marginOcc == null) {
- return new NumUnitValue();
} else {
return new NumUnitValue(marginOcc.getValue());
}
@@ -356,10 +344,8 @@
colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderColor);
}
- if(colorOcc == null && styleClass != null){
+ if(colorOcc == null ){
return null;
- } else if(colorOcc == null) {
- return new ColorValue();
} else {
return new ColorValue(colorOcc.getValue());
}
@@ -368,8 +354,7 @@
// returns a ColorValue instance that represents the color of this element's border-top.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public ColorValue getBorderTopColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
@@ -378,10 +363,8 @@
colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopColor);
}
- if(colorOcc == null && styleClass != null){
+ if(colorOcc == null ){
return null;
- } else if(colorOcc == null) {
- return new ColorValue();
} else {
return new ColorValue(colorOcc.getValue());
}
@@ -390,8 +373,7 @@
// returns a ColorValue instance that represents the color of this element's border-right.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public ColorValue getBorderRightColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
@@ -400,10 +382,8 @@
colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderRightColor);
}
- if(colorOcc == null && styleClass != null){
+ if(colorOcc == null ){
return null;
- } else if(colorOcc == null) {
- return new ColorValue();
} else {
return new ColorValue(colorOcc.getValue());
}
@@ -412,8 +392,7 @@
// returns a ColorValue instance that represents the color of this element's border-bottom.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public ColorValue getBorderBottomColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
@@ -422,10 +401,8 @@
colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomColor);
}
- if(colorOcc == null && styleClass != null){
+ if(colorOcc == null ){
return null;
- } else if(colorOcc == null) {
- return new ColorValue();
} else {
return new ColorValue(colorOcc.getValue());
}
@@ -434,8 +411,7 @@
// returns a ColorValue instance that represents the color of this element's border-left.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public ColorValue getBorderLeftColor(String styleClass) throws InvalidGdlSchemaException {
Occurrence colorOcc = null;
if(styleClass != null){
@@ -444,10 +420,8 @@
colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderLeftColor);
}
- if(colorOcc == null && styleClass != null){
+ if(colorOcc == null ){
return null;
- } else if(colorOcc == null) {
- return new ColorValue();
} else {
return new ColorValue(colorOcc.getValue());
}
@@ -472,7 +446,7 @@
return BorderStyleValue.NONE;
} else {
try{
- return BorderStyleValue.valueOf(styleOcc.getValue());
+ return BorderStyleValue.valueOf(styleOcc.getValue().toUpperCase());
}catch(IllegalArgumentException e){
String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
throw new InvalidGdlSchemaException("border-style must be set to one of " + values + ", but is " + styleOcc.getValue());
@@ -483,8 +457,7 @@
// returns a ColorValue instance that represents the style of this element's border-top.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public BorderStyleValue getBorderTopStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
@@ -493,13 +466,11 @@
styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopStyle);
}
- if(styleOcc == null && styleClass != null){
+ if(styleOcc == null){
return null;
- } else if(styleOcc == null) {
- return BorderStyleValue.NONE;
} else {
try{
- return BorderStyleValue.valueOf(styleOcc.getValue());
+ return BorderStyleValue.valueOf(styleOcc.getValue().toUpperCase());
}catch(IllegalArgumentException e){
String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
throw new InvalidGdlSchemaException("border-top-style must be set to one of " + values + ", but is " + styleOcc.getValue());
@@ -510,8 +481,7 @@
// returns a ColorValue instance that represents the style of this element's border-right.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public BorderStyleValue getBorderRightStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
@@ -520,13 +490,11 @@
styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderRightStyle);
}
- if(styleOcc == null && styleClass != null){
+ if(styleOcc == null){
return null;
- } else if(styleOcc == null) {
- return BorderStyleValue.NONE;
} else {
try{
- return BorderStyleValue.valueOf(styleOcc.getValue());
+ return BorderStyleValue.valueOf(styleOcc.getValue().toUpperCase());
}catch(IllegalArgumentException e){
String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
throw new InvalidGdlSchemaException("border-right-style must be set to one of " + values + ", but is " + styleOcc.getValue());
@@ -537,8 +505,7 @@
// returns a ColorValue instance that represents the style of this element's border-bottom.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public BorderStyleValue getBorderBottomStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
@@ -547,13 +514,11 @@
styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomStyle);
}
- if(styleOcc == null && styleClass != null){
+ if(styleOcc == null){
return null;
- } else if(styleOcc == null) {
- return BorderStyleValue.NONE;
} else {
try{
- return BorderStyleValue.valueOf(styleOcc.getValue());
+ return BorderStyleValue.valueOf(styleOcc.getValue().toUpperCase());
}catch(IllegalArgumentException e){
String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
throw new InvalidGdlSchemaException("border-bottom-style must be set to one of " + values + ", but is " + styleOcc.getValue());
@@ -564,8 +529,7 @@
// returns a ColorValue instance that represents the style of this element's border-left.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public BorderStyleValue getBorderLeftStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
@@ -574,13 +538,11 @@
styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderLeftStyle);
}
- if(styleOcc == null && styleClass != null){
+ if(styleOcc == null){
return null;
- } else if(styleOcc == null) {
- return BorderStyleValue.NONE;
} else {
try{
- return BorderStyleValue.valueOf(styleOcc.getValue());
+ return BorderStyleValue.valueOf(styleOcc.getValue().toUpperCase());
}catch(IllegalArgumentException e){
String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
throw new InvalidGdlSchemaException("border-left-style must be set to one of " + values + ", but is " + styleOcc.getValue());
@@ -613,8 +575,7 @@
// returns a ColorValue instance that represents the width of this element's border-top.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public AbsoluteNumValue getBorderTopWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
@@ -623,10 +584,8 @@
widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopWidth);
}
- if(widthOcc == null && styleClass != null){
+ if(widthOcc == null){
return null;
- } else if(widthOcc == null) {
- return new AbsoluteNumValue();
} else {
return new AbsoluteNumValue(widthOcc.getValue());
}
@@ -635,8 +594,7 @@
// returns a ColorValue instance that represents the width of this element's border-right.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public AbsoluteNumValue getBorderRightWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
@@ -645,10 +603,8 @@
widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderRightWidth);
}
- if(widthOcc == null && styleClass != null){
+ if(widthOcc == null){
return null;
- } else if(widthOcc == null) {
- return new AbsoluteNumValue();
} else {
return new AbsoluteNumValue(widthOcc.getValue());
}
@@ -657,8 +613,7 @@
// returns a ColorValue instance that represents the width of this element's border-bottom.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public AbsoluteNumValue getBorderBottomWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
@@ -667,10 +622,8 @@
widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomWidth);
}
- if(widthOcc == null && styleClass != null){
+ if(widthOcc == null){
return null;
- } else if(widthOcc == null) {
- return new AbsoluteNumValue();
} else {
return new AbsoluteNumValue(widthOcc.getValue());
}
@@ -679,8 +632,7 @@
// returns a ColorValue instance that represents the width of this element's border-left.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public AbsoluteNumValue getBorderLeftWidth(String styleClass) throws InvalidGdlSchemaException {
Occurrence widthOcc = null;
if(styleClass != null){
@@ -689,10 +641,8 @@
widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderLeftWidth);
}
- if(widthOcc == null && styleClass != null){
+ if(widthOcc == null){
return null;
- } else if(widthOcc == null) {
- return new AbsoluteNumValue();
} else {
return new AbsoluteNumValue(widthOcc.getValue());
}
@@ -723,8 +673,7 @@
// returns a NumUnitValue instance that represents the radius of this element's border-top-left.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public NumUnitValue getBorderTopLeftRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
@@ -733,10 +682,8 @@
radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopLeftRadius);
}
- if(radiusOcc == null && styleClass != null){
+ if(radiusOcc == null){
return null;
- } else if(radiusOcc == null) {
- return new NumUnitValue();
} else {
return new NumUnitValue(radiusOcc.getValue());
}
@@ -745,8 +692,7 @@
// returns a NumUnitValue instance that represents the radius of this element's border-top-right.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public NumUnitValue getBorderTopRightRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
@@ -755,10 +701,8 @@
radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopRightRadius);
}
- if(radiusOcc == null && styleClass != null){
+ if(radiusOcc == null){
return null;
- } else if(radiusOcc == null) {
- return new NumUnitValue();
} else {
return new NumUnitValue(radiusOcc.getValue());
}
@@ -767,8 +711,7 @@
// returns a NumUnitValue instance that represents the radius of this element's border-bottom-left.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public NumUnitValue getBorderBottomLeftRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
@@ -777,10 +720,8 @@
radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomLeftRadius);
}
- if(radiusOcc == null && styleClass != null){
+ if(radiusOcc == null){
return null;
- } else if(radiusOcc == null) {
- return new NumUnitValue();
} else {
return new NumUnitValue(radiusOcc.getValue());
}
@@ -789,8 +730,7 @@
// returns a NumUnitValue instance that represents the radius of this element's border-bottom-right.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public NumUnitValue getBorderBottomRightRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
@@ -799,10 +739,8 @@
radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomRightRadius);
}
- if(radiusOcc == null && styleClass != null){
+ if(radiusOcc == null){
return null;
- } else if(radiusOcc == null) {
- return new NumUnitValue();
} else {
return new NumUnitValue(radiusOcc.getValue());
}
@@ -833,8 +771,7 @@
// returns a NumUnitValue instance that represents the padding of this element's top.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public NumUnitValue getPaddingTop(String styleClass) throws InvalidGdlSchemaException {
Occurrence paddingOcc = null;
if(styleClass != null){
@@ -843,10 +780,8 @@
paddingOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlPaddingTop);
}
- if(paddingOcc == null && styleClass != null){
+ if(paddingOcc == null){
return null;
- } else if(paddingOcc == null) {
- return new NumUnitValue();
} else {
return new NumUnitValue(paddingOcc.getValue());
}
@@ -855,8 +790,7 @@
// returns a NumUnitValue instance that represents the padding of this element's right.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public NumUnitValue getPaddingRight(String styleClass) throws InvalidGdlSchemaException {
Occurrence paddingOcc = null;
if(styleClass != null){
@@ -865,10 +799,8 @@
paddingOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlPaddingRight);
}
- if(paddingOcc == null && styleClass != null){
+ if(paddingOcc == null){
return null;
- } else if(paddingOcc == null) {
- return new NumUnitValue();
} else {
return new NumUnitValue(paddingOcc.getValue());
}
@@ -877,8 +809,7 @@
// returns a NumUnitValue instance that represents the padding of this element's bottom.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public NumUnitValue getPaddingBottom(String styleClass) throws InvalidGdlSchemaException {
Occurrence paddingOcc = null;
if(styleClass != null){
@@ -887,10 +818,8 @@
paddingOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlPaddingBottom);
}
- if(paddingOcc == null && styleClass != null){
+ if(paddingOcc == null){
return null;
- } else if(paddingOcc == null) {
- return new NumUnitValue();
} else {
return new NumUnitValue(paddingOcc.getValue());
}
@@ -899,8 +828,7 @@
// returns a NumUnitValue instance that represents the padding of this element's left.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
+ // null, null otherwise.
public NumUnitValue getPaddingLeft(String styleClass) throws InvalidGdlSchemaException {
Occurrence paddingOcc = null;
if(styleClass != null){
@@ -909,10 +837,8 @@
paddingOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlPaddingLeft);
}
- if(paddingOcc == null && styleClass != null){
+ if(paddingOcc == null){
return null;
- } else if(paddingOcc == null) {
- return new NumUnitValue();
} else {
return new NumUnitValue(paddingOcc.getValue());
}
@@ -1109,9 +1035,9 @@
public Overflow getOverflow(String styleClass) throws InvalidGdlSchemaException {
Occurrence overflowOcc = null;
if(styleClass != null){
- overflowOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlCursor, styleClass);
+ overflowOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlOverflow, styleClass);
} else {
- overflowOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlCursor);
+ overflowOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlOverflow);
}
if(overflowOcc == null && styleClass != null){
@@ -1504,10 +1430,49 @@
public void setGdlStyle() throws InvalidGdlSchemaException {
- // TODO: implement
-
+ this.setDisplay(this.getDisplay());
+ this.setZindex(this.getZindex());
+ this.setFloat(this.getFloat());
+ this.setClear(this.getClear());
+ this.setVerticalAlign(this.getVerticalAlign(null));
+ this.setMargin(this.getMargin(null));
+ this.setMarginTop(this.getMarginTop(null));
+ this.setMarginRight(this.getMarginRight(null));
+ this.setMarginBottom(this.getMarginBottom(null));
+ this.setMarginLeft(this.getMarginLeft(null));
+ this.setBorderColor(this.getBorderColor(null));
+ this.setBorderTopColor(this.getBorderTopColor(null));
+ this.setBorderRightColor(this.getBorderRightColor(null));
+ this.setBorderBottomColor(this.getBorderBottomColor(null));
+ this.setBorderLeftColor(this.getBorderLeftColor(null));
+ this.setBorderStyle(this.getBorderStyle(null));
+ this.setBorderTopStyle(this.getBorderTopStyle(null));
+ this.setBorderRightStyle(this.getBorderRightStyle(null));
+ this.setBorderBottomStyle(this.getBorderBottomStyle(null));
+ this.setBorderLeftStyle(this.getBorderLeftStyle(null));
+ this.setBorderWidth(this.getBorderWidth(null));
+ this.setBorderTopWidth(this.getBorderTopWidth(null));
+ this.setBorderRightWidth(this.getBorderRightWidth(null));
+ this.setBorderBottomWidth(this.getBorderBottomWidth(null));
+ this.setBorderLeftWidth(this.getBorderLeftWidth(null));
+ this.setBorderRadius(this.getBorderRadius(null));
+ this.setBorderTopRightRadius(this.getBorderTopRightRadius(null));
+ this.setBorderBottomRightRadius(this.getBorderBottomRightRadius(null));
+ this.setBorderBottomLeftRadius(this.getBorderBottomLeftRadius(null));
+ this.setBorderTopLeftRadius(this.getBorderTopLeftRadius(null));
+ this.setPadding(this.getPadding(null));
+ this.setPaddingTop(this.getPaddingTop(null));
+ this.setPaddingRight(this.getPaddingRight(null));
+ this.setPaddingBottom(this.getPaddingBottom(null));
+ this.setPaddingLeft(this.getPaddingLeft(null));
this.setWidth(this.getWidth(null));
+ this.setMinWidth(this.getMinWidth(null));
+ this.setMaxWidth(this.getMaxWidth(null));
this.setHeight(this.getHeight(null));
+ this.setMinHeight(this.getMinHeight(null));
+ this.setMaxHeight(this.getMaxHeight(null));
+ this.setCursor(this.getCursor(null));
this.setBackgroundColor(this.getBackgroundColor(null));
+ this.setOverflow(this.getOverflow(null));
}
}
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 1 14:03:30 2011 (r552)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Fri Jul 1 15:01:50 2011 (r553)
@@ -3,12 +3,8 @@
import us.isidor.gdl.anaToMia.TmEngine.jtmsBasedEngine.JtmsTmEngine;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.Widgets.isidorus.LoadSchemaCallback;
-import us.isidor.gdl.anaToMia.Widgets.values.ClearValue;
-import us.isidor.gdl.anaToMia.Widgets.values.ColorValue;
import us.isidor.gdl.anaToMia.Widgets.values.CursorValue;
-
import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.DOM;
@@ -61,11 +57,35 @@
Topic gdlId = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlId));
Topic gdlWidth = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlWidth));
Topic gdlHeight = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlHeight));
+ Topic gdlBorderRadius = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlBorderRadius));
+ Topic gdlBorderBottomRightRadius = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlBorderBottomRightRadius));
+ Topic gdlPadding = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlPadding));
+ Topic gdlPaddingLeft = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlPaddingLeft));
+ Topic gdlCursor = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlCursor));
+ Topic gdlMarginTop = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlMarginTop));
+ Topic gdlBorderColor = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlBorderColor));
+ Topic gdlBorderTopColor = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlBorderTopColor));
+ Topic gdlBorderRightColor = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlBorderRightColor));
+ Topic gdlBorderBottomColor = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlBorderBottomColor));
+ Topic gdlBorderStyle = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlBorderStyle));
+ Topic gdlBorderWidth = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlBorderWidth));
+
tmpRepresentative.createOccurrence(gdlBackgroundColor, "red", null);
tmpRepresentative.createOccurrence(gdlId, "ID_1", null);
tmpRepresentative.createOccurrence(gdlWidth, "300px", null);
tmpRepresentative.createOccurrence(gdlHeight, "300px", null);
-
+ tmpRepresentative.createOccurrence(gdlBorderRadius, "30px", null);
+ tmpRepresentative.createOccurrence(gdlBorderBottomRightRadius, "2%", null);
+ tmpRepresentative.createOccurrence(gdlPadding, "5px", null);
+ tmpRepresentative.createOccurrence(gdlPaddingLeft, "5%", null);
+ tmpRepresentative.createOccurrence(gdlCursor, CursorValue.HELP.getCssValue(), null);
+ tmpRepresentative.createOccurrence(gdlMarginTop, "50pt", null);
+ tmpRepresentative.createOccurrence(gdlBorderColor, "lime", null);
+ tmpRepresentative.createOccurrence(gdlBorderTopColor, "#00f", null);
+ tmpRepresentative.createOccurrence(gdlBorderRightColor, "rgb(0, 255, 0)", null);
+ tmpRepresentative.createOccurrence(gdlBorderBottomColor, "rgb(100%, 100%, 0%)", null);
+ tmpRepresentative.createOccurrence(gdlBorderStyle, "dashed", null);
+ tmpRepresentative.createOccurrence(gdlBorderWidth, "5px", null);
GdlVisibleObject tmp = new GdlVisibleObject(tmpRepresentative){};
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ColorValue.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ColorValue.java Fri Jul 1 14:03:30 2011 (r552)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ColorValue.java Fri Jul 1 15:01:50 2011 (r553)
@@ -21,14 +21,14 @@
this.stringValue = value;
}else if(value.matches("^#[0-9A-F]{3}$")) {
this.stringValue = "#" + value.charAt(1) + value.charAt(1) + value.charAt(2) + value.charAt(2) + value.charAt(3) + value.charAt(3);
- }else if(value.matches("^rgb\\( *\\+?[0-9]{1,3} *, *\\+?[0-9]{1,3} *, *\\+?[0-9]{1,3} *\\)$")){
+ }else if(value.matches("^RGB\\( *\\+?[0-9]{1,3} *, *\\+?[0-9]{1,3} *, *\\+?[0-9]{1,3} *\\)$")){
String[] rgb = value.substring(4, value.length() - 1).split(",");
this.stringValue = "#" + decToHexIntegerString(rgb[0]) + decToHexIntegerString(rgb[1]) + decToHexIntegerString(rgb[2]);
- }else if(value.matches("^rgb\\( *\\+?[0-9]{1,3}% *, *\\+?[0-9]{1,3}% *, *\\+?[0-9]{1,3}% *\\)$")){
+ }else if(value.matches("^RGB\\( *\\+?[0-9]{1,3}% *, *\\+?[0-9]{1,3}% *, *\\+?[0-9]{1,3}% *\\)$")){
String[] rgb = value.substring(4, value.length() - 1).split(",");
this.stringValue = "#" + percentToHexIntegerString(rgb[0]) + percentToHexIntegerString(rgb[1]) + percentToHexIntegerString(rgb[2]);
}else {
- throw new InvalidGdlSchemaException("a ColorValue must be a value of the format #RRGGBB, #RGB, rdg(rrr,ggg,bbb), rgb(rrr%,ggg%,bbb%) or a CssColor, but is " + color);
+ throw new InvalidGdlSchemaException("a color value must be a value of the format #RRGGBB, #RGB, rgb(rrr,ggg,bbb), rgb(rrr%,ggg%,bbb%) or a CssColor, but is " + color);
}
}
@@ -47,6 +47,7 @@
private String percentToHexIntegerString(String percentageString){
String rawValue = percentageString.replaceFirst("%", "").replaceFirst("\\+", "").trim();
int percentValue = Integer.valueOf(rawValue);
+ percentValue = percentValue > 100 ? 100 : percentValue;
String result = Integer.toHexString((int)(255 * ((float)percentValue / 100)));
return result.length() == 1 ? "0" + result : result;
}
1
0

[isidorus-cvs] r552 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base values
by lgiessmann@common-lisp.net 01 Jul '11
by lgiessmann@common-lisp.net 01 Jul '11
01 Jul '11
Author: lgiessmann
Date: Fri Jul 1 14:03:30 2011
New Revision: 552
Log:
gdl-frontend: Widgets: fixed a bug in the constructor AutoNumValue(String)
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/values/AutoNumUnitValue.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 1 13:42:48 2011 (r551)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Fri Jul 1 14:03:30 2011 (r552)
@@ -39,10 +39,12 @@
this.tmRepresentative = tmRepresentative;
this.tm = this.tmRepresentative.getTopicMap();
- // TODO: apply GDL style
+ this.setId(this.getId());
+ this.setGdlStyle();
}
+ // returns the topic that represents this element
public Topic getTmRepresentative(){
return this.tmRepresentative;
}
@@ -50,7 +52,9 @@
// a helper method that returns all occurrences of the type bound to the passed PSI
private JsArray<Occurrence> getOccurrences(String occurrenceType){
- return tmRepresentative.getOccurrences(tm.getTopicBySubjectIdentifier(tm.createLocator(occurrenceType)));
+ Topic occType = tm.getTopicBySubjectIdentifier(tm.createLocator(occurrenceType));
+ if(occType == null) return null;
+ else return tmRepresentative.getOccurrences(occType);
}
@@ -65,7 +69,7 @@
}
if(unscopedOccs.size() > 1){
- throw new InvalidGdlSchemaException("The topic " + GdlPsis.getAnyIdOfTopic(this.tmRepresentative) + "must be bound to none or one unscoped occurrence of the type " + occurrenceType + "but is bound " + unscopedOccs.size() + " times to it");
+ throw new InvalidGdlSchemaException("The topic " + GdlPsis.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 {
@@ -107,7 +111,7 @@
public String getId() throws InvalidGdlSchemaException {
JsArray<Occurrence> idOccs = getOccurrences(GdlPsis.OccurrenceType.gdlId);
if(idOccs.length() != 1){
- throw new InvalidGdlSchemaException("The topic " + GdlPsis.getAnyIdOfTopic(this.tmRepresentative) + "must be bound to exactly one occurrence of the type " + GdlPsis.OccurrenceType.gdlId + "but is bound " + idOccs.length() + " times to it");
+ throw new InvalidGdlSchemaException("The topic " + GdlPsis.getAnyIdOfTopic(this.tmRepresentative) + " must be bound to exactly one occurrence of the type " + GdlPsis.OccurrenceType.gdlId + ", but is bound " + idOccs.length() + " times to it");
} else {
return idOccs.get(0).getValue();
}
@@ -1499,7 +1503,11 @@
- public void setGdlStyle(){
+ public void setGdlStyle() throws InvalidGdlSchemaException {
// TODO: implement
+
+ this.setWidth(this.getWidth(null));
+ this.setHeight(this.getHeight(null));
+ this.setBackgroundColor(this.getBackgroundColor(null));
}
}
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 1 13:42:48 2011 (r551)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Fri Jul 1 14:03:30 2011 (r552)
@@ -11,13 +11,12 @@
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.RootPanel;
-import com.google.gwt.user.client.ui.Widget;
+
public class TestClass implements EntryPoint{
HorizontalPanel mainPanel = new HorizontalPanel();
@@ -59,20 +58,26 @@
try{
Topic tmpRepresentative = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator("http://test.org/test-top"));
Topic gdlBackgroundColor = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlBackgroundColor));
+ Topic gdlId = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlId));
+ Topic gdlWidth = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlWidth));
+ Topic gdlHeight = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlHeight));
tmpRepresentative.createOccurrence(gdlBackgroundColor, "red", null);
+ tmpRepresentative.createOccurrence(gdlId, "ID_1", null);
+ tmpRepresentative.createOccurrence(gdlWidth, "300px", null);
+ tmpRepresentative.createOccurrence(gdlHeight, "300px", null);
+
GdlVisibleObject tmp = new GdlVisibleObject(tmpRepresentative){};
- tmp.setPixelSize(300, 300); // TODO: remove
- DOM.setStyleAttribute(tmp.getElement(), "backgroundColor", "lime"); // TODO: remove
this.mainPanel.add(tmp);
}catch(Exception e){
+ e.printStackTrace();
Window.alert(">> e >> " + e.getClass() + " >> " + e.getMessage());
}
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/AutoNumUnitValue.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/AutoNumUnitValue.java Fri Jul 1 13:42:48 2011 (r551)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/AutoNumUnitValue.java Fri Jul 1 14:03:30 2011 (r552)
@@ -14,14 +14,14 @@
if(upperString.equals("AUTO")){
super.unit = null; // if unit is null, the default value is auto
super.value = 0f;
- }else if(value.endsWith("PX")){
- this.value = makeFloat(value, 2);
+ }else if(upperString.endsWith("PX")){
+ this.value = makeFloat(upperString, 2);
this.unit = CssUnit.PIXEL;
- }else if (value.endsWith("PT")){
- this.value = makeFloat(value, 2);
+ }else if (upperString.endsWith("PT")){
+ this.value = makeFloat(upperString, 2);
this.unit = CssUnit.POINT;
- } else if(value.endsWith("%")){
- this.value = makeFloat(value, 1);
+ } else if(upperString.endsWith("%")){
+ this.value = makeFloat(upperString, 1);
this.unit = CssUnit.PERCENTAGE;
} else {
throw new InvalidGdlSchemaException("auto numeric values supported by the GDL containing a unit definition must be of the form <numeric-value>(pt|px|%)|auto, but found: " + value);
1
0

[isidorus-cvs] r551 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base isidorus
by lgiessmann@common-lisp.net 01 Jul '11
by lgiessmann@common-lisp.net 01 Jul '11
01 Jul '11
Author: lgiessmann
Date: Fri Jul 1 13:42:48 2011
New Revision: 551
Log:
gdl-frontend: Widgets: added the last method for setting gdl attributes on gdl:Visible-Object
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/isidorus/LoadSchemaCallback.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 1 10:15:30 2011 (r550)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Fri Jul 1 13:42:48 2011 (r551)
@@ -1129,14 +1129,6 @@
}
- // sets the background-color style property of this element by using the GWT DOM class
- public void setBackgroundColor(ColorValue value){
- if(value != null){
- DOM.setStyleAttribute(this.getElement(), "backgroundColor", value.getCssValue());
- }
- }
-
-
// sets the id property of this element by using the GWT DOM class
public void setId(String id){
if(id != null){
@@ -1424,10 +1416,89 @@
}
}
+
+ // sets the width style property of this element by using the GWT DOM class
+ public void setWidth(AutoNumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "width", value.getCssValue());
+ }
+ }
+
+
+ // sets the min-width style property of this element by using the GWT DOM class
+ public void setMinWidth(AutoNumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "minWidth", value.getCssValue());
+ }
+ }
+
+
+ // sets the max-width style property of this element by using the GWT DOM class
+ public void setMaxWidth(AutoNumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "maxWidth", value.getCssValue());
+ }
+ }
+
+
+ // sets the height style property of this element by using the GWT DOM class
+ public void setHeight(AutoNumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "height", value.getCssValue());
+ }
+ }
+
+
+ // sets the min-height style property of this element by using the GWT DOM class
+ public void setMinHeight(AutoNumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "minHeight", value.getCssValue());
+ }
+ }
+
+
+ // sets the max-height style property of this element by using the GWT DOM class
+ public void setMaxHeight(AutoNumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "maxHeight", value.getCssValue());
+ }
+ }
+
+
+ // sets the cursor style property of this element by using the GWT DOM class
+ public void setCursor(CursorValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "cursor", value.getCssValue());
+ }
+ }
+
+
+ // sets the background-color style property of this element by using the GWT DOM class
+ public void setBackgroundColor(ColorValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "backgroundColor", value.getCssValue());
+ }
+ }
+
+
+ // sets the overflow style property of this element by using the GWT DOM class
+ public void setOverflow(Overflow value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "overlof", value.getCssName());
+ }
+ }
+
+
+
+
+
// TODO: handle styleClass in the setterMethods
+
+
+
public void setGdlStyle(){
// TODO: implement
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/LoadSchemaCallback.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/LoadSchemaCallback.java Fri Jul 1 10:15:30 2011 (r550)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/LoadSchemaCallback.java Fri Jul 1 13:42:48 2011 (r551)
@@ -9,7 +9,6 @@
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
import com.google.gwt.http.client.URL;
-import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Window;
import us.isidor.gdl.anaToMia.Widgets.base.ButtonDialog;
import us.isidor.gdl.anaToMia.Widgets.base.GdlPanel;
1
0

[isidorus-cvs] r550 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base
by lgiessmann@common-lisp.net 01 Jul '11
by lgiessmann@common-lisp.net 01 Jul '11
01 Jul '11
Author: lgiessmann
Date: Fri Jul 1 10:15:30 2011
New Revision: 550
Log:
gdl-frontend: Widgets: implemented some methods that set the element's 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
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 1 09:05:04 2011 (r549)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Fri Jul 1 10:15:30 2011 (r550)
@@ -1177,6 +1177,257 @@
}
+ // sets the vertical-align style property of this element by using the GWT DOM class
+ public void setVerticalAlign(VerticalAlign value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "verticalAlign", value.getCssName());
+ }
+ }
+
+
+ // sets the margin style property of this element by using the GWT DOM class
+ public void setMargin(NumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "margin", value.getCssValue());
+ }
+ }
+
+
+ // sets the margin-top style property of this element by using the GWT DOM class
+ public void setMarginTop(NumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "marginTop", value.getCssValue());
+ }
+ }
+
+
+ // sets the margin-right style property of this element by using the GWT DOM class
+ public void setMarginRight(NumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "marginRight", value.getCssValue());
+ }
+ }
+
+
+ // sets the margin-bottom style property of this element by using the GWT DOM class
+ public void setMarginBottom(NumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "marginBottom", value.getCssValue());
+ }
+ }
+
+
+ // sets the margin-left style property of this element by using the GWT DOM class
+ public void setMarginLeft(NumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "marginLeft", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-color style property of this element by using the GWT DOM class
+ public void setBorderColor(ColorValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderColor", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-top-color style property of this element by using the GWT DOM class
+ public void setBorderTopColor(ColorValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderTopColor", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-right-color style property of this element by using the GWT DOM class
+ public void setBorderRightColor(ColorValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderRightColor", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-bottom-color style property of this element by using the GWT DOM class
+ public void setBorderBottomColor(ColorValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderBottomColor", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-left-color style property of this element by using the GWT DOM class
+ public void setBorderLeftColor(ColorValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderLeftColor", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-style style property of this element by using the GWT DOM class
+ public void setBorderStyle(BorderStyleValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderStyle", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-top-style style property of this element by using the GWT DOM class
+ public void setBorderTopStyle(BorderStyleValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderTopStyle", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-right-style style property of this element by using the GWT DOM class
+ public void setBorderRightStyle(BorderStyleValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderRightStyle", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-bottom-style style property of this element by using the GWT DOM class
+ public void setBorderBottomStyle(BorderStyleValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderBottomStyle", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-left-style style property of this element by using the GWT DOM class
+ public void setBorderLeftStyle(BorderStyleValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderLeftStyle", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-width style property of this element by using the GWT DOM class
+ public void setBorderWidth(AbsoluteNumValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderWidth", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-width style property of this element by using the GWT DOM class
+ public void setBorderTopWidth(AbsoluteNumValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderTopWidth", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-width style property of this element by using the GWT DOM class
+ public void setBorderRightWidth(AbsoluteNumValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderRightWidth", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-width style property of this element by using the GWT DOM class
+ public void setBorderBottomWidth(AbsoluteNumValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderBottomWidth", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-width style property of this element by using the GWT DOM class
+ public void setBorderLeftWidth(AbsoluteNumValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderLeftWidth", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-radius style property of this element by using the GWT DOM class
+ public void setBorderRadius(NumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderRadius", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-top-right-radius style property of this element by using the GWT DOM class
+ public void setBorderTopRightRadius(NumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderTopRightRadius", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-bottom-right-radius style property of this element by using the GWT DOM class
+ public void setBorderBottomRightRadius(NumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderBottomRightRadius", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-bottom-left-radius style property of this element by using the GWT DOM class
+ public void setBorderBottomLeftRadius(NumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderBottomLeftRadius", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-top-left-radius style property of this element by using the GWT DOM class
+ public void setBorderTopLeftRadius(NumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "borderTopLeftRadius", value.getCssValue());
+ }
+ }
+
+
+ // sets the padding style property of this element by using the GWT DOM class
+ public void setPadding(NumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "padding", value.getCssValue());
+ }
+ }
+
+
+ // sets the padding-top style property of this element by using the GWT DOM class
+ public void setPaddingTop(NumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "paddingTop", value.getCssValue());
+ }
+ }
+
+
+ // sets the padding-right style property of this element by using the GWT DOM class
+ public void setPaddingRight(NumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "paddingRight", value.getCssValue());
+ }
+ }
+
+
+ // sets the padding-bottom style property of this element by using the GWT DOM class
+ public void setPaddingBottom(NumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "paddingBottom", value.getCssValue());
+ }
+ }
+
+
+ // sets the padding-left style property of this element by using the GWT DOM class
+ public void setPaddingLeft(NumUnitValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "paddingLeft", value.getCssValue());
+ }
+ }
+
+
+ // TODO: handle styleClass in the setterMethods
+
+
public void setGdlStyle(){
// TODO: implement
}
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 1 09:05:04 2011 (r549)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Fri Jul 1 10:15:30 2011 (r550)
@@ -11,11 +11,13 @@
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.client.ui.Widget;
public class TestClass implements EntryPoint{
HorizontalPanel mainPanel = new HorizontalPanel();
@@ -59,14 +61,17 @@
Topic gdlBackgroundColor = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlBackgroundColor));
tmpRepresentative.createOccurrence(gdlBackgroundColor, "red", null);
- GdlVisibleObject tmp = new GdlVisibleObject(tmpRepresentative) {
- };
+ GdlVisibleObject tmp = new GdlVisibleObject(tmpRepresentative){};
+
+
+
+ tmp.setPixelSize(300, 300); // TODO: remove
+ DOM.setStyleAttribute(tmp.getElement(), "backgroundColor", "lime"); // TODO: remove
- tmp.setPixelSize(300, 300);
- //DOM.setStyleAttribute(tmp.getElement(), "backgroundColor", "lime");
+
+
this.mainPanel.add(tmp);
- Window.alert(CursorValue.CROSSHAIR.getCssValue());
}catch(Exception e){
Window.alert(">> e >> " + e.getClass() + " >> " + e.getMessage());
}
1
0

[isidorus-cvs] r549 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base values
by lgiessmann@common-lisp.net 01 Jul '11
by lgiessmann@common-lisp.net 01 Jul '11
01 Jul '11
Author: lgiessmann
Date: Fri Jul 1 09:05:04 2011
New Revision: 549
Log:
gdl-frontend: Widgets: implemented some methods that set the element's [id, float, clear, background-color] property; added the interface CssValue and created an inheritance to all other self-defined value-classes
Added:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/BorderStyleValue.java
- copied, changed from r543, branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/BorderStyle.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/CssValue.java
Deleted:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/BorderStyle.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/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/AbsoluteNumValue.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/AutoNumUnitValue.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/AutoNumValue.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ClearValue.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ColorValue.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/CursorValue.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/NumUnitValue.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 1 08:06:19 2011 (r548)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Fri Jul 1 09:05:04 2011 (r549)
@@ -7,7 +7,7 @@
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumValue;
-import us.isidor.gdl.anaToMia.Widgets.values.BorderStyle;
+import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue;
import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue;
import us.isidor.gdl.anaToMia.Widgets.values.ClearValue;
import us.isidor.gdl.anaToMia.Widgets.values.ColorValue;
@@ -18,6 +18,7 @@
import com.google.gwt.dom.client.Style.Float;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.VerticalAlign;
+import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Composite;
@@ -28,11 +29,13 @@
protected TopicMap tm = null;
- @SuppressWarnings("unused")
- private GdlVisibleObject() {}
+ private GdlVisibleObject() {
+ initWidget(this.mainPanel);
+ }
public GdlVisibleObject(Topic tmRepresentative) throws InvalidGdlSchemaException{
+ this();
this.tmRepresentative = tmRepresentative;
this.tm = this.tmRepresentative.getTopicMap();
@@ -451,7 +454,7 @@
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
// property is returned.
- public BorderStyle getBorderStyle(String styleClass) throws InvalidGdlSchemaException {
+ public BorderStyleValue getBorderStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
styleOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderStyle, styleClass);
@@ -462,10 +465,10 @@
if(styleOcc == null && styleClass != null){
return null;
} else if(styleOcc == null) {
- return BorderStyle.NONE;
+ return BorderStyleValue.NONE;
} else {
try{
- return BorderStyle.valueOf(styleOcc.getValue());
+ return BorderStyleValue.valueOf(styleOcc.getValue());
}catch(IllegalArgumentException e){
String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
throw new InvalidGdlSchemaException("border-style must be set to one of " + values + ", but is " + styleOcc.getValue());
@@ -478,7 +481,7 @@
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
// property is returned.
- public BorderStyle getBorderTopStyle(String styleClass) throws InvalidGdlSchemaException {
+ public BorderStyleValue getBorderTopStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
styleOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopStyle, styleClass);
@@ -489,10 +492,10 @@
if(styleOcc == null && styleClass != null){
return null;
} else if(styleOcc == null) {
- return BorderStyle.NONE;
+ return BorderStyleValue.NONE;
} else {
try{
- return BorderStyle.valueOf(styleOcc.getValue());
+ return BorderStyleValue.valueOf(styleOcc.getValue());
}catch(IllegalArgumentException e){
String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
throw new InvalidGdlSchemaException("border-top-style must be set to one of " + values + ", but is " + styleOcc.getValue());
@@ -505,7 +508,7 @@
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
// property is returned.
- public BorderStyle getBorderRightStyle(String styleClass) throws InvalidGdlSchemaException {
+ public BorderStyleValue getBorderRightStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
styleOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderRightStyle, styleClass);
@@ -516,10 +519,10 @@
if(styleOcc == null && styleClass != null){
return null;
} else if(styleOcc == null) {
- return BorderStyle.NONE;
+ return BorderStyleValue.NONE;
} else {
try{
- return BorderStyle.valueOf(styleOcc.getValue());
+ return BorderStyleValue.valueOf(styleOcc.getValue());
}catch(IllegalArgumentException e){
String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
throw new InvalidGdlSchemaException("border-right-style must be set to one of " + values + ", but is " + styleOcc.getValue());
@@ -532,7 +535,7 @@
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
// property is returned.
- public BorderStyle getBorderBottomStyle(String styleClass) throws InvalidGdlSchemaException {
+ public BorderStyleValue getBorderBottomStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
styleOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomStyle, styleClass);
@@ -543,10 +546,10 @@
if(styleOcc == null && styleClass != null){
return null;
} else if(styleOcc == null) {
- return BorderStyle.NONE;
+ return BorderStyleValue.NONE;
} else {
try{
- return BorderStyle.valueOf(styleOcc.getValue());
+ return BorderStyleValue.valueOf(styleOcc.getValue());
}catch(IllegalArgumentException e){
String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
throw new InvalidGdlSchemaException("border-bottom-style must be set to one of " + values + ", but is " + styleOcc.getValue());
@@ -559,7 +562,7 @@
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
// property is returned.
- public BorderStyle getBorderLeftStyle(String styleClass) throws InvalidGdlSchemaException {
+ public BorderStyleValue getBorderLeftStyle(String styleClass) throws InvalidGdlSchemaException {
Occurrence styleOcc = null;
if(styleClass != null){
styleOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderLeftStyle, styleClass);
@@ -570,10 +573,10 @@
if(styleOcc == null && styleClass != null){
return null;
} else if(styleOcc == null) {
- return BorderStyle.NONE;
+ return BorderStyleValue.NONE;
} else {
try{
- return BorderStyle.valueOf(styleOcc.getValue());
+ return BorderStyleValue.valueOf(styleOcc.getValue());
}catch(IllegalArgumentException e){
String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
throw new InvalidGdlSchemaException("border-left-style must be set to one of " + values + ", but is " + styleOcc.getValue());
@@ -1126,6 +1129,54 @@
}
+ // sets the background-color style property of this element by using the GWT DOM class
+ public void setBackgroundColor(ColorValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "backgroundColor", value.getCssValue());
+ }
+ }
+
+
+ // sets the id property of this element by using the GWT DOM class
+ public void setId(String id){
+ if(id != null){
+ DOM.setElementProperty(this.getElement(), "id", id);
+ }
+ }
+
+
+ // sets the display style property of this element by using the GWT DOM class
+ public void setDisplay(Display display){
+ if(display != null){
+ DOM.setStyleAttribute(this.getElement(), "display", display.getCssName());
+ }
+ }
+
+
+ // sets the z-index style property of this element by using the GWT DOM class
+ public void setZindex(AutoNumValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "zIndex", value.getCssValue());
+ }
+ }
+
+
+ // sets the float style property of this element by using the GWT DOM class
+ public void setFloat(Float value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "float", value.getCssName());
+ }
+ }
+
+
+ // sets the clear style property of this element by using the GWT DOM class
+ public void setClear(ClearValue value){
+ if(value != null){
+ DOM.setStyleAttribute(this.getElement(), "clear", value.getCssValue());
+ }
+ }
+
+
public void setGdlStyle(){
// TODO: implement
}
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 1 08:06:19 2011 (r548)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Fri Jul 1 09:05:04 2011 (r549)
@@ -1,11 +1,14 @@
package us.isidor.gdl.anaToMia.Widgets.base;
import us.isidor.gdl.anaToMia.TmEngine.jtmsBasedEngine.JtmsTmEngine;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.Widgets.isidorus.LoadSchemaCallback;
+import us.isidor.gdl.anaToMia.Widgets.values.ClearValue;
import us.isidor.gdl.anaToMia.Widgets.values.ColorValue;
import us.isidor.gdl.anaToMia.Widgets.values.CursorValue;
import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.DOM;
@@ -49,5 +52,23 @@
+
+ // only for testing
+ try{
+ Topic tmpRepresentative = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator("http://test.org/test-top"));
+ Topic gdlBackgroundColor = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlBackgroundColor));
+ tmpRepresentative.createOccurrence(gdlBackgroundColor, "red", null);
+
+ GdlVisibleObject tmp = new GdlVisibleObject(tmpRepresentative) {
+ };
+
+ tmp.setPixelSize(300, 300);
+ //DOM.setStyleAttribute(tmp.getElement(), "backgroundColor", "lime");
+
+ this.mainPanel.add(tmp);
+ Window.alert(CursorValue.CROSSHAIR.getCssValue());
+ }catch(Exception e){
+ Window.alert(">> e >> " + e.getClass() + " >> " + e.getMessage());
+ }
}
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/AbsoluteNumValue.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/AbsoluteNumValue.java Fri Jul 1 08:06:19 2011 (r548)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/AbsoluteNumValue.java Fri Jul 1 09:05:04 2011 (r549)
@@ -2,7 +2,7 @@
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
-public class AbsoluteNumValue extends NumUnitValue {
+public class AbsoluteNumValue extends NumUnitValue{
public AbsoluteNumValue() throws InvalidGdlSchemaException{
super("0px");
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/AutoNumUnitValue.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/AutoNumUnitValue.java Fri Jul 1 08:06:19 2011 (r548)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/AutoNumUnitValue.java Fri Jul 1 09:05:04 2011 (r549)
@@ -2,7 +2,7 @@
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
-public class AutoNumUnitValue extends NumUnitValue {
+public class AutoNumUnitValue extends NumUnitValue{
public AutoNumUnitValue(){
super.unit = null; // if unit is null, the default value is auto
super.value = 0f;
@@ -30,11 +30,11 @@
@Override
- public String getStringValue() {
+ public String getCssValue() {
if(super.unit == null){
return "auto";
} else {
- return super.getStringValue();
+ return super.getCssValue();
}
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/AutoNumValue.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/AutoNumValue.java Fri Jul 1 08:06:19 2011 (r548)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/AutoNumValue.java Fri Jul 1 09:05:04 2011 (r549)
@@ -3,7 +3,7 @@
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
-public class AutoNumValue {
+public class AutoNumValue implements CssValue{
private Integer intValue = null;
@@ -28,7 +28,7 @@
// return a string that contains either an integer as a string value
// or the string auto
- public String getStringValue(){
+ public String getCssValue(){
if(intValue == null){
return "auto";
}else {
Copied and modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/BorderStyleValue.java (from r543, branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/BorderStyle.java)
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/BorderStyle.java Fri Jul 1 03:10:46 2011 (r543, copy source)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/BorderStyleValue.java Fri Jul 1 09:05:04 2011 (r549)
@@ -1,6 +1,6 @@
package us.isidor.gdl.anaToMia.Widgets.values;
-public enum BorderStyle {
+public enum BorderStyleValue implements CssValue{
NONE,
HIDDEN,
DOTTED,
@@ -10,5 +10,9 @@
GROOVE,
RIDGE,
INSET,
- OUTSET
+ OUTSET;
+
+ public String getCssValue(){
+ return this.toString().toLowerCase();
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ClearValue.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ClearValue.java Fri Jul 1 08:06:19 2011 (r548)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ClearValue.java Fri Jul 1 09:05:04 2011 (r549)
@@ -1,8 +1,12 @@
package us.isidor.gdl.anaToMia.Widgets.values;
-public enum ClearValue {
+public enum ClearValue implements CssValue{
NONE,
LEFT,
RIGHT,
- BOTH
+ BOTH;
+
+ public String getCssValue(){
+ return this.toString().toLowerCase();
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ColorValue.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ColorValue.java Fri Jul 1 08:06:19 2011 (r548)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ColorValue.java Fri Jul 1 09:05:04 2011 (r549)
@@ -2,7 +2,7 @@
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
-public class ColorValue {
+public class ColorValue implements CssValue{
private String stringValue = null;
@@ -88,7 +88,7 @@
// returns a string of the format #RRGGBB
- public String getStringValue(){
+ public String getCssValue(){
return this.stringValue;
}
@@ -150,7 +150,7 @@
// represents the color key words that are defined in CSS chapter 4.3.6
// (http://www.w3.org/TR/CSS21/syndata.html#value-def-color)
- public enum CssColor{
+ public enum CssColor implements CssValue{
MAROON,
RED,
ORANGE,
@@ -167,6 +167,10 @@
TEAL,
BLACK,
SILVER,
- GRAY
+ GRAY;
+
+ public String getCssValue(){
+ return this.toString().toLowerCase();
+ }
}
}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/CssValue.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/CssValue.java Fri Jul 1 09:05:04 2011 (r549)
@@ -0,0 +1,5 @@
+package us.isidor.gdl.anaToMia.Widgets.values;
+
+public interface CssValue {
+ public String getCssValue();
+}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/CursorValue.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/CursorValue.java Fri Jul 1 08:06:19 2011 (r548)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/CursorValue.java Fri Jul 1 09:05:04 2011 (r549)
@@ -1,6 +1,6 @@
package us.isidor.gdl.anaToMia.Widgets.values;
-public enum CursorValue {
+public enum CursorValue implements CssValue{
AUTO,
DEFAULT,
CROSSHAIR,
@@ -17,5 +17,10 @@
TEXT,
WAIT,
HELP,
- PROGRESS
+ PROGRESS;
+
+
+ public String getCssValue(){
+ return this.toString().toLowerCase();
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/NumUnitValue.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/NumUnitValue.java Fri Jul 1 08:06:19 2011 (r548)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/NumUnitValue.java Fri Jul 1 09:05:04 2011 (r549)
@@ -2,7 +2,7 @@
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
-public class NumUnitValue {
+public class NumUnitValue implements CssValue{
protected CssUnit unit = CssUnit.PIXEL;
protected float value = 0f;
@@ -46,7 +46,7 @@
// returns the value represented by this instance as a css string
- public String getStringValue(){
+ public String getCssValue(){
switch(this.unit){
case PIXEL: return (int)this.value + "px";
case POINT: return (int)this.value + "pt";
@@ -68,9 +68,14 @@
// a subset of CSS units that are supported by the GDL
- public enum CssUnit {
+ public enum CssUnit implements CssValue{
POINT,
PIXEL,
- PERCENTAGE
+ PERCENTAGE;
+
+
+ public String getCssValue(){
+ return this.toString().toLowerCase();
+ }
}
}
1
0

[isidorus-cvs] r548 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base
by lgiessmann@common-lisp.net 01 Jul '11
by lgiessmann@common-lisp.net 01 Jul '11
01 Jul '11
Author: lgiessmann
Date: Fri Jul 1 08:06:19 2011
New Revision: 548
Log:
gdl-frontend: Widgets: implemented a method that gets the GDL overflow property;
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.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 1 07:58:03 2011 (r547)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Fri Jul 1 08:06:19 2011 (r548)
@@ -16,6 +16,7 @@
import com.google.gwt.core.client.JsArray;
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.dom.client.Style.Float;
+import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.VerticalAlign;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Composite;
@@ -1093,8 +1094,36 @@
}
}
-
- // gdlOverflow [gdl:hover | gdl:focus | gdl:active]
+
+ // returns an Overflow instance that represents the overflow property of this element.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public Overflow getOverflow(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence overflowOcc = null;
+ if(styleClass != null){
+ overflowOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlCursor, styleClass);
+ } else {
+ overflowOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlCursor);
+ }
+
+ if(overflowOcc == null && styleClass != null){
+ return null;
+ } else if(overflowOcc == null) {
+ return Overflow.SCROLL;
+ } else {
+ String value = overflowOcc.getValue().toUpperCase();
+ if(value.equals("VISIBLE")){
+ return Overflow.VISIBLE;
+ }else if(value.equals("HIDDEN")){
+ return Overflow.HIDDEN;
+ }else if(value.equals("SCROLL")){
+ return Overflow.SCROLL;
+ }else {
+ throw new InvalidGdlSchemaException("cursor must be set to one of visible, hidden or scroll, but is " + overflowOcc.getValue());
+ }
+ }
+ }
public void setGdlStyle(){
1
0

[isidorus-cvs] r547 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base
by lgiessmann@common-lisp.net 01 Jul '11
by lgiessmann@common-lisp.net 01 Jul '11
01 Jul '11
Author: lgiessmann
Date: Fri Jul 1 07:58:03 2011
New Revision: 547
Log:
gdl-frontend: Widgets: implemented a method that gets the GDL background-color property;
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
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 Fri Jul 1 04:33:23 2011 (r546)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java Fri Jul 1 07:58:03 2011 (r547)
@@ -127,7 +127,7 @@
public final static String gdlPaddingLeft = gdl + "padding-left";
public final static String gdlClear = gdl + "clear";
public final static String gdlFloat = gdl + "float";
- public final static String gdlBackGroundColor = gdl + "background-color";
+ public final static String gdlBackgroundColor = gdl + "background-color";
public final static String gdlOverflow = gdl + "overflow";
public final static String gdlOrdered = gdl + "ordered";
public final static String gdlListstyleType = gdl + "list-style-type";
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 1 04:33:23 2011 (r546)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Fri Jul 1 07:58:03 2011 (r547)
@@ -1072,9 +1072,32 @@
}
+ // returns a ColorValue instance that represents the background-color of this element.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public ColorValue getBackgroundColor(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence colorOcc = null;
+ if(styleClass != null){
+ colorOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBackgroundColor, styleClass);
+ } else {
+ colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBackgroundColor);
+ }
+
+ if(colorOcc == null && styleClass != null){
+ return null;
+ } else if(colorOcc == null) {
+ return new ColorValue("#ffffff");
+ } else {
+ return new ColorValue(colorOcc.getValue());
+ }
+ }
- // gdlBackgroundColor [gdl:hover | gdl:focus | gdl:active]
-
// gdlOverflow [gdl:hover | gdl:focus | gdl:active]
+
+
+ public void setGdlStyle(){
+ // TODO: implement
+ }
}
1
0