public abstract class ChartElement extends ChartNode
Modifier and Type | Class and Description |
---|---|
static interface |
ChartElement.Predicate<T> |
Modifier and Type | Field and Description |
---|---|
NodeCollection |
children |
PROPERTY_CHANGED_MESSAGE, PROPERTY_CHANGING_MESSAGE, trackPropertyChanged, trackPropertyChanging
Modifier and Type | Method and Description |
---|---|
ModifyChildrenResult |
canAddChild(ChartNode child)
Gets a
ModifyChildrenResult value that determines if a child can be added to this element. |
Iterable<ChartNode> |
enumDescendants()
When iterated over returns all descendants in
TreeTraversalMode.DEPTH_FIRST order. |
Iterable<ChartNode> |
enumDescendants(ChartElement.Predicate<ChartNode> predicate,
TreeTraversalMode traverseMode)
When iterated over in the given
TreeTraversalMode , returns children that match the provided predicate. |
Iterable<ChartNode> |
enumDescendants(TreeTraversalMode traverseMode)
When iterated over returns all descendants in the provided
TreeTraversalMode order. |
<T extends ChartElement> |
findAncestor(Class<T> clazz)
Searches up the parent chain and returns the first parent of type T.
|
ChartNode |
findDescendant(ChartElement.Predicate<ChartNode> criteria)
Searches down the subtree of elements, using breadth-first approach, and returns the first descendant of type T that matches the provided criteria.
|
ChartElementPresenter |
getPresenter()
Gets the
ChartElementPresenter instance whichrepresents the visual element in which
this ChartNode is visualised. |
boolean |
isAncestorOf(ChartNode node)
Gets a boolean value that determines whether a given element
resides in the element hierarchy of this element.
|
void |
setPresenter(ChartElementPresenter presenter)
Assigns the given
ChartElementPresenter to this element. |
applyLayoutRounding, arrange, arrange, chartArea, clearValue, collectionIndex, getLayoutSlot, getNodeState, getParent, index, invalidate, isTreeLoaded, isVisible, load, setIsVisible, setParent, setValue
getTypedValue, getValue, isLocalValue
public NodeCollection children
public ChartElementPresenter getPresenter()
ChartNode
ChartElementPresenter
instance whichrepresents the visual element in which
this ChartNode
is visualised.getPresenter
in class ChartNode
ChartElementPresenter
instance.public void setPresenter(ChartElementPresenter presenter)
ChartElementPresenter
to this element.presenter
- The presenter.public <T extends ChartElement> T findAncestor(Class<T> clazz)
T
- The type of parent to search for.public boolean isAncestorOf(ChartNode node)
node
- The node to check.public ChartNode findDescendant(ChartElement.Predicate<ChartNode> criteria)
criteria
- The criteria that determines which descendant to return.public Iterable<ChartNode> enumDescendants()
TreeTraversalMode.DEPTH_FIRST
order.public Iterable<ChartNode> enumDescendants(TreeTraversalMode traverseMode)
TreeTraversalMode
order.traverseMode
- The tree traversal mode.public Iterable<ChartNode> enumDescendants(ChartElement.Predicate<ChartNode> predicate, TreeTraversalMode traverseMode)
TreeTraversalMode
, returns children that match the provided predicate.predicate
- The predicate to apply to children nodes.traverseMode
- The tree traversal mode.public ModifyChildrenResult canAddChild(ChartNode child)
ModifyChildrenResult
value that determines if a child can be added to this element.child
- The child to be considered.