net.aerith.misao.gui
Class PlotProperty

java.lang.Object
  |
  +--net.aerith.misao.gui.PlotProperty

public class PlotProperty
extends java.lang.Object

The PlotProperty represents a set of GUI properties to plot a star and the method to plot.

In the case the size is determined depending on the magnitude, the radius to plot a star circle is calculated while three parameters plot_ratio, limiting_mag and plot_radius are considered. The radius is calculated as:

     radius = plot_ratio * ( limiting_mag - magnitude ) + 1;
     if (radius < plot_radius)
         radius = plot_radius;
 


Field Summary
protected  java.awt.Color color
          The color.
protected  boolean enabled
          True if the stars can be plotted.
protected  boolean fill_flag
          True if the mark is filled.
protected  double limiting_mag
          The parameter to calculate a radius of circle to plot.
protected  int line_width
          The line width.
 int mark
          The mark.
static int PLOT_CIRCLE
          The number of mark which represents to plot a circle.
protected  int plot_radius
          The radius.
protected  double plot_ratio
          The parameter to calculate a radius of circle to plot.
static int PLOT_RECTANGLE
          The number of mark which represents to plot a rectangle.
static int PLOT_TRIANGLE
          The number of mark which represents to plot a triangle.
protected  boolean radius_mag_dependent
          True if the size is determined depending on the magnitude.
protected  MagnitudeSystem system
          The magnitude system.
 
Constructor Summary
PlotProperty()
          Constructs a PlotProperty.
 
Method Summary
 void disable()
          Disables to plot the stars.
 void enable()
          Enables to plot the stars.
 java.awt.Color getColor()
          Gets the color.
 int getFixedRadius()
          Gets the fixed radius.
 double getLimitingMag()
          Gets the limiting magnitude.
 int getLineWidth()
          Gets the line width.
 double getMagnitude(Star star)
          Gets the converted magnitude of the specified star.
 MagnitudeSystem getMagnitudeSystem()
          Gets the magnitude system definition.
 int getMark()
          Gets the mark.
 int getRadius(double mag)
          Gets the radius depending on the specified magnitude.
 boolean isEnabled()
          Checks if the star can be plotted.
 boolean isFilled()
          Returns true if the mark is filled.
 boolean isSizeFixed()
          Returns true if the size is not determined depending on the magnitude
 void plot(java.awt.Graphics g, int x, int y, StarPosition star)
          Plots a star at the specified position.
 void setColor(java.awt.Color color)
          Sets the color.
 void setDependentSizeParameters(double new_ratio, double new_mag, int new_radius)
          Sets the parameters to calculate a radius of circle to plot.
 void setFilled(boolean flag)
          Sets a flag to fill the mark or not.
 void setFixedRadius(int radius)
          Sets the fixed radius.
 void setLimitingMag(double limiting_mag)
          Sets the limiting magnitude.
 void setLineWidth(int width)
          Sets the line width.
 void setMagnitudeSystem(MagnitudeSystem system)
          Sets the magnitude system definition.
 void setMark(int mark)
          Sets the mark.
 void useStarObjectColor()
          Sets to use the color that the star object represents.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

enabled

protected boolean enabled
True if the stars can be plotted.

color

protected java.awt.Color color
The color. In the case of null, a star is plotted in the color that the star object represents.

fill_flag

protected boolean fill_flag
True if the mark is filled.

line_width

protected int line_width
The line width.

plot_radius

protected int plot_radius
The radius. In the case the size is determined depending on the magnitude, the radius means the lower limit.

radius_mag_dependent

protected boolean radius_mag_dependent
True if the size is determined depending on the magnitude.

plot_ratio

protected double plot_ratio
The parameter to calculate a radius of circle to plot.

limiting_mag

protected double limiting_mag
The parameter to calculate a radius of circle to plot.

system

protected MagnitudeSystem system
The magnitude system.

mark

public int mark
The mark.

PLOT_CIRCLE

public static final int PLOT_CIRCLE
The number of mark which represents to plot a circle.

PLOT_TRIANGLE

public static final int PLOT_TRIANGLE
The number of mark which represents to plot a triangle.

PLOT_RECTANGLE

public static final int PLOT_RECTANGLE
The number of mark which represents to plot a rectangle.
Constructor Detail

PlotProperty

public PlotProperty()
Constructs a PlotProperty.
Method Detail

isEnabled

public boolean isEnabled()
Checks if the star can be plotted.
Returns:
true if the star can be plotted.

enable

public void enable()
Enables to plot the stars.

disable

public void disable()
Disables to plot the stars.

getColor

public java.awt.Color getColor()
Gets the color.
Returns:
the color.

setColor

public void setColor(java.awt.Color color)
Sets the color.
Parameters:
color - the color.

useStarObjectColor

public void useStarObjectColor()
Sets to use the color that the star object represents.

isFilled

public boolean isFilled()
Returns true if the mark is filled.
Returns:
true if the mark is filled.

setFilled

public void setFilled(boolean flag)
Sets a flag to fill the mark or not.
Parameters:
flag - true if the mark is filled.

getLineWidth

public int getLineWidth()
Gets the line width.
Returns:
the line width.

setLineWidth

public void setLineWidth(int width)
Sets the line width.
Parameters:
width - the line width.

getFixedRadius

public int getFixedRadius()
Gets the fixed radius.
Returns:
the fixed radius.

getMagnitudeSystem

public MagnitudeSystem getMagnitudeSystem()
Gets the magnitude system definition.
Returns:
the magnitude system.

setMagnitudeSystem

public void setMagnitudeSystem(MagnitudeSystem system)
Sets the magnitude system definition.
Parameters:
system - the magnitude system.

getMagnitude

public double getMagnitude(Star star)
Gets the converted magnitude of the specified star.
Parameters:
star - the star.
Returns:
the magnitude.

getRadius

public int getRadius(double mag)
Gets the radius depending on the specified magnitude.
Parameters:
mag - the magnitude.
Returns:
the radius.

isSizeFixed

public boolean isSizeFixed()
Returns true if the size is not determined depending on the magnitude
Returns:
true if the size is not determined depending on the magnitude

setFixedRadius

public void setFixedRadius(int radius)
Sets the fixed radius.
Parameters:
radius - the radius.

setDependentSizeParameters

public void setDependentSizeParameters(double new_ratio,
                                       double new_mag,
                                       int new_radius)
Sets the parameters to calculate a radius of circle to plot.
Parameters:
new_ratio - the new parameter for plot_ratio.
new_mag - the new parameter for limiting_mag.
new_radius - the new parameter for plot_radius.

getLimitingMag

public double getLimitingMag()
Gets the limiting magnitude.
Returns:
the limiting magnitude.

setLimitingMag

public void setLimitingMag(double limiting_mag)
Sets the limiting magnitude.
Parameters:
limiting_mag - the limiting magnitude.

getMark

public int getMark()
Gets the mark.
Returns:
the number of mark.

setMark

public void setMark(int mark)
Sets the mark.
Parameters:
number - the number of mark.

plot

public void plot(java.awt.Graphics g,
                 int x,
                 int y,
                 StarPosition star)
Plots a star at the specified position.
Parameters:
g - the Graphics to draw.
x - the x positon.
y - the y positon.
star - the star position object to plot.