|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindfusion.diagramming.Cell
public class Cell
Represents a cell in a table. Cells are arranged in a grid of rows and columns, and can span more than one rows or columns if needed. Each cell can display an image and a text label.
Cells are the building blocks of tables. They get their height and width
indirectly, from the width of table columns and the height of table rows as
set via the Column.setWidth(float)
and Row.setHeight(float)
methods. Cells
can be made to span several rows and columns by calling their setRowSpan(int)
and setColumnSpan(int)
methods.
A cell can display a text label, as set via the setText(java.lang.String)
method. The
text alignment is set by calling setTextFormat(com.mindfusion.diagramming.TextFormat)
. Color of the text in
the cells is set via the setTextColor(java.awt.Color)
method.
The appearance of a cell can be customized further via the setBrush(com.mindfusion.diagramming.Brush)
,
setImage(java.awt.Image)
and setImageAlign(int)
methods.
Constructor Summary | |
---|---|
Cell()
Used internally to implement serialization functionality. |
|
Cell(TableNode table)
Initializes a new Cell instance and assigns the specified table as its parent. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Creates a copy of the cell. |
Brush |
getBrush()
Gets the Brush used to fill the cell's interior. |
int |
getColumnSpan()
Gets the number of columns spanned by this cell. |
java.awt.geom.Rectangle2D |
getEditRect(java.awt.geom.Point2D mousePosition)
|
java.awt.Font |
getFont()
|
java.lang.String |
getHyperLink()
Gets the hyperlink associated with the cell. |
java.awt.Image |
getImage()
Gets the image that is displayed inside the cell. |
int |
getImageAlign()
Gets a value indicating how the image displayed inside the cell is aligned relatively to the cell bounds. |
java.lang.String |
getPlainText()
Gets the plain text extracted from the formatted text by removing the formatting tags. |
int |
getRowSpan()
Gets the number of rows spanned by this cell. |
TableNode |
getTable()
|
java.lang.String |
getText()
Gets the text that is displayed inside the cell. |
java.awt.Color |
getTextColor()
Gets the color used to draw the text of this cell. |
TextFormat |
getTextFormat()
Gets a TextFormat object specifying how to format and align the text of this cell. |
java.awt.geom.Dimension2D |
getTextSize()
Gets the size of the text displayed in this cell. |
java.lang.String |
getTextToEdit()
|
java.lang.String |
getToolTip()
Gets the tooltip text that is displayed when the mouse pointer rests for a while over the cell. |
protected void |
loadFromXml(org.w3c.dom.Element xmlElement,
XmlPersistContext context)
|
void |
readExternal(java.io.ObjectInput in)
Implements Externalizable. |
void |
renderText(java.lang.String text,
java.awt.geom.Rectangle2D dest,
com.mindfusion.diagramming.DrawTextHint hint)
Styled text rendering callback. |
protected void |
saveToXml(org.w3c.dom.Element xmlElement,
XmlPersistContext context)
|
void |
setBrush(Brush value)
Sets the Brush used to fill the cell's interior. |
void |
setColumnSpan(int value)
Sets the number of columns spanned by this cell. |
void |
setEditedText(java.lang.String newText)
|
void |
setFont(java.awt.Font font)
|
void |
setHyperLink(java.lang.String value)
Sets the hyperlink associated with the cell. |
void |
setImage(java.awt.Image value)
Sets the image that should be displayed inside the cell. |
void |
setImageAlign(int value)
Sets a value indicating how the image displayed inside the cell should be aligned relatively to the cell bounds. |
void |
setRowSpan(int value)
Sets the number of rows spanned by this cell. |
void |
setText(java.lang.String value)
Sets the text that should be displayed inside the cell. |
void |
setTextColor(java.awt.Color value)
Sets the color used to draw the text of this cell. |
void |
setTextFormat(TextFormat value)
Sets a TextFormat object specifying how to format and align the text of this cell. |
void |
setToolTip(java.lang.String value)
Sets the tooltip text that should be displayed when the mouse pointer rests for a while over the cell. |
void |
writeExternal(java.io.ObjectOutput out)
Implements Externalizable. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Cell(TableNode table)
table
- The TableNode
that contains this cell.public Cell()
Method Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
Cell
instance.public java.lang.String getText()
String
containing the cell's text.public void setText(java.lang.String value)
value
- A String
containing the cell's text.public java.lang.String getHyperLink()
String
containing the cell's hyperlink.public void setHyperLink(java.lang.String value)
value
- A String
containing the cell's hyperlink.public TextFormat getTextFormat()
TextFormat
object specifying how to format and align the text of this cell.
TextFormat
object specifying the text format and alignment.public void setTextFormat(TextFormat value)
TextFormat
object specifying how to format and align the text of this cell.
value
- A TextFormat
object specifying the text format and alignment.public java.awt.Color getTextColor()
Color
object representing the text color.public void setTextColor(java.awt.Color value)
value
- A Color
object representing the text color.public java.awt.geom.Dimension2D getTextSize()
public void renderText(java.lang.String text, java.awt.geom.Rectangle2D dest, com.mindfusion.diagramming.DrawTextHint hint)
public java.lang.String getPlainText()
String
containing the cell's text stripped from
formatting tags.public java.lang.String getToolTip()
String
containing the cell's tooltip.public void setToolTip(java.lang.String value)
value
- A String
containing the cell's tooltip.public java.awt.Image getImage()
java.awt.Image
object.public void setImage(java.awt.Image value)
value
- A java.awt.Image
object.public int getImageAlign()
ImageAlign
constants.public void setImageAlign(int value)
value
- One of the ImageAlign
constants.public Brush getBrush()
Brush
used to fill the cell's interior.
Brush
object.public void setBrush(Brush value)
Brush
used to fill the cell's interior.
value
- A Brush
object.public java.lang.String getTextToEdit()
getTextToEdit
in interface InplaceEditable
public void setEditedText(java.lang.String newText)
setEditedText
in interface InplaceEditable
public java.awt.geom.Rectangle2D getEditRect(java.awt.geom.Point2D mousePosition)
getEditRect
in interface InplaceEditable
public int getColumnSpan()
public void setColumnSpan(int value)
value
- An integer value specifying the number of spanned columns.public int getRowSpan()
public void setRowSpan(int value)
value
- An integer value specifying the number of spanned rows.public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
protected void saveToXml(org.w3c.dom.Element xmlElement, XmlPersistContext context)
protected void loadFromXml(org.w3c.dom.Element xmlElement, XmlPersistContext context) throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException
public TableNode getTable()
public void setFont(java.awt.Font font)
public java.awt.Font getFont()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |