use of org.gephi.filters.api.FilterModel in project gephi by gephi.
the class FiltersPanel method stateChanged.
@Override
public void stateChanged(ChangeEvent e) {
if (e.getSource() instanceof FilterUIModel) {
if (uiModel.getSelectedQuery() != null && stopButton.isVisible()) {
FilterController controller = Lookup.getDefault().lookup(FilterController.class);
controller.filterVisible(uiModel.getSelectedRoot());
} else if (uiModel.getSelectedQuery() != null && selectButton.isSelected()) {
FilterController controller = Lookup.getDefault().lookup(FilterController.class);
controller.selectVisible(uiModel.getSelectedRoot());
}
} else if (e.getSource() instanceof FilterModel) {
if (uiModel.getSelectedQuery() != null && filterModel.getCurrentQuery() == null) {
//Remove case
if (!Arrays.asList(filterModel.getQueries()).contains(uiModel.getSelectedRoot())) {
uiModel.setSelectedQuery(null);
}
} else if (filterModel.getCurrentQuery() != null && filterModel.getCurrentQuery() != uiModel.getSelectedQuery() && filterModel.getCurrentQuery() != uiModel.getSelectedRoot()) {
uiModel.setSelectedQuery(filterModel.getCurrentQuery());
}
}
updateControls();
updateEnabled(true);
}
use of org.gephi.filters.api.FilterModel in project gephi by gephi.
the class FilterControllerImpl method getModel.
@Override
public synchronized FilterModel getModel(Workspace workspace) {
FilterModel filterModel = workspace.getLookup().lookup(FilterModel.class);
if (filterModel == null) {
filterModel = new FilterModelImpl(workspace);
workspace.add(filterModel);
}
return filterModel;
}
use of org.gephi.filters.api.FilterModel in project gephi by gephi.
the class QueryNode method isSelected.
private boolean isSelected() {
FilterController fc = Lookup.getDefault().lookup(FilterController.class);
FilterModel fm = fc.getModel();
return (fm.isFiltering() || fm.isSelecting()) && fc.getModel().getCurrentQuery() == query;
//return FiltersTopComponent.findInstance().getUiModel().getSelectedRoot() == query;
}
Aggregations