picturedream.implementation
Class PreviewPicture

java.lang.Object
  |
  +--picturedream.implementation.PreviewPicture
All Implemented Interfaces:
IPicture

public class PreviewPicture
extends java.lang.Object
implements IPicture

Author:
rico.schuster

Field Summary
private  IPicture basicpicture
           
private  PictureData currentpic
           
private  PictureData filterfilterpic
           
private  PictureData filterpic
           
private  java.awt.Image ivCachedImage
           
private  java.util.Vector ivListeners
          the picture listeners
private static int max_height
           
private static int max_width
           
private  PictureData picturedata
           
 
Constructor Summary
PreviewPicture()
          Creates a new instance of PreviewPicture
 
Method Summary
 void addListener(IPictureListener l)
          adds the given IPictureListener
private  void firePictureChanged()
          fires a picture changed notify
 int[] getData()
          returns a reference to the internal 32 bit buffer
 int getHeight()
          returns the picture height
 java.awt.Image getImage()
          produces a image from the internal 32 bit buffer
 int getWidth()
          returns the picture width
 boolean isValid()
          returns the images state, false if no or a corrupted image was loaded, true if valid picture data is stored in the picture.
 void loadImage(java.lang.String fileName)
          loads a image from file, gif or jpg, java std ;-)
 void process(IPictureProcessor processor)
          uses the given processor to process the prewiew data.
 void processpreview(IPictureProcessor processor, boolean basic)
           
 void redoPicture()
          redo the current loaded Picture
 void reload()
          set the preview filterpic to the original prwview pic
 void removeListener(IPictureListener l)
          removes the given IPictureListener
 void reset()
          resets the image
 void saveImage(java.lang.String fileName)
          save a image as Windows Bitmap
 void setBasicPicture(IPicture basic)
           
 void setData(int[] data, int width, int height)
          sets the picture data directly. the width and height must match the buffers length!
 void undoPicture()
          undo the current loaded cPicture
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

basicpicture

private IPicture basicpicture

ivCachedImage

private java.awt.Image ivCachedImage

max_width

private static final int max_width

max_height

private static final int max_height

ivListeners

private java.util.Vector ivListeners
the picture listeners

picturedata

private PictureData picturedata

filterpic

private PictureData filterpic

currentpic

private PictureData currentpic

filterfilterpic

private PictureData filterfilterpic
Constructor Detail

PreviewPicture

public PreviewPicture()
Creates a new instance of PreviewPicture
Method Detail

addListener

public void addListener(IPictureListener l)
adds the given IPictureListener
Specified by:
addListener in interface IPicture

getData

public int[] getData()
returns a reference to the internal 32 bit buffer
Specified by:
getData in interface IPicture

getHeight

public int getHeight()
returns the picture height
Specified by:
getHeight in interface IPicture

getImage

public java.awt.Image getImage()
produces a image from the internal 32 bit buffer
Specified by:
getImage in interface IPicture

getWidth

public int getWidth()
returns the picture width
Specified by:
getWidth in interface IPicture

isValid

public boolean isValid()
returns the images state, false if no or a corrupted image was loaded, true if valid picture data is stored in the picture.
Specified by:
isValid in interface IPicture

loadImage

public void loadImage(java.lang.String fileName)
               throws java.lang.Exception
loads a image from file, gif or jpg, java std ;-)
Specified by:
loadImage in interface IPicture
Parameters:
fileName - - the filename of the picture to be loaded
Throws:
java.lang.Exception -  

process

public void process(IPictureProcessor processor)
uses the given processor to process the prewiew data. It's finalise the preview pic!!!!
Specified by:
process in interface IPicture
Parameters:
processor - is the processor used tio process the image data

processpreview

public void processpreview(IPictureProcessor processor,
                           boolean basic)

reload

public void reload()
set the preview filterpic to the original prwview pic

redoPicture

public void redoPicture()
redo the current loaded Picture

removeListener

public void removeListener(IPictureListener l)
removes the given IPictureListener
Specified by:
removeListener in interface IPicture

firePictureChanged

private void firePictureChanged()
fires a picture changed notify

reset

public void reset()
resets the image
Specified by:
reset in interface IPicture

saveImage

public void saveImage(java.lang.String fileName)
               throws java.lang.Exception
save a image as Windows Bitmap
Specified by:
saveImage in interface IPicture

setData

public void setData(int[] data,
                    int width,
                    int height)
sets the picture data directly. the width and height must match the buffers length!
Specified by:
setData in interface IPicture
Parameters:
data - - a 32 bit buffer
width - - the picture width
height - - the picture height

undoPicture

public void undoPicture()
undo the current loaded cPicture

setBasicPicture

public void setBasicPicture(IPicture basic)