Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: projetp1/Frontend
base: 8d65235995
...
head fork: projetp1/Frontend
compare: 25d66fb677
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 5 files changed
  • 0 commit comments
  • 2 contributors
View
BIN  projetp1/settings.lol
Binary file not shown
View
3  projetp1/src/com/github/projetp1/DataBase.java
@@ -398,12 +398,11 @@ private ResultSet selectQuery(String _sFields[],String _sTable[],String _sWhere[
CelestialObject l_star = new CelestialObject(l_id,l_HIP,l_HD,l_HR,l_ProperName,l_dRA,l_Dec,l_dDistance,l_dMag,l_dColorIndex);
Mathematics l_calc = new Mathematics(_date,_dLat, _dLon,l_star.getDec(),l_star.getRA());
- if(l_ProperName == "Sol")
+ if(l_id == 1)
{
l_calc = new Mathematics(_date,_dLat, _dLon);
l_star.setdDec(l_calc.getDeclination());
l_star.setdRA(l_calc.getAscension());
- System.out.println("SOLEIL");
}
else
l_calc = new Mathematics(_date,_dLat, _dLon,l_star.getDec(),l_star.getRA());
View
16 projetp1/src/com/github/projetp1/MainView.java
@@ -119,7 +119,7 @@ public MainView() {
inclinometerPanel.setLocation((int)(width()-10-inclinometerPanel.getWidth()), (100+inclinometerPanel.getHeight()));
- skymap = new SkyMap("hyg.db",";");
+ skymap = new SkyMap("hyg.db",";",this);
this.setFocusable(true);
@@ -227,7 +227,17 @@ public void setZoom(int _zoom) {
}
public void updateInfo(CelestialObject _object) {
-
+ name = new JLabel("<html>Nom de l'astre<br />" +
+ _object.getProperName() +
+ "<br /><br />Magnitude<br />" +
+ _object.getMag() +
+ "<br /><br />Distance(Terre)<br />" +
+ _object.getDistance() +
+ "<br /><br />Couleur<br />" +
+ _object.getColorIndex() +
+ "</html>");
+
+ System.out.println("MainView.updateInfo()");
}
public ArrayList<CelestialObject> searchForTextInSearchField() {
@@ -246,7 +256,7 @@ private double calculateScale()
}
private void formComponentResized(java.awt.event.ComponentEvent evt) {
-
+
w = calculateScale();
buttonsPanel.setScale(w/3);
View
118 projetp1/src/com/github/projetp1/Mathematics.java
@@ -18,6 +18,7 @@
import java.lang.Math;
import java.util.Calendar;
import java.util.TimeZone;
+import java.util.logging.Logger;
public class Mathematics
{
@@ -61,7 +62,7 @@
private double dX;
private double dY;
-
+
/**
* Mathematics Constructor
*
@@ -73,7 +74,7 @@
*/
public Mathematics(Calendar _date, double _dLat, double _dLon,double _dDec,double _dAsc)
{
- calculate_date_time(_date);
+ calculateDateTime(_date);
this.dLatitude = _dLat;
this.dLongitude = _dLon;
@@ -92,16 +93,17 @@ public Mathematics(Calendar _date, double _dLat, double _dLon,double _dDec,doubl
*/
public Mathematics(Calendar _date, double _dLat, double _dLon)
{
- calculate_date_time(_date);
+ calculateDateTime(_date);
this.dLatitude = _dLat;
this.dLongitude = _dLon;
this.dDate_JulianCalendar = calculate_JulianDate(this.dDay, this.dMonth, this.dYear, this.dHour,this.dMinute, this.dSecond);
- calculate_position_sun(this.dDate_JulianCalendar);
-
+ calculatePositionSun(this.dDate_JulianCalendar);
+ //this.getAll();
calculate_all();
+ this.getAll();
}
/**
@@ -111,10 +113,10 @@ public Mathematics(Calendar _date, double _dLat, double _dLon)
private void calculate_all()
{
this.dDate_JulianCalendar = calculate_JulianDate(this.dDay, this.dMonth, this.dYear, this.dHour,this.dMinute, this.dSecond);
- this.dSideral_Time = calculate_dSideral_Time(this.dDay, this.dMonth, this.dYear, this.dHour,this.dMinute, this.dSecond);
+ this.dSideral_Time = calculateSideralTime(this.dDay, this.dMonth, this.dYear, this.dHour,this.dMinute, this.dSecond);
- this.dAngle_Sideral_Time = calculate_sideral_hour_dAngle(this.dSideral_Time);
- this.dAngle_Hour = calculate_hour_angle(this.dHour, this.dMinute, this.dGMT);
+ this.dAngle_Sideral_Time = calculateSideralHourAngle(this.dSideral_Time);
+ this.dAngle_Hour = calculateHourAngle(this.dHour, this.dMinute, this.dGMT);
this.dAngle = this.dAngle_Hour + this.dAngle_Sideral_Time;
this.dHour_Angle_Star = this.dAngle - this.dAscension + this.dLongitude;
@@ -122,50 +124,51 @@ private void calculate_all()
this.dHeight = calculate_height(this.dDeclination, this.dLatitude, this.dHour_Angle_Star);
this.dAzimuth = calculate_azimuth(this.dDeclination, this.dLatitude, this.dHeight,this.dHour_Angle_Star);
- this.dX = calculate_X(this.dHeight,this.dAzimuth);
- this.dY = calculate_Y(this.dHeight,this.dAzimuth);
+ this.dX = calculateX(this.dHeight,this.dAzimuth);
+ this.dY = calculateY(this.dHeight,this.dAzimuth);
}
/**
- * calculate_date_time
+ * calculateDateTime
* Calculates the informations from the date and the time
* @param _date : Use a calendar for calculate the GTM hour
*/
- private void calculate_date_time(Calendar _date)
+ private void calculateDateTime(Calendar _date)
{
this.dHour = _date.get(Calendar.HOUR_OF_DAY);
this.dMinute = _date.get(Calendar.MINUTE);
this.dSecond = _date.get(Calendar.SECOND);
- this.dGMT = calculate_Hour_GMT(_date);
+ this.dGMT = calculateHourGMT(_date);
this.dDay = Mathematics.kadditionnal_dDay_of_Date_object + _date.get(Calendar.DATE);
this.dMonth = Mathematics.kadditionnal_dMonth_of_Date_object + _date.get(Calendar.MONTH);
this.dYear = Mathematics.kadditionnal_dYear_of_gregorian_calendar + _date.get(Calendar.YEAR);
}
/**
- * get_all
+ * getAll
* Give all the informations of the values calculated
*/
- public void get_all()
+ public void getAll()
{
- System.out.println("X : " + this.dX);
- System.out.println("Y : " + this.dY);
+ Logger log = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
+ log.info("X : " + this.dX);
+ log.info("Y : " + this.dY);
- System.out.println("Hour : " + this.dHour);
- System.out.println("Minute : " + this.dMinute);
- System.out.println("Seconde : " + this.dSecond);
- System.out.println("GMT : " + this.dGMT);
- System.out.println("Day : " + this.dDay);
- System.out.println("Month : " + this.dMonth);
- System.out.println("Year : " + this.dYear);
+ log.info("Hour : " + this.dHour);
+ log.info("Minute : " + this.dMinute);
+ log.info("Seconde : " + this.dSecond);
+ log.info("GMT : " + this.dGMT);
+ log.info("Day : " + this.dDay);
+ log.info("Month : " + this.dMonth);
+ log.info("Year : " + this.dYear);
- System.out.println("-->" + this.dDay + "/" + this.dMonth + "/" + this.dYear + "\t" + this.dHour + ":" + this.dMinute + ":" + this.dSecond);
+ log.info("-->" + this.dDay + "/" + this.dMonth + "/" + this.dYear + "\t" + this.dHour + ":" + this.dMinute + ":" + this.dSecond);
if(this.dGMT>=0)
- System.out.print("GMT+" + this.dGMT);
+ log.info("GMT+" + this.dGMT);
else
- System.out.print("GMT-" + this.dGMT);
+ log.info("GMT-" + this.dGMT);
System.out.println("Latitude : " + this.dLatitude);
System.out.println("Longitude : " + this.dLongitude);
@@ -185,11 +188,11 @@ public void get_all()
}
/**
- * calculate_position_sun
+ * calculatePositionSun
* Calculates the sun's declination and ascencion
* @param _dDate_JulianCalendar : Use the julian date of the day
*/
- private void calculate_position_sun(double _dDate_JulianCalendar)
+ private void calculatePositionSun(double _dDate_JulianCalendar)
{
//http://www.cppfrance.com/codes/CALCUL-POSITION-SOLEIL-DECLINAISON-ANGLE-HORAIRE-ALTITUDE-AZIMUT_31774.aspx
double g=357.529+0.98560028*_dDate_JulianCalendar;
@@ -197,21 +200,36 @@ private void calculate_position_sun(double _dDate_JulianCalendar)
double l=q+1.915*sin(g*pi/180.0)+0.020*sin(2*g*pi/180.0);
double e=23.439-0.00000036*_dDate_JulianCalendar;
- this.dAscension = arctan(cos(e*pi/180.0)*sin(l*pi/180.0)/cos(l*pi/180.0))*(180.0/pi)/15.0;
+ this.dAscension = arctan(cos(e*pi/180.0)*sin(l*pi/180.0)/cos(l*pi/180.0))*(180.0/pi);
if(cos(l*pi/180.0)<0)
this.dAscension = 12.0+this.dAscension;
else if(cos(l*pi/180.0)>0 && sin(l*pi/180.0)<0)
this.dAscension = this.dAscension+24.0;
this.dDeclination = arcsin(sin(e*pi/180.0)*sin(l*pi/180.0))*180.0/pi;
+
+ /*double nb_siecle=_dDate_JulianCalendar/36525.0;
+ double heure_siderale1=(24110.54841+(8640184.812866*nb_siecle)+(0.093104*(nb_siecle*nb_siecle))-(0.0000062*(nb_siecle*nb_siecle*nb_siecle)))/3600.0;
+ double heure_siderale2=((heure_siderale1/24.0)-(int)(heure_siderale1/24.0))*24.0;
+
+ double angleH=2*pi*heure_siderale2/23.9344;
+ double angleT=(this.dHour-12.0+this.dMinute/60.0+this.dSecond/3600.0)*2*pi/23.9344;
+ double angle=angleT+angleH;
+
+ double angle_horaire=angle-this.dAscension+this.dLongitude;
+
+ this.dAngle_Hour=angleH;
+ this.dAngle_Sideral_Time=angleT;
+ this.dAngle = angle;
+ this.dHour_Angle_Star = angle_horaire;*/
}
/**
- * calculate_Hour_GMT
+ * calculateHourGMT
* Gives the hour from HMT
* @param _cal : Use a calendar for calculate the GTM hour
* @return : Return an int that's the hour GMT
*/
- static private int calculate_Hour_GMT(Calendar _cal)
+ static private int calculateHourGMT(Calendar _cal)
{
TimeZone l_t = _cal.getTimeZone();
@@ -219,13 +237,13 @@ static private int calculate_Hour_GMT(Calendar _cal)
}
/**
- * calculate_X
+ * calculateX
* Calculates the X value of a coordinate system of 2D. It's a projection.
* @param _dHeight : The Height of the star, calculated with "calculate_Height()"
* @param _dAzimuth : The Azimuth of the star, calculated with "calculate_Azimuth()";
* @return : Return a double that contains the X coordinate
*/
- static private double calculate_X(double _dHeight,double _dAzimuth)
+ static private double calculateX(double _dHeight,double _dAzimuth)
{
double l_x = 1*((-2.0/pi)*_dHeight+1);
@@ -234,13 +252,13 @@ static private double calculate_X(double _dHeight,double _dAzimuth)
}
/**
- * calculate_Y
+ * calculateY
* Calculates the Y value of a coordinate system of 2D. It's a projection.
* @param _dHeight : The Height of the star, calculated with "calculate_Height()"
* @param _dAzimuth : The Azimuth of the star, calculated with "calculate_Azimuth()";
* @return : Return a double that contains the Y coordinate
*/
- static private double calculate_Y(double _dHeight,double _dAzimuth)
+ static private double calculateY(double _dHeight,double _dAzimuth)
{
double l_y = 1*((-2.0/pi)*_dHeight+1);
@@ -264,14 +282,14 @@ static private double hms(double _dHour, double _dMinute, double _dSecond)
}
/**
- * fraction_of_day
+ * fractionOfDay
* Calculates the fraction of day about a time
* @param _dHour : The hour of the value
* @param _dMinute : The Minute of the value
* @param _dSecond : The Second of the value
* @return : Return a double that contains the value
*/
- static private double fraction_of_day(double _dHour, double _dMinute, double _dSecond)
+ static private double fractionOfDay(double _dHour, double _dMinute, double _dSecond)
{
return _dHour / 24 + _dMinute / (24 * 60) + _dSecond / (24 * 60 * 60);
}
@@ -331,38 +349,48 @@ static private double calculate_JulianDate(double _dDay, double _dMonth, double
int l_c = (int) (_dYear / 100);
int l_b = 2 - l_c + (int) (l_c / 4);
- int l_t = (int) (fraction_of_day(_dHour, _dMinute, _dSecond));
+ int l_t = (int) (fractionOfDay(_dHour, _dMinute, _dSecond));
return ((int) (knumber_of_dDay_in_one_dYear * (_dYear + kinitial_dYear))
+ (int) (knumber_of_dDay_in_one_dMonth * (_dMonth + 1)) + _dDay + l_t + l_b - 1524.5);
}
+ static public double calculateAngleCompass(double _dX,double _dY,double _dZ)
+ {
+ return 0;
+ }
+
+ static public double calculateAngleInclinometer(double _dX,double _dY,double _dZ)
+ {
+ return 0;
+ }
+
/**
- * calculate_sideral_hour_dAngle Calculates the sideral hour angle
+ * calculateSideralHourAngle Calculates the sideral hour angle
*
* @param _dSideral_Time : The Sideral time
* @return : Return a double that's the result
*/
- static private double calculate_sideral_hour_dAngle(double _dSideral_Time)
+ static private double calculateSideralHourAngle(double _dSideral_Time)
{
return 2.0 * pi * _dSideral_Time / hms(23.0, 56.0, 4.0);
}
/**
- * calculate_hour_angle
+ * calculateHourAngle
* Calculates the hours dAngle
* @param _dHour : The hour
* @param _dMin : The minute
* @param _dGMT : The GMT zone
* @return : Return a double that's the result
*/
- static private double calculate_hour_angle(double _dHour, double _dMin, double _dGMT)
+ static private double calculateHourAngle(double _dHour, double _dMin, double _dGMT)
{
return (_dHour - 12 + _dMin / 60 - _dGMT) * 2 * pi / hms(23.0, 56.0, 4.0);
}
/**
- * calculate_dSideral_Time
+ * calculateSideralTime
* Calculates the sideral time
* @param _dDay : The day
* @param _dMonth : The month
@@ -372,7 +400,7 @@ static private double calculate_hour_angle(double _dHour, double _dMin, double _
* @param _dSecond : The second
* @return : Return a double that's the result
*/
- static private double calculate_dSideral_Time(double _dDay, double _dMonth, double _dYear, double _dHour,double _dMinute, double _dSecond)
+ static private double calculateSideralTime(double _dDay, double _dMonth, double _dYear, double _dHour,double _dMinute, double _dSecond)
{
double l_JJ = calculate_JulianDate(_dDay, _dMonth, _dYear, _dHour, _dMinute, _dSecond);
double l_T = (l_JJ - 2451545.0) / 36525.0;
View
299 projetp1/src/com/github/projetp1/SkyMap.java
@@ -1,42 +1,52 @@
- /**=====================================================================*
- | This file declares the following classes:
- | SkyMap
- |
- | Description of the class SkyMap :
- | This class is used to display the stars, and the arrow direction.
- | It considers the zoom and screen size for the scale.
- |
- | <p>Copyright : EIAJ, all rights reserved</p>
- | @autor : Alexandre Perez
- | @version : 1.0
- |
- |
+/**=====================================================================*
+| This file declares the following classes:
+| SkyMap
+|
+| Description of the class SkyMap :
+| This class is used to display the stars, and the arrow direction.
+| It considers the zoom and screen size for the scale.
+|
+| <p>Copyright : EIAJ, all rights reserved</p>
+| @autor : Alexandre Perez
+| @version : 1.0
+|
+|
*========================================================================*/
package com.github.projetp1;
import java.awt.*;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
import java.util.ArrayList;
import java.util.Calendar;
+import com.sun.org.apache.bcel.internal.generic.LXOR;
+
@SuppressWarnings("serial")
-public class SkyMap extends Container {
-
+public class SkyMap extends Container implements MouseListener
+{
private int zoom = 1;
private double dXOrigin = 0;
private double dYOrigin = 0;
private ArrayList<CelestialObject> celestialObjects;
-
+ MainView mainView = null;
- /**
- * SkyMap
- * Constructor
- * @param _sDataBase : The name of the database that will use
- * @param _sDelimiter : The delimiter of the string of the searchbar
+ /**
+ * SkyMap Constructor
+ *
+ * @param _sDataBase
+ * : The name of the database that will use
+ * @param _sDelimiter
+ * : The delimiter of the string of the searchbar
*/
- public SkyMap(String _sDataBase, String _sDelimiter) {
+ public SkyMap(String _sDataBase, String _sDelimiter, MainView _mainView)
+ {
+ mainView = _mainView;
+
+ this.addMouseListener(this);
this.setBackground(Color.BLACK);
- //this.setOpaque(true);
+ // this.setOpaque(true);
try
{
DataBase db = new DataBase(_sDataBase, _sDelimiter);
@@ -46,130 +56,181 @@ public SkyMap(String _sDataBase, String _sDelimiter) {
{
ex.printStackTrace();
}
- }
-
+ }
+
+ public void mousePressed(MouseEvent e)
+ {
+
+ int l_scale = (int) (this.getHeight() / 2);
+ int l_xCenter = this.getWidth() / 2 - (int) (dXOrigin * l_scale * zoom);
+ int l_yCenter = this.getHeight() / 2 + (int) (dYOrigin * l_scale * zoom);
+ double l_dLastDelta = 10;
+ double l_dXPressed = (double) (e.getX() - l_xCenter) / zoom / l_scale;
+ double l_dYPressed = (double) (e.getY() - l_yCenter) / zoom / l_scale * -1;
+ CelestialObject l_nearestCelestialObject = null;
+
+ for (CelestialObject celestialObject : celestialObjects)
+ {
+ double l_dDelta = Math.sqrt(Math.pow(
+ Math.abs(l_dXPressed - celestialObject.getXReal()), 2)
+ + Math.pow(Math.abs(l_dYPressed - celestialObject.getYReal()), 2));
+
+ if (l_dLastDelta > l_dDelta)
+ {
+ l_dLastDelta = l_dDelta;
+ l_nearestCelestialObject = celestialObject;
+ }
+ }
+
+ mainView.updateInfo(l_nearestCelestialObject);
+ }
+
/**
- * Repaint the stars with the last parameters
- */
- public void updateSkyMap() {
+ * Repaint the stars with the last parameters
+ */
+ public void updateSkyMap()
+ {
this.repaint();
}
-
public void paint(Graphics g)
{
CelestialObject sun = null;
-
- int l_scale = (int)(this.getHeight()/2);
- int l_xCenter = this.getWidth()/2 - (int)(dXOrigin * l_scale * zoom);
- int l_yCenter = this.getHeight()/2 + (int)(dYOrigin * l_scale * zoom);
+
+ int l_scale = (int) (this.getHeight() / 2);
+ int l_xCenter = this.getWidth() / 2 - (int) (dXOrigin * l_scale * zoom);
+ int l_yCenter = this.getHeight() / 2 + (int) (dYOrigin * l_scale * zoom);
for (CelestialObject celestialObject : celestialObjects)
{
int l_x, l_y;
- int l_d = getSizeForMagnitude(celestialObject.getMag())+1;
- l_x = l_xCenter + (int)(celestialObject.getXReal() * zoom * l_scale);
- l_y = l_yCenter - (int)(celestialObject.getYReal() * zoom * l_scale);
+ int l_d = getSizeForMagnitude(celestialObject.getMag()) + 1;
+ l_x = l_xCenter + (int) (celestialObject.getXReal() * zoom * l_scale);
+ l_y = l_yCenter - (int) (celestialObject.getYReal() * zoom * l_scale);
g.setColor(getColorForColorIndex(celestialObject.getColorIndex()));
- String l_name = celestialObject.getProperName();
+ String l_name = celestialObject.getProperName();
- if(l_name != null)
- g.drawString(l_name, l_x, l_y);
- if(celestialObject.getMag() < -20)
- {
- g.drawImage(getToolkit().getImage("res/sun.png"),l_x,l_y, null);
+ if (l_name != null)
+ g.drawString(l_name, l_x, l_y);
+ if (celestialObject.getMag() < -20)
+ {
+ g.drawImage(getToolkit().getImage("res/sun.png"), l_x, l_y, null);
sun = celestialObject;
- }
- else
- g.fillOval(l_x, l_y, l_d, l_d);
+ }
+ else
+ g.fillOval(l_x, l_y, l_d, l_d);
}
g.setColor(Color.red);
- g.fillOval(this.getWidth()/2, this.getHeight()/2, 30,30);
- /*
- Graphics2D g2 = (Graphics2D) g;
- g2.rotate(-getArrowAngle(sun), this.getWidth()/2, this.getHeight()/2); //TODO voir valeur non constante
- g2.drawImage(getToolkit().getImage("res/arrow.png"), this.getWidth()/2, this.getHeight()/2, null);
- */
+ g.fillOval(this.getWidth() / 2, this.getHeight() / 2, 30, 30);
+ /**
+ * Graphics2D g2 = (Graphics2D) g; g2.rotate(-getArrowAngle(sun), this.getWidth()/2,
+ * this.getHeight()/2); //TODO voir valeur non constante
+ * g2.drawImage(getToolkit().getImage("res/arrow.png"), this.getWidth()/2,
+ * this.getHeight()/2, null);
+ */
}
-
-
- private double getArrowAngle(CelestialObject _object) {
+
+ private double getArrowAngle(CelestialObject _object)
+ {
/**
- System.out.print("orign x : " + dXOrigin + ", obj x : " + _object.getXReal());
- System.out.print("orign y : " + dYOrigin + ", obj y : " + _object.getYReal());
- */
+ * System.out.print("orign x : " + dXOrigin + ", obj x : " + _object.getXReal());
+ * System.out.print("orign y : " + dYOrigin + ", obj y : " + _object.getYReal());
+ */
+
+ double l_dangle = Math.atan((_object.getYReal() - dYOrigin)
+ / (_object.getXReal() - dXOrigin));
- double l_dangle = Math.atan((_object.getYReal() - dYOrigin) / (_object.getXReal() - dXOrigin));
-
- if(dXOrigin > _object.getXReal())
+ if (dXOrigin > _object.getXReal())
l_dangle += Math.PI;
-
+
return l_dangle;
- }
-
+ }
+
/**
- * Returns the diameter of the point who display the star
- * The diameter correspond to the star magnitude
- * @param _mag : Magnitude of the star
- * @return Size of the point in pixel
- */
- private int getSizeForMagnitude(double _mag)
- {
- int size = 0;
-
- if (_mag >= 5.3)
- size = 1;
- else if (_mag >= 4.0)
- size = 2;
- else if (_mag >= 2.7)
- size = 3;
- else if (_mag >= 1.4)
- size = 4;
- else if (_mag >= 0.1)
- size = 5;
- else if (_mag >= -1.2)
- size = 6;
- else
- size = 7;
-
- return size;
- }
-
+ * Returns the diameter of the point who display the star The diameter correspond to the star
+ * magnitude
+ *
+ * @param _mag
+ * : Magnitude of the star
+ * @return Size of the point in pixel
+ */
+ private int getSizeForMagnitude(double _mag)
+ {
+ int size = 0;
+
+ if (_mag >= 5.3)
+ size = 1;
+ else if (_mag >= 4.0)
+ size = 2;
+ else if (_mag >= 2.7)
+ size = 3;
+ else if (_mag >= 1.4)
+ size = 4;
+ else if (_mag >= 0.1)
+ size = 5;
+ else if (_mag >= -1.2)
+ size = 6;
+ else
+ size = 7;
+
+ return size;
+ }
/**
- * Returns the color of the point who display the star
- * The color correspond to the star color index
- * @param _colorIndex : Color index of the star
- * @return Color of the point
- */
- private Color getColorForColorIndex(double _colorIndex)
- {
- Color c;
- if(_colorIndex >= 1.41)
- c = new Color(255,200,200);
- else if(_colorIndex >= 0.82)
- c = new Color(255,225,150);
- else if(_colorIndex >= 0.59)
- c = new Color(255,255,130);
- else if(_colorIndex >= 0.31)
- c = new Color(255,255,200);
- else if(_colorIndex >= 0.0)
- c = Color.WHITE;
- else
- c = new Color(215,215,255);
-
- return c;
- }
-
- public void setZoom(int _zoom) {
+ * Returns the color of the point who display the star The color correspond to the star color
+ * index
+ *
+ * @param _colorIndex
+ * : Color index of the star
+ * @return Color of the point
+ */
+ private Color getColorForColorIndex(double _colorIndex)
+ {
+ Color c;
+ if (_colorIndex >= 1.41)
+ c = new Color(255, 200, 200);
+ else if (_colorIndex >= 0.82)
+ c = new Color(255, 225, 150);
+ else if (_colorIndex >= 0.59)
+ c = new Color(255, 255, 130);
+ else if (_colorIndex >= 0.31)
+ c = new Color(255, 255, 200);
+ else if (_colorIndex >= 0.0)
+ c = Color.WHITE;
+ else
+ c = new Color(215, 215, 255);
+
+ return c;
+ }
+
+ public void setZoom(int _zoom)
+ {
this.zoom = _zoom;
}
-
- public void setXOrigin(double _xOrigin) {
+
+ public void setXOrigin(double _xOrigin)
+ {
this.dXOrigin = _xOrigin;
}
-
- public void setYOrigin(double _yOrigin) {
+
+ public void setYOrigin(double _yOrigin)
+ {
this.dYOrigin = _yOrigin;
}
+
+ public void mouseClicked(MouseEvent _arg0)
+ {
+ }
+
+ public void mouseEntered(MouseEvent _arg0)
+ {
+ }
+
+ public void mouseExited(MouseEvent _arg0)
+ {
+ }
+
+ public void mouseReleased(MouseEvent _arg0)
+ {
+ }
}

No commit comments for this range

Something went wrong with that request. Please try again.