Java Code Examples for java.awt.RenderingHints#VALUE_RENDER_SPEED

The following examples show how to use java.awt.RenderingHints#VALUE_RENDER_SPEED . 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: MultiGradientTest.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();

    if (source == cmbPaint) {
        paintType = (PaintType)cmbPaint.getSelectedItem();
    } else if (source == cmbCycle) {
        cycleMethod = (CycleMethod)cmbCycle.getSelectedItem();
    } else if (source == cmbSpace) {
        colorSpace = (ColorSpaceType)cmbSpace.getSelectedItem();
    } else if (source == cmbShape) {
        shapeType = (ShapeType)cmbShape.getSelectedItem();
    } else if (source == cmbXform) {
        xformType = (XformType)cmbXform.getSelectedItem();
    } else if (source == cbAntialias) {
        antialiasHint = cbAntialias.isSelected() ?
            RenderingHints.VALUE_ANTIALIAS_ON :
            RenderingHints.VALUE_ANTIALIAS_OFF;
    } else if (source == cbRender) {
        renderHint = cbRender.isSelected() ?
            RenderingHints.VALUE_RENDER_QUALITY :
            RenderingHints.VALUE_RENDER_SPEED;
    }

    gradientPanel.updatePaint();
}
 
Example 2
Source File: MultiGradientTest.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();

    if (source == cmbPaint) {
        paintType = (PaintType)cmbPaint.getSelectedItem();
    } else if (source == cmbCycle) {
        cycleMethod = (CycleMethod)cmbCycle.getSelectedItem();
    } else if (source == cmbSpace) {
        colorSpace = (ColorSpaceType)cmbSpace.getSelectedItem();
    } else if (source == cmbShape) {
        shapeType = (ShapeType)cmbShape.getSelectedItem();
    } else if (source == cmbXform) {
        xformType = (XformType)cmbXform.getSelectedItem();
    } else if (source == cbAntialias) {
        antialiasHint = cbAntialias.isSelected() ?
            RenderingHints.VALUE_ANTIALIAS_ON :
            RenderingHints.VALUE_ANTIALIAS_OFF;
    } else if (source == cbRender) {
        renderHint = cbRender.isSelected() ?
            RenderingHints.VALUE_RENDER_QUALITY :
            RenderingHints.VALUE_RENDER_SPEED;
    }

    gradientPanel.updatePaint();
}
 
Example 3
Source File: MultiGradientTest.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();

    if (source == cmbPaint) {
        paintType = (PaintType)cmbPaint.getSelectedItem();
    } else if (source == cmbCycle) {
        cycleMethod = (CycleMethod)cmbCycle.getSelectedItem();
    } else if (source == cmbSpace) {
        colorSpace = (ColorSpaceType)cmbSpace.getSelectedItem();
    } else if (source == cmbShape) {
        shapeType = (ShapeType)cmbShape.getSelectedItem();
    } else if (source == cmbXform) {
        xformType = (XformType)cmbXform.getSelectedItem();
    } else if (source == cbAntialias) {
        antialiasHint = cbAntialias.isSelected() ?
            RenderingHints.VALUE_ANTIALIAS_ON :
            RenderingHints.VALUE_ANTIALIAS_OFF;
    } else if (source == cbRender) {
        renderHint = cbRender.isSelected() ?
            RenderingHints.VALUE_RENDER_QUALITY :
            RenderingHints.VALUE_RENDER_SPEED;
    }

    gradientPanel.updatePaint();
}
 
