trackeditor: save trackgen dialog position

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8406 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 4214d650cd0bc386e2cb73a16e4b84fcc0e4a33b
Former-commit-id: 8e86cf6d5eeb614367c595921377ecfb24c56897
This commit is contained in:
iobyte 2022-08-17 19:16:23 +00:00
parent c8b91e074d
commit 9c15bfee65
3 changed files with 45 additions and 1 deletions

View file

@ -735,6 +735,8 @@ public class EditorFrame extends JFrame
getProject().setDefaultSurfacesDialogY(preferences.getInt("DefaultSurfacesDialogY", 0));
getProject().setDefaultObjectsDialogX(preferences.getInt("DefaultObjectsDialogX", 0));
getProject().setDefaultObjectsDialogY(preferences.getInt("DefaultObjectsDialogY", 0));
getProject().setTrackgenDialogX(preferences.getInt("TrackgenDialogX", 0));
getProject().setTrackgenDialogY(preferences.getInt("TrackgenDialogY", 0));
}
/**
@ -2314,6 +2316,8 @@ public class EditorFrame extends JFrame
preferences.putInt("DefaultSurfacesDialogY", getProject().getDefaultSurfacesDialogY());
preferences.putInt("DefaultObjectsDialogX", getProject().getDefaultObjectsDialogX());
preferences.putInt("DefaultObjectsDialogY", getProject().getDefaultObjectsDialogY());
preferences.putInt("TrackgenDialogX", getProject().getTrackgenDialogX());
preferences.putInt("TrackgenDialogY", getProject().getTrackgenDialogY());
System.exit(0);
}

View file

@ -20,6 +20,8 @@
*/
package gui;
import java.awt.Point;
import java.awt.event.WindowEvent;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@ -29,6 +31,7 @@ import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.WindowConstants;
/**
* @author babis
@ -73,6 +76,11 @@ public class TrackgenPanel extends JDialog implements Runnable
this.setContentPane(getJPanel());
this.setTitle("Trackgen");
this.setSize(475, 320);
Point p = new Point();
p.x = editorFrame.getProject().getTrackgenDialogX();
p.y = editorFrame.getProject().getTrackgenDialogY();
this.setLocation(p);
this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
}
public void run()
@ -257,5 +265,15 @@ public class TrackgenPanel extends JDialog implements Runnable
}
return jPanel1;
}
} // @jve:decl-index=0:visual-constraint="10,10"
protected void processWindowEvent(WindowEvent e)
{
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING)
{
editorFrame.getProject().setTrackgenDialogX(this.getX());
editorFrame.getProject().setTrackgenDialogY(this.getY());
}
}
} // @jve:decl-index=0:visual-constraint="10,10"

View file

@ -38,6 +38,8 @@ public class Project
private int defaultSurfacesDialogY = 0;
private int defaultObjectsDialogX = 0;
private int defaultObjectsDialogY = 0;
private int trackgenDialogX = 0;
private int trackgenDialogY = 0;
public Project()
{
@ -160,4 +162,24 @@ public class Project
{
this.defaultObjectsDialogY = defaultObjectsDialogY;
}
public int getTrackgenDialogX()
{
return trackgenDialogX;
}
public void setTrackgenDialogX(int trackgenDialogX)
{
this.trackgenDialogX = trackgenDialogX;
}
public int getTrackgenDialogY()
{
return trackgenDialogY;
}
public void setTrackgenDialogY(int trackgenDialogY)
{
this.trackgenDialogY = trackgenDialogY;
}
}