All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tea.set.Tool

java.lang.Object
   |
   +----tea.set.Tool

public class Tool
extends Object
A class that contains methods shared by multiple widgets.


Constructor Index

 o Tool()

Method Index

 o absLocation(Component)
Return the location of component relative to screen.
 o draw3DLine(Graphics, int, int, int, int, Color, int)
Draw a 3D line.
 o draw3DLine(Graphics, int, int, int, int, Color, int, boolean)
Draw a 3D line, either raised or lowered style.
 o findApplet(Component)
Find the closest applet parent from a component.
 o findFrame(Component)
Find the top level frame from a component.
 o findTopContainer(Component)
Find the top container parent from a component.
 o findWindow(Component)
Find the closest window parent from a component.
 o locationInFrame(Component)
Return the location of component in relative to top frame.
 o locationInWindow(Component)
Return the location of component in relative to parent window.
 o parseString(String)
Replace \n with newline, \t with tab in the string.
 o toArray(Vector)
Copy the content of a vector into an array.
 o tokenize(String, String)
Break string into an array of tokens.

Constructors

 o Tool
 public Tool()

Methods

 o draw3DLine
 public static void draw3DLine(Graphics g,
                               int x1,
                               int y1,
                               int x2,
                               int y2,
                               Color color,
                               int width)
Draw a 3D line.

Parameters:
g - Graphics context of this component.
x1 - starting point x coordinate.
y1 - starting point y coordinate.
x2 - ending point x coordinate.
y2 - ending point y coordinate.
color - line color.
width - line width in pixel.
 o draw3DLine
 public static void draw3DLine(Graphics g,
                               int x1,
                               int y1,
                               int x2,
                               int y2,
                               Color color,
                               int width,
                               boolean raised)
Draw a 3D line, either raised or lowered style.

Parameters:
g - Graphics context of this component.
x1 - starting point x coordinate.
y1 - starting point y coordinate.
x2 - ending point x coordinate.
y2 - ending point y coordinate.
color - line color.
width - line width in pixel.
raised - true to draw raised line, false for lowered line.
 o findFrame
 public static Frame findFrame(Component comp)
Find the top level frame from a component.

Parameters:
comp - component as starting point of search.
Returns:
top frame.
 o findWindow
 public static Window findWindow(Component comp)
Find the closest window parent from a component.

Parameters:
comp - component as starting point of search.
Returns:
nearest window.
 o findApplet
 public static Applet findApplet(Component comp)
Find the closest applet parent from a component.

Parameters:
comp - component as starting point of search.
Returns:
nearest applet.
 o findTopContainer
 public static Container findTopContainer(Component comp)
Find the top container parent from a component.

Parameters:
comp - component as starting point of search.
Returns:
nearest top container.
 o locationInFrame
 public static Point locationInFrame(Component comp)
Return the location of component in relative to top frame.

Parameters:
comp - component as starting point of search.
Returns:
location related to frame.
 o locationInWindow
 public static Point locationInWindow(Component comp)
Return the location of component in relative to parent window.

Parameters:
comp - component as starting point of search.
Returns:
location related to window.
 o absLocation
 public static Point absLocation(Component comp)
Return the location of component relative to screen.

Parameters:
comp - component as starting point of search.
Returns:
location related to screen.
 o parseString
 public static String parseString(String str)
Replace \n with newline, \t with tab in the string. Also unescape '<'.

Parameters:
str - string to be processed.
Returns:
string with newline and tab escape sequence replaced.
 o tokenize
 public static String[] tokenize(String str,
                                 String delim)
Break string into an array of tokens. The delimiter is passed to StringTokenizer for tokenizing the string.

Parameters:
str - string to break up.
delim - delimiter string.
Returns:
token array.
 o toArray
 public static Object[] toArray(Vector v)
Copy the content of a vector into an array.


All Packages  Class Hierarchy  This Package  Previous  Next  Index