Class AbstractVisualLexicon

  • All Implemented Interfaces:
    VisualLexicon
    Direct Known Subclasses:
    BasicTableVisualLexicon, BasicVisualLexicon

    public abstract class AbstractVisualLexicon
    extends Object
    implements VisualLexicon
    Reusable template implementation of VisualLexicon.

    Module: presentation-api

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

    <dependency>
        <groupId>org.cytoscape</groupId>
        <artifactId>presentation-api</artifactId>
    </dependency>
    • Field Detail

      • MIN_COLOR

        protected static final Color MIN_COLOR
      • MAX_COLOR

        protected static final Color MAX_COLOR
      • PAINT_RANGE

        protected static final Range<Paint> PAINT_RANGE
      • STRING_SET

        protected static final Set<String> STRING_SET
      • ARBITRARY_STRING_RANGE

        protected static final Range<String> ARBITRARY_STRING_RANGE
      • ARBITRARY_DOUBLE_RANGE

        protected static final Range<Double> ARBITRARY_DOUBLE_RANGE
      • NONE_ZERO_POSITIVE_DOUBLE_RANGE

        protected static final Range<Double> NONE_ZERO_POSITIVE_DOUBLE_RANGE
    • Method Detail

      • getTypes

        protected abstract Class<?>[] getTypes()
      • addVisualProperty

        protected final void addVisualProperty​(VisualProperty<?> vp,
                                               VisualProperty<?> parent)
        Insert a VisualProperty to the tree.
        Parameters:
        vp - the VisualProperty to insert in the tree.
        parent - the parent of the VisualProperty to insert.
      • lookup

        public final VisualProperty<?> lookup​(Class<?> type,
                                              String id)
        Description copied from interface: VisualLexicon
        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.
        Specified by:
        lookup in interface VisualLexicon
        Parameters:
        type - The type of the visual property sought, which should (in general) be CyNode.class, CyEdge.class, or CyNetwork.class.
        id - A string identifying a particular visual property.
        Returns:
        A VisualProperty identified by the input string or null if no match is found.
      • isSupported

        public boolean isSupported​(VisualProperty<?> vp)
        Description copied from interface: VisualLexicon
        Test the given Visual Property is supported in this Lexicon.
        Specified by:
        isSupported in interface VisualLexicon
        Parameters:
        vp - visual property to be tested.
        Returns:
        true if this lexicon supports the given vp.
      • addIdentifierMapping

        protected final void addIdentifierMapping​(Class<?> type,
                                                  String id,
                                                  VisualProperty<?> vp)
        Parameters:
        type -
        id -
        vp -