Example 4
Source File: MultiGradientTest.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();

    if (source == cmbPaint) {
        paintType = (PaintType)cmbPaint.getSelectedItem();
    } else if (source == cmbCycle) {
        cycleMethod = (CycleMethod)cmbCycle.getSelectedItem();
    } else if (source == cmbSpace) {
        colorSpace = (ColorSpaceType)cmbSpace.getSelectedItem();
    } else if (source == cmbShape) {
        shapeType = (ShapeType)cmbShape.getSelectedItem();
    } else if (source == cmbXform) {
        xformType = (XformType)cmbXform.getSelectedItem();
    } else if (source == cbAntialias) {
        antialiasHint = cbAntialias.isSelected() ?
            RenderingHints.VALUE_ANTIALIAS_ON :
            RenderingHints.VALUE_ANTIALIAS_OFF;
    } else if (source == cbRender) {
        renderHint = cbRender.isSelected() ?
            RenderingHints.VALUE_RENDER_QUALITY :
            RenderingHints.VALUE_RENDER_SPEED;
    }

    gradientPanel.updatePaint();
}
 
Example 5
Source File: MultiGradientTest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();

    if (source == cmbPaint) {
        paintType = (PaintType)cmbPaint.getSelectedItem();
    } else if (source == cmbCycle) {
        cycleMethod = (CycleMethod)cmbCycle.getSelectedItem();
    } else if (source == cmbSpace) {
        colorSpace = (ColorSpaceType)cmbSpace.getSelectedItem();
    } else if (source == cmbShape) {
        shapeType = (ShapeType)cmbShape.getSelectedItem();
    } else if (source == cmbXform) {
        xformType = (XformType)cmbXform.getSelectedItem();
    } else if (source == cbAntialias) {
        antialiasHint = cbAntialias.isSelected() ?
            RenderingHints.VALUE_ANTIALIAS_ON :
            RenderingHints.VALUE_ANTIALIAS_OFF;
    } else if (source == cbRender) {
        renderHint = cbRender.isSelected() ?
            RenderingHints.VALUE_RENDER_QUALITY :
            RenderingHints.VALUE_RENDER_SPEED;
    }

    gradientPanel.updatePaint();
}
 
Example 6
Source File: MultiGradientTest.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();

    if (source == cmbPaint) {
        paintType = (PaintType)cmbPaint.getSelectedItem();
    } else if (source == cmbCycle) {
        cycleMethod = (CycleMethod)cmbCycle.getSelectedItem();
    } else if (source == cmbSpace) {
        colorSpace = (ColorSpaceType)cmbSpace.getSelectedItem();
    } else if (source == cmbShape) {
        shapeType = (ShapeType)cmbShape.getSelectedItem();
    } else if (source == cmbXform) {
        xformType = (XformType)cmbXform.getSelectedItem();
    } else if (source == cbAntialias) {
        antialiasHint = cbAntialias.isSelected() ?
            RenderingHints.VALUE_ANTIALIAS_ON :
            RenderingHints.VALUE_ANTIALIAS_OFF;
    } else if (source == cbRender) {
        renderHint = cbRender.isSelected() ?
            RenderingHints.VALUE_RENDER_QUALITY :
            RenderingHints.VALUE_RENDER_SPEED;
    }

    gradientPanel.updatePaint();
}
 
Example 7
Source File: MultiGradientTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();

    if (source == cmbPaint) {
        paintType = (PaintType)cmbPaint.getSelectedItem();
    } else if (source == cmbCycle) {
        cycleMethod = (CycleMethod)cmbCycle.getSelectedItem();
    } else if (source == cmbSpace) {
        colorSpace = (ColorSpaceType)cmbSpace.getSelectedItem();
    } else if (source == cmbShape) {
        shapeType = (ShapeType)cmbShape.getSelectedItem();
    } else if (source == cmbXform) {
        xformType = (XformType)cmbXform.getSelectedItem();
    } else if (source == cbAntialias) {
        antialiasHint = cbAntialias.isSelected() ?
            RenderingHints.VALUE_ANTIALIAS_ON :
            RenderingHints.VALUE_ANTIALIAS_OFF;
    } else if (source == cbRender) {
        renderHint = cbRender.isSelected() ?
            RenderingHints.VALUE_RENDER_QUALITY :
            RenderingHints.VALUE_RENDER_SPEED;
    }

    gradientPanel.updatePaint();
}
 
