aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/knowcenter/wag/egov/egiz/table/Style.java
diff options
context:
space:
mode:
authorpdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-11-04 16:35:10 +0000
committerpdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-11-04 16:35:10 +0000
commit89a45b322b16d3c3a949b552f4fb4f07f2914817 (patch)
tree4cfbc1a02fae77cb9180d51061a31f24236bfe0e /src/main/java/at/knowcenter/wag/egov/egiz/table/Style.java
parentab57bf058107ad9ea251dfb8e3fc576834ea9f68 (diff)
downloadpdf-as-3-89a45b322b16d3c3a949b552f4fb4f07f2914817.tar.gz
pdf-as-3-89a45b322b16d3c3a949b552f4fb4f07f2914817.tar.bz2
pdf-as-3-89a45b322b16d3c3a949b552f4fb4f07f2914817.zip
- 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
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/table/Style.java')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/table/Style.java66
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()); }