TV-Browser 3.3.3 API

util.ui
Class TextAreaIcon

java.lang.Object
  extended by util.ui.TextAreaIcon
All Implemented Interfaces:
javax.swing.Icon

public class TextAreaIcon
extends java.lang.Object
implements javax.swing.Icon

An icon that displays multiline text.

Author:
Martin Oberhauser

Constructor Summary
TextAreaIcon(java.lang.String text, java.awt.Font font, int width)
          Creates a TextAreaIcon with the specified text, font and width.
TextAreaIcon(java.lang.String text, java.awt.Font font, int width, int lineSpace)
          Creates a TextAreaIcon with the specified text, font and width.
 
Method Summary
 int getIconHeight()
          Returns the icon's height.
 int getIconWidth()
          Returns the icon's mWidth.
 int getLineCount()
           
 int getMaximumLineCount()
          Get the maximum LineCount
 boolean isTextCut()
          has the text in this icon been cut because it was longer than maxLines?
 void paintIcon(java.awt.Component comp, java.awt.Graphics grp, int x, int y)
          Draw the icon at the specified location.
 void setMaximumLineCount(int maxLineCount)
          Sets the maximum Linecount
 void setText(java.io.Reader textReader)
          Set the Text of this Icon
 void setText(java.lang.String text)
          Set the Text of this Icon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextAreaIcon

public TextAreaIcon(java.lang.String text,
                    java.awt.Font font,
                    int width,
                    int lineSpace)
Creates a TextAreaIcon with the specified text, font and width.


TextAreaIcon

public TextAreaIcon(java.lang.String text,
                    java.awt.Font font,
                    int width)
Creates a TextAreaIcon with the specified text, font and width.

Method Detail

setMaximumLineCount

public void setMaximumLineCount(int maxLineCount)
Sets the maximum Linecount

Parameters:
maxLineCount - Max Count of Lines

getMaximumLineCount

public int getMaximumLineCount()
Get the maximum LineCount

Returns:
Maximum LineCount

setText

public void setText(java.lang.String text)
Set the Text of this Icon

Parameters:
text - Text in this Icon

setText

public void setText(java.io.Reader textReader)
             throws java.io.IOException
Set the Text of this Icon

Parameters:
textReader - Text in this Icon
Throws:
java.io.IOException

getIconHeight

public int getIconHeight()
Returns the icon's height.

Specified by:
getIconHeight in interface javax.swing.Icon
Returns:
an int specifying the fixed height of the icon.

getIconWidth

public int getIconWidth()
Returns the icon's mWidth.

Specified by:
getIconWidth in interface javax.swing.Icon
Returns:
an int specifying the fixed mWidth of the icon.

getLineCount

public int getLineCount()
Returns:
The number of used lines.

paintIcon

public void paintIcon(java.awt.Component comp,
                      java.awt.Graphics grp,
                      int x,
                      int y)
Draw the icon at the specified location. Icon implementations may use the Component argument to get properties useful for painting, e.g. the foreground or background color.

Specified by:
paintIcon in interface javax.swing.Icon

isTextCut

public boolean isTextCut()
has the text in this icon been cut because it was longer than maxLines?

Returns:
true if the text was cut
Since:
3.0

TV-Browser 3.3.3 API

TV-Browser 3.3.3, Copyright (C) 2004-2008 TV-Browser Team (dev@tvbrowser.org)