stsci.sky
Class Catalog2D

java.lang.Object
  |
  +--stsci.sky.Catalog2D
All Implemented Interfaces:
ArcObjCont, java.util.EventListener, java.awt.event.ItemListener
Direct Known Subclasses:
CompassCatalog

public class Catalog2D
extends java.lang.Object
implements ArcObjCont, java.awt.event.ItemListener

This represebts a continer for all stars retreived from a particular Archive at a particular time. * @author This decides which color is used for plotting the points.This will actually call back up to the SkyArea toget x,y positions so stars can do the plotting - this is because the SkyArea knows the coordinate system but the star remembers where it was last time and the Catalog contains the color information


Field Summary
protected  SourceArchive archive
           
protected  java.awt.Color col
           
protected  Criteria crit
           
protected  boolean loaded
           
protected  java.lang.String name
           
protected  boolean plot
           
protected  boolean serverSideFilter
           
protected  SkyArea sky
           
protected  java.util.ArrayList stars
           
 
Constructor Summary
Catalog2D()
           
Catalog2D(SourceArchive arc, SkyArea sky)
           
 
Method Summary
 void add(ArchiveObject o)
           
 java.awt.Color color()
          The color to use plotting this catalog.
 boolean filter(Star2D s)
          Apply the criteria to the given star.
 Star2D findNear(int x, int y)
          Find the star plotted near the given screen coordinates - this came from Hipparcos - it assumes stars are ordered in RA comming from the catalog and does a binary searc based on that assumption.
 Star2D findStar(java.lang.String id)
           
 java.util.Iterator getStars()
           
 void init(double a, double d, double r)
          This gets called when we want to populate the sky.
 void itemStateChanged(java.awt.event.ItemEvent arg0)
           
 void moveStars(int year)
           
 java.lang.String name()
           
 void plot()
          Plot all Stars matching the criteria.
 void plot(Star2D s, java.awt.Rectangle r)
          Plot individual Star if it matches criteria.
protected  void replot()
          Unplot Stars no longer matching the criteria but plot thoose which do.
 void reScale()
          Scale changed so all stars must have positions recalcuolated * @return void
 void setCol(java.awt.Color c)
           
 void setCrit(Criteria c)
           
 void setPlot(boolean v)
          Plot this catlog or not ? * @param v
 void setPos(Star2D s)
          Set the X,Y coordinate on screen of the star.
 void setServerSideFilter(boolean v)
          Apply the criteria on the serverside or not - cuts down data transfer but allows less flexibility in the client.
 void unplot()
          unplot all stars from this catalogue * @return void
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

plot

protected boolean plot

serverSideFilter

protected boolean serverSideFilter

loaded

protected boolean loaded

stars

protected java.util.ArrayList stars

crit

protected Criteria crit

sky

protected SkyArea sky

archive

protected SourceArchive archive

col

protected java.awt.Color col

name

protected java.lang.String name
Constructor Detail

Catalog2D

public Catalog2D(SourceArchive arc,
                 SkyArea sky)
Parameters:
arc -  
sky -  
Throws:
-  

Catalog2D

public Catalog2D()
Throws:
-  
Method Detail

setPlot

public void setPlot(boolean v)
Plot this catlog or not ? * @param v
Returns:
void
Throws:
-  

setCrit

public void setCrit(Criteria c)
Parameters:
c -  
Returns:
void
Throws:
-  

setCol

public void setCol(java.awt.Color c)
Parameters:
c -  
Returns:
void
Throws:
-  

moveStars

public void moveStars(int year)
Parameters:
year -  
Returns:
void
Throws:
-  

plot

public void plot()
Plot all Stars matching the criteria. * @return void
Throws:
-  

replot

protected void replot()
Unplot Stars no longer matching the criteria but plot thoose which do. * @return void
Throws:
-  

unplot

public void unplot()
unplot all stars from this catalogue * @return void
Throws:
-  

plot

public void plot(Star2D s,
                 java.awt.Rectangle r)
Plot individual Star if it matches criteria. * @param s
Returns:
void
Throws:
-  

add

public void add(ArchiveObject o)
Specified by:
add in interface ArcObjCont
Parameters:
o -  
Returns:
void
Throws:
-  

name

public java.lang.String name()
Specified by:
name in interface ArcObjCont
Returns:
String
Throws:
-  

findNear

public Star2D findNear(int x,
                       int y)
Find the star plotted near the given screen coordinates - this came from Hipparcos - it assumes stars are ordered in RA comming from the catalog and does a binary searc based on that assumption. This is done none recursivly. * @param x
Parameters:
y -  
Returns:
Star2D
Throws:
-  

findStar

public Star2D findStar(java.lang.String id)

color

public java.awt.Color color()
The color to use plotting this catalog. * @return Color
Throws:
-  

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent arg0)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Parameters:
arg0 -  
Returns:
void
Throws:
-  

init

public void init(double a,
                 double d,
                 double r)
This gets called when we want to populate the sky. * @param a
Parameters:
d -  
r -  
Returns:
void
Throws:
-  

setServerSideFilter

public void setServerSideFilter(boolean v)
Apply the criteria on the serverside or not - cuts down data transfer but allows less flexibility in the client. * @param v
Returns:
void
Throws:
-  

reScale

public void reScale()
Scale changed so all stars must have positions recalcuolated * @return void
Throws:
-  

setPos

public void setPos(Star2D s)
Set the X,Y coordinate on screen of the star. Only needs to be don after a rescale or the first time a star is loaded. * @param s
Returns:
void
Throws:
-  

getStars

public java.util.Iterator getStars()
Returns:
Iterator
Throws:
-  

filter

public boolean filter(Star2D s)
Apply the criteria to the given star. this is used before plotting moving etc. This is overridden by CompassCatalog since it needs to cast the object to a CompasOnject to apply the CompassFilter. * @param s
Returns:
boolean
Throws:
-