Java Code Examples for java.awt.RenderingHints.Key

The following examples show how to use java.awt.RenderingHints.Key. These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: pumpernickel   Source File: RenderingHintsSerializationWrapper.java    License: MIT License 5 votes vote down vote up
public static Key getKey(String keyName) {
	for (RenderingHints.Key key : ALL_RENDERING_HINT_KEYS) {
		if (key.toString().equals(keyName))
			return key;
	}

	// If you reach this exception: you may need to adjust
	// ALL_RENDERING_HINT_KEYS.
	// It's public & static so you can easily add new keys.
	// Just make sure you new key has a unique toString() method.
	throw new IllegalArgumentException("Unsupported key name: " + keyName);
}
 
Example 2
Source Project: youkefu   Source File: NullResizer.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Instantiates the {@code NullResizer} which draws the source image at
 * the origin of the destination image.
 */
public NullResizer()
{
	this(
			RenderingHints.VALUE_INTERPOLATION_BILINEAR,
			Collections.<Key, Object>emptyMap()
	);
}
 
Example 3
Source Project: jdk8u-jdk   Source File: SunGraphics2D.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds a number of preferences for the rendering algorithms.
 * Hint categories include controls for rendering quality and
 * overall time/quality trade-off in the rendering process.
 * @param hints The rendering hints to be set
 * @see RenderingHints
 */
public void addRenderingHints(Map<?,?> hints) {
    boolean customHintPresent = false;
    Iterator<?> iter = hints.keySet().iterator();
    while (iter.hasNext()) {
        Object key = iter.next();
        if (key == SunHints.KEY_RENDERING ||
            key == SunHints.KEY_ANTIALIASING ||
            key == SunHints.KEY_TEXT_ANTIALIASING ||
            key == SunHints.KEY_FRACTIONALMETRICS ||
            key == SunHints.KEY_TEXT_ANTIALIAS_LCD_CONTRAST ||
            key == SunHints.KEY_STROKE_CONTROL ||
            key == SunHints.KEY_INTERPOLATION)
        {
            setRenderingHint((Key) key, hints.get(key));
        } else {
            customHintPresent = true;
        }
    }
    if (customHintPresent) {
        if (this.hints == null) {
            this.hints = makeHints(hints);
        } else {
            this.hints.putAll(hints);
        }
    }
}
 
Example 4
Source Project: TencentKona-8   Source File: SunGraphics2D.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds a number of preferences for the rendering algorithms.
 * Hint categories include controls for rendering quality and
 * overall time/quality trade-off in the rendering process.
 * @param hints The rendering hints to be set
 * @see RenderingHints
 */
public void addRenderingHints(Map<?,?> hints) {
    boolean customHintPresent = false;
    Iterator<?> iter = hints.keySet().iterator();
    while (iter.hasNext()) {
        Object key = iter.next();
        if (key == SunHints.KEY_RENDERING ||
            key == SunHints.KEY_ANTIALIASING ||
            key == SunHints.KEY_TEXT_ANTIALIASING ||
            key == SunHints.KEY_FRACTIONALMETRICS ||
            key == SunHints.KEY_TEXT_ANTIALIAS_LCD_CONTRAST ||
            key == SunHints.KEY_STROKE_CONTROL ||
            key == SunHints.KEY_INTERPOLATION)
        {
            setRenderingHint((Key) key, hints.get(key));
        } else {
            customHintPresent = true;
        }
    }
    if (customHintPresent) {
        if (this.hints == null) {
            this.hints = makeHints(hints);
        } else {
            this.hints.putAll(hints);
        }
    }
}
 
Example 5
Source Project: jdk8u-jdk   Source File: SunGraphics2D.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the preferences for the rendering algorithms.
 * Hint categories include controls for rendering quality and
 * overall time/quality trade-off in the rendering process.
 * @param hints The rendering hints to be set
 * @see RenderingHints
 */
public void setRenderingHints(Map<?,?> hints) {
    this.hints = null;
    renderHint = SunHints.INTVAL_RENDER_DEFAULT;
    antialiasHint = SunHints.INTVAL_ANTIALIAS_OFF;
    textAntialiasHint = SunHints.INTVAL_TEXT_ANTIALIAS_DEFAULT;
    fractionalMetricsHint = SunHints.INTVAL_FRACTIONALMETRICS_OFF;
    lcdTextContrast = lcdTextContrastDefaultValue;
    interpolationHint = -1;
    interpolationType = AffineTransformOp.TYPE_NEAREST_NEIGHBOR;
    boolean customHintPresent = false;
    Iterator<?> iter = hints.keySet().iterator();
    while (iter.hasNext()) {
        Object key = iter.next();
        if (key == SunHints.KEY_RENDERING ||
            key == SunHints.KEY_ANTIALIASING ||
            key == SunHints.KEY_TEXT_ANTIALIASING ||
            key == SunHints.KEY_FRACTIONALMETRICS ||
            key == SunHints.KEY_TEXT_ANTIALIAS_LCD_CONTRAST ||
            key == SunHints.KEY_STROKE_CONTROL ||
            key == SunHints.KEY_INTERPOLATION)
        {
            setRenderingHint((Key) key, hints.get(key));
        } else {
            customHintPresent = true;
        }
    }
    if (customHintPresent) {
        this.hints = makeHints(hints);
    }
    invalidatePipe();
}
 
Example 6
Source Project: jdk8u60   Source File: SunGraphics2D.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the preferences for the rendering algorithms.
 * Hint categories include controls for rendering quality and
 * overall time/quality trade-off in the rendering process.
 * @param hints The rendering hints to be set
 * @see RenderingHints
 */
public void setRenderingHints(Map<?,?> hints) {
    this.hints = null;
    renderHint = SunHints.INTVAL_RENDER_DEFAULT;
    antialiasHint = SunHints.INTVAL_ANTIALIAS_OFF;
    textAntialiasHint = SunHints.INTVAL_TEXT_ANTIALIAS_DEFAULT;
    fractionalMetricsHint = SunHints.INTVAL_FRACTIONALMETRICS_OFF;
    lcdTextContrast = lcdTextContrastDefaultValue;
    interpolationHint = -1;
    interpolationType = AffineTransformOp.TYPE_NEAREST_NEIGHBOR;
    boolean customHintPresent = false;
    Iterator<?> iter = hints.keySet().iterator();
    while (iter.hasNext()) {
        Object key = iter.next();
        if (key == SunHints.KEY_RENDERING ||
            key == SunHints.KEY_ANTIALIASING ||
            key == SunHints.KEY_TEXT_ANTIALIASING ||
            key == SunHints.KEY_FRACTIONALMETRICS ||
            key == SunHints.KEY_TEXT_ANTIALIAS_LCD_CONTRAST ||
            key == SunHints.KEY_STROKE_CONTROL ||
            key == SunHints.KEY_INTERPOLATION)
        {
            setRenderingHint((Key) key, hints.get(key));
        } else {
            customHintPresent = true;
        }
    }
    if (customHintPresent) {
        this.hints = makeHints(hints);
    }
    invalidatePipe();
}
 
Example 7
Source Project: jdk8u-jdk   Source File: SunGraphics2D.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the preferences for the rendering algorithms.
 * Hint categories include controls for rendering quality and
 * overall time/quality trade-off in the rendering process.
 * @param hints The rendering hints to be set
 * @see RenderingHints
 */
public void setRenderingHints(Map<?,?> hints) {
    this.hints = null;
    renderHint = SunHints.INTVAL_RENDER_DEFAULT;
    antialiasHint = SunHints.INTVAL_ANTIALIAS_OFF;
    textAntialiasHint = SunHints.INTVAL_TEXT_ANTIALIAS_DEFAULT;
    fractionalMetricsHint = SunHints.INTVAL_FRACTIONALMETRICS_OFF;
    lcdTextContrast = lcdTextContrastDefaultValue;
    interpolationHint = -1;
    interpolationType = AffineTransformOp.TYPE_NEAREST_NEIGHBOR;
    boolean customHintPresent = false;
    Iterator<?> iter = hints.keySet().iterator();
    while (iter.hasNext()) {
        Object key = iter.next();
        if (key == SunHints.KEY_RENDERING ||
            key == SunHints.KEY_ANTIALIASING ||
            key == SunHints.KEY_TEXT_ANTIALIASING ||
            key == SunHints.KEY_FRACTIONALMETRICS ||
            key == SunHints.KEY_TEXT_ANTIALIAS_LCD_CONTRAST ||
            key == SunHints.KEY_STROKE_CONTROL ||
            key == SunHints.KEY_INTERPOLATION)
        {
            setRenderingHint((Key) key, hints.get(key));
        } else {
            customHintPresent = true;
        }
    }
    if (customHintPresent) {
        this.hints = makeHints(hints);
    }
    invalidatePipe();
}
 
