VR
- The visual root node of the UI toolkit used, e.g.
javafx.scene.Node in case of JavaFX.public abstract class AbstractTool<VR> extends java.lang.Object implements ITool<VR>
AbstractTool
can be used as a base class for ITool
implementations.Type | Property and Description |
---|---|
javafx.beans.property.ReadOnlyBooleanProperty |
active |
javafx.beans.property.ReadOnlyObjectProperty<IDomain<VR>> |
adaptable |
IAdaptable.Bound.Impl<T extends IAdaptable>
ACTIVE_PROPERTY
Constructor and Description |
---|
AbstractTool() |
Modifier and Type | Method and Description |
---|---|
void |
activate() |
javafx.beans.property.ReadOnlyBooleanProperty |
activeProperty() |
javafx.beans.property.ReadOnlyObjectProperty<IDomain<VR>> |
adaptableProperty() |
protected void |
clearActivePolicies(IViewer<VR> viewer)
Clears the list of active policies of this tool for the given viewer.
|
void |
deactivate() |
java.util.List<? extends IPolicy<VR>> |
getActivePolicies(IViewer<VR> viewer)
Returns an (unmodifiable) list containing the
interaction
policies that are currently active within this tool for the given
IViewer , i.e. the target policies of this tool that get notified
about events within the given IViewer . |
IDomain<VR> |
getAdaptable()
Gets the value of the property adaptable.
|
IDomain<VR> |
getDomain()
|
boolean |
isActive()
Gets the value of the property active.
|
protected void |
registerListeners()
This method is called when a valid
IDomain is attached to this
tool so that you can register event listeners for various inputs
(keyboard, mouse) or model changes (selection, scroll offset / viewport). |
protected void |
setActivePolicies(IViewer<VR> viewer,
java.util.Collection<? extends IPolicy<VR>> activePolicies)
Set the active policies of this tool to the given policies.
|
void |
setAdaptable(IDomain<VR> adaptable)
Sets the value of the property adaptable.
|
protected void |
unregisterListeners()
This method is called when the attached
IDomain is reset to
null so that you can unregister previously registered event
listeners. |
public javafx.beans.property.ReadOnlyBooleanProperty activeProperty
activeProperty
in interface IActivatable
isActive()
public javafx.beans.property.ReadOnlyObjectProperty<IDomain<VR>> adaptableProperty
adaptableProperty
in interface IAdaptable.Bound<IDomain<VR>>
getAdaptable()
,
setAdaptable(IDomain)
public void activate()
activate
in interface IActivatable
public javafx.beans.property.ReadOnlyBooleanProperty activeProperty()
activeProperty
in interface IActivatable
isActive()
public javafx.beans.property.ReadOnlyObjectProperty<IDomain<VR>> adaptableProperty()
adaptableProperty
in interface IAdaptable.Bound<IDomain<VR>>
getAdaptable()
,
setAdaptable(IDomain)
protected void clearActivePolicies(IViewer<VR> viewer)
viewer
- The IViewer
for which to clear the active policies of
this tool.getActivePolicies(IViewer)
,
setActivePolicies(IViewer, Collection)
public void deactivate()
deactivate
in interface IActivatable
public java.util.List<? extends IPolicy<VR>> getActivePolicies(IViewer<VR> viewer)
ITool
interaction
policies
that are currently active within this tool for the given
IViewer
, i.e. the target policies of this tool that get notified
about events within the given IViewer
.getActivePolicies
in interface ITool<VR>
viewer
- The IViewer
for which to return the active policies.interaction
policies
that are currently active within this tool.public IDomain<VR> getAdaptable()
getAdaptable
in interface IAdaptable.Bound<IDomain<VR>>
public boolean isActive()
isActive
in interface IActivatable
protected void registerListeners()
IDomain
is attached to this
tool so that you can register event listeners for various inputs
(keyboard, mouse) or model changes (selection, scroll offset / viewport).protected void setActivePolicies(IViewer<VR> viewer, java.util.Collection<? extends IPolicy<VR>> activePolicies)
viewer
- The IViewer
for which to store the active policies of
this tool.activePolicies
- The active policies of this tool.clearActivePolicies(IViewer)
,
getActivePolicies(IViewer)
public void setAdaptable(IDomain<VR> adaptable)
setAdaptable
in interface IAdaptable.Bound<IDomain<VR>>
protected void unregisterListeners()
IDomain
is reset to
null
so that you can unregister previously registered event
listeners.Copyright (c) 2014 itemis AG and others. All rights reserved.