ccl.platform
Class Native

java.lang.Object
  |
  +--ccl.platform.Native
Direct Known Subclasses:
Linux

public class Native
extends java.lang.Object

This is the base class to invoke some native methods. In case the underlying OS is Linux, the appropriate native system methods are invoked, otherwise empty dummy methods are invoked which do nothing.


Constructor Summary
protected Native()
          Native is a singleton class.
 
Method Summary
static Native getInstance()
          Native is a singleton class.
 int getMainJavaPID()
          Get process ID of the current Java main process.
 int getPID()
          Get process ID of the current Java program/process.
static java.util.Hashtable getUserNames()
           
 void requestInputFocus(java.lang.String sWindowTitle_)
          Set input focus on a system window.
 void setLocation(java.awt.Dialog dialog, int x, int y)
          Sets the location of the dialog using native system routines.
 void setLocation(java.awt.Frame frame, int x, int y)
          Sets the location of the frame using native system routines.
 int symlink(java.lang.String sOldPath_, java.lang.String sNewPath_)
          Create a symbolic link (on Unix).
 boolean unlink(java.lang.String sPath_)
          Remove a symbolic link (on Unix).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Native

protected Native()
Native is a singleton class. Use 'getInstance()' to create a Native object.

Method Detail

getInstance

public static Native getInstance()
Native is a singleton class. Use this method to create a Native object.


requestInputFocus

public void requestInputFocus(java.lang.String sWindowTitle_)
Set input focus on a system window.


symlink

public int symlink(java.lang.String sOldPath_,
                   java.lang.String sNewPath_)
Create a symbolic link (on Unix).


unlink

public boolean unlink(java.lang.String sPath_)
Remove a symbolic link (on Unix).


getUserNames

public static java.util.Hashtable getUserNames()
Returns:
Returns an empty Hashtable on windows. If /etc/passwd can be read, the keys of the hashtable are user ids and their values are user names.

getPID

public int getPID()
Get process ID of the current Java program/process.


getMainJavaPID

public int getMainJavaPID()
Get process ID of the current Java main process.


setLocation

public void setLocation(java.awt.Frame frame,
                        int x,
                        int y)
Sets the location of the frame using native system routines.


setLocation

public void setLocation(java.awt.Dialog dialog,
                        int x,
                        int y)
Sets the location of the dialog using native system routines.