org.gephi.perspective.spi.package.html Maven / Gradle / Ivy
Interfaces for creating new perspectives and perspective members.
Create a new Perspective
- Create a new module and set
Perspective API
,
and Lookup 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 the DesktopPerspective
module and then for instance with preview:
public boolean isMemberOf(Perspective perspective) {
return perspective instanceof PreviewPerspective;
}
- Return the unique
TopComponent
identifier for the getTopComponentId()
method. The identifier is defined in the TopComponent
annotations.
- Add
@ServiceProvider
annotation to your class to be found by
the system, like @ServiceProvider(service = PerspectiveMember.class).