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.

GraphicsSetLineType.java 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.render.afp.modca.goca;
  19. /**
  20. * Sets the value of the current line type attribute when stroking GOCA shapes (structured fields)
  21. */
  22. public class GraphicsSetLineType extends AbstractPreparedAFPObject {
  23. /** the default line type */
  24. public static final byte DEFAULT = 0x00; // normally SOLID
  25. /** the default line type */
  26. public static final byte DOTTED = 0x01;
  27. /** short dashed line type */
  28. public static final byte SHORT_DASHED = 0x02;
  29. /** dashed dotted line type */
  30. public static final byte DASH_DOT = 0x03;
  31. /** double dotted line type */
  32. public static final byte DOUBLE_DOTTED = 0x04;
  33. /** long dashed line type */
  34. public static final byte LONG_DASHED = 0x05;
  35. /** dash double dotted line type */
  36. public static final byte DASH_DOUBLE_DOTTED = 0x06;
  37. /** solid line type */
  38. public static final byte SOLID = 0x07;
  39. /** invisible line type */
  40. public static final byte INVISIBLE = 0x08;
  41. /** line type */
  42. private byte type = DEFAULT;
  43. /**
  44. * Main constructor
  45. * @param type line type
  46. */
  47. public GraphicsSetLineType(byte type) {
  48. this.type = type;
  49. prepareData();
  50. }
  51. /**
  52. * {@inheritDoc}
  53. */
  54. protected void prepareData() {
  55. super.data = new byte[] {
  56. 0x18, // GSLW order code
  57. type // line type
  58. };
  59. }
  60. private static final String[] TYPES = {
  61. "DEFAULT", "DOTTED", "SHORT_DASHED", "DASH_DOT", "DOUBLE_DOTTED",
  62. "LONG_DASHED", "DASH_DOUBLE_DOTTED", "SOLID", "INVISIBLE"
  63. };
  64. /**
  65. * {@inheritDoc}
  66. */
  67. public String toString() {
  68. return "GraphicsSetLineType(type=" + TYPES[type] + ")";
  69. }
  70. }