Skip navigation links

Package org.gephi.perspective.spi

Interfaces for creating new perspectives and perspective members.

See: Description

Package org.gephi.perspective.spi Description

Interfaces for creating new perspectives and perspective members.

Create a new Perspective

  1. Create a new module and set Perspective API, and Lookup API as dependencies.
  2. Create a new implementation of perspective and fill methods.
  3. Add @ServiceProvider annotation to your class to be found by the system, like @ServiceProvider(service = Perspective.class, position = 500).
  4. Set the position to define the order of appearance, Overview is 100, Preview is 300.

HowTo attach a TopComponent to a perspective

  1. Create a new class which implements the PerspectiveMember interface
  2. 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;
    }
                    
  3. Return the unique TopComponent identifier for the getTopComponentId() method. The identifier is defined in the TopComponent annotations.
  4. Add @ServiceProvider annotation to your class to be found by the system, like @ServiceProvider(service = PerspectiveMember.class).
Skip navigation links

Copyright © 2007–2017 Gephi Consortium. All rights reserved.