public class IlvDisplayPreferences extends Object implements IlvPersistentObject
IlvManager
containing cartographic data.
Display preferences include :IlvCoordinateFormatter
use when displaying coordinatesIlvDisplayPreferences
provides many utility methods to format coordinates, altitudes and distances anywhere in an application.Constructor and Description |
---|
IlvDisplayPreferences()
Creates a new
IlvDisplayPreferences . |
IlvDisplayPreferences(IlvDisplayPreferences preferences)
Creates a new
IlvDisplayPreferences by copying an existing
one. |
IlvDisplayPreferences(IlvInputStream stream)
Creates a new
IlvDisplayPreferences from an
IlvInputStream . |
IlvDisplayPreferences(IlvLinearUnit distanceUnit,
IlvLinearUnit altitudeUnit)
Creates a new
IlvDisplayPreferences . |
Modifier and Type | Method and Description |
---|---|
IlvDisplayPreferences |
copy()
Creates a new
IlvAltitudeProvider from an
IlvDefaultAltitudeProvider . |
boolean |
equals(Object other)
Overrides deep comparison equals.
|
String |
formatAltitude(double alt)
Transforms and formats an altitude (in meters).
|
String |
formatAngle(double angleRad)
Transforms an angle in radians using the current coordinate formatter.
|
String |
formatCoordinates(double xlon,
double ylat)
Formats lat/lon coordinates in radians according to the preferred formatter.
|
String |
formatDistance(double dist)
Transforms and formats a distance (in meter) .
|
DecimalFormat |
getAltitudeFormater()
Returns the altitude Formatter.
|
IlvLinearUnit |
getAltitudeUnit()
Returns the altitude Unit.
|
IlvCoordinateFormatter |
getCoordinateFormatter()
Returns the coordinate Formatter.
|
DecimalFormat |
getDistanceFormater()
Returns the distance Formatter.
|
IlvLinearUnit |
getDistanceUnit()
Returns the distance Unit.
|
boolean |
isUsingGeodeticComputation()
Returns the
usingGeodeticComputation . |
void |
setAltitudeFormat(String altitudeFormat)
Sets the format to use when formatting altitudes.
|
void |
setAltitudeUnit(IlvLinearUnit altitudeUnit,
boolean resetFormat)
Sets the altitude unit and possibly the altitude format.
|
void |
setCoordinateFormatter(IlvCoordinateFormatter coordinateFormatter)
Sets the coordinate formatter to use when displaying coordinates.
|
void |
setDistanceFormat(String distanceFormat)
Sets the format to use when formatting distance.
|
void |
setDistanceUnit(IlvLinearUnit distanceUnit,
boolean resetFormat)
Sets the distance unit and possibly the distance format.
|
void |
setUsingGeodeticComputation(boolean usingGeodeticComputation)
Indicates whether or not the map should use geodetic computation (date line wrapping).
|
void |
write(IlvOutputStream stream)
Writes the preferences to the output stream.
|
public IlvDisplayPreferences()
IlvDisplayPreferences
. Default units are
meters.public IlvDisplayPreferences(IlvDisplayPreferences preferences)
IlvDisplayPreferences
by copying an existing
one.preferences
- The source preferences to be copied.public IlvDisplayPreferences(IlvInputStream stream) throws IlvReadFileException
IlvDisplayPreferences
from an
IlvInputStream
.stream
- The input stream.IlvReadFileException
- if an error occurs while reading.public IlvDisplayPreferences(IlvLinearUnit distanceUnit, IlvLinearUnit altitudeUnit)
IlvDisplayPreferences
. Default altitude and
distance formats will be "###,### [unit abbreviation]". The default coordinate
formatter is IlvDMSCoordinateFormatter
.distanceUnit
- Unit to use to display distances.altitudeUnit
- Unit to use to display altitudes.public IlvDisplayPreferences copy()
IlvAltitudeProvider
from an
IlvDefaultAltitudeProvider
.IlvAltitudeProvider
.public String formatAltitude(double alt)
alt
- Altitude in meters.getAltitudeUnit()
,
getAltitudeFormater()
public String formatCoordinates(double xlon, double ylat)
xlon
- Longitude in radians.ylat
- Latitude in radians.getCoordinateFormatter()
public String formatDistance(double dist)
dist
- Distance in meters.getDistanceUnit()
,
getDistanceFormater()
public DecimalFormat getAltitudeFormater()
public IlvLinearUnit getAltitudeUnit()
public IlvCoordinateFormatter getCoordinateFormatter()
public DecimalFormat getDistanceFormater()
public IlvLinearUnit getDistanceUnit()
public void setAltitudeFormat(String altitudeFormat)
altitudeFormat
- The altitude format pattern to set.DecimalFormat.DecimalFormat(java.lang.String)
public void setAltitudeUnit(IlvLinearUnit altitudeUnit, boolean resetFormat)
altitudeUnit
- The altitude Unit to set.resetFormat
- If true
, altitude format will be reset to "###,### [unit
abbreviation]".public void setCoordinateFormatter(IlvCoordinateFormatter coordinateFormatter)
coordinateFormatter
- The coordinate formatter to use.public void setDistanceFormat(String distanceFormat)
distanceFormat
- The distance format pattern to set.DecimalFormat.DecimalFormat(java.lang.String)
public void setDistanceUnit(IlvLinearUnit distanceUnit, boolean resetFormat)
distanceUnit
- The distance Unit to set.resetFormat
- If true
, distance format will be reset to "###,### [unit
abbreviation]".public void write(IlvOutputStream stream) throws IOException
write
in interface IlvPersistentObject
stream
- the output streamIOException
- thrown when an exception occurs during
the write operation for this object.IlvPersistentObject.write(ilog.views.io.IlvOutputStream)
public String formatAngle(double angleRad)
IlvDMSCoordinateFormatter
will be used instead.angleRad
- Angle in radians.IlvCoordinateFormatter.getAngleString(double)
public boolean isUsingGeodeticComputation()
usingGeodeticComputation
.usingGeodeticComputation
.public void setUsingGeodeticComputation(boolean usingGeodeticComputation)
usingGeodeticComputation
- true is geodetic computation is used.public boolean equals(Object other)
equals
in class Object
Object.equals(java.lang.Object)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.