Interface TableVisualMappingManager
Manager for VisualStyle
s 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 Summary
Modifier and TypeMethodDescriptionReturns a set of all StyleAssociations that are managed by this service.Returns a Set of allVisualLexicon
s.Returns all directly associatedVisualStyle
s managed by this object.Returns all directly associatedVisualStyle
s managed by this object.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.getAssociatedColumnVisualStyles
(VisualStyle networkVisualStyle, Class<? extends CyIdentifiable> tableType) Returns all column VisualStyles that is associated with the given networkVisualStyle and table type.getAssociatedNetworkVisualStyles
(VisualStyle columnVisualStyle) Returns the network VisualStyles that are associated with the given column VisualStyle.getAssociations
(VisualStyle columnVisualStyle) Returns a set of StyleAssociations for the given columnVisualStyle.Returns the default columnVisualStyle
.getVisualStyle
(View<CyColumn> viewModel) Returns theVisualStyle
directly associated with the target column view model.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.void
setVisualStyle
(View<CyColumn> columnView, VisualStyle visualStyle) Set aVisualStyle
directly to the target column view model.
-
Method Details
-
setVisualStyle
Set aVisualStyle
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
Returns theVisualStyle
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 associatedVisualStyle
s 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 associatedVisualStyle
s managed by this object.- Returns:
- Map of all directly associated VisualStyles.
- Since:
- 3.9
-
getAllVisualLexicon
Set<VisualLexicon> getAllVisualLexicon()Returns a Set of allVisualLexicon
s.- Returns:
- a Set of all
VisualLexicon
s. - Since:
- 3.9
-
getDefaultVisualStyle
VisualStyle getDefaultVisualStyle()Returns the default columnVisualStyle
. 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.classcolName
- 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.classcolName
- The name of the column.- Since:
- 3.10
-
getAssociatedNetworkVisualStyles
Returns the network VisualStyles that are associated with the given column VisualStyle.- Since:
- 3.10
-
getAssociations
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
-