All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alee.laf.desktoppane.InternalFramePainter Maven / Gradle / Ivy

Go to download

WebLaf is a Java Swing Look and Feel and extended components library for cross-platform applications

There is a newer version: 2.2.1
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy