public class Grid
extends java.lang.Object
implements java.io.Externalizable
Constructor and Description |
---|
Grid()
Used internally to implement serialization functionality.
|
Grid(Diagram parent) |
Modifier and Type | Method and Description |
---|---|
void |
addGridListener(GridListener listener) |
protected void |
columnHeaderAdded(Header header)
Handles the HeaderAdded event on the master column header.
|
protected void |
columnHeaderHeightChanged(Header header,
float oldValue) |
protected void |
columnHeaderRemoved(Header header) |
protected void |
columnHeaderSizeChanged() |
protected void |
columnHeaderWidthChanged(Header header,
float oldValue) |
Header |
findColumn(java.lang.String title)
Returns the first column header matching the specified caption.
|
Header |
findRow(java.lang.String title)
Finds the first row whose header caption matches the specified string.
|
ICell |
get(Header column,
Header row)
Gets the cell or the cluster of cells corresponding
to the specified row and column.
|
ICell |
get(int column,
int row) |
boolean |
getAllowResizeHeaders()
Gets a value indicating whether users can
resize the headers of the grid interactively.
|
android.graphics.RectF |
getCellBounds(ICell cell)
Returns the bounding rectangle of the specified cell.
|
int |
getCellColumn(ICell cell)
Returns the column index of the specified cell.
|
ICell |
getCellFromPoint(android.graphics.PointF point,
android.graphics.RectF cellBounds)
Gets the cell located at the specified point.
|
int |
getCellRow(ICell cell)
Returns the row index of the specified cell.
|
Header |
getColumn(int index)
Returns the column header with the specified index from the
bottommost column header level.
|
int |
getColumnCount()
Gets the number of columns in the grid.
|
android.graphics.RectF |
getColumnHeaderBounds()
Returns the bounding rectangle of all column headers.
|
HeaderList |
getColumnHeaders()
Gets the collection with the topmost column headers.
|
float[] |
getColumnHeadersHeights()
Gets an array with float values specifying
the heights of individual column levels.
|
int |
getColumnIndex(Header column)
Returns the 0-based index of the specified column.
|
boolean |
getEnableStyledText()
Gets a value indicating whether the text of the lane headers can contain
formatting tags, such as <b>.
|
android.graphics.RectF |
getHeaderBounds(Header header,
boolean includeSubHeaders)
Returns the bounding rectangle of the specified header.
|
Header |
getHeaderFromPoint(android.graphics.PointF point,
android.graphics.RectF headerBounds)
Gets the Header that is located at the specified point.
|
Header |
getHeaderFromPoint(android.graphics.PointF point,
android.graphics.RectF headerBounds,
android.graphics.PointF scrollPosition)
Gets the Header that is located at the specified point.
|
int |
getHeaderLevel(Header header)
Gets the level of the specified header.
|
boolean |
getheadersOnTop()
Gets a value indicating whether lane headers
appear at the top of the z-order above all other items.
|
boolean |
getHookHeaders()
Gets a value indicating whether headers will be
anchored to the corresponding side (that is, the column
header anchored to the top side and the row header anchored
to the left side).
|
float |
getLeftMargin()
Gets the offset of the lane grid from the left
side of the document bounds.
|
float |
getMinHeaderSize() |
Header |
getRow(int index)
Returns the row header with the specified index from the
bottommost row header level.
|
int |
getRowCount()
Gets the number of rows in the grid.
|
android.graphics.RectF |
getRowHeaderBounds()
Returns the bounding rectangle of all row headers.
|
HeaderList |
getRowHeaders()
Gets the collection with the leftmost row headers.
|
float[] |
getRowHeadersWidths()
Gets an array with float values specifying
the widths of individual row levels.
|
int |
getRowIndex(Header row)
Returns the 0-based index of the specified row.
|
Style |
getTopLeftAreaStyle()
Gets the style of the area above all row headers
and to the left of all column headers.
|
java.lang.String |
getTopLeftAreaText()
Gets the text displayed in the top left area.
|
Color |
getTopLeftAreaTextColor()
Gets the color of the text displayed in the top left area.
|
Font |
getTopLeftAreaTextFont()
Gets the font used to display text in the top left area.
|
TextFormat |
getTopLeftAreaTextFormat()
Gets the format of the text displayed in the top left area.
|
float |
getTopMargin()
Gets the offset of the lane grid from the top
side of the document bounds.
|
protected void |
headerSizeChanged() |
Header |
insertAfter(Header header)
Inserts a new header after the specified header and returns a reference to it.
|
void |
loadFromXml(org.w3c.dom.Element element,
XmlPersistContext context)
Deserializes the lane grid from the specified
Element
using the specified context. |
void |
raiseAppearanceChanged() |
void |
raiseCellBoundsChanged(CellBoundsEvent e) |
void |
raiseHeaderAdded(Header header) |
void |
raiseHeaderResized(Header header,
boolean horizontal,
boolean vertical) |
void |
raiseHeaderStartResizing(Header header,
boolean horizontal,
boolean vertical) |
void |
readExternal(java.io.ObjectInput in) |
void |
removeGridListener(GridListener listener) |
void |
renderFirst(android.graphics.Canvas target,
android.graphics.RectF viewport)
Invoked in order to render the grid before any other diagram
items are drawn.
|
void |
renderLast(android.graphics.Canvas target,
android.graphics.RectF viewport)
Invoked in order to render the grid after all other diagram
items are drawn.
|
void |
resizeColumnHeaderHeights(int level,
float increase)
This method is for internal use only.
|
void |
resizeRowHeaderWidths(int level,
float increase)
This method is for internal use only.
|
protected void |
rowHeaderAdded(Header header) |
protected void |
rowHeaderHeightChanged(Header header,
float oldValue) |
protected void |
rowHeaderRemoved(Header header) |
protected void |
rowHeaderWidthChanged(Header header,
float oldValue) |
void |
saveToXml(org.w3c.dom.Element element,
XmlPersistContext context)
Serializes the lane grid to the specified XmlElement using the specified context.
|
void |
setAllowResizeHeaders(boolean value)
Sets a value indicating whether users can
resize the headers of the grid interactively.
|
void |
setColumnCount(int value)
Sets the number of columns in the grid.
|
void |
setColumnHeadersHeights(float[] value)
Sets an array with float values specifying
the heights of individual column levels.
|
void |
setEnableStyledText(boolean value)
Sets a value indicating whether the text of the lane headers can contain
formatting tags, such as <b>.
|
void |
setHeadersOnTop(boolean value)
Sets a value indicating whether lane headers
appear at the top of the z-order above all other items.
|
void |
setHookHeaders(boolean value)
Sets a value indicating whether headers will be
anchored to the corresponding side (that is, the column
header anchored to the top side and the row header anchored
to the left side).
|
void |
setLeftMargin(float value)
Sets the offset of the lane grid from the left
side of the document bounds.
|
void |
setMinHeaderSize(float value) |
void |
setParent(Diagram parent) |
void |
setRowCount(int value)
Sets the number of rows in the grid.
|
void |
setRowHeadersWidths(float[] values)
Sets an array with float values specifying
the widths of individual row levels.
|
void |
setTopLeftAreaStyle(Style value)
Sets the style of the area above all row headers
and to the left of all column headers.
|
void |
setTopLeftAreaText(java.lang.String value)
Sets the text displayed in the top left area.
|
void |
setTopLeftAreaTextColor(Color value)
Sets the color of the text displayed in the top left area.
|
void |
setTopLeftAreaTextFont(Font value)
Sets the font used to display text in the top left area.
|
void |
setTopLeftAreaTextFormat(TextFormat value)
Sets the format of the text displayed in the top left area.
|
void |
setTopMargin(float value)
Sets the offset of the lane grid from the top
side of the document bounds.
|
void |
writeExternal(java.io.ObjectOutput out) |
public Grid(Diagram parent)
public Grid()
public void renderFirst(android.graphics.Canvas target, android.graphics.RectF viewport)
public void renderLast(android.graphics.Canvas target, android.graphics.RectF viewport)
public Style getTopLeftAreaStyle()
public void setTopLeftAreaStyle(Style value)
public java.lang.String getTopLeftAreaText()
public void setTopLeftAreaText(java.lang.String value)
public Font getTopLeftAreaTextFont()
public void setTopLeftAreaTextFont(Font value)
public TextFormat getTopLeftAreaTextFormat()
public void setTopLeftAreaTextFormat(TextFormat value)
public Color getTopLeftAreaTextColor()
public void setTopLeftAreaTextColor(Color value)
protected void rowHeaderWidthChanged(Header header, float oldValue)
protected void headerSizeChanged()
protected void rowHeaderRemoved(Header header)
protected void rowHeaderHeightChanged(Header header, float oldValue)
protected void rowHeaderAdded(Header header)
protected void columnHeaderWidthChanged(Header header, float oldValue)
protected void columnHeaderSizeChanged()
protected void columnHeaderHeightChanged(Header header, float oldValue)
protected void columnHeaderAdded(Header header)
protected void columnHeaderRemoved(Header header)
public android.graphics.RectF getColumnHeaderBounds()
public android.graphics.RectF getRowHeaderBounds()
public android.graphics.RectF getCellBounds(ICell cell)
cell
- An ICell object representing a cell or a group of cells in the grid.public Header getColumn(int index)
index
- An integer value specifying the column index.public Header getRow(int index)
index
- An integer value specifying the row index.public int getColumnCount()
public void setColumnCount(int value)
public int getRowCount()
public void setRowCount(int value)
public ICell get(Header column, Header row)
public ICell get(int column, int row)
public void addGridListener(GridListener listener)
public void removeGridListener(GridListener listener)
public void raiseHeaderAdded(Header header)
public void raiseCellBoundsChanged(CellBoundsEvent e)
public void raiseHeaderResized(Header header, boolean horizontal, boolean vertical)
public void raiseHeaderStartResizing(Header header, boolean horizontal, boolean vertical)
public void raiseAppearanceChanged()
public float getLeftMargin()
public void setLeftMargin(float value)
public float getTopMargin()
public void setTopMargin(float value)
public float getMinHeaderSize()
public void setMinHeaderSize(float value)
public boolean getHookHeaders()
public void setHookHeaders(boolean value)
public boolean getheadersOnTop()
public void setHeadersOnTop(boolean value)
public android.graphics.RectF getHeaderBounds(Header header, boolean includeSubHeaders)
header
- The Header
object whose coordinates to return.includeSubHeaders
- true to include the coordinates of the child headers in
the returned rectangle; otherwise, false.RectF
that bounds the specified header, and optionally its child headers.public HeaderList getColumnHeaders()
public float[] getColumnHeadersHeights()
public void setColumnHeadersHeights(float[] value)
public boolean getAllowResizeHeaders()
public void setAllowResizeHeaders(boolean value)
public HeaderList getRowHeaders()
public boolean getEnableStyledText()
true
if JDiagram should process formatting tags
when rendering header texts, otherwise false
.public void setEnableStyledText(boolean value)
value
- true
if JDiagram should process formatting tags
when rendering header texts, otherwise false
.public ICell getCellFromPoint(android.graphics.PointF point, android.graphics.RectF cellBounds)
point
- A Point instance specifying a point within the grid.cellBounds
- A Rect instance that receives the coordinates of the found cell.public Header getHeaderFromPoint(android.graphics.PointF point, android.graphics.RectF headerBounds)
point
- A Point instance specifying a point within the grid.headerBounds
- A Rect instance that receives the coordinates of the found header.public Header getHeaderFromPoint(android.graphics.PointF point, android.graphics.RectF headerBounds, android.graphics.PointF scrollPosition)
point
- A Point instance specifying a point within the grid.headerBounds
- A Rect instance that receives the coordinates of the found header.scrollPosition
- When the headers are hooked this parameter should provide information
about the current scroll position in the view.public Header insertAfter(Header header)
header
- The header after which to insert the new header.public int getHeaderLevel(Header header)
public void resizeColumnHeaderHeights(int level, float increase)
public void resizeRowHeaderWidths(int level, float increase)
public void saveToXml(org.w3c.dom.Element element, XmlPersistContext context)
public void loadFromXml(org.w3c.dom.Element element, XmlPersistContext context) throws java.lang.Exception
Element
using the specified context.java.lang.Exception
public void setParent(Diagram parent)
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
public Header findColumn(java.lang.String title)
title
- A string containing the header title to look for.public Header findRow(java.lang.String title)
title
- A string containing the header title to look for.public int getCellColumn(ICell cell)
cell
- An ICell object representing a single cell in the grid.public int getCellRow(ICell cell)
cell
- An ICell object representing a single cell in the grid.public int getColumnIndex(Header column)
column
- A Header instance that represents a grid column.public int getRowIndex(Header row)
row
- A Header instance that represents a grid row.public float[] getRowHeadersWidths()
public void setRowHeadersWidths(float[] values)