Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

graph
Class RotateTextFilter  view RotateTextFilter download RotateTextFilter.java

java.lang.Object
  extended byjava.awt.image.ImageFilter
      extended bygraph.RotateTextFilter
All Implemented Interfaces:
java.lang.Cloneable, java.awt.image.ImageConsumer

class RotateTextFilter
extends java.awt.image.ImageFilter

This is an extension to the ImageFilter class that will rotate an image a multiple of 90 degrees. This filter is easily extended to allow arbitrary rotations


Field Summary
private  int angle
           
private  byte[] bpixels
           
private  java.awt.image.ColorModel colorModel
           
private  double cos
           
private  int height
           
private  int[] ipixels
           
private  double sin
           
private  int width
           
private  int xmax
           
private  int xmin
           
private  int ymax
           
private  int ymin
           
 
Fields inherited from class java.awt.image.ImageFilter
consumer
 
Fields inherited from interface java.awt.image.ImageConsumer
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT
 
Constructor Summary
RotateTextFilter(int angle)
          Instantiate the class
 
Method Summary
 void imageComplete(int status)
          Called when the image is complete.
 void setDimensions(int w, int h)
          Find the dimensions of the original image and pass onto the image consumer the dimensions of the new roated image
 void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, byte[] pixels, int off, int scan)
          As the pixels of the original image are sent store them in memory as the rotated image.
 void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, int[] pixels, int off, int scan)
          As the pixels of the original image are sent store them in memory as the rotated image.
 void setProperties(java.util.Hashtable props)
          Add to the properties table of the image that it has been rotated
 
Methods inherited from class java.awt.image.ImageFilter
clone, getFilterInstance, resendTopDownLeftRight, setColorModel, setHints
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

angle

private int angle

xmin

private int xmin

xmax

private int xmax

ymin

private int ymin

ymax

private int ymax

width

private int width

height

private int height

cos

private double cos

sin

private double sin

ipixels

private int[] ipixels

bpixels

private byte[] bpixels

colorModel

private java.awt.image.ColorModel colorModel
Constructor Detail

RotateTextFilter

public RotateTextFilter(int angle)
Instantiate the class

Method Detail

setProperties

public void setProperties(java.util.Hashtable props)
Add to the properties table of the image that it has been rotated


setDimensions

public void setDimensions(int w,
                          int h)
Find the dimensions of the original image and pass onto the image consumer the dimensions of the new roated image


setPixels

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      java.awt.image.ColorModel model,
                      byte[] pixels,
                      int off,
                      int scan)
As the pixels of the original image are sent store them in memory as the rotated image. This method is called with a subset rectangle of the original image.


setPixels

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      java.awt.image.ColorModel model,
                      int[] pixels,
                      int off,
                      int scan)
As the pixels of the original image are sent store them in memory as the rotated image. This method is called with a subset rectangle of the original image.


imageComplete

public void imageComplete(int status)
Called when the image is complete. When this is called by the image producer, we can then pass the rotated image onto the image consumer.