Class sfclasses.Utils
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sfclasses.Utils

java.lang.Object
   |
   +----sfclasses.Utils

public class Utils
extends Object
Collection of utility routines

Constructor Index

 o Utils()

Method Index

 o add_component(Container, Component, GridBagLayout, GridBagConstraints, int, int, int, int, int, int)
Prepare component to be added using GridBagLayout
 o fileURLPrefix()
Construct system dependent prefix for file URLs
 o getParentFrame(Component)
Execute getParent() repeatedly until it finds the parent frame
 o greenBall()
 o parseIP(String)
Parse string of the form xxx.xxx.xxx.xxx and return an IP address in byte array format.
 o printIP(byte[])
Print an IP address given in byte array format.
 o redBall()
 o timeString(Date)
 o unsign(byte)
 o unsign(int)
 o unsign(short)
 o yellowBall()

Constructors

 o Utils
  public Utils()

Methods

 o add_component
  public static void add_component(Container cont,
                                   Component c,
                                   GridBagLayout gbl,
                                   GridBagConstraints gbc,
                                   int x,
                                   int y,
                                   int w,
                                   int h,
                                   int wx,
                                   int wy)
Prepare component to be added using GridBagLayout
 o getParentFrame
  public static Frame getParentFrame(Component pcomp)
Execute getParent() repeatedly until it finds the parent frame
Parameters:
pcomp - Component
Returns:
parent frame
 o fileURLPrefix
  public static String fileURLPrefix()
Construct system dependent prefix for file URLs
 o parseIP
  public static byte[] parseIP(String addr) throws IllegalArgumentException
Parse string of the form xxx.xxx.xxx.xxx and return an IP address in byte array format.
 o printIP
  public static String printIP(byte addr[])
Print an IP address given in byte array format.
Returns:
String containing the IP address xxx.xxx.xxx.xxx
 o unsign
  public static long unsign(byte i)
Returns:
Unsigned value of a byte variable (0..255)
 o unsign
  public static long unsign(short i)
Returns:
Unsigned value of a short variable (0..65535)
 o unsign
  public static long unsign(int i)
Returns:
Unsigned value of an int variable (0..2^32-1)
 o timeString
  public static String timeString(Date d)
Parameters:
d - Date object
Returns:
String containing only the time from Date.toString()
 o redBall
  public static Image redBall()
Returns:
Red ball icon
 o greenBall
  public static Image greenBall()
Returns:
Green ball icon
 o yellowBall
  public static Image yellowBall()
Returns:
Yellow ball icon

All Packages  Class Hierarchy  This Package  Previous  Next  Index