net.aerith.misao.pixy
Class ThumbnailImageCreater

java.lang.Object
  |
  +--net.aerith.misao.util.OperationObservable
        |
        +--net.aerith.misao.pixy.ThumbnailImageCreater

public class ThumbnailImageCreater
extends OperationObservable

The ThumbnailImageCreater is a class to create the thumbnail image objects or image files based on the specified list of XML magnitude records.


Inner Class Summary
protected  class ThumbnailImageCreater.FolderAndRecord
          The FolderAndRecord is a set of the folder and the magnitude record to create a thumbnail image.
 
Field Summary
protected  FileManager file_manager
          The file manager.
protected  InformationDBManager info_manager
          The information database manager.
static int MAGNIFICATION_KEEP_ORIGINAL
          The number of policy on the magnification which indicates to create the thumbnail image without magnification.
static int MAGNIFICATION_SPECIFIED_RESOLUTION
          The number of policy on the magnification which indicates to create the thumbnail image with the specified resolution.
protected  int policy_magnification
          The policy on the magnification.
protected  int policy_position
          The policy on the position.
protected  int policy_rotation
          The policy on the rotation.
static int POSITION_TARGET_AT_CENTER
          The number of policy on the position which indicates to create the thumbnail image as the target star locates at the center, even if it is at the edge of the original image.
protected  double resolution
          The resolution, the pixel size in arcsec.
static int ROTATION_KEEP_ORIGINAL
          The number of policy on the rotation which indicates to create the thumbnail image without rotation.
static int ROTATION_NORTH_UP_AT_RIGHT_ANGLES
          The number of policy on the rotation which indicates to create the thumbnail image as north is up by rotating at right angles.
protected  java.util.Vector thumbnail_list
          The list of the folder and the magnitude record.
protected  Size thumbnail_size
          The size of the thumbnail image.
 
Fields inherited from class net.aerith.misao.util.OperationObservable
observer_list
 
Constructor Summary
ThumbnailImageCreater(FileManager file_manager)
          Constructs a ThumbnailImageCreater.
 
Method Summary
 void addRecord(XmlMagRecord record)
          Adds the magnitude record.
 void addRecord(XmlMagRecord record, java.io.File folder)
          Adds the set of the folder and magnitude record.
 void clean()
          Cleans up the sets of the folder and magnitude record.
 MonoImage[] create()
          Creates the thumbnail image objects of the previously added records.
 MonoImage[] create(XmlMagRecord[] records)
          Creates the thumbnail image objects.
 java.io.File[] createFile()
          Creates the thumbnail image files of the previously added records.
 java.io.File[] createFile(XmlMagRecord[] records, java.io.File folder)
          Creates the thumbnail image files.
protected  MonoImage createThumbnailImage(MonoImage image, Position target_position, XmlInformation info)
          Creates the thumbnail image.
 void setDBManager(InformationDBManager info_manager)
          Sets the information database manager.
 void setFileManager(FileManager file_manager)
          Sets the file manager.
 void setMagnification(int policy)
          Sets the policy on the magnification.
 void setPosition(int policy)
          Sets the policy on the position.
 void setResolution(double pixel_size)
          Sets the resolution, the pixel size in arcsec.
 void setRotation(int policy)
          Sets the policy on the rotation.
 void setSize(Size size)
          Sets the size of the thumbnail image.
 
Methods inherited from class net.aerith.misao.util.OperationObservable
addObserver, deleteObserver, notifyEnd, notifyFailed, notifyStart, notifySucceeded, notifyWarned
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

thumbnail_list

protected java.util.Vector thumbnail_list
The list of the folder and the magnitude record.

thumbnail_size

protected Size thumbnail_size
The size of the thumbnail image.

policy_position

protected int policy_position
The policy on the position.

policy_magnification

protected int policy_magnification
The policy on the magnification.

policy_rotation

protected int policy_rotation
The policy on the rotation.

resolution

