org.jfree.ui.GradientPaintTransformer Java Examples

The following examples show how to use org.jfree.ui.GradientPaintTransformer. 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: StandardBarPainter.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Paints a single bar instance.
 *
 * @param g2  the graphics target.
 * @param renderer  the renderer.
 * @param row  the row index.
 * @param column  the column index.
 * @param bar  the bar
 * @param base  indicates which side of the rectangle is the base of the
 *              bar.
 */
@Override
public void paintBar(Graphics2D g2, BarRenderer renderer, int row,
        int column, RectangularShape bar, RectangleEdge base) {

    Paint itemPaint = renderer.getItemPaint(row, column);
    GradientPaintTransformer t = renderer.getGradientPaintTransformer();
    if (t != null && itemPaint instanceof GradientPaint) {
        itemPaint = t.transform((GradientPaint) itemPaint, bar);
    }
    g2.setPaint(itemPaint);
    g2.fill(bar);

    // draw the outline...
    if (renderer.isDrawBarOutline()) {
           // && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) {
        Stroke stroke = renderer.getItemOutlineStroke(row, column);
        Paint paint = renderer.getItemOutlinePaint(row, column);
        if (stroke != null && paint != null) {
            g2.setStroke(stroke);
            g2.setPaint(paint);
            g2.draw(bar);
        }
    }

}
 
Example #2
Source File: StandardXYBarPainter.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * Paints a single bar instance.
 *
 * @param g2  the graphics target.
 * @param renderer  the renderer.
 * @param row  the row index.
 * @param column  the column index.
 * @param bar  the bar
 * @param base  indicates which side of the rectangle is the base of the
 *              bar.
 */
@Override
public void paintBar(Graphics2D g2, XYBarRenderer renderer, int row,
        int column, RectangularShape bar, RectangleEdge base) {

    Paint itemPaint = renderer.getItemPaint(row, column);
    GradientPaintTransformer t = renderer.getGradientPaintTransformer();
    if (t != null && itemPaint instanceof GradientPaint) {
        itemPaint = t.transform((GradientPaint) itemPaint, bar);
    }
    g2.setPaint(itemPaint);
    g2.fill(bar);

    // draw the outline...
    if (renderer.isDrawBarOutline()) {
           // && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) {
        Stroke stroke = renderer.getItemOutlineStroke(row, column);
        Paint paint = renderer.getItemOutlinePaint(row, column);
        if (stroke != null && paint != null) {
            g2.setStroke(stroke);
            g2.setPaint(paint);
            g2.draw(bar);
        }
    }

}
 
Example #3
Source File: StandardXYBarPainter.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Paints a single bar instance.
 *
 * @param g2  the graphics target.
 * @param renderer  the renderer.
 * @param row  the row index.
 * @param column  the column index.
 * @param bar  the bar
 * @param base  indicates which side of the rectangle is the base of the
 *              bar.
 */
@Override
public void paintBar(Graphics2D g2, XYBarRenderer renderer, int row,
        int column, RectangularShape bar, RectangleEdge base) {

    Paint itemPaint = renderer.getItemPaint(row, column);
    GradientPaintTransformer t = renderer.getGradientPaintTransformer();
    if (t != null && itemPaint instanceof GradientPaint) {
        itemPaint = t.transform((GradientPaint) itemPaint, bar);
    }
    g2.setPaint(itemPaint);
    g2.fill(bar);

    // draw the outline...
    if (renderer.isDrawBarOutline()) {
           // && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) {
        Stroke stroke = renderer.getItemOutlineStroke(row, column);
        Paint paint = renderer.getItemOutlinePaint(row, column);
        if (stroke != null && paint != null) {
            g2.setStroke(stroke);
            g2.setPaint(paint);
            g2.draw(bar);
        }
    }

}
 
Example #4
Source File: StandardXYBarPainter.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Paints a single bar instance.
 *
 * @param g2  the graphics target.
 * @param renderer  the renderer.
 * @param row  the row index.
 * @param column  the column index.
 * @param bar  the bar
 * @param base  indicates which side of the rectangle is the base of the
 *              bar.
 */
