Package org.pepstock.charba.client.geo
Class ProjectionAxis
- java.lang.Object
-
- org.pepstock.charba.client.configuration.Axis
-
- org.pepstock.charba.client.geo.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
-
-
Constructor Summary
Constructors Constructor Description ProjectionAxis(IsChart chart)
Builds the object storing the chart instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IsChart
getChart()
Returns the chart instanceprotected T
getConfiguration()
Returns the configuration element.Padding
getPadding()
Returns the padding applied during auto scaling of the map in pixels, i.e.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.List<Double>
getProjectionOffset()
Returns a map projection offset value.double
getProjectionScale()
Returns how much the map will be scaled.ChartEnvelop<NativeObject>
loadNativeObject(ChartEnvelop<NativeObject> envelop)
Returns the native object instance inside an envelop.
It can be called only fromorg.pepstock.charba.client
package.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.protected void
setConfiguration(T configuration)
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.void
setProjectionOffset(double x, double y)
Sets a map projection offset value.void
setProjectionScale(double projectionScale)
Sets how much the map will be scaled.String
toJSON()
Returns the JSON representation of the object.-
Methods inherited from class org.pepstock.charba.client.configuration.Axis
getAxis, getAxisBuildTicksCallback, getAxisCalculateLabelRotationCallback, getAxisDataLimitsCallback, getAxisDimensionsCallback, getAxisFitCallback, getAxisTickToLabelConversionCallback, getAxisUpdateCallback, getBackgroundColor, getBackgroundColorAsString, getCharbaId, getDisplay, getId, getType, getWeight, isAlignToPixels, isReverse, setAlignToPixels, setAxisBuildTicksCallback, setAxisCalculateLabelRotationCallback, setAxisDataLimitsCallback, setAxisDimensionsCallback, setAxisFitCallback, setAxisTickToLabelConversionCallback, setAxisUpdateCallback, setBackgroundColor, setBackgroundColor, setDisplay, setDisplay, setReverse, setWeight
-
-
-
-
Constructor Detail
-
ProjectionAxis
public ProjectionAxis(IsChart chart)
Builds the object storing the chart instance.- Parameters:
chart
- chart instance
-
-
Method Detail
-
getPadding
public Padding getPadding()
Returns the padding applied during auto scaling of the map in pixels, i.e. the chart size is reduce by the padding before fitting the map.- Returns:
- the padding applied during auto scaling of the map in pixels
-
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 placedy
- 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 addproperty
- 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 fromorg.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
-
-