Interface Item


  • public interface Item
    An item is a visual element built by an ItemBuilder and later used by a Renderer to be displayed.

    An item simply stores the reference to the original object (e.g. node, edge) and all the information useful for the Renderer like the color, size or position.

    All items can be retrieved from the PreviewModel.

    Author:
    Yudi Xue, Mathieu Bastian
    • Method Detail

      • getSource

        Object getSource()
        Returns the source of the item. The source is usually a graph object like a Node or Edge.
        Returns:
        the item's source object
      • getType

        String getType()
        Returns the type of the item. Default types are Item.NODE, Item.EDGE, Item.NODE_LABEL and Item.EDGE_LABEL.
        Returns:
        the item's type
      • getData

        <D> D getData​(String key)
        Returns data associated to this item.
        Type Parameters:
        D - the type of the data
        Parameters:
        key - the key
        Returns:
        the value associated to key, or null if not exist
      • setData

        void setData​(String key,
                     Object value)
        Sets data to this item.
        Parameters:
        key - the key
        value - the value to be associated with key
      • getKeys

        String[] getKeys()
        Returns all the keys. That allows to enumerate all data associated with this item.
        Returns:
        all keys