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