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

    public class InfiniteCanvasViewer
    extends java.lang.Object
    implements IViewer

The `InfiniteCanvasViewer` is an `IViewer` that manages an `InfiniteCanvas` to display the viewer's contents.

### Property Summary

All Methods Instance Methods Concrete Methods
`javafx.beans.property.ReadOnlyBooleanProperty` `active`
`javafx.beans.property.ReadOnlyObjectProperty<IDomain>` `adaptable`
`javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object>` `adapters`
`javafx.beans.property.ReadOnlyMapProperty<java.lang.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<java.lang.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.

### 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.mvc.fx.viewer.IViewer

`CONTENT_PART_MAP_PROPERTY, CONTENTS_PROPERTY, VISUAL_PART_MAP_PROPERTY`

### Fields inherited from interface org.eclipse.gef.common.adapt.IAdaptable

`ADAPTERS_PROPERTY`

### Fields inherited from interface org.eclipse.gef.common.activate.IActivatable

`ACTIVE_PROPERTY`

### Constructor Summary

Constructors
Constructor and Description
`InfiniteCanvasViewer()` Creates a new `InfiniteCanvasViewer`.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `activate()`
`protected void` `activateAdapters()` Activates the adapters registered at this `InfiniteCanvasViewer`.
`javafx.beans.property.ReadOnlyBooleanProperty` `activeProperty()`
`javafx.beans.property.ReadOnlyObjectProperty<IDomain>` `adaptableProperty()`
`javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object>` `adaptersProperty()`
`javafx.beans.property.ReadOnlyMapProperty<java.lang.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<java.lang.Object>` `contentsProperty()` A read-only property containing the current content objects.
`void` `deactivate()`
`protected void` `deactivateAdapters()` Deactivates the adapters registered at this `InfiniteCanvasViewer`.
`void` `dispose()`
`protected void` `doActivate()` Activates this `InfiniteCanvasViewer`, which activates its adapters.
`protected void` `doDeactivate()` Deactivates this `InfiniteCanvasViewer`, which deactivates its adapters.
`IDomain` `getAdaptable()` Gets the value of the property adaptable.
`<T> T` `getAdapter(AdapterKey<T> key)`
`<T> T` `getAdapter(java.lang.Class<T> classKey)`
`<T> T` `getAdapter(com.google.common.reflect.TypeToken<T> key)`
`<T> AdapterKey<T>` `getAdapterKey(T adapter)`
`javafx.collections.ObservableMap<AdapterKey<?>,java.lang.Object>` `getAdapters()` Gets the value of the property adapters.
`<T> java.util.Map<AdapterKey<? extends T>,T>` `getAdapters(java.lang.Class<? super T> classKey)`
`<T> java.util.Map<AdapterKey<? extends T>,T>` `getAdapters(com.google.common.reflect.TypeToken<? super T> key)`
`InfiniteCanvas` `getCanvas()` Returns the `InfiniteCanvas` that is managed by this `InfiniteCanvasViewer` .
`java.util.Map<java.lang.Object,IContentPart<? extends javafx.scene.Node>>` `getContentPartMap()` Returns the `Map` for registering `IContentPart`s by their content.
`javafx.collections.ObservableList<java.lang.Object>` `getContents()` Gets the value of the property contents.
`IDomain` `getDomain()` Returns the `IDomain` this `IViewer` is bound to.
`IRootPart<? extends javafx.scene.Node>` `getRootPart()` Returns the `IRootPart` of this viewer.
`javafx.scene.Scene` `getScene()` Returns the `Scene` in which the `InfiniteCanvas` of this `InfiniteCanvasViewer` is displayed.
`java.util.Map<javafx.scene.Node,IVisualPart<? extends javafx.scene.Node>>` `getVisualPartMap()` Returns the `Map` for registering `IVisualPart`s by their visual.
`boolean` `isActive()` Gets the value of the property active.
`boolean` `isViewerFocused()` Gets the value of the property viewerFocused.
`void` `reveal(IVisualPart<? extends javafx.scene.Node> visualPart)` Ensure that the visual of the given `IVisualPart` is visible in this viewer.
`void` `setAdaptable(IDomain domain)` Sets the value of the property adaptable.
`<T> void` `setAdapter(T adapter)`
`<T> void` `setAdapter(T adapter, java.lang.String role)`
`<T> void` `setAdapter(com.google.common.reflect.TypeToken<T> adapterType, T adapter)`
`<T> void` `setAdapter(com.google.common.reflect.TypeToken<T> adapterType, T adapter, java.lang.String role)`
`<T> void` `unsetAdapter(T adapter)`
`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 class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Property Detail

#### active

    public final javafx.beans.property.ReadOnlyBooleanProperty activeProperty

Specified by:
  `activeProperty` in interface `IActivatable`
See Also:
  `isActive()`

#### adaptable

    public javafx.beans.property.ReadOnlyObjectProperty<IDomain> adaptableProperty

Specified by:
  `adaptableProperty` in interface `IAdaptable.Bound<IDomain>`
