From 89a45b322b16d3c3a949b552f4fb4f07f2914817 Mon Sep 17 00:00:00 2001 From: pdanner Date: Thu, 4 Nov 2010 16:35:10 +0000 Subject: - Added image[valign|halign] config parameters to allow separate alignment of images. - Normalization of value cell values does not remove multiple newlines any more git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@601 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../at/knowcenter/wag/egov/egiz/table/Style.java | 66 +++++++++++++++++++++- 1 file changed, 64 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/table/Style.java') 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 */ @@ -187,6 +197,14 @@ public class Style implements Serializable { * The current valuevalign value */ 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 */ @@ -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()); } -- cgit v1.2.3