RE: [OpenMap Users] Improved Openmap Printing [Contribution]

From: Sperlongano Brian M NPRI <SperlonganoBM_at_Npt.NUWC.Navy.Mil>
Date: Fri, 24 Sep 2004 12:21:47 -0400

 
Hi Ben,
 
To do this most simply, this is, just to print out a full-page size copy of your mapbean, you would do one of the following:
 
   //using a MapHandler
   new DefaultMapBeanPrinter(myMapHandler).print();

   //using a MapBean
   new DefaultMapBeanPrinter(myMapBean).print();
 
    //using a Layer[] and Projection
   new DefaultMapBeanPrinter(myLayerHandler.getLayers(), myMapBean.getProjection()).print();
 
If you wanted to customize the printout further, you would create a class that extends AbstractMapBeanPrinter and implement the following function (see the source code of DefaultMapBeanPrinter):
 
    public int print(Graphics g, PageFormat pageFormat, int pageIndex) {
 
        //Manipulate graphics object here...
        //Use printMap to place the map
    }

Hope that helps.
 
-Brian

-----Original Message-----
From: Ben Podoll [mailto:benjamin.podoll_at_und.edu]
Sent: Friday, September 24, 2004 11:07 AM
To: 'Sperlongano Brian M NPRI'
Subject: RE: [OpenMap Users] Improved Openmap Printing [Contribution]



What is the easiest way to do this (snippet of code if possible) to print my map bean?

 


  _____


From: owner-openmap-users_at_bbn.com [mailto:owner-openmap-users_at_bbn.com] On Behalf Of Sperlongano Brian M NPRI
Sent: Friday, September 24, 2004 9:06 AM
To: 'openmap_at_bbn.com'; 'openmap-users_at_bbn.com'
Subject: [OpenMap Users] Improved Openmap Printing [Contribution]

 

A few days ago, I sent two classes which enable map printing. I realized later that the approach used (using the paint() method of a MapBean) was flawed in that the printouts would be scaled *after* rasterization, and therefore would result in blockiness if the MapBean is small or the paper is large... in essence the MapBean image would get scaled as raster graphics instead of vector graphics.

 

To remedy these problems, I rewrote the two classes to support vectorized scaling, using the ImageServer class.

 

Feel free to use and distribute, blah blah blah.

 

-Brian

 

Brian Sperlongano

Computer Engineer

NUWCDIVNPT

(401) 832-6214

 




--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Sep 24 2004 - 12:23:00 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:06 EDT