Package org.eclipse.gef.mvc.fx.viewer
Interface IViewer
- All Superinterfaces:
IActivatable
,IAdaptable
,IAdaptable.Bound<IDomain>
,IDisposable
- All Known Implementing Classes:
InfiniteCanvasViewer
The
IViewer
interface specifies all services that a viewer needs to
provide. One application (within one IDomain
) can be consisting of
multiple viewers. Each viewer maintains its own getContentPartMap()
and getVisualPartMap()
that can be used to navigate from/to content,
controller, and visual objects.- Noimplement:
- This interface is not intended to be implemented by clients.
Instead,
InfiniteCanvasViewer
should be subclassed.
-
Property Summary
TypePropertyDescriptionReadOnlyMapProperty<Object,
IContentPart<? extends Node>> Returns an unmodifiable read-only map property that contains the registeredIContentPart
s mapped to their respective content.A read-only property containing the current content objects.Returns aReadOnlyBooleanProperty
that represents the "focused" state of thisIViewer
.ReadOnlyMapProperty<Node,
IVisualPart<? extends Node>> Returns an unmodifiable read-only map property that contains the registeredIVisualPart
s mapped to their respective visual.Properties inherited from interface org.eclipse.gef.common.activate.IActivatable
active
Properties inherited from interface org.eclipse.gef.common.adapt.IAdaptable
adapters
Properties inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
adaptable
-
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
Modifier and TypeFieldDescriptionstatic final String
Name of thecontentPartMapProperty()
.static final String
Name of thecontentsProperty()
.static final String
Name of thevisualPartMapProperty()
.Fields inherited from interface org.eclipse.gef.common.activate.IActivatable
ACTIVE_PROPERTY
Fields inherited from interface org.eclipse.gef.common.adapt.IAdaptable
ADAPTERS_PROPERTY
-
Method Summary
Modifier and TypeMethodDescriptionReadOnlyMapProperty<Object,
IContentPart<? extends Node>> Returns an unmodifiable read-only map property that contains the registeredIContentPart
s mapped to their respective content.A read-only property containing the current content objects.Map<Object,
IContentPart<? extends Node>> Returns theMap
for registeringIContentPart
s by their content.Returns anObservableList
containing the content objects.Returns theIRootPart
of this viewer.Map<Node,
IVisualPart<? extends Node>> Returns theMap
for registeringIVisualPart
s by their visual.boolean
Returns the value of the propertyviewerFocusedProperty()
.void
reveal
(IVisualPart<? extends Node> visualPart) Ensure that the visual of the givenIVisualPart
is visible in this viewer.Returns aReadOnlyBooleanProperty
that represents the "focused" state of thisIViewer
.ReadOnlyMapProperty<Node,
IVisualPart<? extends Node>> Returns an unmodifiable read-only map property that contains the registeredIVisualPart
s mapped to their respective visual.Methods inherited from interface org.eclipse.gef.common.activate.IActivatable
activate, activeProperty, deactivate, isActive
Methods inherited from interface org.eclipse.gef.common.adapt.IAdaptable
adaptersProperty, getAdapter, getAdapter, getAdapter, getAdapterKey, getAdapters, getAdapters, getAdapters, setAdapter, setAdapter, setAdapter, setAdapter, unsetAdapter
Methods inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
adaptableProperty, getAdaptable, setAdaptable
Methods inherited from interface org.eclipse.gef.common.dispose.IDisposable
dispose
-
Property Details
-
contentPartMap
ReadOnlyMapProperty<Object,IContentPart<? extends Node>> contentPartMapPropertyReturns an unmodifiable read-only map property that contains the registeredIContentPart
s mapped to their respective content.- See Also:
-
contents
ReadOnlyListProperty<Object> contentsPropertyA read-only property containing the current content objects.- See Also:
-
viewerFocused
ReadOnlyBooleanProperty viewerFocusedPropertyReturns 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.- See Also:
-
visualPartMap
ReadOnlyMapProperty<Node,IVisualPart<? extends Node>> visualPartMapPropertyReturns an unmodifiable read-only map property that contains the registeredIVisualPart
s mapped to their respective visual.- See Also:
-
-
Field Details
-
CONTENTS_PROPERTY
Name of thecontentsProperty()
.- See Also:
-
CONTENT_PART_MAP_PROPERTY
Name of thecontentPartMapProperty()
.- See Also:
-
VISUAL_PART_MAP_PROPERTY
Name of thevisualPartMapProperty()
.- See Also:
-
-
Method Details
-
contentPartMapProperty
ReadOnlyMapProperty<Object,IContentPart<? extends Node>> contentPartMapProperty()Returns an unmodifiable read-only map property that contains the registeredIContentPart
s mapped to their respective content.- See Also:
-
contentsProperty
ReadOnlyListProperty<Object> contentsProperty()A read-only property containing the current content objects.- See Also:
-
getCanvas
Parent getCanvas() -
getContentPartMap
Map<Object,IContentPart<? extends Node>> getContentPartMap()Returns theMap
for registeringIContentPart
s by their content.- Returns:
- The content part map
-
getContents
ObservableList<Object> getContents()Returns anObservableList
containing the content objects.- Returns:
- An
ObservableList
.
-
getDomain
IDomain getDomain() -
getRootPart
Returns theIRootPart
of this viewer. TheIRootPart
is a specialIVisualPart
that serves as the parent to all containedIContentPart
s,IHandlePart
s, andIFeedbackPart
s.- Returns:
- The
IRootPart
of this viewer.
-
getVisualPartMap
Map<Node,IVisualPart<? extends Node>> getVisualPartMap()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.- Returns:
- The visual-to-visual-part map.
-
isViewerFocused
boolean isViewerFocused()Returns the value of the propertyviewerFocusedProperty()
.- Returns:
- The value of the property
viewerFocusedProperty()
.
-
reveal
Ensure that the visual of the givenIVisualPart
is visible in this viewer.- Parameters:
visualPart
- TheIVisualPart
that is to be revealed.
-
viewerFocusedProperty
ReadOnlyBooleanProperty viewerFocusedProperty()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.- See Also:
-
visualPartMapProperty
ReadOnlyMapProperty<Node,IVisualPart<? extends Node>> visualPartMapProperty()Returns an unmodifiable read-only map property that contains the registeredIVisualPart
s mapped to their respective visual.- See Also:
-