001 /*
002 * Copyright 2011 Christian Kumpe http://kumpe.de/christian/java
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package de.kumpe.hadooptimizer.examples.painting;
017
018 import java.awt.Color;
019 import java.awt.Graphics2D;
020 import java.awt.image.BufferedImage;
021
022 public class PolygonPaint extends PolygonPaintBase {
023 private final static int WIDTH = 400;
024 private final static int HEIGHT = 400;
025
026 public PolygonPaint() {
027 super(2, 3);
028 }
029
030 @Override
031 BufferedImage createReferenceImage() {
032 final BufferedImage reference = new BufferedImage(WIDTH, HEIGHT,
033 BufferedImage.TYPE_BYTE_GRAY);
034 final Graphics2D graphics = reference.createGraphics();
035 graphics.setColor(new Color(1f, 1f, 1f, 0.7f));
036 graphics.fillRect(WIDTH / 4, HEIGHT / 4, WIDTH / 2, HEIGHT / 2);
037 graphics.dispose();
038 return reference;
039 }
040
041 @Override
042 protected String getVersionInfo() {
043 return "$Id: PolygonPaint.java 3797 2011-04-05 07:43:01Z baumbart $";
044 }
045 }