[isidorus-cvs] r553 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base values

lgiessmann at common-lisp.net lgiessmann at common-lisp.net
Fri Jul 1 22:01:50 UTC 2011


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;
 	}




More information about the Isidorus-cvs mailing list