/** * This will retrieve the length of the leader line. * * @return the length of the leader line */ public float getLeaderLineLength() { return this.getCOSObject().getFloat(COSName.LL, 0); }
/** * This will set the length of the leader line. * * @param leaderLineLength length of the leader line */ public void setLeaderLineLength(float leaderLineLength) { this.getCOSObject().setFloat(COSName.LL, leaderLineLength); }
/** * This will retrieve whether the text specified by the /Contents or /RC entries shall be * shown as a caption in the appearance of the line. * * @return boolean if the contents shall be shown as a caption (default: false). */ public boolean hasCaption() { return getCOSObject().getBoolean(COSName.CAP, false); }
/** * This will retrieve the length of the leader line offset. * * @return the length of the leader line offset */ public float getLeaderLineOffsetLength() { return this.getCOSObject().getFloat(COSName.LLO, 0); }
/** * This will set the length of the leader line offset. * * @param leaderLineOffsetLength length of the leader line offset */ public void setLeaderLineOffsetLength(float leaderLineOffsetLength) { this.getCOSObject().setFloat(COSName.LLO, leaderLineOffsetLength); }
/** * This will set if the contents are shown as a caption to the line. * * @param cap Boolean value. */ public void setCaption(boolean cap) { getCOSObject().setBoolean(COSName.CAP, cap); }
/** * This will retrieve the length of the leader line extensions. * * @return the length of the leader line extensions */ public float getLeaderLineExtensionLength() { return this.getCOSObject().getFloat(COSName.LLE, 0); }
/** * This will set the length of the leader line extensions. * * @param leaderLineExtensionLength length of the leader line extensions */ public void setLeaderLineExtensionLength(float leaderLineExtensionLength) { this.getCOSObject().setFloat(COSName.LLE, leaderLineExtensionLength); }
/** * This will retrieve the caption positioning. * * @return the caption positioning */ public String getCaptionPositioning() { return this.getCOSObject().getNameAsString(COSName.CP); }
/** * This will set the caption positioning. Allowed values are: "Inline" and "Top" * * @param captionPositioning caption positioning */ public void setCaptionPositioning(String captionPositioning) { this.getCOSObject().setName(COSName.CP, captionPositioning); }
/** * This will retrieve the start and end coordinates of the line (or leader line if LL entry is set). * * @return array of floats [x1, y1, x2, y2] line start and end points in default user space. */ public float[] getLine() { COSArray l = (COSArray) getCOSObject().getDictionaryObject(COSName.L); return l.toFloatArray(); }
/** * Constructor. */ public PDAnnotationLine() { getCOSObject().setName(COSName.SUBTYPE, SUB_TYPE); // Dictionary value L is mandatory, fill in with arbitary value setLine(new float[] { 0, 0, 0, 0 }); }
/** * This will set interior color of the line endings defined in the LE entry. color is in DeviceRGB color space. * * @param ic color in the DeviceRGB color space. */ public void setInteriorColor(PDColor ic) { getCOSObject().setItem(COSName.IC, ic.toCOSArray()); }
/** * This will retrieve the vertical offset of the caption. * * @return the vertical offset of the caption */ public float getCaptionVerticalOffset() { float retval = 0.f; COSArray array = (COSArray) this.getCOSObject().getDictionaryObject(COSName.CO); if (array != null) { retval = array.toFloatArray()[1]; } return retval; }
/** * This will retrieve the horizontal offset of the caption. * * @return the horizontal offset of the caption */ public float getCaptionHorizontalOffset() { float retval = 0.f; COSArray array = (COSArray) this.getCOSObject().getDictionaryObject(COSName.CO); if (array != null) { retval = array.toFloatArray()[0]; } return retval; }
/** * This will set start and end coordinates of the line (or leader line if LL entry is set). * * @param l array of 4 floats [x1, y1, x2, y2] line start and end points in default user space. */ public void setLine(float[] l) { COSArray newL = new COSArray(); newL.setFloatArray(l); getCOSObject().setItem(COSName.L, newL); }
/** * This will retrieve the line ending style for the end point, possible values shown in the LE_ constants section. * * @return The ending style for the end point, LE_NONE if missing, never null. */ public String getEndPointEndingStyle() { COSBase base = getCOSObject().getDictionaryObject(COSName.LE); if (base instanceof COSArray && ((COSArray) base).size() >= 2) { return ((COSArray) base).getName(1, LE_NONE); } return LE_NONE; }
/** * This will retrieve the line ending style for the start point, possible values shown in the LE_ constants section. * * @return The ending style for the start point, LE_NONE if missing, never null. */ public String getStartPointEndingStyle() { COSBase base = getCOSObject().getDictionaryObject(COSName.LE); if (base instanceof COSArray && ((COSArray) base).size() >= 2) { return ((COSArray) base).getName(0, LE_NONE); } return LE_NONE; }
/** * This will set the horizontal offset of the caption. * * @param offset the horizontal offset of the caption */ public void setCaptionHorizontalOffset(float offset) { COSArray array = (COSArray) this.getCOSObject().getDictionaryObject(COSName.CO); if (array == null) { array = new COSArray(); array.setFloatArray(new float[] { offset, 0.f }); this.getCOSObject().setItem(COSName.CO, array); } else { array.set(0, new COSFloat(offset)); } }
/** * This will set the vertical offset of the caption. * * @param offset vertical offset of the caption */ public void setCaptionVerticalOffset(float offset) { COSArray array = (COSArray) this.getCOSObject().getDictionaryObject(COSName.CO); if (array == null) { array = new COSArray(); array.setFloatArray(new float[] { 0.f, offset }); this.getCOSObject().setItem(COSName.CO, array); } else { array.set(1, new COSFloat(offset)); } }