// ------------------ UIDefaultsResizer.java ----------------------------
/************************************************************************
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
************************************************************************/
import java.awt.event.MouseEvent;
import javax.swing.JTable;
/**
* UIDefaultsResizer class handles setting the
* javax.swing.JTable row heights back to default
* size after a table cell has been resized in Camicker's
* ShowUIDefaults.
*
* @author Brent Allen Parrish
* @see woven-media.com
*/
public class UIDefaultsResizer extends RowHeightResizer
{
// This instance's table reference
private JTable table;
/**
* Class constructor passes the javax.swing.JTable to this
* instance's super class constructor.
*
* @param table javax.swing.JTable reference for this instance.
*/
public UIDefaultsResizer(JTable table)
{
super(table);
this.table = table;
}
/**
* Detects mouse released event and sets the row back to its original height
* after a row has been resized.
*
* @param e java.awt.event.MouseEvent reference for this event.
*/
public void mouseReleased(MouseEvent e)
{
super.mouseReleased(e);
try
{
table.setRowHeight(16);
}
catch(IllegalArgumentException iae)
{
System.err.print(iae.getMessage());
}
}
} // End class