See Also:
  `getAdaptable()`, `setAdaptable(IDomain)`

#### adapters

    public javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object> adaptersProperty

Specified by:
  `adaptersProperty` in interface `IAdaptable`
See Also:
  `getAdapters()`

#### contentPartMap

    public javafx.beans.property.ReadOnlyMapProperty<java.lang.Object,IContentPart<? extends javafx.scene.Node>> contentPartMapProperty

Specified by:
  `contentPartMapProperty` in interface `IViewer`
Returns:
  An unmodifiable read-only map property.
See Also:
  `getContentPartMap()`

#### contents

    public javafx.beans.property.ReadOnlyListProperty<java.lang.Object> contentsProperty

Specified by:
  `contentsProperty` in interface `IViewer`
Returns:
  A read-only list property named `IViewer.CONTENTS_PROPERTY`.
See Also:
  `getContents()`

#### viewerFocused

    public javafx.beans.property.ReadOnlyBooleanProperty viewerFocusedProperty

Specified by:
  `viewerFocusedProperty` in interface `IViewer`
Returns:
  A `ReadOnlyBooleanProperty` that represents the "focused" state of this `IViewer`.
See Also:
  `isViewerFocused()`

#### visualPartMap

    public javafx.beans.property.ReadOnlyMapProperty<javafx.scene.Node,IVisualPart<? extends javafx.scene.Node>> visualPartMapProperty

Specified by:
  `visualPartMapProperty` in interface `IViewer`
Returns:
  An unmodifiable read-only map property.
See Also:
  `getVisualPartMap()`

### Constructor Detail

#### InfiniteCanvasViewer

    public InfiniteCanvasViewer()

Creates a new `InfiniteCanvasViewer`.

### Method Detail

#### activate

    public final void activate()

Specified by:
  `activate` in interface `IActivatable`

#### activateAdapters

    protected void activateAdapters()

Activates the adapters registered at this `InfiniteCanvasViewer`.

#### activeProperty

    public final javafx.beans.property.ReadOnlyBooleanProperty activeProperty()

Specified by:
  `activeProperty` in interface `IActivatable`
See Also:
  `isActive()`

#### adaptableProperty

    public javafx.beans.property.ReadOnlyObjectProperty<IDomain> adaptableProperty()

Specified by:
  `adaptableProperty` in interface `IAdaptable.Bound<IDomain>`
See Also:
  `getAdaptable()`, `setAdaptable(IDomain)`

#### adaptersProperty

    public javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object> adaptersProperty()

Specified by:
  `adaptersProperty` in interface `IAdaptable`
See Also:
  `getAdapters()`

#### contentPartMapProperty

    public javafx.beans.property.ReadOnlyMapProperty<java.lang.Object,IContentPart<? extends javafx.scene.Node>> contentPartMapProperty()

Description copied from interface: `IViewer`
Returns an unmodifiable read-only map property that contains the registered `IContentPart`s mapped to their respective content.

Specified by:
  `contentPartMapProperty` in interface `IViewer`
Returns:
  An unmodifiable read-only map property.
See Also:
  `getContentPartMap()`

#### contentsProperty

    public javafx.beans.property.ReadOnlyListProperty<java.lang.Object> contentsProperty()

Description copied from interface: `IViewer`
A read-only property containing the current content objects.

Specified by:
  `contentsProperty` in interface `IViewer`
Returns:
  A read-only list property named `IViewer.CONTENTS_PROPERTY`.
See Also:
  `getContents()`

#### deactivate

    public final void deactivate()

Specified by:
  `deactivate` in interface `IActivatable`

#### deactivateAdapters

    protected void deactivateAdapters()

Deactivates the adapters registered at this `InfiniteCanvasViewer`.

#### dispose

    public void dispose()

Specified by:
  `dispose` in interface `IDisposable`

#### doActivate

    protected void doActivate()

Activates this `InfiniteCanvasViewer`, which activates its adapters.

#### doDeactivate

    protected void doDeactivate()

Deactivates this `InfiniteCanvasViewer`, which deactivates its adapters.

#### getAdaptable

    public IDomain getAdaptable()

Gets the value of the property adaptable.

Specified by:
  `getAdaptable` in interface `IAdaptable.Bound<IDomain>`

#### getAdapter

    public <T> T getAdapter(AdapterKey<T> key)

Specified by:
  `getAdapter` in interface `IAdaptable`

#### getAdapter

    public <T> T getAdapter(java.lang.Class<T> classKey)

Specified by:
  `getAdapter` in interface `IAdaptable`

#### getAdapter

    public <T> T getAdapter(com.google.common.reflect.TypeToken<T> key)

Specified by:
  `getAdapter` in interface `IAdaptable`

#### getAdapterKey

    public <T> AdapterKey<T> getAdapterKey(T adapter)

Specified by:
  `getAdapterKey` in interface `IAdaptable`

#### getAdapters

    public javafx.collections.ObservableMap<AdapterKey<?>,java.lang.Object> getAdapters()

Gets the value of the property adapters.

Specified by:
  `getAdapters` in interface `IAdaptable`

#### getAdapters

    public <T> java.util.Map<AdapterKey<? extends T>,T> getAdapters(java.lang.Class<? super T> classKey)

Specified by:
  `getAdapters` in interface `IAdaptable`

#### getAdapters

    public <T> java.util.Map<AdapterKey<? extends T>,T> getAdapters(com.google.common.reflect.TypeToken<? super T> key)

Specified by:
  `getAdapters` in interface `IAdaptable`

#### getCanvas

    public InfiniteCanvas getCanvas()

Returns the `InfiniteCanvas` that is managed by this `InfiniteCanvasViewer` .

Specified by:
  `getCanvas` in interface `IViewer`
Returns:
  The `InfiniteCanvas` that is managed by this `InfiniteCanvasViewer` .

#### getContentPartMap

    public java.util.Map<java.lang.Object,IContentPart<? extends javafx.scene.Node>> getContentPartMap()

Description copied from interface: `IViewer`
Returns the `Map` for registering `IContentPart`s by their content.

Specified by:
  `getContentPartMap` in interface `IViewer`
Returns:
  The content part map
See Also:
  `IViewer.getContentPartMap()`

#### getContents

    public javafx.collections.ObservableList<java.lang.Object> getContents()

Gets the value of the property contents.

Specified by:
  `getContents` in interface `IViewer`
Returns:
  An `ObservableList`.

#### getDomain

    public IDomain getDomain()

Description copied from interface: `IViewer`
Returns the `IDomain` this `IViewer` is bound to.

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

#### getRootPart

    public IRootPart<? extends javafx.scene.Node> getRootPart()

Description copied from interface: `IViewer`
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.

Specified by:
  `getRootPart` in interface `IViewer`
Returns:
  The `IRootPart` of this viewer.

#### getScene

    public javafx.scene.Scene getScene()

Returns the `Scene` in which the `InfiniteCanvas` of this `InfiniteCanvasViewer` is displayed.

Returns:
  The `Scene` in which the `InfiniteCanvas` of this `InfiniteCanvasViewer` is displayed.

#### getVisualPartMap

    public java.util.Map<javafx.scene.Node,IVisualPart<? extends javafx.scene.Node>> getVisualPartMap()

Description copied from interface: `IViewer`
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.

Specified by:
  `getVisualPartMap` in interface `IViewer`
Returns:
  The visual-to-visual-part map.
See Also:
  `IViewer.getVisualPartMap()`

#### isActive

    public final boolean isActive()

Gets the value of the property active.

Specified by:
  `isActive` in interface `IActivatable`

#### isViewerFocused

    public boolean isViewerFocused()

Gets the value of the property viewerFocused.

Specified by:
  `isViewerFocused` in interface `IViewer`
Returns:
  The value of the property `IViewer.viewerFocusedProperty()`.

#### reveal

    public void reveal(IVisualPart<? extends javafx.scene.Node> visualPart)

Description copied from interface: `IViewer`
Ensure that the visual of the given `IVisualPart` is visible in this viewer.

Specified by:
  `reveal` in interface `IViewer`
Parameters:
  `visualPart` - The `IVisualPart` that is to be revealed.

#### setAdaptable

    public void setAdaptable(IDomain domain)

Sets the value of the property adaptable.

Specified by:
  `setAdaptable` in interface `IAdaptable.Bound<IDomain>`

#### setAdapter

    public <T> void setAdapter(T adapter)

Specified by:
  `setAdapter` in interface `IAdaptable`

#### setAdapter

    public <T> void setAdapter(T adapter,
                               java.lang.String role)

Specified by:
  `setAdapter` in interface `IAdaptable`

#### setAdapter

    public <T> void setAdapter(com.google.common.reflect.TypeToken<T> adapterType,
                               T adapter)

Specified by:
  `setAdapter` in interface `IAdaptable`

#### setAdapter

    @InjectAdapters
    public <T> void setAdapter(com.google.common.reflect.TypeToken<T> adapterType,
                                               T adapter,
                                               java.lang.String role)

Specified by:
  `setAdapter` in interface `IAdaptable`

#### unsetAdapter

    public <T> void unsetAdapter(T adapter)

Specified by:
  `unsetAdapter` in interface `IAdaptable`

#### viewerFocusedProperty

    public javafx.beans.property.ReadOnlyBooleanProperty viewerFocusedProperty()

Description copied from interface: `IViewer`
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.

Specified by:
  `viewerFocusedProperty` in interface `IViewer`
Returns:
  A `ReadOnlyBooleanProperty` that represents the "focused" state of this `IViewer`.
See Also:
  `isViewerFocused()`

#### 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 registered `IVisualPart`s mapped to their respective visual.

Specified by:
  `visualPartMapProperty` in interface `IViewer`
Returns:
  An unmodifiable read-only map property.
See Also:
  `getVisualPartMap()`