@Override
public void paintBar(Graphics2D g2, XYBarRenderer renderer, int row,
        int column, RectangularShape bar, RectangleEdge base) {

    Paint itemPaint = renderer.getItemPaint(row, column);
    GradientPaintTransformer t = renderer.getGradientPaintTransformer();
    if (t != null && itemPaint instanceof GradientPaint) {
        itemPaint = t.transform((GradientPaint) itemPaint, bar);
    }
    g2.setPaint(itemPaint);
    g2.fill(bar);

    // draw the outline...
    if (renderer.isDrawBarOutline()) {
           // && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) {
        Stroke stroke = renderer.getItemOutlineStroke(row, column);
        Paint paint = renderer.getItemOutlinePaint(row, column);
        if (stroke != null && paint != null) {
            g2.setStroke(stroke);
            g2.setPaint(paint);
            g2.draw(bar);
        }
    }

}
 
Example #5
Source File: StandardXYBarPainter.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Paints a single bar instance.
 *
 * @param g2  the graphics target.
 * @param renderer  the renderer.
 * @param row  the row index.
 * @param column  the column index.
 * @param bar  the bar
 * @param base  indicates which side of the rectangle is the base of the
 *              bar.
 */
@Override
public void paintBar(Graphics2D g2, XYBarRenderer renderer, int row,
        int column, RectangularShape bar, RectangleEdge base) {

    Paint itemPaint = renderer.getItemPaint(row, column);
    GradientPaintTransformer t = renderer.getGradientPaintTransformer();
    if (t != null && itemPaint instanceof GradientPaint) {
        itemPaint = t.transform((GradientPaint) itemPaint, bar);
    }
    g2.setPaint(itemPaint);
    g2.fill(bar);

    // draw the outline...
    if (renderer.isDrawBarOutline()) {
           // && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) {
        Stroke stroke = renderer.getItemOutlineStroke(row, column);
        Paint paint = renderer.getItemOutlinePaint(row, column);
        if (stroke != null && paint != null) {
            g2.setStroke(stroke);
            g2.setPaint(paint);
            g2.draw(bar);
        }
    }

}
 
Example #6
Source File: StandardBarPainter.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Paints a single bar instance.
 *
 * @param g2  the graphics target.
 * @param renderer  the renderer.
 * @param row  the row index.
 * @param column  the column index.
 * @param bar  the bar
 * @param base  indicates which side of the rectangle is the base of the
 *              bar.
 */
@Override
public void paintBar(Graphics2D g2, BarRenderer renderer, int row,
        int column, RectangularShape bar, RectangleEdge base) {

    Paint itemPaint = renderer.getItemPaint(row, column);
    GradientPaintTransformer t = renderer.getGradientPaintTransformer();
    if (t != null && itemPaint instanceof GradientPaint) {
        itemPaint = t.transform((GradientPaint) itemPaint, bar);
    }
    g2.setPaint(itemPaint);
    g2.fill(bar);

    // draw the outline...
    if (renderer.isDrawBarOutline()) {
           // && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) {
        Stroke stroke = renderer.getItemOutlineStroke(row, column);
        Paint paint = renderer.getItemOutlinePaint(row, column);
        if (stroke != null && paint != null) {
            g2.setStroke(stroke);
            g2.setPaint(paint);
            g2.draw(bar);
        }
    }

}
 
Example #7
Source File: StandardXYBarPainter.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Paints a single bar instance.
 *
 * @param g2  the graphics target.
 * @param renderer  the renderer.
 * @param row  the row index.
 * @param column  the column index.
 * @param bar  the bar
 * @param base  indicates which side of the rectangle is the base of the
 *              bar.
 */
@Override
public void paintBar(Graphics2D g2, XYBarRenderer renderer, int row,
        int column, RectangularShape bar, RectangleEdge base) {

    Paint itemPaint = renderer.getItemPaint(row, column);
    GradientPaintTransformer t = renderer.getGradientPaintTransformer();
    if (t != null && itemPaint instanceof GradientPaint) {
        itemPaint = t.transform((GradientPaint) itemPaint, bar);
    }
    g2.setPaint(itemPaint);
    g2.fill(bar);

    // draw the outline...
    if (renderer.isDrawBarOutline()) {
           // && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) {
        Stroke stroke = renderer.getItemOutlineStroke(row, column);
        Paint paint = renderer.getItemOutlinePaint(row, column);
        if (stroke != null && paint != null) {
            g2.setStroke(stroke);
            g2.setPaint(paint);
            g2.draw(bar);
        }
    }

}
 
Example #8
Source File: StandardBarPainter.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Paints a single bar instance.
 *
 * @param g2  the graphics target.
 * @param renderer  the renderer.
 * @param row  the row index.
 * @param column  the column index.
 * @param bar  the bar
 * @param base  indicates which side of the rectangle is the base of the
 *              bar.
 */
@Override
public void paintBar(Graphics2D g2, BarRenderer renderer, int row,
        int column, RectangularShape bar, RectangleEdge base) {

    Paint itemPaint = renderer.getItemPaint(row, column);
    GradientPaintTransformer t = renderer.getGradientPaintTransformer();
    if (t != null && itemPaint instanceof GradientPaint) {
        itemPaint = t.transform((GradientPaint) itemPaint, bar);
    }
    g2.setPaint(itemPaint);
    g2.fill(bar);

    // draw the outline...
    if (renderer.isDrawBarOutline()) {
           // && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) {
        Stroke stroke = renderer.getItemOutlineStroke(row, column);
        Paint paint = renderer.getItemOutlinePaint(row, column);
        if (stroke != null && paint != null) {
            g2.setStroke(stroke);
            g2.setPaint(paint);
            g2.draw(bar);
        }
    }

}
 
Example #9
Source File: XYBarRenderer.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns a clone of the renderer.
 *
 * @return A clone.
 *
 * @throws CloneNotSupportedException  if the renderer cannot be cloned.
 */
@Override
public Object clone() throws CloneNotSupportedException {
    XYBarRenderer result = (XYBarRenderer) super.clone();
    if (this.gradientPaintTransformer != null) {
        result.gradientPaintTransformer = (GradientPaintTransformer)
            ObjectUtilities.clone(this.gradientPaintTransformer);
    }
    result.legendBar = ShapeUtilities.clone(this.legendBar);
    return result;
}
 
Example #10
Source File: IntervalMarkerTest.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
@Test
public void testEquals() {

    IntervalMarker m1 = new IntervalMarker(45.0, 50.0);
    IntervalMarker m2 = new IntervalMarker(45.0, 50.0);
    assertTrue(m1.equals(m2));
    assertTrue(m2.equals(m1));

    m1 = new IntervalMarker(44.0, 50.0);
    assertFalse(m1.equals(m2));
    m2 = new IntervalMarker(44.0, 50.0);
    assertTrue(m1.equals(m2));

    m1 = new IntervalMarker(44.0, 55.0);
    assertFalse(m1.equals(m2));
    m2 = new IntervalMarker(44.0, 55.0);
    assertTrue(m1.equals(m2));

    GradientPaintTransformer t = new StandardGradientPaintTransformer(
            GradientPaintTransformType.HORIZONTAL);
    m1.setGradientPaintTransformer(t);
    assertFalse(m1.equals(m2));
    m2.setGradientPaintTransformer(t);
    assertTrue(m1.equals(m2));

}
 
Example #11
Source File: XYBarRenderer.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns a clone of the renderer.
 *
 * @return A clone.
 *
 * @throws CloneNotSupportedException  if the renderer cannot be cloned.
 */
@Override
public Object clone() throws CloneNotSupportedException {
    XYBarRenderer result = (XYBarRenderer) super.clone();
    if (this.gradientPaintTransformer != null) {
        result.gradientPaintTransformer = (GradientPaintTransformer)
            ObjectUtilities.clone(this.gradientPaintTransformer);
    }
    result.legendBar = ShapeUtilities.clone(this.legendBar);
    return result;
}
 
Example #12
Source File: IntervalMarkerTest.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
@Test
public void testEquals() {

    IntervalMarker m1 = new IntervalMarker(45.0, 50.0);
    IntervalMarker m2 = new IntervalMarker(45.0, 50.0);
    assertTrue(m1.equals(m2));
    assertTrue(m2.equals(m1));

    m1 = new IntervalMarker(44.0, 50.0);
    assertFalse(m1.equals(m2));
    m2 = new IntervalMarker(44.0, 50.0);
    assertTrue(m1.equals(m2));

    m1 = new IntervalMarker(44.0, 55.0);
    assertFalse(m1.equals(m2));
    m2 = new IntervalMarker(44.0, 55.0);
    assertTrue(m1.equals(m2));

    GradientPaintTransformer t = new StandardGradientPaintTransformer(
            GradientPaintTransformType.HORIZONTAL);
    m1.setGradientPaintTransformer(t);
    assertFalse(m1.equals(m2));
    m2.setGradientPaintTransformer(t);
    assertTrue(m1.equals(m2));

}
 
