Class AnnotationElement
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.annotation.elements.AnnotationElement
-
- All Implemented Interfaces:
IsPoint
public final class AnnotationElement extends AbstractNode implements IsPoint
Maps all properties of the annotation element, the implementation of the annotation options in the plugin.
It provides all dimensions of the element and sub elements.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Constructor Description AnnotationElement(AnnotationEnvelop<NativeObject> envelop)
Creates the item using an envelop of the native java script object which contains all properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IsPoint
getCenterPoint()
Returns the center point of the element.IsPoint
getCenterPoint(boolean useFinalPosition)
Returns the center point of the element.AnnotationElement
getFinalPositionProps()
Returns the list of properties of the element, using the final position.double
getHeight()
Returns the height of element in pixel.double
getLabelHeight()
Returns the height of label element in pixel.double
getLabelWidth()
Returns the width of label element in pixel.double
getLabelX()
Returns the X location of label element in pixel.double
getLabelY()
Returns the Y location of element in pixel.OptionsElement
getOptions()
Returns the element options ornull
if options are not stored in the element.double
getPointX()
Returns the X location of element point in pixel.double
getPointY()
Returns the Y location of element point in pixel.double
getWidth()
Returns the width of element in pixel.double
getX()
Returns the X location of element in pixel.double
getX2()
Returns the X location of element in pixel.double
getY()
Returns the Y location of element in pixel.double
getY2()
Returns the Y location of element in pixel.boolean
inRange(double x, double y)
Returns whether the coordinates, passed as arguments, are inside the element or not.boolean
inRange(double x, double y, boolean useFinalPosition)
Returns whether the coordinates, passed as arguments, are inside the element or not.boolean
inRange(IsPoint point)
Returns whether the coordinates, passed as arguments, are inside the element or not.boolean
inRange(IsPoint point, boolean useFinalPosition)
Returns whether the coordinates, passed as arguments, are inside the element or not.boolean
isActive()
Returns if element is active.boolean
isSkipped()
Returnstrue
if skipped.-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.commons.IsPoint
isConsistent
-
-
-
-
Constructor Detail
-
AnnotationElement
public AnnotationElement(AnnotationEnvelop<NativeObject> envelop)
Creates the item using an envelop of the native java script object which contains all properties.- Parameters:
envelop
- envelop of the nativeObject native java script object which contains all properties.
-
-
Method Detail
-
getCenterPoint
public IsPoint getCenterPoint()
Returns the center point of the element.- Returns:
- the center point of the element.
-
getCenterPoint
public IsPoint getCenterPoint(boolean useFinalPosition)
Returns the center point of the element.- Parameters:
useFinalPosition
- if the position must be calculated with final dimensions or also during the animation.- Returns:
- the center point of the element.
-
inRange
public boolean inRange(IsPoint point)
Returns whether the coordinates, passed as arguments, are inside the element or not.- Parameters:
point
- the point instance to check.- Returns:
true
if point is inside the element
-
inRange
public boolean inRange(IsPoint point, boolean useFinalPosition)
Returns whether the coordinates, passed as arguments, are inside the element or not.- Parameters:
point
- the point instance to check.useFinalPosition
- if the position must be calculated with final dimensions or also during the animation.- Returns:
true
if point is inside the element
-
inRange
public boolean inRange(double x, double y)
Returns whether the coordinates, passed as arguments, are inside the element or not.- Parameters:
x
- coordinate x of the point to check.y
- coordinate y of the point to check.- Returns:
true
if point is inside the element
-
inRange
public boolean inRange(double x, double y, boolean useFinalPosition)
Returns whether the coordinates, passed as arguments, are inside the element or not.- Parameters:
x
- coordinate x of the point to check.y
- coordinate y of the point to check.useFinalPosition
- if the position must be calculated with final dimensions or also during the animation.- Returns:
true
if point is inside the element
-
getFinalPositionProps
public AnnotationElement getFinalPositionProps()
Returns the list of properties of the element, using the final position.- Returns:
- an annotation element instance.
-
getOptions
public final OptionsElement getOptions()
Returns the element options ornull
if options are not stored in the element.- Returns:
- the element options or
null
if options are not stored in the element.
-
isActive
public final boolean isActive()
Returns if element is active.- Returns:
true
if the element is active.
-
isSkipped
public final boolean isSkipped()
Returnstrue
if skipped.- Returns:
true
if skipped.
-
getX
public final double getX()
Returns the X location of element in pixel.
-
getY
public final double getY()
Returns the Y location of element in pixel.
-
getX2
public final double getX2()
Returns the X location of element in pixel.- Returns:
- the X location of element in pixel.
-
getY2
public final double getY2()
Returns the Y location of element in pixel.- Returns:
- the Y location of element in pixel.
-
getWidth
public final double getWidth()
Returns the width of element in pixel.- Returns:
- the width of element in pixel.
-
getHeight
public final double getHeight()
Returns the height of element in pixel.- Returns:
- the height of element in pixel.
-
getLabelX
public final double getLabelX()
Returns the X location of label element in pixel.- Returns:
- the X location of label element in pixel.
-
getLabelY
public final double getLabelY()
Returns the Y location of element in pixel.- Returns:
- the Y location of element in pixel.
-
getLabelWidth
public final double getLabelWidth()
Returns the width of label element in pixel.- Returns:
- the width of label element in pixel.
-
getLabelHeight
public final double getLabelHeight()
Returns the height of label element in pixel.- Returns:
- the height of label element in pixel.
-
getPointX
public final double getPointX()
Returns the X location of element point in pixel.- Returns:
- the X location of element point in pixel.
-
getPointY
public final double getPointY()
Returns the Y location of element point in pixel.- Returns:
- the Y location of element point in pixel.
-
-