com.partnersoft.maps.ephemera
Class EphemeraLib

java.lang.Object
  extended by com.partnersoft.maps.ephemera.EphemeraLib

public class EphemeraLib
extends java.lang.Object

Any helpful methods used by Ephemera.

Copyright 2007 Paul Reavis

Version:
$Id$
Author:
Rich Stepanski

Field Summary
static double DEGREES_TO_BYTE
           
static double RADIANS_TO_BYTE
           
 
Method Summary
static java.awt.geom.Rectangle2D findTextBounds(MapApp app, MapSet mapset, java.lang.String textStyle, java.lang.String text)
          Calculates the pixel bounds of the passed String given the passed text style name, Mapset containing text style, and valid MapApp.
static double findTextHeight(MapApp app, MapSet mapset, java.lang.String textStyle, java.lang.String text)
          Calculates the pixel height of the passed String given the passed text style name, Mapset containing text style, and valid MapApp.
static double findTextWidth(MapApp app, MapSet mapset, java.lang.String textStyle, java.lang.String text)
          Calculates the pixel width of the passed String given the passed text style name, Mapset containing text style, and valid MapApp.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEGREES_TO_BYTE

public static final double DEGREES_TO_BYTE
See Also:
Constant Field Values

RADIANS_TO_BYTE

public static final double RADIANS_TO_BYTE
See Also:
Constant Field Values
Method Detail

findTextWidth

public static double findTextWidth(MapApp app,
                                   MapSet mapset,
                                   java.lang.String textStyle,
                                   java.lang.String text)
Calculates the pixel width of the passed String given the passed text style name, Mapset containing text style, and valid MapApp.

Checks for line breaks, returning only the longest width line of text.

Parameters:
app - - valid MapApp.
mapset - - MapSet containing text style.
textStyle - - String name of text style.
text - - String of text to find pixel width of.
Returns:
width of passed text in passed text style.
Throws:
java.lang.NullPointerException - if anything is null.

findTextHeight

public static double findTextHeight(MapApp app,
                                    MapSet mapset,
                                    java.lang.String textStyle,
                                    java.lang.String text)
Calculates the pixel height of the passed String given the passed text style name, Mapset containing text style, and valid MapApp.

Parameters:
app - - valid MapApp.
mapset - - MapSet containing text style.
textStyle - - String name of text style.
text - - String of text to find pixel height of.
Returns:
height of passed text in passed text style.
Throws:
java.lang.NullPointerException - if anything is null.

findTextBounds

public static java.awt.geom.Rectangle2D findTextBounds(MapApp app,
                                                       MapSet mapset,
                                                       java.lang.String textStyle,
                                                       java.lang.String text)
Calculates the pixel bounds of the passed String given the passed text style name, Mapset containing text style, and valid MapApp.

Parameters:
app - - valid MapApp.
mapset - - MapSet containing text style.
textStyle - - String name of text style.
text - - String of text to find pixel bounds of.
Returns:
bounds of passed text in passed text style.
Throws:
java.lang.NullPointerException - if anything is null.