public interface ICanvasObject
CanvasControl
.
The interface is not meant to be implemented by application programmers. Instead, instances implementing this interface can be retrieved from the factory methods in the canvas control.
Modifier and Type | Method and Description |
---|---|
ICanvasObject |
above(ICanvasObject reference)
Moves this instance exactly behind the reference item in the referenced item's group rendering list, so that it will be
rendered directly above the given reference.
|
ICanvasObject |
below(ICanvasObject reference)
Moves this instance exactly before the reference item in the referenced item's group rendering list, so that it will be
rendered directly behind the given reference.
|
ICanvasObjectDescriptor |
getDescriptor()
Gets the descriptor instance that interprets the
UserObject during rendering, hit testing, and
bounds calculation. |
ICanvasObjectGroup |
getGroup()
Gets the parent group of this instance.
|
ICanvasObject |
getNext()
Gets the next item in the list of rendered items that is owned by this element's
Group . |
ICanvasObject |
getPrevious()
Gets the previous item in the list of rendered items that is owned by this element's
Group . |
Object |
getUserObject()
Gets the user object associated with this instance.
|
boolean |
isDirty()
Gets a flag that indicates whether
ICanvasObject needs to be updated during the next call to
CanvasControl.invalidate() . |
boolean |
isVisible()
Gets the visibility state of this instance.
|
ICanvasObject |
lower()
Moves this instance one step closer to the beginning of the group rendering list, so that it will be rendered behind its
current predecessor.
|
ICanvasObject |
raise()
Moves this instance one step closer to the end of the group rendering list, so that it will be rendered on top of its
current successor.
|
void |
remove()
Removes this item from the scene graph it currently belongs to.
|
void |
setDescriptor(ICanvasObjectDescriptor value)
Sets the descriptor instance that interprets the
UserObject during rendering, hit testing, and
bounds calculation. |
void |
setDirty(boolean value)
Sets a flag that indicates whether
ICanvasObject needs to be updated during the next call to
CanvasControl.invalidate() . |
void |
setGroup(ICanvasObjectGroup value)
Sets the parent group of this instance.
|
void |
setUserObject(Object value)
Sets the user object associated with this instance.
|
void |
setVisible(boolean value)
Sets the visibility state of this instance.
|
ICanvasObject |
toBack()
Moves this instance to the beginning of the group rendering list, so that it will be rendered behind all other items in
the same group.
|
ICanvasObject |
toFront()
Moves this instance to the end of the group rendering list, so that it will be rendered in front of all other items in
the same group.
|
ICanvasObject above(ICanvasObject reference)
This method returns the current instance so that calls can be chained, e.g. object.Above(other).Raise()
.
Observe that this instance will move into the referenced item's group if needed.
this
so that calls can be chained.ICanvasObject below(ICanvasObject reference)
This method returns the current instance so that calls can be chained, e.g. object.Below(other).Lower()
.
Observe that this instance will move into the referenced item's group if needed.
this
so that calls can be chained.ICanvasObjectDescriptor getDescriptor()
UserObject
during rendering, hit testing, and
bounds calculation.setDescriptor(ICanvasObjectDescriptor)
ICanvasObjectGroup getGroup()
setGroup(ICanvasObjectGroup)
ICanvasObject getNext()
Group
.
The returned item will be rendered after this item is rendered. If this item is the last one in the list, this method
returns null
.
null
if this item is last in the rendering list of its group or the next item otherwise.ICanvasObject getPrevious()
Group
.
The returned item will be rendered directly before this item is rendered. If this item is the first one in the list,
this method returns null
.
null
if this item is first in the rendering list of its group or the previous item otherwise.Object getUserObject()
The user object will be used by the Descriptor
during rendering, hit testing, and bounds
calculation
setUserObject(Object)
boolean isDirty()
ICanvasObject
needs to be updated during the next call to
CanvasControl.invalidate()
.
Note that it is up to the implementation of the ICanvasObjectDescriptor
to determine the actual dirty state of
this instance. ICanvasObjectDescriptor.isDirty(com.yworks.yfiles.view.ICanvasContext, ICanvasObject)
can use any
strategy to indicate dirtiness. The CanvasControl
will reset this flag during CanvasControl.invalidate()
to false
if the visual is created or updated.
true
if dirty; false
otherwise.setDirty(boolean)
boolean isVisible()
If an ICanvasObject is not visible, it will not be considered for hit tests.
setVisible(boolean)
ICanvasObject lower()
As a convenience, this method returns the current instance so that calls can be conveniently chained, e.g.
object.Lower().Lower()
this
so that calls can be chained.ICanvasObject raise()
As a convenience, this method returns the current instance so that calls can be conveniently chained, e.g.
object.Raise().Raise().Raise()
this
so that calls can be chained.void remove()
void setDescriptor(ICanvasObjectDescriptor value)
UserObject
during rendering, hit testing, and
bounds calculation.value
- The Descriptor to set.getDescriptor()
void setDirty(boolean value)
ICanvasObject
needs to be updated during the next call to
CanvasControl.invalidate()
.
Note that it is up to the implementation of the ICanvasObjectDescriptor
to determine the actual dirty state of
this instance. ICanvasObjectDescriptor.isDirty(com.yworks.yfiles.view.ICanvasContext, ICanvasObject)
can use any
strategy to indicate dirtiness. The CanvasControl
will reset this flag during CanvasControl.invalidate()
to false
if the visual is created or updated.
value
- true
if dirty; false
otherwise.isDirty()
void setGroup(ICanvasObjectGroup value)
value
- The Group to set.getGroup()
void setUserObject(Object value)
The user object will be used by the Descriptor
during rendering, hit testing, and bounds
calculation
value
- The UserObject to set.getUserObject()
void setVisible(boolean value)
If an ICanvasObject is not visible, it will not be considered for hit tests.
value
- The Visible to set.isVisible()
ICanvasObject toBack()
As a convenience, this method returns the current instance so that calls can be conveniently chained, e.g.
object.ToBack().Raise().Raise()
this
so that calls can be chained.ICanvasObject toFront()
As a convenience, this method returns the current instance so that calls can be conveniently chained, e.g.
object.ToFront().Lower()
this
so that calls can be chained.