|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.marvin.beans.MViewParams
public class MViewParams
MViewParams is a helper tool to generate parameter string to MViewPane.
Note that only molecules and labels are supported yet, buttons and
images are not.
Example of typical usage:
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 Summary | |
|---|---|
MViewParams()
For each new parameter generation a new MViewParams instance is necessary to be created. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MViewParams()
| Method Detail |
|---|
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 rows
public void setHeaderCellSize(int row,
int column)
row - number of rows in the sub-tablecolumn - number of columns in the sub-table
public 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 occupy
public 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 occupy
public 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#weighty
public 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#weightx
public void setMoleculeCellSize(int width,
int height)
width - width of viewer cells in pixelsheight - height of viewer cells in pixels
public 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
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||