Interface ElementDraft

  • All Known Subinterfaces:
    EdgeDraft, NodeDraft

    public interface ElementDraft
    Draft element, hosted by import containers to represent nodes or edges found when importing.

    The Factory sub-interface defined the methods to create new element instances.

    Author:
    Mathieu Bastian
    • Method Detail

      • getId

        String getId()
        Returns the element's id.

        The element id is unique.

        Returns:
        element's id
      • getValue

        Object getValue​(String key)
        Returns the element's value for key.
        Parameters:
        key - key
        Returns:
        value or null if not found
      • getLabel

        String getLabel()
        Returns the element's label.
        Returns:
        label or null if unset
      • setLabel

        void setLabel​(String label)
        Sets this element's label.
        Parameters:
        label - label
      • getColor

        Color getColor()
        Returns the element's color.
        Returns:
        color or null if unset
      • setColor

        void setColor​(Color color)
        Sets this element's color.
        Parameters:
        color - color
      • setColor

        void setColor​(String color)
        Parse and sets this element's color.

        Color can be an existing Java color (e.g. yellow, blue, cyan) or an octal or hexadecimal color representation (e.g. 0xFF0096, #FF0096).

        Parameters:
        color - color to be parsed and set
      • isLabelVisible

        boolean isLabelVisible()
        Returns true if the label is visible.

        Default value is true.

        Returns:
        true if label is visible, false otherwise
      • setLabelVisible

        void setLabelVisible​(boolean labelVisible)
        Sets whether the label is visible.
        Parameters:
        labelVisible - label visible flag
      • getLabelSize

        float getLabelSize()
        Returns the label's size.

        Default value is -1.

        Returns:
        label size
      • setLabelSize

        void setLabelSize​(float size)
        Sets the label's size.
        Parameters:
        size - label size
      • getLabelColor

        Color getLabelColor()
        Returns the label's color.
        Returns:
        label's color
      • setLabelColor

        void setLabelColor​(Color color)
        Sets the label's color.
        Parameters:
        color - label color
      • setLabelColor

        void setLabelColor​(String color)
        Parses and sets the label's color.

        Color can be an existing Java color (e.g. yellow, blue, cyan) or an octal or hexadecimal color representation (e.g. 0xFF0096, #FF0096).

        Parameters:
        color - color to be parsed and set
      • setValue

        void setValue​(String key,
                      Object value)
        Sets the value for key.
        Parameters:
        key - key
        value - value
      • setValue

        void setValue​(String key,
                      Object value,
                      double timestamp)
        Sets the value for key at the given timestamp.
        Parameters:
        key - key
        value - value
        timestamp - timestamp
      • setValue

        void setValue​(String key,
                      Object value,
                      double start,
                      double end)
        Sets the value for key at the given interval [start,end].
        Parameters:
        key - key
        value - value
        start - interval start
        end - interval end
      • setValue

        void setValue​(String key,
                      Object value,
                      String dateTime)
        Sets the value for key at the given dateTime.
        Parameters:
        key - key
        value - value
        dateTime - dateTime
      • setValue

        void setValue​(String key,
                      Object value,
                      String startDateTime,
                      String endDateTime)
        Sets the value for key at the given interval [startDateTime,endDateTime].
        Parameters:
        key - key
        value - value
        startDateTime - interval start datetime
        endDateTime - interval end datetime
      • parseAndSetValue

        void parseAndSetValue​(String key,
                              String value)
        Parses and sets the value for key.
        Parameters:
        key - key
        value - value
      • parseAndSetValue

        void parseAndSetValue​(String key,
                              String value,
                              double timestamp)
        Parses and sets the value for key at the given timestamp.
        Parameters:
        key - key
        value - value
        timestamp - timestamp
      • parseAndSetValue

        void parseAndSetValue​(String key,
                              String value,
                              double start,
                              double end)
        Parses and sets the value for key at the given interval [start,end].
        Parameters:
        key - key
        value - value
        start - interval start
        end - interval end
      • parseAndSetValue

        void parseAndSetValue​(String key,
                              String value,
                              String dateTime)
        Parses and sets the value for key at the given dateTime.
        Parameters:
        key - key
        value - value
        dateTime - dateTime
      • parseAndSetValue

        void parseAndSetValue​(String key,
                              String value,
                              String startDateTime,
                              String endDateTime)
        Parses and sets the value for key at the given dateTime.
        Parameters:
        key - key
        value - value
        startDateTime - interval start datetime
        endDateTime - interval end datetime
      • setColor

        void setColor​(String r,
                      String g,
                      String b)
        Parses and sets this element's color using string components.

        Components should be numbers between 0 and 255.

        Parameters:
        r - red component as string
        g - green component as string
        b - blue component as string
      • setColor

        void setColor​(float r,
                      float g,
                      float b)
        Sets this element's color using real color numbers (i.e numbers between 0 and 1).
        Parameters:
        r - red component as float
        g - green component as float
        b - blue component as float
      • setColor

        void setColor​(int r,
                      int g,
                      int b)
        Sets this element's color using int color numbers (i.e numbers between 0 and 255).
        Parameters:
        r - red component as int
        g - green component as int
        b - blue component as int
      • setLabelColor

        void setLabelColor​(String r,
                           String g,
                           String b)
        Parses and sets the label's color using string components.

        Components should be numbers between 0 and 255.

        Parameters:
        r - red component as string
        g - green component as string
        b - blue component as string
      • setLabelColor

        void setLabelColor​(float r,
                           float g,
                           float b)
        Sets the label's color using real color numbers (i.e numbers between 0 and 1).
        Parameters:
        r - red component as float
        g - green component as float
        b - blue component as float
      • setLabelColor

        void setLabelColor​(int r,
                           int g,
                           int b)
        Sets the label's color using int color numbers (i.e numbers between 0 and 255).
        Parameters:
        r - red component as int
        g - green component as int
        b - blue component as int
      • addTimestamp

        void addTimestamp​(double timestamp)
      • addTimestamp

        void addTimestamp​(String dateTime)
      • addTimestamps

        void addTimestamps​(String timestamps)
      • addInterval

        void addInterval​(double start,
                         double end)
      • addInterval

        void addInterval​(String startDateTime,
                         String endDateTime)
      • addIntervals

        void addIntervals​(String intervals)
      • getGraphTimestamp

        Double getGraphTimestamp()
      • getGraphInterval

        Interval getGraphInterval()