mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-23 00:35:29 +00:00
gnujpdf reformat
This commit is contained in:
@@ -23,65 +23,67 @@ import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/**
|
||||
* <p>A border around an annotation </p>
|
||||
* <p>
|
||||
* A border around an annotation </p>
|
||||
*
|
||||
*
|
||||
* @author Peter T Mount, http://www.retep.org.uk/pdf/
|
||||
* @author Eric Z. Beard, ericzbeard@hotmail.com
|
||||
* @version $Revision: 1.2 $
|
||||
*/
|
||||
public class PDFBorder extends PDFObject
|
||||
{
|
||||
public class PDFBorder extends PDFObject {
|
||||
|
||||
/*
|
||||
* NOTE: The original class is the work of Peter T. Mount, who released it
|
||||
* in the uk.org.retep.pdf package. It was modified by Eric Z. Beard as
|
||||
* follows: the package name was changed to gnu.pdf. It is still
|
||||
* licensed under the LGPL.
|
||||
*/
|
||||
*/
|
||||
|
||||
/**
|
||||
* The style of the border
|
||||
*/
|
||||
private short style;
|
||||
|
||||
|
||||
/**
|
||||
* The width of the border
|
||||
*/
|
||||
private double width;
|
||||
|
||||
|
||||
/**
|
||||
* This array allows the definition of a dotted line for the border
|
||||
*/
|
||||
private double dash[];
|
||||
|
||||
|
||||
/**
|
||||
* Creates a border using the predefined styles in PDFAnnot.
|
||||
* <p>Note: Do not use PDFAnnot.DASHED with this method.
|
||||
* Use the other constructor.
|
||||
* <p>
|
||||
* Note: Do not use PDFAnnot.DASHED with this method. Use the other
|
||||
* constructor.
|
||||
*
|
||||
* @param style The style of the border
|
||||
* @param width The width of the border
|
||||
* @see PDFAnnot
|
||||
*/
|
||||
public PDFBorder(short style,double width) {
|
||||
public PDFBorder(short style, double width) {
|
||||
super("/Border");
|
||||
this.style = style;
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a border of style PDFAnnot.DASHED
|
||||
*
|
||||
* @param width The width of the border
|
||||
* @param dash The line pattern definition
|
||||
*/
|
||||
public PDFBorder(double width,double dash[]) {
|
||||
public PDFBorder(double width, double dash[]) {
|
||||
super("/Border");
|
||||
this.style = PDFAnnot.DASHED;
|
||||
this.width = width;
|
||||
this.dash = dash;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param os OutputStream to send the object to
|
||||
* @exception IOException on error
|
||||
@@ -90,23 +92,23 @@ public class PDFBorder extends PDFObject
|
||||
//writeStart(os);
|
||||
os.write(Integer.toString(objser).getBytes());
|
||||
os.write(" 0 obj\n".getBytes());
|
||||
|
||||
|
||||
os.write("[/S /".getBytes());
|
||||
os.write("SDBIU".substring(style,style+1).getBytes());
|
||||
os.write("SDBIU".substring(style, style + 1).getBytes());
|
||||
os.write(" /W ".getBytes());
|
||||
os.write(Double.toString(width).getBytes());
|
||||
if(dash!=null) {
|
||||
if (dash != null) {
|
||||
os.write(" /D [".getBytes());
|
||||
os.write(Double.toString(dash[0]).getBytes());
|
||||
for(int i=1;i<dash.length;i++) {
|
||||
for (int i = 1; i < dash.length; i++) {
|
||||
os.write(" ".getBytes());
|
||||
os.write(Double.toString(dash[i]).getBytes());
|
||||
}
|
||||
os.write("] ".getBytes());
|
||||
}
|
||||
os.write("]\n".getBytes());
|
||||
|
||||
|
||||
//writeEnd(os);
|
||||
os.write("endobj\n".getBytes());
|
||||
}
|
||||
}
|
||||
} // end class PDFBorder
|
||||
|
||||
Reference in New Issue
Block a user