fr.esrf.tangoatk.widget.util.interlock
Class NetUtils

java.lang.Object
  extended by fr.esrf.tangoatk.widget.util.interlock.NetUtils

public class NetUtils
extends java.lang.Object

Utility class.


Constructor Summary
NetUtils()
           
 
Method Summary
static void centerDialog(java.awt.Dialog dlg, int dlgWidth, int dlgHeight)
          Center the given dialog according to its parent.
static void centerFrameOnScreen(java.awt.Frame fr)
          Center the given frame on screen.
static javax.swing.JMenuItem createMenuItem(java.lang.String name, int key, int modifier, java.awt.event.ActionListener a)
          Create a JMenuItem.
static javax.swing.border.Border createTitleBorder(java.lang.String name)
          Create a named title border.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetUtils

public NetUtils()
Method Detail

createMenuItem

public static javax.swing.JMenuItem createMenuItem(java.lang.String name,
                                                   int key,
                                                   int modifier,
                                                   java.awt.event.ActionListener a)
Create a JMenuItem.

Parameters:
name - Name
key - Accelerator key ,0 for none
modifier - Key modifier ,0 for none
a - Action listener
Returns:
Created JMenuItem

createTitleBorder

public static javax.swing.border.Border createTitleBorder(java.lang.String name)
Create a named title border.

Parameters:
name - Border name
Returns:
Border object

centerDialog

public static void centerDialog(java.awt.Dialog dlg,
                                int dlgWidth,
                                int dlgHeight)
Center the given dialog according to its parent. If the dialog is not parented (null parent), It will appear at the center of the screen. The dialog is not displayed.

Note: This function has been designed to work with 'heavyWeight' system dependant awt window which doesn't use a layout manager (null layout).

Parameters:
dlg - the dialog.
dlgWidth - desired width of the JDialog content pane.
dlgHeight - desired height of the JDialog content pane.

centerFrameOnScreen

public static void centerFrameOnScreen(java.awt.Frame fr)
Center the given frame on screen. Call it before showing this frame.

Parameters:
fr - Frame to be centered.