Interface FilterLibrary

  • All Superinterfaces:
    org.openide.util.Lookup.Provider

    public interface FilterLibrary
    extends org.openide.util.Lookup.Provider
    The Filter Library is the place where filter builders are registered and ready to be used. It also has default Categories that filters use to be sorted and well-described.

    Modules can dynamically create new filter builders and serve it ot users by using addBuilder(org.gephi.filters.spi.FilterBuilder).

    Author:
    Mathieu Bastian
    • Field Detail

      • TOPOLOGY

        static final Category TOPOLOGY
        Default Category for topological filters. Use this category for filters working on graph topology, i.e. the structure of nodes and edges.
      • ATTRIBUTES

        static final Category ATTRIBUTES
        Default Category for attributes filters. Use this category for filters working on attribute values.
      • EDGE

        static final Category EDGE
        Default Category for filters working on edges only.
    • Method Detail

      • addBuilder

        void addBuilder​(FilterBuilder builder)
        Adds builder to this library.
        Parameters:
        builder - the builder that is to be added
      • removeBuilder

        void removeBuilder​(FilterBuilder builder)
        Removes builder from this library.
        Parameters:
        builder - the builder that is to be removed
      • getLookup

        org.openide.util.Lookup getLookup()
        Returns this library's lookup. The lookup is a general container for objects and contains:
        • FilterBuilder: Builders, these are building filters.
        • CategoryBuilder: Category builders, these are building. categories, i.e. filters containers.
        • FilterLibraryMask: Masks, for enable/disable categories according to the context.
        • Query: Saved queries, look at FilterController for active queries.
        The lists of all FilterBuilder in the library can be obtained by doing the following command:
         FilterLibrary.getLookup().lookupAll(FilterBuilder.class);
         
        Specified by:
        getLookup in interface org.openide.util.Lookup.Provider
        Returns:
        the lookup container of this library
      • registerMask

        void registerMask​(FilterLibraryMask mask)
        Registers mask as a new FilterLibraryMask. Such masks have categories enable/disable flag. Useful to disable for instance filters for undirected graphs when the current graph is directed.
        Parameters:
        mask - the mask that is to be registered
      • unregisterMask

        void unregisterMask​(FilterLibraryMask mask)
        Unregisters mask in the library. The mask will no longer be used.
        Parameters:
        mask - the mask that is to be unregistered
      • getBuilder

        FilterBuilder getBuilder​(Filter filter)
        Returns the builder that has created filter.
        Parameters:
        filter - the filter that the builder is to be returned
        Returns:
        the builder that has created filter
      • saveQuery

        void saveQuery​(Query query)
        Save query in the library in order it can be reused. Saved queries are saved to the project.
        Parameters:
        query - the query that is to be saved
      • deleteQuery

        void deleteQuery​(Query query)
        Delete a saved query from the library. Deleted queries are deleted from the project.
        Parameters:
        query - the query that is to be deleted