org.apache.poi.hemf.record.emf

## Class HemfMisc.EmfCreatePen

- java.lang.Object
- - org.apache.poi.hwmf.record.HwmfMisc.WmfCreatePenIndirect
  - - org.apache.poi.hemf.record.emf.HemfMisc.EmfCreatePen

- All Implemented Interfaces:
    GenericRecord, HemfRecord, HwmfObjectTableEntry, HwmfRecord
  Direct Known Subclasses:
    HemfMisc.EmfExtCreatePen
  Enclosing class:
    HemfMisc

      public static class HemfMisc.EmfCreatePen
      extends HwmfMisc.WmfCreatePenIndirect
      implements HemfRecord

  The EMR_CREATEPEN record defines a logical pen for graphics operations.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `penIndex` A 32-bit unsigned integer that specifies the index of the logical palette object in the EMF Object Table.

    - ### Fields inherited from class org.apache.poi.hwmf.record.HwmfMisc.WmfCreatePenIndirect

      `colorRef, dimension, penStyle`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EmfCreatePen()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `draw(HemfGraphics ctx)` Draws the record, the default redirects to the parent WMF record drawing
    `HemfRecordType` | `getEmfRecordType()`
    `java.util.Map<java.lang.String,java.util.function.Supplier<?>>` | `getGenericProperties()`
    `java.lang.Enum` | `getGenericRecordType()`
    `int` | `getPenIndex()`
    `long` | `init(LittleEndianInputStream leis, long recordSize, long recordId)` Init record from stream
    `java.lang.String` | `toString()`

    - ### Methods inherited from class org.apache.poi.hwmf.record.HwmfMisc.WmfCreatePenIndirect

      `applyObject, draw, getColorRef, getDimension, getPenStyle, getWmfRecordType, init`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.poi.hemf.record.emf.HemfRecord

      `setHeader`

    - ### Methods inherited from interface org.apache.poi.common.usermodel.GenericRecord

      `getGenericChildren`

- - ### Field Detail

    - #### penIndex

          protected int penIndex

      A 32-bit unsigned integer that specifies the index of the logical palette object in the EMF Object Table. This index MUST be saved so that this object can be reused or modified.

  - ### Constructor Detail

    - #### EmfCreatePen

          public EmfCreatePen()

  - ### Method Detail

    - #### getEmfRecordType

          public HemfRecordType getEmfRecordType()

      Specified by:
        `getEmfRecordType` in interface `HemfRecord`

    - #### init

          public long init(LittleEndianInputStream leis,
                           long recordSize,
                           long recordId)
                    throws java.io.IOException

      Description copied from interface: `HemfRecord`
      Init record from stream
      Specified by:
        `init` in interface `HemfRecord`
      Parameters:
        `leis` - the little endian input stream
        `recordSize` - the size limit for this record
        `recordId` - the id of the `HemfRecordType`
      Returns:
        count of processed bytes
      Throws:
        `java.io.IOException` - when the inputstream is malformed

    - #### draw

          public void draw(HemfGraphics ctx)

      Description copied from interface: `HemfRecord`
      Draws the record, the default redirects to the parent WMF record drawing
      Specified by:
        `draw` in interface `HemfRecord`
      Parameters:
        `ctx` - the drawing context

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `HwmfMisc.WmfCreatePenIndirect`

    - #### getPenIndex

          public int getPenIndex()

    - #### getGenericProperties

          public java.util.Map<java.lang.String,java.util.function.Supplier<?>> getGenericProperties()

      Specified by:
        `getGenericProperties` in interface `GenericRecord`
      Overrides:
        `getGenericProperties` in class `HwmfMisc.WmfCreatePenIndirect`

    - #### getGenericRecordType

          public java.lang.Enum getGenericRecordType()

      Specified by:
        `getGenericRecordType` in interface `GenericRecord`
      Specified by:
        `getGenericRecordType` in interface `HemfRecord`
      Specified by:
        `getGenericRecordType` in interface `HwmfRecord`

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.