From 0714579bc8b9f7fa5b270602496937911e18a2f4 Mon Sep 17 00:00:00 2001 From: Marco Zanon Date: Sun, 11 Mar 2012 10:35:51 +0000 Subject: [PATCH] Renamed getFormattedValue() methods to getCssValue(). --- .../marcozanon/macaco/web/ui/MWebBorder.java | 4 +-- .../marcozanon/macaco/web/ui/MWebColor.java | 2 +- .../macaco/web/ui/MWebDisplayWidget.java | 26 +++++++++---------- .../marcozanon/macaco/web/ui/MWebFont.java | 4 +-- .../marcozanon/macaco/web/ui/MWebMeasure.java | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/java/com/marcozanon/macaco/web/ui/MWebBorder.java b/src/java/com/marcozanon/macaco/web/ui/MWebBorder.java index 5c94282..c063496 100644 --- a/src/java/com/marcozanon/macaco/web/ui/MWebBorder.java +++ b/src/java/com/marcozanon/macaco/web/ui/MWebBorder.java @@ -78,8 +78,8 @@ public class MWebBorder extends MObject { return value; } - public String getFormattedValue() { - return this.getWidthReference().getFormattedValue() + " " + this.getStyle().toString() + " " + this.getColorReference().getFormattedValue(); + public String getCssValue() { + return this.getWidthReference().getCssValue() + " " + this.getStyle().toString() + " " + this.getColorReference().getCssValue(); } } diff --git a/src/java/com/marcozanon/macaco/web/ui/MWebColor.java b/src/java/com/marcozanon/macaco/web/ui/MWebColor.java index ea602f7..e621adc 100644 --- a/src/java/com/marcozanon/macaco/web/ui/MWebColor.java +++ b/src/java/com/marcozanon/macaco/web/ui/MWebColor.java @@ -37,7 +37,7 @@ public class MWebColor extends MObject { return this.color; } - public String getFormattedValue() { + public String getCssValue() { return "#" + String.format("%6H", this.getValue()).replace(" ", "0"); } diff --git a/src/java/com/marcozanon/macaco/web/ui/MWebDisplayWidget.java b/src/java/com/marcozanon/macaco/web/ui/MWebDisplayWidget.java index 9a88bd5..54bb9d8 100644 --- a/src/java/com/marcozanon/macaco/web/ui/MWebDisplayWidget.java +++ b/src/java/com/marcozanon/macaco/web/ui/MWebDisplayWidget.java @@ -150,7 +150,7 @@ public abstract class MWebDisplayWidget extends MWebWidget { if (null == this.getWidthReference()) { throw new MNullPropertyWebException("Invalid width: reference null."); } - return this.getWidthReference().getFormattedValue(); + return this.getWidthReference().getCssValue(); } /* Height */ @@ -192,7 +192,7 @@ public abstract class MWebDisplayWidget extends MWebWidget { if (null == this.getHeightReference()) { throw new MNullPropertyWebException("Invalid height: reference null."); } - return this.getHeightReference().getFormattedValue(); + return this.getHeightReference().getCssValue(); } /* Foreground color */ @@ -234,7 +234,7 @@ public abstract class MWebDisplayWidget extends MWebWidget { if (null == this.getForegroundColorReference()) { throw new MNullPropertyWebException("Invalid foreground color: reference null."); } - return this.getForegroundColorReference().getFormattedValue(); + return this.getForegroundColorReference().getCssValue(); } /* Background color */ @@ -276,7 +276,7 @@ public abstract class MWebDisplayWidget extends MWebWidget { if (null == this.getBackgroundColorReference()) { throw new MNullPropertyWebException("Invalid background color: reference null."); } - return this.getBackgroundColorReference().getFormattedValue(); + return this.getBackgroundColorReference().getCssValue(); } /* Borders */ @@ -375,7 +375,7 @@ public abstract class MWebDisplayWidget extends MWebWidget { if (null == this.getTopBorderReference()) { throw new MNullPropertyWebException("Invalid top border: reference null."); } - return this.getTopBorderReference().getFormattedValue(); + return this.getTopBorderReference().getCssValue(); } protected MWebBorder getRightBorderReference() { @@ -393,7 +393,7 @@ public abstract class MWebDisplayWidget extends MWebWidget { if (null == this.getRightBorderReference()) { throw new MNullPropertyWebException("Invalid right border: reference null."); } - return this.getRightBorderReference().getFormattedValue(); + return this.getRightBorderReference().getCssValue(); } protected MWebBorder getBottomBorderReference() { @@ -411,7 +411,7 @@ public abstract class MWebDisplayWidget extends MWebWidget { if (null == this.getBottomBorderReference()) { throw new MNullPropertyWebException("Invalid bottom border: reference null."); } - return this.getBottomBorderReference().getFormattedValue(); + return this.getBottomBorderReference().getCssValue(); } protected MWebBorder getLeftBorderReference() { @@ -429,7 +429,7 @@ public abstract class MWebDisplayWidget extends MWebWidget { if (null == this.getLeftBorderReference()) { throw new MNullPropertyWebException("Invalid left border: reference null."); } - return this.getLeftBorderReference().getFormattedValue(); + return this.getLeftBorderReference().getCssValue(); } /* Font */ @@ -471,7 +471,7 @@ public abstract class MWebDisplayWidget extends MWebWidget { if (null == this.getFontReference()) { throw new MNullPropertyWebException("Invalid font: reference null."); } - return this.getFontReference().getFormattedValue(); + return this.getFontReference().getCssValue(); } /* Paddings */ @@ -570,7 +570,7 @@ public abstract class MWebDisplayWidget extends MWebWidget { if (null == this.getTopPaddingReference()) { throw new MNullPropertyWebException("Invalid top padding: reference null."); } - return this.getTopPaddingReference().getFormattedValue(); + return this.getTopPaddingReference().getCssValue(); } protected MWebMeasure getRightPaddingReference() { @@ -588,7 +588,7 @@ public abstract class MWebDisplayWidget extends MWebWidget { if (null == this.getRightPaddingReference()) { throw new MNullPropertyWebException("Invalid right padding: reference null."); } - return this.getRightPaddingReference().getFormattedValue(); + return this.getRightPaddingReference().getCssValue(); } protected MWebMeasure getBottomPaddingReference() { @@ -606,7 +606,7 @@ public abstract class MWebDisplayWidget extends MWebWidget { if (null == this.getBottomPaddingReference()) { throw new MNullPropertyWebException("Invalid bottom padding: reference null."); } - return this.getBottomPaddingReference().getFormattedValue(); + return this.getBottomPaddingReference().getCssValue(); } protected MWebMeasure getLeftPaddingReference() { @@ -624,7 +624,7 @@ public abstract class MWebDisplayWidget extends MWebWidget { if (null == this.getLeftPaddingReference()) { throw new MNullPropertyWebException("Invalid left padding: reference null."); } - return this.getLeftPaddingReference().getFormattedValue(); + return this.getLeftPaddingReference().getCssValue(); } /* Text direction */ diff --git a/src/java/com/marcozanon/macaco/web/ui/MWebFont.java b/src/java/com/marcozanon/macaco/web/ui/MWebFont.java index 1db639f..dd6f1c1 100644 --- a/src/java/com/marcozanon/macaco/web/ui/MWebFont.java +++ b/src/java/com/marcozanon/macaco/web/ui/MWebFont.java @@ -148,9 +148,9 @@ public class MWebFont extends MObject { return value; } - public String[] getFormattedValue() { + public String[] getCssValue() { String[] formattedValue = new String[2]; - formattedValue[0] = this.getStyle().toString() + " " + this.getVariant().toString() + " " + this.getWeight().toString() + " " + this.getSizeReference().getFormattedValue() + " " + this.getFamily(); + formattedValue[0] = this.getStyle().toString() + " " + this.getVariant().toString() + " " + this.getWeight().toString() + " " + this.getSizeReference().getCssValue() + " " + this.getFamily(); formattedValue[1] = this.getDecoration().toString(); return formattedValue; } diff --git a/src/java/com/marcozanon/macaco/web/ui/MWebMeasure.java b/src/java/com/marcozanon/macaco/web/ui/MWebMeasure.java index a196e06..6d56825 100644 --- a/src/java/com/marcozanon/macaco/web/ui/MWebMeasure.java +++ b/src/java/com/marcozanon/macaco/web/ui/MWebMeasure.java @@ -69,7 +69,7 @@ public class MWebMeasure extends MObject { return value; } - public String getFormattedValue() { + public String getCssValue() { return this.getNumber() + this.getUnit().toString(); } -- 2.30.2