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`

public class InfiniteCanvasViewer extends Object implements IViewer
The `InfiniteCanvasViewer` is an `IViewer` that manages an `InfiniteCanvas` to display the viewer's contents.

## Property Summary

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

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

## Method Summary

Modifier and Type
Method
Description
`final void`
`activate()`
`protected void`
`activateAdapters()`
Activates the adapters registered at this `InfiniteCanvasViewer`.
`final ReadOnlyBooleanProperty`
`activeProperty()`
`ReadOnlyObjectProperty<IDomain>`
`adaptableProperty()`
`ReadOnlyMapProperty<AdapterKey<?>,Object>`
`adaptersProperty()`
`ReadOnlyMapProperty<Object,IContentPart<? extends Node>>`
`contentPartMapProperty()`
Returns an unmodifiable read-only map property that contains the registered `IContentPart`s mapped to their respective content.
`ReadOnlyListProperty<Object>`
`contentsProperty()`
A read-only property containing the current content objects.
`final 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(TypeToken<T> key)`
`<T> T`
`getAdapter(Class<T> classKey)`
`<T> T`
`getAdapter(AdapterKey<T> key)`
`<T> AdapterKey<T>`
`getAdapterKey(T adapter)`
`ObservableMap<AdapterKey<?>,Object>`
`getAdapters()`
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)`
`InfiniteCanvas`
`getCanvas()`
Returns the `InfiniteCanvas` that is managed by this `InfiniteCanvasViewer` .
`Map<Object,IContentPart<? extends Node>>`
`getContentPartMap()`
Returns the `Map` for registering `IContentPart`s by their content.
`ObservableList<Object>`
`getContents()`
Gets the value of the property contents.
`IDomain`
`getDomain()`
Returns the `IDomain` this `IViewer` is bound to.
`IRootPart<? extends Node>`
`getRootPart()`
Returns the `IRootPart` of this viewer.
`Scene`
`getScene()`
Returns the `Scene` in which the `InfiniteCanvas` of this `InfiniteCanvasViewer` is displayed.
`Map<Node,IVisualPart<? extends Node>>`
`getVisualPartMap()`
Returns the `Map` for registering `IVisualPart`s by their visual.
`final boolean`
`isActive()`
Gets the value of the property active.
`boolean`
`isViewerFocused()`
Gets the value of the property viewerFocused.
`void`
`reveal(IVisualPart<? extends 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(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)`
`ReadOnlyBooleanProperty`
`viewerFocusedProperty()`
Returns a `ReadOnlyBooleanProperty` that represents the "focused" state of this `IViewer`.
`ReadOnlyMapProperty<Node,IVisualPart<? extends 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 Details

### active

public final ReadOnlyBooleanProperty activeProperty

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

### adaptable

public ReadOnlyObjectProperty<IDomain> adaptableProperty

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

### adapters

public ReadOnlyMapProperty<AdapterKey<?>,Object> adaptersProperty

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

### contentPartMap

public ReadOnlyMapProperty<Object,IContentPart<? extends Node>> contentPartMapProperty

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

### contents

public ReadOnlyListProperty<Object> contentsProperty

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

### viewerFocused

public ReadOnlyBooleanProperty viewerFocusedProperty

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

### visualPartMap

public ReadOnlyMapProperty<Node,IVisualPart<? extends Node>> visualPartMapProperty

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

## Constructor Details

### InfiniteCanvasViewer

public InfiniteCanvasViewer()
Creates a new `InfiniteCanvasViewer`.

## Method Details

### 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 ReadOnlyBooleanProperty activeProperty()

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

### adaptableProperty

public ReadOnlyObjectProperty<IDomain> adaptableProperty()

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

### adaptersProperty

public ReadOnlyMapProperty<AdapterKey<?>,Object> adaptersProperty()

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

### contentPartMapProperty

public ReadOnlyMapProperty<Object,IContentPart<? extends 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 ReadOnlyListProperty<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>`
Property description:

### getAdapter

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

Specified by:
  `getAdapter` in interface `IAdaptable`

### getAdapter

public <T> T getAdapter(Class<T> classKey)

Specified by:
  `getAdapter` in interface `IAdaptable`

### getAdapter

public <T> T getAdapter(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 ObservableMap<AdapterKey<?>,Object> getAdapters()
Gets the value of the property adapters.

Specified by:
  `getAdapters` in interface `IAdaptable`
Property description:

### getAdapters

public <T> Map<AdapterKey<? extends T>,T> getAdapters(Class<? super T> classKey)

Specified by:
  `getAdapters` in interface `IAdaptable`

### getAdapters

public <T> Map<AdapterKey<? extends T>,T> getAdapters(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 Map<Object,IContentPart<? extends 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 ObservableList<Object> getContents()
Gets the value of the property contents.

Specified by:
  `getContents` in interface `IViewer`
Property description:
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 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 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 Map<Node,IVisualPart<? extends 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`
Property description:

### isViewerFocused

public boolean isViewerFocused()
Gets the value of the property viewerFocused.

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

### reveal

public void reveal(IVisualPart<? extends 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>`
Property description:

### setAdapter

public <T> void setAdapter(T adapter)

Specified by:
  `setAdapter` in interface `IAdaptable`

### setAdapter

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

Specified by:
  `setAdapter` in interface `IAdaptable`

### setAdapter

public <T> void setAdapter(TypeToken<T> adapterType, T adapter)

Specified by:
  `setAdapter` in interface `IAdaptable`

### setAdapter

@InjectAdapters public <T> void setAdapter(TypeToken<T> adapterType, T adapter, String role)

Specified by:
  `setAdapter` in interface `IAdaptable`

### unsetAdapter

public <T> void unsetAdapter(T adapter)

Specified by:
  `unsetAdapter` in interface `IAdaptable`

### viewerFocusedProperty

public 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 ReadOnlyMapProperty<Node,IVisualPart<? extends 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()`