@PublicAPI public class MViewParams extends java.lang.Object
MViewParams mvpw = new MViewParams(); mvpw.setRowCount(rows); mvpw.setColumnCount(cols); mvpw.setVisibleRows(actualVisibleRows); mvpw.setHeaderCellSize(2, 1); mvpw.addMolecule(1, 0, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, 1, 1); mvpw.addLabel(0, 0, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.NONE, 0, 1); mvpw.setMoleculeCellSize(200, 200); mvpw.setLabelProperty(10, true, false); viewPane.setParams(mvpw.getMViewParam());This equals with the following parameter setting:
String layout = (size > 1) ? ("layout0=:2:1:M:1:0:1:1:c:b:1:1:L:0:0:1:1:c:n:0:1\n" + "param0=:M:200:200:L:10b\n") : ""; viewPane.setParams("rows=" + rows + "\n" + "cols=" + cols + "\n" + "visibleRows=" + actualVisibleRows + "\n" + layout + "\n");
Constructor and Description |
---|
MViewParams()
For each new parameter generation a new MViewParams instance is necessary to be created.
|
Modifier and Type | Method and Description |
---|---|
void |
addLabel(int startRow,
int startColumn,
int rows,
int columns)
Defines a label component inside the MarvinView table.
|
void |
addLabel(int startRow,
int startColumn,
int rows,
int columns,
int anchor,
int fill,
int weightx,
int weighty)
Defines a label component inside the MarvinView table.
|
void |
addMolecule(int startRow,
int startColumn,
int rows,
int columns)
Defines a molecule viewer component inside the MarvinView table.
|
void |
addMolecule(int startRow,
int startColumn,
int rows,
int columns,
int anchor,
int fill,
int weighty,
int weightx)
Defines a molecule viewer component inside the MarvinView table.
|
java.lang.String |
getMViewParam()
Generates the parameter string that can be set to MViewPane.
|
void |
setColumnCount(int i)
Sets the nuber of columns.
|
void |
setHeaderCellSize(int row,
int column)
Sets a logical cell extent by interpreting rows and columns as part of a sub-table.
|
void |
setLabelProperty(int fontSize,
boolean bold,
boolean italics)
Defines properties for cells containing label components.
|
void |
setMoleculeCellSize(int width,
int height)
Sets the preferred size of the cells containing molecules.
|
void |
setRowCount(int i)
Sets the total nuber of rows.
|
void |
setVisibleRows(int i)
Sets the nuber of visible rows.
|
public MViewParams()
public java.lang.String getMViewParam()
public void setRowCount(int i)
i
- maximum number of rowspublic void setColumnCount(int i)
i
- number of rowspublic void setVisibleRows(int i)
i
- number of visible rows less or equal than the total number of rowspublic void setHeaderCellSize(int row, int column)
row
- number of rows in the sub-tablecolumn
- number of columns in the sub-tablepublic void addLabel(int startRow, int startColumn, int rows, int columns)
startRow
- uppermost row of the labelstartColumn
- leftmost column of the labelrows
- number of rows to occupycolumns
- number of columns to occupypublic void addMolecule(int startRow, int startColumn, int rows, int columns)
startRow
- uppermost row of the viewerstartColumn
- leftmost column of the viewerrows
- number of rows to occupycolumns
- number of columns to occupypublic void addLabel(int startRow, int startColumn, int rows, int columns, int anchor, int fill, int weightx, int weighty)
startRow
- uppermost row of the labelstartColumn
- leftmost column of the labelrows
- number of rows to occupycolumns
- number of columns to occupyanchor
- GridBagConstraints#anchorfill
- GridBagConstraints#fillweightx
- GridBagConstraints#weightxweighty
- GridBagConstraints#weightypublic void addMolecule(int startRow, int startColumn, int rows, int columns, int anchor, int fill, int weighty, int weightx)
startRow
- uppermost row of the viewerstartColumn
- leftmost column of the viewerrows
- number of rows to occupycolumns
- number of columns to occupyanchor
- GridBagConstraints#anchorfill
- GridBagConstraints#fillweighty
- GridBagConstraints#weightyweightx
- GridBagConstraints#weightxpublic void setMoleculeCellSize(int width, int height)
width
- width of viewer cells in pixelsheight
- height of viewer cells in pixelspublic void setLabelProperty(int fontSize, boolean bold, boolean italics)
fontSize
- size of the used fontbold
- whether to set the font to bold or notitalics
- whether to set the font to italics or not