Example #13
Source File: IntervalMarkerTest.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
@Test
public void testEquals() {

    IntervalMarker m1 = new IntervalMarker(45.0, 50.0);
    IntervalMarker m2 = new IntervalMarker(45.0, 50.0);
    assertTrue(m1.equals(m2));
    assertTrue(m2.equals(m1));

    m1 = new IntervalMarker(44.0, 50.0);
    assertFalse(m1.equals(m2));
    m2 = new IntervalMarker(44.0, 50.0);
    assertTrue(m1.equals(m2));

    m1 = new IntervalMarker(44.0, 55.0);
    assertFalse(m1.equals(m2));
    m2 = new IntervalMarker(44.0, 55.0);
    assertTrue(m1.equals(m2));

    GradientPaintTransformer t = new StandardGradientPaintTransformer(
            GradientPaintTransformType.HORIZONTAL);
    m1.setGradientPaintTransformer(t);
    assertFalse(m1.equals(m2));
    m2.setGradientPaintTransformer(t);
    assertTrue(m1.equals(m2));

}
 
Example #14
Source File: XYBarRenderer.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a clone of the renderer.
 *
 * @return A clone.
 *
 * @throws CloneNotSupportedException  if the renderer cannot be cloned.
 */
@Override
public Object clone() throws CloneNotSupportedException {
    XYBarRenderer result = (XYBarRenderer) super.clone();
    if (this.gradientPaintTransformer != null) {
        result.gradientPaintTransformer = (GradientPaintTransformer)
            ObjectUtilities.clone(this.gradientPaintTransformer);
    }
    result.legendBar = ShapeUtilities.clone(this.legendBar);
    return result;
}
 
Example #15
Source File: XYBarRenderer.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns a clone of the renderer.
 *
 * @return A clone.
 *
 * @throws CloneNotSupportedException  if the renderer cannot be cloned.
 */
@Override
public Object clone() throws CloneNotSupportedException {
    XYBarRenderer result = (XYBarRenderer) super.clone();
    if (this.gradientPaintTransformer != null) {
        result.gradientPaintTransformer = (GradientPaintTransformer)
            ObjectUtilities.clone(this.gradientPaintTransformer);
    }
    result.legendBar = ShapeUtilities.clone(this.legendBar);
    return result;
}
 
Example #16
Source File: IntervalMarkerTest.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
@Test
public void testEquals() {

    IntervalMarker m1 = new IntervalMarker(45.0, 50.0);
    IntervalMarker m2 = new IntervalMarker(45.0, 50.0);
    assertTrue(m1.equals(m2));
    assertTrue(m2.equals(m1));

    m1 = new IntervalMarker(44.0, 50.0);
    assertFalse(m1.equals(m2));
    m2 = new IntervalMarker(44.0, 50.0);
    assertTrue(m1.equals(m2));

    m1 = new IntervalMarker(44.0, 55.0);
    assertFalse(m1.equals(m2));
    m2 = new IntervalMarker(44.0, 55.0);
    assertTrue(m1.equals(m2));

    GradientPaintTransformer t = new StandardGradientPaintTransformer(
            GradientPaintTransformType.HORIZONTAL);
    m1.setGradientPaintTransformer(t);
    assertFalse(m1.equals(m2));
    m2.setGradientPaintTransformer(t);
    assertTrue(m1.equals(m2));

}
 
Example #17
Source File: IntervalMarkerTest.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
@Test
public void testEquals() {

    IntervalMarker m1 = new IntervalMarker(45.0, 50.0);
    IntervalMarker m2 = new IntervalMarker(45.0, 50.0);
    assertTrue(m1.equals(m2));
    assertTrue(m2.equals(m1));

    m1 = new IntervalMarker(44.0, 50.0);
    assertFalse(m1.equals(m2));
    m2 = new IntervalMarker(44.0, 50.0);
    assertTrue(m1.equals(m2));

    m1 = new IntervalMarker(44.0, 55.0);
    assertFalse(m1.equals(m2));
    m2 = new IntervalMarker(44.0, 55.0);
    assertTrue(m1.equals(m2));

    GradientPaintTransformer t = new StandardGradientPaintTransformer(
            GradientPaintTransformType.HORIZONTAL);
    m1.setGradientPaintTransformer(t);
    assertFalse(m1.equals(m2));
    m2.setGradientPaintTransformer(t);
    assertTrue(m1.equals(m2));

}
 
Example #18
Source File: BarRenderer.java    From opensim-gui with Apache License 2.0 4 votes vote down vote up
/**
 * Draws the bar for a single (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     CategoryItemRendererState state,
                     Rectangle2D dataArea,
                     CategoryPlot plot,
                     CategoryAxis domainAxis,
                     ValueAxis rangeAxis,
                     CategoryDataset dataset,
                     int row,
                     int column,
                     int pass) {

    // nothing is drawn for null values...
    Number dataValue = dataset.getValue(row, column);
    if (dataValue == null) {
        return;
    }
    
    double value = dataValue.doubleValue();
    
    PlotOrientation orientation = plot.getOrientation();
    double barW0 = calculateBarW0(plot, orientation, dataArea, domainAxis, 
            state, row, column);
    double[] barL0L1 = calculateBarL0L1(value);
    if (barL0L1 == null) {
        return;  // the bar is not visible
    }
    
    RectangleEdge edge = plot.getRangeAxisEdge();
    double transL0 = rangeAxis.valueToJava2D(barL0L1[0], dataArea, edge);
    double transL1 = rangeAxis.valueToJava2D(barL0L1[1], dataArea, edge);
    double barL0 = Math.min(transL0, transL1);
    double barLength = Math.max(Math.abs(transL1 - transL0), 
            getMinimumBarLength());

    // draw the bar...
    Rectangle2D bar = null;
    if (orientation == PlotOrientation.HORIZONTAL) {
        bar = new Rectangle2D.Double(barL0, barW0, barLength, 
                state.getBarWidth());
    }
    else {
        bar = new Rectangle2D.Double(barW0, barL0, state.getBarWidth(), 
                barLength);
    }
    Paint itemPaint = getItemPaint(row, column);
    GradientPaintTransformer t = getGradientPaintTransformer();
    if (t != null && itemPaint instanceof GradientPaint) {
        itemPaint = t.transform((GradientPaint) itemPaint, bar);
    }
    g2.setPaint(itemPaint);
    g2.fill(bar);

    // draw the outline...
    if (isDrawBarOutline() 
            && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) {
        Stroke stroke = getItemOutlineStroke(row, column);
        Paint paint = getItemOutlinePaint(row, column);
        if (stroke != null && paint != null) {
            g2.setStroke(stroke);
            g2.setPaint(paint);
            g2.draw(bar);
        }
    }

    CategoryItemLabelGenerator generator 
        = getItemLabelGenerator(row, column);
    if (generator != null && isItemLabelVisible(row, column)) {
        drawItemLabel(g2, dataset, row, column, plot, generator, bar, 
                (value < 0.0));
    }        

    // add an item entity, if this information is being collected
    EntityCollection entities = state.getEntityCollection();
    if (entities != null) {
        addItemEntity(entities, dataset, row, column, bar);
    }

}
 
Example #19
Source File: LegendItem.java    From opensim-gui with Apache License 2.0 3 votes vote down vote up
/**
 * Sets the transformer used when the fill paint is an instance of 
 * <code>GradientPaint</code>.
 * 
 * @param transformer  the transformer (<code>null</code> not permitted).
 * 
 * @since 1.0.4
 * 
 * @see #getFillPaintTransformer()
 */
public void setFillPaintTransformer(GradientPaintTransformer transformer) {
    if (transformer == null) { 
        throw new IllegalArgumentException("Null 'transformer' attribute.");
    }
    this.fillPaintTransformer = transformer;
}
 
Example #20
Source File: BarRenderer.java    From buffer_bci with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Returns the gradient paint transformer (an object used to transform
 * gradient paint objects to fit each bar).
 *
 * @return A transformer (<code>null</code> possible).
 *
 * @see #setGradientPaintTransformer(GradientPaintTransformer)
 */
