Package org.renjin.primitives.graphics

Source Code of org.renjin.primitives.graphics.GraphicsDeviceDriverStub

package org.renjin.primitives.graphics;

import org.renjin.graphics.Color;
import org.renjin.graphics.GraphicParameters;
import org.renjin.graphics.GraphicsDeviceDriver;
import org.renjin.graphics.geom.Dimension;
import org.renjin.graphics.geom.Rectangle;


public class GraphicsDeviceDriverStub implements GraphicsDeviceDriver {

  private Rectangle deviceRegion;
  private Dimension size;
 
  public GraphicsDeviceDriverStub(Rectangle deviceRegion, Dimension size) {
    super();
    this.deviceRegion = deviceRegion;
    this.size = size;
  }

  public GraphicsDeviceDriverStub(int widthPixels, int heightPixels) {
    deviceRegion = new Rectangle(0, widthPixels, 0, heightPixels);
    size = new Dimension(widthPixels / 72d, heightPixels / 72d);
  }

  @Override
  public Dimension getInchesPerPixel() {
    return new Dimension(size.getWidth() / deviceRegion.getWidth(),
                         size.getHeight() / deviceRegion.getHeight());
  }

  @Override
  public Dimension getCharacterSize() {
    return new Dimension(10.8, 14.4);
  }

  @Override
  public void drawRectangle(Rectangle bounds, Color fillColor,
      Color borderColor, GraphicParameters parameters) {
     
   
  }

  @Override
  public Rectangle getDeviceRegion() {
    return deviceRegion;
  }

  public Dimension getSize() {
    return size;
  }
 
}
TOP

Related Classes of org.renjin.primitives.graphics.GraphicsDeviceDriverStub

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.