Package org.eclipse.gef.mvc.fx.viewer
Class InfiniteCanvasViewer
java.lang.Object
org.eclipse.gef.mvc.fx.viewer.InfiniteCanvasViewer
- All Implemented Interfaces:
IActivatable
,IAdaptable
,IAdaptable.Bound<IDomain>
,IDisposable
,IViewer
The
InfiniteCanvasViewer
is an IViewer
that manages an
InfiniteCanvas
to display the viewer's contents.-
Property Summary
TypePropertyDescriptionfinal javafx.beans.property.ReadOnlyBooleanProperty
javafx.beans.property.ReadOnlyObjectProperty<IDomain>
javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,
Object> javafx.beans.property.ReadOnlyMapProperty<Object,
IContentPart<? extends javafx.scene.Node>> Returns an unmodifiable read-only map property that contains the registeredIContentPart
s mapped to their respective content.javafx.beans.property.ReadOnlyListProperty<Object>
A read-only property containing the current content objects.javafx.beans.property.ReadOnlyBooleanProperty
Returns aReadOnlyBooleanProperty
that represents the "focused" state of thisIViewer
.javafx.beans.property.ReadOnlyMapProperty<javafx.scene.Node,
IVisualPart<? extends javafx.scene.Node>> Returns an unmodifiable read-only map property that contains the registeredIVisualPart
s mapped to their respective visual. -
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable
IAdaptable.Bound<A extends IAdaptable>
Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
IAdaptable.Bound.Impl<T extends IAdaptable>
-
Field Summary
Fields inherited from interface org.eclipse.gef.common.activate.IActivatable
ACTIVE_PROPERTY
Fields inherited from interface org.eclipse.gef.common.adapt.IAdaptable
ADAPTERS_PROPERTY
Fields inherited from interface org.eclipse.gef.mvc.fx.viewer.IViewer
CONTENT_PART_MAP_PROPERTY, CONTENTS_PROPERTY, VISUAL_PART_MAP_PROPERTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
activate()
protected void
Activates the adapters registered at thisInfiniteCanvasViewer
.final javafx.beans.property.ReadOnlyBooleanProperty
javafx.beans.property.ReadOnlyObjectProperty<IDomain>
javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,
Object> javafx.beans.property.ReadOnlyMapProperty<Object,
IContentPart<? extends javafx.scene.Node>> Returns an unmodifiable read-only map property that contains the registeredIContentPart
s mapped to their respective content.javafx.beans.property.ReadOnlyListProperty<Object>
A read-only property containing the current content objects.final void
protected void
Deactivates the adapters registered at thisInfiniteCanvasViewer
.void
dispose()
protected void
Activates thisInfiniteCanvasViewer
, which activates its adapters.protected void
Deactivates thisInfiniteCanvasViewer
, which deactivates its adapters.Gets the value of the property adaptable.<T> T
getAdapter
(TypeToken<T> key) <T> T
getAdapter
(Class<T> classKey) <T> T
getAdapter
(AdapterKey<T> key) <T> AdapterKey<T>
getAdapterKey
(T adapter) javafx.collections.ObservableMap<AdapterKey<?>,
Object> Gets the value of the property adapters.<T> Map<AdapterKey<? extends T>,
T> getAdapters
(TypeToken<? super T> key) <T> Map<AdapterKey<? extends T>,
T> getAdapters
(Class<? super T> classKey) Returns theInfiniteCanvas
that is managed by thisInfiniteCanvasViewer
.Map<Object,
IContentPart<? extends javafx.scene.Node>> Returns theMap
for registeringIContentPart
s by their content.javafx.collections.ObservableList<Object>
Gets the value of the property contents.IRootPart<? extends javafx.scene.Node>
Returns theIRootPart
of this viewer.javafx.scene.Scene
getScene()
Map<javafx.scene.Node,
IVisualPart<? extends javafx.scene.Node>> Returns theMap
for registeringIVisualPart
s by their visual.final boolean
isActive()
Gets the value of the property active.boolean
Gets the value of the property viewerFocused.void
reveal
(IVisualPart<? extends javafx.scene.Node> visualPart) Ensure that the visual of the givenIVisualPart
is visible in this viewer.void
setAdaptable
(IDomain domain) Sets the value of the property adaptable.<T> void
setAdapter
(TypeToken<T> adapterType, T adapter) <T> void
setAdapter
(TypeToken<T> adapterType, T adapter, String role) <T> void
setAdapter
(T adapter) <T> void
setAdapter
(T adapter, String role) <T> void
unsetAdapter
(T adapter) javafx.beans.property.ReadOnlyBooleanProperty
Returns aReadOnlyBooleanProperty
that represents the "focused" state of thisIViewer
.javafx.beans.property.ReadOnlyMapProperty<javafx.scene.Node,
IVisualPart<? extends javafx.scene.Node>> Returns an unmodifiable read-only map property that contains the registeredIVisualPart
s mapped to their respective visual.
-
Property Details
-
active
public final javafx.beans.property.ReadOnlyBooleanProperty activeProperty- Specified by:
activeProperty
in interfaceIActivatable
- See Also:
-
adaptable
- Specified by:
adaptableProperty
in interfaceIAdaptable.Bound<IDomain>
- See Also:
-
adapters
- Specified by:
adaptersProperty
in interfaceIAdaptable
- See Also:
-
contentPartMap
public javafx.beans.property.ReadOnlyMapProperty<Object,IContentPart<? extends javafx.scene.Node>> contentPartMapProperty- Specified by:
contentPartMapProperty
in interfaceIViewer
- Returns:
- An unmodifiable read-only map property.
- See Also:
-
contents
- Specified by:
contentsProperty
in interfaceIViewer
- Returns:
- A read-only list property named
IViewer.CONTENTS_PROPERTY
. - See Also:
-
viewerFocused
public javafx.beans.property.ReadOnlyBooleanProperty viewerFocusedProperty- Specified by:
viewerFocusedProperty
in interfaceIViewer
- Returns:
- A
ReadOnlyBooleanProperty
that represents the "focused" state of thisIViewer
. - See Also:
-
visualPartMap
public javafx.beans.property.ReadOnlyMapProperty<javafx.scene.Node,IVisualPart<? extends javafx.scene.Node>> visualPartMapProperty- Specified by:
visualPartMapProperty
in interfaceIViewer
- Returns:
- An unmodifiable read-only map property.
- See Also:
-
-
Constructor Details
-
InfiniteCanvasViewer
public InfiniteCanvasViewer()Creates a newInfiniteCanvasViewer
.
-
-
Method Details
-
activate
public final void activate()- Specified by:
activate
in interfaceIActivatable
-
activateAdapters
protected void activateAdapters()Activates the adapters registered at thisInfiniteCanvasViewer
. -
activeProperty
public final javafx.beans.property.ReadOnlyBooleanProperty activeProperty()- Specified by:
activeProperty
in interfaceIActivatable
- See Also:
-
adaptableProperty
- Specified by:
adaptableProperty
in interfaceIAdaptable.Bound<IDomain>
- See Also:
-
adaptersProperty
- Specified by:
adaptersProperty
in interfaceIAdaptable
- See Also:
-
contentPartMapProperty
public javafx.beans.property.ReadOnlyMapProperty<Object,IContentPart<? extends javafx.scene.Node>> contentPartMapProperty()Description copied from interface:IViewer
Returns an unmodifiable read-only map property that contains the registeredIContentPart
s mapped to their respective content.- Specified by:
contentPartMapProperty
in interfaceIViewer
- Returns:
- An unmodifiable read-only map property.
- See Also:
-
contentsProperty
Description copied from interface:IViewer
A read-only property containing the current content objects.- Specified by:
contentsProperty
in interfaceIViewer
- Returns:
- A read-only list property named
IViewer.CONTENTS_PROPERTY
. - See Also:
-
deactivate
public final void deactivate()- Specified by:
deactivate
in interfaceIActivatable
-
deactivateAdapters
protected void deactivateAdapters()Deactivates the adapters registered at thisInfiniteCanvasViewer
. -
dispose
public void dispose()- Specified by:
dispose
in interfaceIDisposable
-
doActivate
protected void doActivate()Activates thisInfiniteCanvasViewer
, which activates its adapters. -
doDeactivate
protected void doDeactivate()Deactivates thisInfiniteCanvasViewer
, which deactivates its adapters. -
getAdaptable
Gets the value of the property adaptable.- Specified by:
getAdaptable
in interfaceIAdaptable.Bound<IDomain>
- Property description:
-
getAdapter
- Specified by:
getAdapter
in interfaceIAdaptable
-
getAdapter
- Specified by:
getAdapter
in interfaceIAdaptable
-
getAdapter
- Specified by:
getAdapter
in interfaceIAdaptable
-
getAdapterKey
- Specified by:
getAdapterKey
in interfaceIAdaptable
-
getAdapters
Gets the value of the property adapters.- Specified by:
getAdapters
in interfaceIAdaptable
- Property description:
-
getAdapters
- Specified by:
getAdapters
in interfaceIAdaptable
-
getAdapters
- Specified by:
getAdapters
in interfaceIAdaptable
-
getCanvas
Returns theInfiniteCanvas
that is managed by thisInfiniteCanvasViewer
.- Specified by:
getCanvas
in interfaceIViewer
- Returns:
- The
InfiniteCanvas
that is managed by thisInfiniteCanvasViewer
.
-
getContentPartMap
Description copied from interface:IViewer
Returns theMap
for registeringIContentPart
s by their content.- Specified by:
getContentPartMap
in interfaceIViewer
- Returns:
- The content part map
- See Also:
-
getContents
Gets the value of the property contents.- Specified by:
getContents
in interfaceIViewer
- Property description:
- Returns:
- An
ObservableList
.
-
getDomain
Description copied from interface:IViewer
-
getRootPart
Description copied from interface:IViewer
Returns theIRootPart
of this viewer. TheIRootPart
is a specialIVisualPart
that serves as the parent to all containedIContentPart
s,IHandlePart
s, andIFeedbackPart
s.- Specified by:
getRootPart
in interfaceIViewer
- Returns:
- The
IRootPart
of this viewer.
-
getScene
public javafx.scene.Scene getScene()- Returns:
- The
Scene
in which theInfiniteCanvas
of thisInfiniteCanvasViewer
is displayed.
-
getVisualPartMap
Description copied from interface:IViewer
Returns theMap
for registeringIVisualPart
s by their visual. This map is used for hit-testing. Hit testing is performed by first determining which visual is hit, and then mapping that to anIVisualPart
.Note, that when looking up an
IVisualPart
for a given visual in the map, it is required to walk up the visual hierarchy until a registered visual is found, because anIVisualPart
only has to register its "main" visual (i.e. the one returned byIVisualPart.getVisual()
) at the visual-part-map, but potential children visuals do not have to be registered.- Specified by:
getVisualPartMap
in interfaceIViewer
- Returns:
- The visual-to-visual-part map.
- See Also:
-
isActive
public final boolean isActive()Gets the value of the property active.- Specified by:
isActive
in interfaceIActivatable
- Property description:
-
isViewerFocused
public boolean isViewerFocused()Gets the value of the property viewerFocused.- Specified by:
isViewerFocused
in interfaceIViewer
- Property description:
- Returns:
- The value of the property
IViewer.viewerFocusedProperty()
.
-
reveal
Description copied from interface:IViewer
Ensure that the visual of the givenIVisualPart
is visible in this viewer.- Specified by:
reveal
in interfaceIViewer
- Parameters:
visualPart
- TheIVisualPart
that is to be revealed.
-
setAdaptable
Sets the value of the property adaptable.- Specified by:
setAdaptable
in interfaceIAdaptable.Bound<IDomain>
- Property description:
-
setAdapter
public <T> void setAdapter(T adapter) - Specified by:
setAdapter
in interfaceIAdaptable
-
setAdapter
- Specified by:
setAdapter
in interfaceIAdaptable
-
setAdapter
- Specified by:
setAdapter
in interfaceIAdaptable
-
setAdapter
- Specified by:
setAdapter
in interfaceIAdaptable
-
unsetAdapter
public <T> void unsetAdapter(T adapter) - Specified by:
unsetAdapter
in interfaceIAdaptable
-
viewerFocusedProperty
public javafx.beans.property.ReadOnlyBooleanProperty viewerFocusedProperty()Description copied from interface:IViewer
Returns aReadOnlyBooleanProperty
that represents the "focused" state of thisIViewer
. AnIViewer
is focused when its visualization has keyboard focus and its window is active, i.e. it is focused if it will receive keyboard events.- Specified by:
viewerFocusedProperty
in interfaceIViewer
- Returns:
- A
ReadOnlyBooleanProperty
that represents the "focused" state of thisIViewer
. - See Also:
-
visualPartMapProperty
public javafx.beans.property.ReadOnlyMapProperty<javafx.scene.Node,IVisualPart<? extends javafx.scene.Node>> visualPartMapProperty()Description copied from interface:IViewer
Returns an unmodifiable read-only map property that contains the registeredIVisualPart
s mapped to their respective visual.- Specified by:
visualPartMapProperty
in interfaceIViewer
- Returns:
- An unmodifiable read-only map property.
- See Also:
-