summaryrefslogtreecommitdiff
path: root/sources/utils/VSFrame.java
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-05-25 08:10:13 +0000
committerPaul Buetow <paul@buetow.org>2008-05-25 08:10:13 +0000
commitc015d586d22b69078b6da61858e5675793856b0b (patch)
treeefbc9881cf59363abef52a0beb5eedf9e81a224a /sources/utils/VSFrame.java
parent62fe28f0b0b0c9ebde18a6dc33907889ff3aa21b (diff)
JAutoDoc :)
Diffstat (limited to 'sources/utils/VSFrame.java')
-rw-r--r--sources/utils/VSFrame.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/sources/utils/VSFrame.java b/sources/utils/VSFrame.java
index 608011b..ad2b54c 100644
--- a/sources/utils/VSFrame.java
+++ b/sources/utils/VSFrame.java
@@ -1,30 +1,65 @@
+/*
+ * VS is (c) 2008 by Paul C. Buetow
+ * vs@dev.buetow.org
+ */
package utils;
import java.awt.*;
import java.awt.event.*;
import javax.swing.JFrame;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class VSFrame.
+ */
public class VSFrame extends JFrame {
+
+ /** The Constant X_LOCATION_OFFSET. */
private final static int X_LOCATION_OFFSET = 40;
+
+ /** The Constant Y_LOCATION_OFFSET. */
private final static int Y_LOCATION_OFFSET = 80;
+
+ /** The parent. */
private Component parent;
+
+ /** The dispose. */
private boolean dispose;
+ /**
+ * Instantiates a new vS frame.
+ *
+ * @param title the title
+ * @param parent the parent
+ */
public VSFrame(String title, Component parent) {
super(title);
init(parent);
}
+ /**
+ * Instantiates a new vS frame.
+ *
+ * @param title the title
+ */
public VSFrame(String title) {
super(title);
init(null);
}
+ /**
+ * Inits the.
+ *
+ * @param parent the parent
+ */
private void init(Component parent) {
this.parent = parent;
this.dispose = false;
}
+ /**
+ * Dispose with parent.
+ */
public void disposeWithParent() {
if (!dispose && parent != null && parent instanceof Window) {
Window window = (Window) parent;
@@ -37,6 +72,9 @@ public class VSFrame extends JFrame {
dispose = true;
}
+ /**
+ * Sets the correct location.
+ */
private void setCorrectLocation() {
int x = 0, y = 0;
final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
@@ -62,6 +100,9 @@ public class VSFrame extends JFrame {
super.setLocation(x, y);
}
+ /* (non-Javadoc)
+ * @see java.awt.Window#setSize(int, int)
+ */
public void setSize(int width, int height) {
super.setSize(width, height);
setCorrectLocation();