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

com.alee.laf.radiobutton.RadioButtonPainter Maven / Gradle / Ivy

There is a newer version: 1.2.14
Show newest version
package com.alee.laf.radiobutton;

import com.alee.api.annotations.NotNull;
import com.alee.laf.checkbox.AbstractStateButtonPainter;
import com.alee.painter.decoration.DecorationState;
import com.alee.painter.decoration.IDecoration;

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy