Interface TableVisualMappingManager


public interface TableVisualMappingManager

Manager for VisualStyles applied to table columns.

There are two types of VisualStyle "associations" managed by this service.

  • Direct Associations: This is when an VisualStyle is directly applied to a View<CyColumn>. These column VisualStyles are not allowed for the default node/edge tables from a network, and are intended for programmatic use by Apps to apply styles to unassigned tables. To create styles for network tables use Network Style Associations instead.
  • Network Style Associations: This is when a column VisualStyle is associated with a network VisualStyle. These column VisualStyles are then applied to the default node/edge tables for the same networks that have the network VisualStyle applied. Note: network VisualStyles are managed by the VisualMappingManager.

Since:
3.9

Module: vizmap-api

To use this in your app, include the following dependency in your POM:

<dependency>
    <groupId>org.cytoscape</groupId>
    <artifactId>vizmap-api</artifactId>
</dependency>

Cytoscape Backwards Compatibility (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.
  • Method Details

    • setVisualStyle

      void setVisualStyle(View<CyColumn> columnView, VisualStyle visualStyle)
      Set a VisualStyle directly to the target column view model.

      Note: As of Cytoscape 3.10 the preferred way to create a visual style for use in the node or edge table is to create a visual style and associate it with a network style using the setAssociatedVisualStyle(...) method. The setVisualStyle(...) method should only be used by Apps to programmatically set styles on tables that are not registered with the CyNetworkTableManager.

      Note: If the target column is from a network node/edge table, then it will automatically be associated with the network's current VisualStyle instead of being directly associated.

      Parameters:
      visualStyle - Visual Style to be set. May be null.
      columnView - The target column view model.
      Throws:
      IllegalStateException - If the columnView is for a network table, and the network does not have one style applied to it.
      Since:
      3.9
    • getVisualStyle

      VisualStyle getVisualStyle(View<CyColumn> viewModel)
      Returns the VisualStyle directly associated with the target column view model.
      Returns:
      VisualStyle associated with the column view model. May return null if the column does not have a style.
      Throws:
      IllegalStateException - If the columnView is for a network table, and the network does not have one style applied to it.
      Since:
      3.9
    • getAllVisualStyles

      Set<VisualStyle> getAllVisualStyles()
      Returns all directly associated VisualStyles managed by this object.
      Returns:
      Set of all directly associated VisualStyles. Note, the default VisualStyle returned by getDefaultVisualStyle() is not included in the returned set.
      Since:
      3.9
    • getAllVisualStylesMap

      Map<View<CyColumn>,VisualStyle> getAllVisualStylesMap()
      Returns all directly associated VisualStyles managed by this object.
      Returns:
      Map of all directly associated VisualStyles.
      Since:
      3.9
    • getAllVisualLexicon

      Set<VisualLexicon> getAllVisualLexicon()
      Returns a Set of all VisualLexicons.
      Returns:
      a Set of all VisualLexicons.
      Since:
      3.9
    • getDefaultVisualStyle

      VisualStyle getDefaultVisualStyle()
      Returns the default column VisualStyle. This is just an empty visual style that can be used to avoid dealing with null.
      Since:
      3.10
    • setAssociatedVisualStyle

      void setAssociatedVisualStyle(VisualStyle networkVisualStyle, Class<? extends CyIdentifiable> tableType, String colName, VisualStyle columnVisualStyle)
      Associates a column VisualStyle to a network VisualStyle, and specifies the table type and column name for the column VisualStyle to be applied to. Note this method does not check if a column with the given name actually exists.
      Parameters:
      networkVisualStyle - The network VisualStyle that the given columnVisualStyle will be associated with.
      tableType - CyNode.class or CyEdge.class
      colName - The name of the column.
      columnVisualStyle - The VisualStyle that will be applied to the column. May be null to remove a style from the given column.
      Throws:
      NullPointerException - If networkVisualStyle, tableType or colName are null.
      Since:
      3.10
    • getAssociatedColumnVisualStyles

      Map<String,VisualStyle> getAssociatedColumnVisualStyles(VisualStyle networkVisualStyle, Class<? extends CyIdentifiable> tableType)
      Returns all column VisualStyles that is associated with the given networkVisualStyle and table type.
      Parameters:
      networkVisualStyle - The network VisualStyle that the returned columnVisualStyles are associated with.
      tableType - CyNode.class or CyEdge.class
      Since:
      3.10
    • getAssociatedColumnVisualStyle

      default VisualStyle getAssociatedColumnVisualStyle(VisualStyle networkVisualStyle, Class<? extends CyIdentifiable> tableType, String colName)
      Returns the column VisualStyle that is associated with the given networkVisualStyle, table type and column name.
      Parameters:
      networkVisualStyle - The network VisualStyle that the returned column VisualStyle is associated with.
      tableType - CyNode.class or CyEdge.class
      colName - The name of the column.
      Since:
      3.10
    • getAssociatedNetworkVisualStyles

      Set<VisualStyle> getAssociatedNetworkVisualStyles(VisualStyle columnVisualStyle)
      Returns the network VisualStyles that are associated with the given column VisualStyle.
      Since:
      3.10
    • getAssociations

      Set<StyleAssociation> getAssociations(VisualStyle columnVisualStyle)
      Returns a set of StyleAssociations for the given columnVisualStyle. The StyleAssociations contain the network VisualStyles, table types and column names that the given columnVisualStyle is associated with.
      Since:
      3.10
    • getAllStyleAssociations

      Set<StyleAssociation> getAllStyleAssociations()
      Returns a set of all StyleAssociations that are managed by this service. The StyleAssociations contain the network VisualStyles, table types and column names that the given columnVisualStyle is associated with.
      Since:
      3.10