Package org.gephi.perspective.spi
Interfaces for creating new perspectives and perspective members.
Create a new Perspective
-
Create a new module and set
Perspective API
, andLookup API
as dependencies. - Create a new implementation of perspective and fill methods.
-
Add
@ServiceProvider
annotation to your class to be found by the system, like @ServiceProvider(service = Perspective.class, position = 500). - Set the position to define the order of appearance, Overview is 100, Preview is 300.
HowTo attach a TopComponent to a perspective
-
Create a new class which implements the
PerspectiveMember
interface -
Implement the
isMemberOf()
method. Simply test if the given perspective is the one you want to attach the component. For default perspectives, first add a dependency to theDesktopPerspective
module and then for instance with preview:public boolean isMemberOf(Perspective perspective) { return perspective instanceof PreviewPerspective; }
-
Return the unique
TopComponent
identifier for thegetTopComponentId()
method. The identifier is defined in theTopComponent
annotations. -
Add
@ServiceProvider
annotation to your class to be found by the system, like @ServiceProvider(service = PerspectiveMember.class).
-
Interface Summary Interface Description Perspective Define a group of components which are showed in the banner.