com.partnersoft.maps.app
Class MapPlotBuilder

java.lang.Object
  extended by com.partnersoft.maps.app.MapPlotBuilder

public class MapPlotBuilder
extends java.lang.Object

Plots map and returns as version requested through getters. Plot is based off of values set.

Copyright 2008 Partner Software, Inc.

Version:
$Id$
Author:
Rich Stepanski

Constructor Summary
MapPlotBuilder(MapApp app)
          Constructs a MapPlotBuilder.
 
Method Summary
 java.awt.image.BufferedImage getAsImage()
          Generates a plot using this class's settings and returns it as an image of some sort.
 com.lowagie.text.pdf.PdfTemplate getAsPdfTemplate(com.lowagie.text.pdf.PdfWriter writer)
          Generates a plot using this class's settings and returns it as an iText Pdf template.
 void setBorderColor(java.awt.Color color)
          Sets the color for the border to be drawn.
 void setCenterX(double x)
          Sets the center X position for this plot on the map.
 void setCenterY(double y)
          Sets the center Y position for this plot on the map.
 void setPixelHeight(int height)
          Sets the pixel height for this plot.
 void setPixelWidth(int width)
          Sets the pixel width for this plot.
 void setRotation(double rotation)
          Sets the rotation for this plot.
 void setScale(double scale)
          Sets the scale for this plot.
 void setShowBorder(boolean showBorder)
          Determines if the plot should be drawn with a border.
 void setShowScaleAndArrow(boolean showScaleAndArrow)
          Determines if the plot should be drawn with north arrow and map scale.
 void setViewFrame(MapViewFrame frame)
          The MapViewFrame to use for this plot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapPlotBuilder

public MapPlotBuilder(MapApp app)
Constructs a MapPlotBuilder. Internal MapViewFrame defaults to a copy of passed app's frame.

Parameters:
app - - A valid MapApp
Method Detail

setShowBorder

public void setShowBorder(boolean showBorder)
Determines if the plot should be drawn with a border. Border defaults to Color.BLACK.

Parameters:
showBorder - - True if border is to be shown. False otherwise.

setBorderColor

public void setBorderColor(java.awt.Color color)
Sets the color for the border to be drawn. Also sets showBorder to true. Defaults to Color.BLACK if color is null.

Parameters:
color - - Color to draw border.

setShowScaleAndArrow

public void setShowScaleAndArrow(boolean showScaleAndArrow)
Determines if the plot should be drawn with north arrow and map scale.

Parameters:
showScaleAndArrow - - True if scale and arrow are to be shown. False otherwise.

setViewFrame

public void setViewFrame(MapViewFrame frame)
The MapViewFrame to use for this plot. Sets pixel height, pixel width, centerX, centerY, scale, and rotation.

Parameters:
frame - - MapViewFrame with settings to plot with.
Throws:
java.lang.NullPointerException - if viewFrame is null.

setPixelWidth

public void setPixelWidth(int width)
Sets the pixel width for this plot.

Parameters:
width - - width in pixels of plot.

setPixelHeight

public void setPixelHeight(int height)
Sets the pixel height for this plot.

Parameters:
height - - height in pixels of plot.

setScale

public void setScale(double scale)
Sets the scale for this plot.

Parameters:
scale - - scale of plot.

setCenterX

public void setCenterX(double x)
Sets the center X position for this plot on the map.

Parameters:
x - - Position on map for center of plot.

setCenterY

public void setCenterY(double y)
Sets the center Y position for this plot on the map.

Parameters:
y - - Position on map for center of plot.

setRotation

public void setRotation(double rotation)
Sets the rotation for this plot.

Parameters:
rotation - - rotation of plot.

getAsPdfTemplate

public com.lowagie.text.pdf.PdfTemplate getAsPdfTemplate(com.lowagie.text.pdf.PdfWriter writer)
Generates a plot using this class's settings and returns it as an iText Pdf template.

Returns:
- iText PdfTemplate containing drawn plot, or NULL if an error occurs.
Throws:
java.lang.NullPointerException - if viewFrame is null.

getAsImage

public java.awt.image.BufferedImage getAsImage()
Generates a plot using this class's settings and returns it as an image of some sort.

Returns:
- BufferedImage containing drawn plot.
Throws:
java.lang.NullPointerException - if viewFrame is null.