Java Code Examples for org.jfree.chart.plot.CategoryPlot#getOutlinePaint()

The following examples show how to use org.jfree.chart.plot.CategoryPlot#getOutlinePaint() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BarRenderer3D.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
public void drawOutline(Graphics2D g2, CategoryPlot plot,
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}
 
Example 2
Source File: BarRenderer3D.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
@Override
public void drawOutline(Graphics2D g2, CategoryPlot plot,
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}
 
Example 3
Source File: LineRenderer3D.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
@Override
public void drawOutline(Graphics2D g2, CategoryPlot plot,
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}
 
Example 4
Source File: BarRenderer3D.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
@Override
public void drawOutline(Graphics2D g2, CategoryPlot plot,
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}
 
Example 5
Source File: LineRenderer3D.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
@Override
public void drawOutline(Graphics2D g2, CategoryPlot plot,
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}
 
Example 6
Source File: BarRenderer3D.java    From opensim-gui with Apache License 2.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
public void drawOutline(Graphics2D g2, CategoryPlot plot, 
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}
 
Example 7
Source File: LineRenderer3D.java    From opensim-gui with Apache License 2.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
public void drawOutline(Graphics2D g2, CategoryPlot plot, 
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}
 
Example 8
Source File: BarRenderer3D.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
public void drawOutline(Graphics2D g2, CategoryPlot plot, 
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}
 
Example 9
Source File: LineRenderer3D.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
public void drawOutline(Graphics2D g2, CategoryPlot plot, 
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}
 
Example 10
Source File: LineRenderer3D.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
@Override
public void drawOutline(Graphics2D g2, CategoryPlot plot,
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}
 
Example 11
Source File: LineRenderer3D.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
public void drawOutline(Graphics2D g2, CategoryPlot plot,
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}
 
Example 12
Source File: BarRenderer3D.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
@Override
public void drawOutline(Graphics2D g2, CategoryPlot plot,
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}
 
Example 13
Source File: LineRenderer3D.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
@Override
public void drawOutline(Graphics2D g2, CategoryPlot plot,
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}
 
Example 14
Source File: BarRenderer3D.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
@Override
public void drawOutline(Graphics2D g2, CategoryPlot plot,
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}
 
Example 15
Source File: LineRenderer3D.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
@Override
public void drawOutline(Graphics2D g2, CategoryPlot plot,
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}
 
Example 16
Source File: BarRenderer3D.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
@Override
public void drawOutline(Graphics2D g2, CategoryPlot plot,
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}
 
Example 17
Source File: LineRenderer3D.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
@Override
public void drawOutline(Graphics2D g2, CategoryPlot plot,
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}
 
Example 18
Source File: BarRenderer3D.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Draws the outline for the plot.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area inside the axes.
 */
@Override
public void drawOutline(Graphics2D g2, CategoryPlot plot,
                        Rectangle2D dataArea) {

    float x0 = (float) dataArea.getX();
    float x1 = x0 + (float) Math.abs(this.xOffset);
    float x3 = (float) dataArea.getMaxX();
    float x2 = x3 - (float) Math.abs(this.xOffset);

    float y0 = (float) dataArea.getMaxY();
    float y1 = y0 - (float) Math.abs(this.yOffset);
    float y3 = (float) dataArea.getMinY();
    float y2 = y3 + (float) Math.abs(this.yOffset);

    GeneralPath clip = new GeneralPath();
    clip.moveTo(x0, y0);
    clip.lineTo(x0, y2);
    clip.lineTo(x1, y3);
    clip.lineTo(x3, y3);
    clip.lineTo(x3, y1);
    clip.lineTo(x2, y0);
    clip.closePath();

    // put an outline around the data area...
    Stroke outlineStroke = plot.getOutlineStroke();
    Paint outlinePaint = plot.getOutlinePaint();
    if ((outlineStroke != null) && (outlinePaint != null)) {
        g2.setStroke(outlineStroke);
        g2.setPaint(outlinePaint);
        g2.draw(clip);
    }

}