diff options
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/table')
-rw-r--r-- | src/main/java/at/knowcenter/wag/egov/egiz/table/Style.java | 66 |
1 files changed, 64 insertions, 2 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/table/Style.java b/src/main/java/at/knowcenter/wag/egov/egiz/table/Style.java index 5b3db7d..d26570c 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/table/Style.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/table/Style.java @@ -39,6 +39,7 @@ public class Style implements Serializable { // 03.11.2010 changed by exthex - added valuevalign and valuehalign to allow separate layout for value and non-value cells.
// Also the hardcoded default values for halign and valign were removed to allow proper inheritment.
+// 04.11.2010 changed by exthex - added imagevalign and imagehalign analog to valuevalign/valuehalign
/**
* SVUID.
@@ -84,13 +85,22 @@ public class Style implements Serializable { public final static String VALIGN = "valign";
/**
- * halign key
+ * value halign key
*/
public final static String VALUEHALIGN = "valuehalign";
/**
- * valign key
+ * value valign key
*/
public final static String VALUEVALIGN = "valuevalign";
+
+ /**
+ * image halign key
+ */
+ public final static String IMAGEHALIGN = "imagehalign";
+ /**
+ * image valign key
+ */
+ public final static String IMAGEVALIGN = "imagevalign";
/**
* padding key, default padding = 1
*/
@@ -188,6 +198,14 @@ public class Style implements Serializable { */
private String valueVAlign_ = null;
/**
+ * The current imagehalign value
+ */
+ private String imageHAlign_ = null;
+ /**
+ * The current imagevalign value
+ */
+ private String imageVAlign_ = null;
+ /**
* The current border value -> initialized with the default border value
*/
private float border_ = DEFAULT_BORDER;
@@ -248,6 +266,16 @@ public class Style implements Serializable { valueVAlign_ = value;
}
}
+ if (IMAGEHALIGN.equals(id)) {
+ if (LEFT.equals(value) || CENTER.equals(value) || RIGHT.equals(value)) {
+ imageHAlign_ = value;
+ }
+ }
+ if (IMAGEVALIGN.equals(id)) {
+ if (TOP.equals(value) || MIDDLE.equals(value) || BOTTOM.equals(value)) {
+ imageVAlign_ = value;
+ }
+ }
if (PADDING.equals(id)) {
padding_ = Float.parseFloat(value);
}
@@ -399,6 +427,36 @@ public class Style implements Serializable { public String getValueVAlign() {
return valueVAlign_;
}
+
+ /**
+ * @param align The imageHAlign to set.
+ */
+ public void setImageHAlign(String align) {
+ imageHAlign_ = align;
+ }
+
+ /**
+ * Returns the image halign
+ * @return Returns the image halign
+ */
+ public String getImageHAlign() {
+ return imageHAlign_;
+ }
+
+ /**
+ * @param align The imageVAlign to set.
+ */
+ public void setImageVAlign(String align) {
+ imageVAlign_ = align;
+ }
+
+ /**
+ * Returns the image valign
+ * @return Returns the image valign
+ */
+ public String getImageVAlign() {
+ return imageVAlign_;
+ }
/**
* Returns the scaleToFit dimensions to be applied for image-cells.
@@ -449,6 +507,8 @@ public class Style implements Serializable { newStyle.setBorder(baseStyle.getBorder());
newStyle.setFont(baseStyle.getFont());
newStyle.setHAlign(baseStyle.getHAlign());
+ newStyle.setImageHAlign(baseStyle.getImageHAlign());
+ newStyle.setImageVAlign(baseStyle.getImageVAlign());
newStyle.setPadding(baseStyle.getPadding());
newStyle.setVAlign(baseStyle.getVAlign());
newStyle.setValueFont(baseStyle.getValueFont());
@@ -463,6 +523,8 @@ public class Style implements Serializable { if (newStyle.getBorder() == DEFAULT_BORDER) { newStyle.setBorder(inheritStyle.getBorder()); }
if (newStyle.getFont() == null) { newStyle.setFont(inheritStyle.getFont()); }
if (newStyle.getHAlign() == null) { newStyle.setHAlign(inheritStyle.getHAlign()); }
+ if (newStyle.getImageHAlign() == null) { newStyle.setImageHAlign(inheritStyle.getImageHAlign()); }
+ if (newStyle.getImageVAlign() == null) { newStyle.setImageVAlign(inheritStyle.getImageVAlign()); }
if (newStyle.getPadding() == DEFAULT_PADDING) { newStyle.setPadding(inheritStyle.getPadding()); }
if (newStyle.getVAlign() == null) { newStyle.setVAlign(inheritStyle.getVAlign()); }
if (newStyle.getValueFont() == null) { newStyle.setValueFont(inheritStyle.getValueFont()); }
|