/**
  * Shows a {@link ScatterPlotPane}.
  *
  * @param parent parent component. Can be null
  * @param xAxisName name of the X-Axis
  * @param yAxisName name of the Y-Axis
  * @param chartData data to plot
  */
 public static void showDialog(
     Component parent, String xAxisName, String yAxisName, List<ScatterPlotData> chartData) {
   ScatterPlotPane scatterPlotPane = new ScatterPlotPane(parent, xAxisName, yAxisName, chartData);
   JDialog scatterPlotDialog = new JDialog();
   scatterPlotDialog.setContentPane(scatterPlotPane);
   scatterPlotDialog.setModalityType(ModalityType.APPLICATION_MODAL);
   scatterPlotDialog.setTitle("Scatter Plot");
   scatterPlotDialog.setIconImages(Images.getApplicationImages());
   scatterPlotDialog.setPreferredSize(new Dimension(DEFAULT_WIDTH, DEFAULT_HEIGHT));
   scatterPlotDialog.setMinimumSize(new Dimension(MINIMUM_WIDTH, MINIMUM_HEIGHT));
   scatterPlotDialog.pack();
   scatterPlotDialog.setLocationRelativeTo(parent);
   scatterPlotDialog.setVisible(true);
   scatterPlotDialog.dispose();
 }
Example #2
0
 /**
  * Draws an animation in the middle of the track showing that the track is being loaded
  *
  * @param g graphics where to draw the animation
  */
 public void drawLoadingAnimation(Graphics g) {
   Image image = Images.getLoadingImage();
   int x = (graphicsPanel.getWidth() - image.getWidth(null)) / 2;
   int y = (graphicsPanel.getHeight() - image.getHeight(null)) / 2;
   g.drawImage(image, x, y, trackPanel);
 }