net.aerith.misao.pixy
Class InteractiveCatalogReader

java.lang.Object
  |
  +--net.aerith.misao.pixy.InteractiveCatalogReader

public class InteractiveCatalogReader
extends java.lang.Object

The InteractiveCatalogReader represents a catalog reader, which will show a dialog message and wait until the required CD-ROM is set properly.


Field Summary
protected  CatalogReader reader
          The catalog reader.
 
Constructor Summary
InteractiveCatalogReader(CatalogReader reader)
          Constructs an InteractiveCatalogReader.
 
Method Summary
 void close()
          Closes a catalog.
 double getMaximumPositionErrorInArcsec()
          Gets the maximum error of position in arcsec.
 void open(java.awt.Container pane)
          Opens a catalog to read all star data.
 void open(java.awt.Container pane, Coor coor, double fov)
          Opens a catalog.
 CatalogStarList read(java.awt.Container pane, Coor coor, double fov)
          Reads all star data in the specified area.
 CatalogStar readNext(java.awt.Container pane)
          Reads one star from the opened catalog.
 void setDate(JulianDay date)
          Sets the date.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

reader

protected CatalogReader reader
The catalog reader.
Constructor Detail

InteractiveCatalogReader

public InteractiveCatalogReader(CatalogReader reader)
Constructs an InteractiveCatalogReader.
Parameters:
reader - the catalog reader.
Method Detail

getMaximumPositionErrorInArcsec

public double getMaximumPositionErrorInArcsec()
Gets the maximum error of position in arcsec. It is the search area size to identify with other stars.
Returns:
the maximum error of position in arcsec.

setDate

public void setDate(JulianDay date)
Sets the date.
Parameters:
date - the date.

open

public void open(java.awt.Container pane)
          throws java.io.IOException,
                 java.io.FileNotFoundException,
                 CdromNotFoundException
Opens a catalog to read all star data. This method must be invoked at first. If the required CD-ROM is not found, it will show a dialog message and wait until they are set properly.
Parameters:
pane - the pane to show a dialog.
Throws:
java.io.IOException - if a file cannot be accessed.
java.io.FileNotFoundException - if a file does not exists in any URL.
CdromNotFoundException - if this reader is to read data from CD-ROMs and a file does not exists in any URL.

open

public void open(java.awt.Container pane,
                 Coor coor,
                 double fov)
          throws java.io.IOException,
                 java.io.FileNotFoundException,
                 CdromNotFoundException
Opens a catalog. This method must be invoked at first.If the required CD-ROM is not found, it will show a dialog message and wait until they are set properly.
Parameters:
pane - the pane to show a dialog.
coor - the R.A. and Decl. of the center.
fov - the field of view to read in degree.
Throws:
java.io.IOException - if a file cannot be accessed.
java.io.FileNotFoundException - if a file does not exists in any URL.
CdromNotFoundException - if this reader is to read data from CD-ROMs and a file does not exists in any URL.

readNext

public CatalogStar readNext(java.awt.Container pane)
                     throws java.io.IOException,
                            java.io.FileNotFoundException,
                            CdromNotFoundException,
                            QueryFailException
Reads one star from the opened catalog. After this method is invoked, the cursor is promoted to tne next star. When every data is read, it returns null. If the required CD-ROM is not found, it will show a dialog message and wait until they are set properly.
Returns:
a star data.
Throws:
java.io.IOException - if a file cannot be accessed.
java.io.FileNotFoundException - if a file does not exists in any URL.
CdromNotFoundException - if this reader is to read data from CD-ROMs and a file does not exists in any URL.
QueryFailException - if the query to the server is failed.

close

public void close()
           throws java.io.IOException
Closes a catalog. This method must be invoked finally.
Throws:
java.io.IOException - if a file cannot be accessed.

read

public CatalogStarList read(java.awt.Container pane,
                            Coor coor,
                            double fov)
                     throws java.io.IOException,
                            java.io.FileNotFoundException,
                            CdromNotFoundException,
                            QueryFailException
Reads all star data in the specified area. If the required CD-ROM is not found, it will show a dialog message and wait until they are set properly.
Parameters:
pane - the pane to show a dialog.
coor - the R.A. and Decl. of the center.
fov - the field of view to read in degree.
Returns:
the list of stars in the specified area.
Throws:
java.io.IOException - if a file cannot be accessed.
java.io.FileNotFoundException - if a file does not exists in any URL.
CdromNotFoundException - if this reader is to read data from CD-ROMs and a file does not exists in any URL.
QueryFailException - if the query to the server is failed.