⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 booleanproperty.java

📁 JAVA 数学程序库 提供常规的数值计算程序包
💻 JAVA
字号:
package jmathlib.core.graphics.properties;

import jmathlib.core.graphics.*;


public class BooleanProperty extends RadioProperty
{
	public BooleanProperty(PropertySet parent, String name, boolean value)
	{
		super(parent, name, new String[] {"on", "off"}, (value ? "on" : "off"));
	}

	public boolean getBoolean()
	{
		return getValue().equals("on");
	}

	public boolean isSet()
	{
		return getBoolean();
	}


    public void set(boolean value) 
    {
        try
        {
            set(new Boolean(value));
        }
        catch (Exception e)
        { 
            jmathlib.core.interpreter.Errors.throwMathLibException("BooleanProperty exception");
        }
        
    }
    
    public void set(Object value) throws PropertyException
	{
		if (value instanceof Boolean)
			super.set(((Boolean)value).booleanValue() ? "on" : "off");
		else if (value instanceof Number)
			super.set(((Number)value).intValue() != 0 ? "on" : "off");
		else
			super.set(value);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -