edu.jhu.tmaj.client.image.data
Class ResizableTableComponentListener
java.lang.Object
java.awt.event.ComponentAdapter
edu.jhu.tmaj.client.image.data.ResizableTableComponentListener
- All Implemented Interfaces:
- java.awt.event.ComponentListener, java.util.EventListener
public final class ResizableTableComponentListener
- extends java.awt.event.ComponentAdapter
Added to a window with a JTable, this ComponentListener adjusts the row height of the JTable
whenever the window is resized. In addition, the HeaderTableScrollPane height is adjusted. This
class enables the "Fit to Window" option in thumbnails display.
Method Summary |
void |
componentResized(java.awt.event.ComponentEvent e)
Updates the table and scrollpane's row size if isOn() is set to true. |
void |
setIsOn(boolean b)
Sets whether this listener will take action when the window is resized. |
Methods inherited from class java.awt.event.ComponentAdapter |
componentHidden, componentMoved, componentShown |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResizableTableComponentListener
public ResizableTableComponentListener(java.awt.Component component,
javax.swing.JTable table,
HeaderTableScrollPane scroll_pane)
- Initializes the ComponentListener.
- Parameters:
component
- the component which displays the table, namely the scrollpane.table
- the table whose row height will be resized when the Frame's size is changed.scroll_pane
- the HeaderTableScrollPane whose RowHeaderView's row size will be resized
setIsOn
public void setIsOn(boolean b)
- Sets whether this listener will take action when the window is resized.
componentResized
public void componentResized(java.awt.event.ComponentEvent e)
- Updates the table and scrollpane's row size if isOn() is set to true.
- Specified by:
componentResized
in interface java.awt.event.ComponentListener
- Overrides:
componentResized
in class java.awt.event.ComponentAdapter