本文整理汇总了Java中java.awt.RenderingHints.VALUE_RENDER_QUALITY属性的典型用法代码示例。如果您正苦于以下问题:Java RenderingHints.VALUE_RENDER_QUALITY属性的具体用法?Java RenderingHints.VALUE_RENDER_QUALITY怎么用?Java RenderingHints.VALUE_RENDER_QUALITY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.awt.RenderingHints
的用法示例。
在下文中一共展示了RenderingHints.VALUE_RENDER_QUALITY属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
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();
}
示例2: AffineTransformOp
/**
* 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;
}
}