use of org.cytoscape.filter.internal.filters.composite.CompositeFilterPanel in project cytoscape-impl by cytoscape.
the class AbstractPanelController method removeOrphans.
private void removeOrphans(CompositeFilterPanel<V> panel) {
CompositeFilter<CyNetwork, CyIdentifiable> model = panel.getModel();
if (model.getLength() > 0) {
return;
}
Container parent = panel.getParent();
if (!(parent instanceof CompositeFilterPanel)) {
return;
}
@SuppressWarnings("unchecked") CompositeFilterPanel<V> parentPanel = (CompositeFilterPanel<V>) parent;
CompositeFilter<CyNetwork, CyIdentifiable> parentModel = parentPanel.getModel();
for (int index = 0; index < parentModel.getLength(); index++) {
Filter<CyNetwork, CyIdentifiable> filter = parentModel.get(index);
if (model == filter) {
parentPanel.removeTransformer(index, true);
removeOrphans(parentPanel);
return;
}
}
}
use of org.cytoscape.filter.internal.filters.composite.CompositeFilterPanel in project cytoscape-impl by cytoscape.
the class TransformerPanelController method createView.
@Override
public JComponent createView(TransformerPanel parent, Transformer<CyNetwork, CyIdentifiable> transformer, int depth) {
// CompositeFilterImpl needs a CompositeFilterPanel but the top is blank so view will be null
JComponent view = transformerViewManager.createView(transformer);
if (transformer instanceof SubFilterTransformer || transformer instanceof CompositeFilter) {
String addButtonTT = transformerViewManager.getAddButtonTooltip(transformer);
CompositeFilterController controller = CompositeFilterController.createFor(view, addButtonTT);
CompositeFilter<CyNetwork, CyIdentifiable> compositeFilter;
if (transformer instanceof SubFilterTransformer)
compositeFilter = ((SubFilterTransformer<CyNetwork, CyIdentifiable>) transformer).getCompositeFilter();
else
compositeFilter = (CompositeFilter<CyNetwork, CyIdentifiable>) transformer;
return new CompositeFilterPanel<TransformerPanel>(parent, this, controller, compositeFilter, depth);
}
if (view == null)
throw new IllegalArgumentException("view could not be created for: " + transformer.getId());
return view;
}
use of org.cytoscape.filter.internal.filters.composite.CompositeFilterPanel in project cytoscape-impl by cytoscape.
the class FilterPanelController method createView.
@Override
public JComponent createView(FilterPanel parent, Transformer<CyNetwork, CyIdentifiable> filter, int depth) {
// CompositeFilterImpl needs a CompositeFilterPanel but the top is blank so view will be null
JComponent view = transformerViewManager.createView(filter);
if (view instanceof InteractivityChangedListener) {
((InteractivityChangedListener) view).handleInteractivityChanged(isInteractive);
}
if (filter instanceof CompositeFilter) {
String addButtonTT = transformerViewManager.getAddButtonTooltip(filter);
CompositeFilterController controller = CompositeFilterController.createFor(view, addButtonTT);
return new CompositeFilterPanel<FilterPanel>(parent, this, controller, (CompositeFilter<CyNetwork, CyIdentifiable>) filter, depth);
}
if (view == null)
throw new IllegalArgumentException("view could not be created for: " + filter.getId());
return view;
}
Aggregations