Interface EditConstraints


  • public interface EditConstraints
    interface describing possible constraints on data set modifications
    Author:
    rstein
    • Method Detail

      • canDelete

        boolean canDelete​(int index)
        Parameters:
        index - data set point index
        Returns:
        true: if the specified data point can be deleted.
      • canAdd

        boolean canAdd​(int index)
        Parameters:
        index - data set point index
        Returns:
        true: if a new data point can be added at the specified data point.
      • canChange

        default boolean canChange​(int index)
        Determines if the specified data point can be modified.
        Parameters:
        index - data point index
        Returns:
        default is true
      • isXEditable

        boolean isXEditable()
        Returns:
        true: if the horizontal values can be modified
      • isYEditable

        boolean isYEditable()
        Returns:
        true: if the vertical values can be modified
      • isAcceptable

        default boolean isAcceptable​(int index,
                                     double newX,
                                     double newY)
        Determines if the specified point can be accepted by the data set. The specified point may be a new point (in this case index should be -1) or existing point. This method can be used e.g. to make sure that the new point doesn't have the same X coordinate as existing point.
        Parameters:
        index - index of the point being modified or -1 if it is a new point
        newX - X coordinate of the considered point
        newY - Y coordinate of the considered point
        Returns:
        true if the point is acceptable by the data set, false otherwise