use of com.tom_roush.harmony.awt.AWTColor in project PdfBox-Android by TomRoush.
the class FDFAnnotation method getColor.
/**
* Get the annotation color.
*
* @return The annotation color, or null if there is none.
*/
public AWTColor getColor() {
AWTColor retval = null;
COSArray array = (COSArray) annot.getDictionaryObject(COSName.C);
if (array != null) {
float[] rgb = array.toFloatArray();
if (rgb.length >= 3) {
retval = new AWTColor(rgb[0], rgb[1], rgb[2]);
}
}
return retval;
}
use of com.tom_roush.harmony.awt.AWTColor in project PdfBox-Android by TomRoush.
the class FDFAnnotationPolyline method getInteriorColor.
/**
* This will retrieve the interior color of the line endings defined in the LE entry.
*
* @return object representing the color.
*/
public AWTColor getInteriorColor() {
AWTColor retval = null;
COSArray array = (COSArray) annot.getDictionaryObject(COSName.IC);
if (array != null) {
float[] rgb = array.toFloatArray();
if (rgb.length >= 3) {
retval = new AWTColor(rgb[0], rgb[1], rgb[2]);
}
}
return retval;
}
use of com.tom_roush.harmony.awt.AWTColor in project PdfBox-Android by TomRoush.
the class FDFAnnotationSquare method getInteriorColor.
/**
* This will retrieve the interior color of the drawn area.
*
* @return object representing the color.
*/
public AWTColor getInteriorColor() {
AWTColor retval = null;
COSArray array = (COSArray) annot.getDictionaryObject(COSName.IC);
if (array != null) {
float[] rgb = array.toFloatArray();
if (rgb.length >= 3) {
retval = new AWTColor(rgb[0], rgb[1], rgb[2]);
}
}
return retval;
}
use of com.tom_roush.harmony.awt.AWTColor in project PdfBox-Android by TomRoush.
the class FDFAnnotationPolyline method initStyles.
private void initStyles(Element element) {
String startStyle = element.getAttribute("head");
if (startStyle != null && !startStyle.isEmpty()) {
setStartPointEndingStyle(startStyle);
}
String endStyle = element.getAttribute("tail");
if (endStyle != null && !endStyle.isEmpty()) {
setEndPointEndingStyle(endStyle);
}
String color = element.getAttribute("interior-color");
if (color != null && color.length() == 7 && color.charAt(0) == '#') {
int colorValue = Integer.parseInt(color.substring(1, 7), 16);
setInteriorColor(new AWTColor(colorValue));
}
}
use of com.tom_roush.harmony.awt.AWTColor in project PdfBox-Android by TomRoush.
the class FDFAnnotationLine method getInteriorColor.
/**
* This will retrieve the interior color of the line endings defined in the LE entry.
*
* @return object representing the color.
*/
public AWTColor getInteriorColor() {
AWTColor retval = null;
COSArray array = (COSArray) annot.getDictionaryObject(COSName.IC);
if (array != null) {
float[] rgb = array.toFloatArray();
if (rgb.length >= 3) {
retval = new AWTColor(rgb[0], rgb[1], rgb[2]);
}
}
return retval;
}