/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* HTML table view.
*
* @author Timothy Prinzing
* @see View
*/
/**
* Constructs a TableView for the given element.
*
* @param elem the element that this view is responsible for
*/
gridValid = false;
captionIndex = -1;
totalColumnRequirements = new SizeRequirements();
}
/**
* Creates a new table row.
*
* @param elem an element
* @return the row
*/
// PENDING(prinz) need to add support for some of the other
// elements, but for now just ignore anything that is not
// a TR.
}
return null;
}
/**
* The number of columns in the table.
*/
public int getColumnCount() {
return columnSpans.length;
}
/**
* 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.
*/
return columnSpans[col];
}
return 0;
}
/**
* The number of rows in the table.
*/
public int getRowCount() {
}
/**
* Fetch the span of multiple rows. This includes
* the border area.
*/
return span;
}
return 0;
}
/**
* Fetches the span (height) of the given row.
*/
}
return 0;
}
}
return null;
}
int n = getViewCount();
View v;
for (int i = 0; i < n; i++) {
v = getView(i);
if (v instanceof RowView) {
if (v != null) {
return v;
}
}
}
return super.getViewAtPoint(x, y, alloc);
}
/**
* Determines the number of columns occupied by
* the table cell represented by given element.
*/
if (s != null) {
try {
} catch (NumberFormatException nfe) {
// fall through to one column
}
}
}
return 1;
}
/**
* Determines the number of rows occupied by
* the table cell represented by given element.
*/
if (s != null) {
try {
} catch (NumberFormatException nfe) {
// fall through to one row
}
}
}
return 1;
}
protected void invalidateGrid() {
gridValid = false;
}
return doc.getStyleSheet();
}
/**
* Update the insets, which contain the caption if there
* is a caption.
*/
void updateInsets() {
if (captionIndex != -1) {
bottom += h;
} else {
top += h;
}
}
}
/**
* Update any cached values that come from attributes.
*/
protected void setPropertiesFromAttributes() {
} else {
// Default cell spacing equals 2
cellSpacing = 2;
}
} else {
borderWidth = 0;
}
}
}
/**
* Fill in the grid locations that are placeholders
* for multi-column, multi-row, and missing grid
* locations.
*/
void updateGrid() {
if (! gridValid) {
relativeCells = false;
multiRowCells = false;
// determine which views are table rows and clear out
// grid points marked filled.
captionIndex = -1;
int n = getViewCount();
for (int i = 0; i < n; i++) {
if (v instanceof RowView) {
} else {
captionIndex = i;
}
}
}
}
int maxColumns = 0;
int col = 0;
if (! relativeCells) {
relativeCells = true;
}
}
// advance to a free column
if (rowSpan > 1) {
multiRowCells = true;
}
// fill in the overflow entries for this cell
addFill(i, j);
}
}
}
if (colSpan > 1) {
}
}
}
}
// setup the column layout/requirements
columnSpans = new int[maxColumns];
columnOffsets = new int[maxColumns];
for (int i = 0; i < maxColumns; i++) {
columnRequirements[i] = new SizeRequirements();
}
gridValid = true;
}
}
/**
* Mark a grid location as filled in for a cells overflow.
*/
}
}
/**
* Layout the columns to fit within the given target span.
*
* @param targetSpan the given span for total of all the table
* columns
* @param reqs the requirements desired for each column. This
* is the column maximum of the cells minimum, preferred, and
* maximum requested span
* @param spans the return value of how much to allocated to
* each column
* @param offsets the return value of the offset from the
* origin for each column
* @return the offset from the origin and the span for each column
* in the offsets and spans parameters
*/
SizeRequirements[] reqs) {
//clean offsets and spans
}
/**
* 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.
*/
// clean columnRequirements
}
if (host instanceof JTextComponent) {
} else {
skipComments = true;
}
}
// pass 1 - single column cells
boolean hasMultiColumn = false;
int nrows = getRowCount();
for (int i = 0; i < nrows; i++) {
int col = 0;
continue;
}
if (colSpan == 1) {
} else {
hasMultiColumn = true;
}
col++;
}
}
// pass 2 - multi-column cells
if (hasMultiColumn) {
for (int i = 0; i < nrows; i++) {
int col = 0;
continue;
}
if (colSpan > 1) {
}
col++;
}
}
}
}
/**
* check the requirements of a table cell that spans a single column.
*/
}
/**
* check the requirements of a table cell that spans multiple
* columns.
*/
// calculate the totals
long min = 0;
long pref = 0;
long max = 0;
for (int i = 0; i < ncols; i++) {
}
// check if the minimum size needs adjustment.
/*
* the columns that this cell spans need adjustment to fit
* this table cell.... calculate the adjustments.
*/
for (int i = 0; i < ncols; i++) {
}
// apply the adjustments
for (int i = 0; i < ncols; i++) {
}
}
// check if the preferred size needs adjustment.
/*
* the columns that this cell spans need adjustment to fit
* this table cell.... calculate the adjustments.
*/
for (int i = 0; i < ncols; i++) {
}
// apply the adjustments
for (int i = 0; i < ncols; i++) {
}
}
}
// --- BoxView methods -----------------------------------------
/**
* 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).
* <p>
* 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.
*/
updateGrid();
// calculate column requirements for each column
// the requirements are the sum of the columns.
if (r == null) {
r = new SizeRequirements();
}
long min = 0;
long pref = 0;
int n = columnRequirements.length;
for (int i = 0; i < n; i++) {
}
// The user has requested a smaller size than is needed to
// show the table, override it.
}
}
// set the alignment
if (o != null) {
// set horizontal alignment
r.alignment = 0;
r.alignment = 0.5f;
r.alignment = 1;
} else {
r.alignment = 0;
}
} else {
r.alignment = 0;
}
return r;
}
/**
* 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).
* <p>
* This is implemented to provide the superclass behavior adjusted for
* multi-row table cells.
*/
updateInsets();
return r;
}
/**
* 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.
* <p>
* This is implemented to call the
* <a href="#layoutColumns">layoutColumns</a> method, and then
* forward to the superclass to actually carry out the layout
* of the tables rows.
*
* @param targetSpan the total span given to the view, which
* whould be used to layout the children
* @param axis the axis being layed out
* @param offsets the offsets from the origin of the view for
* each of the child views. This is a return value and is
* filled in by the implementation of this method
* @param spans the span of each child view; this is a return
* value and is filled in by the implementation of this method
* @return the offset and span for each child view in the
* offsets and spans parameters
*/
// make grid is properly represented
updateGrid();
// all of the row layouts are invalid, so mark them that way
int n = getRowCount();
for (int i = 0; i < n; i++) {
}
// calculate column spans
// continue normal layout
}
/**
* 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.
* <p>
* 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.
*
* @param targetSpan the total span given to the view, which
* whould be used to layout the children
* @param axis the axis being layed out
* @param offsets the offsets from the origin of the view for
* each of the child views; this is a return value and is
* filled in by the implementation of this method
* @param spans the span of each child view; this is a return
* value and is filled in by the implementation of this method
* @return the offset and span for each child view in the
* offsets and spans parameters
*/
if (captionIndex != -1) {
// place the caption
spans[captionIndex] = h;
if (boxBottom != getBottomInset()) {
} else {
}
}
}
/**
* 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.
*
* @param pos the search position >= 0
* @param a the allocation to the table on entry, and the
* allocation of the view containing the position on exit
* @return the view representing the given position, or
* null if there isn't one
*/
int n = getViewCount();
for (int i = 0; i < n; i++) {
int p0 = v.getStartOffset();
int p1 = v.getEndOffset();
// it's in this view.
if (a != null) {
childAllocation(i, a);
}
return v;
}
}
if (pos == getEndOffset()) {
if (a != null) {
this.childAllocation(n - 1, a);
}
return v;
}
return null;
}
// --- View methods ---------------------------------------------
/**
* Fetches the attributes to use when rendering. This is
* implemented to multiplex the attributes specified in the
* model with a StyleSheet.
*/
}
return attr;
}
/**
* 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.
*
* @param g the rendering surface to use
* @param allocation the allocated region to render into
* @see View#paint
*/
// paint the border
if (captionIndex != -1) {
// adjust the border for the caption
if (top != getTopInset()) {
int h = getTopInset() - top;
a.y += h;
a.height -= h;
} else {
}
}
// paint interior
int n = getViewCount();
for (int i = 0; i < n; i++) {
}
//super.paint(g, a);
}
/**
* Establishes the parent view for this view. This is
* guaranteed to be called before any other methods if the
* parent view is functioning properly.
* <p>
* This is implemented
* to forward to the superclass as well as call the
* <a href="#setPropertiesFromAttributes">setPropertiesFromAttributes</a>
* 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.
*
* @param parent the new parent, or null if the view is
* being removed from a parent it was previously added
* to
*/
}
}
/**
* 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.
*
* @return the factory, null if none
*/
return this;
}
/**
* 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.
*
* @param e the change information from the associated document
* @param a the current allocation of the view
* @param f the factory to use to rebuild if the view has children
* @see View#insertUpdate
*/
super.insertUpdate(e, a, this);
}
/**
* 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.
*
* @param e the change information from the associated document
* @param a the current allocation of the view
* @param f the factory to use to rebuild if the view has children
* @see View#removeUpdate
*/
super.removeUpdate(e, a, this);
}
/**
* 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.
*
* @param e the change information from the associated document
* @param a the current allocation of the view
* @param f the factory to use to rebuild if the view has children
* @see View#changedUpdate
*/
super.changedUpdate(e, a, this);
}
super.forwardUpdate(ec, e, a, f);
// A change in any of the table cells usually effects the whole table,
// so redraw it all!
if (a != null) {
Component c = getContainer();
if (c != null) {
a.getBounds();
}
}
}
/**
* Change the child views. This is implemented to
* provide the superclass behavior and invalidate the
* grid so that rows and columns will be recalculated.
*/
}
// --- ViewFactory methods ------------------------------------------
/**
* 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.
*/
return createTableRow(elem);
}
}
// default is to delegate to the normal factory
if (p != null) {
ViewFactory f = p.getViewFactory();
if (f != null) {
}
}
return null;
}
// ---- variables ----------------------------------------------------
private int cellSpacing;
private int borderWidth;
/**
* The index of the caption view if there is a caption.
* This has a value of -1 if there is no caption. The
* caption lives in the inset area of the table, and is
* updated with each time the grid is recalculated.
*/
private int captionIndex;
/**
* Do any of the table cells contain a relative size
* specification? This is updated with each call to
* updateGrid(). If this is true, the ColumnIterator
* will do extra work to calculate relative cell
* specifications.
*/
private boolean relativeCells;
/**
* Do any of the table cells span multiple rows? If
* true, the RowRequirementIterator will do additional
* work to adjust the requirements of rows spanned by
* a single table cell. This is updated with each call to
* updateGrid().
*/
private boolean multiRowCells;
int[] columnSpans;
int[] columnOffsets;
/**
* SizeRequirements for all the columns.
*/
// whether to display comments inside table or not.
boolean skipComments = false;
boolean gridValid;
/**
* Disable percentage adjustments which should only apply
* when calculating layout, not requirements.
*/
void disablePercentages() {
percentages = null;
}
/**
* Update percentage adjustments if they are needed.
*/
adjustmentWeights[i] = 0;
}
if (relativeCells) {
} else {
percentages = null;
}
int nrows = getRowCount();
int col = 0;
for (int i = 0; i < colSpan; i++) {
if (lv.isPercentage()) {
// add a percentage requirement
} else {
}
}
}
}
}
}
/**
* Set the layout arrays to use for holding layout results
*/
}
// --- RequirementIterator methods -------------------
public int getCount() {
return columnRequirements.length;
}
public void setIndex(int i) {
col = i;
}
}
public int getOffset() {
}
}
public int getSpan() {
}
// do not care for percentages, since min span can't
// be less than columnRequirements[col].minimum,
// but can be less than percentage value.
}
}
}
}
public float getBorderWidth() {
return borderWidth;
}
public float getLeadingCollapseSpan() {
return cellSpacing;
}
public float getTrailingCollapseSpan() {
return cellSpacing;
}
public int getAdjustmentWeight() {
return adjustmentWeights[col];
}
/**
* Current column index
*/
private int col;
/**
* percentage values (may be null since there
* might not be any).
*/
private int[] percentages;
private int[] adjustmentWeights;
private int[] offsets;
private int[] spans;
}
RowIterator() {
}
void updateAdjustments() {
if (multiRowCells) {
// adjust requirements of multi-row cells
int n = getRowCount();
adjustments = new int[n];
for (int i = 0; i < n; i++) {
if (rv.multiRowCells == true) {
for (int j = 0; j < ncells; j++) {
int nrows = getRowsOccupied(v);
if (nrows > 1) {
}
}
}
}
} else {
adjustments = null;
}
}
/**
* Fixup preferences to accomodate a multi-row table cell
* if not already covered by existing preferences. This is
* have arrived yet.
*/
// rows are missing (could be a bad rowspan specification)
// or not all the rows have arrived. Do the best we can with
// the current set of rows.
if (nrows < 1) {
return;
}
}
int span = 0;
for (int i = 0; i < nrows; i++) {
}
if (spanNeeded > span) {
for (int i = 1; i < nrows; i++) {
}
}
}
}
// --- RequirementIterator methods -------------------
}
}
public int getOffset() {
}
return 0;
}
}
}
public int getSpan() {
}
return 0;
}
public int getCount() {
}
public void setIndex(int i) {
row = i;
}
return getPreferredSpan(parentSpan);
}
}
return 0;
}
return getPreferredSpan(parentSpan);
}
public float getBorderWidth() {
return borderWidth;
}
public float getLeadingCollapseSpan() {
return cellSpacing;
}
public float getTrailingCollapseSpan() {
return cellSpacing;
}
public int getAdjustmentWeight() {
return 0;
}
/**
* Current row index
*/
private int row;
/**
* Adjustments to the row requirements to handle multi-row
* table cells.
*/
private int[] adjustments;
private int[] offsets;
private int[] spans;
}
/**
* View of a row in a row-centric table.
*/
/**
* Constructs a TableView for the given element.
*
* @param elem the element that this view is responsible for
*/
fillColumns = new BitSet();
RowView.this.setPropertiesFromAttributes();
}
void clearFilledColumns() {
}
}
}
/**
* The number of columns present in this row.
*/
int getColumnCount() {
int nfill = 0;
int n = fillColumns.size();
for (int i = 0; i < n; i++) {
if (fillColumns.get(i)) {
nfill ++;
}
}
return getViewCount() + nfill;
}
/**
* Fetches the attributes to use when rendering. This is
* implemented to multiplex the attributes specified in the
* model with a StyleSheet.
*/
return attr;
}
int n = getViewCount();
for (int i = 0; i < n; i++) {
childAllocation(i, alloc);
return getView(i);
}
}
return null;
}
return doc.getStyleSheet();
}
/**
* This is called by a child to indicate its
* preferred span has changed. This is implemented to
* execute the superclass behavior and well as try to
* determine if a row with a multi-row cell hangs across
* this row. If a multi-row cell covers this row it also
* needs to propagate a preferenceChanged so that it will
* recalculate the multi-row cell.
*
* @param child the child view
* @param width true if the width preference should change
* @param height true if the height preference should change
*/
if (rv.multiRowCells) {
break;
}
}
}
}
// The major axis requirements for a row are dictated by the column
// requirements. These methods use the value calculated by
// TableView.
return req;
}
float value;
}
else {
}
return value;
}
float value;
// We're flexible.
}
else {
}
return value;
}
float value;
}
else {
}
return value;
}
super.changedUpdate(e, a, f);
getEndOffset()) {
RowView.this.setPropertiesFromAttributes();
}
}
/**
* 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.
*
* @param g the rendering surface to use
* @param allocation the allocated region to render into
* @see View#paint
*/
super.paint(g, a);
}
/**
* Change the child views. This is implemented to
* provide the superclass behavior and invalidate the
* grid so that rows and columns will be recalculated.
*/
}
/**
* Calculate the height requirements of the table row. The
* requirements of multi-row cells are not considered for this
* calculation. The table itself will check and adjust the row
* requirements for all the rows that have multi-row cells spanning
* them. This method updates the multi-row flag that indicates that
* this row and rows below need additional consideration.
*/
// return super.calculateMinorAxisRequirements(axis, r);
long min = 0;
long pref = 0;
long max = 0;
multiRowCells = false;
int n = getViewCount();
for (int i = 0; i < n; i++) {
if (getRowsOccupied(v) > 1) {
multiRowCells = true;
} else {
}
}
if (r == null) {
r = new SizeRequirements();
r.alignment = 0.5f;
}
return r;
}
/**
* 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 major axis.
* <p>
* This is re-implemented to give each child the span of the column
* width for the table, and to give cells that span multiple columns
* the multi-column span.
*
* @param targetSpan the total span given to the view, which
* whould be used to layout the children
* @param axis the axis being layed out
* @param offsets the offsets from the origin of the view for
* each of the child views; this is a return value and is
* filled in by the implementation of this method
* @param spans the span of each child view; this is a return
* value and is filled in by the implementation of this method
* @return the offset and span for each child view in the
* offsets and spans parameters
*/
int col = 0;
int ncells = getViewCount();
continue;
}
if (colSpan > 1) {
int n = columnSpans.length;
for (int j = 1; j < colSpan; j++) {
// Because the table may be only partially formed, some
// of the columns may not yet exist. Therefore we check
// the bounds.
if ((col+j) < n) {
}
}
}
col++;
}
}
/**
* 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.
* <p>
* This is implemented to delegate to the superclass, then adjust
* the span for any cell that spans multiple rows.
*
* @param targetSpan the total span given to the view, which
* whould be used to layout the children
* @param axis the axis being layed out
* @param offsets the offsets from the origin of the view for
* each of the child views; this is a return value and is
* filled in by the implementation of this method
* @param spans the span of each child view; this is a return
* value and is filled in by the implementation of this method
* @return the offset and span for each child view in the
* offsets and spans parameters
*/
int col = 0;
int ncells = getViewCount();
if (rowSpan > 1) {
}
if (colSpan > 1) {
}
}
}
/**
* Determines the resizability of the view along the
* given axis. A value of 0 or less is not resizable.
*
* @param axis may be either View.X_AXIS or View.Y_AXIS
* @return the resize weight
* @exception IllegalArgumentException for an invalid axis
*/
return 1;
}
/**
* 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.
*
* @param pos the search position >= 0
* @param a the allocation to the table on entry, and the
* allocation of the view containing the position on exit
* @return the view representing the given position, or
* null if there isn't one
*/
int n = getViewCount();
for (int i = 0; i < n; i++) {
int p0 = v.getStartOffset();
int p1 = v.getEndOffset();
// it's in this view.
if (a != null) {
childAllocation(i, a);
}
return v;
}
}
if (pos == getEndOffset()) {
if (a != null) {
this.childAllocation(n - 1, a);
}
return v;
}
return null;
}
/**
* Update any cached values that come from attributes.
*/
void setPropertiesFromAttributes() {
}
/** columns filled by multi-column or multi-row cells */
/**
* The row index within the overall grid
*/
int rowIndex;
/**
* The view index (for row index to view index conversion).
* This is set by the updateGrid method.
*/
int viewIndex;
/**
* Does this table row have cells that span multiple rows?
*/
boolean multiRowCells;
}
/**
* Default view of an html table cell. This needs to be moved
* somewhere else.
*/
/**
* Constructs a TableCell for the given element.
*
* @param elem the element that this view is responsible for
*/
}
/**
* 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 major axis. This is called by the
* superclass to recalculate the positions of the child views
* when the layout might have changed.
* <p>
* This is implemented to delegate to the superclass to
* tile the children. If the target span is greater than
* was needed, the offsets are adjusted to align the children
* (i.e. position according to the html valign attribute).
*
* @param targetSpan the total span given to the view, which
* whould be used to layout the children
* @param axis the axis being layed out
* @param offsets the offsets from the origin of the view for
* each of the child views; this is a return value and is
* filled in by the implementation of this method
* @param spans the span of each child view; this is a return
* value and is filled in by the implementation of this method
* @return the offset and span for each child view in the
* offsets and spans parameters
*/
// calculate usage
int used = 0;
for (int i = 0; i < n; i++) {
}
// calculate adjustments
int adjust = 0;
if (used < targetSpan) {
// PENDING(prinz) change to use the css alignment.
}
}
}
// make adjustments.
if (adjust != 0) {
for (int i = 0; i < n; i++) {
}
}
}
/**
* Calculate the requirements needed along 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).
* <p>
* This is implemented to delegate to the superclass, but
* indicate the maximum size is very large (i.e. the cell
* is willing to expend to occupy the full height of the row).
*
* @param axis the axis being layed out.
* @param r the requirements to fill in. If null, a new one
* should be allocated.
*/
SizeRequirements r) {
return req;
}
//for the cell the minimum should be derived from the child views
//the parent behaviour is to use CSS for that
int n = getViewCount();
int min = 0;
for (int i = 0; i < n; i++) {
}
return rv;
}
}
}