org.stellarium.astro
Class ConstellationMgr

java.lang.Object
  extended by org.stellarium.astro.ConstellationMgr

public class ConstellationMgr
extends java.lang.Object

Manage group of constellations.

See C++ version of this file.

Version:
0.8.2
Author:
Jerome Beau, Fred Simon

Field Summary
private  java.util.List<java.util.List<javax.vecmath.Point3d>> allBoundarySegments
           
private  double artFadeDuration
           
private  double artMaxIntensity
           
private  SFontIfc asterFont
           
private  java.util.Map<java.lang.String,Constellation> asterisms
           
private  boolean flagArt
           
private  boolean flagBoundaries
           
private  boolean flagLines
           
private  boolean flagNames
           
private  HipStarMgr hipStarMgr
           
private  boolean isolateSelected
           
private  Constellation selected
           
 
Constructor Summary
ConstellationMgr(HipStarMgr hipStars)
          constructor which loads all data from appropriate files
 
Method Summary
 void draw(Projector prj, NavigatorIfc nav)
          Draw all the constellations in the vector
 void drawArt(Projector prj, NavigatorIfc nav)
           
(package private)  void drawBoundaries(Projector prj)
           
 void drawLines(Projector prj)
           
 void drawNames(Projector prj)
          Draw the names of all the constellations
 Constellation findFromAbbreviation(java.lang.String shortname)
           
 double getArtFadeDuration()
          Get constellation art fade duration
 double getArtIntensity()
          Set constellation maximum art intensity
 SColor getBoundaryColor()
           
 boolean getFlagBoundaries()
          Get whether constellation boundaries lines are displayed
 boolean getFlagIsolateSelected()
          Get whether selected constellation is displayed alone
 boolean getFlagLines()
          Get whether constellation path lines are displayed
 boolean getFlagNames()
          Get whether constellation names are displayed
 SColor getLabelColor()
           
 SColor getLineColor()
           
 StelObject getSelected()
           
 boolean isFlagArt()
          Get whether constellation art is displayed
 Constellation isStarIn(StelObject s)
           
 java.util.List<java.lang.String> listMatchingObjectsI18n(java.lang.String objPrefix)
           
 java.util.List<java.lang.String> listMatchingObjectsI18n(java.lang.String objPrefix, int maxNbItem)
          Find and return the list of at most maxNbItem objects auto-completing the passed object I18n name
(package private)  boolean loadBoundaries(java.lang.String boundaryFile)
           
 void loadLinesAndArt(java.lang.String fileName, java.lang.String artfileName, java.lang.String boundaryfileName, LoadingBar lb)
          Load from file
 void loadNames(java.lang.String namesFile)
           
 StelObject searchByNameI18n(java.lang.String nameI18n)
          Return the matching constellation object's pointer if exists or NULL
 void setArtFadeDuration(float duration)
          Set constellation art fade duration
 void setArtIntensity(float max)
          Set constellation maximum art intensity
 void setBoundaryColor(SColor c)
           
 void setFlagArt(boolean b)
          Set whether constellation art will be displayed
 void setFlagBoundaries(boolean b)
          Set whether constellation boundaries lines will be displayed
 void setFlagGravityLabel(boolean g)
           
 void setFlagIsolateSelected(boolean s)
          Set whether selected constellation must be displayed alone
 void setFlagLines(boolean b)
          Set whether constellation path lines will be displayed
 void setFlagNames(boolean b)
          Set whether constellation names will be displayed
 void setFont(float fontSize, java.lang.String ttfFileName)
           
 void setLabelColor(SColor c)
           
 void setLineColor(SColor c)
           
 void setSelected(StelObject s)
          Define which constellation is selected from a star number
 void setSelected(java.lang.String abbreviation)
          Define which constellation is selected from its abbreviation
(package private)  void setSelectedConst(Constellation c)
           
 void translateNames(Translator trans)
           
 void update(int deltaTime)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

asterisms

private java.util.Map<java.lang.String,Constellation> asterisms

asterFont

private SFontIfc asterFont

hipStarMgr

private final HipStarMgr hipStarMgr

selected

private Constellation selected

isolateSelected

private boolean isolateSelected

allBoundarySegments

private java.util.List<java.util.List<javax.vecmath.Point3d>> allBoundarySegments

flagNames

private boolean flagNames

flagLines

private boolean flagLines

flagArt

private boolean flagArt

flagBoundaries

private boolean flagBoundaries

artFadeDuration

private double artFadeDuration

artMaxIntensity

private double artMaxIntensity
Constructor Detail

ConstellationMgr

public ConstellationMgr(HipStarMgr hipStars)
                 throws StellariumException
constructor which loads all data from appropriate files

Throws:
StellariumException
Method Detail

setFlagGravityLabel

public void setFlagGravityLabel(boolean g)

setLineColor

public void setLineColor(SColor c)

getLineColor

public SColor getLineColor()

setBoundaryColor

public void setBoundaryColor(SColor c)

getBoundaryColor

public SColor getBoundaryColor()

setLabelColor

public void setLabelColor(SColor c)

getLabelColor

public SColor getLabelColor()

setFont

public void setFont(float fontSize,
                    java.lang.String ttfFileName)
             throws StellariumException
Throws:
StellariumException

loadLinesAndArt

public void loadLinesAndArt(java.lang.String fileName,
                            java.lang.String artfileName,
                            java.lang.String boundaryfileName,
                            LoadingBar lb)
                     throws StellariumException
Load from file

Throws:
StellariumException

draw

public void draw(Projector prj,
                 NavigatorIfc nav)
Draw all the constellations in the vector


drawArt

public void drawArt(Projector prj,
                    NavigatorIfc nav)

drawLines

public void drawLines(Projector prj)

drawNames

public void drawNames(Projector prj)
Draw the names of all the constellations


isStarIn

public Constellation isStarIn(StelObject s)

findFromAbbreviation

public Constellation findFromAbbreviation(java.lang.String shortname)

loadNames

public void loadNames(java.lang.String namesFile)
               throws StellariumException
Parameters:
namesFile - Name of the file containing the constellation names in english
Throws:
StellariumException

translateNames

public void translateNames(Translator trans)

update

public void update(int deltaTime)

setArtIntensity

public void setArtIntensity(float max)
Set constellation maximum art intensity

Parameters:
max -

getArtIntensity

public double getArtIntensity()
Set constellation maximum art intensity

Returns:

setArtFadeDuration

public void setArtFadeDuration(float duration)
Set constellation art fade duration

Parameters:
duration -

getArtFadeDuration

public double getArtFadeDuration()
Get constellation art fade duration

Returns:

setFlagLines

public void setFlagLines(boolean b)
Set whether constellation path lines will be displayed

Parameters:
b -

getFlagLines

public boolean getFlagLines()
Get whether constellation path lines are displayed

Returns:

setFlagBoundaries

public void setFlagBoundaries(boolean b)
Set whether constellation boundaries lines will be displayed

Parameters:
b -

getFlagBoundaries

public boolean getFlagBoundaries()
Get whether constellation boundaries lines are displayed

Returns:

setFlagArt

public void setFlagArt(boolean b)
Set whether constellation art will be displayed

Parameters:
b -

isFlagArt

public boolean isFlagArt()
Get whether constellation art is displayed

Returns:

setFlagNames

public void setFlagNames(boolean b)
Set whether constellation names will be displayed

Parameters:
b -

getFlagNames

public boolean getFlagNames()
Get whether constellation names are displayed

Returns:

setFlagIsolateSelected

public void setFlagIsolateSelected(boolean s)
Set whether selected constellation must be displayed alone


getFlagIsolateSelected

public boolean getFlagIsolateSelected()
Get whether selected constellation is displayed alone


setSelected

public void setSelected(java.lang.String abbreviation)
Define which constellation is selected from its abbreviation


setSelected

public void setSelected(StelObject s)
Define which constellation is selected from a star number


getSelected

public StelObject getSelected()

setSelectedConst

void setSelectedConst(Constellation c)

loadBoundaries

boolean loadBoundaries(java.lang.String boundaryFile)
                 throws StellariumException
Throws:
StellariumException

drawBoundaries

void drawBoundaries(Projector prj)

searchByNameI18n

public StelObject searchByNameI18n(java.lang.String nameI18n)
Return the matching constellation object's pointer if exists or NULL

Parameters:
nameI18n - The case sensistive constellation name

listMatchingObjectsI18n

public java.util.List<java.lang.String> listMatchingObjectsI18n(java.lang.String objPrefix)

listMatchingObjectsI18n

public java.util.List<java.lang.String> listMatchingObjectsI18n(java.lang.String objPrefix,
                                                                int maxNbItem)
Find and return the list of at most maxNbItem objects auto-completing the passed object I18n name