当前位置: 首页>>代码示例>>Java>>正文


Java ConfigBase.PropInfo方法代码示例

本文整理汇总了Java中me.ichun.mods.ichunutil.common.core.config.ConfigBase.PropInfo方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigBase.PropInfo方法的具体用法?Java ConfigBase.PropInfo怎么用?Java ConfigBase.PropInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在me.ichun.mods.ichunutil.common.core.config.ConfigBase的用法示例。


在下文中一共展示了ConfigBase.PropInfo方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: WindowSetStringArray

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入方法依赖的package包/类
public WindowSetStringArray(GuiConfigs parent, int w, int h, int minW, int minH, ConfigBase conf, ConfigBase.PropInfo info)
{
    super(parent, 0, 0, w, h, minW, minH, "ichunutil.config.gui.setStringArray", true);
    this.parent = parent;
    this.config = conf;
    this.prop = info;

    elements.add(new ElementButton(this, width / 2 - 30, height - 25, 60, 16, 3, false, 2, 1, "gui.done"));

    try
    {
        String[] vals = (String[])info.field.get(config);
        for(int i = 0; i < vals.length; i++)
        {
            elements.add(new ElementTextInput(this, 10, i * 18 + 20, width - 20, 12, i, prop.comment, vals[i]));
        }
    }
    catch(Exception ignored)
    {
    }
    ;
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:23,代码来源:WindowSetStringArray.java

示例2: WindowSetIntArray

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入方法依赖的package包/类
public WindowSetIntArray(GuiConfigs parent, int w, int h, int minW, int minH, ConfigBase conf, ConfigBase.PropInfo info)
{
    super(parent, 0, 0, w, h, minW, minH, "ichunutil.config.gui.setIntArray", true);
    this.parent = parent;
    this.config = conf;
    this.prop = info;

    elements.add(new ElementButton(this, width / 2 - 30, height - 25, 60, 16, 3, false, 2, 1, "gui.done"));

    try
    {
        int[] vals = (int[])info.field.get(config);
        for(int i = 0; i < vals.length; i++)
        {
            elements.add(new ElementTextInputNumber(this, 10, i * 18 + 20, width - 20, 12, i, prop.comment, Integer.toString(vals[i]), false));
        }
    }
    catch(Exception ignored)
    {
    }
    ;
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:23,代码来源:WindowSetIntArray.java

示例3: WindowSetKeyBind

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入方法依赖的package包/类
public WindowSetKeyBind(GuiConfigs parent, int w, int h, int minW, int minH, String msg, ConfigBase conf, ConfigBase.PropInfo info)
{
    super(parent, 0, 0, w, h, minW, minH, "ichunutil.config.gui.setKeyBind", true);
    this.parent = parent;
    this.config = conf;
    this.prop = info;
    message = msg;
    hook = new ElementKeyBindHook(this, 0, 0, 0, 0, 0, true);
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:10,代码来源:WindowSetKeyBind.java

示例4: draw

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入方法依赖的package包/类
public void draw(int mouseX, int mouseY) //4 pixel border?
{
    if(parent.windowCats.configs.selectedIdentifier.isEmpty())
    {
        return;
    }
    else
    {
        for(me.ichun.mods.ichunutil.client.gui.window.element.ElementListTree.Tree tree : parent.windowCats.configs.trees)
        {
            if(tree.selected)
            {
                ConfigBase.CategoryInfo cat = (ConfigBase.CategoryInfo)tree.attachedObject;
                if(!cat.equals(selectedCat) && parent.windowCats.selectedConfig != null)
                {
                    props.saveTimeout = 0;
                    props.save();

                    selectedCat = cat;
                    titleLocale = cat.name;

                    props.trees.clear();
                    props.sliderProg = 0.0D;
                    for(ConfigBase.PropInfo prop : parent.windowCats.selectedConfig.categories.get(selectedCat))
                    {
                        props.createTree(parent.windowCats.selectedConfig, prop, 17);
                    }
                }
            }
        }
    }
    super.draw(mouseX, mouseY);
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:34,代码来源:WindowSetter.java

示例5: WindowSetNestedIntArray

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入方法依赖的package包/类
public WindowSetNestedIntArray(GuiConfigs parent, int w, int h, int minW, int minH, ConfigBase conf, ConfigBase.PropInfo info)
{
    super(parent, 0, 0, w, h, minW, minH, "ichunutil.config.gui.setIntArray", true);
    this.parent = parent;
    this.config = conf;
    this.prop = info;

    elements.add(new ElementButton(this, width / 2 - 30, height - 25, 60, 16, 3, false, 2, 1, "gui.done"));

    try
    {
        NestedIntArray vals = (NestedIntArray)info.field.get(config);
        int i = 0;
        for(Map.Entry<Integer, ArrayList<Integer>> e : vals.values.entrySet())
        {
            elements.add(new ElementTextInputNumber(this, 10, i * 18 + 20, 40, 12, i * 100, prop.comment, Integer.toString(e.getKey()), false));
            ArrayList<Integer> nest = e.getValue();
            for(int j = 0; j < nest.size(); j++)
            {
                elements.add(new ElementTextInputNumber(this, 52 + (j * 39), i * 18 + 20, 40, 12, i * 100 + (j + 1), prop.comment, Integer.toString(nest.get(j)), false));
            }
            i++;
        }
    }
    catch(Exception ignored)
    {
    }
    ;
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:30,代码来源:WindowSetNestedIntArray.java

示例6: draw

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入方法依赖的package包/类
public void draw(int mouseX, int mouseY) //4 pixel border?
{
    if(parent.windowConfigs.configs.selectedIdentifier.isEmpty())
    {
        return;
    }
    else
    {
        for(me.ichun.mods.ichunutil.client.gui.window.element.ElementListTree.Tree tree : parent.windowConfigs.configs.trees)
        {
            if(tree.selected)
            {
                ConfigBase conf = (ConfigBase)tree.attachedObject;
                if(conf != selectedConfig)
                {
                    //NEW SELECTED CONFIG;
                    selectedConfig = conf;
                    titleLocale = selectedConfig.getModName();
                    configs.selectedIdentifier = "";
                    configs.trees.clear();

                    for(Map.Entry<ConfigBase.CategoryInfo, ArrayList<ConfigBase.PropInfo>> e : selectedConfig.categories.entrySet())
                    {
                        configs.createTree(null, e.getKey(), 13, 0, false, false);
                    }
                }
            }
        }
    }
    super.draw(mouseX, mouseY);
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:32,代码来源:WindowCats.java

示例7: createTree

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入方法依赖的package包/类
public void createTree(ConfigBase conf, ConfigBase.PropInfo obj, int h)
{
    trees.add(new Tree(conf, obj, h));
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:5,代码来源:ElementPropSetter.java

示例8: Tree

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入方法依赖的package包/类
public Tree(ConfigBase conf, ConfigBase.PropInfo obj, int h)
{
    config = conf;
    propInfo = obj;
    theHeight = h;
    try
    {
        obj.field.setAccessible(true);
        Class clz = obj.field.getType();
        if(clz.equals(int.class) || clz.equals(Integer.class))
        {
            int[] minmax = new int[] { Integer.MIN_VALUE, Integer.MAX_VALUE };
            if(obj.field.isAnnotationPresent(IntMinMax.class))
            {
                IntMinMax minMax = obj.field.getAnnotation(IntMinMax.class);
                minmax[0] = minMax.min();
                minmax[1] = minMax.max();

                element = new ElementNumberInput(parent, 0, 0, 200, 12, 0, "", 1, false, minmax[0], minmax[1], obj.field.getInt(conf));
            }
            else if(obj.field.isAnnotationPresent(IntBool.class))
            {
                element = new ElementToggle(parent, 0, 0, 0, 12, 0, false, 0, 0, "gui.yes", null, obj.field.getInt(conf) == 1);
            }
            else
            {
                element = new ElementNumberInput(parent, 0, 0, 200, 12, 0, "", 1, false, minmax[0], minmax[1], obj.field.getInt(conf));
            }
        }
        else if(clz.equals(Colour.class))
        {
            element = new ElementTextInput(parent, 0, 0, 40, 12, 0, "", Integer.toHexString(((Colour)obj.field.get(conf)).getColour())); //last arg is current text
            ((ElementTextInput)element).textField.setMaxStringLength(6);
        }
        else if(clz.equals(String.class))
        {
            element = new ElementTextInput(parent, 0, 0, 40, 12, 0, "", (String)obj.field.get(conf)); //last arg is current text
        }
        else if(clz.equals(KeyBind.class))
        {
            element = new ElementButton(parent, 0, 0, 0, 12, 0, false, 0, 0, "");
        }
        else if(clz.equals(String[].class) || clz.equals(int[].class) || clz.equals(NestedIntArray.class))
        {
            element = new ElementButton(parent, 0, 0, 0, 12, 0, false, 0, 0, "Set");
        }
    }
    catch(Exception ignored)
    {
    }
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:52,代码来源:ElementPropSetter.java


注:本文中的me.ichun.mods.ichunutil.common.core.config.ConfigBase.PropInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。