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

org.pepsoft.worldpainter.util.TristateButtonModel Maven / Gradle / Ivy

There is a newer version: 2.23.2
Show newest version
package org.pepsoft.worldpainter.util;

public class TristateButtonModel extends com.jidesoft.swing.TristateButtonModel {
    public void setTristateMode(boolean tristateMode) {
        this.tristateMode = tristateMode;
        if ((! tristateMode) && isMixed()) {
            setState(TristateCheckBox.STATE_UNSELECTED);
        }
    }
    
    public boolean isTristateMode() {
        return tristateMode;
    }
    
    @Override
    protected int getNextState(int current) {
        if ((! tristateMode) && isSelected()) {
            return TristateCheckBox.STATE_UNSELECTED;
        } else {
            return super.getNextState(current);
        }
    }
    
    private boolean tristateMode = true;

    private static final long serialVersionUID = 1L;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy