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

com.alee.laf.checkbox.CheckBoxPainter Maven / Gradle / Ivy

package com.alee.laf.checkbox;

import com.alee.painter.decoration.DecorationState;
import com.alee.painter.decoration.IDecoration;

import javax.swing.*;
import java.util.List;

/**
 * Basic painter for {@link JCheckBox} component.
 * It is used as {@link WCheckBoxUI} default painter.
 *
 * @param  component type
 * @param  component UI type
 * @param  decoration type
 * @author Alexandr Zernov
 */
public class CheckBoxPainter, D extends IDecoration>
        extends AbstractStateButtonPainter implements ICheckBoxPainter
{
    @Override
    public List getDecorationStates ()
    {
        final List states = super.getDecorationStates ();
        if ( component.isSelected () )
        {
            states.add ( DecorationState.checked );
        }
        return states;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy