Java Code Examples for java.awt.RenderingHints#VALUE_RENDER_DEFAULT

The following examples show how to use java.awt.RenderingHints#VALUE_RENDER_DEFAULT . 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: AbstractGraphics2D.java    From pumpernickel with MIT License 5 votes vote down vote up
public void reset() {
	hints = new RenderingHints(RenderingHints.KEY_RENDERING,
			RenderingHints.VALUE_RENDER_DEFAULT);
	composite = AlphaComposite.SrcOver;
	paint = Color.white;
	background = Color.white;
	stroke = new BasicStroke(1);
	transform = new AffineTransform();
	font = UIManager.getFont("Label.font") == null ? new Font("Default", 0,
			12) : UIManager.getFont("Label.font");
	clipping = null;
}
 
Example 2
Source File: AbstractGraphics2D.java    From pumpernickel with MIT License 5 votes vote down vote up
/** Clones the properties of the <code>AbstractGraphics2D</code> argument. */
public AbstractGraphics2D(AbstractGraphics2D g) {
	hints = new RenderingHints(RenderingHints.KEY_RENDERING,
			RenderingHints.VALUE_RENDER_DEFAULT);
	hints.remove(RenderingHints.KEY_RENDERING);
	hints.putAll(g.hints);
	composite = g.composite;
	paint = g.paint;
	background = g.background;
	stroke = g.stroke;
	transform = new AffineTransform();
	setClip(g.clipping); // set *before* transform
	transform.setTransform(g.transform);
	font = g.font;

	int i = g.name.lastIndexOf(' ');
	if (i == -1) {
		name = g.name + " " + 2;
	} else {
		String end = g.name.substring(i + 1);
		try {
			int ctr = Integer.parseInt(end);
			ctr++;
			name = g.name.substring(0, i) + " " + ctr;
		} catch (NumberFormatException e) {
			name = g.name + " " + 2;
		}
	}
}