Search in sources :

Example 1 with CompositeFilterController

use of org.cytoscape.filter.internal.filters.composite.CompositeFilterController 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;
}
Also used : CompositeFilter(org.cytoscape.filter.model.CompositeFilter) JComponent(javax.swing.JComponent) CyNetwork(org.cytoscape.model.CyNetwork) CompositeFilterController(org.cytoscape.filter.internal.filters.composite.CompositeFilterController) CompositeFilterPanel(org.cytoscape.filter.internal.filters.composite.CompositeFilterPanel) SubFilterTransformer(org.cytoscape.filter.model.SubFilterTransformer) CyIdentifiable(org.cytoscape.model.CyIdentifiable)

Example 2 with CompositeFilterController

use of org.cytoscape.filter.internal.filters.composite.CompositeFilterController 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;
}
Also used : CompositeFilter(org.cytoscape.filter.model.CompositeFilter) JComponent(javax.swing.JComponent) CyNetwork(org.cytoscape.model.CyNetwork) InteractivityChangedListener(org.cytoscape.filter.view.InteractivityChangedListener) CompositeFilterController(org.cytoscape.filter.internal.filters.composite.CompositeFilterController) CompositeFilterPanel(org.cytoscape.filter.internal.filters.composite.CompositeFilterPanel) CyIdentifiable(org.cytoscape.model.CyIdentifiable)

Aggregations

JComponent (javax.swing.JComponent)2 CompositeFilterController (org.cytoscape.filter.internal.filters.composite.CompositeFilterController)2 CompositeFilterPanel (org.cytoscape.filter.internal.filters.composite.CompositeFilterPanel)2 CompositeFilter (org.cytoscape.filter.model.CompositeFilter)2 CyIdentifiable (org.cytoscape.model.CyIdentifiable)2 CyNetwork (org.cytoscape.model.CyNetwork)2 SubFilterTransformer (org.cytoscape.filter.model.SubFilterTransformer)1 InteractivityChangedListener (org.cytoscape.filter.view.InteractivityChangedListener)1