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

com.alee.extended.checkbox.TristateCheckBoxPainter 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.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 WebTristateCheckBox component.
 * It is used as WebTristateCheckBoxUI default painter.
 *
 * @param  component type
 * @param  component UI type
 * @param  decoration type
 * @author Alexandr Zernov
 */

public class TristateCheckBoxPainter>
        extends AbstractStateButtonPainter implements ITristateCheckBoxPainter
{
    @Override
    protected 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