package jas2.swingstudio;
import java.awt.*;
/**
* A panel that can be attached to a CutDialog. Return an instance of
* this class from getPlotPanel in HasPlot and from
* getSliderPanel in HasSlider. This panel will be
* exactly the right width to be added to either the top or bottom
* of a CutDialog.
* @see CutDialog
* @see HasPlot
* @see HasSlider
*/
public class CutDialogPanel extends javax.swing.JPanel
{
public CutDialogPanel(java.awt.LayoutManager l)
{
super(l);
}
/** Returns a dimension with a width equal to the CutDialog's width. */
final public Dimension getMaximumSize()
{
final Dimension d = super.getMaximumSize();
d.width = m_width;
return d;
}
/** Returns a dimension with a width equal to the CutDialog's width. */
final public Dimension getMinimumSize()
{
final Dimension d = super.getMinimumSize();
d.width = m_width;
return d;
}
/** Returns a dimension with a width equal to the CutDialog's width. */
final public Dimension getPreferredSize()
{
final Dimension d = super.getPreferredSize();
d.width = m_width;
return d;
}
/**
* Override to have setup take place before showing. Returns true
* by default.
* @return whether to continue with showing this panel (return false
* if an error occurred in the setup of the panel)
*/
public boolean beforeShowing()
{
return true;
}
/** Override to do any necessary cleanup. The default definition does nothing. */
public void afterClosing()
{
}
int m_width;
}
Ads help maintain this website.