Example 8
Source Project: jdk8u_jdk   Source File: SunGraphics2D.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the preferences for the rendering algorithms.
 * Hint categories include controls for rendering quality and
 * overall time/quality trade-off in the rendering process.
 * @param hints The rendering hints to be set
 * @see RenderingHints
 */
public void setRenderingHints(Map<?,?> hints) {
    this.hints = null;
    renderHint = SunHints.INTVAL_RENDER_DEFAULT;
    antialiasHint = SunHints.INTVAL_ANTIALIAS_OFF;
    textAntialiasHint = SunHints.INTVAL_TEXT_ANTIALIAS_DEFAULT;
    fractionalMetricsHint = SunHints.INTVAL_FRACTIONALMETRICS_OFF;
    lcdTextContrast = lcdTextContrastDefaultValue;
    interpolationHint = -1;
    interpolationType = AffineTransformOp.TYPE_NEAREST_NEIGHBOR;
    boolean customHintPresent = false;
    Iterator<?> iter = hints.keySet().iterator();
    while (iter.hasNext()) {
        Object key = iter.next();
        if (key == SunHints.KEY_RENDERING ||
            key == SunHints.KEY_ANTIALIASING ||
            key == SunHints.KEY_TEXT_ANTIALIASING ||
            key == SunHints.KEY_FRACTIONALMETRICS ||
            key == SunHints.KEY_TEXT_ANTIALIAS_LCD_CONTRAST ||
            key == SunHints.KEY_STROKE_CONTROL ||
            key == SunHints.KEY_INTERPOLATION)
        {
            setRenderingHint((Key) key, hints.get(key));
        } else {
            customHintPresent = true;
        }
    }
    if (customHintPresent) {
        this.hints = makeHints(hints);
    }
    invalidatePipe();
}
 
Example 9
/**
 * Returns the preferences for the rendering algorithms.
 * @param hintCategory The category of hint to be set. The strings
 * are defined in the RenderingHints class.
 * @return The preferences for rendering algorithms. The strings
 * are defined in the RenderingHints class.
 * @see RenderingHints
 */
public Object getRenderingHint(Key hintKey) {
    if (hints != null) {
        return hints.get(hintKey);
    }
    if (!(hintKey instanceof SunHints.Key)) {
        return null;
    }
    int keyindex = ((SunHints.Key)hintKey).getIndex();
    switch (keyindex) {
    case SunHints.INTKEY_RENDERING:
        return SunHints.Value.get(SunHints.INTKEY_RENDERING,
                                  renderHint);
    case SunHints.INTKEY_ANTIALIASING:
        return SunHints.Value.get(SunHints.INTKEY_ANTIALIASING,
                                  antialiasHint);
    case SunHints.INTKEY_TEXT_ANTIALIASING:
        return SunHints.Value.get(SunHints.INTKEY_TEXT_ANTIALIASING,
                                  textAntialiasHint);
    case SunHints.INTKEY_FRACTIONALMETRICS:
        return SunHints.Value.get(SunHints.INTKEY_FRACTIONALMETRICS,
                                  fractionalMetricsHint);
    case SunHints.INTKEY_AATEXT_LCD_CONTRAST:
        return new Integer(lcdTextContrast);
    case SunHints.INTKEY_INTERPOLATION:
        switch (interpolationHint) {
        case SunHints.INTVAL_INTERPOLATION_NEAREST_NEIGHBOR:
            return SunHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR;
        case SunHints.INTVAL_INTERPOLATION_BILINEAR:
            return SunHints.VALUE_INTERPOLATION_BILINEAR;
        case SunHints.INTVAL_INTERPOLATION_BICUBIC:
            return SunHints.VALUE_INTERPOLATION_BICUBIC;
        }
        return null;
    case SunHints.INTKEY_STROKE_CONTROL:
        return SunHints.Value.get(SunHints.INTKEY_STROKE_CONTROL,
                                  strokeHint);
    }
    return null;
}
 
Example 10
Source Project: openjdk-jdk8u   Source File: SunGraphics2D.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the preferences for the rendering algorithms.
 * Hint categories include controls for rendering quality and
 * overall time/quality trade-off in the rendering process.
 * @param hints The rendering hints to be set
 * @see RenderingHints
 */
public void setRenderingHints(Map<?,?> hints) {
    this.hints = null;
    renderHint = SunHints.INTVAL_RENDER_DEFAULT;
    antialiasHint = SunHints.INTVAL_ANTIALIAS_OFF;
    textAntialiasHint = SunHints.INTVAL_TEXT_ANTIALIAS_DEFAULT;
    fractionalMetricsHint = SunHints.INTVAL_FRACTIONALMETRICS_OFF;
    lcdTextContrast = lcdTextContrastDefaultValue;
    interpolationHint = -1;
    interpolationType = AffineTransformOp.TYPE_NEAREST_NEIGHBOR;
    boolean customHintPresent = false;
    Iterator<?> iter = hints.keySet().iterator();
    while (iter.hasNext()) {
        Object key = iter.next();
        if (key == SunHints.KEY_RENDERING ||
            key == SunHints.KEY_ANTIALIASING ||
            key == SunHints.KEY_TEXT_ANTIALIASING ||
            key == SunHints.KEY_FRACTIONALMETRICS ||
            key == SunHints.KEY_TEXT_ANTIALIAS_LCD_CONTRAST ||
            key == SunHints.KEY_STROKE_CONTROL ||
            key == SunHints.KEY_INTERPOLATION)
        {
            setRenderingHint((Key) key, hints.get(key));
        } else {
            customHintPresent = true;
        }
    }
    if (customHintPresent) {
        this.hints = makeHints(hints);
    }
    invalidatePipe();
}
 
Example 11
Source Project: openjdk-8   Source File: SunGraphics2D.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the preferences for the rendering algorithms.
 * @param hintCategory The category of hint to be set. The strings
 * are defined in the RenderingHints class.
 * @return The preferences for rendering algorithms. The strings
 * are defined in the RenderingHints class.
 * @see RenderingHints
 */
public Object getRenderingHint(Key hintKey) {
    if (hints != null) {
        return hints.get(hintKey);
    }
    if (!(hintKey instanceof SunHints.Key)) {
        return null;
    }
    int keyindex = ((SunHints.Key)hintKey).getIndex();
    switch (keyindex) {
    case SunHints.INTKEY_RENDERING:
        return SunHints.Value.get(SunHints.INTKEY_RENDERING,
                                  renderHint);
    case SunHints.INTKEY_ANTIALIASING:
        return SunHints.Value.get(SunHints.INTKEY_ANTIALIASING,
                                  antialiasHint);
    case SunHints.INTKEY_TEXT_ANTIALIASING:
        return SunHints.Value.get(SunHints.INTKEY_TEXT_ANTIALIASING,
                                  textAntialiasHint);
    case SunHints.INTKEY_FRACTIONALMETRICS:
        return SunHints.Value.get(SunHints.INTKEY_FRACTIONALMETRICS,
                                  fractionalMetricsHint);
    case SunHints.INTKEY_AATEXT_LCD_CONTRAST:
        return new Integer(lcdTextContrast);
    case SunHints.INTKEY_INTERPOLATION:
        switch (interpolationHint) {
        case SunHints.INTVAL_INTERPOLATION_NEAREST_NEIGHBOR:
            return SunHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR;
        case SunHints.INTVAL_INTERPOLATION_BILINEAR:
            return SunHints.VALUE_INTERPOLATION_BILINEAR;
        case SunHints.INTVAL_INTERPOLATION_BICUBIC:
            return SunHints.VALUE_INTERPOLATION_BICUBIC;
        }
        return null;
    case SunHints.INTKEY_STROKE_CONTROL:
        return SunHints.Value.get(SunHints.INTKEY_STROKE_CONTROL,
                                  strokeHint);
    }
    return null;
}
 
Example 12
/**
 * Adds a number of preferences for the rendering algorithms.
 * Hint categories include controls for rendering quality and
 * overall time/quality trade-off in the rendering process.
 * @param hints The rendering hints to be set
 * @see RenderingHints
 */
public void addRenderingHints(Map<?,?> hints) {
    boolean customHintPresent = false;
    Iterator<?> iter = hints.keySet().iterator();
    while (iter.hasNext()) {
        Object key = iter.next();
        if (key == SunHints.KEY_RENDERING ||
            key == SunHints.KEY_ANTIALIASING ||
            key == SunHints.KEY_TEXT_ANTIALIASING ||
            key == SunHints.KEY_FRACTIONALMETRICS ||
            key == SunHints.KEY_TEXT_ANTIALIAS_LCD_CONTRAST ||
            key == SunHints.KEY_STROKE_CONTROL ||
            key == SunHints.KEY_INTERPOLATION)
        {
            setRenderingHint((Key) key, hints.get(key));
        } else {
            customHintPresent = true;
        }
    }
    if (customHintPresent) {
        if (this.hints == null) {
            this.hints = makeHints(hints);
        } else {
            this.hints.putAll(hints);
        }
    }
}
 
Example 13
/**
 * Sets the preferences for the rendering algorithms.
 * Hint categories include controls for rendering quality and
 * overall time/quality trade-off in the rendering process.
 * @param hints The rendering hints to be set
 * @see RenderingHints
 */
public void setRenderingHints(Map<?,?> hints) {
    this.hints = null;
    renderHint = SunHints.INTVAL_RENDER_DEFAULT;
    antialiasHint = SunHints.INTVAL_ANTIALIAS_OFF;
    textAntialiasHint = SunHints.INTVAL_TEXT_ANTIALIAS_DEFAULT;
    fractionalMetricsHint = SunHints.INTVAL_FRACTIONALMETRICS_OFF;
    lcdTextContrast = lcdTextContrastDefaultValue;
    interpolationHint = -1;
    interpolationType = AffineTransformOp.TYPE_NEAREST_NEIGHBOR;
    boolean customHintPresent = false;
    Iterator<?> iter = hints.keySet().iterator();
    while (iter.hasNext()) {
        Object key = iter.next();
        if (key == SunHints.KEY_RENDERING ||
            key == SunHints.KEY_ANTIALIASING ||
            key == SunHints.KEY_TEXT_ANTIALIASING ||
            key == SunHints.KEY_FRACTIONALMETRICS ||
            key == SunHints.KEY_TEXT_ANTIALIAS_LCD_CONTRAST ||
            key == SunHints.KEY_STROKE_CONTROL ||
            key == SunHints.KEY_INTERPOLATION)
        {
            setRenderingHint((Key) key, hints.get(key));
        } else {
            customHintPresent = true;
        }
    }
    if (customHintPresent) {
        this.hints = makeHints(hints);
    }
    invalidatePipe();
}
 
Example 14
Source Project: openjdk-jdk9   Source File: SunGraphics2D.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the preferences for the rendering algorithms.
 * Hint categories include controls for rendering quality and
 * overall time/quality trade-off in the rendering process.
 * @param hints The rendering hints to be set
 * @see RenderingHints
 */
public void setRenderingHints(Map<?,?> hints) {
    this.hints = null;
    renderHint = SunHints.INTVAL_RENDER_DEFAULT;
    antialiasHint = SunHints.INTVAL_ANTIALIAS_OFF;
    textAntialiasHint = SunHints.INTVAL_TEXT_ANTIALIAS_DEFAULT;
    fractionalMetricsHint = SunHints.INTVAL_FRACTIONALMETRICS_OFF;
    lcdTextContrast = lcdTextContrastDefaultValue;
    interpolationHint = -1;
    interpolationType = AffineTransformOp.TYPE_NEAREST_NEIGHBOR;
    boolean customHintPresent = false;
    Iterator<?> iter = hints.keySet().iterator();
    while (iter.hasNext()) {
        Object key = iter.next();
        if (key == SunHints.KEY_RENDERING ||
            key == SunHints.KEY_ANTIALIASING ||
            key == SunHints.KEY_TEXT_ANTIALIASING ||
            key == SunHints.KEY_FRACTIONALMETRICS ||
            key == SunHints.KEY_TEXT_ANTIALIAS_LCD_CONTRAST ||
            key == SunHints.KEY_STROKE_CONTROL ||
            key == SunHints.KEY_INTERPOLATION)
        {
            setRenderingHint((Key) key, hints.get(key));
        } else {
            customHintPresent = true;
        }
    }
    if (customHintPresent) {
        this.hints = makeHints(hints);
    }
    invalidatePipe();
}
 
Example 15
Source Project: jdk8u_jdk   Source File: SunGraphics2D.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns the preferences for the rendering algorithms.
 * @param hintCategory The category of hint to be set. The strings
 * are defined in the RenderingHints class.
 * @return The preferences for rendering algorithms. The strings
 * are defined in the RenderingHints class.
 * @see RenderingHints
 */
public Object getRenderingHint(Key hintKey) {
    if (hints != null) {
        return hints.get(hintKey);
    }
    if (!(hintKey instanceof SunHints.Key)) {
        return null;
    }
    int keyindex = ((SunHints.Key)hintKey).getIndex();
    switch (keyindex) {
    case SunHints.INTKEY_RENDERING:
        return SunHints.Value.get(SunHints.INTKEY_RENDERING,
                                  renderHint);
    case SunHints.INTKEY_ANTIALIASING:
        return SunHints.Value.get(SunHints.INTKEY_ANTIALIASING,
                                  antialiasHint);
    case SunHints.INTKEY_TEXT_ANTIALIASING:
        return SunHints.Value.get(SunHints.INTKEY_TEXT_ANTIALIASING,
                                  textAntialiasHint);
    case SunHints.INTKEY_FRACTIONALMETRICS:
        return SunHints.Value.get(SunHints.INTKEY_FRACTIONALMETRICS,
                                  fractionalMetricsHint);
    case SunHints.INTKEY_AATEXT_LCD_CONTRAST:
        return new Integer(lcdTextContrast);
    case SunHints.INTKEY_INTERPOLATION:
        switch (interpolationHint) {
        case SunHints.INTVAL_INTERPOLATION_NEAREST_NEIGHBOR:
            return SunHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR;
        case SunHints.INTVAL_INTERPOLATION_BILINEAR:
            return SunHints.VALUE_INTERPOLATION_BILINEAR;
        case SunHints.INTVAL_INTERPOLATION_BICUBIC:
            return SunHints.VALUE_INTERPOLATION_BICUBIC;
        }
        return null;
    case SunHints.INTKEY_STROKE_CONTROL:
        return SunHints.Value.get(SunHints.INTKEY_STROKE_CONTROL,
                                  strokeHint);
    case SunHints.INTKEY_RESOLUTION_VARIANT:
        return SunHints.Value.get(SunHints.INTKEY_RESOLUTION_VARIANT,
                                  resolutionVariantHint);
    }
    return null;
}
 
Example 16
Source Project: pumpernickel   Source File: VectorGraphics2D.java    License: MIT License 4 votes vote down vote up
@Override
public Object getRenderingHint(Key hintKey) {
	return context.getRenderingHint(hintKey);
}
 
Example 17
Source Project: ghidra   Source File: DockingMenuItemUI.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setRenderingHint(Key hintKey, Object hintValue) {
	g.setRenderingHint(hintKey, hintValue);
}
 
Example 18
Source Project: ghidra   Source File: Graphics2DWrapper.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Object getRenderingHint(Key hintKey) {
	return delegate.getRenderingHint(hintKey);
}
 
Example 19
Source Project: ghidra   Source File: HexOrDecimalInputTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setRenderingHint(Key hintKey, Object hintValue) {
	// no-op
}
 
Example 20
Source Project: ghidra   Source File: HexOrDecimalInputTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Object getRenderingHint(Key hintKey) {
	return null;
}
 
Example 21
Source Project: ghidra   Source File: TextLayoutGraphics.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setRenderingHint(Key hintKey, Object hintValue) {
	// stub
}
 
Example 22
Source Project: jdk8u-jdk   Source File: SunGraphics2D.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns the preferences for the rendering algorithms.
 * @param hintCategory The category of hint to be set. The strings
 * are defined in the RenderingHints class.
 * @return The preferences for rendering algorithms. The strings
 * are defined in the RenderingHints class.
 * @see RenderingHints
 */
public Object getRenderingHint(Key hintKey) {
    if (hints != null) {
        return hints.get(hintKey);
    }
    if (!(hintKey instanceof SunHints.Key)) {
        return null;
    }
    int keyindex = ((SunHints.Key)hintKey).getIndex();
    switch (keyindex) {
    case SunHints.INTKEY_RENDERING:
        return SunHints.Value.get(SunHints.INTKEY_RENDERING,
                                  renderHint);
    case SunHints.INTKEY_ANTIALIASING:
        return SunHints.Value.get(SunHints.INTKEY_ANTIALIASING,
                                  antialiasHint);
    case SunHints.INTKEY_TEXT_ANTIALIASING:
        return SunHints.Value.get(SunHints.INTKEY_TEXT_ANTIALIASING,
                                  textAntialiasHint);
    case SunHints.INTKEY_FRACTIONALMETRICS:
        return SunHints.Value.get(SunHints.INTKEY_FRACTIONALMETRICS,
                                  fractionalMetricsHint);
    case SunHints.INTKEY_AATEXT_LCD_CONTRAST:
        return new Integer(lcdTextContrast);
    case SunHints.INTKEY_INTERPOLATION:
        switch (interpolationHint) {
        case SunHints.INTVAL_INTERPOLATION_NEAREST_NEIGHBOR:
            return SunHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR;
        case SunHints.INTVAL_INTERPOLATION_BILINEAR:
            return SunHints.VALUE_INTERPOLATION_BILINEAR;
        case SunHints.INTVAL_INTERPOLATION_BICUBIC:
            return SunHints.VALUE_INTERPOLATION_BICUBIC;
        }
        return null;
    case SunHints.INTKEY_STROKE_CONTROL:
        return SunHints.Value.get(SunHints.INTKEY_STROKE_CONTROL,
                                  strokeHint);
    case SunHints.INTKEY_RESOLUTION_VARIANT:
        return SunHints.Value.get(SunHints.INTKEY_RESOLUTION_VARIANT,
                                  resolutionVariantHint);
    }
    return null;
}
 
Example 23
Source Project: TencentKona-8   Source File: SunGraphics2D.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns the preferences for the rendering algorithms.
 * @param hintCategory The category of hint to be set. The strings
 * are defined in the RenderingHints class.
 * @return The preferences for rendering algorithms. The strings
 * are defined in the RenderingHints class.
 * @see RenderingHints
 */
public Object getRenderingHint(Key hintKey) {
    if (hints != null) {
        return hints.get(hintKey);
    }
    if (!(hintKey instanceof SunHints.Key)) {
        return null;
    }
    int keyindex = ((SunHints.Key)hintKey).getIndex();
    switch (keyindex) {
    case SunHints.INTKEY_RENDERING:
        return SunHints.Value.get(SunHints.INTKEY_RENDERING,
                                  renderHint);
    case SunHints.INTKEY_ANTIALIASING:
        return SunHints.Value.get(SunHints.INTKEY_ANTIALIASING,
                                  antialiasHint);
    case SunHints.INTKEY_TEXT_ANTIALIASING:
        return SunHints.Value.get(SunHints.INTKEY_TEXT_ANTIALIASING,
                                  textAntialiasHint);
    case SunHints.INTKEY_FRACTIONALMETRICS:
        return SunHints.Value.get(SunHints.INTKEY_FRACTIONALMETRICS,
                                  fractionalMetricsHint);
    case SunHints.INTKEY_AATEXT_LCD_CONTRAST:
        return new Integer(lcdTextContrast);
    case SunHints.INTKEY_INTERPOLATION:
        switch (interpolationHint) {
        case SunHints.INTVAL_INTERPOLATION_NEAREST_NEIGHBOR:
            return SunHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR;
        case SunHints.INTVAL_INTERPOLATION_BILINEAR:
            return SunHints.VALUE_INTERPOLATION_BILINEAR;
        case SunHints.INTVAL_INTERPOLATION_BICUBIC:
            return SunHints.VALUE_INTERPOLATION_BICUBIC;
        }
        return null;
    case SunHints.INTKEY_STROKE_CONTROL:
        return SunHints.Value.get(SunHints.INTKEY_STROKE_CONTROL,
                                  strokeHint);
    case SunHints.INTKEY_RESOLUTION_VARIANT:
        return SunHints.Value.get(SunHints.INTKEY_RESOLUTION_VARIANT,
                                  resolutionVariantHint);
    }
    return null;
}
 
Example 24
Source Project: pumpernickel   Source File: Graphics2DContext.java    License: MIT License 4 votes vote down vote up
/**
 * @see java.awt.Graphics2D#setRenderingHint(Key, Object)
 */
public void setRenderingHint(Key hintKey, Object hintValue) {
	renderingHints.put(hintKey, hintValue);
}
 
Example 25
Source Project: proguard   Source File: OverrideGraphics2D.java    License: GNU General Public License v2.0 4 votes vote down vote up
public void setRenderingHint(Key hintKey, Object hintValue)
{
    graphics.setRenderingHint(hintKey, hintValue);
}
 
Example 26
Source Project: jdk8u60   Source File: SunGraphics2D.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns the preferences for the rendering algorithms.
 * @param hintCategory The category of hint to be set. The strings
 * are defined in the RenderingHints class.
 * @return The preferences for rendering algorithms. The strings
 * are defined in the RenderingHints class.
 * @see RenderingHints
 */
