在javafx中的三状态复选框中更改循环顺序

在javafx中的三状态复选框中更改循环顺序,javafx,checkbox,Javafx,Checkbox,有没有办法更改javafx中三态复选框的点击顺序? 默认设置为选中->取消选中->不确定。 是否可以改为按以下顺序?选中->不确定->取消选中 关于为什么的一些背景 使用复选框的应用程序默认将复选框设置为false,这与需要检查但尚未检查的流程相对应。 未定义状态对应于经过物理检查并被确定为坏的进程。 检查状态对应于经过物理检查并通过QC的流程。 真实的情况比未定义的情况更经常发生 由于默认值为false,因此未定义循环到的下一次单击。(坏)然后为真(检查)。这些单击是针对多个流程进行的,更改顺

有没有办法更改javafx中三态复选框的点击顺序? 默认设置为选中->取消选中->不确定。
是否可以改为按以下顺序?选中->不确定->取消选中

关于为什么的一些背景


使用复选框的应用程序默认将复选框设置为false,这与需要检查但尚未检查的流程相对应。
未定义状态对应于经过物理检查并被确定为坏的进程。
检查状态对应于经过物理检查并通过QC的流程。
真实的情况比未定义的情况更经常发生


由于默认值为false,因此未定义循环到的下一次单击。(坏)然后为真(检查)。这些单击是针对多个流程进行的,更改顺序将大大减少用户必须进行的单击次数。

感谢您帮助我提出建议。我现在找到了这个问题的答案。
CheckBox类中的顺序循环基于以下逻辑

我创建了CheckBox类的扩展,并重写了fire()方法
下面是复选框的版本,该复选框现在根据需要循环

import javafx.event.ActionEvent;
import javafx.scene.control.CheckBox;

/**
 *
 * @author returncode13
 */
public class RcheckBox extends CheckBox{


    /**
     * Toggles the state of the {@code CheckBox}. If allowIndeterminate is
     * true, then each invocation of this function will advance the CheckBox
     * through the states checked, undefined, and unchecked. If
     * allowIndeterminate is false, then the CheckBox will only cycle through
     * the checked and unchecked states, and forcing indeterminate to equal to
     * false.
     */

    @Override
    public void fire() {
        super.fire(); 
        if(!isDisabled()){

            if(isAllowIndeterminate()){
                 if(!isSelected() && !isIndeterminate()){
                    setIndeterminate(true);
                }else if(isIndeterminate()){
                    setSelected(true);
                    setIndeterminate(false);
                }else if(isSelected() && !isIndeterminate()){
                    setSelected(false);
                    setIndeterminate(false);
                }
            }else{
                setSelected(!isSelected());
                setIndeterminate(false);
            }
            fireEvent(new ActionEvent());


        }
    }

}

隐马尔可夫模型。。。你会让你的用户感到困惑,那么你为什么要这样做呢?正如克利奥帕特拉所说,这会让用户感到困惑,在大多数情况下,这是一个糟糕的设计选择。但是,您可能需要为
复选框设置一个单击侦听器,并自己设置状态。使用该复选框的应用程序将该复选框默认为false,这对应于需要选中但尚未选中的进程。未定义状态是一个经过物理检查并被确定为坏的进程。已检查状态是一个经过物理检查并已通过QC的过程。真实情况比未定义情况更经常发生。由于默认值为false,因此未定义循环到的下一次单击。(坏)然后为真(检查)。这些点击是为几个进程和改变顺序将大大减少点击次数必须由用户。谢谢解释(你可以考虑编辑到你的问题:)嗯…也许自定义控件是更好的选择?有些东西不允许这么多的循环,但一个单一的过渡,从没有物理检查,要么物理检查和好,或物理检查和坏?嗯。。。想知道为什么不修改逻辑以适应复选框的模型:checkbox.undeterminate(或未定义)=物理上未选中,checkbox.selected==物理上已选中且良好,checkbox.unselected==物理上已选中且不好,然后以undeterminate开始,切换周期如您所需
import javafx.event.ActionEvent;
import javafx.scene.control.CheckBox;

/**
 *
 * @author returncode13
 */
public class RcheckBox extends CheckBox{


    /**
     * Toggles the state of the {@code CheckBox}. If allowIndeterminate is
     * true, then each invocation of this function will advance the CheckBox
     * through the states checked, undefined, and unchecked. If
     * allowIndeterminate is false, then the CheckBox will only cycle through
     * the checked and unchecked states, and forcing indeterminate to equal to
     * false.
     */

    @Override
    public void fire() {
        super.fire(); 
        if(!isDisabled()){

            if(isAllowIndeterminate()){
                 if(!isSelected() && !isIndeterminate()){
                    setIndeterminate(true);
                }else if(isIndeterminate()){
                    setSelected(true);
                    setIndeterminate(false);
                }else if(isSelected() && !isIndeterminate()){
                    setSelected(false);
                    setIndeterminate(false);
                }
            }else{
                setSelected(!isSelected());
                setIndeterminate(false);
            }
            fireEvent(new ActionEvent());


        }
    }

}