Interface VisualLexicon

  • All Known Implementing Classes:
    BasicVisualLexicon

    public interface VisualLexicon
    A RenderingEngine should provide one, immutable lexicon implementing this interface. This is a pre-defined tree of VisualProperties designed by the RenderingEngine developer.

    Module: viewmodel-api

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

    <dependency>
        <groupId>org.cytoscape</groupId>
        <artifactId>viewmodel-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 Detail

      • getRootVisualProperty

        VisualProperty<NullDataType> getRootVisualProperty()
        Get root of this tree. To traverse this tree, use this node as the entry point.
        Returns:
        root node.
      • getAllVisualProperties

        Set<VisualProperty<?>> getAllVisualProperties()
        Returns the Set of VisualPropertys supported by this Renderer.
        Returns:
        Set of all visual properties
      • lookup

        VisualProperty<?> lookup​(Class<?> type,
                                 String identifier)
        Returns the appropriate visual property for the descriptive string. The string is generally expected to be descriptive identifier from a file format (e.g. XGMML, GML) that can be mapped to a VisualProperty by the implementer of the VisualLexicon. This method will return null if no match is found.
        Parameters:
        type - The type of the visual property sought, which should (in general) be CyNode.class, CyEdge.class, or CyNetwork.class.
        identifier - A string identifying a particular visual property.
        Returns:
        A VisualProperty identified by the input string or null if no match is found.
      • getVisualLexiconNode

        VisualLexiconNode getVisualLexiconNode​(VisualProperty<?> vp)
        Get a tree node in for the given VisualProperty.
        Parameters:
        vp - target VisualProperty in this lexicon.
        Returns:
        tree node for the VisualProperty in this lexicon.
        Throws:
        IllegalArgumentException - If vp does not exist in the lexicon.
      • getAllDescendants

        Collection<VisualProperty<?>> getAllDescendants​(VisualProperty<?> prop)
        Get collection of visual properties for a given object type (node/edge/network).
        Parameters:
        prop - any visual property
        Returns:
        Collection of visual properties for the type.
      • isSupported

        boolean isSupported​(VisualProperty<?> vp)
        Test the given Visual Property is supported in this Lexicon.
        Parameters:
        vp - visual property to be tested.
        Returns:
        true if this lexicon supports the given vp.
      • getSupportedValueRange

        <T> Set<T> getSupportedValueRange​(VisualProperty<T> vp)
        Returns a filtered value range for a VisualProperty that uses a DiscreteRange. VisualLexicons may override this method to remove or add values to a DiscreteRange for a built-in VisualProperty from BasicVisualLexicon.
        Parameters:
        vp - VisualProperty where vp.getRange().isDiscrete() == true