protected double resolution
The resolution, the pixel size in arcsec.

info_manager

protected InformationDBManager info_manager
The information database manager.

file_manager

protected FileManager file_manager
The file manager.

POSITION_TARGET_AT_CENTER

public static final int POSITION_TARGET_AT_CENTER
The number of policy on the position which indicates to create the thumbnail image as the target star locates at the center, even if it is at the edge of the original image.

MAGNIFICATION_KEEP_ORIGINAL

public static final int MAGNIFICATION_KEEP_ORIGINAL
The number of policy on the magnification which indicates to create the thumbnail image without magnification.

MAGNIFICATION_SPECIFIED_RESOLUTION

public static final int MAGNIFICATION_SPECIFIED_RESOLUTION
The number of policy on the magnification which indicates to create the thumbnail image with the specified resolution.

ROTATION_KEEP_ORIGINAL

public static final int ROTATION_KEEP_ORIGINAL
The number of policy on the rotation which indicates to create the thumbnail image without rotation.

ROTATION_NORTH_UP_AT_RIGHT_ANGLES

public static final int ROTATION_NORTH_UP_AT_RIGHT_ANGLES
The number of policy on the rotation which indicates to create the thumbnail image as north is up by rotating at right angles.
Constructor Detail

ThumbnailImageCreater

public ThumbnailImageCreater(FileManager file_manager)
Constructs a ThumbnailImageCreater.
Parameters:
file_manager - the file manager.
Method Detail

setSize

public void setSize(Size size)
Sets the size of the thumbnail image.
Parameters:
size - the size of the thumbnail image.

setPosition

public void setPosition(int policy)
Sets the policy on the position.
Parameters:
policy - the number of policy on the position.

setMagnification

public void setMagnification(int policy)
Sets the policy on the magnification.
Parameters:
policy - the number of policy on the magnification.

setResolution

public void setResolution(double pixel_size)
Sets the resolution, the pixel size in arcsec.
Parameters:
pixel_size - the pixel size in arcsec.

setRotation

public void setRotation(int policy)
Sets the policy on the rotation.
Parameters:
policy - the number of policy on the rotation.

addRecord

public void addRecord(XmlMagRecord record)
Adds the magnitude record. It is to create the thumbnail image objects.
Parameters:
record - the magnitude record.

addRecord

public void addRecord(XmlMagRecord record,
                      java.io.File folder)
Adds the set of the folder and magnitude record. It is to create the thumbnail image files.
Parameters:
record - the magnitude record.
folder - the folder to create the thumbnail image.

clean

public void clean()
Cleans up the sets of the folder and magnitude record.

setDBManager

public void setDBManager(InformationDBManager info_manager)
Sets the information database manager.
Parameters:
info_manager - the information database manager.

setFileManager

public void setFileManager(FileManager file_manager)
Sets the file manager.
Parameters:
file_manager - the file manager.

create

public MonoImage[] create(XmlMagRecord[] records)
Creates the thumbnail image objects.
Parameters:
records - the array of XML magnitude records.
Returns:
the array of the thumbnail image objects.

create

public MonoImage[] create()
Creates the thumbnail image objects of the previously added records.
Returns:
the array of the thumbnail image objects in the same order as magnitude records added to this creater.

createFile

public java.io.File[] createFile(XmlMagRecord[] records,
                                 java.io.File folder)
Creates the thumbnail image files.
Parameters:
records - the array of XML magnitude records.
folder - the folder to create the files.
Returns:
the array of the thumbnail image files.

createFile

public java.io.File[] createFile()
Creates the thumbnail image files of the previously added records.
Returns:
the array of the thumbnail image files.

createThumbnailImage

protected MonoImage createThumbnailImage(MonoImage image,
                                         Position target_position,
                                         XmlInformation info)
Creates the thumbnail image.
Parameters:
image - the original image object.
target_position - the (x,y) position of the target.
info - the XML information document.
Returns:
the image object.