java.awt.RenderingHints.Key Java Examples

The following examples show how to use java.awt.RenderingHints.Key. 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: NullResizer.java    From youkefu with 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 #2
Source File: SunGraphics2D.java    From openjdk-jdk8u-backup with 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 #3
Source File: SunGraphics2D.java    From jdk8u-jdk with 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 #4
Source File: SunGraphics2D.java    From openjdk-jdk9 with 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 #5
Source File: SunGraphics2D.java    From openjdk-jdk8u with 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 File: SunGraphics2D.java    From openjdk-8-source with 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 #7
Source File: SunGraphics2D.java    From jdk8u-jdk with 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 #8
Source File: SunGraphics2D.java    From jdk8u_jdk with 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
Source File: SunGraphics2D.java    From openjdk-8 with 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 #10
Source File: SunGraphics2D.java    From openjdk-8-source with 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 #11
Source File: SunGraphics2D.java    From jdk8u-jdk with 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 #12
Source File: SunGraphics2D.java    From jdk8u60 with 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 #13
Source File: SunGraphics2D.java    From TencentKona-8 with 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 #14
Source File: RenderingHintsSerializationWrapper.java    From pumpernickel with 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 #15
Source File: GeoWaveGTDataStoreFactory.java    From geowave with 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 #16
Source File: SunGraphics2D.java    From jdk8u_jdk with 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 #17
Source File: Graphics2DContext.java    From pumpernickel with 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 #18
Source File: TestGraphics.java    From jmeter-plugins with 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 #19
Source File: SunGraphics2D.java    From hottub with 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 #20
Source File: VectorGraphics2D.java    From pumpernickel with MIT License 4 votes vote down vote up
@Override
public Object getRenderingHint(Key hintKey) {
	return context.getRenderingHint(hintKey);
}
 
Example #21
Source File: Graphics2DEmul.java    From jmeter-plugins with 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 #22
Source File: GeoWaveGTRasterFormatFactory.java    From geowave with Apache License 2.0 4 votes vote down vote up
@Override
public Map<Key, ?> getImplementationHints() {
  return null;
}
 
Example #23
Source File: HexOrDecimalInputTest.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
public void setRenderingHint(Key hintKey, Object hintValue) {
	// no-op
}
 
Example #24
Source File: TextLayoutGraphics.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
public void setRenderingHint(Key hintKey, Object hintValue) {
	// stub
}
 
Example #25
Source File: SunGraphics2D.java    From jdk8u-jdk with 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 #26
Source File: SunGraphics2D.java    From TencentKona-8 with 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 File: NonClearGraphics2D.java    From lwjgl3-awt with MIT License 4 votes vote down vote up
public void setRenderingHint(Key hintKey, Object hintValue) {
	delegate.setRenderingHint(hintKey, hintValue);
}
 
Example #28
Source File: SunGraphics2D.java    From jdk8u60 with 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 #29
Source File: SunGraphics2D.java    From openjdk-jdk8u-backup with 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 #30
Source File: OverrideGraphics2D.java    From proguard with GNU General Public License v2.0 4 votes vote down vote up
public void setRenderingHint(Key hintKey, Object hintValue)
{
    graphics.setRenderingHint(hintKey, hintValue);
}