|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjview.JStarFactory
public class JStarFactory
This class comprises a simple container for displaying star descriptions
in a sky survey catalog. It consists of a Shape and a Paint instance.
Additionally, to prevent overboarding
scaling for bright stars, a #KEY_SCALEDOWN float describes the
factor on how to scale down the faintest stars, and also a
#KEY_MAXMAGNIFY float that is the maximum growth in size for
the brightest star in the sample. The #getShapes
method scales the primary shape up to the magnitude of the star and
stores it together with the position information in a list of Shape
objects that can be queried with #getShapes. Note that the orignal
shape must be centered around 0,0.
All methods are static here.
| Field Summary | |
|---|---|
private static Map<String,Color> |
colors
The list of principal colors to catalog names. |
private static Vector2D |
DEFSCALE
The default scaling laws. |
private static Shape |
DEFSHAPE
The default star shape radius for a circular shape. |
private static Map<String,Vector2D> |
scales
The list of scaling factors to catalog names. |
private static Map<String,Shape> |
shapes
The list of principal shapes against catalog names. |
| Constructor Summary | |
|---|---|
JStarFactory()
|
|
| Method Summary | ||
|---|---|---|
private static String |
extract(Map catalog)
Extracts the catalog name as used in our look-up tables for construction in the static section. |
|
static Paint |
getCatalogColor(StarCatalog scan)
Returns the color entry for the catalog or null, if catalog is unknown. |
|
private static String |
getCatalogKey(String fullname)
Deprtives the full catalog name from anything after the first whitespace. |
|
static Vector2D |
getCatalogScale(StarCatalog scan)
Returns scaling laws for this catalog or default scaling laws. |
|
static Shape |
getCatalogShape(StarCatalog scan)
Returns the principal shape of the catalog or the default shape, if catalog is unknown. |
|
static List<StarDescription> |
limit(List<StarDescription> stars,
double maxmag)
Filters the list of stars. |
|
static List<StarDescription> |
limit(List<StarDescription> stars,
double min,
double max,
String mag)
Filters the list of stars. |
|
static List<PointDraw> |
makePoints(List<StarDescription> stars,
Shape primary,
Vector2D scale,
Vector2D minmax,
CoordinateTransforming convert,
boolean fill)
Prepares the shapes list by scaling and translating the main shape. |
|
static List<PointDraw> |
makePoints(List<StarDescription> stars,
Shape primary,
Vector2D scale,
Vector2D minmax,
String mag,
CoordinateTransforming convert,
boolean fill)
Prepares the shapes list by scaling and translating the main shape. |
|
static List<ShapeDraw> |
makeShapes(List<StarDescription> stars,
Shape primary,
Vector2D scale,
Vector2D minmax,
CoordinateTransforming convert,
boolean filled)
Prepares the shapes list by scaling and translating the main shape. |
|
static List<ShapeDraw> |
makeShapes(List<StarDescription> stars,
Shape primary,
Vector2D scale,
Vector2D minmax,
String mag,
CoordinateTransforming convert,
boolean filled)
Prepares the shapes list by scaling and translating the main shape. |
|
private static
|
matchAgainstMap(Map<String,T> lookup,
String fullname,
T def)
Tries to find a match in known catalogs. |
|
static Vector2D |
scanMagnitudes(List<StarDescription> stars)
Returns the minimum and maximum magnitudes in the entire star list. |
|
static Vector2D |
scanMagnitudes(List<StarDescription> stars,
String magstring)
Returns the minimum and maximum size indicator in the entire star list. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final Shape DEFSHAPE
private static final Vector2D DEFSCALE
private static final Map<String,Shape> shapes
private static final Map<String,Color> colors
private static final Map<String,Vector2D> scales
| Constructor Detail |
|---|
public JStarFactory()
| Method Detail |
|---|
private static String extract(Map catalog)
public static Paint getCatalogColor(StarCatalog scan)
public static Shape getCatalogShape(StarCatalog scan)
public static Vector2D getCatalogScale(StarCatalog scan)
private static <T> T matchAgainstMap(Map<String,T> lookup,
String fullname,
T def)
private static String getCatalogKey(String fullname)
public static List<StarDescription> limit(List<StarDescription> stars,
double maxmag)
maxmag - The maximum magnitude to consider.
public static List<StarDescription> limit(List<StarDescription> stars,
double min,
double max,
String mag)
stars - The entire list of starsmin - The maximum magnitude to consider.max - The maximum magnitude to consider.mag - The value to consider, normally magnitude
public static Vector2D scanMagnitudes(List<StarDescription> stars)
stars - A List of StarDescriptions.
public static Vector2D scanMagnitudes(List<StarDescription> stars,
String magstring)
stars - A List of StarDescriptions.magstring - The key to the star description size ID, normally mag.
public static List<ShapeDraw> makeShapes(List<StarDescription> stars,
Shape primary,
Vector2D scale,
Vector2D minmax,
CoordinateTransforming convert,
boolean filled)
stars - The list of StarDescriptions.primary - The normalized Drawing shape for stars.scale - Converts magnitudes to normalized sizes.minmax - The minmum/maximum of the magnitudes in the list.mag - The magnitude key in the list of stars.convert - The translation of ra/dec into normalized pixels.
public static List<ShapeDraw> makeShapes(List<StarDescription> stars,
Shape primary,
Vector2D scale,
Vector2D minmax,
String mag,
CoordinateTransforming convert,
boolean filled)
stars - The list of StarDescriptions.primary - The normalized Drawing shape for stars.scale - Converts magnitudes to normalized sizes.minmax - The minmum/maximum of the magnitudes in the list.mag - The magnitude key in the list of stars.convert - The translation of ra/dec into normalized pixels.
public static List<PointDraw> makePoints(List<StarDescription> stars,
Shape primary,
Vector2D scale,
Vector2D minmax,
CoordinateTransforming convert,
boolean fill)
stars - The list of StarDescriptions.primary - The normalized Drawing shape for stars.scale - Converts magnitudes to normalized sizes.minmax - The minmum/maximum of the magnitudes in the list.mag - The magnitude key in the list of stars.convert - The translation of ra/dec into normalized pixels.
public static List<PointDraw> makePoints(List<StarDescription> stars,
Shape primary,
Vector2D scale,
Vector2D minmax,
String mag,
CoordinateTransforming convert,
boolean fill)
stars - The list of StarDescriptions.primary - The normalized Drawing shape for stars.scale - Converts magnitudes to normalized sizes.minmax - The minmum/maximum of the magnitudes in the list.mag - The magnitude key in the list of stars.convert - The translation of ra/dec into normalized pixels.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||