You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AbstractTriplet.java 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.afp.modca.triplets;
  19. import org.apache.fop.afp.Streamable;
  20. import org.apache.fop.afp.StructuredData;
  21. /**
  22. * A simple implementation of a MOD:CA triplet
  23. */
  24. public abstract class AbstractTriplet implements Streamable, StructuredData {
  25. public static final byte CODED_GRAPHIC_CHARACTER_SET_GLOBAL_IDENTIFIER = 0x01;
  26. /** Triplet identifiers */
  27. public static final byte FULLY_QUALIFIED_NAME = 0x02;
  28. public static final byte MAPPING_OPTION = 0x04;
  29. public static final byte OBJECT_CLASSIFICATION = 0x10;
  30. public static final byte MODCA_INTERCHANGE_SET = 0x18;
  31. public static final byte FONT_DESCRIPTOR_SPECIFICATION = 0x1F;
  32. public static final byte OBJECT_FUNCTION_SET_SPECIFICATION = 0x21;
  33. public static final byte EXTENDED_RESOURCE_LOCAL_IDENTIFIER = 0x22;
  34. public static final byte RESOURCE_LOCAL_IDENTIFIER = 0x24;
  35. public static final byte RESOURCE_SECTION_NUMBER = 0x25;
  36. public static final byte CHARACTER_ROTATION = 0x26;
  37. public static final byte OBJECT_BYTE_OFFSET = 0x2D;
  38. public static final byte ATTRIBUTE_VALUE = 0x36;
  39. public static final byte DESCRIPTOR_POSITION = 0x43;
  40. public static final byte MEDIA_EJECT_CONTROL = 0x45;
  41. public static final byte PAGE_OVERLAY_CONDITIONAL_PROCESSING = 0x46;
  42. public static final byte RESOURCE_USAGE_ATTRIBUTE = 0x47;
  43. public static final byte MEASUREMENT_UNITS = 0x4B;
  44. public static final byte OBJECT_AREA_SIZE = 0x4C;
  45. public static final byte AREA_DEFINITION = 0x4D;
  46. public static final byte COLOR_SPECIFICATION = 0x4E;
  47. public static final byte ENCODING_SCHEME_ID = 0x50;
  48. public static final byte MEDIUM_MAP_PAGE_NUMBER = 0x56;
  49. public static final byte OBJECT_BYTE_EXTENT = 0x57;
  50. public static final byte OBJECT_STRUCTURED_FIELD_OFFSET = 0x58;
  51. public static final byte OBJECT_STRUCTURED_FIELD_EXTENT = 0x59;
  52. public static final byte OBJECT_OFFSET = 0x5A;
  53. public static final byte FONT_HORIZONTAL_SCALE_FACTOR = 0x5D;
  54. public static final byte OBJECT_COUNT = 0x5E;
  55. public static final byte OBJECT_DATE_AND_TIMESTAMP = 0x62;
  56. public static final byte COMMENT = 0x65;
  57. public static final byte MEDIUM_ORIENTATION = 0x68;
  58. public static final byte RESOURCE_OBJECT_INCLUDE = 0x6C;
  59. public static final byte PRESENTATION_SPACE_RESET_MIXING = 0x70;
  60. public static final byte PRESENTATION_SPACE_MIXING_RULE = 0x71;
  61. public static final byte UNIVERSAL_DATE_AND_TIMESTAMP = 0x72;
  62. public static final byte TONER_SAVER = 0x74;
  63. public static final byte COLOR_FIDELITY = 0x75;
  64. public static final byte FONT_FIDELITY = 0x78;
  65. public static final byte ATTRIBUTE_QUALIFIER = (byte)0x80;
  66. public static final byte PAGE_POSITION_INFORMATION = (byte)0x81;
  67. public static final byte PARAMETER_VALUE = (byte)0x82;
  68. public static final byte PRESENTATION_CONTROL = (byte)0x83;
  69. public static final byte FONT_RESOLUTION_AND_METRIC_TECHNOLOGY = (byte)0x84;
  70. public static final byte FINISHING_OPERATION = (byte)0x85;
  71. public static final byte TEXT_FIDELITY = (byte)0x86;
  72. public static final byte MEDIA_FIDELITY = (byte)0x87;
  73. public static final byte FINISHING_FIDELITY = (byte)0x88;
  74. public static final byte DATA_OBJECT_FONT_DESCRIPTOR = (byte)0x8B;
  75. public static final byte LOCALE_SELECTOR = (byte)0x8C;
  76. public static final byte UP3I_FINISHING_OPERATION = (byte)0x8E;
  77. public static final byte COLOR_MANAGEMENT_RESOURCE_DESCRIPTOR = (byte)0x91;
  78. public static final byte RENDERING_INTENT = (byte)0x95;
  79. public static final byte CMR_TAG_FIDELITY = (byte)0x96;
  80. public static final byte DEVICE_APPEARANCE = (byte)0x97;
  81. /** the triplet identifier */
  82. protected final byte id;
  83. /**
  84. * Constructor
  85. *
  86. * @param id the triplet identifier (see static definitions above)
  87. */
  88. public AbstractTriplet(byte id) {
  89. this.id = id;
  90. }
  91. /**
  92. * Returns the triplet identifier
  93. *
  94. * @return the triplet identifier
  95. */
  96. public byte getId() {
  97. return this.id;
  98. }
  99. /**
  100. * Returns the structured triplet data array
  101. *
  102. * @return the structured triplet data array
  103. */
  104. public byte[] getData() {
  105. int dataLen = getDataLength();
  106. byte[] data = new byte[dataLen];
  107. data[0] = (byte)dataLen;
  108. data[1] = id;
  109. return data;
  110. }
  111. }