Methods Summary |
---|
public void | addNotify()
super.addNotify ();
autoPosition ();
|
public void | autoPosition()
autoPosition ( this, frameOwner );
|
public static void | autoPosition(java.awt.Frame frame, java.awt.Frame frameOwner)
Dimension dim;
Dimension dimOwner;
Dimension dimFrame;
Dimension dimScreen;
Point point;
Insets insets;
Frame framePrevSibling = null;
if ( frame == null || frameOwner == null || !frameOwner.isShowing() )
return;
if ( frameOwner instanceof JMFrame && ((JMFrame)frameOwner).vectorChildFrames.size() > 0 ) {
framePrevSibling = (Frame) ((JMFrame)frameOwner).vectorChildFrames.lastElement();
}
if ( framePrevSibling != null && framePrevSibling.isShowing() ) {
point = framePrevSibling.getLocationOnScreen();
point.x += 20;
point.y += 20;
}
else {
point = frameOwner.getLocationOnScreen ();
dimOwner = frameOwner.getSize ();
point.y += dimOwner.height;
}
dim = frame.getPreferredSize ();
dimFrame = frame.getSize ();
dimFrame.width = Math.max ( dim.width, dimFrame.width );
dimFrame.height = Math.max ( dim.height, dimFrame.height );
dimScreen = Toolkit.getDefaultToolkit().getScreenSize();
if ( point.x + dimFrame.width > dimScreen.width )
point.x = dimScreen.width - dimFrame.width;
if ( point.y + dimFrame.height > dimScreen.height )
point.y = dimScreen.height - dimFrame.height;
frame.setLocation ( point );
|
protected void | initFrame()
this.addWindowListener ( this );
|
public void | setVisible(boolean boolVisible)
if ( boolVisible == true && !this.isVisible() && boolFirstTimeVisible == true ) {
boolFirstTimeVisible = false;
autoPosition ();
if ( frameOwner != null && frameOwner instanceof JMFrame ) {
((JMFrame)frameOwner).vectorChildFrames.addElement ( this );
}
}
super.setVisible ( boolVisible );
|
public void | windowActivated(java.awt.event.WindowEvent event)
|
public void | windowClosed(java.awt.event.WindowEvent event)
if ( frameOwner != null && frameOwner instanceof JMFrame
&& ((JMFrame)frameOwner).vectorChildFrames.contains(this) ) {
((JMFrame)frameOwner).vectorChildFrames.removeElement ( this );
}
|
public void | windowClosing(java.awt.event.WindowEvent event)
this.dispose ();
|
public void | windowDeactivated(java.awt.event.WindowEvent event)
|
public void | windowDeiconified(java.awt.event.WindowEvent event)
|
public void | windowIconified(java.awt.event.WindowEvent event)
|
public void | windowOpened(java.awt.event.WindowEvent event)
|