Interface IErrorBarPainter

  • All Superinterfaces:
    java.io.Serializable
    All Known Implementing Classes:
    ErrorBarPainter, ErrorBarPainterLine

    public interface IErrorBarPainter
    extends java.io.Serializable
    Interface for a renderer of error bars.

    It contains a similar method to IPointPainter.paintPoint(int, int, int, int, Graphics, ITracePoint2D) with an additional IErrorBarPixel for getting information about the error to render.

    A visible error bar consists of three parts:

    • The start point
    • The end point
    • The segment connecting the start point and the end point
    This interface offers to configure these three parts by IPointPainter instances (which are used by ITracePainter implementations too.

    If one of these three parts (see the setters) is null, the corresponding part should not be painted.

    A further configuration is to define the colors of these parts by the according setters.

    Version:
    $Revision: 1.27 $
    Author:
    Achim Westermann
    • Method Detail

      • addPropertyChangeListener

        void addPropertyChangeListener​(java.lang.String propertyName,
                                       java.beans.PropertyChangeListener listener)
        Registers a property change listener that will be informed about changes of the property identified by the given propertyName.

        PropertyChangeEvents

        PropertyChangeListener instances may be added via Container.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) . They inherit the properties to listen from Container.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) . Additionally more PropertyChangeEvents should be triggered (contract for implementation!).

        Property Change events

        The following PropertyChangeEvent instances will be fired to registered PropertyChangeListener instances.
        getPropertyName() getSource() getOldValue() getNewValue() comment
        PROPERTY_ENDPOINT IErrorBarPainter that changed. IPointPainter. IPointPainter. Note that null as the old value indicates a new painter. Null as the new value is valid and means that the end point rendering is turned off.
        PROPERTY_STARTPOINT IErrorBarPainter that changed. IPointPainter. IPointPainter. Note that null as the old value indicates a new painter. Null as the new value is valid and means that the start point rendering is turned off.
        PROPERTY_CONNECTION IErrorBarPainter that changed. IPointPainter. IPointPainter. Note that null as the old value indicates a new painter. Null as the new value is valid and means that the connection segment point rendering is turned off.
        PROPERTY_ENDPOINT_COLOR IErrorBarPainter that changed. Color. Color. Note that null as the old value indicates a new color different from the default. Null as the new value is valid and means that the end point color is switched to default.
        PROPERTY_STARTPOINT_COLOR IErrorBarPainter that changed. Color. Color. Note that null as the old value indicates a new color different from the default. Null as the new value is valid and means that the start point color is switched to default.
        PROPERTY_CONNECTION_COLOR IErrorBarPainter that changed. Color. Color. Note that null as the old value indicates a new color different from the default. Null as the new value is valid and means that the connection segment color is switched to default.

        Parameters:
        propertyName - the name of the property the listener is interested in
        listener - a listener that will only be informed if the property identified by the argument propertyName changes
      • getConnectionColor

        java.awt.Color getConnectionColor()
        Returns the color of the connection segment or null if unconfigured.

        Returns:
        the color of the connection segment or null if unconfigured.
      • getConnectionPainter

        IPointPainter<?> getConnectionPainter()
        Returns the painter for the connection segment of the error bar.

        Returns:
        The painter for the connection segment of the error bar.
      • getEndPointColor

        java.awt.Color getEndPointColor()
        Returns the color of the end point or null if unconfigured.

        Returns:
        the color of the end point or null if unconfigured.
      • getEndPointPainter

        IPointPainterConfigurableUI<?> getEndPointPainter()
        Returns the painter for the end point of the error bar.

        Returns:
        The painter for the end point of the error bar.
      • getPropertyChangeListeners

        java.beans.PropertyChangeListener[] getPropertyChangeListeners​(java.lang.String property)
        Returns all property change listeners for the given property.

        Parameters:
        property - one of the constants with the PROPERTY_ prefix defined in this class or subclasses.
        Returns:
        the property change listeners for the given property.
      • getSegmentConnection

        IErrorBarPainter.ISegment getSegmentConnection()
        Returns the facade instance for accessing the connection segment of this configurable error bar painter.

        Returns:
        the facade instance for accessing the connection segment of this configurable error bar painter.
      • getSegmentEnd

        IErrorBarPainter.ISegment getSegmentEnd()
        Returns the facade instance for accessing the end segment of this configurable error bar painter.

        Returns:
        the facade instance for accessing the end segment of this configurable error bar painter.
      • getSegmentStart

        IErrorBarPainter.ISegment getSegmentStart()
        Returns the facade instance for accessing the start segment of this configurable error bar painter.

        Returns:
        the facade instance for accessing the start segment of this configurable error bar painter.
      • getStartPointColor

        java.awt.Color getStartPointColor()
        Returns the color of the start point or null if unconfigured.

        Returns:
        the color of the start point or null if unconfigured.
      • getStartPointPainter

        IPointPainterConfigurableUI<?> getStartPointPainter()
        Returns the painter for the start point of the error bar.

        Returns:
        the painter for the start point of the error bar.
      • paintErrorBar

        void paintErrorBar​(int absoluteX,
                           int absoluteY,
                           ITracePoint2D original,
                           java.awt.Graphics g,
                           IErrorBarPixel errorBar)
        Paint the error bar for the point given by absolute coordinates on the given graphic context.

        Basic implementations should modularize further and allow configuration for the way of painting the connection segments, the start point (origin) and end point of the error bar with implementations of IPointPainter.

        Parameters:
        absoluteX - the ready to use x value for the point to paint.
        absoluteY - the ready to use y value for the point to paint.
        errorBar - contains the data for the errors to render.
        original - the original trace point this error bar is painted for.
        g - the graphic context to paint on.
        See Also:
        IErrorBarPixel
      • removePropertyChangeListener

        void removePropertyChangeListener​(java.beans.PropertyChangeListener listener)
        Unregisters a property change listener that has been registered for listening on all properties.

        Parameters:
        listener - a listener that will only be informed if the property identified by the argument propertyName changes
      • removePropertyChangeListener

        void removePropertyChangeListener​(java.lang.String property,
                                          java.beans.PropertyChangeListener listener)
        Removes a property change listener for listening on the given property.

        Parameters:
        property - one of the constants with teh PROPERTY_ prefix defined in this class or subclasses.
        listener - the listener for this property change.
      • setConnectionColor

        void setConnectionColor​(java.awt.Color connectionColor)
        Sets the color for the connection segment.

        If this is not used or null is provided, the color of the corresponding trace will be used. If no underlying connection painter exists nothing will be done.

        Parameters:
        connectionColor - The connection segment color to set.
      • setConnectionPainter

        void setConnectionPainter​(IPointPainterConfigurableUI<?> connectionPainter)
        Note that the choice for the right point painter has to be taken with care: It is senseless to use an implementation that does not interconnect both coordinates given to IPointPainter.paintPoint(int, int, int, int, Graphics, ITracePoint2D) .

        Choosing a PointPainterLine will have the same visual effect as setting such an instance for the start point painter.

        Currently the only useful choice is the PointPainterLine or null (to make the connection segment invisible). But the interface is open enough to use implementations that would paint interpolated dots, discs, squares,... whatever you think of (contribute!).

        Parameters:
        connectionPainter - The connection segmentPainter to set.
      • setEndPointColor

        void setEndPointColor​(java.awt.Color endPointColor)
        Sets the color for the end point.

        If this is not used or null is provided, the color of the corresponding trace will be used. If no underlying end point painter exists nothing will be done.

        Parameters:
        endPointColor - The end point color to set.
      • setEndPointPainter

        void setEndPointPainter​(IPointPainterConfigurableUI<?> endPointPainter)
        Sets the painter for the end point of the error bar.

        Note that the choice for the right point painter has to be taken with care: It is senseless to use an implementation that interconnects both coordinates given to IPointPainter.paintPoint(int, int, int, int, Graphics, ITracePoint2D).

        Choosing a PointPainterLine will have the same visual effect as setting such an instance for the connection segment painter.

        Parameters:
        endPointPainter - The end point painter to set.
      • setStartPointColor

        void setStartPointColor​(java.awt.Color startPointColor)
        Sets the color for the start point.

        If this is not used or null is provided, the color of the corresponding trace will be used. If no underlying start point painter exists nothing will be done.

        Parameters:
        startPointColor - The start point color to set.