package edu.agh.tunev.ui.plot;

import java.beans.PropertyVetoException;

import javax.swing.JInternalFrame;
import javax.swing.SwingUtilities;

public abstract class AbstractPlot extends JInternalFrame {

	private static final long serialVersionUID = 1L;

	/**
	 * Nazwa wykresu w UI.
	 */
	public static String PLOT_NAME;

	public AbstractPlot(int modelNumber, String modelName, int plotNumber,
			Class<? extends AbstractPlot> subclass) {
		String name = null;
		try {
			name = (String) subclass.getDeclaredField("PLOT_NAME").get(this);
		} catch (IllegalArgumentException | IllegalAccessException
				| NoSuchFieldException | SecurityException e1) {
		}

		setTitle(modelNumber + ": " + modelName + " - " + plotNumber + ": "
				+ name);
		setSize(400, 300);
		setLocation(modelNumber * 20 + 400 + (plotNumber - 1) * 20, modelNumber
				* 20 + (plotNumber - 1) * 20);
		setFrameIcon(null);
		setResizable(true);
		setClosable(true);
		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		setVisible(true);

		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				try {
					AbstractPlot.this.setSelected(true);
				} catch (PropertyVetoException e) {
					AbstractPlot.this.toFront();
				}
			}
		});
	}

}

@@ -792,25 +792,29 @@
  20 + 400 + 
-(
+20 + 
 plotNumber -
@@ -807,29 +807,24 @@
 + plotNumber
- - 1)
  * 20, model
@@ -841,17 +841,21 @@
 %09* 20 + 
-(
+20 + 
 plotNumb
@@ -860,13 +860,8 @@
 mber
- - 1)
  * 2

Move default position of plot slightly (would cover visualization)