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: Shape to be used at the corners of stroked paths [PDF:1.6:4.3.2].
034: @version 0.0.4
035: */
036: public enum LineJoinEnum {
037: // <class>
038: // <static>
039: // <fields>
040: /**
041: Sharp line join.
042: */
043: Miter(0),
044: /**
045: Rounded line join.
046: */
047: Round(1),
048: /**
049: Squared-off line join.
050: */
051: Bevel(2);
052:
053: private static Map<Integer, LineJoinEnum> map = new HashMap<Integer, LineJoinEnum>();
054: // </fields>
055:
056: // <constructors>
057: static {
058: for (LineJoinEnum value : LineJoinEnum.values()) {
059: map.put(value.getCode(), value);
060: }
061: }
062:
063: // </constructors>
064:
065: // <interface>
066: // <public>
067: public static LineJoinEnum valueOf(int code) {
068: return map.get(code);
069: }
070:
071: // </public>
072: // </interface>
073: // </static>
074:
075: // <dynamic>
076: // <fields>
077: /**
078: <h3>Remarks</h3>
079: <p>Code MUST be explicitly distinct from the ordinal position of the enum constant
080: as they coincide by chance only.</p>
081: */
082: private int code;
083:
084: // </fields>
085:
086: // <constructors>
087: private LineJoinEnum(int code) {
088: this .code = code;
089: }
090:
091: // </constructors>
092:
093: // <interface>
094: // <public>
095: public int getCode() {
096: return code;
097: }
098: // </public>
099: // </interface>
100: // </dynamic>
101: // </class>
102: }
|