AnyLogic AnyLogic
Expand
Font size
  • java.lang.Object
    • com.anylogic.engine.Scale
All Implemented Interfaces:
java.io.Serializable

public class Scale
extends java.lang.Object
implements java.io.Serializable
See Also:
Serialized Form

Field Summary

Fields 
static Scale DEFAULT_SCALE  
Modifier and Type Field Description

Constructor Summary

Constructors 
Scale​(double pixelsPerMeter)  
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods 
double pixelsPerUnit​(LengthUnits unit)
Returns the number of pixels corresponding to one given unit, according to the scaling settings of this objects
double toLengthUnits​(double lengthInPixels, LengthUnits units)
Converts the given pixel length to the length units
double toPixels​(double lengthInUnits, LengthUnits units)
Converts the length in the given length units to pixels
Modifier and Type Method Description

Methods inherited from class java.lang.Object

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

Field Detail

DEFAULT_SCALE

public static final Scale DEFAULT_SCALE

Constructor Detail

Scale

public Scale​(double pixelsPerMeter)

Method Detail

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')
How can we improve this article?