Interface VisualStyle

  • public interface VisualStyle
    A VisualStyle is a collection of VisualMappingFunctions and default values that define how a set of attributes is mapped to visual properties of View objects.

    Module: vizmap-api

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


    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 Detail

      • getTitle

        String getTitle()
        Returns name of this visual style. This should NOT be used as the ID of this Visual Style. Just for GUI components and may not be unique.

        Title of Visual Style is a mutable field and may NOT be unique.

        title of this visual style
      • setTitle

        void setTitle​(String title)
        Set new title for this VisualStyle.
        title - New title of this VisualStyle.
      • removeVisualMappingFunction

        void removeVisualMappingFunction​(VisualProperty<?> vp)
        Remove a VisualMappingFunction for the VisualProperty. One visual property can be associated with only one mapping function, so this always removes correct one.
        vp - VisualMappingFunction associated with this VisualProperty will be removed.
      • getVisualMappingFunction

        <V> VisualMappingFunction<?,​V> getVisualMappingFunction​(VisualProperty<V> vp)
        Get current VisualMappingFunction for the VisualProperty.
        Type Parameters:
        V - Data type of VisualProperty.
        vp - visual property associated with the target mapping.
        mapping function for the VisualProperty. If no mapping is available, this value is null.
      • getDefaultValue

        <V> V getDefaultValue​(VisualProperty<V> vp)
        Returns default value for the VisualProperty. This is style's default value, not same as VisualProperty default. If VisualMappingFunction is not available for this VisualProperty, this default value will be used in the view model.
        Type Parameters:
        V - Data type of VisualProperty
        vp - target VisualProperty
        Style's default value for the VisualProperty.
      • setDefaultValue

        <V,​S extends V> void setDefaultValue​(VisualProperty<V> vp,
                                                   S value)
        Set default value for the VisualProperty.
        Type Parameters:
        V - Data type of VisualProperty
        S - Data type of actual default value. This can be same as V or its child classes.
        vp - target VisualProperty
        value - Value to be set as default. This can be child type of V. For example, if V is Number, S can be Double, Integer, etc.
      • apply

        void apply​(CyNetworkView networkView)
        Apply Visual Style to the entire network view.
        networkView - The view that the visual property should be applied to.
        NullPointerException - if the specified networkView is null
      • apply

        void apply​(CyRow row,
                   View<? extends CyIdentifiable> view)
        Apply Visual Property values only to the given View Object (node or edge). If you need to update only few set of node/edge views, then this is more efficient.
        row - Data table row for the view's model. This is necessary for applying mapped values.
        view - The view that the visual property should be applied to.
      • getAllVisualPropertyDependencies

        Set<VisualPropertyDependency<?>> getAllVisualPropertyDependencies()
        Get all dependencies for this style.
        set of dependencies associated with this style.
      • addVisualPropertyDependency

        void addVisualPropertyDependency​(VisualPropertyDependency<?> dependency)
        Add a new VisualPropertyDependency. If the VisualStyle already contains a dependency with the same id, the passed dependency is not added.
        dependency - new dependency to be added