From 632222604a21482c3443b4a7d45589803c72fe20 Mon Sep 17 00:00:00 2001 From: Glen Mazza Date: Wed, 24 Nov 2004 21:07:31 +0000 Subject: [PATCH] PR: Obtained from: Submitted by: Reviewed by: 1.) Removed unneeded enumeration interfaces from fo.Constants. 2.) Appended EN_ to enumeration constants to make them better S&R'able throughout app. 3.) Added an EN_INHERIT enumeration constant (although not currently used in the system.) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198175 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/area/CTM.java | 8 +- .../org/apache/fop/area/PageViewport.java | 8 +- .../org/apache/fop/area/inline/Leader.java | 2 +- src/java/org/apache/fop/fo/Constants.java | 662 +++++------------- .../org/apache/fop/fo/FOPropertyMapping.java | 630 ++++++++--------- src/java/org/apache/fop/fo/FOText.java | 12 +- src/java/org/apache/fop/fo/PropertyList.java | 6 +- src/java/org/apache/fop/fo/flow/Block.java | 24 +- .../fop/fo/flow/InstreamForeignObject.java | 16 +- src/java/org/apache/fop/fo/flow/Leader.java | 8 +- .../org/apache/fop/fo/flow/TableCell.java | 2 +- .../ConditionalPageMasterReference.java | 16 +- .../fop/fo/pagination/PageSequence.java | 4 +- .../apache/fop/fo/pagination/RegionAfter.java | 4 +- .../apache/fop/fo/pagination/RegionBA.java | 2 +- .../fop/fo/pagination/RegionBefore.java | 4 +- .../apache/fop/fo/pagination/RegionEnd.java | 2 +- .../apache/fop/fo/pagination/RegionSE.java | 6 +- .../apache/fop/fo/pagination/RegionStart.java | 2 +- .../RepeatablePageMasterAlternatives.java | 2 +- .../RepeatablePageMasterReference.java | 2 +- .../properties/BorderWidthPropertyMaker.java | 2 +- .../CommonBorderPaddingBackground.java | 6 +- .../fop/fo/properties/CondLengthProperty.java | 2 +- .../properties/PositionShorthandParser.java | 30 +- .../fo/properties/SpacingPropertyMaker.java | 2 +- .../BlockContainerLayoutManager.java | 22 +- .../fop/layoutmgr/CharacterLayoutManager.java | 16 +- .../ExternalGraphicLayoutManager.java | 38 +- .../layoutmgr/InstreamForeignObjectLM.java | 18 +- .../fop/layoutmgr/LeaderLayoutManager.java | 50 +- .../fop/layoutmgr/LeafNodeLayoutManager.java | 16 +- .../fop/layoutmgr/LineLayoutManager.java | 34 +- .../layoutmgr/PageSequenceLayoutManager.java | 30 +- .../fop/layoutmgr/TextLayoutManager.java | 38 +- .../apache/fop/render/awt/AWTRenderer.java | 2 +- .../apache/fop/render/pdf/PDFRenderer.java | 22 +- .../org/apache/fop/render/ps/PSRenderer.java | 2 +- .../org/apache/fop/render/rtf/RTFHandler.java | 2 +- .../render/rtf/TableAttributesConverter.java | 30 +- .../render/rtf/TextAttributesConverter.java | 12 +- .../rtfdoc/BorderAttributesConverter.java | 18 +- .../apache/fop/render/svg/SVGRenderer.java | 12 +- .../apache/fop/render/xml/XMLRenderer.java | 12 +- .../org/apache/fop/traits/LayoutProps.java | 4 +- src/java/org/apache/fop/traits/SpaceVal.java | 8 +- 46 files changed, 756 insertions(+), 1094 deletions(-) diff --git a/src/java/org/apache/fop/area/CTM.java b/src/java/org/apache/fop/area/CTM.java index 04d0c4619..b959bbf6d 100644 --- a/src/java/org/apache/fop/area/CTM.java +++ b/src/java/org/apache/fop/area/CTM.java @@ -113,15 +113,15 @@ public class CTM implements Serializable { public static CTM getWMctm(int wm, int ipd, int bpd) { CTM wmctm; switch (wm) { - case Constants.WritingMode.LR_TB: + case Constants.EN_LR_TB: return new CTM(CTM_LRTB); - case Constants.WritingMode.RL_TB: { + case Constants.EN_RL_TB: { wmctm = new CTM(CTM_RLTB); wmctm.e = ipd; return wmctm; } //return CTM_RLTB.translate(ipd, 0); - case Constants.WritingMode.TB_RL: { // CJK + case Constants.EN_TB_RL: { // CJK wmctm = new CTM(CTM_TBRL); wmctm.e = bpd; return wmctm; @@ -299,7 +299,7 @@ public class CTM implements Serializable { * can set ipd and bpd appropriately based on the writing mode. */ - if (writingMode == Constants.WritingMode.LR_TB || writingMode == Constants.WritingMode.RL_TB) { + if (writingMode == Constants.EN_LR_TB || writingMode == Constants.EN_RL_TB) { reldims.ipd = width; reldims.bpd = height; } else { diff --git a/src/java/org/apache/fop/area/PageViewport.java b/src/java/org/apache/fop/area/PageViewport.java index abfb3e2a3..c26104ae8 100644 --- a/src/java/org/apache/fop/area/PageViewport.java +++ b/src/java/org/apache/fop/area/PageViewport.java @@ -275,7 +275,7 @@ public class PageViewport implements Resolvable, Cloneable { public Object getMarker(String name, int pos) { Object mark = null; switch (pos) { - case Constants.RetrievePosition.FSWP: + case Constants.EN_FSWP: if (markerFirstStart != null) { mark = markerFirstStart.get(name); } @@ -283,12 +283,12 @@ public class PageViewport implements Resolvable, Cloneable { mark = markerFirstAny.get(name); } break; - case Constants.RetrievePosition.FIC: + case Constants.EN_FIC: if (markerFirstAny != null) { mark = markerFirstAny.get(name); } break; - case Constants.RetrievePosition.LSWP: + case Constants.EN_LSWP: if (markerLastStart != null) { mark = markerLastStart.get(name); } @@ -296,7 +296,7 @@ public class PageViewport implements Resolvable, Cloneable { mark = markerLastAny.get(name); } break; - case Constants.RetrievePosition.LEWP: + case Constants.EN_LEWP: if (markerLastEnd != null) { mark = markerLastEnd.get(name); } diff --git a/src/java/org/apache/fop/area/inline/Leader.java b/src/java/org/apache/fop/area/inline/Leader.java index d8d008bc8..f683b5af0 100644 --- a/src/java/org/apache/fop/area/inline/Leader.java +++ b/src/java/org/apache/fop/area/inline/Leader.java @@ -31,7 +31,7 @@ public class Leader extends InlineArea { // if space replaced with a space // otherwise this is a holder for a line - private int ruleStyle = Constants.RuleStyle.SOLID; + private int ruleStyle = Constants.EN_SOLID; private int ruleThickness = 1000; /** diff --git a/src/java/org/apache/fop/fo/Constants.java b/src/java/org/apache/fop/fo/Constants.java index 5f8378868..e2c19e780 100644 --- a/src/java/org/apache/fop/fo/Constants.java +++ b/src/java/org/apache/fop/fo/Constants.java @@ -388,504 +388,166 @@ public interface Constants { int CP_WITHIN_PAGE = 11 << COMPOUND_SHIFT; // Enumeration constants - - int ABSOLUTE = 1; - int ABSOLUTE_COLORMETRIC = 2; - int AFTER = 3; - int ALL = 4; - int ALPHABETIC = 5; - int ALWAYS = 6; - int ANY = 7; - int AUTO = 8; - int BASELINE = 9; - int BEFORE = 10; - int BLANK = 11; - int BLINK = 12; - int BOTTOM = 13; - int CAPITALIZE = 14; - int CENTER = 15; - int COLLAPSE = 16; - int COLUMN = 17; - int DASHED = 18; - int DISCARD = 19; - int DOCUMENT = 20; - int DOTS = 21; - int DOTTED = 22; - int DOUBLE = 23; - int END = 24; - int END_ON_EVEN = 25; - int END_ON_ODD = 26; - int ERROR_IF_OVERFLOW = 27; - int EVEN = 28; - int EVEN_PAGE = 29; - int FALSE = 30; - int FIC = 31; - int FIRST = 32; - int FIXED = 33; - int FORCE = 34; - int FSWP = 35; - int GROOVE = 36; - int HIDDEN = 37; - int IGNORE = 38; - int IGNORE_IF_AFTER_LINEFEED = 39; - int IGNORE_IF_BEFORE_LINEFEED = 40; - int IGNORE_IF_SURROUNDING_LINEFEED = 41; - int INSET = 42; - int JUSTIFY = 43; - int LAST = 44; - int LEFT = 45; - int LEWP = 46; - int LINE_THROUGH = 47; - int LOWERCASE = 48; - int LR_TB = 49; - int LSWP = 50; - int MIDDLE = 51; - int NO_BLINK = 52; - int NO_FORCE = 53; - int NO_LINE_THROUGH = 54; - int NO_OVERLINE = 55; - int NO_UNDERLINE = 56; - int NO_WRAP = 57; - int NON_UNIFORM = 58; - int NONE = 59; - int NOREPEAT = 60; - int NORMAL = 61; - int NOT_BLANK = 62; - int ODD = 63; - int ODD_PAGE = 64; - int OUTSET = 65; - int OVERLINE = 66; - int PAGE = 67; - int PAGE_SEQUENCE = 68; - int PERCEPTUAL = 69; - int PRESERVE = 70; - int REFERENCE_AREA = 71; - int RELATIVE = 72; - int RELATIVE_COLOMETRIC = 73; - int REPEAT = 74; - int REPEATX = 75; - int REPEATY = 76; - int REST = 77; - int RETAIN = 78; - int RIDGE = 79; - int RIGHT = 80; - int RL_TB = 81; - int RULE = 82; - int SATURATION = 83; - int SCROLL = 84; - int SEPARATE = 85; - int SMALL_CAPS = 86; - int SOLID = 87; - int SPACE = 88; - int START = 89; - int STATIC = 90; - int SUB = 91; - int SUPER = 92; - int TB_RL = 93; - int TEXT_BOTTOM = 94; - int TEXT_TOP = 95; - int TOP = 96; - int TRADITIONAL = 97; - int TREAT_AS_SPACE = 98; - int TREAT_AS_ZERO_WIDTH_SPACE = 99; - int TRUE = 100; - int UNDERLINE = 101; - int UNIFORM = 102; - int UPPERCASE = 103; - int USECONTENT = 104; - int VISIBLE = 105; - int WRAP = 106; - int FONT_HEIGHT = 107; - int LINE_HEIGHT = 108; - int MAX_HEIGHT = 109; - int NO_LIMIT = 110; - int AUTO_ODD = 111; - int AUTO_EVEN = 112; - int BEFORE_EDGE = 113; - int TEXT_BEFORE_EDGE = 114; - int CENTRAL = 115; - int AFTER_EDGE = 116; - int TEXT_AFTER_EDGE = 117; - int IDEOGRAPHIC = 118; - int HANGING = 119; - int MATHEMATICAL = 120; - int SCALE_TO_FIT = 121; - int USE_FONT_METRICS = 122; - int INDEFINITE = 123; - int LARGER = 124; - int SMALLER = 125; - int INSIDE = 126; - int OUTSIDE = 127; - int CONSIDER_SHIFTS = 128; - int DISREGARD_SHIFTS = 129; - int INTEGER_PIXELS = 130; - int RESAMPLE_ANY_METHOD = 131; - int USE_SCRIPT = 132; - int NO_CHANGE = 133; - int RESET_SIZE = 134; - int WIDER = 135; - int NARROWER = 136; - int ULTRA_CONDENSED = 137; - int EXTRA_CONDENSED = 138; - int CONDENSED = 139; - int SEMI_CONDENSED = 140; - int SEMI_EXPANDED = 141; - int EXPANDED = 142; - int EXTRA_EXPANDED = 143; - int ULTRA_EXPANDED = 144; - int LINE = 145; - int INDENT = 146; - int BLOCK = 147; - int BOTH = 148; - int COLLAPSE_WITH_PRECEDENCE = 149; - int SHOW = 150; - int HIDE = 151; - int EMBED = 152; - int BIDI_OVERRIDE = 153; - int LTR = 154; - int RTL = 155; - int CHARACTER_BY_CHARACTER = 156; - int SUPPRESS = 157; - int PAGINATE = 158; - int BOUNDED_IN_ONE_DIMENSION = 159; - int UNBOUNDED = 160; - int ENUM_COUNT = 160; - - // Enumeration Interfaces - - public interface GenericBooleanInterface { - int TRUE = Constants.TRUE; - int FALSE = Constants.FALSE; - } - - public interface GenericBorderStyleInterface { - int NONE = Constants.NONE; - int HIDDEN = Constants.HIDDEN; - int DOTTED = Constants.DOTTED; - int DASHED = Constants.DASHED; - int SOLID = Constants.SOLID; - int DOUBLE = Constants.DOUBLE; - int GROOVE = Constants.GROOVE; - int RIDGE = Constants.RIDGE; - int INSET = Constants.INSET; - int OUTSET = Constants.OUTSET; - } - - public interface GenericBreakInterface { - int AUTO = Constants.AUTO; - int COLUMN = Constants.COLUMN; - int PAGE = Constants.PAGE; - int EVEN_PAGE = Constants.EVEN_PAGE; - int ODD_PAGE = Constants.ODD_PAGE; - } - - public interface GenericCondBorderWidthInterface { - public interface Conditionality { - int DISCARD = Constants.DISCARD; - int RETAIN = Constants.RETAIN; - } - } - - public interface GenericCondPaddingInterface { - public interface Conditionality { - int DISCARD = Constants.DISCARD; - int RETAIN = Constants.RETAIN; - } - } - - public interface GenericKeepInterface { - public interface WithinPage { - int AUTO = Constants.AUTO; - int ALWAYS = Constants.ALWAYS; - } - public interface WithinLine { - int AUTO = Constants.AUTO; - int ALWAYS = Constants.ALWAYS; - } - public interface WithinColumn { - int AUTO = Constants.AUTO; - int ALWAYS = Constants.ALWAYS; - } - } - - public interface GenericSpaceInterface { - public interface Precedence { - int FORCE = Constants.FORCE; - } - public interface Conditionality { - int DISCARD = Constants.DISCARD; - int RETAIN = Constants.RETAIN; - } - } - - - public interface AbsolutePosition { - int AUTO = Constants.AUTO; - int FIXED = Constants.FIXED; - int ABSOLUTE = Constants.ABSOLUTE; } - - public interface BackgroundRepeat { - int REPEAT = Constants.REPEAT; - int REPEATX = Constants.REPEATX; - int REPEATY = Constants.REPEATY; - int NOREPEAT = Constants.NOREPEAT; } - - public interface BaselineShift { - int BASELINE = Constants.BASELINE; - int SUB = Constants.SUB; - int SUPER = Constants.SUPER; } - - public interface BlankOrNotBlank { - int BLANK = Constants.BLANK; - int NOT_BLANK = Constants.NOT_BLANK; - int ANY = Constants.ANY; } - - public interface BorderAfterStyle extends GenericBorderStyleInterface { } - - public interface BorderAfterWidth extends GenericCondBorderWidthInterface { } - - public interface BorderBeforeStyle extends GenericBorderStyleInterface { } - - public interface BorderBeforeWidth extends GenericCondBorderWidthInterface { } - - public interface BorderBottomStyle extends GenericBorderStyleInterface { } - - public interface BorderCollapse { - int SEPARATE = Constants.SEPARATE; - int COLLAPSE = Constants.COLLAPSE; } - - public interface BorderEndStyle extends GenericBorderStyleInterface { } - - public interface BorderEndWidth extends GenericCondBorderWidthInterface { } - - public interface BorderLeftStyle extends GenericBorderStyleInterface { } - - public interface BorderRightStyle extends GenericBorderStyleInterface { } - - public interface BorderStartStyle extends GenericBorderStyleInterface { } - - public interface BorderStartWidth extends GenericCondBorderWidthInterface { } - - public interface BorderTopStyle extends GenericBorderStyleInterface { } - - public interface BreakAfter extends GenericBreakInterface { } - - public interface BreakBefore extends GenericBreakInterface { } - - public interface CaptionSide { - int BEFORE = Constants.BEFORE; - int AFTER = Constants.AFTER; - int START = Constants.START; - int END = Constants.END; - int TOP = Constants.TOP; - int BOTTOM = Constants.BOTTOM; - int LEFT = Constants.LEFT; - int RIGHT = Constants.RIGHT; } - - public interface DisplayAlign { - int BEFORE = Constants.BEFORE; - int AFTER = Constants.AFTER; - int CENTER = Constants.CENTER; - int AUTO = Constants.AUTO; } - - public interface FontVariant { - int NORMAL = Constants.NORMAL; - int SMALL_CAPS = Constants.SMALL_CAPS; } - - public interface ForcePageCount { - int EVEN = Constants.EVEN; - int ODD = Constants.ODD; - int END_ON_EVEN = Constants.END_ON_EVEN; - int END_ON_ODD = Constants.END_ON_ODD; - int NO_FORCE = Constants.NO_FORCE; - int AUTO = Constants.AUTO; } - - public interface Hyphenate { - int TRUE = Constants.TRUE; - int FALSE = Constants.FALSE; } - - public interface KeepTogether extends GenericKeepInterface { } - - public interface KeepWithNext extends GenericKeepInterface { } - - public interface KeepWithPrevious extends GenericKeepInterface { } - - public interface LeaderAlignment { - int NONE = Constants.NONE; - int REFERENCE_AREA = Constants.REFERENCE_AREA; - int PAGE = Constants.PAGE; } - - public interface LeaderPattern { - int SPACE = Constants.SPACE; - int RULE = Constants.RULE; - int DOTS = Constants.DOTS; - int USECONTENT = Constants.USECONTENT; } - - public interface LetterValue { - int ALPHABETIC = Constants.ALPHABETIC; - int TRADITIONAL = Constants.TRADITIONAL; - int AUTO = Constants.AUTO; } - - public interface LinefeedTreatment { - int IGNORE = Constants.IGNORE; - int PRESERVE = Constants.PRESERVE; - int TREAT_AS_SPACE = Constants.TREAT_AS_SPACE; - int TREAT_AS_ZERO_WIDTH_SPACE = Constants.TREAT_AS_ZERO_WIDTH_SPACE; } - - public interface LineStackingStrategy { - int LINE_HEIGHT = Constants.LINE_HEIGHT; - int FONT_HEIGHT = Constants.FONT_HEIGHT; - int MAX_HEIGHT = Constants.MAX_HEIGHT; - } - - public interface OddOrEven { - int ODD = Constants.ODD; - int EVEN = Constants.EVEN; - int ANY = Constants.ANY; } - - public interface Overflow { - int VISIBLE = Constants.VISIBLE; - int HIDDEN = Constants.HIDDEN; - int SCROLL = Constants.SCROLL; - int ERROR_IF_OVERFLOW = Constants.ERROR_IF_OVERFLOW; - int AUTO = Constants.AUTO; } - - public interface PaddingAfter extends GenericCondPaddingInterface { } - - public interface PaddingBefore extends GenericCondPaddingInterface { } - - public interface PaddingEnd extends GenericCondPaddingInterface { } - - public interface PaddingStart extends GenericCondPaddingInterface { } - - public interface PagePosition { - int FIRST = Constants.FIRST; - int LAST = Constants.LAST; - int REST = Constants.REST; - int ANY = Constants.ANY; } - -/* public interface Position { conflicts with layoutmgr.Position - int STATIC = Constants.STATIC; - int RELATIVE = Constants.RELATIVE; - int ABSOLUTE = Constants.ABSOLUTE; - int FIXED = Constants.FIXED; } */ - - public interface Precedence { - int TRUE = Constants.TRUE; - int FALSE = Constants.FALSE; } - - public interface RelativeAlign { - int BEFORE = Constants.BEFORE; - int BASELINE = Constants.BASELINE; } - - public interface RenderingIntent { - int AUTO = Constants.AUTO; - int PERCEPTUAL = Constants.PERCEPTUAL; - int RELATIVE_COLOMETRIC = Constants.RELATIVE_COLOMETRIC; - int SATURATION = Constants.SATURATION; - int ABSOLUTE_COLORMETRIC = Constants.ABSOLUTE_COLORMETRIC; } - - public interface RetrieveBoundary { - int PAGE = Constants.PAGE; - int PAGE_SEQUENCE = Constants.PAGE_SEQUENCE; - int DOCUMENT = Constants.DOCUMENT; } - - public interface RetrievePosition { - int FSWP = Constants.FSWP; - int FIC = Constants.FIC; - int LSWP = Constants.LSWP; - int LEWP = Constants.LEWP; } - - public interface RuleStyle { - int NONE = Constants.NONE; - int DOTTED = Constants.DOTTED; - int DASHED = Constants.DASHED; - int SOLID = Constants.SOLID; - int DOUBLE = Constants.DOUBLE; - int GROOVE = Constants.GROOVE; - int RIDGE = Constants.RIDGE; } - - public interface Scaling { - int UNIFORM = Constants.UNIFORM; - int NON_UNIFORM = Constants.NON_UNIFORM; } - - public interface SpaceAfter extends GenericSpaceInterface { } - - public interface SpaceBefore extends GenericSpaceInterface { } - - public interface SpaceEnd extends GenericSpaceInterface { } - - public interface SpaceStart extends GenericSpaceInterface { } - -/* public interface Span { conflicts with Area.Span - int NONE = Constants.NONE; - int ALL = Constants.ALL; } */ - - public interface TableLayout { - int AUTO = Constants.AUTO; - int FIXED = Constants.FIXED; } - - public interface TableOmitFooterAtBreak extends GenericBooleanInterface { } - - public interface TableOmitHeaderAtBreak extends GenericBooleanInterface { } - - public interface TextAlign { - int CENTER = Constants.CENTER; - int END = Constants.END; - int START = Constants.START; - int JUSTIFY = Constants.JUSTIFY; } - - public interface TextAlignLast { - int CENTER = Constants.CENTER; - int END = Constants.END; - int START = Constants.START; - int JUSTIFY = Constants.JUSTIFY; } - - public interface TextDecoration { - int NONE = Constants.NONE; - int UNDERLINE = Constants.UNDERLINE; - int OVERLINE = Constants.OVERLINE; - int LINE_THROUGH = Constants.LINE_THROUGH; - int BLINK = Constants.BLINK; - int NO_UNDERLINE = Constants.NO_UNDERLINE; - int NO_OVERLINE = Constants.NO_OVERLINE; - int NO_LINE_THROUGH = Constants.NO_LINE_THROUGH; - int NO_BLINK = Constants.NO_BLINK; } - - public interface TextTransform { - int NONE = Constants.NONE; - int CAPITALIZE = Constants.CAPITALIZE; - int UPPERCASE = Constants.UPPERCASE; - int LOWERCASE = Constants.LOWERCASE; } - - public interface VerticalAlign { - int BASELINE = Constants.BASELINE; - int MIDDLE = Constants.MIDDLE; - int SUB = Constants.SUB; - int SUPER = Constants.SUPER; - int TEXT_TOP = Constants.TEXT_TOP; - int TEXT_BOTTOM = Constants.TEXT_BOTTOM; - int TOP = Constants.TOP; - int BOTTOM = Constants.BOTTOM; } - - public interface WhiteSpaceCollapse extends GenericBooleanInterface { } - - public interface WhiteSpaceTreatment { - int IGNORE = Constants.IGNORE; - int PRESERVE = Constants.PRESERVE; - int IGNORE_IF_BEFORE_LINEFEED = Constants.IGNORE_IF_BEFORE_LINEFEED; - int IGNORE_IF_AFTER_LINEFEED = Constants.IGNORE_IF_AFTER_LINEFEED; - int IGNORE_IF_SURROUNDING_LINEFEED = Constants.IGNORE_IF_SURROUNDING_LINEFEED; } - - public interface WordSpacing extends GenericSpaceInterface { } - - public interface WrapOption { - int WRAP = Constants.WRAP; - int NO_WRAP = Constants.NO_WRAP; } - - public interface WritingMode { - int LR_TB = Constants.LR_TB; - int RL_TB = Constants.RL_TB; - int TB_RL = Constants.TB_RL; } - + int EN_ABSOLUTE = 1; + int EN_ABSOLUTE_COLORMETRIC = 2; + int EN_AFTER = 3; + int EN_ALL = 4; + int EN_ALPHABETIC = 5; + int EN_ALWAYS = 6; + int EN_ANY = 7; + int EN_AUTO = 8; + int EN_BASELINE = 9; + int EN_BEFORE = 10; + int EN_BLANK = 11; + int EN_BLINK = 12; + int EN_BOTTOM = 13; + int EN_CAPITALIZE = 14; + int EN_CENTER = 15; + int EN_COLLAPSE = 16; + int EN_COLUMN = 17; + int EN_DASHED = 18; + int EN_DISCARD = 19; + int EN_DOCUMENT = 20; + int EN_DOTS = 21; + int EN_DOTTED = 22; + int EN_DOUBLE = 23; + int EN_END = 24; + int EN_END_ON_EVEN = 25; + int EN_END_ON_ODD = 26; + int EN_ERROR_IF_OVERFLOW = 27; + int EN_EVEN = 28; + int EN_EVEN_PAGE = 29; + int EN_FALSE = 30; + int EN_FIC = 31; + int EN_FIRST = 32; + int EN_FIXED = 33; + int EN_FORCE = 34; + int EN_FSWP = 35; + int EN_GROOVE = 36; + int EN_HIDDEN = 37; + int EN_IGNORE = 38; + int EN_IGNORE_IF_AFTER_LINEFEED = 39; + int EN_IGNORE_IF_BEFORE_LINEFEED = 40; + int EN_IGNORE_IF_SURROUNDING_LINEFEED = 41; + int EN_INSET = 42; + int EN_JUSTIFY = 43; + int EN_LAST = 44; + int EN_LEFT = 45; + int EN_LEWP = 46; + int EN_LINE_THROUGH = 47; + int EN_LOWERCASE = 48; + int EN_LR_TB = 49; + int EN_LSWP = 50; + int EN_MIDDLE = 51; + int EN_NO_BLINK = 52; + int EN_NO_FORCE = 53; + int EN_NO_LINE_THROUGH = 54; + int EN_NO_OVERLINE = 55; + int EN_NO_UNDERLINE = 56; + int EN_NO_WRAP = 57; + int EN_NON_UNIFORM = 58; + int EN_NONE = 59; + int EN_NOREPEAT = 60; + int EN_NORMAL = 61; + int EN_NOT_BLANK = 62; + int EN_ODD = 63; + int EN_ODD_PAGE = 64; + int EN_OUTSET = 65; + int EN_OVERLINE = 66; + int EN_PAGE = 67; + int EN_PAGE_SEQUENCE = 68; + int EN_PERCEPTUAL = 69; + int EN_PRESERVE = 70; + int EN_REFERENCE_AREA = 71; + int EN_RELATIVE = 72; + int EN_RELATIVE_COLOMETRIC = 73; + int EN_REPEAT = 74; + int EN_REPEATX = 75; + int EN_REPEATY = 76; + int EN_REST = 77; + int EN_RETAIN = 78; + int EN_RIDGE = 79; + int EN_RIGHT = 80; + int EN_RL_TB = 81; + int EN_RULE = 82; + int EN_SATURATION = 83; + int EN_SCROLL = 84; + int EN_SEPARATE = 85; + int EN_SMALL_CAPS = 86; + int EN_SOLID = 87; + int EN_SPACE = 88; + int EN_START = 89; + int EN_STATIC = 90; + int EN_SUB = 91; + int EN_SUPER = 92; + int EN_TB_RL = 93; + int EN_TEXT_BOTTOM = 94; + int EN_TEXT_TOP = 95; + int EN_TOP = 96; + int EN_TRADITIONAL = 97; + int EN_TREAT_AS_SPACE = 98; + int EN_TREAT_AS_ZERO_WIDTH_SPACE = 99; + int EN_TRUE = 100; + int EN_UNDERLINE = 101; + int EN_UNIFORM = 102; + int EN_UPPERCASE = 103; + int EN_USECONTENT = 104; + int EN_VISIBLE = 105; + int EN_WRAP = 106; + int EN_FONT_HEIGHT = 107; + int EN_LINE_HEIGHT = 108; + int EN_MAX_HEIGHT = 109; + int EN_NO_LIMIT = 110; + int EN_AUTO_ODD = 111; + int EN_AUTO_EVEN = 112; + int EN_BEFORE_EDGE = 113; + int EN_TEXT_BEFORE_EDGE = 114; + int EN_CENTRAL = 115; + int EN_AFTER_EDGE = 116; + int EN_TEXT_AFTER_EDGE = 117; + int EN_IDEOGRAPHIC = 118; + int EN_HANGING = 119; + int EN_MATHEMATICAL = 120; + int EN_SCALE_TO_FIT = 121; + int EN_USE_FONT_METRICS = 122; + int EN_INDEFINITE = 123; + int EN_LARGER = 124; + int EN_SMALLER = 125; + int EN_INSIDE = 126; + int EN_OUTSIDE = 127; + int EN_CONSIDER_SHIFTS = 128; + int EN_DISREGARD_SHIFTS = 129; + int EN_INTEGER_PIXELS = 130; + int EN_RESAMPLE_ANY_METHOD = 131; + int EN_USE_SCRIPT = 132; + int EN_NO_CHANGE = 133; + int EN_RESET_SIZE = 134; + int EN_WIDER = 135; + int EN_NARROWER = 136; + int EN_ULTRA_CONDENSED = 137; + int EN_EXTRA_CONDENSED = 138; + int EN_CONDENSED = 139; + int EN_SEMI_CONDENSED = 140; + int EN_SEMI_EXPANDED = 141; + int EN_EXPANDED = 142; + int EN_EXTRA_EXPANDED = 143; + int EN_ULTRA_EXPANDED = 144; + int EN_LINE = 145; + int EN_INDENT = 146; + int EN_BLOCK = 147; + int EN_BOTH = 148; + int EN_COLLAPSE_WITH_PRECEDENCE = 149; + int EN_SHOW = 150; + int EN_HIDE = 151; + int EN_EMBED = 152; + int EN_BIDI_OVERRIDE = 153; + int EN_LTR = 154; + int EN_RTL = 155; + int EN_CHARACTER_BY_CHARACTER = 156; + int EN_SUPPRESS = 157; + int EN_PAGINATE = 158; + int EN_BOUNDED_IN_ONE_DIMENSION = 159; + int EN_UNBOUNDED = 160; + int EN_INHERIT = 161; + int ENUM_COUNT = 161; } diff --git a/src/java/org/apache/fop/fo/FOPropertyMapping.java b/src/java/org/apache/fop/fo/FOPropertyMapping.java index cdecce0ef..14878037f 100644 --- a/src/java/org/apache/fop/fo/FOPropertyMapping.java +++ b/src/java/org/apache/fop/fo/FOPropertyMapping.java @@ -233,28 +233,28 @@ public class FOPropertyMapping implements Constants { // GenericBoolean genericBoolean = new EnumProperty.Maker(0); - genericBoolean.addEnum("true", makeEnumProperty(TRUE, "TRUE")); - genericBoolean.addEnum("false", makeEnumProperty(FALSE, "FALSE")); + genericBoolean.addEnum("true", makeEnumProperty(EN_TRUE, "TRUE")); + genericBoolean.addEnum("false", makeEnumProperty(EN_FALSE, "FALSE")); // GenericKeep genericKeep = new KeepProperty.Maker(0); sub = new NumberProperty.Maker(CP_WITHIN_PAGE); sub.setByShorthand(true); sub.setDefault("auto"); - sub.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - sub.addEnum("always", makeEnumProperty(ALWAYS, "ALWAYS")); + sub.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + sub.addEnum("always", makeEnumProperty(EN_ALWAYS, "ALWAYS")); genericKeep.addSubpropMaker(sub); sub = new NumberProperty.Maker(CP_WITHIN_LINE); sub.setByShorthand(true); sub.setDefault("auto"); - sub.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - sub.addEnum("always", makeEnumProperty(ALWAYS, "ALWAYS")); + sub.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + sub.addEnum("always", makeEnumProperty(EN_ALWAYS, "ALWAYS")); genericKeep.addSubpropMaker(sub); sub = new NumberProperty.Maker(CP_WITHIN_COLUMN); sub.setByShorthand(true); sub.setDefault("auto"); - sub.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - sub.addEnum("always", makeEnumProperty(ALWAYS, "ALWAYS")); + sub.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + sub.addEnum("always", makeEnumProperty(EN_ALWAYS, "ALWAYS")); genericKeep.addSubpropMaker(sub); // GenericCondLength @@ -263,8 +263,8 @@ public class FOPropertyMapping implements Constants { sub.setByShorthand(true); genericCondLength.addSubpropMaker(sub); sub = new EnumProperty.Maker(CP_CONDITIONALITY); - sub.addEnum("discard", makeEnumProperty(DISCARD, "DISCARD")); - sub.addEnum("retain", makeEnumProperty(RETAIN, "RETAIN")); + sub.addEnum("discard", makeEnumProperty(EN_DISCARD, "DISCARD")); + sub.addEnum("retain", makeEnumProperty(EN_RETAIN, "RETAIN")); genericCondLength.addSubpropMaker(sub); // GenericCondPadding @@ -294,8 +294,8 @@ public class FOPropertyMapping implements Constants { sub.setDefault("medium"); genericCondBorderWidth.addSubpropMaker(sub); sub = new EnumProperty.Maker(CP_CONDITIONALITY); - sub.addEnum("discard", makeEnumProperty(DISCARD, "DISCARD")); - sub.addEnum("retain", makeEnumProperty(RETAIN, "RETAIN")); + sub.addEnum("discard", makeEnumProperty(EN_DISCARD, "DISCARD")); + sub.addEnum("retain", makeEnumProperty(EN_RETAIN, "RETAIN")); genericCondBorderWidth.addSubpropMaker(sub); // GenericBorderWidth @@ -309,26 +309,26 @@ public class FOPropertyMapping implements Constants { // GenericBorderStyle genericBorderStyle = new EnumProperty.Maker(0); genericBorderStyle.setInherited(false); - genericBorderStyle.addEnum("none", makeEnumProperty(NONE, "NONE")); - genericBorderStyle.addEnum("hidden", makeEnumProperty(HIDDEN, "HIDDEN")); - genericBorderStyle.addEnum("dotted", makeEnumProperty(DOTTED, "DOTTED")); - genericBorderStyle.addEnum("dashed", makeEnumProperty(DASHED, "DASHED")); - genericBorderStyle.addEnum("solid", makeEnumProperty(SOLID, "SOLID")); - genericBorderStyle.addEnum("double", makeEnumProperty(DOUBLE, "DOUBLE")); - genericBorderStyle.addEnum("groove", makeEnumProperty(GROOVE, "GROOVE")); - genericBorderStyle.addEnum("ridge", makeEnumProperty(RIDGE, "RIDGE")); - genericBorderStyle.addEnum("inset", makeEnumProperty(INSET, "INSET")); - genericBorderStyle.addEnum("outset", makeEnumProperty(OUTSET, "OUTSET")); + genericBorderStyle.addEnum("none", makeEnumProperty(EN_NONE, "NONE")); + genericBorderStyle.addEnum("hidden", makeEnumProperty(EN_HIDDEN, "HIDDEN")); + genericBorderStyle.addEnum("dotted", makeEnumProperty(EN_DOTTED, "DOTTED")); + genericBorderStyle.addEnum("dashed", makeEnumProperty(EN_DASHED, "DASHED")); + genericBorderStyle.addEnum("solid", makeEnumProperty(EN_SOLID, "SOLID")); + genericBorderStyle.addEnum("double", makeEnumProperty(EN_DOUBLE, "DOUBLE")); + genericBorderStyle.addEnum("groove", makeEnumProperty(EN_GROOVE, "GROOVE")); + genericBorderStyle.addEnum("ridge", makeEnumProperty(EN_RIDGE, "RIDGE")); + genericBorderStyle.addEnum("inset", makeEnumProperty(EN_INSET, "INSET")); + genericBorderStyle.addEnum("outset", makeEnumProperty(EN_OUTSET, "OUTSET")); genericBorderStyle.setDefault("none"); // GenericBreak genericBreak = new EnumProperty.Maker(0); genericBreak.setInherited(false); - genericBreak.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - genericBreak.addEnum("column", makeEnumProperty(COLUMN, "COLUMN")); - genericBreak.addEnum("page", makeEnumProperty(PAGE, "PAGE")); - genericBreak.addEnum("even-page", makeEnumProperty(EVEN_PAGE, "EVEN_PAGE")); - genericBreak.addEnum("odd-page", makeEnumProperty(ODD_PAGE, "ODD_PAGE")); + genericBreak.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + genericBreak.addEnum("column", makeEnumProperty(EN_COLUMN, "COLUMN")); + genericBreak.addEnum("page", makeEnumProperty(EN_PAGE, "PAGE")); + genericBreak.addEnum("even-page", makeEnumProperty(EN_EVEN_PAGE, "EVEN_PAGE")); + genericBreak.addEnum("odd-page", makeEnumProperty(EN_ODD_PAGE, "ODD_PAGE")); genericBreak.setDefault("auto"); // GenericSpace @@ -347,12 +347,12 @@ public class FOPropertyMapping implements Constants { sub.setByShorthand(true); genericSpace.addSubpropMaker(sub); sub = new NumberProperty.Maker(CP_PRECEDENCE); - sub.addEnum("force", makeEnumProperty(FORCE, "FORCE")); + sub.addEnum("force", makeEnumProperty(EN_FORCE, "FORCE")); sub.setDefault("0"); genericSpace.addSubpropMaker(sub); sub = new EnumProperty.Maker(CP_CONDITIONALITY); - sub.addEnum("discard", makeEnumProperty(DISCARD, "DISCARD")); - sub.addEnum("retain", makeEnumProperty(RETAIN, "RETAIN")); + sub.addEnum("discard", makeEnumProperty(EN_DISCARD, "DISCARD")); + sub.addEnum("retain", makeEnumProperty(EN_RETAIN, "RETAIN")); sub.setDefault("discard"); genericSpace.addSubpropMaker(sub); } @@ -507,9 +507,9 @@ public class FOPropertyMapping implements Constants { // absolute-position m = new EnumProperty.Maker(PR_ABSOLUTE_POSITION); m.setInherited(false); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - m.addEnum("fixed", makeEnumProperty(FIXED, "FIXED")); - m.addEnum("absolute", makeEnumProperty(ABSOLUTE, "ABSOLUTE")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + m.addEnum("fixed", makeEnumProperty(EN_FIXED, "FIXED")); + m.addEnum("absolute", makeEnumProperty(EN_ABSOLUTE, "ABSOLUTE")); m.setDefault("auto"); m.addShorthand(s_generics[PR_POSITION]); addPropertyMaker("absolute-position", m); @@ -517,28 +517,28 @@ public class FOPropertyMapping implements Constants { // top l = new LengthProperty.Maker(PR_TOP); l.setInherited(false); - l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + l.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); l.setDefault("auto"); addPropertyMaker("top", l); // right l = new LengthProperty.Maker(PR_RIGHT); l.setInherited(false); - l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + l.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); l.setDefault("auto"); addPropertyMaker("right", l); // bottom l = new LengthProperty.Maker(PR_BOTTOM); l.setInherited(false); - l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + l.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); l.setDefault("auto"); addPropertyMaker("bottom", l); // left l = new LengthProperty.Maker(PR_LEFT); l.setInherited(false); - l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + l.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); l.setDefault("auto"); addPropertyMaker("left", l); } @@ -663,8 +663,8 @@ public class FOPropertyMapping implements Constants { // background-attachment m = new EnumProperty.Maker(PR_BACKGROUND_ATTACHMENT); m.setInherited(false); - m.addEnum("scroll", makeEnumProperty(SCROLL, "SCROLL")); - m.addEnum("fixed", makeEnumProperty(FIXED, "FIXED")); + m.addEnum("scroll", makeEnumProperty(EN_SCROLL, "SCROLL")); + m.addEnum("fixed", makeEnumProperty(EN_FIXED, "FIXED")); m.setDefault("scroll"); addPropertyMaker("background-attachment", m); @@ -693,10 +693,10 @@ public class FOPropertyMapping implements Constants { // background-repeat m = new EnumProperty.Maker(PR_BACKGROUND_REPEAT); m.setInherited(false); - m.addEnum("repeat", makeEnumProperty(REPEAT, "REPEAT")); - m.addEnum("repeat-x", makeEnumProperty(REPEATX, "REPEATX")); - m.addEnum("repeat-y", makeEnumProperty(REPEATY, "REPEATY")); - m.addEnum("no-repeat", makeEnumProperty(NOREPEAT, "NOREPEAT")); + m.addEnum("repeat", makeEnumProperty(EN_REPEAT, "REPEAT")); + m.addEnum("repeat-x", makeEnumProperty(EN_REPEATX, "REPEATX")); + m.addEnum("repeat-y", makeEnumProperty(EN_REPEATY, "REPEATY")); + m.addEnum("no-repeat", makeEnumProperty(EN_NOREPEAT, "NOREPEAT")); m.setDefault("repeat"); addPropertyMaker("background-repeat", m); @@ -1061,8 +1061,8 @@ public class FOPropertyMapping implements Constants { // font-selection-strategy m = new EnumProperty.Maker(PR_FONT_SELECTION_STRATEGY); m.setInherited(true); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - m.addEnum("character-by-character", makeEnumProperty(CHARACTER_BY_CHARACTER, "CHARACTER_BY_CHARACTER")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + m.addEnum("character-by-character", makeEnumProperty(EN_CHARACTER_BY_CHARACTER, "CHARACTER_BY_CHARACTER")); m.setDefault("auto"); addPropertyMaker("font-selection-strategy", m); @@ -1075,24 +1075,24 @@ public class FOPropertyMapping implements Constants { // font-stretch m = new EnumProperty.Maker(PR_FONT_STRETCH); - m.addEnum("normal", makeEnumProperty(NORMAL, "NORMAL")); - m.addEnum("wider", makeEnumProperty(WIDER, "WIDER")); - m.addEnum("narrower", makeEnumProperty(NARROWER, "NARROWER")); - m.addEnum("ultra-condensed", makeEnumProperty(ULTRA_CONDENSED, "ULTRA_CONDENSED")); - m.addEnum("extra-condensed", makeEnumProperty(EXTRA_CONDENSED, "EXTRA_CONDENSED")); - m.addEnum("condensed", makeEnumProperty(CONDENSED, "CONDENSED")); - m.addEnum("semi-condensed", makeEnumProperty(SEMI_CONDENSED, "SEMI_CONDENSED")); - m.addEnum("semi-expanded", makeEnumProperty(SEMI_EXPANDED, "SEMI_EXPANDED")); - m.addEnum("expanded", makeEnumProperty(EXPANDED, "EXPANDED")); - m.addEnum("extra-expanded", makeEnumProperty(EXTRA_EXPANDED, "EXTRA_EXPANDED")); - m.addEnum("ultra-expanded", makeEnumProperty(ULTRA_EXPANDED, "ULTRA_EXPANDED")); + m.addEnum("normal", makeEnumProperty(EN_NORMAL, "NORMAL")); + m.addEnum("wider", makeEnumProperty(EN_WIDER, "WIDER")); + m.addEnum("narrower", makeEnumProperty(EN_NARROWER, "NARROWER")); + m.addEnum("ultra-condensed", makeEnumProperty(EN_ULTRA_CONDENSED, "ULTRA_CONDENSED")); + m.addEnum("extra-condensed", makeEnumProperty(EN_EXTRA_CONDENSED, "EXTRA_CONDENSED")); + m.addEnum("condensed", makeEnumProperty(EN_CONDENSED, "CONDENSED")); + m.addEnum("semi-condensed", makeEnumProperty(EN_SEMI_CONDENSED, "SEMI_CONDENSED")); + m.addEnum("semi-expanded", makeEnumProperty(EN_SEMI_EXPANDED, "SEMI_EXPANDED")); + m.addEnum("expanded", makeEnumProperty(EN_EXPANDED, "EXPANDED")); + m.addEnum("extra-expanded", makeEnumProperty(EN_EXTRA_EXPANDED, "EXTRA_EXPANDED")); + m.addEnum("ultra-expanded", makeEnumProperty(EN_ULTRA_EXPANDED, "ULTRA_EXPANDED")); m.setDefault("normal"); addPropertyMaker("font-stretch", m); // font-size-adjust m = new NumberProperty.Maker(PR_FONT_SIZE_ADJUST); m.setInherited(true); - m.addEnum("none", makeEnumProperty(NONE, "NONE")); + m.addEnum("none", makeEnumProperty(EN_NONE, "NONE")); m.setDefault("none"); addPropertyMaker("font-size-adjust", m); @@ -1105,8 +1105,8 @@ public class FOPropertyMapping implements Constants { // font-variant m = new EnumProperty.Maker(PR_FONT_VARIANT); m.setInherited(true); - m.addEnum("normal", makeEnumProperty(NORMAL, "NORMAL")); - m.addEnum("small-caps", makeEnumProperty(SMALL_CAPS, "SMALL_CAPS")); + m.addEnum("normal", makeEnumProperty(EN_NORMAL, "NORMAL")); + m.addEnum("small-caps", makeEnumProperty(EN_SMALL_CAPS, "SMALL_CAPS")); m.setDefault("normal"); addPropertyMaker("font-variant", m); @@ -1143,8 +1143,8 @@ public class FOPropertyMapping implements Constants { // hyphenate m = new EnumProperty.Maker(PR_HYPHENATE); m.setInherited(true); - m.addEnum("true", makeEnumProperty(TRUE, "TRUE")); - m.addEnum("false", makeEnumProperty(FALSE, "FALSE")); + m.addEnum("true", makeEnumProperty(EN_TRUE, "TRUE")); + m.addEnum("false", makeEnumProperty(EN_FALSE, "FALSE")); m.setDefault("false"); addPropertyMaker("hyphenate", m); @@ -1274,8 +1274,8 @@ public class FOPropertyMapping implements Constants { // relative-position m = new EnumProperty.Maker(PR_RELATIVE_POSITION); m.setInherited(false); - m.addEnum("static", makeEnumProperty(STATIC, "STATIC")); - m.addEnum("relative", makeEnumProperty(RELATIVE, "RELATIVE")); + m.addEnum("static", makeEnumProperty(EN_STATIC, "STATIC")); + m.addEnum("relative", makeEnumProperty(EN_RELATIVE, "RELATIVE")); m.setDefault("static"); m.addShorthand(s_generics[PR_POSITION]); addPropertyMaker("relative-position", m); @@ -1287,85 +1287,85 @@ public class FOPropertyMapping implements Constants { // alignment-adjust m = new LengthProperty.Maker(PR_ALIGNMENT_ADJUST); m.setInherited(false); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - m.addEnum("baseline", makeEnumProperty(BASELINE, "BASELINE")); - m.addEnum("before-edge", makeEnumProperty(BEFORE_EDGE, "BEFORE_EDGE")); - m.addEnum("text-before-edge", makeEnumProperty(TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE")); - m.addEnum("middle", makeEnumProperty(MIDDLE, "MIDDLE")); - m.addEnum("central", makeEnumProperty(CENTRAL, "CENTRAL")); - m.addEnum("after-edge", makeEnumProperty(AFTER_EDGE, "AFTER_EDGE")); - m.addEnum("text-after-edge", makeEnumProperty(TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE")); - m.addEnum("ideographic", makeEnumProperty(IDEOGRAPHIC, "IDEOGRAPHIC")); - m.addEnum("alphabetic", makeEnumProperty(ALPHABETIC, "ALPHABETIC")); - m.addEnum("hanging", makeEnumProperty(HANGING, "HANGING")); - m.addEnum("mathematical", makeEnumProperty(MATHEMATICAL, "MATHEMATICAL")); - m.addEnum("top", makeEnumProperty(TOP, "TOP")); - m.addEnum("bottom", makeEnumProperty(BOTTOM, "BOTTOM")); - m.addEnum("text-top", makeEnumProperty(TEXT_TOP, "TEXT_TOP")); - m.addEnum("text-bottom", makeEnumProperty(TEXT_BOTTOM, "TEXT_BOTTOM")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + m.addEnum("baseline", makeEnumProperty(EN_BASELINE, "BASELINE")); + m.addEnum("before-edge", makeEnumProperty(EN_BEFORE_EDGE, "BEFORE_EDGE")); + m.addEnum("text-before-edge", makeEnumProperty(EN_TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE")); + m.addEnum("middle", makeEnumProperty(EN_MIDDLE, "MIDDLE")); + m.addEnum("central", makeEnumProperty(EN_CENTRAL, "CENTRAL")); + m.addEnum("after-edge", makeEnumProperty(EN_AFTER_EDGE, "AFTER_EDGE")); + m.addEnum("text-after-edge", makeEnumProperty(EN_TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE")); + m.addEnum("ideographic", makeEnumProperty(EN_IDEOGRAPHIC, "IDEOGRAPHIC")); + m.addEnum("alphabetic", makeEnumProperty(EN_ALPHABETIC, "ALPHABETIC")); + m.addEnum("hanging", makeEnumProperty(EN_HANGING, "HANGING")); + m.addEnum("mathematical", makeEnumProperty(EN_MATHEMATICAL, "MATHEMATICAL")); + m.addEnum("top", makeEnumProperty(EN_TOP, "TOP")); + m.addEnum("bottom", makeEnumProperty(EN_BOTTOM, "BOTTOM")); + m.addEnum("text-top", makeEnumProperty(EN_TEXT_TOP, "TEXT_TOP")); + m.addEnum("text-bottom", makeEnumProperty(EN_TEXT_BOTTOM, "TEXT_BOTTOM")); m.setDefault("auto"); addPropertyMaker("alignment-adjust", m); // alignment-baseline m = new EnumProperty.Maker(PR_ALIGNMENT_BASELINE); m.setInherited(false); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - m.addEnum("baseline", makeEnumProperty(BASELINE, "BASELINE")); - m.addEnum("before-edge", makeEnumProperty(BEFORE_EDGE, "BEFORE_EDGE")); - m.addEnum("text-before-edge", makeEnumProperty(TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE")); - m.addEnum("middle", makeEnumProperty(MIDDLE, "MIDDLE")); - m.addEnum("central", makeEnumProperty(CENTRAL, "CENTRAL")); - m.addEnum("after-edge", makeEnumProperty(AFTER_EDGE, "AFTER_EDGE")); - m.addEnum("text-after-edge", makeEnumProperty(TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE")); - m.addEnum("ideographic", makeEnumProperty(IDEOGRAPHIC, "IDEOGRAPHIC")); - m.addEnum("alphabetic", makeEnumProperty(ALPHABETIC, "ALPHABETIC")); - m.addEnum("hanging", makeEnumProperty(HANGING, "HANGING")); - m.addEnum("mathematical", makeEnumProperty(MATHEMATICAL, "MATHEMATICAL")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + m.addEnum("baseline", makeEnumProperty(EN_BASELINE, "BASELINE")); + m.addEnum("before-edge", makeEnumProperty(EN_BEFORE_EDGE, "BEFORE_EDGE")); + m.addEnum("text-before-edge", makeEnumProperty(EN_TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE")); + m.addEnum("middle", makeEnumProperty(EN_MIDDLE, "MIDDLE")); + m.addEnum("central", makeEnumProperty(EN_CENTRAL, "CENTRAL")); + m.addEnum("after-edge", makeEnumProperty(EN_AFTER_EDGE, "AFTER_EDGE")); + m.addEnum("text-after-edge", makeEnumProperty(EN_TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE")); + m.addEnum("ideographic", makeEnumProperty(EN_IDEOGRAPHIC, "IDEOGRAPHIC")); + m.addEnum("alphabetic", makeEnumProperty(EN_ALPHABETIC, "ALPHABETIC")); + m.addEnum("hanging", makeEnumProperty(EN_HANGING, "HANGING")); + m.addEnum("mathematical", makeEnumProperty(EN_MATHEMATICAL, "MATHEMATICAL")); m.setDefault("auto"); addPropertyMaker("alignment-baseline", m); // baseline-shift m = new LengthProperty.Maker(PR_BASELINE_SHIFT); m.setInherited(false); - m.addEnum("baseline", makeEnumProperty(BASELINE, "BASELINE")); - m.addEnum("sub", makeEnumProperty(SUB, "SUB")); - m.addEnum("super", makeEnumProperty(SUPER, "SUPER")); + m.addEnum("baseline", makeEnumProperty(EN_BASELINE, "BASELINE")); + m.addEnum("sub", makeEnumProperty(EN_SUB, "SUB")); + m.addEnum("super", makeEnumProperty(EN_SUPER, "SUPER")); m.setDefault("baseline"); addPropertyMaker("baseline-shift", m); // display-align m = new EnumProperty.Maker(PR_DISPLAY_ALIGN); m.setInherited(true); - m.addEnum("before", makeEnumProperty(BEFORE, "BEFORE")); - m.addEnum("after", makeEnumProperty(AFTER, "AFTER")); - m.addEnum("center", makeEnumProperty(CENTER, "CENTER")); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + m.addEnum("before", makeEnumProperty(EN_BEFORE, "BEFORE")); + m.addEnum("after", makeEnumProperty(EN_AFTER, "AFTER")); + m.addEnum("center", makeEnumProperty(EN_CENTER, "CENTER")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); m.setDefault("auto"); addPropertyMaker("display-align", m); // dominant-baseline m = new EnumProperty.Maker(PR_DOMINANT_BASELINE); m.setInherited(false); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - m.addEnum("use-script", makeEnumProperty(USE_SCRIPT, "USE_SCRIPT")); - m.addEnum("no-change", makeEnumProperty(NO_CHANGE, "NO_CHANGE")); - m.addEnum("reset-size", makeEnumProperty(RESET_SIZE, "RESET_SIZE")); - m.addEnum("ideographic", makeEnumProperty(IDEOGRAPHIC, "IDEOGRAPHIC")); - m.addEnum("alphabetic", makeEnumProperty(ALPHABETIC, "ALPHABETIC")); - m.addEnum("hanging", makeEnumProperty(HANGING, "HANGING")); - m.addEnum("mathematical", makeEnumProperty(MATHEMATICAL, "MATHEMATICAL")); - m.addEnum("central", makeEnumProperty(CENTRAL, "CENTRAL")); - m.addEnum("middle", makeEnumProperty(MIDDLE, "MIDDLE")); - m.addEnum("text-after-edge", makeEnumProperty(TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE" )); - m.addEnum("text-before-edge", makeEnumProperty(TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + m.addEnum("use-script", makeEnumProperty(EN_USE_SCRIPT, "USE_SCRIPT")); + m.addEnum("no-change", makeEnumProperty(EN_NO_CHANGE, "NO_CHANGE")); + m.addEnum("reset-size", makeEnumProperty(EN_RESET_SIZE, "RESET_SIZE")); + m.addEnum("ideographic", makeEnumProperty(EN_IDEOGRAPHIC, "IDEOGRAPHIC")); + m.addEnum("alphabetic", makeEnumProperty(EN_ALPHABETIC, "ALPHABETIC")); + m.addEnum("hanging", makeEnumProperty(EN_HANGING, "HANGING")); + m.addEnum("mathematical", makeEnumProperty(EN_MATHEMATICAL, "MATHEMATICAL")); + m.addEnum("central", makeEnumProperty(EN_CENTRAL, "CENTRAL")); + m.addEnum("middle", makeEnumProperty(EN_MIDDLE, "MIDDLE")); + m.addEnum("text-after-edge", makeEnumProperty(EN_TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE" )); + m.addEnum("text-before-edge", makeEnumProperty(EN_TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE")); m.setDefault("auto"); addPropertyMaker("dominant-baseline", m); // relative-align m = new EnumProperty.Maker(PR_RELATIVE_ALIGN); m.setInherited(true); - m.addEnum("before", makeEnumProperty(BEFORE, "BEFORE")); - m.addEnum("baseline", makeEnumProperty(BASELINE, "BASELINE")); + m.addEnum("before", makeEnumProperty(EN_BEFORE, "BEFORE")); + m.addEnum("baseline", makeEnumProperty(EN_BASELINE, "BASELINE")); m.setDefault("before"); addPropertyMaker("relative-align", m); } @@ -1383,20 +1383,20 @@ public class FOPropertyMapping implements Constants { l = new LengthProperty.Maker(CP_MINIMUM); l.setDefault("auto"); - l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + l.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); l.setPercentBase(LengthBase.CONTAINING_BOX); l.setByShorthand(true); m.addSubpropMaker(l); l = new LengthProperty.Maker(CP_OPTIMUM); l.setDefault("auto"); - l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + l.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); l.setPercentBase(LengthBase.CONTAINING_BOX); l.setByShorthand(true); m.addSubpropMaker(l); l = new LengthProperty.Maker(CP_MAXIMUM); - l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + l.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); l.setDefault("auto"); l.setPercentBase(LengthBase.CONTAINING_BOX); l.setByShorthand(true); @@ -1415,23 +1415,23 @@ public class FOPropertyMapping implements Constants { // content-height l = new LengthProperty.Maker(PR_CONTENT_HEIGHT); l.setInherited(false); - l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - l.addEnum("scale-to-fit", makeEnumProperty(SCALE_TO_FIT, "SCALE_TO_FIT")); + l.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + l.addEnum("scale-to-fit", makeEnumProperty(EN_SCALE_TO_FIT, "SCALE_TO_FIT")); l.setDefault("auto"); addPropertyMaker("content-height", l); // content-width l = new LengthProperty.Maker(PR_CONTENT_WIDTH); l.setInherited(false); - l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - l.addEnum("scale-to-fit", makeEnumProperty(SCALE_TO_FIT, "SCALE_TO_FIT")); + l.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + l.addEnum("scale-to-fit", makeEnumProperty(EN_SCALE_TO_FIT, "SCALE_TO_FIT")); l.setDefault("auto"); addPropertyMaker("content-width", l); // height l = new LengthProperty.Maker(PR_HEIGHT); l.setInherited(false); - l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + l.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); l.setDefault("auto"); addPropertyMaker("height", l); @@ -1442,20 +1442,20 @@ public class FOPropertyMapping implements Constants { l = new LengthProperty.Maker(CP_MINIMUM); l.setDefault("auto"); - l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + l.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); l.setPercentBase(LengthBase.CONTAINING_BOX); l.setByShorthand(true); m.addSubpropMaker(l); l = new LengthProperty.Maker(CP_OPTIMUM); l.setDefault("auto"); - l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + l.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); l.setPercentBase(LengthBase.CONTAINING_BOX); l.setByShorthand(true); m.addSubpropMaker(l); l = new LengthProperty.Maker(CP_MAXIMUM); - l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + l.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); l.setDefault("auto"); l.setPercentBase(LengthBase.CONTAINING_BOX); l.setByShorthand(true); @@ -1498,24 +1498,24 @@ public class FOPropertyMapping implements Constants { // scaling m = new EnumProperty.Maker(PR_SCALING); m.setInherited(true); - m.addEnum("uniform", makeEnumProperty(UNIFORM, "UNIFORM")); - m.addEnum("non-uniform", makeEnumProperty(NON_UNIFORM, "NON_UNIFORM")); + m.addEnum("uniform", makeEnumProperty(EN_UNIFORM, "UNIFORM")); + m.addEnum("non-uniform", makeEnumProperty(EN_NON_UNIFORM, "NON_UNIFORM")); m.setDefault("uniform"); addPropertyMaker("scaling", m); // scaling-method m = new EnumProperty.Maker(PR_SCALING_METHOD); m.setInherited(false); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - m.addEnum("integer-pixels", makeEnumProperty(INTEGER_PIXELS, "INTEGER_PIXELS")); - m.addEnum("resample-any-method", makeEnumProperty(RESAMPLE_ANY_METHOD, "RESAMPLE_ANY_METHOD")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + m.addEnum("integer-pixels", makeEnumProperty(EN_INTEGER_PIXELS, "INTEGER_PIXELS")); + m.addEnum("resample-any-method", makeEnumProperty(EN_RESAMPLE_ANY_METHOD, "RESAMPLE_ANY_METHOD")); m.setDefault("auto"); addPropertyMaker("scaling-method", m); // width l = new LengthProperty.Maker(PR_WIDTH); l.setInherited(false); - l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + l.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); l.setPercentBase(LengthBase.BLOCK_WIDTH); l.setDefault("auto"); addPropertyMaker("width", l); @@ -1527,16 +1527,16 @@ public class FOPropertyMapping implements Constants { // hyphenation-keep m = new EnumProperty.Maker(PR_HYPHENATION_KEEP); m.setInherited(true); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - m.addEnum("column", makeEnumProperty(COLUMN, "COLUMN")); - m.addEnum("page", makeEnumProperty(PAGE, "PAGE")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + m.addEnum("column", makeEnumProperty(EN_COLUMN, "COLUMN")); + m.addEnum("page", makeEnumProperty(EN_PAGE, "PAGE")); m.setDefault("auto"); addPropertyMaker("hyphenation-keep", m); // hyphenation-ladder-count m = new NumberProperty.Maker(PR_HYPHENATION_LADDER_COUNT); m.setInherited(true); - m.addEnum("no-limit", makeEnumProperty(NO_LIMIT, "NO_LIMIT")); + m.addEnum("no-limit", makeEnumProperty(EN_NO_LIMIT, "NO_LIMIT")); m.setDefault("no-limit"); addPropertyMaker("hyphenation-ladder-count", m); @@ -1558,38 +1558,38 @@ public class FOPropertyMapping implements Constants { // line-height-shift-adjustment m = new EnumProperty.Maker(PR_LINE_HEIGHT_SHIFT_ADJUSTMENT); m.setInherited(true); - m.addEnum("consider-shifts", makeEnumProperty(CONSIDER_SHIFTS, "CONSIDER_SHIFTS")); - m.addEnum("disregard-shifts", makeEnumProperty(DISREGARD_SHIFTS, "DISREGARD_SHIFTS")); + m.addEnum("consider-shifts", makeEnumProperty(EN_CONSIDER_SHIFTS, "CONSIDER_SHIFTS")); + m.addEnum("disregard-shifts", makeEnumProperty(EN_DISREGARD_SHIFTS, "DISREGARD_SHIFTS")); m.setDefault("consider-shifts"); addPropertyMaker("line-height-shift-adjustment", m); // line-stacking-strategy m = new EnumProperty.Maker(PR_LINE_STACKING_STRATEGY); m.setInherited(true); - m.addEnum("line-height", makeEnumProperty(LINE_HEIGHT, "LINE_HEIGHT")); - m.addEnum("font-height", makeEnumProperty(FONT_HEIGHT, "FONT_HEIGHT")); - m.addEnum("max-height", makeEnumProperty(MAX_HEIGHT, "MAX_HEIGHT")); + m.addEnum("line-height", makeEnumProperty(EN_LINE_HEIGHT, "LINE_HEIGHT")); + m.addEnum("font-height", makeEnumProperty(EN_FONT_HEIGHT, "FONT_HEIGHT")); + m.addEnum("max-height", makeEnumProperty(EN_MAX_HEIGHT, "MAX_HEIGHT")); m.setDefault("max-height"); addPropertyMaker("line-stacking-strategy", m); // linefeed-treatment m = new EnumProperty.Maker(PR_LINEFEED_TREATMENT); m.setInherited(true); - m.addEnum("ignore", makeEnumProperty(IGNORE, "IGNORE")); - m.addEnum("preserve", makeEnumProperty(PRESERVE, "PRESERVE")); - m.addEnum("treat-as-space", makeEnumProperty(TREAT_AS_SPACE, "TREAT_AS_SPACE")); - m.addEnum("treat-as-zero-width-space", makeEnumProperty(TREAT_AS_ZERO_WIDTH_SPACE, "TREAT_AS_ZERO_WIDTH_SPACE")); + m.addEnum("ignore", makeEnumProperty(EN_IGNORE, "IGNORE")); + m.addEnum("preserve", makeEnumProperty(EN_PRESERVE, "PRESERVE")); + m.addEnum("treat-as-space", makeEnumProperty(EN_TREAT_AS_SPACE, "TREAT_AS_SPACE")); + m.addEnum("treat-as-zero-width-space", makeEnumProperty(EN_TREAT_AS_ZERO_WIDTH_SPACE, "TREAT_AS_ZERO_WIDTH_SPACE")); m.setDefault("treat-as-space"); addPropertyMaker("linefeed-treatment", m); // white-space-treatment m = new EnumProperty.Maker(PR_WHITE_SPACE_TREATMENT); m.setInherited(true); - m.addEnum("ignore", makeEnumProperty(IGNORE, "IGNORE")); - m.addEnum("preserve", makeEnumProperty(PRESERVE, "PRESERVE")); - m.addEnum("ignore-if-before-linefeed", makeEnumProperty(IGNORE_IF_BEFORE_LINEFEED, "IGNORE_IF_BEFORE_LINEFEED")); - m.addEnum("ignore-if-after-linefeed", makeEnumProperty(IGNORE_IF_AFTER_LINEFEED, "IGNORE_IF_AFTER_LINEFEED")); - m.addEnum("ignore-if-surrounding-linefeed", makeEnumProperty(IGNORE_IF_SURROUNDING_LINEFEED, "IGNORE_IF_SURROUNDING_LINEFEED")); + m.addEnum("ignore", makeEnumProperty(EN_IGNORE, "IGNORE")); + m.addEnum("preserve", makeEnumProperty(EN_PRESERVE, "PRESERVE")); + m.addEnum("ignore-if-before-linefeed", makeEnumProperty(EN_IGNORE_IF_BEFORE_LINEFEED, "IGNORE_IF_BEFORE_LINEFEED")); + m.addEnum("ignore-if-after-linefeed", makeEnumProperty(EN_IGNORE_IF_AFTER_LINEFEED, "IGNORE_IF_AFTER_LINEFEED")); + m.addEnum("ignore-if-surrounding-linefeed", makeEnumProperty(EN_IGNORE_IF_SURROUNDING_LINEFEED, "IGNORE_IF_SURROUNDING_LINEFEED")); m.setDefault("ignore-if-surrounding-linefeed"); addPropertyMaker("white-space-treatment", m); @@ -1598,14 +1598,14 @@ public class FOPropertyMapping implements Constants { m.setInherited(true); // Note: both 'end', 'right' and 'outside' are mapped to END // both 'start', 'left' and 'inside' are mapped to START - m.addEnum("center", makeEnumProperty(CENTER, "CENTER")); - m.addEnum("end", makeEnumProperty(END, "END")); - m.addEnum("right", makeEnumProperty(END, "END")); - m.addEnum("start", makeEnumProperty(START, "START")); - m.addEnum("left", makeEnumProperty(START, "START")); - m.addEnum("justify", makeEnumProperty(JUSTIFY, "JUSTIFY")); - m.addEnum("inside", makeEnumProperty(START, "START")); - m.addEnum("outside", makeEnumProperty(END, "END")); + m.addEnum("center", makeEnumProperty(EN_CENTER, "CENTER")); + m.addEnum("end", makeEnumProperty(EN_END, "END")); + m.addEnum("right", makeEnumProperty(EN_END, "END")); + m.addEnum("start", makeEnumProperty(EN_START, "START")); + m.addEnum("left", makeEnumProperty(EN_START, "START")); + m.addEnum("justify", makeEnumProperty(EN_JUSTIFY, "JUSTIFY")); + m.addEnum("inside", makeEnumProperty(EN_START, "START")); + m.addEnum("outside", makeEnumProperty(EN_END, "END")); m.setDefault("start"); addPropertyMaker("text-align", m); @@ -1617,24 +1617,24 @@ public class FOPropertyMapping implements Constants { return null; } int correspondingValue = corresponding.getEnum(); - if (correspondingValue == JUSTIFY) { - return makeEnumProperty(START, "START"); - } else if (correspondingValue == END) { - return makeEnumProperty(END, "END"); - } else if (correspondingValue == START) { - return makeEnumProperty(START, "START"); - } else if (correspondingValue == CENTER) { - return makeEnumProperty(CENTER, "CENTER"); + if (correspondingValue == EN_JUSTIFY) { + return makeEnumProperty(EN_START, "START"); + } else if (correspondingValue == EN_END) { + return makeEnumProperty(EN_END, "END"); + } else if (correspondingValue == EN_START) { + return makeEnumProperty(EN_START, "START"); + } else if (correspondingValue == EN_CENTER) { + return makeEnumProperty(EN_CENTER, "CENTER"); } else { return null; } } }; m.setInherited(true); - m.addEnum("center", makeEnumProperty(CENTER, "CENTER")); - m.addEnum("end", makeEnumProperty(END, "END")); - m.addEnum("start", makeEnumProperty(START, "START")); - m.addEnum("justify", makeEnumProperty(JUSTIFY, "JUSTIFY")); + m.addEnum("center", makeEnumProperty(EN_CENTER, "CENTER")); + m.addEnum("end", makeEnumProperty(EN_END, "END")); + m.addEnum("start", makeEnumProperty(EN_START, "START")); + m.addEnum("justify", makeEnumProperty(EN_JUSTIFY, "JUSTIFY")); m.setDefault("start"); addPropertyMaker("text-align-last", m); @@ -1655,8 +1655,8 @@ public class FOPropertyMapping implements Constants { // wrap-option m = new EnumProperty.Maker(PR_WRAP_OPTION); m.setInherited(true); - m.addEnum("wrap", makeEnumProperty(WRAP, "WRAP")); - m.addEnum("no-wrap", makeEnumProperty(NO_WRAP, "NO_WRAP")); + m.addEnum("wrap", makeEnumProperty(EN_WRAP, "WRAP")); + m.addEnum("no-wrap", makeEnumProperty(EN_NO_WRAP, "NO_WRAP")); m.setDefault("wrap"); addPropertyMaker("wrap-option", m); } @@ -1677,30 +1677,30 @@ public class FOPropertyMapping implements Constants { m.getSubpropMaker(CP_PRECEDENCE).setDefault("force"); m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard"); m.setDefault("normal"); - m.addEnum("normal", makeEnumProperty(NORMAL, "NORMAL")); + m.addEnum("normal", makeEnumProperty(EN_NORMAL, "NORMAL")); addPropertyMaker("letter-spacing", m); // suppress-at-line-break m = new EnumProperty.Maker(PR_SUPPRESS_AT_LINE_BREAK); m.setInherited(false); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - m.addEnum("suppress", makeEnumProperty(SUPPRESS, "SUPPRESS")); - m.addEnum("retain", makeEnumProperty(RETAIN, "RETAIN")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + m.addEnum("suppress", makeEnumProperty(EN_SUPPRESS, "SUPPRESS")); + m.addEnum("retain", makeEnumProperty(EN_RETAIN, "RETAIN")); m.setDefault("auto"); addPropertyMaker("suppress-at-line-break", m); // text-decoration m = new EnumProperty.Maker(PR_TEXT_DECORATION); m.setInherited(false); - m.addEnum("none", makeEnumProperty(NONE, "NONE")); - m.addEnum("underline", makeEnumProperty(UNDERLINE, "UNDERLINE")); - m.addEnum("overline", makeEnumProperty(OVERLINE, "OVERLINE")); - m.addEnum("line-through", makeEnumProperty(LINE_THROUGH, "LINE_THROUGH")); - m.addEnum("blink", makeEnumProperty(BLINK, "BLINK")); - m.addEnum("no-underline", makeEnumProperty(NO_UNDERLINE, "NO_UNDERLINE")); - m.addEnum("no-overline", makeEnumProperty(NO_OVERLINE, "NO_OVERLINE")); - m.addEnum("no-line-through", makeEnumProperty(NO_LINE_THROUGH, "NO_LINE_THROUGH")); - m.addEnum("no-blink", makeEnumProperty(NO_BLINK, "NO_BLINK")); + m.addEnum("none", makeEnumProperty(EN_NONE, "NONE")); + m.addEnum("underline", makeEnumProperty(EN_UNDERLINE, "UNDERLINE")); + m.addEnum("overline", makeEnumProperty(EN_OVERLINE, "OVERLINE")); + m.addEnum("line-through", makeEnumProperty(EN_LINE_THROUGH, "LINE_THROUGH")); + m.addEnum("blink", makeEnumProperty(EN_BLINK, "BLINK")); + m.addEnum("no-underline", makeEnumProperty(EN_NO_UNDERLINE, "NO_UNDERLINE")); + m.addEnum("no-overline", makeEnumProperty(EN_NO_OVERLINE, "NO_OVERLINE")); + m.addEnum("no-line-through", makeEnumProperty(EN_NO_LINE_THROUGH, "NO_LINE_THROUGH")); + m.addEnum("no-blink", makeEnumProperty(EN_NO_BLINK, "NO_BLINK")); m.setDefault("none"); addPropertyMaker("text-decoration", m); @@ -1713,18 +1713,18 @@ public class FOPropertyMapping implements Constants { // text-transform m = new EnumProperty.Maker(PR_TEXT_TRANSFORM); m.setInherited(true); - m.addEnum("none", makeEnumProperty(NONE, "NONE")); - m.addEnum("capitalize", makeEnumProperty(CAPITALIZE, "CAPITALIZE")); - m.addEnum("uppercase", makeEnumProperty(UPPERCASE, "UPPERCASE")); - m.addEnum("lowercase", makeEnumProperty(LOWERCASE, "LOWERCASE")); + m.addEnum("none", makeEnumProperty(EN_NONE, "NONE")); + m.addEnum("capitalize", makeEnumProperty(EN_CAPITALIZE, "CAPITALIZE")); + m.addEnum("uppercase", makeEnumProperty(EN_UPPERCASE, "UPPERCASE")); + m.addEnum("lowercase", makeEnumProperty(EN_LOWERCASE, "LOWERCASE")); m.setDefault("none"); addPropertyMaker("text-transform", m); // treat-as-word-space m = new EnumProperty.Maker(PR_TREAT_AS_WORD_SPACE); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - m.addEnum("true", makeEnumProperty(TRUE, "TRUE")); - m.addEnum("false", makeEnumProperty(FALSE, "FALSE")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + m.addEnum("true", makeEnumProperty(EN_TRUE, "TRUE")); + m.addEnum("false", makeEnumProperty(EN_FALSE, "FALSE")); m.setInherited(false); m.setDefault("auto"); addPropertyMaker("treat-as-word-space", m); @@ -1736,7 +1736,7 @@ public class FOPropertyMapping implements Constants { m.getSubpropMaker(CP_PRECEDENCE).setDefault("force"); m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard"); m.setDefault("normal"); - m.addEnum("normal", makeEnumProperty(NORMAL, "NORMAL")); + m.addEnum("normal", makeEnumProperty(EN_NORMAL, "NORMAL")); addPropertyMaker("word-spacing", m); } @@ -1759,11 +1759,11 @@ public class FOPropertyMapping implements Constants { // rendering-intent m = new EnumProperty.Maker(PR_RENDERING_INTENT); m.setInherited(false); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - m.addEnum("perceptual", makeEnumProperty(PERCEPTUAL, "PERCEPTUAL")); - m.addEnum("relative-colorimetric", makeEnumProperty(RELATIVE_COLOMETRIC, "RELATIVE_COLOMETRIC")); - m.addEnum("saturation", makeEnumProperty(SATURATION, "SATURATION")); - m.addEnum("absolute-colorimetric", makeEnumProperty(ABSOLUTE_COLORMETRIC, "ABSOLUTE_COLORMETRIC")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + m.addEnum("perceptual", makeEnumProperty(EN_PERCEPTUAL, "PERCEPTUAL")); + m.addEnum("relative-colorimetric", makeEnumProperty(EN_RELATIVE_COLOMETRIC, "RELATIVE_COLOMETRIC")); + m.addEnum("saturation", makeEnumProperty(EN_SATURATION, "SATURATION")); + m.addEnum("absolute-colorimetric", makeEnumProperty(EN_ABSOLUTE_COLORMETRIC, "ABSOLUTE_COLORMETRIC")); m.setDefault("auto"); addPropertyMaker("rendering-intent", m); } @@ -1775,12 +1775,12 @@ public class FOPropertyMapping implements Constants { m = new EnumProperty.Maker(PR_CLEAR); m.setInherited(false); // Note that left -> start and right -> end. - m.addEnum("start", makeEnumProperty(START, "START")); - m.addEnum("end", makeEnumProperty(END, "END")); - m.addEnum("left", makeEnumProperty(START, "START")); - m.addEnum("right", makeEnumProperty(END, "END")); - m.addEnum("both", makeEnumProperty(BOTH, "BOTH")); - m.addEnum("none", makeEnumProperty(NONE, "NONE")); + m.addEnum("start", makeEnumProperty(EN_START, "START")); + m.addEnum("end", makeEnumProperty(EN_END, "END")); + m.addEnum("left", makeEnumProperty(EN_START, "START")); + m.addEnum("right", makeEnumProperty(EN_END, "END")); + m.addEnum("both", makeEnumProperty(EN_BOTH, "BOTH")); + m.addEnum("none", makeEnumProperty(EN_NONE, "NONE")); m.setDefault("none"); addPropertyMaker("clear", m); @@ -1788,23 +1788,23 @@ public class FOPropertyMapping implements Constants { m = new EnumProperty.Maker(PR_FLOAT); m.setInherited(false); // Note that left -> start and right -> end. - m.addEnum("before", makeEnumProperty(BEFORE, "BEFORE")); - m.addEnum("start", makeEnumProperty(START, "START")); - m.addEnum("end", makeEnumProperty(END, "END")); - m.addEnum("left", makeEnumProperty(START, "START")); - m.addEnum("right", makeEnumProperty(END, "END")); - m.addEnum("none", makeEnumProperty(NONE, "NONE")); + m.addEnum("before", makeEnumProperty(EN_BEFORE, "BEFORE")); + m.addEnum("start", makeEnumProperty(EN_START, "START")); + m.addEnum("end", makeEnumProperty(EN_END, "END")); + m.addEnum("left", makeEnumProperty(EN_START, "START")); + m.addEnum("right", makeEnumProperty(EN_END, "END")); + m.addEnum("none", makeEnumProperty(EN_NONE, "NONE")); m.setDefault("none"); addPropertyMaker("float", m); // intrusion-displace m = new EnumProperty.Maker(PR_INTRUSION_DISPLACE); m.setInherited(false); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - m.addEnum("none", makeEnumProperty(NONE, "NONE")); - m.addEnum("line", makeEnumProperty(LINE, "LINE")); - m.addEnum("indent", makeEnumProperty(INDENT, "INDENT")); - m.addEnum("block", makeEnumProperty(BLOCK, "BLOCK")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + m.addEnum("none", makeEnumProperty(EN_NONE, "NONE")); + m.addEnum("line", makeEnumProperty(EN_LINE, "LINE")); + m.addEnum("indent", makeEnumProperty(EN_INDENT, "INDENT")); + m.addEnum("block", makeEnumProperty(EN_BLOCK, "BLOCK")); m.setDefault("none"); addPropertyMaker("intrusion-displace", m); } @@ -1868,11 +1868,11 @@ public class FOPropertyMapping implements Constants { // overflow m = new EnumProperty.Maker(PR_OVERFLOW); m.setInherited(false); - m.addEnum("visible", makeEnumProperty(VISIBLE, "VISIBLE")); - m.addEnum("hidden", makeEnumProperty(HIDDEN, "HIDDEN")); - m.addEnum("scroll", makeEnumProperty(SCROLL, "SCROLL")); - m.addEnum("error-if-overflow", makeEnumProperty(ERROR_IF_OVERFLOW, "ERROR_IF_OVERFLOW")); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + m.addEnum("visible", makeEnumProperty(EN_VISIBLE, "VISIBLE")); + m.addEnum("hidden", makeEnumProperty(EN_HIDDEN, "HIDDEN")); + m.addEnum("scroll", makeEnumProperty(EN_SCROLL, "SCROLL")); + m.addEnum("error-if-overflow", makeEnumProperty(EN_ERROR_IF_OVERFLOW, "ERROR_IF_OVERFLOW")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); m.setDefault("auto"); addPropertyMaker("overflow", m); @@ -1885,8 +1885,8 @@ public class FOPropertyMapping implements Constants { // span m = new EnumProperty.Maker(PR_SPAN); m.setInherited(false); - m.addEnum("none", makeEnumProperty(NONE, "NONE")); - m.addEnum("all", makeEnumProperty(ALL, "ALL")); + m.addEnum("none", makeEnumProperty(EN_NONE, "NONE")); + m.addEnum("all", makeEnumProperty(EN_ALL, "ALL")); m.setDefault("none"); addPropertyMaker("span", m); } @@ -1898,19 +1898,19 @@ public class FOPropertyMapping implements Constants { // leader-alignment m = new EnumProperty.Maker(PR_LEADER_ALIGNMENT); m.setInherited(true); - m.addEnum("none", makeEnumProperty(NONE, "NONE")); - m.addEnum("reference-area", makeEnumProperty(REFERENCE_AREA, "REFERENCE_AREA")); - m.addEnum("page", makeEnumProperty(PAGE, "PAGE")); + m.addEnum("none", makeEnumProperty(EN_NONE, "NONE")); + m.addEnum("reference-area", makeEnumProperty(EN_REFERENCE_AREA, "REFERENCE_AREA")); + m.addEnum("page", makeEnumProperty(EN_PAGE, "PAGE")); m.setDefault("none"); addPropertyMaker("leader-alignment", m); // leader-pattern m = new EnumProperty.Maker(PR_LEADER_PATTERN); m.setInherited(true); - m.addEnum("space", makeEnumProperty(SPACE, "SPACE")); - m.addEnum("rule", makeEnumProperty(RULE, "RULE")); - m.addEnum("dots", makeEnumProperty(DOTS, "DOTS")); - m.addEnum("use-content", makeEnumProperty(USECONTENT, "USECONTENT")); + m.addEnum("space", makeEnumProperty(EN_SPACE, "SPACE")); + m.addEnum("rule", makeEnumProperty(EN_RULE, "RULE")); + m.addEnum("dots", makeEnumProperty(EN_DOTS, "DOTS")); + m.addEnum("use-content", makeEnumProperty(EN_USECONTENT, "USECONTENT")); m.setDefault("space"); addPropertyMaker("leader-pattern", m); @@ -1949,13 +1949,13 @@ public class FOPropertyMapping implements Constants { // rule-style m = new EnumProperty.Maker(PR_RULE_STYLE); m.setInherited(true); - m.addEnum("none", makeEnumProperty(NONE, "NONE")); - m.addEnum("dotted", makeEnumProperty(DOTTED, "DOTTED")); - m.addEnum("dashed", makeEnumProperty(DASHED, "DASHED")); - m.addEnum("solid", makeEnumProperty(SOLID, "SOLID")); - m.addEnum("double", makeEnumProperty(DOUBLE, "DOUBLE")); - m.addEnum("groove", makeEnumProperty(GROOVE, "GROOVE")); - m.addEnum("ridge", makeEnumProperty(RIDGE, "RIDGE")); + m.addEnum("none", makeEnumProperty(EN_NONE, "NONE")); + m.addEnum("dotted", makeEnumProperty(EN_DOTTED, "DOTTED")); + m.addEnum("dashed", makeEnumProperty(EN_DASHED, "DASHED")); + m.addEnum("solid", makeEnumProperty(EN_SOLID, "SOLID")); + m.addEnum("double", makeEnumProperty(EN_DOUBLE, "DOUBLE")); + m.addEnum("groove", makeEnumProperty(EN_GROOVE, "GROOVE")); + m.addEnum("ridge", makeEnumProperty(EN_RIDGE, "RIDGE")); m.setDefault("solid"); addPropertyMaker("rule-style", m); @@ -2072,19 +2072,19 @@ public class FOPropertyMapping implements Constants { // retrieve-position m = new EnumProperty.Maker(PR_RETRIEVE_POSITION); m.setInherited(false); - m.addEnum("first-starting-within-page", makeEnumProperty(FSWP, "FSWP")); - m.addEnum("first-including-carryover", makeEnumProperty(FIC, "FIC")); - m.addEnum("last-starting-within-page", makeEnumProperty(LSWP, "LSWP")); - m.addEnum("last-ending-within-page", makeEnumProperty(LEWP, "LEWP")); + m.addEnum("first-starting-within-page", makeEnumProperty(EN_FSWP, "FSWP")); + m.addEnum("first-including-carryover", makeEnumProperty(EN_FIC, "FIC")); + m.addEnum("last-starting-within-page", makeEnumProperty(EN_LSWP, "LSWP")); + m.addEnum("last-ending-within-page", makeEnumProperty(EN_LEWP, "LEWP")); m.setDefault("first-starting-within-page"); addPropertyMaker("retrieve-position", m); // retrieve-boundary m = new EnumProperty.Maker(PR_RETRIEVE_BOUNDARY); m.setInherited(false); - m.addEnum("page", makeEnumProperty(PAGE, "PAGE")); - m.addEnum("page-sequence", makeEnumProperty(PAGE_SEQUENCE, "PAGE_SEQUENCE")); - m.addEnum("document", makeEnumProperty(DOCUMENT, "DOCUMENT")); + m.addEnum("page", makeEnumProperty(EN_PAGE, "PAGE")); + m.addEnum("page-sequence", makeEnumProperty(EN_PAGE_SEQUENCE, "PAGE_SEQUENCE")); + m.addEnum("document", makeEnumProperty(EN_DOCUMENT, "DOCUMENT")); m.setDefault("page-sequence"); addPropertyMaker("retrieve-boundary", m); } @@ -2113,9 +2113,9 @@ public class FOPropertyMapping implements Constants { // letter-value m = new EnumProperty.Maker(PR_LETTER_VALUE); m.setInherited(false); - m.addEnum("alphabetic", makeEnumProperty(ALPHABETIC, "ALPHABETIC")); - m.addEnum("traditional", makeEnumProperty(TRADITIONAL, "TRADITIONAL")); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + m.addEnum("alphabetic", makeEnumProperty(EN_ALPHABETIC, "ALPHABETIC")); + m.addEnum("traditional", makeEnumProperty(EN_TRADITIONAL, "TRADITIONAL")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); m.setDefault("auto"); addPropertyMaker("letter-value", m); } @@ -2127,9 +2127,9 @@ public class FOPropertyMapping implements Constants { // blank-or-not-blank m = new EnumProperty.Maker(PR_BLANK_OR_NOT_BLANK); m.setInherited(false); - m.addEnum("blank", makeEnumProperty(BLANK, "BLANK")); - m.addEnum("not-blank", makeEnumProperty(NOT_BLANK, "NOT_BLANK")); - m.addEnum("any", makeEnumProperty(ANY, "ANY")); + m.addEnum("blank", makeEnumProperty(EN_BLANK, "BLANK")); + m.addEnum("not-blank", makeEnumProperty(EN_NOT_BLANK, "NOT_BLANK")); + m.addEnum("any", makeEnumProperty(EN_ANY, "ANY")); m.setDefault("any"); addPropertyMaker("blank-or-not-blank", m); @@ -2142,7 +2142,7 @@ public class FOPropertyMapping implements Constants { // column-gap l = new LengthProperty.Maker(PR_COLUMN_GAP); l.setInherited(false); - l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + l.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); l.setDefault("0.25in"); addPropertyMaker("column-gap", l); @@ -2161,21 +2161,21 @@ public class FOPropertyMapping implements Constants { // force-page-count m = new EnumProperty.Maker(PR_FORCE_PAGE_COUNT); m.setInherited(false); - m.addEnum("even", makeEnumProperty(EVEN, "EVEN")); - m.addEnum("odd", makeEnumProperty(ODD, "ODD")); - m.addEnum("end-on-even", makeEnumProperty(END_ON_EVEN, "END_ON_EVEN")); - m.addEnum("end-on-odd", makeEnumProperty(END_ON_ODD, "END_ON_ODD")); - m.addEnum("no-force", makeEnumProperty(NO_FORCE, "NO_FORCE")); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + m.addEnum("even", makeEnumProperty(EN_EVEN, "EVEN")); + m.addEnum("odd", makeEnumProperty(EN_ODD, "ODD")); + m.addEnum("end-on-even", makeEnumProperty(EN_END_ON_EVEN, "END_ON_EVEN")); + m.addEnum("end-on-odd", makeEnumProperty(EN_END_ON_ODD, "END_ON_ODD")); + m.addEnum("no-force", makeEnumProperty(EN_NO_FORCE, "NO_FORCE")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); m.setDefault("auto"); addPropertyMaker("force-page-count", m); // initial-page-number m = new NumberProperty.Maker(PR_INITIAL_PAGE_NUMBER); m.setInherited(false); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - m.addEnum("auto-odd", makeEnumProperty(AUTO_ODD, "AUTO_ODD")); - m.addEnum("auto-even", makeEnumProperty(AUTO_EVEN, "AUTO_EVEN")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + m.addEnum("auto-odd", makeEnumProperty(EN_AUTO_ODD, "AUTO_ODD")); + m.addEnum("auto-even", makeEnumProperty(EN_AUTO_EVEN, "AUTO_EVEN")); m.setDefault("auto"); addPropertyMaker("initial-page-number", m); @@ -2194,34 +2194,34 @@ public class FOPropertyMapping implements Constants { // maximum-repeats m = new NumberProperty.Maker(PR_MAXIMUM_REPEATS); m.setInherited(false); - m.addEnum("no-limit", makeEnumProperty(NO_LIMIT, "NO_LIMIT")); + m.addEnum("no-limit", makeEnumProperty(EN_NO_LIMIT, "NO_LIMIT")); m.setDefault("no-limit"); addPropertyMaker("maximum-repeats", m); // media-usage m = new EnumProperty.Maker(PR_MEDIA_USAGE); m.setInherited(false); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - m.addEnum("paginate", makeEnumProperty(PAGINATE, "PAGINATE")); - m.addEnum("bounded-in-one-dimension", makeEnumProperty(BOUNDED_IN_ONE_DIMENSION, "BOUNDED_IN_ONE_DIMENSION")); - m.addEnum("unbounded", makeEnumProperty(UNBOUNDED, "UNBOUNDED")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + m.addEnum("paginate", makeEnumProperty(EN_PAGINATE, "PAGINATE")); + m.addEnum("bounded-in-one-dimension", makeEnumProperty(EN_BOUNDED_IN_ONE_DIMENSION, "BOUNDED_IN_ONE_DIMENSION")); + m.addEnum("unbounded", makeEnumProperty(EN_UNBOUNDED, "UNBOUNDED")); m.setDefault("auto"); addPropertyMaker("media-usage", m); // odd-or-even m = new EnumProperty.Maker(PR_ODD_OR_EVEN); m.setInherited(false); - m.addEnum("odd", makeEnumProperty(ODD, "ODD")); - m.addEnum("even", makeEnumProperty(EVEN, "EVEN")); - m.addEnum("any", makeEnumProperty(ANY, "ANY")); + m.addEnum("odd", makeEnumProperty(EN_ODD, "ODD")); + m.addEnum("even", makeEnumProperty(EN_EVEN, "EVEN")); + m.addEnum("any", makeEnumProperty(EN_ANY, "ANY")); m.setDefault("any"); addPropertyMaker("odd-or-even", m); // page-height l = new LengthProperty.Maker(PR_PAGE_HEIGHT); l.setInherited(false); - l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - l.addEnum("indefinite", makeEnumProperty(INDEFINITE, "INDEFINITE")); + l.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + l.addEnum("indefinite", makeEnumProperty(EN_INDEFINITE, "INDEFINITE")); // TODO: default should be 'auto' l.setDefault("11in"); addPropertyMaker("page-height", l); @@ -2229,18 +2229,18 @@ public class FOPropertyMapping implements Constants { // page-position m = new EnumProperty.Maker(PR_PAGE_POSITION); m.setInherited(false); - m.addEnum("first", makeEnumProperty(FIRST, "FIRST")); - m.addEnum("last", makeEnumProperty(LAST, "LAST")); - m.addEnum("rest", makeEnumProperty(REST, "REST")); - m.addEnum("any", makeEnumProperty(ANY, "ANY")); + m.addEnum("first", makeEnumProperty(EN_FIRST, "FIRST")); + m.addEnum("last", makeEnumProperty(EN_LAST, "LAST")); + m.addEnum("rest", makeEnumProperty(EN_REST, "REST")); + m.addEnum("any", makeEnumProperty(EN_ANY, "ANY")); m.setDefault("any"); addPropertyMaker("page-position", m); // page-width l = new LengthProperty.Maker(PR_PAGE_WIDTH); l.setInherited(false); - l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - l.addEnum("indefinite", makeEnumProperty(INDEFINITE, "INDEFINITE")); + l.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + l.addEnum("indefinite", makeEnumProperty(EN_INDEFINITE, "INDEFINITE")); // TODO: default should be 'auto' l.setDefault("8in"); addPropertyMaker("page-width", l); @@ -2248,8 +2248,8 @@ public class FOPropertyMapping implements Constants { // precedence m = new EnumProperty.Maker(PR_PRECEDENCE); m.setInherited(false); - m.addEnum("true", makeEnumProperty(TRUE, "TRUE")); - m.addEnum("false", makeEnumProperty(FALSE, "FALSE")); + m.addEnum("true", makeEnumProperty(EN_TRUE, "TRUE")); + m.addEnum("false", makeEnumProperty(EN_FALSE, "FALSE")); m.setDefault("false"); addPropertyMaker("precedence", m); @@ -2280,9 +2280,9 @@ public class FOPropertyMapping implements Constants { m = new EnumProperty.Maker(PR_BORDER_COLLAPSE); m.setInherited(true); m.setDefault("collapse"); - m.addEnum("separate", makeEnumProperty(SEPARATE, "SEPARATE")); - m.addEnum("collapse-with-precedence", makeEnumProperty(COLLAPSE_WITH_PRECEDENCE, "COLLAPSE_WITH_PRECEDENCE")); - m.addEnum("collapse", makeEnumProperty(COLLAPSE, "COLLAPSE")); + m.addEnum("separate", makeEnumProperty(EN_SEPARATE, "SEPARATE")); + m.addEnum("collapse-with-precedence", makeEnumProperty(EN_COLLAPSE_WITH_PRECEDENCE, "COLLAPSE_WITH_PRECEDENCE")); + m.addEnum("collapse", makeEnumProperty(EN_COLLAPSE, "COLLAPSE")); addPropertyMaker("border-collapse", m); // border-end-precedence @@ -2313,14 +2313,14 @@ public class FOPropertyMapping implements Constants { // caption-side m = new EnumProperty.Maker(PR_CAPTION_SIDE); m.setInherited(true); - m.addEnum("before", makeEnumProperty(BEFORE, "BEFORE")); - m.addEnum("after", makeEnumProperty(AFTER, "AFTER")); - m.addEnum("start", makeEnumProperty(START, "START")); - m.addEnum("end", makeEnumProperty(END, "END")); - m.addEnum("top", makeEnumProperty(TOP, "TOP")); - m.addEnum("bottom", makeEnumProperty(BOTTOM, "BOTTOM")); - m.addEnum("left", makeEnumProperty(LEFT, "LEFT")); - m.addEnum("right", makeEnumProperty(RIGHT, "RIGHT")); + m.addEnum("before", makeEnumProperty(EN_BEFORE, "BEFORE")); + m.addEnum("after", makeEnumProperty(EN_AFTER, "AFTER")); + m.addEnum("start", makeEnumProperty(EN_START, "START")); + m.addEnum("end", makeEnumProperty(EN_END, "END")); + m.addEnum("top", makeEnumProperty(EN_TOP, "TOP")); + m.addEnum("bottom", makeEnumProperty(EN_BOTTOM, "BOTTOM")); + m.addEnum("left", makeEnumProperty(EN_LEFT, "LEFT")); + m.addEnum("right", makeEnumProperty(EN_RIGHT, "RIGHT")); m.setDefault("before"); addPropertyMaker("caption-side", m); @@ -2340,8 +2340,8 @@ public class FOPropertyMapping implements Constants { // empty-cells m = new EnumProperty.Maker(PR_EMPTY_CELLS); m.setInherited(true); - m.addEnum("show", makeEnumProperty(SHOW, "SHOW")); - m.addEnum("hide", makeEnumProperty(HIDE, "HIDE")); + m.addEnum("show", makeEnumProperty(EN_SHOW, "SHOW")); + m.addEnum("hide", makeEnumProperty(EN_HIDE, "HIDE")); m.setDefault("show"); addPropertyMaker("empty-cells", m); @@ -2381,8 +2381,8 @@ public class FOPropertyMapping implements Constants { m = new EnumProperty.Maker(PR_TABLE_LAYOUT); m.setInherited(false); m.setDefault("auto"); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); - m.addEnum("fixed", makeEnumProperty(FIXED, "FIXED")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); + m.addEnum("fixed", makeEnumProperty(EN_FIXED, "FIXED")); addPropertyMaker("table-layout", m); // table-omit-footer-at-break @@ -2406,8 +2406,8 @@ public class FOPropertyMapping implements Constants { // direction m = new EnumProperty.Maker(PR_DIRECTION); m.setInherited(true); - m.addEnum("ltr", makeEnumProperty(LTR, "LTR")); - m.addEnum("rtl", makeEnumProperty(RTL, "RTL")); + m.addEnum("ltr", makeEnumProperty(EN_LTR, "LTR")); + m.addEnum("rtl", makeEnumProperty(EN_RTL, "RTL")); m.setDefault("ltr"); addPropertyMaker("direction", m); @@ -2426,23 +2426,23 @@ public class FOPropertyMapping implements Constants { // text-altitude m = new LengthProperty.Maker(PR_TEXT_ALTITUDE); m.setInherited(false); - m.addEnum("use-font-metrics", makeEnumProperty(USE_FONT_METRICS, "USE_FONT_METRICS")); + m.addEnum("use-font-metrics", makeEnumProperty(EN_USE_FONT_METRICS, "USE_FONT_METRICS")); m.setDefault("use-font-metrics"); addPropertyMaker("text-altitude", m); // text-depth m = new LengthProperty.Maker(PR_TEXT_DEPTH); m.setInherited(false); - m.addEnum("use-font-metrics", makeEnumProperty(USE_FONT_METRICS, "USE_FONT_METRICS")); + m.addEnum("use-font-metrics", makeEnumProperty(EN_USE_FONT_METRICS, "USE_FONT_METRICS")); m.setDefault("use-font-metrics"); addPropertyMaker("text-depth", m); // unicode-bidi m = new EnumProperty.Maker(PR_UNICODE_BIDI); m.setInherited(false); - m.addEnum("normal", makeEnumProperty(NORMAL, "NORMAL")); - m.addEnum("embed", makeEnumProperty(EMBED, "EMBED")); - m.addEnum("bidi-override", makeEnumProperty(BIDI_OVERRIDE, "BIDI_OVERRIDE")); + m.addEnum("normal", makeEnumProperty(EN_NORMAL, "NORMAL")); + m.addEnum("embed", makeEnumProperty(EN_EMBED, "EMBED")); + m.addEnum("bidi-override", makeEnumProperty(EN_BIDI_OVERRIDE, "BIDI_OVERRIDE")); m.setDefault("normal"); addPropertyMaker("unicode-bidi", m); @@ -2450,9 +2450,9 @@ public class FOPropertyMapping implements Constants { m = new EnumProperty.Maker(PR_WRITING_MODE); m.setInherited(true); m.setDefault("lr-tb"); - m.addEnum("lr-tb", makeEnumProperty(LR_TB, "LR_TB")); - m.addEnum("rl-tb", makeEnumProperty(RL_TB, "RL_TB")); - m.addEnum("tb-rl", makeEnumProperty(TB_RL, "TB_RL")); + m.addEnum("lr-tb", makeEnumProperty(EN_LR_TB, "LR_TB")); + m.addEnum("rl-tb", makeEnumProperty(EN_RL_TB, "RL_TB")); + m.addEnum("tb-rl", makeEnumProperty(EN_TB_RL, "TB_RL")); m.addKeyword("lr", "lr-tb"); m.addKeyword("rl", "rl-tb"); m.addKeyword("tb", "tb-rl"); @@ -2508,16 +2508,16 @@ public class FOPropertyMapping implements Constants { // visibility m = new EnumProperty.Maker(PR_VISIBILITY); m.setInherited(false); - m.addEnum("visible", makeEnumProperty(VISIBLE, "VISIBLE")); - m.addEnum("hidden", makeEnumProperty(HIDDEN, "HIDDEN")); - m.addEnum("collapse", makeEnumProperty(COLLAPSE, "COLLAPSE")); + m.addEnum("visible", makeEnumProperty(EN_VISIBLE, "VISIBLE")); + m.addEnum("hidden", makeEnumProperty(EN_HIDDEN, "HIDDEN")); + m.addEnum("collapse", makeEnumProperty(EN_COLLAPSE, "COLLAPSE")); m.setDefault("visible"); addPropertyMaker("visibility", m); // z-index m = new NumberProperty.Maker(PR_Z_INDEX); m.setInherited(false); - m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); + m.addEnum("auto", makeEnumProperty(EN_AUTO, "AUTO")); m.setDefault("auto"); addPropertyMaker("z-index", m); } @@ -2644,10 +2644,10 @@ public class FOPropertyMapping implements Constants { // position m = new EnumProperty.Maker(PR_POSITION); m.setInherited(false); - m.addEnum("static", makeEnumProperty(STATIC, "STATIC")); - m.addEnum("relative", makeEnumProperty(RELATIVE, "RELATIVE")); - m.addEnum("absolute", makeEnumProperty(ABSOLUTE, "ABSOLUTE")); - m.addEnum("fixed", makeEnumProperty(FIXED, "FIXED")); + m.addEnum("static", makeEnumProperty(EN_STATIC, "STATIC")); + m.addEnum("relative", makeEnumProperty(EN_RELATIVE, "RELATIVE")); + m.addEnum("absolute", makeEnumProperty(EN_ABSOLUTE, "ABSOLUTE")); + m.addEnum("fixed", makeEnumProperty(EN_FIXED, "FIXED")); m.setDefault("static"); m.setDatatypeParser(new PositionShorthandParser()); addPropertyMaker("position", m); @@ -2661,14 +2661,14 @@ public class FOPropertyMapping implements Constants { // vertical-align TODO: Should be a LengthProperty. m = new EnumProperty.Maker(PR_VERTICAL_ALIGN); m.setInherited(false); - m.addEnum("baseline", makeEnumProperty(BASELINE, "BASELINE")); - m.addEnum("middle", makeEnumProperty(MIDDLE, "MIDDLE")); - m.addEnum("sub", makeEnumProperty(SUB, "SUB")); - m.addEnum("super", makeEnumProperty(SUPER, "SUPER")); - m.addEnum("text-top", makeEnumProperty(TEXT_TOP, "TEXT_TOP")); - m.addEnum("text-bottom", makeEnumProperty(TEXT_BOTTOM, "TEXT_BOTTOM")); - m.addEnum("top", makeEnumProperty(TOP, "TOP")); - m.addEnum("bottom", makeEnumProperty(BOTTOM, "BOTTOM")); + m.addEnum("baseline", makeEnumProperty(EN_BASELINE, "BASELINE")); + m.addEnum("middle", makeEnumProperty(EN_MIDDLE, "MIDDLE")); + m.addEnum("sub", makeEnumProperty(EN_SUB, "SUB")); + m.addEnum("super", makeEnumProperty(EN_SUPER, "SUPER")); + m.addEnum("text-top", makeEnumProperty(EN_TEXT_TOP, "TEXT_TOP")); + m.addEnum("text-bottom", makeEnumProperty(EN_TEXT_BOTTOM, "TEXT_BOTTOM")); + m.addEnum("top", makeEnumProperty(EN_TOP, "TOP")); + m.addEnum("bottom", makeEnumProperty(EN_BOTTOM, "BOTTOM")); m.setDefault("baseline"); addPropertyMaker("vertical-align", m); diff --git a/src/java/org/apache/fop/fo/FOText.java b/src/java/org/apache/fop/fo/FOText.java index d5b36efc0..9a2faaa10 100644 --- a/src/java/org/apache/fop/fo/FOText.java +++ b/src/java/org/apache/fop/fo/FOText.java @@ -161,7 +161,7 @@ public class FOText extends FONode { * @return true if this will create an area in the output */ public boolean willCreateArea() { - if (whiteSpaceCollapse == Constants.WhiteSpaceCollapse.FALSE + if (whiteSpaceCollapse == Constants.EN_FALSE && endIndex - startIndex > 0) { return true; } @@ -224,7 +224,7 @@ public class FOText extends FONode { * text-transform property. */ private void textTransform() { - if (textTransform == Constants.TextTransform.NONE) { + if (textTransform == Constants.EN_NONE) { return; } for (int i = 0; i < endIndex; i++) { @@ -353,13 +353,13 @@ public class FOText extends FONode { private char charTransform(int i) { switch (textTransform) { /* put NONE first, as this is probably the common case */ - case Constants.TextTransform.NONE: + case Constants.EN_NONE: return ca[i]; - case Constants.TextTransform.UPPERCASE: + case Constants.EN_UPPERCASE: return Character.toUpperCase(ca[i]); - case Constants.TextTransform.LOWERCASE: + case Constants.EN_LOWERCASE: return Character.toLowerCase(ca[i]); - case Constants.TextTransform.CAPITALIZE: + case Constants.EN_CAPITALIZE: if (isStartOfWord(i)) { /* Use toTitleCase here. Apparently, some languages use diff --git a/src/java/org/apache/fop/fo/PropertyList.java b/src/java/org/apache/fop/fo/PropertyList.java index 4703b1f0f..15425df66 100644 --- a/src/java/org/apache/fop/fo/PropertyList.java +++ b/src/java/org/apache/fop/fo/PropertyList.java @@ -231,9 +231,9 @@ abstract public class PropertyList { */ public int getWritingMode(int lrtb, int rltb, int tbrl) { switch (writingMode) { - case Constants.WritingMode.LR_TB: return lrtb; - case Constants.WritingMode.RL_TB: return rltb; - case Constants.WritingMode.TB_RL: return tbrl; + case Constants.EN_LR_TB: return lrtb; + case Constants.EN_RL_TB: return rltb; + case Constants.EN_TB_RL: return tbrl; } return -1; } diff --git a/src/java/org/apache/fop/fo/flow/Block.java b/src/java/org/apache/fop/fo/flow/Block.java index 6d2d8c33e..e21fe926a 100644 --- a/src/java/org/apache/fop/fo/flow/Block.java +++ b/src/java/org/apache/fop/fo/flow/Block.java @@ -346,28 +346,28 @@ public class Block extends FObjMixed { boolean bIgnore = false; switch (whiteSpaceTreatment) { - case Constants.IGNORE: + case Constants.EN_IGNORE: bIgnore = true; break; - case Constants.IGNORE_IF_BEFORE_LINEFEED: + case Constants.EN_IGNORE_IF_BEFORE_LINEFEED: bIgnore = lfCheck.nextIsLF(); break; - case Constants.IGNORE_IF_SURROUNDING_LINEFEED: + case Constants.EN_IGNORE_IF_SURROUNDING_LINEFEED: bIgnore = (bPrevWasLF || lfCheck.nextIsLF()); break; - case Constants.IGNORE_IF_AFTER_LINEFEED: + case Constants.EN_IGNORE_IF_AFTER_LINEFEED: bIgnore = bPrevWasLF; break; - case Constants.PRESERVE: + case Constants.EN_PRESERVE: // nothing to do now, replacement takes place later break; } // Handle ignore and replacement if (bIgnore) { charIter.remove(); - } else if (whiteSpaceCollapse == TRUE) { - if (bInWS || (linefeedTreatment == Constants.PRESERVE + } else if (whiteSpaceCollapse == EN_TRUE) { + if (bInWS || (linefeedTreatment == Constants.EN_PRESERVE && (bPrevWasLF || lfCheck.nextIsLF()))) { charIter.remove(); } else { @@ -397,15 +397,15 @@ public class Block extends FObjMixed { bPrevWasLF = true; // for following whitespace switch (linefeedTreatment) { - case Constants.IGNORE: + case Constants.EN_IGNORE: charIter.remove(); break; - case Constants.TREAT_AS_SPACE: + case Constants.EN_TREAT_AS_SPACE: if (bInWS) { // only if bWScollapse=true charIter.remove(); } else { - if (whiteSpaceCollapse == TRUE) { + if (whiteSpaceCollapse == EN_TRUE) { bInWS = true; // remove the linefeed if no word in block // encountered yet @@ -416,10 +416,10 @@ public class Block extends FObjMixed { charIter.replaceChar('\u0020'); } break; - case Constants.TREAT_AS_ZERO_WIDTH_SPACE: + case Constants.EN_TREAT_AS_ZERO_WIDTH_SPACE: charIter.replaceChar('\u200b'); // Fall through: this isn't XML whitespace - case Constants.PRESERVE: + case Constants.EN_PRESERVE: bInWS = false; break; } diff --git a/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java b/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java index bed5d3a30..024ccc0c9 100644 --- a/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java +++ b/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java @@ -150,15 +150,15 @@ public class InstreamForeignObject extends FObj { public int computeXOffset (int ipd, int cwidth) { int xoffset = 0; switch (textAlign) { - case TextAlign.CENTER: + case EN_CENTER: xoffset = (ipd - cwidth) / 2; break; - case TextAlign.END: + case EN_END: xoffset = ipd - cwidth; break; - case TextAlign.START: + case EN_START: break; - case TextAlign.JUSTIFY: + case EN_JUSTIFY: default: break; } @@ -168,15 +168,15 @@ public class InstreamForeignObject extends FObj { public int computeYOffset(int bpd, int cheight) { int yoffset = 0; switch (displayAlign) { - case DisplayAlign.BEFORE: + case EN_BEFORE: break; - case DisplayAlign.AFTER: + case EN_AFTER: yoffset = bpd - cheight; break; - case DisplayAlign.CENTER: + case EN_CENTER: yoffset = (bpd - cheight) / 2; break; - case DisplayAlign.AUTO: + case EN_AUTO: default: break; } diff --git a/src/java/org/apache/fop/fo/flow/Leader.java b/src/java/org/apache/fop/fo/flow/Leader.java index 51d8caafa..377a452b2 100644 --- a/src/java/org/apache/fop/fo/flow/Leader.java +++ b/src/java/org/apache/fop/fo/flow/Leader.java @@ -109,18 +109,18 @@ public class Leader extends FObjMixed { leaderPattern = pList.get(PR_LEADER_PATTERN).getEnum(); leaderPatternWidth = pList.get(PR_LEADER_PATTERN_WIDTH).getLength(); switch(leaderPattern) { - case LeaderPattern.SPACE: + case EN_SPACE: // use Space break; - case LeaderPattern.RULE: + case EN_RULE: // the following properties only apply // for leader-pattern = "rule" ruleStyle = pList.get(PR_RULE_STYLE).getEnum(); ruleThickness = pList.get(PR_RULE_THICKNESS).getLength(); break; - case LeaderPattern.DOTS: + case EN_DOTS: break; - case LeaderPattern.USECONTENT: + case EN_USECONTENT: // use inline layout manager to create inline areas // add the inline parent multiple times until leader full break; diff --git a/src/java/org/apache/fop/fo/flow/TableCell.java b/src/java/org/apache/fop/fo/flow/TableCell.java index caef9bf9d..755d943d7 100644 --- a/src/java/org/apache/fop/fo/flow/TableCell.java +++ b/src/java/org/apache/fop/fo/flow/TableCell.java @@ -192,7 +192,7 @@ public class TableCell extends FObj { * rectangle from the theoretical grid position. */ private void calcBorders(CommonBorderPaddingBackground bp) { - if (this.borderCollapse == BorderCollapse.SEPARATE) { + if (this.borderCollapse == EN_SEPARATE) { /* * Easy case. * Cell border is the property specified directly on cell. diff --git a/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java b/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java index a269fb6ed..f05ac271d 100644 --- a/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java +++ b/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java @@ -92,17 +92,17 @@ public class ConditionalPageMasterReference extends FObj { boolean isBlankPage) { // page-position if (isFirstPage) { - if (pagePosition == PagePosition.REST) { + if (pagePosition == EN_REST) { return false; - } else if (pagePosition == PagePosition.LAST) { + } else if (pagePosition == EN_LAST) { // ?? how can one know at this point? getLogger().debug("LAST PagePosition NYI"); return false; } } else { - if (pagePosition == PagePosition.FIRST) { + if (pagePosition == EN_FIRST) { return false; - } else if (pagePosition == PagePosition.LAST) { + } else if (pagePosition == EN_LAST) { // ?? how can one know at this point? getLogger().debug("LAST PagePosition NYI"); // potentially valid, don't return @@ -111,22 +111,22 @@ public class ConditionalPageMasterReference extends FObj { // odd-or-even if (isOddPage) { - if (oddOrEven == OddOrEven.EVEN) { + if (oddOrEven == EN_EVEN) { return false; } } else { - if (oddOrEven == OddOrEven.ODD) { + if (oddOrEven == EN_ODD) { return false; } } // blank-or-not-blank if (isBlankPage) { - if (blankOrNotBlank == BlankOrNotBlank.NOT_BLANK) { + if (blankOrNotBlank == EN_NOT_BLANK) { return false; } } else { - if (blankOrNotBlank == BlankOrNotBlank.BLANK) { + if (blankOrNotBlank == EN_BLANK) { return false; } } diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java index 65ac9b768..1c6f4836e 100644 --- a/src/java/org/apache/fop/fo/pagination/PageSequence.java +++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java @@ -297,7 +297,7 @@ public class PageSequence extends FObj { public void initPageNumber() { this.currentPageNumber = this.root.getRunningPageNumberCounter() + 1; - if (this.pageNumberType == AUTO_ODD) { + if (this.pageNumberType == EN_AUTO_ODD) { // Next page but force odd. May force empty page creation! // Whose master is used for this??? Assume no. // Use force-page-count = auto @@ -305,7 +305,7 @@ public class PageSequence extends FObj { if (currentPageNumber % 2 == 0) { this.currentPageNumber++; } - } else if (pageNumberType == AUTO_EVEN) { + } else if (pageNumberType == EN_AUTO_EVEN) { if (currentPageNumber % 2 == 1) { this.currentPageNumber++; } diff --git a/src/java/org/apache/fop/fo/pagination/RegionAfter.java b/src/java/org/apache/fop/fo/pagination/RegionAfter.java index 6fb6ca623..dc8fafd36 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionAfter.java +++ b/src/java/org/apache/fop/fo/pagination/RegionAfter.java @@ -43,12 +43,12 @@ public class RegionAfter extends RegionBA { public Rectangle getViewportRectangle (FODimension reldims) { // Depends on extent, precedence ans writing mode Rectangle vpRect; - if (getWritingMode() == WritingMode.LR_TB || getWritingMode() == WritingMode.RL_TB) { + if (getWritingMode() == EN_LR_TB || getWritingMode() == EN_RL_TB) { vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(), reldims.ipd, getExtent().getValue()); } else { vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(), getExtent().getValue(), reldims.ipd); } - if (getPrecedence() == FALSE) { + if (getPrecedence() == EN_FALSE) { adjustIPD(vpRect, getWritingMode()); } return vpRect; diff --git a/src/java/org/apache/fop/fo/pagination/RegionBA.java b/src/java/org/apache/fop/fo/pagination/RegionBA.java index 227104e34..b06e53138 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionBA.java +++ b/src/java/org/apache/fop/fo/pagination/RegionBA.java @@ -86,7 +86,7 @@ public abstract class RegionBA extends Region { offset += end.getExtent().getValue(); } if (offset > 0) { - if (wm == WritingMode.LR_TB || wm == WritingMode.RL_TB) { + if (wm == EN_LR_TB || wm == EN_RL_TB) { vpRefRect.width -= offset; } else { vpRefRect.height -= offset; diff --git a/src/java/org/apache/fop/fo/pagination/RegionBefore.java b/src/java/org/apache/fop/fo/pagination/RegionBefore.java index 72de90461..19607f9b1 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionBefore.java +++ b/src/java/org/apache/fop/fo/pagination/RegionBefore.java @@ -54,12 +54,12 @@ public class RegionBefore extends RegionBA { // Before is always 0, start depends on extent // ipd depends on precedence, bpd=extent Rectangle vpRect; - if (getWritingMode() == WritingMode.LR_TB || getWritingMode() == WritingMode.RL_TB) { + if (getWritingMode() == EN_LR_TB || getWritingMode() == EN_RL_TB) { vpRect = new Rectangle(0, 0, reldims.ipd, getExtent().getValue()); } else { vpRect = new Rectangle(0, 0, getExtent().getValue(), reldims.ipd); } - if (getPrecedence() == FALSE) { + if (getPrecedence() == EN_FALSE) { adjustIPD(vpRect, getWritingMode()); } return vpRect; diff --git a/src/java/org/apache/fop/fo/pagination/RegionEnd.java b/src/java/org/apache/fop/fo/pagination/RegionEnd.java index 4e1e10b3d..e4aff17e6 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionEnd.java +++ b/src/java/org/apache/fop/fo/pagination/RegionEnd.java @@ -42,7 +42,7 @@ public class RegionEnd extends RegionSE { public Rectangle getViewportRectangle (FODimension reldims) { // Depends on extent, precedence and writing mode Rectangle vpRect; - if (getWritingMode() == WritingMode.LR_TB || getWritingMode() == WritingMode.RL_TB) { + if (getWritingMode() == EN_LR_TB || getWritingMode() == EN_RL_TB) { // Rectangle: x , y (of top left point), width, height vpRect = new Rectangle(reldims.ipd - getExtent().getValue(), 0, getExtent().getValue(), reldims.bpd); diff --git a/src/java/org/apache/fop/fo/pagination/RegionSE.java b/src/java/org/apache/fop/fo/pagination/RegionSE.java index d75db5f68..a47326778 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionSE.java +++ b/src/java/org/apache/fop/fo/pagination/RegionSE.java @@ -69,16 +69,16 @@ public abstract class RegionSE extends Region { protected void adjustIPD(Rectangle vpRefRect, int wm) { int offset = 0; RegionBefore before = (RegionBefore) getSiblingRegion(FO_REGION_BEFORE); - if (before != null && before.getPrecedence() == TRUE) { + if (before != null && before.getPrecedence() == EN_TRUE) { offset = before.getExtent().getValue(); vpRefRect.translate(0, offset); } RegionAfter after = (RegionAfter) getSiblingRegion(FO_REGION_AFTER); - if (after != null && after.getPrecedence() == TRUE) { + if (after != null && after.getPrecedence() == EN_TRUE) { offset += after.getExtent().getValue(); } if (offset > 0) { - if (wm == WritingMode.LR_TB || wm == WritingMode.RL_TB) { + if (wm == EN_LR_TB || wm == EN_RL_TB) { vpRefRect.height -= offset; } else { vpRefRect.width -= offset; diff --git a/src/java/org/apache/fop/fo/pagination/RegionStart.java b/src/java/org/apache/fop/fo/pagination/RegionStart.java index 2b97cb7fe..9668dceeb 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionStart.java +++ b/src/java/org/apache/fop/fo/pagination/RegionStart.java @@ -44,7 +44,7 @@ public class RegionStart extends RegionSE { // This is the rectangle relative to the page-reference area in // writing-mode relative coordinates Rectangle vpRect; - if (getWritingMode() == WritingMode.LR_TB || getWritingMode() == WritingMode.RL_TB) { + if (getWritingMode() == EN_LR_TB || getWritingMode() == EN_RL_TB) { vpRect = new Rectangle(0, 0, getExtent().getValue(), reldims.bpd); } else { vpRect = new Rectangle(0, 0, reldims.bpd, getExtent().getValue()); diff --git a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java index 566397fce..546107929 100644 --- a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java +++ b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java @@ -103,7 +103,7 @@ public class RepeatablePageMasterAlternatives extends FObj * Return the "maximum-repeats" property. */ public int getMaximumRepeats() { - if (maximumRepeats.getEnum() == NO_LIMIT) { + if (maximumRepeats.getEnum() == EN_NO_LIMIT) { return INFINITE; } else { int mr = maximumRepeats.getNumeric().getValue(); diff --git a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java index 860ae58c0..200536321 100644 --- a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java +++ b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java @@ -103,7 +103,7 @@ public class RepeatablePageMasterReference extends FObj * Return the "maximum-repeats" property. */ public int getMaximumRepeats() { - if (maximumRepeats.getEnum() == NO_LIMIT) { + if (maximumRepeats.getEnum() == EN_NO_LIMIT) { return INFINITE; } else { int mr = maximumRepeats.getNumeric().getValue(); diff --git a/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java b/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java index 84e5122fb..2dad68853 100644 --- a/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java @@ -61,7 +61,7 @@ public class BorderWidthPropertyMaker extends LengthProperty.Maker { // Calculate the values as described in 7.7.20. Property style = propertyList.get(borderStyleId); - if (style.getEnum() == Constants.NONE) { + if (style.getEnum() == Constants.EN_NONE) { return new FixedLength(0); } return p; diff --git a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java index ba5637a3b..a3564c7aa 100755 --- a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java +++ b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java @@ -129,7 +129,7 @@ public class CommonBorderPaddingBackground implements Cloneable { padding[side] = pList.get(paddingProp).getCondLength(); // If style = none, force width to 0, don't get Color (spec 7.7.20) int style = pList.get(styleProp).getEnum(); - if (style != Constants.NONE) { + if (style != Constants.EN_NONE) { borderInfo[side] = new BorderInfo(style, pList.get(widthProp).getCondLength(), pList.get(colorProp).getColorType()); @@ -170,7 +170,7 @@ public class CommonBorderPaddingBackground implements Cloneable { public int getBorderWidth(int side, boolean bDiscard) { if ((borderInfo[side] == null) - || (borderInfo[side].mStyle == Constants.NONE) + || (borderInfo[side].mStyle == Constants.EN_NONE) || (bDiscard && borderInfo[side].mWidth.isDiscard())) { return 0; } else { @@ -190,7 +190,7 @@ public class CommonBorderPaddingBackground implements Cloneable { if (borderInfo[side] != null) { return borderInfo[side].mStyle; } else { - return Constants.NONE; + return Constants.EN_NONE; } } diff --git a/src/java/org/apache/fop/fo/properties/CondLengthProperty.java b/src/java/org/apache/fop/fo/properties/CondLengthProperty.java index 9238996bb..b14f12df3 100644 --- a/src/java/org/apache/fop/fo/properties/CondLengthProperty.java +++ b/src/java/org/apache/fop/fo/properties/CondLengthProperty.java @@ -111,7 +111,7 @@ public class CondLengthProperty extends Property implements CompoundDatatype { * @return true if the length can be discarded. */ public boolean isDiscard() { - return this.conditionality.getEnum() == Constants.DISCARD; + return this.conditionality.getEnum() == Constants.EN_DISCARD; } /** diff --git a/src/java/org/apache/fop/fo/properties/PositionShorthandParser.java b/src/java/org/apache/fop/fo/properties/PositionShorthandParser.java index bc7f46999..04d85cd8f 100755 --- a/src/java/org/apache/fop/fo/properties/PositionShorthandParser.java +++ b/src/java/org/apache/fop/fo/properties/PositionShorthandParser.java @@ -33,25 +33,25 @@ public class PositionShorthandParser implements ShorthandParser { int propVal = property.getEnum(); if (propId == Constants.PR_ABSOLUTE_POSITION) { switch (propVal) { - case Constants.STATIC: - case Constants.RELATIVE: - return new EnumProperty(Constants.AUTO, "AUTO"); - case Constants.ABSOLUTE: - return new EnumProperty(Constants.ABSOLUTE, "ABSOLUTE"); - case Constants.FIXED: - return new EnumProperty(Constants.FIXED, "FIXED"); + case Constants.EN_STATIC: + case Constants.EN_RELATIVE: + return new EnumProperty(Constants.EN_AUTO, "AUTO"); + case Constants.EN_ABSOLUTE: + return new EnumProperty(Constants.EN_ABSOLUTE, "ABSOLUTE"); + case Constants.EN_FIXED: + return new EnumProperty(Constants.EN_FIXED, "FIXED"); } } if (propId == Constants.PR_RELATIVE_POSITION) { switch (propVal) { - case Constants.STATIC: - return new EnumProperty(Constants.STATIC, "STATIC"); - case Constants.RELATIVE: - return new EnumProperty(Constants.RELATIVE, "RELATIVE"); - case Constants.ABSOLUTE: - return new EnumProperty(Constants.STATIC, "STATIC"); - case Constants.FIXED: - return new EnumProperty(Constants.STATIC, "STATIC"); + case Constants.EN_STATIC: + return new EnumProperty(Constants.EN_STATIC, "STATIC"); + case Constants.EN_RELATIVE: + return new EnumProperty(Constants.EN_RELATIVE, "RELATIVE"); + case Constants.EN_ABSOLUTE: + return new EnumProperty(Constants.EN_STATIC, "STATIC"); + case Constants.EN_FIXED: + return new EnumProperty(Constants.EN_STATIC, "STATIC"); } } return null; diff --git a/src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java b/src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java index 53ddae093..f4f709a05 100755 --- a/src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java @@ -44,7 +44,7 @@ public class SpacingPropertyMaker extends SpaceProperty.Maker { public Property convertProperty(Property p, PropertyList propertyList, FObj fo) throws PropertyException { - if (p.getEnum() == Constants.NORMAL) { + if (p.getEnum() == Constants.EN_NORMAL) { return p; } return super.convertProperty(p, propertyList, fo); diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java index 315004305..e1a0c99a4 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java @@ -66,7 +66,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager { */ protected void initProperties() { abProps = fobj.getCommonAbsolutePosition(); - if (abProps.absolutePosition == AbsolutePosition.ABSOLUTE) { + if (abProps.absolutePosition == EN_ABSOLUTE) { Rectangle2D rect = new Rectangle2D.Double(abProps.left.getValue(), abProps.top.getValue(), abProps.right.getValue() - abProps.left.getValue(), abProps.bottom.getValue() - abProps.top.getValue()); @@ -85,16 +85,16 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager { public BreakPoss getNextBreakPoss(LayoutContext context) { - if (abProps.absolutePosition == AbsolutePosition.ABSOLUTE) { + if (abProps.absolutePosition == EN_ABSOLUTE) { return getAbsoluteBreakPoss(context); } int ipd = context.getRefIPD(); int bpd = context.getStackLimit().opt; - if (width.getEnum() != AUTO) { + if (width.getEnum() != EN_AUTO) { ipd = width.getValue(); } - if (height.getEnum() != AUTO) { + if (height.getEnum() != EN_AUTO) { bpd = height.getValue(); } Rectangle2D rect = new Rectangle2D.Double(0, 0, ipd, bpd); @@ -111,7 +111,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager { relDims.ipd = context.getRefIPD(); } stackLimit = new MinOptMax(relDims.ipd); - if (width.getEnum() == AUTO) { + if (width.getEnum() == EN_AUTO) { relDims.bpd = context.getStackLimit().opt; } absoluteCTM = new CTM(vals[0], vals[1], vals[2], vals[3], 0, 0); @@ -225,9 +225,9 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager { breakPoss.setStackingSize(new MinOptMax(0)); if (stackSize.opt > relDims.bpd) { - if (fobj.getOverflow() == Overflow.HIDDEN) { + if (fobj.getOverflow() == EN_HIDDEN) { clip = true; - } else if (fobj.getOverflow() == Overflow.ERROR_IF_OVERFLOW) { + } else if (fobj.getOverflow() == EN_ERROR_IF_OVERFLOW) { log.error("contents overflows block-container viewport: clipping"); clip = true; } @@ -279,7 +279,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager { TraitSetter.addBorders(viewportBlockArea, fobj.getCommonBorderPaddingBackground()); TraitSetter.addBackground(viewportBlockArea, fobj.getCommonBorderPaddingBackground()); - if (abProps.absolutePosition == AbsolutePosition.ABSOLUTE) { + if (abProps.absolutePosition == EN_ABSOLUTE) { viewportBlockArea.setXOffset(abProps.left.getValue()); viewportBlockArea.setYOffset(abProps.top.getValue()); viewportBlockArea.setIPD(abProps.right.getValue() - abProps.left.getValue()); @@ -301,7 +301,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager { // need to set bpd to actual size for rotation // and stacking viewportBlockArea.setIPD(relDims.ipd); - if (height.getEnum() != AUTO) { + if (height.getEnum() != EN_AUTO) { viewportBlockArea.setBPD(relDims.bpd); autoHeight = false; } @@ -309,7 +309,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager { viewportBlockArea.setClip(clip); } else { viewportBlockArea.setIPD(relDims.ipd); - if (height.getEnum() != AUTO) { + if (height.getEnum() != EN_AUTO) { viewportBlockArea.setBPD(relDims.bpd); autoHeight = false; } @@ -318,7 +318,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager { curBlockArea = new Block(); - if (abProps.absolutePosition == AbsolutePosition.ABSOLUTE) { + if (abProps.absolutePosition == EN_ABSOLUTE) { viewportBlockArea.setPositioning(Block.ABSOLUTE); } diff --git a/src/java/org/apache/fop/layoutmgr/CharacterLayoutManager.java b/src/java/org/apache/fop/layoutmgr/CharacterLayoutManager.java index 431d244d5..fa72864bd 100644 --- a/src/java/org/apache/fop/layoutmgr/CharacterLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/CharacterLayoutManager.java @@ -73,16 +73,16 @@ public class CharacterLayoutManager extends LeafNodeLayoutManager { protected void offsetArea(LayoutContext context) { int bpd = curArea.getBPD(); switch (verticalAlignment) { - case VerticalAlign.MIDDLE: + case EN_MIDDLE: curArea.setOffset(context.getMiddleBaseline() + fs.getXHeight() / 2); break; - case VerticalAlign.TOP: + case EN_TOP: curArea.setOffset(fs.getAscender()); break; - case VerticalAlign.BOTTOM: + case EN_BOTTOM: curArea.setOffset(context.getLineHeight() - bpd + fs.getAscender()); break; - case VerticalAlign.BASELINE: + case EN_BASELINE: default: curArea.setOffset(context.getBaseline()); break; @@ -118,12 +118,12 @@ public class CharacterLayoutManager extends LeafNodeLayoutManager { int total = 0; int middle = 0; switch (verticalAlignment) { - case VerticalAlign.MIDDLE : middle = bpd / 2 ; + case EN_MIDDLE : middle = bpd / 2 ; break; - case VerticalAlign.TOP : // fall through - case VerticalAlign.BOTTOM : total = bpd; + case EN_TOP : // fall through + case EN_BOTTOM : total = bpd; break; - case VerticalAlign.BASELINE: // fall through + case EN_BASELINE: // fall through default : lead = fs.getAscender(); total = bpd; break; diff --git a/src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java b/src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java index 8b29cbcd9..033b131a8 100644 --- a/src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java @@ -74,20 +74,20 @@ public class ExternalGraphicLayoutManager extends LeafNodeLayoutManager { // assume lr-tb for now and just use the .optimum value of the range Length ipd = fobj.getInlineProgressionDimension().getOptimum().getLength(); - if (ipd.getEnum() != AUTO) { + if (ipd.getEnum() != EN_AUTO) { viewWidth = ipd.getValue(); } else { ipd = fobj.getWidth(); - if (ipd.getEnum() != AUTO) { + if (ipd.getEnum() != EN_AUTO) { viewWidth = ipd.getValue(); } } Length bpd = fobj.getBlockProgressionDimension().getOptimum().getLength(); - if (bpd.getEnum() != AUTO) { + if (bpd.getEnum() != EN_AUTO) { viewHeight = bpd.getValue(); } else { bpd = fobj.getHeight(); - if (bpd.getEnum() != AUTO) { + if (bpd.getEnum() != EN_AUTO) { viewHeight = bpd.getValue(); } } @@ -98,8 +98,8 @@ public class ExternalGraphicLayoutManager extends LeafNodeLayoutManager { int cwidth = -1; int cheight = -1; Length ch = fobj.getContentHeight(); - if (ch.getEnum() != AUTO) { - if (ch.getEnum() == SCALE_TO_FIT) { + if (ch.getEnum() != EN_AUTO) { + if (ch.getEnum() == EN_SCALE_TO_FIT) { if (viewHeight != -1) { cheight = viewHeight; } @@ -108,8 +108,8 @@ public class ExternalGraphicLayoutManager extends LeafNodeLayoutManager { } } Length cw = fobj.getContentWidth(); - if (cw.getEnum() != AUTO) { - if (cw.getEnum() == SCALE_TO_FIT) { + if (cw.getEnum() != EN_AUTO) { + if (cw.getEnum() == EN_SCALE_TO_FIT) { if (viewWidth != -1) { cwidth = viewWidth; } @@ -119,7 +119,7 @@ public class ExternalGraphicLayoutManager extends LeafNodeLayoutManager { } int scaling = fobj.getScaling(); - if ((scaling == Scaling.UNIFORM) || (cwidth == -1) || cheight == -1) { + if ((scaling == EN_UNIFORM) || (cwidth == -1) || cheight == -1) { ImageFactory fact = ImageFactory.getInstance(); fopimage = fact.getImage(url, fobj.getUserAgent()); if (fopimage == null) { @@ -162,9 +162,9 @@ public class ExternalGraphicLayoutManager extends LeafNodeLayoutManager { if (cwidth > viewWidth || cheight > viewHeight) { int overflow = fobj.getOverflow(); - if (overflow == Overflow.HIDDEN) { + if (overflow == EN_HIDDEN) { clip = true; - } else if (overflow == Overflow.ERROR_IF_OVERFLOW) { + } else if (overflow == EN_ERROR_IF_OVERFLOW) { fobj.getLogger().error("Image: " + url + " overflows the viewport, clipping to viewport"); clip = true; @@ -174,29 +174,29 @@ public class ExternalGraphicLayoutManager extends LeafNodeLayoutManager { int xoffset = 0; int yoffset = 0; switch(fobj.getDisplayAlign()) { - case DisplayAlign.BEFORE: + case EN_BEFORE: break; - case DisplayAlign.AFTER: + case EN_AFTER: yoffset = viewHeight - cheight; break; - case DisplayAlign.CENTER: + case EN_CENTER: yoffset = (viewHeight - cheight) / 2; break; - case DisplayAlign.AUTO: + case EN_AUTO: default: break; } switch(fobj.getTextAlign()) { - case TextAlign.CENTER: + case EN_CENTER: xoffset = (viewWidth - cwidth) / 2; break; - case TextAlign.END: + case EN_END: xoffset = viewWidth - cwidth; break; - case TextAlign.START: + case EN_START: break; - case TextAlign.JUSTIFY: + case EN_JUSTIFY: default: break; } diff --git a/src/java/org/apache/fop/layoutmgr/InstreamForeignObjectLM.java b/src/java/org/apache/fop/layoutmgr/InstreamForeignObjectLM.java index 0efe6eaaa..636acde53 100644 --- a/src/java/org/apache/fop/layoutmgr/InstreamForeignObjectLM.java +++ b/src/java/org/apache/fop/layoutmgr/InstreamForeignObjectLM.java @@ -77,22 +77,22 @@ public class InstreamForeignObjectLM extends LeafNodeLayoutManager { // isn't the block-progression-dimension always in the same // direction as the line height? len = fobj.getBlockProgressionDimension().getOptimum().getLength(); - if (len.getEnum() != AUTO) { + if (len.getEnum() != EN_AUTO) { bpd = len.getValue(); } else { len = fobj.getHeight(); - if (len.getEnum() != AUTO) { + if (len.getEnum() != EN_AUTO) { bpd = len.getValue(); } } } len = fobj.getInlineProgressionDimension().getOptimum().getLength(); - if (len.getEnum() != AUTO) { + if (len.getEnum() != EN_AUTO) { ipd = len.getValue(); } else { len = fobj.getWidth(); - if (len.getEnum() != AUTO) { + if (len.getEnum() != EN_AUTO) { ipd = len.getValue(); } } @@ -102,7 +102,7 @@ public class InstreamForeignObjectLM extends LeafNodeLayoutManager { int cwidth = -1; int cheight = -1; len = fobj.getContentWidth(); - if (len.getEnum() != AUTO) { + if (len.getEnum() != EN_AUTO) { /*if(len.scaleToFit()) { if(ipd != -1) { cwidth = ipd; @@ -111,7 +111,7 @@ public class InstreamForeignObjectLM extends LeafNodeLayoutManager { cwidth = len.getValue(); } len = fobj.getContentHeight(); - if (len.getEnum() != AUTO) { + if (len.getEnum() != EN_AUTO) { /*if(len.scaleToFit()) { if(bpd != -1) { cwidth = bpd; @@ -134,7 +134,7 @@ public class InstreamForeignObjectLM extends LeafNodeLayoutManager { cheight = (int)size.getY() * 1000; } int scaling = fobj.getScaling(); - if (scaling == Scaling.UNIFORM) { + if (scaling == EN_UNIFORM) { // adjust the larger double rat1 = cwidth / (size.getX() * 1000f); double rat2 = cheight / (size.getY() * 1000f); @@ -156,9 +156,9 @@ public class InstreamForeignObjectLM extends LeafNodeLayoutManager { boolean clip = false; if (cwidth > ipd || cheight > bpd) { int overflow = fobj.getOverflow(); - if (overflow == Overflow.HIDDEN) { + if (overflow == EN_HIDDEN) { clip = true; - } else if (overflow == Overflow.ERROR_IF_OVERFLOW) { + } else if (overflow == EN_ERROR_IF_OVERFLOW) { fobj.getLogger().error("Instream foreign object overflows the viewport: clipping"); clip = true; } diff --git a/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java b/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java index 836783c71..8ad0dda5c 100644 --- a/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java @@ -80,15 +80,15 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager { private InlineArea getLeaderInlineArea() { InlineArea leaderArea = null; - if (fobj.getLeaderPattern() == LeaderPattern.RULE) { + if (fobj.getLeaderPattern() == EN_RULE) { org.apache.fop.area.inline.Leader leader = new org.apache.fop.area.inline.Leader(); leader.setRuleStyle(fobj.getRuleStyle()); leader.setRuleThickness(fobj.getRuleThickness().getValue()); leaderArea = leader; - } else if (fobj.getLeaderPattern() == LeaderPattern.SPACE) { + } else if (fobj.getLeaderPattern() == EN_SPACE) { leaderArea = new Space(); - } else if (fobj.getLeaderPattern() == LeaderPattern.DOTS) { + } else if (fobj.getLeaderPattern() == EN_DOTS) { TextArea t = new TextArea(); char dot = '.'; // userAgent.getLeaderDotCharacter(); @@ -112,7 +112,7 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager { fa.setBPD(font.getAscender()); leaderArea = fa; - } else if (fobj.getLeaderPattern() == LeaderPattern.USECONTENT) { + } else if (fobj.getLeaderPattern() == EN_USECONTENT) { if (fobj.getChildNodes() == null) { fobj.getLogger().error("Leader use-content with no content"); return null; @@ -154,55 +154,55 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager { int bpd = curArea.getBPD(); switch (pattern) { - case LeaderPattern.RULE: + case EN_RULE: switch (verticalAlignment) { - case VerticalAlign.TOP: + case EN_TOP: curArea.setOffset(0); break; - case VerticalAlign.MIDDLE: + case EN_MIDDLE: curArea.setOffset(context.getMiddleBaseline() - bpd / 2); break; - case VerticalAlign.BOTTOM: + case EN_BOTTOM: curArea.setOffset(context.getLineHeight() - bpd); break; - case VerticalAlign.BASELINE: // fall through + case EN_BASELINE: // fall through default: curArea.setOffset(context.getBaseline() - bpd); break; } break; - case LeaderPattern.DOTS: + case EN_DOTS: switch (verticalAlignment) { - case VerticalAlign.TOP: + case EN_TOP: curArea.setOffset(0); break; - case VerticalAlign.MIDDLE: + case EN_MIDDLE: curArea.setOffset(context.getMiddleBaseline()); break; - case VerticalAlign.BOTTOM: + case EN_BOTTOM: curArea.setOffset(context.getLineHeight() - bpd + font.getAscender()); break; - case VerticalAlign.BASELINE: // fall through + case EN_BASELINE: // fall through default: curArea.setOffset(context.getBaseline()); break; } break; - case LeaderPattern.SPACE: + case EN_SPACE: // nothing to do break; - case LeaderPattern.USECONTENT: + case EN_USECONTENT: switch (verticalAlignment) { - case VerticalAlign.TOP: + case EN_TOP: curArea.setOffset(0); break; - case VerticalAlign.MIDDLE: + case EN_MIDDLE: curArea.setOffset(context.getMiddleBaseline()); break; - case VerticalAlign.BOTTOM: + case EN_BOTTOM: curArea.setOffset(context.getLineHeight() - bpd); break; - case VerticalAlign.BASELINE: // fall through + case EN_BASELINE: // fall through default: curArea.setOffset(context.getBaseline()); break; @@ -212,7 +212,7 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager { } public void addAreas(PositionIterator posIter, LayoutContext context) { - if (fobj.getLeaderPattern() != LeaderPattern.USECONTENT) { + if (fobj.getLeaderPattern() != EN_USECONTENT) { // use LeafNodeLayoutManager.addAreas() super.addAreas(posIter, context); } else { @@ -251,12 +251,12 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager { int total = 0; int middle = 0; switch (verticalAlignment) { - case VerticalAlign.MIDDLE : middle = bpd / 2 ; + case EN_MIDDLE : middle = bpd / 2 ; break; - case VerticalAlign.TOP : // fall through - case VerticalAlign.BOTTOM : total = bpd; + case EN_TOP : // fall through + case EN_BOTTOM : total = bpd; break; - case VerticalAlign.BASELINE: // fall through + case EN_BASELINE: // fall through default: lead = bpd; break; } diff --git a/src/java/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java b/src/java/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java index ce1a19aaf..30eee8927 100644 --- a/src/java/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java @@ -190,16 +190,16 @@ public class LeafNodeLayoutManager extends AbstractLayoutManager protected void offsetArea(LayoutContext context) { int bpd = curArea.getBPD(); switch (verticalAlignment) { - case VerticalAlign.MIDDLE: + case EN_MIDDLE: curArea.setOffset(context.getMiddleBaseline() - bpd / 2); break; - case VerticalAlign.TOP: + case EN_TOP: //curArea.setOffset(0); break; - case VerticalAlign.BOTTOM: + case EN_BOTTOM: curArea.setOffset(context.getLineHeight() - bpd); break; - case VerticalAlign.BASELINE: + case EN_BASELINE: default: curArea.setOffset(context.getBaseline() - bpd); break; @@ -251,14 +251,14 @@ public class LeafNodeLayoutManager extends AbstractLayoutManager int total = 0; int middle = 0; switch (verticalAlignment) { - case VerticalAlign.MIDDLE : middle = bpd / 2 ; + case EN_MIDDLE : middle = bpd / 2 ; lead = bpd / 2 ; break; - case VerticalAlign.TOP : total = bpd; + case EN_TOP : total = bpd; break; - case VerticalAlign.BOTTOM : total = bpd; + case EN_BOTTOM : total = bpd; break; - case VerticalAlign.BASELINE: + case EN_BASELINE: default: lead = bpd; break; } diff --git a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java index 925c4c903..e7aab011c 100644 --- a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java @@ -81,7 +81,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager { hyphProps = fobj.getCommonHyphenation(); // - if (bTextAlignment != JUSTIFY && bTextAlignmentLast == JUSTIFY) { + if (bTextAlignment != EN_JUSTIFY && bTextAlignmentLast == EN_JUSTIFY) { effectiveAlignment = 0; } else { effectiveAlignment = bTextAlignment; @@ -118,7 +118,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager { private List vecInlineBreaks = new ArrayList(); private BreakPoss prevBP = null; // Last confirmed break position - private int bTextAlignment = TextAlign.JUSTIFY; + private int bTextAlignment = EN_JUSTIFY; private int bTextAlignmentLast; private int effectiveAlignment; private Length textIndent; @@ -300,14 +300,14 @@ public class LineLayoutManager extends InlineStackingLayoutManager { public void startParagraph(int lineWidth) { // set the minimum amount of empty space at the end of the // last line - if (bTextAlignment == CENTER) { + if (bTextAlignment == EN_CENTER) { lineFillerWidth = 0; } else { lineFillerWidth = (int)(lineWidth / 12); } // add auxiliary elements at the beginning of the paragraph - if (bTextAlignment == CENTER && bTextAlignmentLast != JUSTIFY) { + if (bTextAlignment == EN_CENTER && bTextAlignmentLast != EN_JUSTIFY) { this.add(new KnuthGlue(0, 3 * DEFAULT_SPACE_WIDTH, 0, null, false)); ignoreAtStart ++; @@ -330,14 +330,14 @@ public class LineLayoutManager extends InlineStackingLayoutManager { this.remove(this.size() - 1); } if (this.size() > ignoreAtStart) { - if (bTextAlignment == CENTER - && bTextAlignmentLast != JUSTIFY) { + if (bTextAlignment == EN_CENTER + && bTextAlignmentLast != EN_JUSTIFY) { this.add(new KnuthGlue(0, 3 * DEFAULT_SPACE_WIDTH, 0, null, false)); this.add(new KnuthPenalty(0, -KnuthElement.INFINITE, false, null, false)); ignoreAtEnd = 2; - } else if (bTextAlignmentLast != JUSTIFY) { + } else if (bTextAlignmentLast != EN_JUSTIFY) { // add the elements representing the space // at the end of the last line // and the forced break @@ -384,7 +384,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager { clearPrevIPD(); int iPrevLineEnd = vecInlineBreaks.size(); - if (iPrevLineEnd == 0 && bTextAlignment == TextAlign.START) { + if (iPrevLineEnd == 0 && bTextAlignment == EN_START) { availIPD.subtract(new MinOptMax(textIndent.getValue())); } prevBP = null; @@ -502,7 +502,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager { maxAdjustment, false)) == 0) { // the first try failed, now try something different log.debug("No set of breaking points found with maxAdjustment = " + maxAdjustment); - if (hyphProps.hyphenate == Constants.TRUE) { + if (hyphProps.hyphenate == Constants.EN_TRUE) { // consider every hyphenation point as a legal break findHyphenationPoints(currPar); } else { @@ -518,7 +518,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager { // and force the algorithm to find // a set of breaking points log.debug("No set of breaking points found with maxAdjustment = " + maxAdjustment - + (hyphProps.hyphenate == Constants.TRUE ? " and hyphenation" : "")); + + (hyphProps.hyphenate == Constants.EN_TRUE ? " and hyphenation" : "")); maxAdjustment = 20; iBPcount = findBreakingPoints(currPar, @@ -652,13 +652,13 @@ public class LineLayoutManager extends InlineStackingLayoutManager { : bestActiveNode.difference + par.lineFillerWidth; int textAlign = (bestActiveNode.line < line || bForced) ? bTextAlignment : bTextAlignmentLast; - indent += (textAlign == CENTER) + indent += (textAlign == EN_CENTER) ? difference / 2 - : (textAlign == END) ? difference : 0; + : (textAlign == EN_END) ? difference : 0; indent += (bestActiveNode.line == 1 && knuthParagraphs.indexOf(par) == 0) ? textIndent.getValue() : 0; - double ratio = (textAlign == JUSTIFY) + double ratio = (textAlign == EN_JUSTIFY) ? bestActiveNode.adjustRatio : 0; makeLineBreakPosition(par, @@ -1306,20 +1306,20 @@ public class LineLayoutManager extends InlineStackingLayoutManager { double dAdjust = 0.0; int indent = 0; switch (textalign) { - case TextAlign.JUSTIFY: + case EN_JUSTIFY: if (realWidth != 0) { dAdjust = (double) (targetWith - realWidth) / realWidth; } break; - case TextAlign.START: + case EN_START: if (prevLineEnd == 0) { indent = textIndent.getValue(); } break; - case TextAlign.CENTER: + case EN_CENTER: indent = (targetWith - realWidth) / 2; break; - case TextAlign.END: + case EN_END: indent = targetWith - realWidth; break; } diff --git a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java index 1c41a954a..c2c24efb0 100644 --- a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java @@ -372,10 +372,10 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager implements public Marker retrieveMarker(String name, int pos, int boundary) { // get marker from the current markers on area tree Marker mark = (Marker)curPage.getMarker(name, pos); - if (mark == null && boundary != RetrieveBoundary.PAGE) { + if (mark == null && boundary != EN_PAGE) { // go back over pages until mark found // if document boundary then keep going - boolean doc = boundary == RetrieveBoundary.DOCUMENT; + boolean doc = boundary == EN_DOCUMENT; int seq = areaTreeModel.getPageSequenceCount(); int page = areaTreeModel.getPageCount(seq) - 1; while (page >= 0) { @@ -548,12 +548,12 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager implements if (aclass == Area.CLASS_NORMAL) { // todo: how to get properties from the Area??? // Need span, break - int breakVal = Constants.AUTO; + int breakVal = Constants.EN_AUTO; Integer breakBefore = (Integer)childArea.getTrait(Trait.BREAK_BEFORE); if (breakBefore != null) { breakVal = breakBefore.intValue(); } - if (breakVal != Constants.AUTO) { + if (breakVal != Constants.EN_AUTO) { // We may be forced to make new page handleBreak(breakVal); } else if (curPage == null) { @@ -561,9 +561,9 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager implements } // Now we should be on the right kind of page boolean bNeedSpan = false; - int span = Constants.NONE; // childArea.getSpan() + int span = Constants.EN_NONE; // childArea.getSpan() int numCols = 1; - if (span == Constants.ALL) { + if (span == Constants.EN_ALL) { // Assume the number of columns is stored on the curBody object. //numCols = curBody.getProperty(NUMBER_OF_COLUMNS); } @@ -617,7 +617,7 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager implements * @param breakVal the break value to handle */ private void handleBreak(int breakVal) { - if (breakVal == Constants.COLUMN) { + if (breakVal == Constants.EN_COLUMN) { if (curSpan != null && curSpan.getColumnCount() != curSpanColumns) { // Move to next column @@ -625,7 +625,7 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager implements return; } // else need new page - breakVal = Constants.PAGE; + breakVal = Constants.EN_PAGE; } if (needEmptyPage(breakVal)) { curPage = makeNewPage(true, false); @@ -645,7 +645,7 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager implements */ private boolean needEmptyPage(int breakValue) { - if (breakValue == Constants.PAGE || curPage.getPage().isEmpty()) { + if (breakValue == Constants.EN_PAGE || curPage.getPage().isEmpty()) { // any page is OK or we already have an empty page return false; } @@ -653,10 +653,10 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager implements /* IF we are on the kind of page we need, we'll need a new page. */ if (pageCount%2 != 0) { // Current page is odd - return (breakValue == Constants.ODD_PAGE); + return (breakValue == Constants.EN_ODD_PAGE); } else { - return (breakValue == Constants.EVEN_PAGE); + return (breakValue == Constants.EN_EVEN_PAGE); } } } @@ -666,15 +666,15 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager implements */ private boolean needNewPage(int breakValue) { if (curPage != null && curPage.getPage().isEmpty()) { - if (breakValue == Constants.PAGE) { + if (breakValue == Constants.EN_PAGE) { return false; } else if (pageCount%2 != 0) { // Current page is odd - return (breakValue == Constants.EVEN_PAGE); + return (breakValue == Constants.EN_EVEN_PAGE); } else { - return (breakValue == Constants.ODD_PAGE); + return (breakValue == Constants.EN_ODD_PAGE); } } else { @@ -849,7 +849,7 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager implements BodyRegion body = new BodyRegion(); setRegionPosition(r, body, absRegVPRect); int columnCount = r.getColumnCount(); - if ((columnCount > 1) && (r.getOverflow() == Overflow.SCROLL)) { + if ((columnCount > 1) && (r.getOverflow() == EN_SCROLL)) { // recover by setting 'column-count' to 1. This is allowed but // not required by the spec. log.error("Setting 'column-count' to 1 because " diff --git a/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java b/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java index 706849025..27ce99765 100644 --- a/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java @@ -123,7 +123,7 @@ public class TextLayoutManager extends AbstractLayoutManager private int lead = 0; private int total = 0; private int middle = 0; - private int verticalAlignment = VerticalAlign.BASELINE; + private int verticalAlignment = EN_BASELINE; /** * Create a Text layout manager. @@ -173,12 +173,12 @@ public class TextLayoutManager extends AbstractLayoutManager setAlignment(((Inline) foText.getParent()).getVerticalAlign()); } switch (verticalAlignment) { - case VerticalAlign.MIDDLE : middle = textHeight / 2 ; + case EN_MIDDLE : middle = textHeight / 2 ; break; - case VerticalAlign.TOP : // fall through - case VerticalAlign.BOTTOM : total = textHeight; + case EN_TOP : // fall through + case EN_BOTTOM : total = textHeight; break; - case VerticalAlign.BASELINE: // fall through + case EN_BASELINE: // fall through default : lead = fs.getAscender(); total = textHeight; break; @@ -229,7 +229,7 @@ public class TextLayoutManager extends AbstractLayoutManager */ public boolean canBreakBefore(LayoutContext context) { char c = textArray[iNextStart]; - return ((c == NEWLINE) || (foText.getWrapOption() == WRAP + return ((c == NEWLINE) || (foText.getWrapOption() == EN_WRAP && (CharUtilities.isBreakableSpace(c) || (BREAK_CHARS.indexOf(c) >= 0 && (iNextStart == 0 @@ -419,7 +419,7 @@ public class TextLayoutManager extends AbstractLayoutManager for (; iNextStart < textArray.length; iNextStart++) { char c = textArray[iNextStart]; // Include any breakable white-space as break char - if ((c == NEWLINE) || (foText.getWrapOption() == WRAP + if ((c == NEWLINE) || (foText.getWrapOption() == EN_WRAP && (CharUtilities.isBreakableSpace(c) || (BREAK_CHARS.indexOf(c) >= 0 && (iNextStart == 0 || Character.isLetterOrDigit(textArray[iNextStart-1])))))) { @@ -640,16 +640,16 @@ public class TextLayoutManager extends AbstractLayoutManager textArea.setBPD(fs.getAscender() - fs.getDescender()); int bpd = textArea.getBPD(); switch (verticalAlignment) { - case VerticalAlign.MIDDLE: + case EN_MIDDLE: textArea.setOffset(context.getMiddleBaseline() + fs.getXHeight() / 2); break; - case VerticalAlign.TOP: + case EN_TOP: textArea.setOffset(fs.getAscender()); break; - case VerticalAlign.BOTTOM: + case EN_BOTTOM: textArea.setOffset(context.getLineHeight() - bpd + fs.getAscender()); break; - case VerticalAlign.BASELINE: + case EN_BASELINE: default: textArea.setOffset(context.getBaseline()); break; @@ -686,7 +686,7 @@ public class TextLayoutManager extends AbstractLayoutManager false)); } switch (alignment) { - case CENTER : + case EN_CENTER : vecAreaInfo.add (new AreaInfo(iNextStart, (short) (iNextStart + 1), (short) 1, (short) 0, @@ -713,8 +713,8 @@ public class TextLayoutManager extends AbstractLayoutManager iNextStart ++; break; - case START : // fall through - case END : + case EN_START : // fall through + case EN_END : vecAreaInfo.add (new AreaInfo(iNextStart, (short) (iNextStart + 1), (short) 1, (short) 0, @@ -732,7 +732,7 @@ public class TextLayoutManager extends AbstractLayoutManager iNextStart ++; break; - case JUSTIFY: + case EN_JUSTIFY: vecAreaInfo.add (new AreaInfo(iNextStart, (short) (iNextStart + 1), (short) 1, (short) 0, @@ -991,7 +991,7 @@ public class TextLayoutManager extends AbstractLayoutManager } else { // ai refers to a space switch (alignment) { - case CENTER : + case EN_CENTER : returnList.add (new KnuthGlue(0, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0, new LeafPosition(this, iReturnedIndex), false)); @@ -1013,8 +1013,8 @@ public class TextLayoutManager extends AbstractLayoutManager new LeafPosition(this, -1), true)); iReturnedIndex ++; break; - case START : // fall through - case END : + case EN_START : // fall through + case EN_END : returnList.add (new KnuthGlue(0, 3 * wordSpaceIPD.opt, 0, new LeafPosition(this, iReturnedIndex), false)); @@ -1027,7 +1027,7 @@ public class TextLayoutManager extends AbstractLayoutManager new LeafPosition(this, -1), true)); iReturnedIndex ++; break; - case JUSTIFY: + case EN_JUSTIFY: returnList.add (new KnuthGlue(wordSpaceIPD.opt, wordSpaceIPD.max - wordSpaceIPD.opt, diff --git a/src/java/org/apache/fop/render/awt/AWTRenderer.java b/src/java/org/apache/fop/render/awt/AWTRenderer.java index e6ce03acb..3d87c43b8 100644 --- a/src/java/org/apache/fop/render/awt/AWTRenderer.java +++ b/src/java/org/apache/fop/render/awt/AWTRenderer.java @@ -377,7 +377,7 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable ImageFactory fact = ImageFactory.getInstance(); FopImage fopimage = fact.getImage(back.getURL(), userAgent); if (fopimage != null && fopimage.load(FopImage.DIMENSIONS)) { - if (back.getRepeat() == BackgroundRepeat.REPEAT) { + if (back.getRepeat() == EN_REPEAT) { // create a pattern for the image } else { // place once diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java index 13d1edb1a..aa37362ae 100644 --- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java +++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java @@ -550,7 +550,7 @@ public class PDFRenderer extends PrintRenderer { ImageFactory fact = ImageFactory.getInstance(); FopImage fopimage = fact.getImage(back.getURL(), userAgent); if (fopimage != null && fopimage.load(FopImage.DIMENSIONS)) { - if (back.getRepeat() == BackgroundRepeat.REPEAT) { + if (back.getRepeat() == EN_REPEAT) { // create a pattern for the image } else { // place once @@ -621,10 +621,10 @@ public class PDFRenderer extends PrintRenderer { private void updateLineStyle(int style) { switch (style) { - case Constants.DASHED: + case Constants.EN_DASHED: currentStream.add("[3] 0 d\n"); break; - case Constants.DOTTED: + case Constants.EN_DOTTED: currentStream.add("[1 7] 0 d\n"); break; default: @@ -1259,18 +1259,18 @@ public class PDFRenderer extends PrintRenderer { int style = area.getRuleStyle(); boolean alt = false; switch(style) { - case RuleStyle.SOLID: + case EN_SOLID: currentStream.add("[] 0 d\n"); break; - case RuleStyle.DOTTED: + case EN_DOTTED: currentStream.add("[2] 0 d\n"); break; - case RuleStyle.DASHED: + case EN_DASHED: currentStream.add("[6 4] 0 d\n"); break; - case RuleStyle.DOUBLE: - case RuleStyle.GROOVE: - case RuleStyle.RIDGE: + case EN_DOUBLE: + case EN_GROOVE: + case EN_RIDGE: alt = true; break; } @@ -1281,7 +1281,7 @@ public class PDFRenderer extends PrintRenderer { currentStream.add(area.getRuleThickness() / 1000f + " w\n"); drawLine(startx, starty, endx, starty); } else { - if (style == RuleStyle.DOUBLE) { + if (style == EN_DOUBLE) { float third = area.getRuleThickness() / 3000f; currentStream.add(third + " w\n"); drawLine(startx, starty, endx, starty); @@ -1297,7 +1297,7 @@ public class PDFRenderer extends PrintRenderer { currentStream.add(startx + " " + (starty + 2 * half) + " l\n"); currentStream.add("h\n"); currentStream.add("f\n"); - if (style == RuleStyle.GROOVE) { + if (style == EN_GROOVE) { currentStream.add("0 g\n"); currentStream.add(startx + " " + starty + " m\n"); currentStream.add(endx + " " + starty + " l\n"); diff --git a/src/java/org/apache/fop/render/ps/PSRenderer.java b/src/java/org/apache/fop/render/ps/PSRenderer.java index b0a62cb57..52c433b9d 100644 --- a/src/java/org/apache/fop/render/ps/PSRenderer.java +++ b/src/java/org/apache/fop/render/ps/PSRenderer.java @@ -693,7 +693,7 @@ public class PSRenderer extends PrintRenderer { ImageFactory fact = ImageFactory.getInstance(); FopImage fopimage = fact.getImage(back.getURL(), userAgent); if (fopimage != null && fopimage.load(FopImage.DIMENSIONS)) { - if (back.getRepeat() == BackgroundRepeat.REPEAT) { + if (back.getRepeat() == EN_REPEAT) { // create a pattern for the image } else { // place once diff --git a/src/java/org/apache/fop/render/rtf/RTFHandler.java b/src/java/org/apache/fop/render/rtf/RTFHandler.java index bbb4ad279..21e2ad33b 100644 --- a/src/java/org/apache/fop/render/rtf/RTFHandler.java +++ b/src/java/org/apache/fop/render/rtf/RTFHandler.java @@ -960,7 +960,7 @@ public class RTFHandler extends FOEventHandler { newGraphic.setURL(eg.getSrc()); //get scaling - if (eg.getScaling() == Constants.UNIFORM) { + if (eg.getScaling() == Constants.EN_UNIFORM) { newGraphic.setScaling ("uniform"); } diff --git a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java index 25da7bdff..6f2000e02 100644 --- a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java +++ b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java @@ -177,22 +177,22 @@ public class TableAttributesConverter { //check for keep-together row attribute - if (fobj.getKeepTogether().getWithinPage().getEnum() == Constants.ALWAYS) { + if (fobj.getKeepTogether().getWithinPage().getEnum() == Constants.EN_ALWAYS) { attrib.set(ITableAttributes.ROW_KEEP_TOGETHER); } //Check for keep-with-next row attribute. - if (fobj.getKeepWithNext().getWithinPage().getEnum() == Constants.ALWAYS) { + if (fobj.getKeepWithNext().getWithinPage().getEnum() == Constants.EN_ALWAYS) { attrib.set(ITableAttributes.ROW_KEEP_WITH_NEXT); } //Check for keep-with-previous row attribute. - if (fobj.getKeepWithPrevious().getWithinPage().getEnum() == Constants.ALWAYS) { + if (fobj.getKeepWithPrevious().getWithinPage().getEnum() == Constants.EN_ALWAYS) { attrib.set(ITableAttributes.ROW_KEEP_WITH_PREVIOUS); } //Check for height row attribute. - if (fobj.getHeight().getEnum() != Constants.AUTO) { + if (fobj.getHeight().getEnum() != Constants.EN_AUTO) { attrib.set(ITableAttributes.ROW_HEIGHT, fobj.getHeight().getValue() / (1000 / 20)); } @@ -221,7 +221,7 @@ public class TableAttributesConverter { /* ep = (EnumProperty)fobj.getProperty(Constants.PR_BORDER_TOP_STYLE); - if (ep != null && ep.getEnum() != Constants.NONE) { + if (ep != null && ep.getEnum() != Constants.EN_NONE) { attrib.set(ITableAttributes.ROW_BORDER_TOP, "\\" + convertAttributetoRtf(ep.getEnum())); attrib.set(ITableAttributes.ROW_BORDER_HORIZONTAL, "\\" @@ -229,7 +229,7 @@ public class TableAttributesConverter { isBorderPresent = true; } ep = (EnumProperty)fobj.getProperty(Constants.PR_BORDER_BOTTOM_STYLE); - if (ep != null && ep.getEnum() != Constants.NONE) { + if (ep != null && ep.getEnum() != Constants.EN_NONE) { attrib.set(ITableAttributes.ROW_BORDER_BOTTOM, "\\" + convertAttributetoRtf(ep.getEnum())); attrib.set(ITableAttributes.ROW_BORDER_HORIZONTAL, "\\" @@ -237,7 +237,7 @@ public class TableAttributesConverter { isBorderPresent = true; } ep = (EnumProperty)fobj.getProperty(Constants.PR_BORDER_LEFT_STYLE); - if (ep != null && ep.getEnum() != Constants.NONE) { + if (ep != null && ep.getEnum() != Constants.EN_NONE) { attrib.set(ITableAttributes.ROW_BORDER_LEFT, "\\" + convertAttributetoRtf(ep.getEnum())); attrib.set(ITableAttributes.ROW_BORDER_VERTICAL, "\\" @@ -245,7 +245,7 @@ public class TableAttributesConverter { isBorderPresent = true; } ep = (EnumProperty)fobj.getProperty(Constants.PR_BORDER_RIGHT_STYLE); - if (ep != null && ep.getEnum() != Constants.NONE) { + if (ep != null && ep.getEnum() != Constants.EN_NONE) { attrib.set(ITableAttributes.ROW_BORDER_RIGHT, "\\" + convertAttributetoRtf(ep.getEnum())); attrib.set(ITableAttributes.ROW_BORDER_VERTICAL, "\\" @@ -291,19 +291,19 @@ public class TableAttributesConverter { public static String convertAttributetoRtf(int iBorderStyle) { // Added by Normand Masse // "solid" is interpreted like "thin" - if (iBorderStyle == Constants.SOLID) { + if (iBorderStyle == Constants.EN_SOLID) { return BorderAttributesConverter.BORDER_SINGLE_THICKNESS; -/* } else if (iBorderStyle==Constants.THIN) { +/* } else if (iBorderStyle==Constants.EN_THIN) { return BorderAttributesConverter.BORDER_SINGLE_THICKNESS; - } else if (iBorderStyle==Constants.THICK) { + } else if (iBorderStyle==Constants.EN_THICK) { return BorderAttributesConverter.BORDER_DOUBLE_THICKNESS; - } else if (iBorderStyle==Constants. value.equals("shadowed")) { + } else if (iBorderStyle==Constants.EN_ value.equals("shadowed")) { return BorderAttributesConverter.BORDER_SHADOWED;*/ - } else if (iBorderStyle == Constants.DOUBLE) { + } else if (iBorderStyle == Constants.EN_DOUBLE) { return BorderAttributesConverter.BORDER_DOUBLE; - } else if (iBorderStyle == Constants.DOTTED) { + } else if (iBorderStyle == Constants.EN_DOTTED) { return BorderAttributesConverter.BORDER_DOTTED; - } else if (iBorderStyle == Constants.DASHED) { + } else if (iBorderStyle == Constants.EN_DASHED) { return BorderAttributesConverter.BORDER_DASH; /* } else if (iBorderStyle==Constants value.equals("hairline")) { return BorderAttributesConverter.BORDER_HAIRLINE;*/ diff --git a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java index a297b6425..316d379d5 100644 --- a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java +++ b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java @@ -166,7 +166,7 @@ class TextAttributesConverter { private static void attrTextDecoration(int textDecoration, RtfAttributes rtfAttr) { - if (textDecoration == Constants.UNDERLINE) { + if (textDecoration == Constants.EN_UNDERLINE) { rtfAttr.set(RtfText.ATTR_UNDERLINE, 1); } else { rtfAttr.set(RtfText.ATTR_UNDERLINE, 0); @@ -186,11 +186,11 @@ class TextAttributesConverter { /* private static void attrBlockDimension(FObj fobj, FOPRtfAttributes rtfAttr) { Length ipd = fobj.getProperty(Constants.PR_INLINE_PROGRESSION_DIMENSION).getLengthRange().getOptimum().getLength(); - if (ipd.getEnum() != Constants.AUTO) { + if (ipd.getEnum() != Constants.EN_AUTO) { rtfAttr.set(RtfText.FRAME_WIDTH, ipd); } Length bpd = fobj.getProperty(Constants.PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange().getOptimum().getLength(); - if (bpd.getEnum() != Constants.AUTO) { + if (bpd.getEnum() != Constants.EN_AUTO) { rtfAttr.set(RtfText.FRAME_HEIGHT, bpd); } } @@ -199,13 +199,13 @@ class TextAttributesConverter { private static void attrBlockTextAlign(int alignment, RtfAttributes rtfAttr) { String rtfValue = null; switch (alignment) { - case Constants.CENTER: + case Constants.EN_CENTER: rtfValue = RtfText.ALIGN_CENTER; break; - case Constants.END: + case Constants.EN_END: rtfValue = RtfText.ALIGN_RIGHT; break; - case Constants.JUSTIFY: + case Constants.EN_JUSTIFY: rtfValue = RtfText.ALIGN_JUSTIFIED; break; default: diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/BorderAttributesConverter.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/BorderAttributesConverter.java index 0416f3e1d..4eca61954 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/BorderAttributesConverter.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/BorderAttributesConverter.java @@ -119,7 +119,7 @@ public class BorderAttributesConverter { public static void makeBorder(CommonBorderPaddingBackground border, int side, RtfAttributes attributes, String controlWord) { int styleEnum = border.getBorderStyle(side); - if (styleEnum != Constants.NONE) { + if (styleEnum != Constants.EN_NONE) { FOPRtfAttributes attrs = new FOPRtfAttributes(); attrs.set(BORDER_COLOR, border.getBorderColor(side)); attrs.set(convertAttributetoRtf(styleEnum)); @@ -136,21 +136,21 @@ public class BorderAttributesConverter { public static String convertAttributetoRtf(int iBorderStyle) { // Added by Normand Masse // "solid" is interpreted like "thin" - if (iBorderStyle == Constants.NONE) { + if (iBorderStyle == Constants.EN_NONE) { return BorderAttributesConverter.BORDER_NIL; - } else if (iBorderStyle == Constants.SOLID) { + } else if (iBorderStyle == Constants.EN_SOLID) { return BorderAttributesConverter.BORDER_SINGLE_THICKNESS; -/* } else if (iBorderStyle==Constants.THIN) { +/* } else if (iBorderStyle==Constants.EN_THIN) { return BorderAttributesConverter.BORDER_SINGLE_THICKNESS; - } else if (iBorderStyle==Constants.THICK) { + } else if (iBorderStyle==Constants.EN_THICK) { return BorderAttributesConverter.BORDER_DOUBLE_THICKNESS; - } else if (iBorderStyle==Constants. value.equals("shadowed")) { + } else if (iBorderStyle==Constants.EN_ value.equals("shadowed")) { return BorderAttributesConverter.BORDER_SHADOWED;*/ - } else if (iBorderStyle == Constants.DOUBLE) { + } else if (iBorderStyle == Constants.EN_DOUBLE) { return BorderAttributesConverter.BORDER_DOUBLE; - } else if (iBorderStyle == Constants.DOTTED) { + } else if (iBorderStyle == Constants.EN_DOTTED) { return BorderAttributesConverter.BORDER_DOTTED; - } else if (iBorderStyle == Constants.DASHED) { + } else if (iBorderStyle == Constants.EN_DASHED) { return BorderAttributesConverter.BORDER_DASH; /* } else if (iBorderStyle==Constants value.equals("hairline")) { return BorderAttributesConverter.BORDER_HAIRLINE;*/ diff --git a/src/java/org/apache/fop/render/svg/SVGRenderer.java b/src/java/org/apache/fop/render/svg/SVGRenderer.java index 4e7cb6fc7..25ea983d6 100644 --- a/src/java/org/apache/fop/render/svg/SVGRenderer.java +++ b/src/java/org/apache/fop/render/svg/SVGRenderer.java @@ -360,19 +360,19 @@ public class SVGRenderer extends AbstractRenderer implements XMLHandler { String style = "stroke:black;stroke-width:" + (area.getRuleThickness() / 1000) + ";"; switch (area.getRuleStyle()) { - case RuleStyle.DOTTED: + case EN_DOTTED: style += "stroke-dasharray:1,1"; break; - case RuleStyle.DASHED: + case EN_DASHED: style += "stroke-dasharray:5,1"; break; - case RuleStyle.SOLID: + case EN_SOLID: break; - case RuleStyle.DOUBLE: + case EN_DOUBLE: break; - case RuleStyle.GROOVE: + case EN_GROOVE: break; - case RuleStyle.RIDGE: + case EN_RIDGE: break; } Element line = SVGUtilities.createLine(svgDocument, diff --git a/src/java/org/apache/fop/render/xml/XMLRenderer.java b/src/java/org/apache/fop/render/xml/XMLRenderer.java index ba1459099..dcc8d1f13 100644 --- a/src/java/org/apache/fop/render/xml/XMLRenderer.java +++ b/src/java/org/apache/fop/render/xml/XMLRenderer.java @@ -450,21 +450,21 @@ public class XMLRenderer extends AbstractRenderer { protected void renderLeader(Leader area) { String style = "solid"; switch (area.getRuleStyle()) { - case RuleStyle.DOTTED: + case EN_DOTTED: style = "dotted"; break; - case RuleStyle.DASHED: + case EN_DASHED: style = "dashed"; break; - case RuleStyle.SOLID: + case EN_SOLID: break; - case RuleStyle.DOUBLE: + case EN_DOUBLE: style = "double"; break; - case RuleStyle.GROOVE: + case EN_GROOVE: style = "groove"; break; - case RuleStyle.RIDGE: + case EN_RIDGE: style = "ridge"; break; } diff --git a/src/java/org/apache/fop/traits/LayoutProps.java b/src/java/org/apache/fop/traits/LayoutProps.java index 68c9946ba..d4dee2653 100644 --- a/src/java/org/apache/fop/traits/LayoutProps.java +++ b/src/java/org/apache/fop/traits/LayoutProps.java @@ -34,11 +34,11 @@ public class LayoutProps { public SpaceVal spaceAfter; private static final int[] BREAK_PRIORITIES = - new int[]{ Constants.AUTO, Constants.COLUMN, Constants.PAGE }; + new int[]{ Constants.EN_AUTO, Constants.EN_COLUMN, Constants.EN_PAGE }; public LayoutProps() { - breakBefore = breakAfter = Constants.AUTO; + breakBefore = breakAfter = Constants.EN_AUTO; bIsSpan = false; } diff --git a/src/java/org/apache/fop/traits/SpaceVal.java b/src/java/org/apache/fop/traits/SpaceVal.java index 3b1557d42..5dfbab90f 100644 --- a/src/java/org/apache/fop/traits/SpaceVal.java +++ b/src/java/org/apache/fop/traits/SpaceVal.java @@ -43,13 +43,13 @@ public class SpaceVal { spaceprop.getOptimum().getLength().getValue(), spaceprop.getMaximum().getLength().getValue()); bConditional = - (spaceprop.getConditionality().getEnum() == Constants.DISCARD); + (spaceprop.getConditionality().getEnum() == Constants.EN_DISCARD); Property precProp = spaceprop.getPrecedence(); if (precProp.getNumber() != null) { iPrecedence = precProp.getNumber().intValue(); bForcing = false; } else { - bForcing = (precProp.getEnum() == Constants.FORCE); + bForcing = (precProp.getEnum() == Constants.EN_FORCE); iPrecedence = 0; } } @@ -70,7 +70,7 @@ public class SpaceVal { } static public SpaceVal makeWordSpacing(Property wordSpacing, SpaceVal letterSpacing, Font fs) { - if (wordSpacing.getEnum() == Constants.NORMAL) { + if (wordSpacing.getEnum() == Constants.EN_NORMAL) { // give word spaces the possibility to shrink by a third, // and stretch by a half; int spaceCharIPD = fs.getCharWidth(' '); @@ -85,7 +85,7 @@ public class SpaceVal { } static public SpaceVal makeLetterSpacing(Property letterSpacing) { - if (letterSpacing.getEnum() == Constants.NORMAL) { + if (letterSpacing.getEnum() == Constants.EN_NORMAL) { // letter spaces are set to zero (or use different values?) return new SpaceVal(new MinOptMax(0), true, true, 0); } else { -- 2.39.5