1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- /* $Id$ */
-
- package org.apache.fop.render.afp.modca.goca;
-
- /**
- * Sets the value of the current line type attribute when stroking GOCA shapes (structured fields)
- */
- public class GraphicsSetLineType extends AbstractPreparedAFPObject {
- /** the default line type */
- public static final byte DEFAULT = 0x00; // normally SOLID
-
- /** the default line type */
- public static final byte DOTTED = 0x01;
-
- /** short dashed line type */
- public static final byte SHORT_DASHED = 0x02;
-
- /** dashed dotted line type */
- public static final byte DASH_DOT = 0x03;
-
- /** double dotted line type */
- public static final byte DOUBLE_DOTTED = 0x04;
-
- /** long dashed line type */
- public static final byte LONG_DASHED = 0x05;
-
- /** dash double dotted line type */
- public static final byte DASH_DOUBLE_DOTTED = 0x06;
-
- /** solid line type */
- public static final byte SOLID = 0x07;
-
- /** invisible line type */
- public static final byte INVISIBLE = 0x08;
-
- /** line type */
- private byte type = DEFAULT;
-
- /**
- * Main constructor
- * @param type line type
- */
- public GraphicsSetLineType(byte type) {
- this.type = type;
- prepareData();
- }
-
- /**
- * {@inheritDoc}
- */
- protected void prepareData() {
- super.data = new byte[] {
- 0x18, // GSLW order code
- type // line type
- };
- }
-
- private static final String[] TYPES = {
- "DEFAULT", "DOTTED", "SHORT_DASHED", "DASH_DOT", "DOUBLE_DOTTED",
- "LONG_DASHED", "DASH_DOUBLE_DOTTED", "SOLID", "INVISIBLE"
- };
-
- /**
- * {@inheritDoc}
- */
- public String toString() {
- return "GraphicsSetLineType(type=" + TYPES[type] + ")";
- }
- }
|