From 7e5da4ee9ea802605745a4e384cc787b6eb6b9c4 Mon Sep 17 00:00:00 2001 From: Glen Mazza Date: Sun, 4 Jan 2004 21:14:34 +0000 Subject: [PATCH] String->Int conversion: removed String version of PropertyList.get() git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197110 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fo/PropertyList.java | 24 ------------- .../org/apache/fop/fo/PropertyManager.java | 35 ++++++++----------- 2 files changed, 14 insertions(+), 45 deletions(-) diff --git a/src/java/org/apache/fop/fo/PropertyList.java b/src/java/org/apache/fop/fo/PropertyList.java index 02023b9f2..cb2b29645 100644 --- a/src/java/org/apache/fop/fo/PropertyList.java +++ b/src/java/org/apache/fop/fo/PropertyList.java @@ -274,17 +274,6 @@ public class PropertyList extends HashMap { return p; } - - /** - * Return the property on the current FlowObject if it is specified, or if a - * corresponding property is specified. If neither is specified, it returns null. - * @param propertyName name of property - * @return the Property corresponding to that name - */ - public Property getSpecified(String propertyName) { - return get(propertyName, false, false); - } - /** * Return the property on the current FlowObject. If it isn't set explicitly, * this will try to compute it based on other properties, or if it is @@ -298,19 +287,6 @@ public class PropertyList extends HashMap { return get(propertyName, true, true); } - /** - * TEMPORARY until conversion to int's complete - * Return the property on the current FlowObject. If it isn't set explicitly, - * this will try to compute it based on other properties, or if it is - * inheritable, to return the inherited value. If all else fails, it returns - * the default value. - * @param propertyName The name of the property whose value is desired. - * @return the Property corresponding to that name - */ - public Property get(String propertyName) { - return get(propertyName, true, true); - } - /** * Return the property on the current FlowObject. Depending on the passed flags, * this will try to compute it based on other properties, or if it is diff --git a/src/java/org/apache/fop/fo/PropertyManager.java b/src/java/org/apache/fop/fo/PropertyManager.java index 69d5b171c..aef23a39c 100644 --- a/src/java/org/apache/fop/fo/PropertyManager.java +++ b/src/java/org/apache/fop/fo/PropertyManager.java @@ -50,9 +50,6 @@ */ package org.apache.fop.fo; -// Java -import java.text.MessageFormat; - // FOP import org.apache.fop.fonts.Font; import org.apache.fop.fo.properties.CommonBorderAndPadding; @@ -83,16 +80,15 @@ public class PropertyManager implements Constants { private CommonHyphenation hyphProps = null; private TextInfo textInfo = null; - private static final String[] SA_BEFORE = new String[]{"before"}; - private static final String[] SA_AFTER = new String[]{"after"}; - private static final String[] SA_START = new String[]{"start"}; - private static final String[] SA_END = new String[]{"end"}; - - private static final MessageFormat MSGFMT_COLOR = new MessageFormat("border-{0}-color"); - private static final MessageFormat MSGFMT_STYLE = new MessageFormat("border-{0}-style"); - private static final MessageFormat MSGFMT_WIDTH = new MessageFormat("border-{0}-width"); - private static final MessageFormat MSGFMT_PADDING = new MessageFormat("padding-{0}"); - + private static final int[] SA_BEFORE = new int[] { + PR_BORDER_BEFORE_COLOR, PR_BORDER_BEFORE_STYLE, PR_BORDER_BEFORE_WIDTH, PR_PADDING_BEFORE}; + private static final int[] SA_AFTER = new int[]{ + PR_BORDER_AFTER_COLOR, PR_BORDER_AFTER_STYLE, PR_BORDER_AFTER_WIDTH, PR_PADDING_AFTER}; + private static final int[] SA_START = new int[]{ + PR_BORDER_START_COLOR, PR_BORDER_START_STYLE, PR_BORDER_START_WIDTH, PR_PADDING_START}; + private static final int[] SA_END = new int[]{ + PR_BORDER_END_COLOR, PR_BORDER_END_STYLE, PR_BORDER_END_WIDTH, PR_PADDING_END}; + private static final String NONE = "none"; /** @@ -189,18 +185,15 @@ public class PropertyManager implements Constants { return borderAndPadding; } - private void initBorderInfo(int whichSide, String[] saSide) { + private void initBorderInfo(int whichSide, int[] saSide) { borderAndPadding.setPadding(whichSide, - propertyList.get( - MSGFMT_PADDING.format(saSide)).getCondLength()); + propertyList.get(saSide[3]).getCondLength()); // If style = none, force width to 0, don't get Color (spec 7.7.20) - int style = propertyList.get(MSGFMT_STYLE.format(saSide)).getEnum(); + int style = propertyList.get(saSide[1]).getEnum(); if (style != Constants.NONE) { borderAndPadding.setBorder(whichSide, style, - propertyList.get( - MSGFMT_WIDTH.format(saSide)).getCondLength(), - propertyList.get( - MSGFMT_COLOR.format(saSide)).getColorType()); + propertyList.get(saSide[2]).getCondLength(), + propertyList.get(saSide[0]).getColorType()); } } -- 2.39.5