Package views

Examples of views.SkyMap


    });

    userInterface.getBtnScreenshot().addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        SkyMap sm = (SkyMap) userInterface.getSkyMap();
        Date date = (Date) userInterface.getSpnUserDate().getValue();
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        String d = new SimpleDateFormat("yyyy-MM-dd_HH-mm").format(Calendar.getInstance().getTime());
        // on arrete le défilement
        userInterface.getTglbtnPlay().setSelected(false);
        sm.screenshot("Screenshot_"+d+".png");
      }
    });

    userInterface.getSpnRatio().setValue(rotateRatio);
    Helper.registerStopAction(new Callable<Integer>() {
View Full Code Here


   *
   * @param mousePosition
   *            the position on the map in pixels
   */
  public static void findNearestStar(Point mousePosition) {
    SkyMap sm = (SkyMap) userInterface.getSkyMap();

    if (!sm.mapBounds.contains(mousePosition))
      return;
    if (mousePosition == null)
      return;
   
    Star nearestStar = Helper.getNearestStarFromPosition(mousePosition);
   
    // may be null when no stars are loaded or visible
    if (nearestStar != null) {
      // get point and text
      Point ttPos = nearestStar.getPoint();
      String line1 = nearestStar.getName();
      String line2 = nearestStar.getCoodinates().toString();
      String line3 = "Magnitude : " + nearestStar.getMagnitude();
      String line4 = "Type spectral : " + nearestStar.getSpectralType();
 
      sm.drawToolTip(ttPos,
              PanelsFactory.createToolTip("<html>" + line1 + "<br/>" + line2 + "<br/>" + line3 + "<br/>" + line4 + "<br/></html>",
                            nearestStar.getColor().brighter().brighter()));
    }
  }
View Full Code Here

    //temporary fix
    userInterface.getBtnUpdateDate().doClick();
  }
 
  private static void loadStarDisplay() {
    SkyMap sm = (SkyMap) userInterface.getSkyMap();
    sm.setStars(Stars.getStars());
    Date currentDate = Calendar.getInstance().getTime();
    // adjusting UTC time from user time zone
    long offset = Calendar.getInstance().getTimeZone().getOffset(currentDate.getTime());
    currentDate.setTime(currentDate.getTime() - offset);
    userInterface.getSpnUserDate().setValue(currentDate);
View Full Code Here

   *
   * @param date
   *            the date in the UTC format
   */
  public static void updateDateWithDate(Date date) {
    SkyMap sm = (SkyMap) userInterface.getSkyMap();
    setMaxMagnitude((double) userInterface.getSpnMagnitude().getValue());
    sm.clearToolTips();
    double longitude = Math.toRadians((Double) userInterface.getSpnLongitude().getValue());
    double latitude = Math.toRadians((Double) userInterface.getSpnLatitude().getValue());
    GregorianDate gd = new GregorianDate(date);
    UserCoordinates uc = new UserCoordinates(longitude, latitude, Time.gregorianToJulian(gd));
    sm.setUserCoordinates(uc);
    sm.repaint();
  }
View Full Code Here

   *
   * @param coordinates
   *            the coordinates of the new position to switch to
   */
  public static void updatePosition(final EarthCoordinates coordinates) {
    SkyMap sm = (SkyMap) userInterface.getSkyMap();
    sm.clearToolTips();
    sm.getUserCoordinates().setLongitude(coordinates.getLongitude());
    sm.getUserCoordinates().setLatitude(coordinates.getLatitude());
    sm.repaint();
  }
View Full Code Here

TOP

Related Classes of views.SkyMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.