AnyLogic
Expand
Font size
All Implemented Interfaces:
Serializable

public class Scale
extends Object
implements Serializable
See Also:
Serialized Form

Field Summary

Modifier and TypeFieldDescription
static final ScaleDEFAULT_SCALE 

Constructor Summary

ConstructorDescription
Scale(double pixelsPerMeter) 

Method Summary

Modifier and TypeMethodDescription
doublepixelsPerUnit(LengthUnits unit)
Returns the number of pixels corresponding to one given unit, according to the scaling settings of this objects
doubletoLengthUnits(double lengthInPixels, LengthUnits units)
Converts the given pixel length to the length units
doubletoPixels(double lengthInUnits, LengthUnits units)
Converts the length in the given length units to pixels

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

DEFAULT_SCALE

public static final Scale DEFAULT_SCALE

Constructor Details

Scale

public Scale(double pixelsPerMeter)

Method Details

pixelsPerUnit

public double pixelsPerUnit(LengthUnits unit)
Returns the number of pixels corresponding to one given unit, according to the scaling settings of this objects

toLengthUnits

public double toLengthUnits(double lengthInPixels,
 LengthUnits units)
Converts the given pixel length to the length units
Parameters:
lengthInPixels - the length in pixels (in the scope of underlying agent which acts as 'Space')
units - length units
Returns:
result in length units

toPixels

public double toPixels(double lengthInUnits,
 LengthUnits units)
Converts the length in the given length units to pixels
Parameters:
lengthInUnits - the length in units
units - length units
Returns:
result in pixels (in the scope of underlying agent which acts as 'Space')