Class ProjectionAxis


  • public final class ProjectionAxis
    extends Axis
    A map projection is a way to flatten a globe's surface into a plane in order to make a map.
    This requires a systematic transformation of the latitudes and longitudes of locations from the surface of the globe into locations on a plane.
    This is the scale which is managing the map projection.
    Author:
    Andrea "Stock" Stocchero
    • Field Detail

      • ID

        public static final ScaleId ID
        Projection axis id.
      • TYPE

        public static final AxisType TYPE
        Projection axis type.
    • Constructor Detail

      • ProjectionAxis

        public ProjectionAxis​(IsChart chart)
        Builds the object storing the chart instance.
        Parameters:
        chart - chart instance
    • Method Detail

      • setProjection

        public void setProjection​(Projection projection)
        Sets a map projection which is a way to flatten a globe's surface into a plane in order to make a map.
        Parameters:
        projection - a map projection which is a way to flatten a globe's surface into a plane in order to make a map
      • getProjection

        public Projection getProjection()
        Returns a map projection which is a way to flatten a globe's surface into a plane in order to make a map.
        Returns:
        a map projection which is a way to flatten a globe's surface into a plane in order to make a map
      • setProjectionScale

        public void setProjectionScale​(double projectionScale)
        Sets how much the map will be scaled.
        Parameters:
        projectionScale - how much the map will be scaled
      • getProjectionScale

        public double getProjectionScale()
        Returns how much the map will be scaled.
        Returns:
        how much the map will be scaled
      • setProjectionOffset

        public void setProjectionOffset​(double x,
                                        double y)
        Sets a map projection offset value.
        Parameters:
        x - x offset where the map has been placed
        y - y offset where the map has been placed
      • getProjectionOffset

        public List<Double> getProjectionOffset()
        Returns a map projection offset value.
        Returns:
        a map projection offset value.
      • setConfiguration

        protected final void setConfiguration​(T configuration)
        Parameters:
        configuration - the configuration to set
      • getConfiguration

        protected final T getConfiguration()
        Returns the configuration element.
        Returns:
        the configuration element.
      • merge

        public final void merge​(NativeObjectContainer source,
                                String property)
        Merge a native object in the this one with a specific property name.
        This is used by plugins implementation (native java script ones) when they are not using the standard way to add plugin configuration in the options of chart.
        Parameters:
        source - native object container to add
        property - property name
      • toJSON

        public final String toJSON()
        Returns the JSON representation of the object.
        Returns:
        the JSON representation of the object.
      • loadNativeObject

        public final ChartEnvelop<NativeObject> loadNativeObject​(ChartEnvelop<NativeObject> envelop)
        Returns the native object instance inside an envelop.
        It can be called only from org.pepstock.charba.client package.
        Parameters:
        envelop - envelop instance which will contain the native object
        Returns:
        the envelop, passed as argument, loaded with the native object
      • getChart

        public final IsChart getChart()
        Returns the chart instance
        Returns:
        the chart