Class BasicVisualLexicon

  • All Implemented Interfaces:
    VisualLexicon

    public class BasicVisualLexicon
    extends Object
    implements VisualLexicon
    Basic 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>

    Cytoscape Backwards Compatibility (Abstract Class): This class is abstract and meant to be extended by users. This means that we may add methods for minor version updates. Methods will only be removed for major version updates.
    • 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
      • NODE_PAINT

        public static final VisualProperty<Paint> NODE_PAINT
        The color of the whole node, including its border, label and selected paint.

        Property Type: {@see java.awt.Color}

        Property Range: A non-null color

      • NODE_FILL_COLOR

        public static final VisualProperty<Paint> NODE_FILL_COLOR
        The color of the node.

        Property Type: {@see java.awt.Color}

        Property Range: A non-null color

      • NODE_LABEL_COLOR

        public static final VisualProperty<Paint> NODE_LABEL_COLOR
        The color of the node label.

        Property Type: {@see java.awt.Color}

        Property Range: A non-null color

      • NODE_LABEL

        public static final VisualProperty<String> NODE_LABEL
        The text used for the node label.

        Property Type: {@see java.lang.String}

        Property Range: Any string

      • NODE_X_LOCATION

        public static final VisualProperty<Double> NODE_X_LOCATION
        X location of the node. Default value of this will be ignored. The value will be used only when mapping function is defined.

        Property Type: {@see java.lang.Double}

        Property Range: {@see java.lang.Double#NEGATIVE_INFINITY} <= value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • NODE_Y_LOCATION

        public static final VisualProperty<Double> NODE_Y_LOCATION
        Y location of the node. Default value of this will be ignored. The value will be used only when mapping function is defined.

        Property Type: {@see java.lang.Double}

        Property Range: {@see java.lang.Double#NEGATIVE_INFINITY} <= value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • NODE_SIZE

        public static final VisualProperty<Double> NODE_SIZE
        The size of the node. Width and height will be equal. This property is mutually exclusive of Node Height and Node Width.

        Property Type: {@see java.lang.Double}

        Property Range: 0 < value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • NODE_WIDTH

        public static final VisualProperty<Double> NODE_WIDTH
        The width of the node. Width will be independent of height. This property is mutually exclusive of Node Size.

        Property Type: {@see java.lang.Double}

        Property Range: 0 < value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • NODE_HEIGHT

        public static final VisualProperty<Double> NODE_HEIGHT
        The height of the node. Height will be independent of width. This property is mutually exclusive of Node Size.

        Property Type: {@see java.lang.Double}

        Property Range: 0 < value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • NODE_VISIBLE

        public static final VisualProperty<Boolean> NODE_VISIBLE
        Hides the node if set to false. By default, this value is set to true.

        Property Type: {@see java.lang.Boolean}

        Property Range: true or false

      • NODE_SELECTED

        public static final VisualProperty<Boolean> NODE_SELECTED
        TODO Documentation

        Property Type: {@see java.lang.Boolean}

        Property Range: true or false

      • NODE_NESTED_NETWORK_IMAGE_VISIBLE

        public static final VisualProperty<Boolean> NODE_NESTED_NETWORK_IMAGE_VISIBLE
        A boolean value that indicates whether a nested network should be visualized (assuming a nested network is present for the specified node).

        Property Type: {@see java.lang.Boolean}

        Property Range: true or false

      • NODE_LABEL_WIDTH

        public static final VisualProperty<Double> NODE_LABEL_WIDTH
        The maximum width of the node label. If the node label is wider than the specified width, Cytoscape will automatically wrap the label on space characters. Cytoscape will not hyphenate words, meaning that if a single word (i.e. no spaces) is longer than maximum width, the word will be displayed beyond the maximum width.

        Property Type: {@see java.lang.Double}

        Property Range: 0 < value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • NODE_SELECTED_PAINT

        public static final VisualProperty<Paint> NODE_SELECTED_PAINT
        TODO Documentation

        Property Type: {@see java.awt.Color}

        Property Range: A non-null color

      • NODE_BORDER_PAINT

        public static final VisualProperty<Paint> NODE_BORDER_PAINT
        The color of the border of the node.

        Property Type: {@see java.awt.Color}

        Property Range: A non-null color

      • NODE_BORDER_WIDTH

        public static final VisualProperty<Double> NODE_BORDER_WIDTH
        TODO Documentation

        Property Type: {@see java.lang.Double}

        Property Range: 0 <= value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • NODE_TOOLTIP

        public static final VisualProperty<String> NODE_TOOLTIP
        The text of the tooltip that appears when a mouse hovers over the node.

        Property Type: {@see java.lang.String}

        Property Range: Any string

      • NODE_LABEL_FONT_FACE

        public static final VisualProperty<Font> NODE_LABEL_FONT_FACE
        The font used for the node label.

        Property Type: {@see java.awt.Font}

        Property Range: Any font available in the local graphics environment

      • NODE_LABEL_FONT_SIZE

        public static final VisualProperty<Integer> NODE_LABEL_FONT_SIZE
        The size of the font used for the node label.

        Property Type: {@see java.lang.Integer}

        Property Range: 1 <= value <= {@see java.lang.Integer#MAX_VALUE}

      • NODE_TRANSPARENCY

        public static final VisualProperty<Integer> NODE_TRANSPARENCY
        The opacity of the color of the node. Zero means totally transparent, and 255 means totally opaque.

        Property Type: {@see java.lang.Integer}

        Property Range: 0 <= value <= 255

      • NODE_OPACITY

        public static final VisualProperty<Integer> NODE_OPACITY
        See {@see BasicVisualLexicon#NODE_TRANSPARENCY}
      • NODE_BORDER_TRANSPARENCY

        public static final VisualProperty<Integer> NODE_BORDER_TRANSPARENCY
        TODO Documentation

        Property Type: {@see java.lang.Integer}

        Property Range: 0 <= value <= 255

      • NODE_LABEL_TRANSPARENCY

        public static final VisualProperty<Integer> NODE_LABEL_TRANSPARENCY
        TODO Documentation

        Property Type: {@see java.lang.Integer}

        Property Range: 0 <= value <= 255

      • NODE_SHAPE

        public static final VisualProperty<NodeShape> NODE_SHAPE
        The shape of the node.

        Additional Details: {@see org.cytoscape.view.presentation.property.NodeShapeVisualProperty}

      • NODE_BORDER_LINE_TYPE

        public static final VisualProperty<LineType> NODE_BORDER_LINE_TYPE
        The type of line used for the border of the node.

        Additional Details: {@see org.cytoscape.view.presentation.property.LineTypeVisualProperty}

      • EDGE_PAINT

        public static final VisualProperty<Paint> EDGE_PAINT
        The color of the whole edge (including the stroke and arrows) when it is selected or unselected.

        Property Type: {@see java.awt.Color}

        Property Range: A non-null color

      • EDGE_LABEL_COLOR

        public static final VisualProperty<Paint> EDGE_LABEL_COLOR
        TODO Documentation

        Property Type: {@see java.awt.Color}

        Property Range: A non-null color

      • EDGE_LABEL

        public static final VisualProperty<String> EDGE_LABEL
        The text used for the edge label.

        Property Type: {@see java.lang.String}

        Property Range: Any string

      • EDGE_WIDTH

        public static final VisualProperty<Double> EDGE_WIDTH
        The width of the edge line.

        Property Type: {@see java.lang.Double}

        Property Range: 0 < value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • EDGE_VISIBLE

        public static final VisualProperty<Boolean> EDGE_VISIBLE
        Hides the edge if set to false. By default, this value is set to true.

        Property Type: {@see java.lang.Boolean}

        Property Range: true or false

      • EDGE_SELECTED

        public static final VisualProperty<Boolean> EDGE_SELECTED
        TODO Documentation

        Property Type: {@see java.lang.Boolean}

        Property Range: true or false

      • EDGE_LINE_TYPE

        public static final VisualProperty<LineType> EDGE_LINE_TYPE
        The type of stoke used to render the line (solid, dashed, etc.)

        Additional Details: {@see org.cytoscape.view.presentation.property.LineTypeVisualProperty}

      • EDGE_TOOLTIP

        public static final VisualProperty<String> EDGE_TOOLTIP
        The text of the tooltip that appears when a mouse hovers over the edge.

        Property Type: {@see java.lang.String}

        Property Range: Any string

      • EDGE_LABEL_FONT_FACE

        public static final VisualProperty<Font> EDGE_LABEL_FONT_FACE
        The font used for the edge label.

        Property Type: {@see java.awt.Font}

        Property Range: Any font available in the local graphics environment

      • EDGE_LABEL_FONT_SIZE

        public static final VisualProperty<Integer> EDGE_LABEL_FONT_SIZE
        The size of the font used for the edge label.

        Property Type: {@see java.lang.Integer}

        Property Range: 1 <= value <= {@see java.lang.Integer#MAX_VALUE}

      • EDGE_LABEL_TRANSPARENCY

        public static final VisualProperty<Integer> EDGE_LABEL_TRANSPARENCY
        The opacity of the color of the edge label. Zero means totally transparent, and 255 means totally opaque.

        Property Type: {@see java.lang.Integer}

        Property Range: 0 <= value <= 255

      • EDGE_SELECTED_PAINT

        public static final VisualProperty<Paint> EDGE_SELECTED_PAINT
        The color of the whole edge (stroke and arrows) when selected.

        Property Type: {@see java.awt.Color}

        Property Range: A non-null color

      • EDGE_UNSELECTED_PAINT

        public static final VisualProperty<Paint> EDGE_UNSELECTED_PAINT
        The color of the whole edge (stroke and arrows) when it is not selected.

        Property Type: {@see java.awt.Color}

        Property Range: A non-null color

      • EDGE_STROKE_SELECTED_PAINT

        public static final VisualProperty<Paint> EDGE_STROKE_SELECTED_PAINT
        The color of the edge line when selected.

        Property Type: {@see java.awt.Color}

        Property Range: A non-null color

      • EDGE_STROKE_UNSELECTED_PAINT

        public static final VisualProperty<Paint> EDGE_STROKE_UNSELECTED_PAINT
        The color of the edge line.

        Property Type: {@see java.awt.Color}

        Property Range: A non-null color

      • EDGE_TRANSPARENCY

        public static final VisualProperty<Integer> EDGE_TRANSPARENCY
        The opacity of the of the edge. Zero means totally transparent, and 255 means totally opaque.

        Property Type: {@see java.lang.Integer}

        Property Range: 0 <= value <= 255

      • EDGE_SOURCE_ARROW_SHAPE

        public static final VisualProperty<ArrowShape> EDGE_SOURCE_ARROW_SHAPE
        The shape of the arrow on the source node end of the edge.

        Additional Details: {@see org.cytoscape.view.presentation.property.ArrowShapeVisualProperty}

      • EDGE_TARGET_ARROW_SHAPE

        public static final VisualProperty<ArrowShape> EDGE_TARGET_ARROW_SHAPE
        The shape of the arrow on the target node end of the edge.

        Additional Details: {@see org.cytoscape.view.presentation.property.ArrowShapeVisualProperty}

      • EDGE_SOURCE_ARROW_SIZE

        public static final VisualProperty<Double> EDGE_SOURCE_ARROW_SIZE
        TODO Documentation

        Property Type: {@see java.lang.Double}

        Property Range: 0 < value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • EDGE_TARGET_ARROW_SIZE

        public static final VisualProperty<Double> EDGE_TARGET_ARROW_SIZE
        TODO Documentation

        Property Type: {@see java.lang.Double}

        Property Range: 0 < value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • EDGE_BEND

        public static final EdgeBendVisualProperty EDGE_BEND
        If Edge Bend is defined, edges will be rendered as straight or curved lines. If this value is set to true, edges will be drawn as curved lines.
      • EDGE_LABEL_WIDTH

        public static final VisualProperty<Double> EDGE_LABEL_WIDTH
        TODO Documentation

        Property Type: {@see java.lang.Double}

        Property Range: 0 < value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • NETWORK_SCALE_FACTOR

        public static final VisualProperty<Double> NETWORK_SCALE_FACTOR
        The zoom level of the network view.

        Property Type: {@see java.lang.Double}

        Property Range: 0 < value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • NETWORK_CENTER_X_LOCATION

        public static final VisualProperty<Double> NETWORK_CENTER_X_LOCATION
        The X location of network view center.

        Property Type: {@see java.lang.Double}

        Property Range: {@see java.lang.Double#NEGATIVE_INFINITY} <= value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • NETWORK_CENTER_Y_LOCATION

        public static final VisualProperty<Double> NETWORK_CENTER_Y_LOCATION
        The Y location of network view center.

        Property Type: {@see java.lang.Double}

        Property Range: {@see java.lang.Double#NEGATIVE_INFINITY} <= value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • NETWORK_SIZE

        public static final VisualProperty<Double> NETWORK_SIZE
        The size (width and height) of the network view.

        Property Type: {@see java.lang.Double}

        Property Range: 0 < value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • NETWORK_WIDTH

        public static final VisualProperty<Double> NETWORK_WIDTH
        The width of the network view.

        Property Type: {@see java.lang.Double}

        Property Range: 0 < value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • NETWORK_HEIGHT

        public static final VisualProperty<Double> NETWORK_HEIGHT
        The height of the network view.

        Property Type: {@see java.lang.Double}

        Property Range: 0 < value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • NETWORK_TITLE

        public static final VisualProperty<String> NETWORK_TITLE
        The title of the network view.

        Property Type: {@see java.lang.String}

        Property Range: Any string

      • NETWORK_BACKGROUND_PAINT

        public static final VisualProperty<Paint> NETWORK_BACKGROUND_PAINT
        The background color of the network view.

        Property Type: {@see java.awt.Color}

        Property Range: A non-null color

      • NODE_Z_LOCATION

        public static final VisualProperty<Double> NODE_Z_LOCATION
        Z location of the node. Default value of this will be ignored. The value will be used only when mapping function is defined.

        Property Type: {@see java.lang.Double}

        Property Range: {@see java.lang.Double#NEGATIVE_INFINITY} <= value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • NODE_DEPTH

        public static final VisualProperty<Double> NODE_DEPTH
        TODO Documentation

        Property Type: {@see java.lang.Double}

        Property Range: 0 < value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • NETWORK_CENTER_Z_LOCATION

        public static final VisualProperty<Double> NETWORK_CENTER_Z_LOCATION
        TODO Documentation

        Property Type: {@see java.lang.Double}

        Property Range: {@see java.lang.Double#NEGATIVE_INFINITY} <= value <= {@see java.lang.Double#POSITIVE_INFINITY}

      • NETWORK_DEPTH

        public static final VisualProperty<Double> NETWORK_DEPTH
        TODO Documentation

        Property Type: {@see java.lang.Double}

        Property Range: 0 < value <= {@see java.lang.Double#POSITIVE_INFINITY}

    • Constructor Detail

      • BasicVisualLexicon

        public BasicVisualLexicon​(VisualProperty<NullDataType> rootVisualProperty)
        Constructor for VisualLexicon. The parameters are required for all lexicons.
        Parameters:
        rootVisualProperty - Root of the visual property tree.
    • Method Detail

      • addBendFactory

        public final void addBendFactory​(BendFactory bendFactory,
                                         Map<?,​?> props)
      • 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 -