All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.wildcrest.MultiLineLabel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----com.wildcrest.MultiLineLabel

public class MultiLineLabel
extends Canvas
(C) Copyright 1999, Wildcrest Associates (http://www.wildcrest.com). All rights reserved.

A Java component for displaying multiple line read-only text label. Supports line breaks, line spacing, tab expansion, margins (left, right, top, bottom), line wrap (disabled in free version), font selection, height autosizing, and a multiple line property sheet editor.


Constructor Index

 o MultiLineLabel()
Construct a MultiLineLabel object with an empty label and default width
 o MultiLineLabel(String)
Construct a MultiLineLabel object with the specified string as the label
 o MultiLineLabel(String, int)
Construct a MultiLineLabel object with the specified string as the label and with initial width in pixels

Method Index

 o addPropertyChangeListener(PropertyChangeListener)
 o getBottomMargin()
Returns the bottom margin of the label.
 o getCopyright()
 o getInchesPerTab()
Returns the inches per tab stop for the label.
 o getLabelWidth()
Returns the width of the component.
 o getLeftMargin()
Returns the left margin of the label.
 o getLineSpacing()
Returns the line spacing for the label.
 o getMinimumSize()
Returns the minimum size for displaying this component.
 o getPreferredSize()
Returns the recommended size for displaying this component.
 o getRightMargin()
Returns the right margin of the label.
 o getText()
Returns the label's text string.
 o getTopMargin()
Returns the top margin of the label.
 o getWrap()
Returns whether automatic line wrapping is enabled or disabled.
 o minimumSize()
Deprecated.
 o paint(Graphics)
Paints the MultiLineLabel component using the given graphics context (called by AWT)
 o preferredSize()
Deprecated.
 o removePropertyChangeListener(PropertyChangeListener)
 o setBottomMargin(double)
Sets the bottom margin in inches.
 o setBounds(int, int, int, int)
Moves and resizes this component.
 o setCopyright(String)
 o setInchesPerTab(double)
Sets the inches per tab stop.
 o setLabelWidth(int)
Sets width of the label.
 o setLeftMargin(double)
Sets the left margin in inches.
 o setLineSpacing(double)
Sets the line spacing, in multiples of fontHeight.
 o setLocation(int, int)
Set location for this component.
 o setRightMargin(double)
Sets the right margin in inches.
 o setSize(int, int)
Resizes this component.
 o setText(String)
Sets the text label.
 o setTopMargin(double)
Sets the top margin in inches.
 o setWrap(boolean)
Sets whether automatic line wrap is enabled or disabled.

Constructors

 o MultiLineLabel
 public MultiLineLabel(String string,
                       int width)
Construct a MultiLineLabel object with the specified string as the label and with initial width in pixels

 o MultiLineLabel
 public MultiLineLabel(String string)
Construct a MultiLineLabel object with the specified string as the label

 o MultiLineLabel
 public MultiLineLabel()
Construct a MultiLineLabel object with an empty label and default width

Methods

 o setText
 public void setText(String str)
Sets the text label. Can have embedded line.separators to indicate hard line boundaries or can rely on line wrapping feature to break lines. Also can have embedded tabs.

Parameters:
string - a string specifying the text of the MultiLineLabel, which may (or may not) have embedded line.separators and tabs
 o getText
 public synchronized String getText()
Returns the label's text string.

 o setInchesPerTab
 public void setInchesPerTab(double inchesPerTab)
Sets the inches per tab stop.

Parameters:
inchesPerTab - inches per tab stop. Default: 0.5
 o getInchesPerTab
 public synchronized double getInchesPerTab()
Returns the inches per tab stop for the label.

 o setLineSpacing
 public void setLineSpacing(double lineSpacing)
Sets the line spacing, in multiples of fontHeight.

Parameters:
lineSpacing - in multiples of fontHeight (1.0 = single spacing, 2.0 = double spacing, etc.) Default: 1.0
 o getLineSpacing
 public synchronized double getLineSpacing()
Returns the line spacing for the label.

 o setLeftMargin
 public void setLeftMargin(double leftMargin)
Sets the left margin in inches.

Parameters:
leftMargin - left margin in inches. Default: 0.0
 o getLeftMargin
 public synchronized double getLeftMargin()
Returns the left margin of the label.

 o setRightMargin
 public void setRightMargin(double rightMargin)
Sets the right margin in inches.

Parameters:
rightMargin - right margin in inches (negative values allowed). Default: 0.0
 o getRightMargin
 public synchronized double getRightMargin()
Returns the right margin of the label.

 o setTopMargin
 public void setTopMargin(double topMargin)
Sets the top margin in inches.

Parameters:
topMargin - top margin in inches. Default: 0.0
 o getTopMargin
 public synchronized double getTopMargin()
Returns the top margin of the label.

 o setBottomMargin
 public void setBottomMargin(double bottomMargin)
Sets the bottom margin in inches.

Parameters:
bottomMargin - bottom margin in inches (negative values allowed). Default 0.0
 o getBottomMargin
 public synchronized double getBottomMargin()
Returns the bottom margin of the label.

 o setWrap
 public void setWrap(boolean wrap)
Sets whether automatic line wrap is enabled or disabled.

Parameters:
wrap - whether automatic line wrap is enabled or disabled. Default: true (disabled regardless of setting in free version)
 o getWrap
 public synchronized boolean getWrap()
Returns whether automatic line wrapping is enabled or disabled.

 o setLabelWidth
 public void setLabelWidth(int width)
Sets width of the label.

Parameters:
width - width of the label in pixels. Default: 150
 o getLabelWidth
 public synchronized int getLabelWidth()
Returns the width of the component.

 o setCopyright
 public void setCopyright(String str)
 o getCopyright
 public synchronized String getCopyright()
 o addPropertyChangeListener
 public void addPropertyChangeListener(PropertyChangeListener listener)
 o removePropertyChangeListener
 public void removePropertyChangeListener(PropertyChangeListener listener)
 o paint
 public void paint(Graphics g)
Paints the MultiLineLabel component using the given graphics context (called by AWT)

Parameters:
g - the graphics context used for painting the component
Overrides:
paint in class Canvas
 o getPreferredSize
 public Dimension getPreferredSize()
Returns the recommended size for displaying this component. Width is left unchanged, height is the size needed to display all the lines of text.

Overrides:
getPreferredSize in class Component
See Also:
getMinimumSize
 o preferredSize
 public Dimension preferredSize()
Note: preferredSize() is deprecated.

Overrides:
preferredSize in class Component
See Also:
getPreferredSize
 o getMinimumSize
 public Dimension getMinimumSize()
Returns the minimum size for displaying this component. Width is left unchange, height is the size needed to display all the lines of text.

Overrides:
getMinimumSize in class Component
See Also:
getPreferredSize
 o minimumSize
 public Dimension minimumSize()
Note: minimumSize() is deprecated.

Overrides:
minimumSize in class Component
See Also:
getMinimumSize
 o setBounds
 public synchronized void setBounds(int x,
                                    int y,
                                    int width,
                                    int height)
Moves and resizes this component. Causes rewrap of text.

Parameters:
x - horizontal position in parent container's coordinates
y - vertical position in parent container's coordinates
width - desired width in pixels
height - desired height in pixels
Overrides:
setBounds in class Component
 o setSize
 public synchronized void setSize(int width,
                                  int height)
Resizes this component. Causes rewrap of text.

Parameters:
width - desired width in pixels
height - desired height in pixels
Overrides:
setSize in class Component
 o setLocation
 public synchronized void setLocation(int x,
                                      int y)
Set location for this component. Causes rewrap of text.

Parameters:
x - desired x coordinate
y - desired y coordinate
Overrides:
setLocation in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index