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

com.alee.extended.checkbox.TristateCheckBoxPainter Maven / Gradle / Ivy

There is a newer version: 1.2.14
Show newest version
package com.alee.extended.checkbox;

import com.alee.laf.checkbox.AbstractStateButtonPainter;
import com.alee.laf.checkbox.CheckState;
import com.alee.painter.decoration.DecorationState;
import com.alee.painter.decoration.IDecoration;

import java.util.List;

/**
 * Basic painter for {@link WebTristateCheckBox} component.
 * It is used as {@link WTristateCheckBoxUI} default painter.
 *
 * @param  component type
 * @param  component UI type
 * @param  decoration type
 * @author Alexandr Zernov
 */
public class TristateCheckBoxPainter, D extends IDecoration>
        extends AbstractStateButtonPainter implements ITristateCheckBoxPainter
{
    @Override
    public List getDecorationStates ()
    {
        final List states = super.getDecorationStates ();
        if ( component.getState () == CheckState.checked )
        {
            states.add ( DecorationState.checked );
        }
        if ( component.getState () == CheckState.mixed )
        {
            states.add ( DecorationState.mixed );
        }
        return states;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy