com.supermap.desktop.controls.ui

类 SmCheckBoxTristate

  • java.lang.Object
    • java.awt.Component
      • java.awt.Container
        • javax.swing.JComponent
          • javax.swing.AbstractButton
            • javax.swing.JToggleButton
              • javax.swing.JCheckBox
                • com.supermap.desktop.controls.ui.SmCheckBoxTristate
  • 所有已实现的接口:
    java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.SwingConstants


    public class SmCheckBoxTristate
    extends javax.swing.JCheckBox
    Maintenance tip - There were some tricks to getting this code working:

    1. You have to overwite addMouseListener() to do nothing 2. You have to add a mouse event on mousePressed by calling super.addMouseListener() 3. You have to replace the UIActionMap for the keyboard event "pressed" with your own one. 4. You have to remove the UIActionMap for the keyboard event "released". 5. You have to grab focus when the next state is entered, otherwise clicking on the component won't get the focus. 6. You have to make a TristateDecorator as a button model that wraps the original button model and does state management. 多态复选框

    另请参阅:
    序列化表格
    • 构造器详细资料

      • SmCheckBoxTristate

        public SmCheckBoxTristate(java.lang.String text,
                                  javax.swing.Icon icon,
                                  SmCheckBoxTristate.State initial)
        参数:
        text - 显示文本
        icon - 图标
        initial - 初始状态
      • SmCheckBoxTristate

        public SmCheckBoxTristate(java.lang.String text)
      • SmCheckBoxTristate

        public SmCheckBoxTristate()
    • 方法详细资料

      • addMouseListener

        public void addMouseListener(java.awt.event.MouseListener l)
        No one may add mouse listeners, not even Swing!
        覆盖:
        addMouseListener 在类中 java.awt.Component
      • getState

        public SmCheckBoxTristate.State getState()
        Return the current state, which is determined by the selection status of the model.
      • setState

        public void setState(SmCheckBoxTristate.State state)
        Set the new state to either SELECTED, NOT_SELECTED or DONT_CARE. If state == null, it is treated as DONT_CARE.
      • updateUI

        public void updateUI()
        覆盖:
        updateUI 在类中 javax.swing.JCheckBox
      • isSelectedEx

        public java.lang.Boolean isSelectedEx()
        返回复选框选择状态
        返回:
      • setSelectedEx

        public void setSelectedEx(java.lang.Boolean selectedEx)
        设置复选框选择状态
      • setSelected

        public void setSelected(boolean selected)
        覆盖:
        setSelected 在类中 javax.swing.AbstractButton
      • addStateChangeListener

        public void addStateChangeListener(com.supermap.desktop.controls.ui.StateChangeListener listener)
        注册状态更改监听事件
        参数:
        listener -
      • removeStateChangeListener

        public void removeStateChangeListener(com.supermap.desktop.controls.ui.StateChangeListener listener)
        移除状态更改监听事件
        参数:
        listener -