All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class datarep.common.WrapLabel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----datarep.common.WrapLabel

public class WrapLabel
extends Component
implements AdjustmentListener
WrapLabel is a class which implements an object which is functionally equivalent to a Label, except it recognizes \n as starting a new line. It also allows you to specify the width of the label. The default value for the width is for it to be the size of the longest line. The WrapLabel also reacts gracefully if its parent container is resized.

Version:
1.2
Author:
Data Representations, Inc.

Variable Index

 o SIZE_TO_LONGEST_LINE

Constructor Index

 o WrapLabel()
creates a new WrapLabel with no text in the label, and the default width.
 o WrapLabel(String)
creates a new WrapLabel with the specified label.
 o WrapLabel(String, int)
creates a new WrapLabel with the specified label and width.

Method Index

 o addNotify()
 o adjustmentValueChanged(AdjustmentEvent)
 o getMinimumSize()
 o getPreferredSize()
 o getPreferredWidth()
gets the preferred width
 o getText()
gets the text of the WrapLabel.
 o main(String[])
a simple test of WrapLabel
 o paint(Graphics)
draws the WrapLabel
 o removeNotify()
 o setPreferredWidth(int)
 o setText(String)
Sets the text of the WrapLabel to the desired value.
 o toString()

Variables

 o SIZE_TO_LONGEST_LINE
 public static final int SIZE_TO_LONGEST_LINE

Constructors

 o WrapLabel
 public WrapLabel()
creates a new WrapLabel with no text in the label, and the default width.

 o WrapLabel
 public WrapLabel(String text)
creates a new WrapLabel with the specified label.

 o WrapLabel
 public WrapLabel(String text,
                  int width)
creates a new WrapLabel with the specified label and width.

Methods

 o getText
 public String getText()
gets the text of the WrapLabel.

 o setText
 public synchronized void setText(String text)
Sets the text of the WrapLabel to the desired value.

 o getPreferredWidth
 public int getPreferredWidth()
gets the preferred width

 o setPreferredWidth
 public synchronized void setPreferredWidth(int width)
 o paint
 public void paint(Graphics g)
draws the WrapLabel

Overrides:
paint in class Component
 o getPreferredSize
 public Dimension getPreferredSize()
Overrides:
getPreferredSize in class Component
 o getMinimumSize
 public Dimension getMinimumSize()
Overrides:
getMinimumSize in class Component
 o addNotify
 public void addNotify()
Overrides:
addNotify in class Component
 o removeNotify
 public void removeNotify()
Overrides:
removeNotify in class Component
 o adjustmentValueChanged
 public void adjustmentValueChanged(AdjustmentEvent e)
 o main
 public static void main(String args[])
a simple test of WrapLabel

 o toString
 public String toString()
Overrides:
toString in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index