All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jp.kyasu.graphics.TextAttachment

java.lang.Object
   |
   +----jp.kyasu.graphics.VWrapper
           |
           +----jp.kyasu.graphics.TextAttachment

public class TextAttachment
extends VWrapper
The TextAttachment class implements the visual item that can be stored in the text. The text attachment can wrap any visual object. The text attachment has the ratio to the width of layout of the rich text. If the ratio is set (the ratio is greater than 0.0f), the width of the text attachment becomes variable and it is resized in the ratio to the width of the layout of the rich text.

Version:
28 Sep 1997
Author:
Kazuki YASUMATSU
See Also:
Text, TextLayout

Variable Index

 o BOTTOM
The constant for the vertical bottom alignment.
 o MIDDLE
The constant for the vertical middle alignment.
 o TOP
The constant for the vertical top alignment.

Constructor Index

 o TextAttachment(String, Visualizable)
Constructs a text attachment with the specified name and visual object.
 o TextAttachment(String, Visualizable, float)
Constructs a text attachment with the specified name, visual object and ratio to the width.
 o TextAttachment(String, Visualizable, int)
Constructs a text attachment with the specified name, visual object and vertical alignment.
 o TextAttachment(String, Visualizable, int, float)
Constructs a text attachment with the specified name, visual object, vertical alignment and ratio to the width.
 o TextAttachment(Visualizable)
Constructs a text attachment with the specified visual object.
 o TextAttachment(Visualizable, float)
Constructs a text attachment with the specified visual object and ratio to the width.
 o TextAttachment(Visualizable, int)
Constructs a text attachment with the specified visual object and vertical alignment.
 o TextAttachment(Visualizable, int, float)
Constructs a text attachment with the specified visual object, vertical alignment and ratio to the width.

Method Index

 o clone()
Returns a clone of this text attachment.
 o getAlignment()
Returns the vertical alignment of this text attachment.
 o getName()
Returns the name of this text attachment.
 o getRatioToWidth()
Returns the ratio to the width of the layout of the rich text.
 o isVariableWidth()
Checks if the width of the text attachment is variable.
 o setAlignment(int)
Sets the vertical alignment of this text attachment to be the specified alignment.
 o setRatioToWidth(float)
Sets the ratio to the width of the layout of the rich text.

Variables

 o MIDDLE
 public static final int MIDDLE
The constant for the vertical middle alignment.

 o TOP
 public static final int TOP
The constant for the vertical top alignment.

 o BOTTOM
 public static final int BOTTOM
The constant for the vertical bottom alignment.

Constructors

 o TextAttachment
 public TextAttachment(Visualizable visualizable)
Constructs a text attachment with the specified visual object.

Parameters:
visualizable - the visual object.
 o TextAttachment
 public TextAttachment(Visualizable visualizable,
                       int alignment)
Constructs a text attachment with the specified visual object and vertical alignment.

Parameters:
visualizable - the visual object.
alignment - the vertical alignment.
 o TextAttachment
 public TextAttachment(Visualizable visualizable,
                       float f)
Constructs a text attachment with the specified visual object and ratio to the width.

Parameters:
visualizable - the visual object.
f - the ratio to the width.
 o TextAttachment
 public TextAttachment(Visualizable visualizable,
                       int alignment,
                       float f)
Constructs a text attachment with the specified visual object, vertical alignment and ratio to the width.

Parameters:
visualizable - the visual object.
alignment - the vertical alignment.
f - the ratio to the width.
 o TextAttachment
 public TextAttachment(String name,
                       Visualizable visualizable)
Constructs a text attachment with the specified name and visual object.

Parameters:
name - the name.
visualizable - the visual object.
 o TextAttachment
 public TextAttachment(String name,
                       Visualizable visualizable,
                       int alignment)
Constructs a text attachment with the specified name, visual object and vertical alignment.

Parameters:
name - the name.
visualizable - the visual object.
alignment - the vertical alignment.
 o TextAttachment
 public TextAttachment(String name,
                       Visualizable visualizable,
                       float f)
Constructs a text attachment with the specified name, visual object and ratio to the width.

Parameters:
name - the name.
visualizable - the visual object.
f - the ratio to the width.
 o TextAttachment
 public TextAttachment(String name,
                       Visualizable visualizable,
                       int alignment,
                       float f)
Constructs a text attachment with the specified name, visual object, vertical alignment and ratio to the width.

Parameters:
name - the name.
visualizable - the visual object.
alignment - the vertical alignment.
f - the ratio to the width.

Methods

 o getName
 public String getName()
Returns the name of this text attachment.

 o getAlignment
 public int getAlignment()
Returns the vertical alignment of this text attachment.

See Also:
MIDDLE, TOP, BOTTOM
 o setAlignment
 public void setAlignment(int alignment)
Sets the vertical alignment of this text attachment to be the specified alignment.

Parameters:
alignment - the vertical alignment.
See Also:
MIDDLE, TOP, BOTTOM
 o isVariableWidth
 public boolean isVariableWidth()
Checks if the width of the text attachment is variable.

 o getRatioToWidth
 public float getRatioToWidth()
Returns the ratio to the width of the layout of the rich text.

 o setRatioToWidth
 public void setRatioToWidth(float f)
Sets the ratio to the width of the layout of the rich text.

Parameters:
f - the ratio that should be smaller than 1.0f.
 o clone
 public Object clone()
Returns a clone of this text attachment.

Overrides:
clone in class VWrapper

All Packages  Class Hierarchy  This Package  Previous  Next  Index