Search in sources :

Example 1 with CellType

use of org.cytoscape.view.vizmap.gui.internal.event.CellType in project cytoscape-impl by cytoscape.

the class VizMapPropertyBuilder method removeMappingProperties.

protected void removeMappingProperties(final PropertySheetPanel propertySheetPanel) {
    final Property[] properties = propertySheetPanel.getProperties();
    if (properties != null) {
        final PropertySheetTable table = propertySheetPanel.getTable();
        final PropertyRendererRegistry rendReg = (PropertyRendererRegistry) table.getRendererFactory();
        for (final Property p : properties) {
            if (p instanceof VizMapperProperty) {
                final CellType cellType = ((VizMapperProperty<?, ?, ?>) p).getCellType();
                if (cellType == CellType.CONTINUOUS || cellType == CellType.DISCRETE) {
                    if (cellType == CellType.CONTINUOUS) {
                        // TODO: Update range trace?
                        rendReg.unregisterRenderer(p);
                    }
                    propertySheetPanel.removeProperty(p);
                }
            }
        }
        table.repaint();
        propertySheetPanel.repaint();
    }
}
Also used : PropertyRendererRegistry(com.l2fprod.common.propertysheet.PropertyRendererRegistry) CellType(org.cytoscape.view.vizmap.gui.internal.event.CellType) PropertySheetTable(com.l2fprod.common.propertysheet.PropertySheetTable) VizMapperProperty(org.cytoscape.view.vizmap.gui.internal.VizMapperProperty) Property(com.l2fprod.common.propertysheet.Property) VisualProperty(org.cytoscape.view.model.VisualProperty) VizMapperProperty(org.cytoscape.view.vizmap.gui.internal.VizMapperProperty)

Aggregations

Property (com.l2fprod.common.propertysheet.Property)1 PropertyRendererRegistry (com.l2fprod.common.propertysheet.PropertyRendererRegistry)1 PropertySheetTable (com.l2fprod.common.propertysheet.PropertySheetTable)1 VisualProperty (org.cytoscape.view.model.VisualProperty)1 VizMapperProperty (org.cytoscape.view.vizmap.gui.internal.VizMapperProperty)1 CellType (org.cytoscape.view.vizmap.gui.internal.event.CellType)1