public Object getRenderingHint(Key hintKey) {
    if (hints != null) {
        return hints.get(hintKey);
    }
    if (!(hintKey instanceof SunHints.Key)) {
        return null;
    }
    int keyindex = ((SunHints.Key)hintKey).getIndex();
    switch (keyindex) {
    case SunHints.INTKEY_RENDERING:
        return SunHints.Value.get(SunHints.INTKEY_RENDERING,
                                  renderHint);
    case SunHints.INTKEY_ANTIALIASING:
        return SunHints.Value.get(SunHints.INTKEY_ANTIALIASING,
                                  antialiasHint);
    case SunHints.INTKEY_TEXT_ANTIALIASING:
        return SunHints.Value.get(SunHints.INTKEY_TEXT_ANTIALIASING,
                                  textAntialiasHint);
    case SunHints.INTKEY_FRACTIONALMETRICS:
        return SunHints.Value.get(SunHints.INTKEY_FRACTIONALMETRICS,
                                  fractionalMetricsHint);
    case SunHints.INTKEY_AATEXT_LCD_CONTRAST:
        return new Integer(lcdTextContrast);
    case SunHints.INTKEY_INTERPOLATION:
        switch (interpolationHint) {
        case SunHints.INTVAL_INTERPOLATION_NEAREST_NEIGHBOR:
            return SunHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR;
        case SunHints.INTVAL_INTERPOLATION_BILINEAR:
            return SunHints.VALUE_INTERPOLATION_BILINEAR;
        case SunHints.INTVAL_INTERPOLATION_BICUBIC:
            return SunHints.VALUE_INTERPOLATION_BICUBIC;
        }
        return null;
    case SunHints.INTKEY_STROKE_CONTROL:
        return SunHints.Value.get(SunHints.INTKEY_STROKE_CONTROL,
                                  strokeHint);
    case SunHints.INTKEY_RESOLUTION_VARIANT:
        return SunHints.Value.get(SunHints.INTKEY_RESOLUTION_VARIANT,
                                  resolutionVariantHint);
    }
    return null;
}
 
Example 27
Source Project: jmeter-plugins   Source File: Graphics2DEmul.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setRenderingHint(Key hintKey, Object hintValue) {
   throw new UnsupportedOperationException("Not supported yet.");
}
 
Example 28
Source Project: jmeter-plugins   Source File: TestGraphics.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setRenderingHint(Key hintKey, Object hintValue)
{
   throw new UnsupportedOperationException("Not supported yet.");
}
 
Example 29
Source Project: geowave   Source File: GeoWaveGTDataStoreFactory.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Map<Key, ?> getImplementationHints() {
  // No implementation hints required at this time
  return Collections.emptyMap();
}
 
Example 30
Source Project: hottub   Source File: SunGraphics2D.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns the preferences for the rendering algorithms.
 * @param hintCategory The category of hint to be set. The strings
 * are defined in the RenderingHints class.
 * @return The preferences for rendering algorithms. The strings
 * are defined in the RenderingHints class.
 * @see RenderingHints
 */
public Object getRenderingHint(Key hintKey) {
    if (hints != null) {
        return hints.get(hintKey);
    }
    if (!(hintKey instanceof SunHints.Key)) {
        return null;
    }
    int keyindex = ((SunHints.Key)hintKey).getIndex();
    switch (keyindex) {
    case SunHints.INTKEY_RENDERING:
        return SunHints.Value.get(SunHints.INTKEY_RENDERING,
                                  renderHint);
    case SunHints.INTKEY_ANTIALIASING:
        return SunHints.Value.get(SunHints.INTKEY_ANTIALIASING,
                                  antialiasHint);
    case SunHints.INTKEY_TEXT_ANTIALIASING:
        return SunHints.Value.get(SunHints.INTKEY_TEXT_ANTIALIASING,
                                  textAntialiasHint);
    case SunHints.INTKEY_FRACTIONALMETRICS:
        return SunHints.Value.get(SunHints.INTKEY_FRACTIONALMETRICS,
                                  fractionalMetricsHint);
    case SunHints.INTKEY_AATEXT_LCD_CONTRAST:
        return new Integer(lcdTextContrast);
    case SunHints.INTKEY_INTERPOLATION:
        switch (interpolationHint) {
        case SunHints.INTVAL_INTERPOLATION_NEAREST_NEIGHBOR:
            return SunHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR;
        case SunHints.INTVAL_INTERPOLATION_BILINEAR:
            return SunHints.VALUE_INTERPOLATION_BILINEAR;
        case SunHints.INTVAL_INTERPOLATION_BICUBIC:
            return SunHints.VALUE_INTERPOLATION_BICUBIC;
        }
        return null;
    case SunHints.INTKEY_STROKE_CONTROL:
        return SunHints.Value.get(SunHints.INTKEY_STROKE_CONTROL,
                                  strokeHint);
    case SunHints.INTKEY_RESOLUTION_VARIANT:
        return SunHints.Value.get(SunHints.INTKEY_RESOLUTION_VARIANT,
                                  resolutionVariantHint);
    }
    return null;
}