Search in sources :

Example 1 with ColumnFilterController

use of org.cytoscape.filter.internal.filters.column.ColumnFilterController in project cytoscape-impl by cytoscape.

the class ModelMonitor method updateColumnSliders.

private void updateColumnSliders() {
    for (ColumnFilterController controller : columnViews.values()) {
        ColumnFilter filter = controller.getFilter();
        Class<? extends CyIdentifiable> columnType = filter.getTableType();
        Number[] range;
        String name = filter.getColumnName();
        if (name == null) {
            continue;
        }
        CyTable table;
        if (CyNode.class.equals(columnType)) {
            table = network.getDefaultNodeTable();
            range = getColumnRange(table, name, nodeColumnRanges);
        } else if (CyEdge.class.equals(columnType)) {
            table = network.getDefaultEdgeTable();
            range = getColumnRange(table, name, edgeColumnRanges);
        } else {
            continue;
        }
        CyColumn column = table.getColumn(name);
        if (column == null) {
            continue;
        }
        Class<?> type = column.getType();
        if (List.class.equals(type)) {
            type = column.getListElementType();
        }
        if (Integer.class.equals(type) || Long.class.equals(type)) {
            controller.setSliderBounds(range[0].longValue(), range[1].longValue());
        } else {
            controller.setSliderBounds(range[0].doubleValue(), range[1].doubleValue());
        }
    }
}
Also used : CyTable(org.cytoscape.model.CyTable) CyColumn(org.cytoscape.model.CyColumn) ColumnFilterController(org.cytoscape.filter.internal.filters.column.ColumnFilterController) ColumnFilter(org.cytoscape.filter.internal.filters.column.ColumnFilter) CyEdge(org.cytoscape.model.CyEdge)

Example 2 with ColumnFilterController

use of org.cytoscape.filter.internal.filters.column.ColumnFilterController in project cytoscape-impl by cytoscape.

the class ModelMonitor method updateColumnViews.

private void updateColumnViews() {
    for (Entry<ColumnFilterView, ColumnFilterController> entry : columnViews.entrySet()) {
        ColumnFilterController controller = entry.getValue();
        controller.columnsChanged(entry.getKey());
    }
}
Also used : ColumnFilterController(org.cytoscape.filter.internal.filters.column.ColumnFilterController) ColumnFilterView(org.cytoscape.filter.internal.filters.column.ColumnFilterView)

Aggregations

ColumnFilterController (org.cytoscape.filter.internal.filters.column.ColumnFilterController)2 ColumnFilter (org.cytoscape.filter.internal.filters.column.ColumnFilter)1 ColumnFilterView (org.cytoscape.filter.internal.filters.column.ColumnFilterView)1 CyColumn (org.cytoscape.model.CyColumn)1 CyEdge (org.cytoscape.model.CyEdge)1 CyTable (org.cytoscape.model.CyTable)1