Example 8
Source File: MultiGradientTest.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();

    if (source == cmbPaint) {
        paintType = (PaintType)cmbPaint.getSelectedItem();
    } else if (source == cmbCycle) {
        cycleMethod = (CycleMethod)cmbCycle.getSelectedItem();
    } else if (source == cmbSpace) {
        colorSpace = (ColorSpaceType)cmbSpace.getSelectedItem();
    } else if (source == cmbShape) {
        shapeType = (ShapeType)cmbShape.getSelectedItem();
    } else if (source == cmbXform) {
        xformType = (XformType)cmbXform.getSelectedItem();
    } else if (source == cbAntialias) {
        antialiasHint = cbAntialias.isSelected() ?
            RenderingHints.VALUE_ANTIALIAS_ON :
            RenderingHints.VALUE_ANTIALIAS_OFF;
    } else if (source == cbRender) {
        renderHint = cbRender.isSelected() ?
            RenderingHints.VALUE_RENDER_QUALITY :
            RenderingHints.VALUE_RENDER_SPEED;
    }

    gradientPanel.updatePaint();
}
 
Example 9
Source File: MultiGradientTest.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();

    if (source == cmbPaint) {
        paintType = (PaintType)cmbPaint.getSelectedItem();
    } else if (source == cmbCycle) {
        cycleMethod = (CycleMethod)cmbCycle.getSelectedItem();
    } else if (source == cmbSpace) {
        colorSpace = (ColorSpaceType)cmbSpace.getSelectedItem();
    } else if (source == cmbShape) {
        shapeType = (ShapeType)cmbShape.getSelectedItem();
    } else if (source == cmbXform) {
        xformType = (XformType)cmbXform.getSelectedItem();
    } else if (source == cbAntialias) {
        antialiasHint = cbAntialias.isSelected() ?
            RenderingHints.VALUE_ANTIALIAS_ON :
            RenderingHints.VALUE_ANTIALIAS_OFF;
    } else if (source == cbRender) {
        renderHint = cbRender.isSelected() ?
            RenderingHints.VALUE_RENDER_QUALITY :
            RenderingHints.VALUE_RENDER_SPEED;
    }

    gradientPanel.updatePaint();
}
 
Example 10
Source File: MultiGradientTest.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();

    if (source == cmbPaint) {
        paintType = (PaintType)cmbPaint.getSelectedItem();
    } else if (source == cmbCycle) {
        cycleMethod = (CycleMethod)cmbCycle.getSelectedItem();
    } else if (source == cmbSpace) {
        colorSpace = (ColorSpaceType)cmbSpace.getSelectedItem();
    } else if (source == cmbShape) {
        shapeType = (ShapeType)cmbShape.getSelectedItem();
    } else if (source == cmbXform) {
        xformType = (XformType)cmbXform.getSelectedItem();
    } else if (source == cbAntialias) {
        antialiasHint = cbAntialias.isSelected() ?
            RenderingHints.VALUE_ANTIALIAS_ON :
            RenderingHints.VALUE_ANTIALIAS_OFF;
    } else if (source == cbRender) {
        renderHint = cbRender.isSelected() ?
            RenderingHints.VALUE_RENDER_QUALITY :
            RenderingHints.VALUE_RENDER_SPEED;
    }

    gradientPanel.updatePaint();
}
 
Example 11
Source File: MultiGradientTest.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();

    if (source == cmbPaint) {
        paintType = (PaintType)cmbPaint.getSelectedItem();
    } else if (source == cmbCycle) {
        cycleMethod = (CycleMethod)cmbCycle.getSelectedItem();
    } else if (source == cmbSpace) {
        colorSpace = (ColorSpaceType)cmbSpace.getSelectedItem();
    } else if (source == cmbShape) {
        shapeType = (ShapeType)cmbShape.getSelectedItem();
    } else if (source == cmbXform) {
        xformType = (XformType)cmbXform.getSelectedItem();
    } else if (source == cbAntialias) {
        antialiasHint = cbAntialias.isSelected() ?
            RenderingHints.VALUE_ANTIALIAS_ON :
            RenderingHints.VALUE_ANTIALIAS_OFF;
    } else if (source == cbRender) {
        renderHint = cbRender.isSelected() ?
            RenderingHints.VALUE_RENDER_QUALITY :
            RenderingHints.VALUE_RENDER_SPEED;
    }

    gradientPanel.updatePaint();
}
 
Example 12
Source File: MultiGradientTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();

    if (source == cmbPaint) {
        paintType = (PaintType)cmbPaint.getSelectedItem();
    } else if (source == cmbCycle) {
        cycleMethod = (CycleMethod)cmbCycle.getSelectedItem();
    } else if (source == cmbSpace) {
        colorSpace = (ColorSpaceType)cmbSpace.getSelectedItem();
    } else if (source == cmbShape) {
        shapeType = (ShapeType)cmbShape.getSelectedItem();
    } else if (source == cmbXform) {
        xformType = (XformType)cmbXform.getSelectedItem();
    } else if (source == cbAntialias) {
        antialiasHint = cbAntialias.isSelected() ?
            RenderingHints.VALUE_ANTIALIAS_ON :
            RenderingHints.VALUE_ANTIALIAS_OFF;
    } else if (source == cbRender) {
        renderHint = cbRender.isSelected() ?
            RenderingHints.VALUE_RENDER_QUALITY :
            RenderingHints.VALUE_RENDER_SPEED;
    }

    gradientPanel.updatePaint();
}
 
Example 13
Source File: MultiGradientTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();

    if (source == cmbPaint) {
        paintType = (PaintType)cmbPaint.getSelectedItem();
    } else if (source == cmbCycle) {
        cycleMethod = (CycleMethod)cmbCycle.getSelectedItem();
    } else if (source == cmbSpace) {
        colorSpace = (ColorSpaceType)cmbSpace.getSelectedItem();
    } else if (source == cmbShape) {
        shapeType = (ShapeType)cmbShape.getSelectedItem();
    } else if (source == cmbXform) {
        xformType = (XformType)cmbXform.getSelectedItem();
    } else if (source == cbAntialias) {
        antialiasHint = cbAntialias.isSelected() ?
            RenderingHints.VALUE_ANTIALIAS_ON :
            RenderingHints.VALUE_ANTIALIAS_OFF;
    } else if (source == cbRender) {
        renderHint = cbRender.isSelected() ?
            RenderingHints.VALUE_RENDER_QUALITY :
            RenderingHints.VALUE_RENDER_SPEED;
    }

    gradientPanel.updatePaint();
}
 
Example 14
Source File: AffineTransformOp.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Constructs an {@code AffineTransformOp} given an affine transform.
 * The interpolation type is determined from the
 * {@code RenderingHints} object.  If the interpolation hint is
 * defined, it will be used. Otherwise, if the rendering quality hint is
 * defined, the interpolation type is determined from its value.  If no
 * hints are specified ({@code hints} is null),
 * the interpolation type is {@link #TYPE_NEAREST_NEIGHBOR
 * TYPE_NEAREST_NEIGHBOR}.
 *
 * @param xform The {@code AffineTransform} to use for the
 * operation.
 *
 * @param hints The {@code RenderingHints} object used to specify
 * the interpolation type for the operation.
 *
 * @throws ImagingOpException if the transform is non-invertible.
 * @see java.awt.RenderingHints#KEY_INTERPOLATION
 * @see java.awt.RenderingHints#KEY_RENDERING
 */
public AffineTransformOp(AffineTransform xform, RenderingHints hints){
    validateTransform(xform);
    this.xform = (AffineTransform) xform.clone();
    this.hints = hints;

    if (hints != null) {
        Object value = hints.get(RenderingHints.KEY_INTERPOLATION);
        if (value == null) {
            value = hints.get(RenderingHints.KEY_RENDERING);
            if (value == RenderingHints.VALUE_RENDER_SPEED) {
                interpolationType = TYPE_NEAREST_NEIGHBOR;
            }
            else if (value == RenderingHints.VALUE_RENDER_QUALITY) {
                interpolationType = TYPE_BILINEAR;
            }
        }
        else if (value == RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR) {
            interpolationType = TYPE_NEAREST_NEIGHBOR;
        }
        else if (value == RenderingHints.VALUE_INTERPOLATION_BILINEAR) {
            interpolationType = TYPE_BILINEAR;
        }
        else if (value == RenderingHints.VALUE_INTERPOLATION_BICUBIC) {
            interpolationType = TYPE_BICUBIC;
        }
    }
    else {
        interpolationType = TYPE_NEAREST_NEIGHBOR;
    }
}
 
Example 15
Source File: AffineTransformOp.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructs an {@code AffineTransformOp} given an affine transform.
 * The interpolation type is determined from the
 * {@code RenderingHints} object.  If the interpolation hint is
 * defined, it will be used. Otherwise, if the rendering quality hint is
 * defined, the interpolation type is determined from its value.  If no
 * hints are specified ({@code hints} is null),
 * the interpolation type is {@link #TYPE_NEAREST_NEIGHBOR
 * TYPE_NEAREST_NEIGHBOR}.
 *
 * @param xform The {@code AffineTransform} to use for the
 * operation.
 *
 * @param hints The {@code RenderingHints} object used to specify
 * the interpolation type for the operation.
 *
 * @throws ImagingOpException if the transform is non-invertible.
 * @see java.awt.RenderingHints#KEY_INTERPOLATION
 * @see java.awt.RenderingHints#KEY_RENDERING
 */
public AffineTransformOp(AffineTransform xform, RenderingHints hints){
    validateTransform(xform);
    this.xform = (AffineTransform) xform.clone();
    this.hints = hints;

    if (hints != null) {
        Object value = hints.get(RenderingHints.KEY_INTERPOLATION);
        if (value == null) {
            value = hints.get(RenderingHints.KEY_RENDERING);
            if (value == RenderingHints.VALUE_RENDER_SPEED) {
                interpolationType = TYPE_NEAREST_NEIGHBOR;
            }
            else if (value == RenderingHints.VALUE_RENDER_QUALITY) {
                interpolationType = TYPE_BILINEAR;
            }
        }
        else if (value == RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR) {
            interpolationType = TYPE_NEAREST_NEIGHBOR;
        }
        else if (value == RenderingHints.VALUE_INTERPOLATION_BILINEAR) {
            interpolationType = TYPE_BILINEAR;
        }
        else if (value == RenderingHints.VALUE_INTERPOLATION_BICUBIC) {
            interpolationType = TYPE_BICUBIC;
        }
    }
    else {
        interpolationType = TYPE_NEAREST_NEIGHBOR;
    }
}
 
Example 16
Source File: ShadowEffect.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Apply blurring to the generate image
 * 
 * @param image The image to be blurred
 */
private void blur(BufferedImage image) {
	float[] matrix = GAUSSIAN_BLUR_KERNELS[blurKernelSize - 1];
	Kernel gaussianBlur1 = new Kernel(matrix.length, 1, matrix);
	Kernel gaussianBlur2 = new Kernel(1, matrix.length, matrix);
	RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED);
	ConvolveOp gaussianOp1 = new ConvolveOp(gaussianBlur1, ConvolveOp.EDGE_NO_OP, hints);
	ConvolveOp gaussianOp2 = new ConvolveOp(gaussianBlur2, ConvolveOp.EDGE_NO_OP, hints);
	BufferedImage scratchImage = EffectUtil.getScratchImage();
	for (int i = 0; i < blurPasses; i++) {
		gaussianOp1.filter(image, scratchImage);
		gaussianOp2.filter(scratchImage, image);
	}
}