Class AbstractVisualLexicon

java.lang.Object
org.cytoscape.view.presentation.property.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 Details

    • rootVisualProperty

      protected final VisualProperty<NullDataType> rootVisualProperty
      The Root of this tree.
    • 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
    • ANGLE_DOUBLE_RANGE

      protected static final Range<Double> ANGLE_DOUBLE_RANGE
  • Constructor Details

  • Method Details

    • getTypes

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

      protected abstract void addVisualProperties(VisualProperty<NullDataType> root)
    • getAllVisualProperties

      public final Set<VisualProperty<?>> getAllVisualProperties()
      Description copied from interface: VisualLexicon
      Returns the Set of VisualPropertys supported by this Renderer.
      Specified by:
      getAllVisualProperties in interface VisualLexicon
      Returns:
      Set of all visual properties
    • getAllDescendants

      public final Collection<VisualProperty<?>> getAllDescendants(VisualProperty<?> prop)
      Description copied from interface: VisualLexicon
      Get collection of visual properties for a given object type (node/edge/network).
      Specified by:
      getAllDescendants in interface VisualLexicon
      Parameters:
      prop - any visual property
      Returns:
      Collection of visual properties for the type.
    • getRootVisualProperty

      public final VisualProperty<NullDataType> getRootVisualProperty()
      Description copied from interface: VisualLexicon
      Get root of this tree. To traverse this tree, use this node as the entry point.
      Specified by:
      getRootVisualProperty in interface VisualLexicon
      Returns:
      root node.
    • 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.
    • getVisualLexiconNode

      public final VisualLexiconNode getVisualLexiconNode(VisualProperty<?> vp)
      Description copied from interface: VisualLexicon
      Get a tree node in for the given VisualProperty.
      Specified by:
      getVisualLexiconNode in interface VisualLexicon
      Parameters:
      vp - target VisualProperty in this lexicon.
      Returns:
      tree node for the VisualProperty in this lexicon.
    • 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.
    • getSupportedValueRange

      public <T> Set<T> getSupportedValueRange(VisualProperty<T> vp)
      Description copied from interface: VisualLexicon
      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.
      Specified by:
      getSupportedValueRange in interface VisualLexicon
      Parameters:
      vp - VisualProperty where vp.getRange().isDiscrete() == true
    • addIdentifierMapping

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