EVolve.visualization
Class AutoImage

java.lang.Object
  |
  +--EVolve.visualization.AutoImage
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
AutoShapeImage

public class AutoImage
extends java.lang.Object
implements java.lang.Cloneable

Automatic expanding image.


Field Summary
protected  int h
           
protected  int hMax
           
protected  short[][] image
           
protected  int imageHeight
           
protected  int imageWidth
           
protected  java.util.HashMap Int2Object
           
protected  java.util.HashMap object2Int
           
protected  int w
           
protected  int wMax
           
 
Constructor Summary
AutoImage()
          Creates an auto-image.
 
Method Summary
 java.lang.Object clone()
           
 java.lang.Object getColor(int x, int y)
          Gets the color of a pixel.
 int getDimension(int dim)
           
 int getH()
           
 java.awt.image.BufferedImage getImage()
          Gets the buffered-image.
 short[][] getImageDataArray()
           
 java.awt.Color getSortedColor(ReferenceDimension xAxis, ReferenceDimension yAxis, int x, int y)
           
 AutoImage getSortedImage(ReferenceDimension xAxis, ReferenceDimension yAxis)
          Sorts the image.
 int getW()
           
 void setColor(int x, int y, java.lang.Object color)
          Sets the color of a pixel.
 void setImageWidth(int width, int height)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

image

protected short[][] image

w

protected int w

h

protected int h

wMax

protected int wMax

hMax

protected int hMax

imageWidth

protected int imageWidth

imageHeight

protected int imageHeight

object2Int

protected java.util.HashMap object2Int

Int2Object

protected java.util.HashMap Int2Object
Constructor Detail

AutoImage

public AutoImage()
Creates an auto-image.

Method Detail

setColor

public void setColor(int x,
                     int y,
                     java.lang.Object color)
Sets the color of a pixel.

Parameters:
x - position on X-axis
y - position on Y-axis
color - the color

getColor

public java.lang.Object getColor(int x,
                                 int y)
Gets the color of a pixel.

Parameters:
x - position on X-axis
y - position on Y-axis
Returns:
the color

getSortedColor

public java.awt.Color getSortedColor(ReferenceDimension xAxis,
                                     ReferenceDimension yAxis,
                                     int x,
                                     int y)

getImage

public java.awt.image.BufferedImage getImage()
                                      throws NoDataPlotException
Gets the buffered-image.

Returns:
buffered-image
NoDataPlotException

getSortedImage

public AutoImage getSortedImage(ReferenceDimension xAxis,
                                ReferenceDimension yAxis)
Sorts the image.

Parameters:
xAxis - dimension that represents the X-axis, null if doesn't need to be sorted
yAxis - dimension that represents the Y-axis, null if doesn't need to be sorted
Returns:
sorted image

getDimension

public int getDimension(int dim)

getW

public int getW()

getH

public int getH()

setImageWidth

public void setImageWidth(int width,
                          int height)

getImageDataArray

public short[][] getImageDataArray()

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object