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-ffa450edef68tags/Root_Temp_KnuthStylePageBreaking
@@ -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 { |
@@ -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); | |||
} |
@@ -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; | |||
/** |
@@ -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; | |||
} |
@@ -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 |
@@ -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; | |||
} |
@@ -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; | |||
} |
@@ -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; | |||
} |
@@ -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; |
@@ -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. |
@@ -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; | |||
} | |||
} |
@@ -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++; | |||
} |
@@ -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; |
@@ -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; |
@@ -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; |
@@ -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); |
@@ -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; |
@@ -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()); |
@@ -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(); |
@@ -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(); |
@@ -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; |
@@ -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; | |||
} | |||
} | |||
@@ -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; | |||
} | |||
/** |
@@ -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; |
@@ -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); |
@@ -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); | |||
} | |||
@@ -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; |
@@ -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; | |||
} |
@@ -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; | |||
} |
@@ -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; | |||
} |
@@ -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; | |||
} |
@@ -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; | |||
} |
@@ -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 " |
@@ -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, |
@@ -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 |
@@ -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"); |
@@ -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 |
@@ -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"); | |||
} | |||
@@ -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;*/ |
@@ -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: |
@@ -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;*/ |
@@ -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, |
@@ -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; | |||
} |
@@ -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; | |||
} | |||
@@ -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 { |