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 java.lang.Object implements IViewer
TheInfiniteCanvasVieweris anIViewerthat manages anInfiniteCanvasto display the viewer's contents.
-
-
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 newInfiniteCanvasViewer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()protected voidactivateAdapters()Activates the adapters registered at thisInfiniteCanvasViewer.javafx.beans.property.ReadOnlyBooleanPropertyactiveProperty()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 registeredIContentParts mapped to their respective content.javafx.beans.property.ReadOnlyListProperty<java.lang.Object>contentsProperty()A read-only property containing the current content objects.voiddeactivate()protected voiddeactivateAdapters()Deactivates the adapters registered at thisInfiniteCanvasViewer.voiddispose()protected voiddoActivate()Activates thisInfiniteCanvasViewer, which activates its adapters.protected voiddoDeactivate()Deactivates thisInfiniteCanvasViewer, which deactivates its adapters.IDomaingetAdaptable()<T> TgetAdapter(TypeToken<T> key)<T> TgetAdapter(java.lang.Class<T> classKey)<T> TgetAdapter(AdapterKey<T> key)<T> AdapterKey<T>getAdapterKey(T adapter)javafx.collections.ObservableMap<AdapterKey<?>,java.lang.Object>getAdapters()<T> java.util.Map<AdapterKey<? extends T>,T>getAdapters(TypeToken<? super T> key)<T> java.util.Map<AdapterKey<? extends T>,T>getAdapters(java.lang.Class<? super T> classKey)InfiniteCanvasgetCanvas()Returns theInfiniteCanvasthat is managed by thisInfiniteCanvasViewer.java.util.Map<java.lang.Object,IContentPart<? extends javafx.scene.Node>>getContentPartMap()Returns theMapfor registeringIContentParts by their content.javafx.collections.ObservableList<java.lang.Object>getContents()Returns anObservableListcontaining the content objects.IDomaingetDomain()IRootPart<? extends javafx.scene.Node>getRootPart()Returns theIRootPartof this viewer.javafx.scene.ScenegetScene()java.util.Map<javafx.scene.Node,IVisualPart<? extends javafx.scene.Node>>getVisualPartMap()Returns theMapfor registeringIVisualParts by their visual.booleanisActive()booleanisViewerFocused()Returns the value of the propertyIViewer.viewerFocusedProperty().voidreveal(IVisualPart<? extends javafx.scene.Node> visualPart)Ensure that the visual of the givenIVisualPartis visible in this viewer.voidsetAdaptable(IDomain domain)<T> voidsetAdapter(TypeToken<T> adapterType, T adapter)<T> voidsetAdapter(TypeToken<T> adapterType, T adapter, java.lang.String role)<T> voidsetAdapter(T adapter)<T> voidsetAdapter(T adapter, java.lang.String role)<T> voidunsetAdapter(T adapter)javafx.beans.property.ReadOnlyBooleanPropertyviewerFocusedProperty()Returns aReadOnlyBooleanPropertythat represents the "focused" state of thisIViewer.javafx.beans.property.ReadOnlyMapProperty<javafx.scene.Node,IVisualPart<? extends javafx.scene.Node>>visualPartMapProperty()Returns an unmodifiable read-only map property that contains the registeredIVisualParts mapped to their respective visual.
-
-
-
Constructor Detail
-
InfiniteCanvasViewer
public InfiniteCanvasViewer()
Creates a newInfiniteCanvasViewer.
-
-
Method Detail
-
activate
public final void activate()
- Specified by:
activatein interfaceIActivatable
-
activateAdapters
protected void activateAdapters()
Activates the adapters registered at thisInfiniteCanvasViewer.
-
activeProperty
public final javafx.beans.property.ReadOnlyBooleanProperty activeProperty()
- Specified by:
activePropertyin interfaceIActivatable
-
adaptableProperty
public javafx.beans.property.ReadOnlyObjectProperty<IDomain> adaptableProperty()
- Specified by:
adaptablePropertyin interfaceIAdaptable.Bound<IDomain>
-
adaptersProperty
public javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object> adaptersProperty()
- Specified by:
adaptersPropertyin interfaceIAdaptable
-
contentPartMapProperty
public javafx.beans.property.ReadOnlyMapProperty<java.lang.Object,IContentPart<? extends javafx.scene.Node>> contentPartMapProperty()
Description copied from interface:IViewerReturns an unmodifiable read-only map property that contains the registeredIContentParts mapped to their respective content.- Specified by:
contentPartMapPropertyin interfaceIViewer- Returns:
- An unmodifiable read-only map property.
-
contentsProperty
public javafx.beans.property.ReadOnlyListProperty<java.lang.Object> contentsProperty()
Description copied from interface:IViewerA read-only property containing the current content objects.- Specified by:
contentsPropertyin interfaceIViewer- Returns:
- A read-only list property named
IViewer.CONTENTS_PROPERTY.
-
deactivate
public final void deactivate()
- Specified by:
deactivatein interfaceIActivatable
-
deactivateAdapters
protected void deactivateAdapters()
Deactivates the adapters registered at thisInfiniteCanvasViewer.
-
dispose
public void dispose()
- Specified by:
disposein interfaceIDisposable
-
doActivate
protected void doActivate()
Activates thisInfiniteCanvasViewer, which activates its adapters.
-
doDeactivate
protected void doDeactivate()
Deactivates thisInfiniteCanvasViewer, which deactivates its adapters.
-
getAdaptable
public IDomain getAdaptable()
- Specified by:
getAdaptablein interfaceIAdaptable.Bound<IDomain>
-
getAdapter
public <T> T getAdapter(AdapterKey<T> key)
- Specified by:
getAdapterin interfaceIAdaptable
-
getAdapter
public <T> T getAdapter(java.lang.Class<T> classKey)
- Specified by:
getAdapterin interfaceIAdaptable
-
getAdapter
public <T> T getAdapter(TypeToken<T> key)
- Specified by:
getAdapterin interfaceIAdaptable
-
getAdapterKey
public <T> AdapterKey<T> getAdapterKey(T adapter)
- Specified by:
getAdapterKeyin interfaceIAdaptable
-
getAdapters
public javafx.collections.ObservableMap<AdapterKey<?>,java.lang.Object> getAdapters()
- Specified by:
getAdaptersin interfaceIAdaptable
-
getAdapters
public <T> java.util.Map<AdapterKey<? extends T>,T> getAdapters(java.lang.Class<? super T> classKey)
- Specified by:
getAdaptersin interfaceIAdaptable
-
getAdapters
public <T> java.util.Map<AdapterKey<? extends T>,T> getAdapters(TypeToken<? super T> key)
- Specified by:
getAdaptersin interfaceIAdaptable
-
getCanvas
public InfiniteCanvas getCanvas()
Returns theInfiniteCanvasthat is managed by thisInfiniteCanvasViewer.- Specified by:
getCanvasin interfaceIViewer- Returns:
- The
InfiniteCanvasthat is managed by thisInfiniteCanvasViewer.
-
getContentPartMap
public java.util.Map<java.lang.Object,IContentPart<? extends javafx.scene.Node>> getContentPartMap()
Description copied from interface:IViewerReturns theMapfor registeringIContentParts by their content.- Specified by:
getContentPartMapin interfaceIViewer- Returns:
- The content part map
- See Also:
IViewer.getContentPartMap()
-
getContents
public javafx.collections.ObservableList<java.lang.Object> getContents()
Description copied from interface:IViewerReturns anObservableListcontaining the content objects.- Specified by:
getContentsin interfaceIViewer- Returns:
- An
ObservableList.
-
getRootPart
public IRootPart<? extends javafx.scene.Node> getRootPart()
Description copied from interface:IViewerReturns theIRootPartof this viewer. TheIRootPartis a specialIVisualPartthat serves as the parent to all containedIContentParts,IHandleParts, andIFeedbackParts.- Specified by:
getRootPartin interfaceIViewer- Returns:
- The
IRootPartof this viewer.
-
getScene
public javafx.scene.Scene getScene()
- Returns:
- The
Scenein which theInfiniteCanvasof thisInfiniteCanvasVieweris displayed.
-
getVisualPartMap
public java.util.Map<javafx.scene.Node,IVisualPart<? extends javafx.scene.Node>> getVisualPartMap()
Description copied from interface:IViewerReturns theMapfor registeringIVisualParts 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
IVisualPartfor a given visual in the map, it is required to walk up the visual hierarchy until a registered visual is found, because anIVisualPartonly 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:
getVisualPartMapin interfaceIViewer- Returns:
- The visual-to-visual-part map.
- See Also:
IViewer.getVisualPartMap()
-
isActive
public final boolean isActive()
- Specified by:
isActivein interfaceIActivatable
-
isViewerFocused
public boolean isViewerFocused()
Description copied from interface:IViewerReturns the value of the propertyIViewer.viewerFocusedProperty().- Specified by:
isViewerFocusedin interfaceIViewer- Returns:
- The value of the property
IViewer.viewerFocusedProperty().
-
reveal
public void reveal(IVisualPart<? extends javafx.scene.Node> visualPart)
Description copied from interface:IViewerEnsure that the visual of the givenIVisualPartis visible in this viewer.- Specified by:
revealin interfaceIViewer- Parameters:
visualPart- TheIVisualPartthat is to be revealed.
-
setAdaptable
public void setAdaptable(IDomain domain)
- Specified by:
setAdaptablein interfaceIAdaptable.Bound<IDomain>
-
setAdapter
public <T> void setAdapter(T adapter)
- Specified by:
setAdapterin interfaceIAdaptable
-
setAdapter
public <T> void setAdapter(T adapter, java.lang.String role)- Specified by:
setAdapterin interfaceIAdaptable
-
setAdapter
public <T> void setAdapter(TypeToken<T> adapterType, T adapter)
- Specified by:
setAdapterin interfaceIAdaptable
-
setAdapter
@InjectAdapters public <T> void setAdapter(TypeToken<T> adapterType, T adapter, java.lang.String role)
- Specified by:
setAdapterin interfaceIAdaptable
-
unsetAdapter
public <T> void unsetAdapter(T adapter)
- Specified by:
unsetAdapterin interfaceIAdaptable
-
viewerFocusedProperty
public javafx.beans.property.ReadOnlyBooleanProperty viewerFocusedProperty()
Description copied from interface:IViewerReturns aReadOnlyBooleanPropertythat represents the "focused" state of thisIViewer. AnIVieweris 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:
viewerFocusedPropertyin interfaceIViewer- Returns:
- A
ReadOnlyBooleanPropertythat represents the "focused" state of thisIViewer.
-
visualPartMapProperty
public javafx.beans.property.ReadOnlyMapProperty<javafx.scene.Node,IVisualPart<? extends javafx.scene.Node>> visualPartMapProperty()
Description copied from interface:IViewerReturns an unmodifiable read-only map property that contains the registeredIVisualParts mapped to their respective visual.- Specified by:
visualPartMapPropertyin interfaceIViewer- Returns:
- An unmodifiable read-only map property.
-
-