Package org.eclipse.gef.mvc.fx.viewer

# Interface IViewer

All Superinterfaces:
  `IActivatable`, `IAdaptable`, `IAdaptable.Bound<IDomain>`, `IDisposable`

All Known Implementing Classes:
  `InfiniteCanvasViewer`

public interface IViewer extends IAdaptable, IActivatable, IDisposable, IAdaptable.Bound<IDomain>
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

Properties
Type
Property
Description
`javafx.beans.property.ReadOnlyMapProperty<Object,IContentPart<? extends javafx.scene.Node>>`
`contentPartMap`
Returns an unmodifiable read-only map property that contains the registered `IContentPart`s mapped to their respective content.
`javafx.beans.property.ReadOnlyListProperty<Object>`
`contents`
A read-only property containing the current content objects.
`javafx.beans.property.ReadOnlyBooleanProperty`
`viewerFocused`
Returns a `ReadOnlyBooleanProperty` that represents the "focused" state of this `IViewer`.
`javafx.beans.property.ReadOnlyMapProperty<javafx.scene.Node,IVisualPart<? extends javafx.scene.Node>>`
`visualPartMap`
Returns an unmodifiable read-only map property that contains the registered `IVisualPart`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

Fields
Modifier and Type
Field
Description
`static final String`
`CONTENT_PART_MAP_PROPERTY`
Name of the `contentPartMapProperty()`.
`static final String`
`CONTENTS_PROPERTY`
Name of the `contentsProperty()`.
`static final String`
`VISUAL_PART_MAP_PROPERTY`
Name of the `visualPartMapProperty()`.

### 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 Type
Method
Description
`javafx.beans.property.ReadOnlyMapProperty<Object,IContentPart<? extends javafx.scene.Node>>`
`contentPartMapProperty()`
Returns an unmodifiable read-only map property that contains the registered `IContentPart`s mapped to their respective content.
`javafx.beans.property.ReadOnlyListProperty<Object>`
`contentsProperty()`
A read-only property containing the current content objects.
`javafx.scene.Parent`
`getCanvas()`
Returns the `Parent` that displays the visuals of this `viewer's` `parts`
`Map<Object,IContentPart<? extends javafx.scene.Node>>`
`getContentPartMap()`
Returns the `Map` for registering `IContentPart`s by their content.
`javafx.collections.ObservableList<Object>`
`getContents()`
Returns an `ObservableList` containing the content objects.
`IDomain`
`getDomain()`
Returns the `IDomain` this `IViewer` is bound to.
`IRootPart<? extends javafx.scene.Node>`
`getRootPart()`
Returns the `IRootPart` of this viewer.
`Map<javafx.scene.Node,IVisualPart<? extends javafx.scene.Node>>`
`getVisualPartMap()`
Returns the `Map` for registering `IVisualPart`s by their visual.
`boolean`
`isViewerFocused()`
Returns the value of the property `viewerFocusedProperty()`.
`void`
`reveal(IVisualPart<? extends javafx.scene.Node> visualPart)`
Ensure that the visual of the given `IVisualPart` is visible in this viewer.
`javafx.beans.property.ReadOnlyBooleanProperty`
`viewerFocusedProperty()`
Returns a `ReadOnlyBooleanProperty` that represents the "focused" state of this `IViewer`.
`javafx.beans.property.ReadOnlyMapProperty<javafx.scene.Node,IVisualPart<? extends javafx.scene.Node>>`
`visualPartMapProperty()`
Returns an unmodifiable read-only map property that contains the registered `IVisualPart`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

javafx.beans.property.ReadOnlyMapProperty<Object,IContentPart<? extends javafx.scene.Node>> contentPartMapProperty
Returns an unmodifiable read-only map property that contains the registered `IContentPart`s mapped to their respective content.

See Also:
  - `getContentPartMap()`

### contents

javafx.beans.property.ReadOnlyListProperty<Object> contentsProperty
A read-only property containing the current content objects.

See Also:
  - `getContents()`

### viewerFocused

javafx.beans.property.ReadOnlyBooleanProperty viewerFocusedProperty
Returns a `ReadOnlyBooleanProperty` that represents the "focused" state of this `IViewer`. An `IViewer` 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:
  - `isViewerFocused()`

### visualPartMap

javafx.beans.property.ReadOnlyMapProperty<javafx.scene.Node,IVisualPart<? extends javafx.scene.Node>> visualPartMapProperty
Returns an unmodifiable read-only map property that contains the registered `IVisualPart`s mapped to their respective visual.

See Also:
  - `getVisualPartMap()`

## Field Details

### CONTENTS_PROPERTY

static final String CONTENTS_PROPERTY
Name of the `contentsProperty()`.

See Also:
  - Constant Field Values

### CONTENT_PART_MAP_PROPERTY

static final String CONTENT_PART_MAP_PROPERTY
Name of the `contentPartMapProperty()`.

See Also:
  - Constant Field Values

### VISUAL_PART_MAP_PROPERTY

static final String VISUAL_PART_MAP_PROPERTY
Name of the `visualPartMapProperty()`.

See Also:
  - Constant Field Values

## Method Details

### contentPartMapProperty

javafx.beans.property.ReadOnlyMapProperty<Object,IContentPart<? extends javafx.scene.Node>> contentPartMapProperty()
Returns an unmodifiable read-only map property that contains the registered `IContentPart`s mapped to their respective content.

See Also:
  - `getContentPartMap()`

### contentsProperty

javafx.beans.property.ReadOnlyListProperty<Object> contentsProperty()
A read-only property containing the current content objects.

See Also:
  - `getContents()`

### getCanvas

javafx.scene.Parent getCanvas()
Returns the `Parent` that displays the visuals of this `viewer's` `parts`

Returns:
  The `Parent` that displays the visuals of the `viewer's` `parts`.

### getContentPartMap

Map<Object,IContentPart<? extends javafx.scene.Node>> getContentPartMap()
Returns the `Map` for registering `IContentPart`s by their content.

Returns:
  The content part map

### getContents

javafx.collections.ObservableList<Object> getContents()
Returns an `ObservableList` containing the content objects.

Returns:
  An `ObservableList`.

### getDomain

IDomain getDomain()
Returns the `IDomain` this `IViewer` is bound to.

Returns:
  The `IDomain` this `IViewer` is bound to, or `null` if this `IViewer` is not (yet) bound to an `IDomain`.

### getRootPart

IRootPart<? extends javafx.scene.Node> getRootPart()
Returns the `IRootPart` of this viewer. The `IRootPart` is a special `IVisualPart` that serves as the parent to all contained `IContentPart`s, `IHandlePart`s, and `IFeedbackPart`s.

Returns:
  The `IRootPart` of this viewer.

### getVisualPartMap

Map<javafx.scene.Node,IVisualPart<? extends javafx.scene.Node>> getVisualPartMap()
Returns the `Map` for registering `IVisualPart`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 an `IVisualPart`.

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 an `IVisualPart` only has to register its "main" visual (i.e. the one returned by `IVisualPart.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 property `viewerFocusedProperty()`.

Returns:
  The value of the property `viewerFocusedProperty()`.

### reveal

void reveal(IVisualPart<? extends javafx.scene.Node> visualPart)
Ensure that the visual of the given `IVisualPart` is visible in this viewer.

Parameters:
  `visualPart` - The `IVisualPart` that is to be revealed.

### viewerFocusedProperty

javafx.beans.property.ReadOnlyBooleanProperty viewerFocusedProperty()
Returns a `ReadOnlyBooleanProperty` that represents the "focused" state of this `IViewer`. An `IViewer` 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:
  - `isViewerFocused()`

### visualPartMapProperty

javafx.beans.property.ReadOnlyMapProperty<javafx.scene.Node,IVisualPart<? extends javafx.scene.Node>> visualPartMapProperty()
Returns an unmodifiable read-only map property that contains the registered `IVisualPart`s mapped to their respective visual.

See Also:
  - `getVisualPartMap()`