|
Copyright © 2005 Scientific Applications. All Rights Reserved. | ||||||||
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.CellRendererPane
com.sciapp.table.WrapperCellRendererPane
com.sciapp.filter.DefaultFilterRenderer
public class DefaultFilterRenderer
DefaultFilterRenderer is the default FilterRenderer implementation that uses an arrow button to present users with filter options for a column.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.CellRendererPane |
---|
CellRendererPane.AccessibleCellRendererPane |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected ArrowButton |
arrow
The button that is showing on the header. |
protected Color |
filteredColor
the color of the arrow for a column that has filters |
protected Component |
normalComponent
the component returned from the unfiltered renderer |
protected Color |
unfilteredColor
the color of the arrow for a column that has no filters |
protected boolean |
useRollOver
flag that determines whether the arrow button will be visible only if the user rolls over the column with the mouse |
Fields inherited from class com.sciapp.table.WrapperCellRendererPane |
---|
opaqueFalse |
Fields inherited from class javax.swing.CellRendererPane |
---|
accessibleContext |
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 | |
---|---|
DefaultFilterRenderer()
Constructs a DefaultFilterRenderer. |
Method Summary | |
---|---|
boolean |
checkForFilter(MouseEvent e,
PopupFilterHeaderModel model)
Determines whether the mouse event triggered the start of a filter action on the column. |
ArrowButton |
getArrowButton()
Returns the arrow button that is showing when a filter is installed on the column. |
Component |
getFilterableComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column,
int rollOverColumn,
PopupFilterHeaderModel model,
TableCellRenderer innerRenderer)
Returns the component used for drawing the filterable header column. |
Color |
getFilteredColor()
Determines the color of the arrow button for columns that have filters. |
Component |
getMainComponent()
Returns the main wrapped component. |
Dimension |
getPreferredSize()
Returns the preferred size of this container. |
String |
getToolTipText(MouseEvent event)
Returns the string to be used as the tooltip for event. |
Color |
getUnfilteredColor()
Determines the color of the arrow button for columns that do not have filters. |
boolean |
getUseRollOver()
Determines whether the arrow button will be visible only if the user rolls over the column with the mouse. |
void |
setBounds(int x,
int y,
int w,
int h)
Moves and resizes this component. |
void |
setFilteredColor(Color filteredColor)
Assigns the color of the arrow button for columns that have filters. |
void |
setUnfilteredColor(Color unfilteredColor)
Assigns the color of the arrow button for columns that do not have filters. |
void |
setUseRollOver(boolean useRollOver)
Determines whether the arrow button will be visible only if the user rolls over the column with the mouse. |
Methods inherited from class com.sciapp.table.WrapperCellRendererPane |
---|
getMainComponent, paint, paintComponent |
Methods inherited from class javax.swing.CellRendererPane |
---|
addImpl, getAccessibleContext, invalidate, paintComponent, paintComponent, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Component normalComponent
protected transient ArrowButton arrow
protected Color unfilteredColor
protected Color filteredColor
protected boolean useRollOver
Constructor Detail |
---|
public DefaultFilterRenderer()
Method Detail |
---|
public boolean checkForFilter(MouseEvent e, PopupFilterHeaderModel model)
checkForFilter
in interface FilterRenderer
e
- the mouse event generated on the table's headermodel
- the filter header model containing information about installed filters
public ArrowButton getArrowButton()
public Component getFilterableComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column, int rollOverColumn, PopupFilterHeaderModel model, TableCellRenderer innerRenderer)
getFilterableComponent
in interface FilterRenderer
table
- the table that is asking the renderer to drawvalue
- the value of the column to be renderedisSelected
- true if the column is to be rendered with the selection highlighted, false otherwisehasFocus
- if true, render appropriately.row
- the row index of the column being drawn. usually -1column
- the column index of the column being drawnrollOverColumn
- the column that the mouse is rolled over at the time of drawing or -1 if there is no rollover columnmodel
- the filter header model that contains information about installed filtersinnerRenderer
- the renderer of the 'unfiltered' component
public Color getFilteredColor()
public Component getMainComponent()
getMainComponent
in class WrapperCellRendererPane
public Dimension getPreferredSize()
getPreferredSize
in class Container
Dimension
that represents
the preferred size of this container.Container.getMinimumSize()
,
Container.getLayout()
,
LayoutManager.preferredLayoutSize(Container)
,
Component.getPreferredSize()
public String getToolTipText(MouseEvent event)
getToolTipText
in class WrapperCellRendererPane
event
- the mouse event producing the tooltip
public Color getUnfilteredColor()
public boolean getUseRollOver()
public void setBounds(int x, int y, int w, int h)
x
and y
, and the
new size is specified by width
and height
.
setBounds
in class Component
x
- the new x-coordinate of this componenty
- the new y-coordinate of this componentw
- the new width
of this componenth
- the new height
of this
componentComponent.getBounds()
,
Component.setLocation(int, int)
,
Component.setLocation(Point)
,
Component.setSize(int, int)
,
Component.setSize(Dimension)
public void setFilteredColor(Color filteredColor)
filteredColor
- the arrow button's color for filtered columnspublic void setUnfilteredColor(Color unfilteredColor)
unfilteredColor
- the arrow button's color for non-filtered columnspublic void setUseRollOver(boolean useRollOver)
useRollOver
- true if the arrow button is only visible when rolling over, false otherwise
|
Copyright © 2005 Scientific Applications. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |