| java.lang.Object javax.swing.text.View javax.swing.text.CompositeView javax.swing.text.BoxView javax.swing.text.html.TableView
TableView | class TableView extends BoxView implements ViewFactory(Code) | | HTML table view.
author: Timothy Prinzing version: 1.47 05/05/07 See Also: View |
Inner Class :public class RowView extends BoxView | |
Inner Class :class CellView extends BlockView | |
Constructor Summary | |
public | TableView(Element elem) Constructs a TableView for the given element. |
Method Summary | |
void | addFill(int row, int col) Mark a grid location as filled in for a cells overflow. | void | calculateColumnRequirements(int axis) Calculate the requirements for each column. | protected SizeRequirements | calculateMajorAxisRequirements(int axis, SizeRequirements r) Calculate the requirements for the major axis. | protected SizeRequirements | calculateMinorAxisRequirements(int axis, SizeRequirements r) Calculate the requirements for the minor axis. | public void | changedUpdate(DocumentEvent e, Shape a, ViewFactory f) Gives notification from the document that attributes were changed
in a location that this view is responsible for.
This replaces the ViewFactory with an implementation that
calls through to the createTableRow and createTableCell
methods. | void | checkMultiColumnCell(int axis, int col, int ncols, View v) check the requirements of a table cell that spans multiple
columns. | void | checkSingleColumnCell(int axis, int col, View v) check the requirements of a table cell that spans a single column. | public View | create(Element elem) The table itself acts as a factory for the various
views that actually represent pieces of the table. | protected RowView | createTableRow(Element elem) Creates a new table row. | protected void | forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent e, Shape a, ViewFactory f) | public AttributeSet | getAttributes() Fetches the attributes to use when rendering. | public int | getColumnCount() The number of columns in the table. | public int | getColumnSpan(int col) Fetches the span (width) of the given column. | protected int | getColumnsOccupied(View v) Determines the number of columns occupied by
the table cell represented by given element. | public int | getMultiRowSpan(int row0, int row1) Fetch the span of multiple rows. | RowView | getRow(int row) | public int | getRowCount() The number of rows in the table. | public int | getRowSpan(int row) Fetches the span (height) of the given row. | protected int | getRowsOccupied(View v) Determines the number of rows occupied by
the table cell represented by given element. | protected StyleSheet | getStyleSheet() | protected View | getViewAtPoint(int x, int y, Rectangle alloc) | protected View | getViewAtPosition(int pos, Rectangle a) Fetches the child view that represents the given position in
the model. | public ViewFactory | getViewFactory() Fetches the ViewFactory implementation that is feeding
the view hierarchy. | public void | insertUpdate(DocumentEvent e, Shape a, ViewFactory f) Gives notification that something was inserted into
the document in a location that this view is responsible for. | protected void | invalidateGrid() | protected void | layoutColumns(int targetSpan, int[] offsets, int[] spans, SizeRequirements[] reqs) Layout the columns to fit within the given target span.
Parameters: targetSpan - the given span for total of all the tablecolumns Parameters: reqs - the requirements desired for each column. | protected void | layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) Perform layout for the major axis of the box (i.e. | protected void | layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) Perform layout for the minor axis of the box (i.e. | public void | paint(Graphics g, Shape allocation) Renders using the given rendering surface and area on that
surface. | public void | removeUpdate(DocumentEvent e, Shape a, ViewFactory f) Gives notification that something was removed from the document
in a location that this view is responsible for.
This replaces the ViewFactory with an implementation that
calls through to the createTableRow and createTableCell
methods. | public void | replace(int offset, int length, View[] views) Change the child views. | public void | setParent(View parent) Establishes the parent view for this view. | protected void | setPropertiesFromAttributes() Update any cached values that come from attributes. | void | updateGrid() Fill in the grid locations that are placeholders
for multi-column, multi-row, and missing grid
locations. | void | updateInsets() Update the insets, which contain the caption if there
is a caption. |
colIterator | ColumnIterator colIterator(Code) | | |
columnOffsets | int[] columnOffsets(Code) | | |
columnSpans | int[] columnSpans(Code) | | |
gridValid | boolean gridValid(Code) | | |
rowIterator | RowIterator rowIterator(Code) | | |
skipComments | boolean skipComments(Code) | | |
TableView | public TableView(Element elem)(Code) | | Constructs a TableView for the given element.
Parameters: elem - the element that this view is responsible for |
addFill | void addFill(int row, int col)(Code) | | Mark a grid location as filled in for a cells overflow.
|
calculateColumnRequirements | void calculateColumnRequirements(int axis)(Code) | | Calculate the requirements for each column. The calculation
is done as two passes over the table. The table cells that
occupy a single column are scanned first to determine the
maximum of minimum, preferred, and maximum spans along the
give axis. Table cells that span multiple columns are excluded
from the first pass. A second pass is made to determine if
the cells that span multiple columns are satisfied. If the
column requirements are not satisified, the needs of the
multi-column cell is mixed into the existing column requirements.
The calculation of the multi-column distribution is based upon
the proportions of the existing column requirements and taking
into consideration any constraining maximums.
|
calculateMajorAxisRequirements | protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements r)(Code) | | Calculate the requirements for the major axis. This is called by
the superclass whenever the requirements need to be updated (i.e.
a preferenceChanged was messaged through this view).
This is implemented to provide the superclass behavior adjusted for
multi-row table cells.
|
calculateMinorAxisRequirements | protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r)(Code) | | Calculate the requirements for the minor axis. This is called by
the superclass whenever the requirements need to be updated (i.e.
a preferenceChanged was messaged through this view).
This is implemented to calculate the requirements as the sum of the
requirements of the columns and then adjust it if the
CSS width or height attribute is specified and applicable to
the axis.
|
changedUpdate | public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f)(Code) | | Gives notification from the document that attributes were changed
in a location that this view is responsible for.
This replaces the ViewFactory with an implementation that
calls through to the createTableRow and createTableCell
methods. If the element given to the factory isn't a
table row or cell, the request is delegated to the factory
passed as an argument.
Parameters: e - the change information from the associated document Parameters: a - the current allocation of the view Parameters: f - the factory to use to rebuild if the view has children See Also: View.changedUpdate |
checkMultiColumnCell | void checkMultiColumnCell(int axis, int col, int ncols, View v)(Code) | | check the requirements of a table cell that spans multiple
columns.
|
checkSingleColumnCell | void checkSingleColumnCell(int axis, int col, View v)(Code) | | check the requirements of a table cell that spans a single column.
|
create | public View create(Element elem)(Code) | | The table itself acts as a factory for the various
views that actually represent pieces of the table.
All other factory activity is delegated to the factory
returned by the parent of the table.
|
createTableRow | protected RowView createTableRow(Element elem)(Code) | | Creates a new table row.
Parameters: elem - an element the row |
getAttributes | public AttributeSet getAttributes()(Code) | | Fetches the attributes to use when rendering. This is
implemented to multiplex the attributes specified in the
model with a StyleSheet.
|
getColumnCount | public int getColumnCount()(Code) | | The number of columns in the table.
|
getColumnSpan | public int getColumnSpan(int col)(Code) | | Fetches the span (width) of the given column.
This is used by the nested cells to query the
sizes of grid locations outside of themselves.
|
getColumnsOccupied | protected int getColumnsOccupied(View v)(Code) | | Determines the number of columns occupied by
the table cell represented by given element.
|
getMultiRowSpan | public int getMultiRowSpan(int row0, int row1)(Code) | | Fetch the span of multiple rows. This includes
the border area.
|
getRow | RowView getRow(int row)(Code) | | |
getRowCount | public int getRowCount()(Code) | | The number of rows in the table.
|
getRowSpan | public int getRowSpan(int row)(Code) | | Fetches the span (height) of the given row.
|
getRowsOccupied | protected int getRowsOccupied(View v)(Code) | | Determines the number of rows occupied by
the table cell represented by given element.
|
getViewAtPosition | protected View getViewAtPosition(int pos, Rectangle a)(Code) | | Fetches the child view that represents the given position in
the model. This is implemented to walk through the children
looking for a range that contains the given position. In this
view the children do not necessarily have a one to one mapping
with the child elements.
Parameters: pos - the search position >= 0 Parameters: a - the allocation to the table on entry, and theallocation of the view containing the position on exit the view representing the given position, or null if there isn't one |
getViewFactory | public ViewFactory getViewFactory()(Code) | | Fetches the ViewFactory implementation that is feeding
the view hierarchy.
This replaces the ViewFactory with an implementation that
calls through to the createTableRow and createTableCell
methods. If the element given to the factory isn't a
table row or cell, the request is delegated to the factory
produced by the superclass behavior.
the factory, null if none |
insertUpdate | public void insertUpdate(DocumentEvent e, Shape a, ViewFactory f)(Code) | | Gives notification that something was inserted into
the document in a location that this view is responsible for.
This replaces the ViewFactory with an implementation that
calls through to the createTableRow and createTableCell
methods. If the element given to the factory isn't a
table row or cell, the request is delegated to the factory
passed as an argument.
Parameters: e - the change information from the associated document Parameters: a - the current allocation of the view Parameters: f - the factory to use to rebuild if the view has children See Also: View.insertUpdate |
invalidateGrid | protected void invalidateGrid()(Code) | | |
layoutColumns | protected void layoutColumns(int targetSpan, int[] offsets, int[] spans, SizeRequirements[] reqs)(Code) | | Layout the columns to fit within the given target span.
Parameters: targetSpan - the given span for total of all the tablecolumns Parameters: reqs - the requirements desired for each column. Thisis the column maximum of the cells minimum, preferred, andmaximum requested span Parameters: spans - the return value of how much to allocated toeach column Parameters: offsets - the return value of the offset from theorigin for each column the offset from the origin and the span for each column in the offsets and spans parameters |
layoutMajorAxis | protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans)(Code) | | Perform layout for the major axis of the box (i.e. the
axis that it represents). The results
of the layout should be placed in the given arrays which represent
the allocations to the children along the minor axis. This
is called by the superclass whenever the layout needs to be
updated along the minor axis.
This method is where the layout of the table rows within the
table takes place. This method is implemented to call the use
the RowIterator and the CSS collapsing tile to layout
with border spacing and border collapsing capabilities.
Parameters: targetSpan - the total span given to the view, whichwhould be used to layout the children Parameters: axis - the axis being layed out Parameters: offsets - the offsets from the origin of the view foreach of the child views; this is a return value and isfilled in by the implementation of this method Parameters: spans - the span of each child view; this is a returnvalue and is filled in by the implementation of this method the offset and span for each child view in theoffsets and spans parameters |
layoutMinorAxis | protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans)(Code) | | Perform layout for the minor axis of the box (i.e. the
axis orthoginal to the axis that it represents). The results
of the layout should be placed in the given arrays which represent
the allocations to the children along the minor axis. This
is called by the superclass whenever the layout needs to be
updated along the minor axis.
This is implemented to call the
layoutColumns method, and then
forward to the superclass to actually carry out the layout
of the tables rows.
Parameters: targetSpan - the total span given to the view, whichwhould be used to layout the children Parameters: axis - the axis being layed out Parameters: offsets - the offsets from the origin of the view foreach of the child views. This is a return value and isfilled in by the implementation of this method Parameters: spans - the span of each child view; this is a returnvalue and is filled in by the implementation of this method the offset and span for each child view in theoffsets and spans parameters |
paint | public void paint(Graphics g, Shape allocation)(Code) | | Renders using the given rendering surface and area on that
surface. This is implemented to delegate to the css box
painter to paint the border and background prior to the
interior. The superclass culls rendering the children
that don't directly intersect the clip and the row may
have cells hanging from a row above in it. The table
does not use the superclass rendering behavior and instead
paints all of the rows and lets the rows cull those
cells not intersecting the clip region.
Parameters: g - the rendering surface to use Parameters: allocation - the allocated region to render into See Also: View.paint |
removeUpdate | public void removeUpdate(DocumentEvent e, Shape a, ViewFactory f)(Code) | | Gives notification that something was removed from the document
in a location that this view is responsible for.
This replaces the ViewFactory with an implementation that
calls through to the createTableRow and createTableCell
methods. If the element given to the factory isn't a
table row or cell, the request is delegated to the factory
passed as an argument.
Parameters: e - the change information from the associated document Parameters: a - the current allocation of the view Parameters: f - the factory to use to rebuild if the view has children See Also: View.removeUpdate |
replace | public void replace(int offset, int length, View[] views)(Code) | | Change the child views. This is implemented to
provide the superclass behavior and invalidate the
grid so that rows and columns will be recalculated.
|
setParent | public void setParent(View parent)(Code) | | Establishes the parent view for this view. This is
guaranteed to be called before any other methods if the
parent view is functioning properly.
This is implemented
to forward to the superclass as well as call the
setPropertiesFromAttributes
method to set the paragraph properties from the css
attributes. The call is made at this time to ensure
the ability to resolve upward through the parents
view attributes.
Parameters: parent - the new parent, or null if the view isbeing removed from a parent it was previously addedto |
setPropertiesFromAttributes | protected void setPropertiesFromAttributes()(Code) | | Update any cached values that come from attributes.
|
updateGrid | void updateGrid()(Code) | | Fill in the grid locations that are placeholders
for multi-column, multi-row, and missing grid
locations.
|
updateInsets | void updateInsets()(Code) | | Update the insets, which contain the caption if there
is a caption.
|
Methods inherited from javax.swing.text.BoxView | protected void baselineLayout(int targetSpan, int axis, int[] offsets, int[] spans)(Code)(Java Doc) protected SizeRequirements baselineRequirements(int axis, SizeRequirements r)(Code)(Java Doc) protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements r)(Code)(Java Doc) protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r)(Code)(Java Doc) protected void childAllocation(int index, Rectangle alloc)(Code)(Java Doc) protected boolean flipEastAndWestAtEnds(int position, Position.Bias bias)(Code)(Java Doc) protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent e, Shape a, ViewFactory f)(Code)(Java Doc) public float getAlignment(int axis)(Code)(Java Doc) public int getAxis()(Code)(Java Doc) public Shape getChildAllocation(int index, Shape a)(Code)(Java Doc) public int getHeight()(Code)(Java Doc) public float getMaximumSpan(int axis)(Code)(Java Doc) public float getMinimumSpan(int axis)(Code)(Java Doc) protected int getOffset(int axis, int childIndex)(Code)(Java Doc) public float getPreferredSpan(int axis)(Code)(Java Doc) public int getResizeWeight(int axis)(Code)(Java Doc) protected int getSpan(int axis, int childIndex)(Code)(Java Doc) protected View getViewAtPoint(int x, int y, Rectangle alloc)(Code)(Java Doc) public int getWidth()(Code)(Java Doc) protected boolean isAfter(int x, int y, Rectangle innerAlloc)(Code)(Java Doc) protected boolean isAllocationValid()(Code)(Java Doc) protected boolean isBefore(int x, int y, Rectangle innerAlloc)(Code)(Java Doc) protected boolean isLayoutValid(int axis)(Code)(Java Doc) protected void layout(int width, int height)(Code)(Java Doc) public void layoutChanged(int axis)(Code)(Java Doc) protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans)(Code)(Java Doc) protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans)(Code)(Java Doc) public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException(Code)(Java Doc) public void paint(Graphics g, Shape allocation)(Code)(Java Doc) protected void paintChild(Graphics g, Rectangle alloc, int index)(Code)(Java Doc) public void preferenceChanged(View child, boolean width, boolean height)(Code)(Java Doc) public void replace(int index, int length, View[] elems)(Code)(Java Doc) public void setAxis(int axis)(Code)(Java Doc) public void setSize(float width, float height)(Code)(Java Doc) public int viewToModel(float x, float y, Shape a, Position.Bias[] bias)(Code)(Java Doc)
|
Methods inherited from javax.swing.text.CompositeView | abstract protected void childAllocation(int index, Rectangle a)(Code)(Java Doc) protected boolean flipEastAndWestAtEnds(int position, Position.Bias bias)(Code)(Java Doc) protected short getBottomInset()(Code)(Java Doc) public Shape getChildAllocation(int index, Shape a)(Code)(Java Doc) protected Rectangle getInsideAllocation(Shape a)(Code)(Java Doc) protected short getLeftInset()(Code)(Java Doc) protected int getNextEastWestVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet) throws BadLocationException(Code)(Java Doc) protected int getNextNorthSouthVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet) throws BadLocationException(Code)(Java Doc) public int getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet) throws BadLocationException(Code)(Java Doc) protected short getRightInset()(Code)(Java Doc) protected short getTopInset()(Code)(Java Doc) public View getView(int n)(Code)(Java Doc) abstract protected View getViewAtPoint(int x, int y, Rectangle alloc)(Code)(Java Doc) protected View getViewAtPosition(int pos, Rectangle a)(Code)(Java Doc) public int getViewCount()(Code)(Java Doc) public int getViewIndex(int pos, Position.Bias b)(Code)(Java Doc) protected int getViewIndexAtPosition(int pos)(Code)(Java Doc) abstract protected boolean isAfter(int x, int y, Rectangle alloc)(Code)(Java Doc) abstract protected boolean isBefore(int x, int y, Rectangle alloc)(Code)(Java Doc) protected void loadChildren(ViewFactory f)(Code)(Java Doc) public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException(Code)(Java Doc) public Shape modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a) throws BadLocationException(Code)(Java Doc) public void replace(int offset, int length, View[] views)(Code)(Java Doc) protected void setInsets(short top, short left, short bottom, short right)(Code)(Java Doc) protected void setParagraphInsets(AttributeSet attr)(Code)(Java Doc) public void setParent(View parent)(Code)(Java Doc) public int viewToModel(float x, float y, Shape a, Position.Bias[] bias)(Code)(Java Doc)
|
Methods inherited from javax.swing.text.View | public void append(View v)(Code)(Java Doc) public View breakView(int axis, int offset, float pos, float len)(Code)(Java Doc) public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f)(Code)(Java Doc) public View createFragment(int p0, int p1)(Code)(Java Doc) protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent e, Shape a, ViewFactory f)(Code)(Java Doc) protected void forwardUpdateToView(View v, DocumentEvent e, Shape a, ViewFactory f)(Code)(Java Doc) public float getAlignment(int axis)(Code)(Java Doc) public AttributeSet getAttributes()(Code)(Java Doc) public int getBreakWeight(int axis, float pos, float len)(Code)(Java Doc) public Shape getChildAllocation(int index, Shape a)(Code)(Java Doc) public Container getContainer()(Code)(Java Doc) public Document getDocument()(Code)(Java Doc) public Element getElement()(Code)(Java Doc) public int getEndOffset()(Code)(Java Doc) public Graphics getGraphics()(Code)(Java Doc) public float getMaximumSpan(int axis)(Code)(Java Doc) public float getMinimumSpan(int axis)(Code)(Java Doc) public int getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet) throws BadLocationException(Code)(Java Doc) public View getParent()(Code)(Java Doc) abstract public float getPreferredSpan(int axis)(Code)(Java Doc) public int getResizeWeight(int axis)(Code)(Java Doc) public int getStartOffset()(Code)(Java Doc) public String getToolTipText(float x, float y, Shape allocation)(Code)(Java Doc) public View getView(int n)(Code)(Java Doc) public int getViewCount()(Code)(Java Doc) public ViewFactory getViewFactory()(Code)(Java Doc) public int getViewIndex(int pos, Position.Bias b)(Code)(Java Doc) public int getViewIndex(float x, float y, Shape allocation)(Code)(Java Doc) public void insert(int offs, View v)(Code)(Java Doc) public void insertUpdate(DocumentEvent e, Shape a, ViewFactory f)(Code)(Java Doc) public boolean isVisible()(Code)(Java Doc) abstract public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException(Code)(Java Doc) public Shape modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a) throws BadLocationException(Code)(Java Doc) public Shape modelToView(int pos, Shape a) throws BadLocationException(Code)(Java Doc) abstract public void paint(Graphics g, Shape allocation)(Code)(Java Doc) public void preferenceChanged(View child, boolean width, boolean height)(Code)(Java Doc) public void remove(int i)(Code)(Java Doc) public void removeAll()(Code)(Java Doc) public void removeUpdate(DocumentEvent e, Shape a, ViewFactory f)(Code)(Java Doc) public void replace(int offset, int length, View[] views)(Code)(Java Doc) public void setParent(View parent)(Code)(Java Doc) public void setSize(float width, float height)(Code)(Java Doc) protected boolean updateChildren(DocumentEvent.ElementChange ec, DocumentEvent e, ViewFactory f)(Code)(Java Doc) protected void updateLayout(DocumentEvent.ElementChange ec, DocumentEvent e, Shape a)(Code)(Java Doc) abstract public int viewToModel(float x, float y, Shape a, Position.Bias[] biasReturn)(Code)(Java Doc) public int viewToModel(float x, float y, Shape a)(Code)(Java Doc)
|
|
|