Search in sources :

Example 16 with SizeRequirements

use of javax.swing.SizeRequirements in project jdk8u_jdk by JetBrains.

the class TableView method checkSingleColumnCell.

/**
     * check the requirements of a table cell that spans a single column.
     */
void checkSingleColumnCell(int axis, int col, View v) {
    SizeRequirements req = columnRequirements[col];
    req.minimum = Math.max((int) v.getMinimumSpan(axis), req.minimum);
    req.preferred = Math.max((int) v.getPreferredSpan(axis), req.preferred);
    req.maximum = Math.max((int) v.getMaximumSpan(axis), req.maximum);
}
Also used : SizeRequirements(javax.swing.SizeRequirements)

Example 17 with SizeRequirements

use of javax.swing.SizeRequirements in project jdk8u_jdk by JetBrains.

the class FlowView method calculateMinorAxisRequirements.

/**
     * Calculate requirements along the minor axis.  This
     * is implemented to forward the request to the logical
     * view by calling getMinimumSpan, getPreferredSpan, and
     * getMaximumSpan on it.
     */
protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r) {
    if (r == null) {
        r = new SizeRequirements();
    }
    float pref = layoutPool.getPreferredSpan(axis);
    float min = layoutPool.getMinimumSpan(axis);
    // Don't include insets, Box.getXXXSpan will include them.
    r.minimum = (int) min;
    r.preferred = Math.max(r.minimum, (int) pref);
    r.maximum = Integer.MAX_VALUE;
    r.alignment = 0.5f;
    return r;
}
Also used : SizeRequirements(javax.swing.SizeRequirements)

Aggregations

SizeRequirements (javax.swing.SizeRequirements)17 Element (javax.swing.text.Element)1 View (javax.swing.text.View)1 InlineView (javax.swing.text.html.InlineView)1 ParagraphView (javax.swing.text.html.ParagraphView)1