~hjd/ubuntu/wily/xmlgraphics-commons/debian-merged

« back to all changes in this revision

Viewing changes to src/java/org/apache/xmlgraphics/java2d/ps/EPSDocumentGraphics2D.java

  • Committer: Hans Joachim Desserud
  • Date: 2015-11-11 18:22:53 UTC
  • mfrom: (9.1.5 sid)
  • Revision ID: hans_joachim_desserud-20151111182253-zwi0frfm97j0wddn
  * Merge from Debian unstable.  Remaining changes:
    - d/control: Drop dependencies required for unit testing as they
      include libmockito-java which would pull maven into main, disable unit
      test execution.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 * limitations under the License.
16
16
 */
17
17
 
18
 
/* $Id: EPSDocumentGraphics2D.java 954770 2010-06-15 09:05:14Z jeremias $ */
 
18
/* $Id: EPSDocumentGraphics2D.java 1681698 2015-05-26 07:49:35Z ssteiner $ */
19
19
 
20
20
package org.apache.xmlgraphics.java2d.ps;
21
21
 
27
27
 * This class is a wrapper for the <tt>AbstractPSDocumentGraphics2D</tt> that
28
28
 * is used to create EPS (Encapsulated PostScript) files instead of PS file.
29
29
 *
30
 
 * @version $Id: EPSDocumentGraphics2D.java 954770 2010-06-15 09:05:14Z jeremias $
 
30
 * @version $Id: EPSDocumentGraphics2D.java 1681698 2015-05-26 07:49:35Z ssteiner $
31
31
 * @see org.apache.xmlgraphics.java2d.ps.PSGraphics2D
32
32
 * @see org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D
33
33
 */
50
50
 
51
51
    /** {@inheritDoc} */
52
52
    protected void writeFileHeader() throws IOException {
53
 
        final Long pagewidth = new Long(this.width);
54
 
        final Long pageheight = new Long(this.height);
 
53
        final Long pagewidth = (long) this.width;
 
54
        final Long pageheight = (long) this.height;
55
55
 
56
56
        //PostScript Header
57
57
        gen.writeln(DSCConstants.PS_ADOBE_30 + " " + DSCConstants.EPSF_30);
63
63
        gen.writeDSCComment(DSCConstants.PAGES, DSCConstants.ATEND);
64
64
        gen.writeDSCComment(DSCConstants.BBOX, new Object[]
65
65
                {ZERO, ZERO, pagewidth, pageheight});
66
 
        gen.writeDSCComment(DSCConstants.LANGUAGE_LEVEL, new Integer(gen.getPSLevel()));
 
66
        gen.writeDSCComment(DSCConstants.LANGUAGE_LEVEL, gen.getPSLevel());
67
67
        gen.writeDSCComment(DSCConstants.END_COMMENTS);
68
68
 
69
69
        //Prolog
77
77
 
78
78
    /** {@inheritDoc} */
79
79
    protected void writePageHeader() throws IOException {
80
 
        Integer pageNumber = new Integer(this.pagecount);
 
80
        Integer pageNumber = this.pagecount;
81
81
        gen.writeDSCComment(DSCConstants.PAGE, new Object[]
82
82
                {pageNumber.toString(), pageNumber});
83
83
        gen.writeDSCComment(DSCConstants.PAGE_BBOX, new Object[]
84
 
                {ZERO, ZERO, new Integer(width), new Integer(height)});
 
84
                {ZERO, ZERO, width, height});
85
85
        gen.writeDSCComment(DSCConstants.BEGIN_PAGE_SETUP);
86
86
        if (customTextHandler instanceof PSTextHandler) {
87
87
            ((PSTextHandler)customTextHandler).writePageSetup();