com.alee.laf.desktoppane.InternalFramePainter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of weblaf-ui Show documentation
Show all versions of weblaf-ui Show documentation
WebLaf is a Java Swing Look and Feel and extended components library for cross-platform applications
package com.alee.laf.desktoppane;
import com.alee.painter.decoration.AbstractContainerPainter;
import com.alee.painter.decoration.DecorationState;
import com.alee.painter.decoration.IDecoration;
import com.alee.utils.CompareUtils;
import javax.swing.*;
import java.util.List;
import static javax.swing.JInternalFrame.*;
/**
* Basic painter for JInternalFrame component.
* It is used as WebInternalFrameUI default painter.
*
* @param component type
* @param component UI type
* @param decoration type
* @author Alexandr Zernov
* @author Mikle Garin
*/
public class InternalFramePainter>
extends AbstractContainerPainter implements IInternalFramePainter
{
@Override
protected void propertyChange ( final String property, final Object oldValue, final Object newValue )
{
// Perform basic actions on property changes
super.propertyChange ( property, oldValue, newValue );
// Decoration update on internal frame state changes
if ( CompareUtils.equals ( property, IS_SELECTED_PROPERTY, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY ) )
{
updateDecorationState ();
}
}
@Override
protected List getDecorationStates ()
{
final List states = super.getDecorationStates ();
if ( component.isMaximum () )
{
states.add ( DecorationState.maximized );
}
return states;
}
}