|
||||||||||
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
jdbreport.grid.RowHeader
public class RowHeader
Nested Class Summary | |
---|---|
protected class |
RowHeader.AccessibleRowHeader
This class implements accessibility support for the RowHeader class. |
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 | |
---|---|
protected int |
draggedDistance
The distance from its original position the row has been dragged. |
protected TableRow |
draggedRow
The index of the row being dragged. |
static int |
LEVEL_WIDTH
|
protected TableRow |
resizingRow
The index of the row being resized. |
protected TableRowModel |
rowModel
|
protected JReportGrid |
table
|
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 | |
---|---|
RowHeader(JReportGrid table)
Constructs a RowHeader which is initialized with
cm as the row model. |
Method Summary | |
---|---|
protected TableCellRenderer |
createDefaultRenderer()
Returns a default renderer to be used when no header renderer is defined by a TableRow . |
AccessibleContext |
getAccessibleContext()
Gets the AccessibleContext associated with this RowHeader. |
TableCellRenderer |
getDefaultRenderer()
Returns the default renderer used when no headerRenderer
is defined by a TableRow . |
int |
getDraggedDistance()
Returns the row's vertical distance from its original position, if and only if, a drag is in process. |
TableRow |
getDraggedRow()
Returns the the dragged row, if and only if, a drag is in process, otherwise returns null . |
Rectangle |
getHeaderRect(int row)
Returns the rectangle containing the header tile at row . |
ImageIcon |
getHideGroupImage()
|
boolean |
getReorderingAllowed()
Returns true if the user is allowed to rearrange rows by dragging their headers, false otherwise. |
boolean |
getResizingAllowed()
Returns true if the user is allowed to resize rows by dragging between their headers, false otherwise. |
TableRow |
getResizingRow()
Returns the resizing row. |
TableRowModel |
getRowModel()
Returns the TableRowModel that contains all row
information of this table RowHeader. |
ImageIcon |
getShowGroupImage()
|
JTable |
getTable()
Returns the table associated with this header. |
String |
getToolTipText(MouseEvent event)
Allows the renderer's tips to be used if there is text set. |
TableRowHeaderUI |
getUI()
Returns the look and feel (L&F) object that renders this component. |
String |
getUIClassID()
Returns the suffix used to construct the name of the look and feel (L&F) class used to render this component. |
int |
getWidth()
|
protected void |
initializeLocalVars()
Initializes the local variables and properties with default values. |
protected String |
paramString()
Returns a string representation of this RowHeader . |
void |
resizeAndRepaint()
Sizes the header and marks it as needing display. |
void |
rowAdded(TableRowModelEvent e)
Invoked when a row is added to the table row model. |
int |
rowAtPoint(Point point)
Returns the index of the row that point lies in, or -1 if
it lies out of bounds. |
void |
rowMarginChanged(ChangeEvent e)
Invoked when a row is moved due to a margin change. |
void |
rowMoved(TableRowModelEvent e)
Invoked when a row is repositioned. |
void |
rowRemoved(TableRowModelEvent e)
Invoked when a row is removed from the table row model. |
void |
rowResized(TableRowModelEvent e)
Invoked when a row is resized. |
void |
rowSelectionChanged(ListSelectionEvent e)
Tells listeners that the selection model of the TableRowModel changed. |
void |
rowUpdated(TableRowModelEvent e)
Tells listeners that a rows was change. |
void |
setDefaultRenderer(TableCellRenderer defaultRenderer)
Sets the default renderer to be used when no headerRenderer
is defined by a TableRow . |
void |
setDraggedDistance(int distance)
Sets the header's draggedDistance to distance . |
void |
setDraggedRow(TableRow aRow)
Sets the header's draggedRow to aRow . |
void |
setReorderingAllowed(boolean reorderingAllowed)
Sets whether the user can drag row headers to reorder rows. |
void |
setResizingAllowed(boolean resizingAllowed)
Sets whether the user can resize rows by dragging between headers. |
void |
setResizingRow(TableRow aRow)
Sets the header's resizingRow to aRow . |
void |
setRowModel(TableRowModel rowModel)
Sets the row model for this table to newModel and
registers for listener notifications from the new row model. |
void |
setTable(JReportGrid table)
Sets the table associated with this header. |
void |
setUI(TableRowHeaderUI ui)
Sets the look and feel (L&F) object that renders this component. |
void |
setVisible(boolean flag)
|
void |
updateUI()
Notification from the UIManager that the look and feel
(L&F) has changed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int LEVEL_WIDTH
protected JReportGrid table
protected TableRowModel rowModel
protected transient TableRow resizingRow
null
if not resizing.
protected transient TableRow draggedRow
null
if not dragging.
protected transient int draggedDistance
Constructor Detail |
---|
public RowHeader(JReportGrid table)
RowHeader
which is initialized with
cm
as the row model. If cm
is
null
this method will initialize the table header with a
default RowModel
.
Method Detail |
---|
public ImageIcon getShowGroupImage()
public ImageIcon getHideGroupImage()
public void setTable(JReportGrid table)
table
- the new tablepublic JTable getTable()
table
propertypublic void setReorderingAllowed(boolean reorderingAllowed)
reorderingAllowed
- true if the table view should allow reordering; otherwise
falsepublic boolean getReorderingAllowed()
reorderingAllowed
propertysetReorderingAllowed(boolean)
public void setResizingAllowed(boolean resizingAllowed)
resizingAllowed
- true if table view should allow resizingpublic boolean getResizingAllowed()
resizingAllowed
propertysetResizingAllowed(boolean)
public TableRow getDraggedRow()
null
.
null
getDraggedDistance()
public int getDraggedDistance()
getDraggedRow()
public TableRow getResizingRow()
null
.
null
public void setDefaultRenderer(TableCellRenderer defaultRenderer)
headerRenderer
is defined by a TableRow
.
defaultRenderer
- the default rendererpublic TableCellRenderer getDefaultRenderer()
headerRenderer
is defined by a TableRow
.
public int rowAtPoint(Point point)
point
lies in, or -1 if
it lies out of bounds.
point
lies in, or -1 if
it lies out of boundspublic int getWidth()
getWidth
in class JComponent
public Rectangle getHeaderRect(int row)
row
.
When the row
parameter is out of bounds this method uses
the same conventions as the JTable
method
getCellRect
.
row
public String getToolTipText(MouseEvent event)
getToolTipText
in class JComponent
event
- the location of the event identifies the proper renderer and,
therefore, the proper tip
public void setVisible(boolean flag)
setVisible
in class JComponent
public TableRowHeaderUI getUI()
TableRowHeaderUI
object that renders this
componentpublic void setUI(TableRowHeaderUI ui)
ui
- the TableHeaderUI
L&F objectUIDefaults.getUI(javax.swing.JComponent)
public void updateUI()
UIManager
that the look and feel
(L&F) has changed. Replaces the current UI object with the latest version
from the UIManager
.
updateUI
in class JComponent
JComponent.updateUI()
public String getUIClassID()
getUIClassID
in class JComponent
public void setRowModel(TableRowModel rowModel)
newModel
and
registers for listener notifications from the new row model.
rowModel
- the new data source for this table
IllegalArgumentException
- if newModel
is null
getRowModel()
public TableRowModel getRowModel()
TableRowModel
that contains all row
information of this table RowHeader.
rowModel
propertypublic void rowAdded(TableRowModelEvent e)
Application code will not use these methods explicitly, they are used
internally by JReportGrid
.
rowAdded
in interface TableRowModelListener
e
- the event receivedTableRowModelListener
public void rowUpdated(TableRowModelEvent e)
TableRowModelListener
rowUpdated
in interface TableRowModelListener
public void rowRemoved(TableRowModelEvent e)
Application code will not use these methods explicitly, they are used
internally by JReportGrid
.
rowRemoved
in interface TableRowModelListener
e
- the event receivedTableRowModelListener
public void rowMoved(TableRowModelEvent e)
Application code will not use these methods explicitly, they are used
internally by JReportGrid
.
rowMoved
in interface TableRowModelListener
e
- the event receivedTableRowModelListener
public void rowResized(TableRowModelEvent e)
Application code will not use these methods explicitly, they are used
internally by JReportGrid
.
rowResized
in interface TableRowModelListener
e
- the event receivedTableRowModelListener
public void rowMarginChanged(ChangeEvent e)
Application code will not use these methods explicitly, they are used
internally by JReportGrid
.
rowMarginChanged
in interface TableRowModelListener
e
- the event receivedTableRowModelListener
public void rowSelectionChanged(ListSelectionEvent e)
TableRowModelListener
rowSelectionChanged
in interface TableRowModelListener
protected TableCellRenderer createDefaultRenderer()
TableRow
.
protected void initializeLocalVars()
public void resizeAndRepaint()
revalidate
followed by repaint
.
public void setDraggedRow(TableRow aRow)
draggedRow
to aRow
.
Application code will not use this method explicitly, it is used internally by the row dragging mechanism.
aRow
- the row being dragged, or null
if no row is
being draggedpublic void setDraggedDistance(int distance)
draggedDistance
to distance
.
distance
- the distance draggedpublic void setResizingRow(TableRow aRow)
resizingRow
to aRow
.
Application code will not use this method explicitly, it is used internally by the row sizing mechanism.
aRow
- the row being resized, or null
if no row is
being resizedprotected String paramString()
RowHeader
. This
method is intended to be used only for debugging purposes, and the
content and format of the returned string may vary between
implementations. The returned string may be empty but may not be
null
.
Overriding paramString
to provide information about the
specific new aspects of the JFC components.
paramString
in class JComponent
RowHeader
public AccessibleContext getAccessibleContext()
getAccessibleContext
in interface Accessible
getAccessibleContext
in class JComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |