cz.autel.dmi

Class HIGConstraints

public class HIGConstraints extends Object implements Serializable

Defines constraints for each component added to container with HIGLayout layout manager. Defines components target area: x, y (column, row) of top left corner, width (number of columns or absolute size in pixels), height (number of rows or absolute size in pixels), anchors string, vertical and horizontal corrections. Usually You will use one instance of this class because HIGLayout copies passed constraint object when adds component to container.

Most of methods returns this object so Your can chain more calls into single line of code.

Constructor Summary
HIGConstraints()
Method Summary
HIGConstraintsanchors(String anchors)
Sets anchors string.
HIGConstraintsc(int c)
Sets column index.
HIGConstraintsc(int c, String anchors)
Sets column index and anchors.
intc()
Returns current column index.
HIGConstraintsclearCorrection()
Clears all corrections.
HIGConstraintscwh(int c, int w, int h)
Sets column index, target area width and height.
HIGConstraintscwh(int c, int w, int h, String anchors)
Sets column index, target area width, height and anchors.
HIGConstraintsH(int h)
Sets width to absolute size in pixels.
HIGConstraintsnext2Col()
Increases current column index by two.
HIGConstraintsnext2Row()
Increases current row index by two.
HIGConstraintsnextCol()
Increases current column index by one.
HIGConstraintsnextRow()
Increases current row index by one.
HIGConstraintsr(int r)
Sets row index.
HIGConstraintsr(int r, String anchors)
Sets row index and anchors.
intr()
Returns current row index.
HIGConstraintsrc(int r, int c)
Sets row and column index.
HIGConstraintsrc(int r, int c, String anchors)
Sets row and column index and anchors.
HIGConstraintsrcwh(int r, int c, int w, int h)
Sets row and column index, width and height.
HIGConstraintsrcwh(int r, int c, int w, int h, String anchors)
Sets row and column index, width, height and anchors.
HIGConstraintsrwh(int r, int w, int h)
Sets row index, target area width and height.
HIGConstraintsrwh(int r, int w, int h, String anchors)
Sets row index, target area width, height and anchors.
HIGConstraintssetHCorrection(int xCorr, int wCorr)
Set horizontal correction until changed or cleared.
HIGConstraintssetVCorrection(int yCorr, int hCorr)
Set vertical correction until changed or cleared.
HIGConstraintsW(int w)
Sets width to absolute size in pixels.
HIGConstraintsx(int x)
Sets column index.
HIGConstraintsx(int x, String anchors)
Sets column index and anchors.
intx()
Returns current column index.
HIGConstraintsxwh(int x, int w, int h)
Sets column index, target area width and height.
HIGConstraintsxwh(int x, int w, int h, String anchors)
Sets column index, target area width, height and anchors.
HIGConstraintsxy(int x, int y)
Sets row and column index.
HIGConstraintsxy(int x, int y, String anchors)
Sets row and column index and anchors.
HIGConstraintsxywh(int x, int y, int w, int h)
Sets row and column index, width and height.
HIGConstraintsxywh(int x, int y, int w, int h, String anchors)
Sets row and column index, width, height and anchors.
HIGConstraintsy(int y)
Sets row index.
HIGConstraintsy(int y, String anchors)
Sets row index and anchors.
inty()
Returns current row index.
HIGConstraintsywh(int y, int w, int h)
Sets row index, target area width and height.
HIGConstraintsywh(int y, int w, int h, String anchors)
Sets row index, target area width, height and anchors.

Constructor Detail

HIGConstraints

public HIGConstraints()

Method Detail

anchors

public HIGConstraints anchors(String anchors)
Sets anchors string. Preserves all other settings.

Parameters: anchors anchors string (of letters 'l','r','t','b')

Returns: this

c

public HIGConstraints c(int c)
Sets column index. Preserves row index, sets anchor to "rltb", width and height to 1.

Parameters: c column index

Returns: this

c

public HIGConstraints c(int c, String anchors)
Sets column index and anchors. Preserves row index, sets width and height to 1.

Parameters: c column index anchors anchors string (of letters 'l','r','t','b')

Returns: this

c

public int c()
Returns current column index.

clearCorrection

public HIGConstraints clearCorrection()
Clears all corrections.

Returns: this

See Also: HIGConstraints HIGConstraints

cwh

public HIGConstraints cwh(int c, int w, int h)
Sets column index, target area width and height. Preserves row index, sets anchors string to "lrtb".

Parameters: c column index w width, number of columns h height, number of rows

Returns: this

cwh

public HIGConstraints cwh(int c, int w, int h, String anchors)
Sets column index, target area width, height and anchors. Preserver row index.

Parameters: c column index w width, number of columns h height, number of rows anchors anchors string (of letters 'l','r','t','b')

Returns: this

H

public HIGConstraints H(int h)
Sets width to absolute size in pixels. Preserves all other settings.

Returns: this

next2Col

public HIGConstraints next2Col()
Increases current column index by two. Preserves all previous settings.

Returns: this

next2Row

public HIGConstraints next2Row()
Increases current row index by two. Preserves all previous settings.

Returns: this

nextCol

public HIGConstraints nextCol()
Increases current column index by one. Preserves all previous settings.

Returns: this

nextRow

public HIGConstraints nextRow()
Increases current row index by one. Preserves all previous settings.

Returns: this

r

public HIGConstraints r(int r)
Sets row index. Preserves column index, sets anchor to "rltb", width and height to 1.

Parameters: r row index

Returns: this

r

public HIGConstraints r(int r, String anchors)
Sets row index and anchors. Preserves column index, width and height to 1.

Parameters: r row index anchors anchors string (of letters 'l','r','t','b')

Returns: this

r

public int r()
Returns current row index.

rc

public HIGConstraints rc(int r, int c)
Sets row and column index. Sets anchor to "rltb", width and height to 1.

Parameters: r row index c column index

Returns: this

rc

public HIGConstraints rc(int r, int c, String anchors)
Sets row and column index and anchors. Sets width and height to 1.

Parameters: r row index c column index anchors anchors string (of letters 'l','r','t','b')

Returns: this

rcwh

public HIGConstraints rcwh(int r, int c, int w, int h)
Sets row and column index, width and height. Sets anchors to "lrtb".

Parameters: r row index c column index w width, number of columns h height, number of rows

Returns: this

rcwh

public HIGConstraints rcwh(int r, int c, int w, int h, String anchors)
Sets row and column index, width, height and anchors.

Parameters: r row index c column index w width, number of columns h height, number of rows anchors anchors string (of letters 'l','r','t','b')

Returns: this

rwh

public HIGConstraints rwh(int r, int w, int h)
Sets row index, target area width and height. Preserves row index, sets anchors string to "lrtb".

Parameters: r row index w width, number of columns h height, number of rows

Returns: this

rwh

public HIGConstraints rwh(int r, int w, int h, String anchors)
Sets row index, target area width, height and anchors. Preserver column index.

Parameters: r row index w width, number of columns h height, number of rows anchors anchors string (of letters 'l','r','t','b')

Returns: this

setHCorrection

public HIGConstraints setHCorrection(int xCorr, int wCorr)
Set horizontal correction until changed or cleared. When layout manager takes component's preferred size it will add to it passed width correction; after positioning it will change position about position correction.

Parameters: xCorr correction of horizontal position, in pixels. Can be negative. wCorr correction of width, in pixels. Can be negative.

Returns: this

See Also: HIGConstraints

setVCorrection

public HIGConstraints setVCorrection(int yCorr, int hCorr)
Set vertical correction until changed or cleared. When layout manager takes component's preferred size it will add to it passed height correction; after positioning it will change position about position correction.

Parameters: yCorr correction of vertical position, in pixels. Can be negative. hCorr correction of height, in pixels. Can be negative.

Returns: this

See Also: HIGConstraints

W

public HIGConstraints W(int w)
Sets width to absolute size in pixels. Preserves all other settings.

Returns: this

x

public HIGConstraints x(int x)
Sets column index. Preserves row index, sets anchor to "rltb", width and height to 1.

Parameters: x column index

Returns: this

x

public HIGConstraints x(int x, String anchors)
Sets column index and anchors. Preserves row index, sets width and height to 1.

Parameters: x column index anchors anchors string (of letters 'l','r','t','b')

Returns: this

x

public int x()
Returns current column index.

xwh

public HIGConstraints xwh(int x, int w, int h)
Sets column index, target area width and height. Preserves row index, sets anchors string to "lrtb".

Parameters: x column index w width, number of columns h height, number of rows

Returns: this

xwh

public HIGConstraints xwh(int x, int w, int h, String anchors)
Sets column index, target area width, height and anchors. Preserver row index.

Parameters: x column index w width, number of columns h height, number of rows anchors anchors string (of letters 'l','r','t','b')

Returns: this

xy

public HIGConstraints xy(int x, int y)
Sets row and column index. Sets anchor to "rltb", width and height to 1.

Parameters: x column index y row index

Returns: this

xy

public HIGConstraints xy(int x, int y, String anchors)
Sets row and column index and anchors. Sets width and height to 1.

Parameters: x column index y row index anchors anchors string (of letters 'l','r','t','b')

Returns: this

xywh

public HIGConstraints xywh(int x, int y, int w, int h)
Sets row and column index, width and height. Sets anchors to "lrtb".

Parameters: x column index y row index w width, number of columns h height, number of rows

Returns: this

xywh

public HIGConstraints xywh(int x, int y, int w, int h, String anchors)
Sets row and column index, width, height and anchors.

Parameters: x column index y row index w width, number of columns h height, number of rows anchors anchors string (of letters 'l','r','t','b')

Returns: this

y

public HIGConstraints y(int y)
Sets row index. Preserves column index, sets anchor to "rltb", width and height to 1.

Parameters: y row index

Returns: this

y

public HIGConstraints y(int y, String anchors)
Sets row index and anchors. Preserves column index, width and height to 1.

Parameters: y row index anchors anchors string (of letters 'l','r','t','b')

Returns: this

y

public int y()
Returns current row index.

ywh

public HIGConstraints ywh(int y, int w, int h)
Sets row index, target area width and height. Preserves row index, sets anchors string to "lrtb".

Parameters: y row index w width, number of columns h height, number of rows

Returns: this

ywh

public HIGConstraints ywh(int y, int w, int h, String anchors)
Sets row index, target area width, height and anchors. Preserver column index.

Parameters: y row index w width, number of columns h height, number of rows anchors anchors string (of letters 'l','r','t','b')

Returns: this