public GradientPaintTransformer getGradientPaintTransformer() {
    return this.gradientPaintTransformer;
}
 
Example #21
Source File: XYAreaRenderer.java    From buffer_bci with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Sets the gradient paint transformer and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param transformer  the transformer (<code>null</code> not permitted).
 *
 * @since 1.0.14
 */
public void setGradientTransformer(GradientPaintTransformer transformer) {
    ParamChecks.nullNotPermitted(transformer, "transformer");
    this.gradientTransformer = transformer;
    fireChangeEvent();
}
 
Example #22
Source File: XYAreaRenderer.java    From SIMVA-SoS with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the gradient paint transformer.
 *
 * @return The gradient paint transformer (never <code>null</code>).
 *
 * @since 1.0.14
 */
public GradientPaintTransformer getGradientTransformer() {
    return this.gradientTransformer;
}
 
Example #23
Source File: BarRenderer.java    From opensim-gui with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the gradient paint transformer (an object used to transform 
 * gradient paint objects to fit each bar.
 * 
 * @return A transformer (<code>null</code> possible).
 * 
 * @see #setGradientPaintTransformer(GradientPaintTransformer)
 */    
public GradientPaintTransformer getGradientPaintTransformer() {
    return this.gradientPaintTransformer;    
}
 
Example #24
Source File: LegendItem.java    From ECG-Viewer with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the transformer used when the fill paint is an instance of
 * <code>GradientPaint</code>.
 *
 * @return The transformer (never <code>null</code>).
 *
 * @since 1.0.4
 *
 * @see #setFillPaintTransformer(GradientPaintTransformer)
 */
public GradientPaintTransformer getFillPaintTransformer() {
    return this.fillPaintTransformer;
}
 
Example #25
Source File: XYSplineRenderer.java    From buffer_bci with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Returns the gradient paint transformer, or <code>null</code>.
 * 
 * @return The gradient paint transformer (possibly <code>null</code>).
 * 
 * @since 1.0.17
 */
public GradientPaintTransformer getGradientPaintTransformer() {
    return this.gradientPaintTransformer;
}
 
Example #26
Source File: IntervalMarker.java    From ECG-Viewer with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the gradient paint transformer.
 *
 * @return The gradient paint transformer (possibly <code>null</code>).
 */
public GradientPaintTransformer getGradientPaintTransformer() {
    return this.gradientPaintTransformer;
}
 
Example #27
Source File: XYAreaRenderer.java    From buffer_bci with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Returns the gradient paint transformer.
 *
 * @return The gradient paint transformer (never <code>null</code>).
 *
 * @since 1.0.14
 */
public GradientPaintTransformer getGradientTransformer() {
    return this.gradientTransformer;
}
 
Example #28
Source File: DialBackground.java    From SIMVA-SoS with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the transformer used to adjust the coordinates of any
 * <code>GradientPaint</code> instance used for the background paint, and
 * sends a {@link DialLayerChangeEvent} to all registered listeners.
 *
 * @param t  the transformer (<code>null</code> not permitted).
 *
 * @see #getGradientPaintTransformer()
 */
public void setGradientPaintTransformer(GradientPaintTransformer t) {
    ParamChecks.nullNotPermitted(t, "t");
    this.gradientPaintTransformer = t;
    notifyListeners(new DialLayerChangeEvent(this));
}
 
Example #29
Source File: LegendItem.java    From buffer_bci with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Sets the transformer used when the fill paint is an instance of
 * <code>GradientPaint</code>.
 *
 * @param transformer  the transformer (<code>null</code> not permitted).
 *
 * @since 1.0.4
 *
 * @see #getFillPaintTransformer()
 */
public void setFillPaintTransformer(GradientPaintTransformer transformer) {
    ParamChecks.nullNotPermitted(transformer, "transformer");
    this.fillPaintTransformer = transformer;
}
 
Example #30
Source File: XYSplineRenderer.java    From SIMVA-SoS with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the gradient paint transformer and sends a 
 * {@link RendererChangeEvent} to all registered listeners.
 * 
 * @param gpt  the transformer (<code>null</code> permitted).
 * 
 * @since 1.0.17
 */
public void setGradientPaintTransformer(GradientPaintTransformer gpt) {
    this.gradientPaintTransformer = gpt;
    fireChangeEvent();
}