|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTable
org.openpermis.editor.policy.gui.DynamicTable
public class DynamicTable
Extension of the JTable
that dynamically resizes its preferred scrollable viewport size.
The table features a visible row count for preferred size and optionally uses additional space if used with a layout manager that stretches components to available space.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JTable |
---|
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintMode |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
DynamicTable()
Creates a new, uninitialized dynamic table. |
|
DynamicTable(int rows,
boolean dynamic)
Creates a new, uninitialized dynamic table with the specified visible row count. |
|
DynamicTable(TableModel tableModel)
Creates a dynamic table for the specified table model. |
|
DynamicTable(TableModel tableModel,
int rows,
boolean dynamic)
Creates a dynamic table for the specified table model. |
Method Summary | |
---|---|
void |
doLayout()
|
Dimension |
getPreferredScrollableViewportSize()
Adds sizing of the table. |
void |
setColumnWeights(double... columnWeights)
Sets the weights for the columns when layouting. |
void |
setVisibleRowCount(int rows,
boolean dynamic)
Sets the number of visible rows. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DynamicTable()
public DynamicTable(int rows, boolean dynamic)
rows
- the number of visible rows, 0 to disable preferred scrollable viewport height.dynamic
- indicates if the enclosing scroll pane resizes if there are fewer
than the given number of rows.setVisibleRowCount(int, boolean)
public DynamicTable(TableModel tableModel)
tableModel
- the model to create the table for.public DynamicTable(TableModel tableModel, int rows, boolean dynamic)
tableModel
- the model to create the table for.rows
- the number of visible rows, 0 to disable preferred scrollable viewport height.dynamic
- indicates if the enclosing scroll pane resizes if there are fewer
than the given number of rows.setVisibleRowCount(int, boolean)
Method Detail |
---|
public void setVisibleRowCount(int rows, boolean dynamic)
rows
- the number of visible rows, 0 to disable preferred scrollable viewport height.dynamic
- indicates if the enclosing scroll pane resizes if there are fewer
than the given number of rows.public void setColumnWeights(double... columnWeights)
The total column weights should yield a value of one, e.g. the array new double[] { 0.25, 0.5, 0.25 } will assign 25% of the table width to the first and the third column and 50% to the middle column.
Weighted column layouting is disabled if this value is null
.
columnWeights
- the column weights to set, null
to revert to standard table
column layouting.public Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface Scrollable
getPreferredScrollableViewportSize
in class JTable
public void doLayout()
doLayout
in class JTable
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:17:21
Copyright (c) 2002-2007 Ergon Informatik AG