001: /*
002: Copyright © 2006 Stefano Chizzolini. http://clown.stefanochizzolini.it
003:
004: Contributors:
005: * Stefano Chizzolini (original code developer, http://www.stefanochizzolini.it):
006: contributed code is Copyright © 2006 by Stefano Chizzolini.
007:
008: This file should be part of the source code distribution of "PDF Clown library"
009: (the Program): see the accompanying README files for more info.
010:
011: This Program is free software; you can redistribute it and/or modify it under
012: the terms of the GNU General Public License as published by the Free Software
013: Foundation; either version 2 of the License, or (at your option) any later version.
014:
015: This Program is distributed in the hope that it will be useful, but WITHOUT ANY
016: WARRANTY, either expressed or implied; without even the implied warranty of
017: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more details.
018:
019: You should have received a copy of the GNU General Public License along with this
020: Program (see README files); if not, go to the GNU website (http://www.gnu.org/).
021:
022: Redistribution and use, with or without modification, are permitted provided that such
023: redistributions retain the above copyright notice, license and disclaimer, along with
024: this list of conditions.
025: */
026:
027: package it.stefanochizzolini.clown.documents.contents;
028:
029: import java.util.HashMap;
030: import java.util.Map;
031:
032: /**
033: Glyph-outlines appearance on text showing [PDF:1.6:5.2.5].
034: */
035: public enum TextRenderModeEnum {
036: // <class>
037: // <static>
038: // <fields>
039: /**
040: Fill text glyphs.
041: */
042: Fill(0),
043: /**
044: Stroke text glyphs.
045: */
046: Stroke(1),
047: /**
048: Fill, then stroke text glyphs.
049: */
050: FillStroke(2),
051: /**
052: Do nothing (invisible text glyphs).
053: */
054: Invisible(3),
055: /**
056: Fill text glyphs, then apply to path for clipping.
057: */
058: FillClip(4),
059: /**
060: Stroke text glyphs, then apply to path for clipping.
061: */
062: StrokeClip(5),
063: /**
064: Fill, then stroke text glyphs, then apply to path for clipping.
065: */
066: FillStrokeClip(6),
067: /**
068: Apply text glyphs to path for clipping.
069: */
070: Clip(7);
071:
072: private static Map<Integer, TextRenderModeEnum> map = new HashMap<Integer, TextRenderModeEnum>();
073: // </fields>
074:
075: // <constructors>
076: static {
077: for (TextRenderModeEnum value : TextRenderModeEnum.values()) {
078: map.put(value.getCode(), value);
079: }
080: }
081:
082: // </constructors>
083:
084: // <interface>
085: // <public>
086: public static TextRenderModeEnum valueOf(int code) {
087: return map.get(code);
088: }
089:
090: // </public>
091: // </interface>
092: // </static>
093:
094: // <dynamic>
095: // <fields>
096: /**
097: <h3>Remarks</h3>
098: <p>Code MUST be explicitly distinct from the ordinal position of the enum constant
099: as they coincide by chance only.</p>
100: */
101: private int code;
102:
103: // </fields>
104:
105: // <constructors>
106: private TextRenderModeEnum(int code) {
107: this .code = code;
108: }
109:
110: // </constructors>
111:
112: // <interface>
113: // <public>
114: public int getCode() {
115: return code;
116: }
117: // </public>
118: // </interface>
119: // </dynamic>
120: // </class>
121: }
|