package devopsdistilled.operp.client.abstracts;

import javax.swing.JComponent;
import javax.swing.JDialog;

import net.miginfocom.swing.MigLayout;

public abstract class SubTaskPane implements PaneModelObserver {
	protected JDialog dialog;

	public SubTaskPane() {
		dialog = new JDialog();
		dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
		dialog.getContentPane().setLayout(new MigLayout("fill"));
	}

	public abstract JComponent getPane();

	public void init() {
		dialog.getContentPane().add(getPane(), "grow");
		//dialog.setSize(400, 600);
		dialog.setLocationRelativeTo(null);
		dialog.pack();
		dialog.requestFocus();
		dialog.setVisible(true);
	}

	public JDialog getDialog() {
		return dialog;
	}

	@Override
	public void updateTitle(String title) {
		getDialog().setTitle(title);
	}
}

@@ -42,16 +42,69 @@
 racts;%0A%0A
+import java.awt.Dimension;%0Aimport java.awt.Toolkit;%0A%0A
 import j
@@ -581,10 +581,8 @@
 ;%0A%09%09
-//
 dial
@@ -591,36 +591,8 @@
 .set
-Size(400, 600);%0A%09%09dialog.set
 Loca
@@ -627,16 +627,277 @@
 og.pack(
+);%0A%09%09final Toolkit toolkit = Toolkit.getDefaultToolkit();%0A%09%09final Dimension screenSize = toolkit.getScreenSize();%0A%09%09final int x = (screenSize.width - dialog.getWidth()) / 2;%0A%09%09final int y = (screenSize.height - dialog.getHeight()) / 2;%0A%09%09dialog.setLocation(x, y
 );%0A%09%09dia

Set SubTaskPane dialog to center.