Class GanttRenderer

    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        For serialization.
        See Also:
        Constant Field Values
      • completePaint

        private transient java.awt.Paint completePaint
        The paint for displaying the percentage complete.
      • incompletePaint

        private transient java.awt.Paint incompletePaint
        The paint for displaying the incomplete part of a task.
      • startPercent

        private double startPercent
        Controls the starting edge of the progress indicator (expressed as a percentage of the overall bar width).
      • endPercent

        private double endPercent
        Controls the ending edge of the progress indicator (expressed as a percentage of the overall bar width).
    • Constructor Detail

      • GanttRenderer

        public GanttRenderer()
        Creates a new renderer.
    • Method Detail

      • getCompletePaint

        public java.awt.Paint getCompletePaint()
        Returns the paint used to show the percentage complete.
        Returns:
        The paint (never null).
        See Also:
        setCompletePaint(Paint)
      • setCompletePaint

        public void setCompletePaint​(java.awt.Paint paint)
        Sets the paint used to show the percentage complete and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        paint - the paint (null not permitted).
        See Also:
        getCompletePaint()
      • getIncompletePaint

        public java.awt.Paint getIncompletePaint()
        Returns the paint used to show the percentage incomplete.
        Returns:
        The paint (never null).
        See Also:
        setCompletePaint(Paint)
      • setIncompletePaint

        public void setIncompletePaint​(java.awt.Paint paint)
        Sets the paint used to show the percentage incomplete and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        paint - the paint (null not permitted).
        See Also:
        getIncompletePaint()
      • getStartPercent

        public double getStartPercent()
        Returns the position of the start of the progress indicator, as a percentage of the bar width.
        Returns:
        The start percent.
        See Also:
        setStartPercent(double)
      • setStartPercent

        public void setStartPercent​(double percent)
        Sets the position of the start of the progress indicator, as a percentage of the bar width, and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        percent - the percent.
        See Also:
        getStartPercent()
      • getEndPercent

        public double getEndPercent()
        Returns the position of the end of the progress indicator, as a percentage of the bar width.
        Returns:
        The end percent.
        See Also:
        setEndPercent(double)
      • setEndPercent

        public void setEndPercent​(double percent)
        Sets the position of the end of the progress indicator, as a percentage of the bar width, and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        percent - the percent.
        See Also:
        getEndPercent()
      • drawItem

        public void drawItem​(java.awt.Graphics2D g2,
                             CategoryItemRendererState state,
                             java.awt.geom.Rectangle2D dataArea,
                             CategoryPlot plot,
                             CategoryAxis domainAxis,
                             ValueAxis rangeAxis,
                             CategoryDataset dataset,
                             int row,
                             int column,
                             int pass)
        Draws the bar for a single (series, category) data item.
        Specified by:
        drawItem in interface CategoryItemRenderer
        Overrides:
        drawItem in class IntervalBarRenderer
        Parameters:
        g2 - the graphics device.
        state - the renderer state.
        dataArea - the data area.
        plot - the plot.
        domainAxis - the domain axis.
        rangeAxis - the range axis.
        dataset - the dataset.
        row - the row index (zero-based).
        column - the column index (zero-based).
        pass - the pass index.
      • drawTasks

        protected void drawTasks​(java.awt.Graphics2D g2,
                                 CategoryItemRendererState state,
                                 java.awt.geom.Rectangle2D dataArea,
                                 CategoryPlot plot,
                                 CategoryAxis domainAxis,
                                 ValueAxis rangeAxis,
                                 GanttCategoryDataset dataset,
                                 int row,
                                 int column)
        Draws the tasks/subtasks for one item.
        Parameters:
        g2 - the graphics device.
        state - the renderer state.
        dataArea - the data plot area.
        plot - the plot.
        domainAxis - the domain axis.
        rangeAxis - the range axis.
        dataset - the data.
        row - the row index (zero-based).
        column - the column index (zero-based).
      • drawTask

        protected void drawTask​(java.awt.Graphics2D g2,
                                CategoryItemRendererState state,
                                java.awt.geom.Rectangle2D dataArea,
                                CategoryPlot plot,
                                CategoryAxis domainAxis,
                                ValueAxis rangeAxis,
                                GanttCategoryDataset dataset,
                                int row,
                                int column)
        Draws a single task.
        Parameters:
        g2 - the graphics device.
        state - the renderer state.
        dataArea - the data plot area.
        plot - the plot.
        domainAxis - the domain axis.
        rangeAxis - the range axis.
        dataset - the data.
        row - the row index (zero-based).
        column - the column index (zero-based).
      • getItemMiddle

        public double getItemMiddle​(java.lang.Comparable rowKey,
                                    java.lang.Comparable columnKey,
                                    CategoryDataset dataset,
                                    CategoryAxis axis,
                                    java.awt.geom.Rectangle2D area,
                                    RectangleEdge edge)
        Returns the Java2D coordinate for the middle of the specified data item.
        Specified by:
        getItemMiddle in interface CategoryItemRenderer
        Overrides:
        getItemMiddle in class AbstractCategoryItemRenderer
        Parameters:
        rowKey - the row key.
        columnKey - the column key.
        dataset - the dataset.
        axis - the axis.
        area - the drawing area.
        edge - the edge along which the axis lies.
        Returns:
        The Java2D coordinate.
      • equals

        public boolean equals​(java.lang.Object obj)
        Tests this renderer for equality with an arbitrary object.
        Overrides:
        equals in class IntervalBarRenderer
        Parameters:
        obj - the object (null permitted).
        Returns:
        A boolean.
      • writeObject

        private void writeObject​(java.io.ObjectOutputStream stream)
                          throws java.io.IOException
        Provides serialization support.
        Parameters:
        stream - the output stream.
        Throws:
        java.io.IOException - if there is an I/O error.
      • readObject

        private void readObject​(java.io.ObjectInputStream stream)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Provides serialization support.
        Parameters:
        stream - the input stream.
        Throws:
        java.io.IOException - if there is an I/O error.
        java.lang.ClassNotFoundException - if there is a classpath problem.