Package org.gephi.filters.api
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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addBuilder(FilterBuilder builder)
Addsbuilder
to this library.void
deleteQuery(Query query)
Delete a savedquery
from the library.FilterBuilder
getBuilder(Filter filter)
Returns the builder that has createdfilter
.org.openide.util.Lookup
getLookup()
Returns this library's lookup.void
registerMask(FilterLibraryMask mask)
Registersmask
as a newFilterLibraryMask
.void
removeBuilder(FilterBuilder builder)
Removesbuilder
from this library.void
saveQuery(Query query)
Savequery
in the library in order it can be reused.void
unregisterMask(FilterLibraryMask mask)
Unregistersmask
in the library.
-
-
-
Field Detail
-
TOPOLOGY
static final Category TOPOLOGY
DefaultCategory
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
DefaultCategory
for attributes filters. Use this category for filters working on attribute values.
-
EDGE
static final Category EDGE
DefaultCategory
for filters working on edges only.
-
-
Method Detail
-
addBuilder
void addBuilder(FilterBuilder builder)
Addsbuilder
to this library.- Parameters:
builder
- the builder that is to be added
-
removeBuilder
void removeBuilder(FilterBuilder builder)
Removesbuilder
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 atFilterController
for active queries.
FilterBuilder
in the library can be obtained by doing the following command:FilterLibrary.getLookup().lookupAll(FilterBuilder.class);
- Specified by:
getLookup
in interfaceorg.openide.util.Lookup.Provider
- Returns:
- the lookup container of this library
-
registerMask
void registerMask(FilterLibraryMask mask)
Registersmask
as a newFilterLibraryMask
. 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)
Unregistersmask
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 createdfilter
.- Parameters:
filter
- the filter that the builder is to be returned- Returns:
- the builder that has created
filter
-
saveQuery
void saveQuery(Query query)
Savequery
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 savedquery
from the library. Deleted queries are deleted from the project.- Parameters:
query
- the query that is to be deleted
-
-