|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlt.monarch.chart.AbstractView<E>
lt.monarch.chart.view.CompositeView<ChartPaintTags>
lt.monarch.chart.view.ViewGrid
public class ViewGrid extends CompositeView<ChartPaintTags>
Layouts several sub-views in a grid. Using order in which views are added to
the grid, they are placed one by one to toFill the first row of grid from left
to right, then the second row and so on. To control where each view
is inserted ViewGridIndexed subclass can be used.
| Modifier and Type | Field and Description |
|---|---|
protected int |
columns
|
protected int[] |
columnWeight
|
protected int |
hGap
|
protected int |
rows
|
protected int[] |
rowWeight
|
protected int |
totalColumnWeight
|
protected int |
totalRowWeight
|
protected int |
vGap
|
| Fields inherited from class lt.monarch.chart.view.CompositeView |
|---|
views |
| Fields inherited from class lt.monarch.chart.AbstractView |
|---|
layoutInvalid, paintStyle, style |
| Constructor and Description |
|---|
ViewGrid()
Constructs a container with 1 row and 1 column. |
ViewGrid(int columns,
int rows)
Constructs a container with the number of rows and columns. |
| Modifier and Type | Method and Description |
|---|---|
void |
addView(View v)
Adds a new view into this container. |
protected void |
checkBounds(int row,
int col)
|
protected void |
checkColumn(int column)
|
protected void |
checkRow(int row)
|
int |
getHgap()
Returns the horizontal gap between grid cells in pixels. |
java.awt.Dimension |
getPreferredSize(AbstractGraphics g)
Gets the preferred size of this view in the specified Graphics context. |
int |
getVgap()
Returns the vertical gap between grid cells in pixels. |
protected View |
getView(int row,
int col)
|
protected int |
getViewIndex(int row,
int col)
|
protected void |
increaseSize(int rows,
int columns)
|
protected void |
layout(AbstractGraphics g)
Prepares the view by arranging all internal views and calculates required constants. |
void |
setColumnWeight(int col,
int weight)
Sets the weight of a column. |
void |
setGridSize(int rows,
int columns)
Sets new size for this grid. |
void |
setHgap(int hGap)
Sets the horizontal gap between grid cells in pixels. |
void |
setRowWeight(int row,
int weight)
Sets the weight of a row. |
void |
setVgap(int vGap)
Sets the vertical gap between grid cells in pixels. |
void |
viewInvalidated(View view)
Notifies, that view layout changed |
| Methods inherited from class lt.monarch.chart.view.CompositeView |
|---|
dispose, getContainingObjects, getGraphicsType, getViewCount, getViews, paint, removeView, setContainer, setView, validate, viewActivated, viewDeactivated |
| Methods inherited from class lt.monarch.chart.AbstractView |
|---|
activate, addViewListener, clone, container, deactivate, finalize, getAlignmentX, getAlignmentY, getBounds, getChartObjectBounds, getContainer, getHeight, getMaximumSize, getMinimumSize, getPaintMode, getPaintStyle, getParent, getSize, getSize, getStyle, getStyle, getWidth, getX, getY, invalidate, isLayoutValid, removeViewListener, render, repaint, repaint, setAlignmentX, setAlignmentY, setBounds, setBounds, setLocation, setMaximumSize, setMinimumSize, setPaintMode, setPreferredSize, setSize |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int[] columnWeight
protected int[] rowWeight
protected int totalColumnWeight
protected int totalRowWeight
protected int columns
protected int rows
protected int vGap
protected int hGap
| Constructor Detail |
|---|
public ViewGrid()
public ViewGrid(int columns,
int rows)
columns - number of columns in a gridrows - number of rows in a grid| Method Detail |
|---|
public void setGridSize(int rows,
int columns)
throws java.lang.IllegalArgumentException
rows - new rows count of gridcolumns - new columns count of gridjava.lang.IllegalArgumentException
protected void increaseSize(int rows,
int columns)
protected int getViewIndex(int row,
int col)
protected View getView(int row,
int col)
protected void checkRow(int row)
protected void checkColumn(int column)
protected void checkBounds(int row,
int col)
public void setRowWeight(int row,
int weight)
row - row indexweight - row weight
public void setColumnWeight(int col,
int weight)
col - column indexweight - column weightpublic void addView(View v)
CompositeView
addView in class CompositeView<ChartPaintTags>v - view to be addedpublic void setVgap(int vGap)
vGap - vertical gap in pixelspublic void setHgap(int hGap)
hGap - horizontal gap in pixelspublic int getVgap()
public int getHgap()
public void viewInvalidated(View view)
ViewListener
viewInvalidated in interface ViewListenerviewInvalidated in class CompositeView<ChartPaintTags>view - viewpublic java.awt.Dimension getPreferredSize(AbstractGraphics g)
AbstractView
getPreferredSize in interface ViewgetPreferredSize in class AbstractView<ChartPaintTags>g - the Graphics context in which view will be paintedprotected void layout(AbstractGraphics g)
AbstractView
layout in class AbstractView<ChartPaintTags>g - graphics context
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||