|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.swing.NavigationComponentHelper
public abstract class NavigationComponentHelper
NavigationComponentHelper
is a helper class to implement on JTree, JList and JTable (or JIDE table
subclasses) so they can be used for the navigation purpose. In order to make the component suitable for the
navigation, we want the selection effect to be easily noticeable and covers the row (instead of just one cell or one
node in the case of JTable and JTree respectively). We also want to have rollover effect the mouse is over a row.
Further more, the selection should have different color when the component is focused so that when multiple
navigation components are used, we can tell which one is active. Some L&Fs already do it by default but the most L&Fs
don't do it. This class provides some common code to make the implementation easy.
Constructor Summary | |
---|---|
NavigationComponentHelper()
|
Method Summary | |
---|---|
void |
focusGained(FocusEvent e)
|
void |
focusLost(FocusEvent e)
|
Point |
getMousePosition()
|
int |
getRolloverRow()
Gets the rollover row that currently has rollover effect. |
protected abstract Rectangle |
getRowBounds(int row)
|
protected abstract int[] |
getSelectedRows()
|
protected Color |
getSelectionColor(JComponent c)
Gets the color to paint the selected rows. |
void |
mouseClicked(MouseEvent e)
|
void |
mouseEntered(MouseEvent e)
|
void |
mouseExited(MouseEvent e)
|
void |
mouseMoved(MouseEvent e)
|
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(MouseEvent e)
|
void |
paint(Graphics g,
JComponent c)
Paints the rollover row and selection rows. |
protected void |
paintRolloverRow(Graphics g,
JComponent c,
int row)
Paints the rollover row. |
protected void |
paintSelectedRow(Graphics g,
JComponent c,
int row)
Paints the selected row. |
void |
repaintSelections(JComponent c)
|
protected abstract int |
rowAtPoint(Point p)
|
void |
setRolloverRow(int rolloverRow)
Sets the rollover row. |
void |
setup(JComponent c)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NavigationComponentHelper()
Method Detail |
---|
protected abstract Rectangle getRowBounds(int row)
protected abstract int rowAtPoint(Point p)
protected abstract int[] getSelectedRows()
public void mouseMoved(MouseEvent e)
public void mouseExited(MouseEvent e)
public void mousePressed(MouseEvent e)
public void mouseReleased(MouseEvent e)
public void mouseClicked(MouseEvent e)
public void mouseEntered(MouseEvent e)
public void focusGained(FocusEvent e)
public void focusLost(FocusEvent e)
public void paint(Graphics g, JComponent c)
g
- the Graphicsc
- the componentprotected void paintSelectedRow(Graphics g, JComponent c, int row)
g
- the Graphicsc
- the componentrow
- the row indexprotected Color getSelectionColor(JComponent c)
c
- the component
protected void paintRolloverRow(Graphics g, JComponent c, int row)
g
- the Graphicsc
- the componentrow
- the row indexpublic void setup(JComponent c)
public void repaintSelections(JComponent c)
public int getRolloverRow()
public void setRolloverRow(int rolloverRow)
rolloverRow
- the row to show the rollover effect.public Point getMousePosition()
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |