[Date Prev][Date Next][Index][Thread] [SGT Mail Archive] [SGT Main Page]

RE: printing for dummies



*************************************************
Message from the sgt mail list.
*************************************************

Don,

I had a look on the examples as suggested and I didn't find anything
relevant to my problem (I didn't find anything about scaling the plot to
full page). I modified my printing method like this :

    PrinterJob printJob = PrinterJob.getPrinterJob();
    setPageScaleMode(AbstractPane.TO_FIT);
    printJob.setPrintable(this, pageFormat_ );
    if ( printJob.printDialog() ) {
      try {
        RepaintManager currentManager = RepaintManager.currentManager(this);
        currentManager.setDoubleBufferingEnabled(false);
        printJob.print();
        currentManager.setDoubleBufferingEnabled(true);
      }
      catch (PrinterException ex) {
        ex.printStackTrace();
      }
    }

But it behaves exactly like before. As a clue, the bigger I make the graph
(by maximizing the window and resizing the app), the smaller on the paper.
If I make the graph tiny, I could barely see the graph on the paper because
it is so large and of course heavily clipped.

I use JPlotLayout's print method, should I override it and make some
translate and/or some scaling? Do you have any portion of code that could
help me? What I need is really simple : I want to print the graph and
shrink/extend it to the full page.

Regards,
Patrick Delarge
http://www.delarge.be


-----Original Message-----
From: owner-sgt@epic.noaa.gov [mailto:owner-sgt@epic.noaa.gov]On Behalf
Of Donald Denbo
Sent: mardi 7 octobre 2003 17:55
To: Patrick Delarge
Cc: sgt@epic.noaa.gov
Subject: Re: printing for dummies


*************************************************
Message from the sgt mail list.
*************************************************

Patrick,
	Look at the printing in gov.noaa.pmel.sgt.demo.BeanDemo.java,
JGridDemo, or JVectorDemo.  There are issues about position on the
printed page and about scaling the plot to fit the page.  If you still
have questions let me know.

Don


On Tuesday, October 7, 2003, at 02:05  AM, Patrick Delarge wrote:

> *************************************************
> Message from the sgt mail list.
> *************************************************
>
> Hi you all,
>
> I derived a JPlotLayout and add a method to print the graph :
>
>     PrinterJob printJob = PrinterJob.getPrinterJob();
>     printJob.setPrintable(this, printJob.defaultPage());
>     if ( printJob.printDialog() ) {
>       try {
>         printJob.print();
>       }
>       catch (PrinterException ex) {
>         ex.printStackTrace();
>       }
>     }
>
> Although it does print something, only the center part of the graph is
> printed, the Y axis is not printed, the title and legend are not
> printed
> either. Seems a clipping occur, but turning it to off doesn't change
> anything. I also tried to adjust the printer margin, no change.
>
> Anybody have an idea? I use SGT 3.0 and JRE 1.4.
>
> Regards,
> Patrick Delarge
> http://www.delarge.be
>
>
> *************************************************
> To remove yourself from this mailing list,
> send mail to <Majordomo@epic.noaa.gov> with
> "unsubscribe sgt" in the message body.
>


*************************************************
To remove yourself from this mailing list,
send mail to <Majordomo@epic.noaa.gov> with
"unsubscribe sgt" in the message body.


*************************************************
To remove yourself from this mailing list,
send mail to <Majordomo@epic.noaa.gov> with
"unsubscribe sgt" in the message body.