Class sunsoft.jws.visual.rt.awt.MultiLineLabel
All Packages Class Hierarchy This Package Previous Next Index
Class sunsoft.jws.visual.rt.awt.MultiLineLabel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----sunsoft.jws.visual.rt.awt.MultiLineLabel
- public class MultiLineLabel
- extends Canvas
-
alignment
-
-
CENTER
-
-
label
-
-
LEFT
-
-
line_ascent
-
-
line_height
-
-
line_widths
-
-
lines
-
-
margin_height
-
-
margin_width
-
-
max_width
-
-
maxChars
-
-
num_lines
-
-
RIGHT
-
-
MultiLineLabel()
-
-
MultiLineLabel(String)
-
-
MultiLineLabel(String, int)
-
-
MultiLineLabel(String, int, int)
-
-
MultiLineLabel(String, int, int, int)
-
-
MultiLineLabel(String, int, int, int, int)
- Break the label up into separate lines, and save the other info.
-
addNotify()
- This method is invoked after our Canvas is first created
but before it can actually be displayed.
-
getAlignment()
-
-
getLabel()
-
-
getMarginHeight()
-
-
getMarginWidth()
-
-
measure()
- This method figures out how the font is, and how wide each
line of the label is, and how wide the widest line is.
-
minimumSize()
- This method is called when the layout manager wants to know
the bare minimum amount of space we need to get by.
-
newLabel(String)
- This method breaks a specified label up into an array of lines.
-
paint(Graphics)
- This method draws the label (applets use the same method).
-
preferredSize()
- This method is called by a layout manager when it wants to
know how big we'd like to be.
-
setAlignment(int)
-
-
setFont(Font)
-
-
setForeground(Color)
-
-
setLabel(String)
-
-
setMarginHeight(int)
-
-
setMarginWidth(int)
-
LEFT
public final static int LEFT
CENTER
public final static int CENTER
RIGHT
public final static int RIGHT
label
protected String label
lines
protected Vector lines
num_lines
protected int num_lines
maxChars
protected int maxChars
margin_width
protected int margin_width
margin_height
protected int margin_height
line_height
protected int line_height
line_ascent
protected int line_ascent
line_widths
protected int line_widths[]
max_width
protected int max_width
alignment
protected int alignment
MultiLineLabel
public MultiLineLabel(String label,
int maxChars,
int margin_width,
int margin_height,
int alignment)
- Break the label up into separate lines, and save the other info.
MultiLineLabel
public MultiLineLabel(String label,
int maxChars,
int margin_width,
int margin_height)
MultiLineLabel
public MultiLineLabel(String label,
int maxChars,
int alignment)
MultiLineLabel
public MultiLineLabel(String label,
int maxChars)
MultiLineLabel
public MultiLineLabel(String label)
MultiLineLabel
public MultiLineLabel()
newLabel
protected void newLabel(String label)
- This method breaks a specified label up into an array of lines.
It uses the StringTokenizer utility class.
measure
protected void measure()
- This method figures out how the font is, and how wide each
line of the label is, and how wide the widest line is.
setLabel
public void setLabel(String label)
getLabel
public String getLabel()
setFont
public void setFont(Font f)
- Overrides:
- setFont in class Component
setForeground
public void setForeground(Color c)
- Overrides:
- setForeground in class Component
setAlignment
public void setAlignment(int a)
setMarginWidth
public void setMarginWidth(int mw)
setMarginHeight
public void setMarginHeight(int mh)
getAlignment
public int getAlignment()
getMarginWidth
public int getMarginWidth()
getMarginHeight
public int getMarginHeight()
addNotify
public void addNotify()
- This method is invoked after our Canvas is first created
but before it can actually be displayed. After we've
invoked our superclass's addNotify() method, we have font
metrics and can successfully call measure() to figure out
how big the label is.
- Overrides:
- addNotify in class Canvas
preferredSize
public Dimension preferredSize()
- This method is called by a layout manager when it wants to
know how big we'd like to be.
- Overrides:
- preferredSize in class Component
minimumSize
public Dimension minimumSize()
- This method is called when the layout manager wants to know
the bare minimum amount of space we need to get by.
- Overrides:
- minimumSize in class Component
paint
public void paint(Graphics g)
- This method draws the label (applets use the same method).
Note that it handles the margins and the alignment, but that
it doesn't have to worry about the color or font--the superclass
takes care of setting those in the Graphics object we're passed.
- Overrides:
- paint in class Canvas
All Packages Class Hierarchy This Package Previous Next Index