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


Java Value类代码示例

本文整理汇总了Java中org.newdawn.slick.font.effects.ConfigurableEffect.Value的典型用法代码示例。如果您正苦于以下问题:Java Value类的具体用法?Java Value怎么用?Java Value使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Value类属于org.newdawn.slick.font.effects.ConfigurableEffect包,在下文中一共展示了Value类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: save

import org.newdawn.slick.font.effects.ConfigurableEffect.Value; //导入依赖的package包/类
/**
 * Saves the settings to a file.
 * 
 * @param file The file we're saving to
 * @throws IOException if the file could not be saved.
 */
public void save(File file) throws IOException {
	PrintStream out = new PrintStream(new FileOutputStream(file));
	out.println("font.size=" + fontSize);
	out.println("font.bold=" + bold);
	out.println("font.italic=" + italic);
	out.println();
	out.println("pad.top=" + paddingTop);
	out.println("pad.right=" + paddingRight);
	out.println("pad.bottom=" + paddingBottom);
	out.println("pad.left=" + paddingLeft);
	out.println("pad.advance.x=" + paddingAdvanceX);
	out.println("pad.advance.y=" + paddingAdvanceY);
	out.println();
	out.println("glyph.page.width=" + glyphPageWidth);
	out.println("glyph.page.height=" + glyphPageHeight);
	out.println();
	for (Iterator iter = effects.iterator(); iter.hasNext();) {
		ConfigurableEffect effect = (ConfigurableEffect)iter.next();
		out.println("effect.class=" + effect.getClass().getName());
		for (Iterator iter2 = effect.getValues().iterator(); iter2.hasNext();) {
			Value value = (Value)iter2.next();
			out.println("effect." + value.getName() + "=" + value.getString());
		}
		out.println();
	}
	out.close();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:34,代码来源:HieroSettings.java

示例2: colorValue

import org.newdawn.slick.font.effects.ConfigurableEffect.Value; //导入依赖的package包/类
/**
 * Prompts the user for a colour value
 * 
 * @param name Thename of the value being configured
 * @param currentValue The default value that should be selected
 * @return The value selected
 */
static public Value colorValue(String name, Color currentValue) {
	return new DefaultValue(name, EffectUtil.toString(currentValue)) {
		public void showDialog () {
			Color newColor = JColorChooser.showDialog(null, "Choose a color", EffectUtil.fromString(value));
			if (newColor != null) value = EffectUtil.toString(newColor);
		}

		public Object getObject () {
			return EffectUtil.fromString(value);
		}
	};
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:20,代码来源:EffectUtil.java

示例3: intValue

import org.newdawn.slick.font.effects.ConfigurableEffect.Value; //导入依赖的package包/类
/**
 * Prompts the user for int value
 * 
 * @param name The name of the dialog to show
 * @param currentValue The current value to be displayed
 * @param description The help text to provide
 * @return The value selected by the user
 */
static public Value intValue (String name, final int currentValue, final String description) {
	return new DefaultValue(name, String.valueOf(currentValue)) {
		public void showDialog () {
			JSpinner spinner = new JSpinner(new SpinnerNumberModel(currentValue, Short.MIN_VALUE, Short.MAX_VALUE, 1));
			if (showValueDialog(spinner, description)) value = String.valueOf(spinner.getValue());
		}

		public Object getObject () {
			return Integer.valueOf(value);
		}
	};
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:21,代码来源:EffectUtil.java

示例4: floatValue

import org.newdawn.slick.font.effects.ConfigurableEffect.Value; //导入依赖的package包/类
/**
 * Prompts the user for float value
 * 
 * @param name The name of the dialog to show
 * @param currentValue The current value to be displayed
 * @param description The help text to provide
 * @param min The minimum value to allow
 * @param max The maximum value to allow
 * @return The value selected by the user
 */
static public Value floatValue (String name, final float currentValue, final float min, final float max,
	final String description) {
	return new DefaultValue(name, String.valueOf(currentValue)) {
		public void showDialog () {
			JSpinner spinner = new JSpinner(new SpinnerNumberModel(currentValue, min, max, 0.1f));
			if (showValueDialog(spinner, description)) value = String.valueOf(((Double)spinner.getValue()).floatValue());
		}

		public Object getObject () {
			return Float.valueOf(value);
		}
	};
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:24,代码来源:EffectUtil.java

示例5: booleanValue

import org.newdawn.slick.font.effects.ConfigurableEffect.Value; //导入依赖的package包/类
/**
 * Prompts the user for boolean value
 * 
 * @param name The name of the dialog to show
 * @param currentValue The current value to be displayed
 * @param description The help text to provide
 * @return The value selected by the user
 */
static public Value booleanValue (String name, final boolean currentValue, final String description) {
	return new DefaultValue(name, String.valueOf(currentValue)) {
		public void showDialog () {
			JCheckBox checkBox = new JCheckBox();
			checkBox.setSelected(currentValue);
			if (showValueDialog(checkBox, description)) value = String.valueOf(checkBox.isSelected());
		}

		public Object getObject () {
			return Boolean.valueOf(value);
		}
	};
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:22,代码来源:EffectUtil.java

示例6: updateValues

import org.newdawn.slick.font.effects.ConfigurableEffect.Value; //导入依赖的package包/类
public void updateValues () {
	prefs.put("foreground", EffectUtil.toString(colorEffect.getColor()));
	valuesPanel.removeAll();
	values = effect.getValues();
	for (Iterator iter = values.iterator(); iter.hasNext();)
		addValue((Value)iter.next());
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:8,代码来源:Hiero.java

示例7: save

import org.newdawn.slick.font.effects.ConfigurableEffect.Value; //导入依赖的package包/类
/**
 * Saves the settings to a file.
 *
 * @param file The file we're saving to
 * @throws IOException if the file could not be saved.
 * @throws SlickException if effect from effects is not ConfigurableEffect
 */
public void save(@Nonnull File file) throws SlickException, IOException {
    try(
        final FileOutputStream fileOutputStream = new FileOutputStream(file);
        final PrintStream out = new PrintStream(fileOutputStream)
    ) {
        out.println("font.size=" + fontSize);
        out.println("font.bold=" + bold);
        out.println("font.italic=" + italic);
        out.println();
        out.println("pad.top=" + paddingTop);
        out.println("pad.right=" + paddingRight);
        out.println("pad.bottom=" + paddingBottom);
        out.println("pad.left=" + paddingLeft);
        out.println("pad.advance.x=" + paddingAdvanceX);
        out.println("pad.advance.y=" + paddingAdvanceY);
        out.println();
        out.println("glyph.page.width=" + glyphPageWidth);
        out.println("glyph.page.height=" + glyphPageHeight);
        out.println();
        for (Iterator<Effect> iter = effects.iterator(); iter.hasNext();) {
            if(!(iter.next() instanceof ConfigurableEffect)) {
                throw new SlickException("Effect is not org.newdawn.slick.font.effects.ConfigurableEffect");
            }
            ConfigurableEffect effect = (ConfigurableEffect) iter.next();            
            out.println("effect.class=" + effect.getClass().getName());
            for (Value value : effect.getValues()) {
                out.println("effect." + value.getName() + "=" + value.getString());
            }
            out.println();
        }
    }
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:40,代码来源:HieroSettings.java

示例8: colorValue

import org.newdawn.slick.font.effects.ConfigurableEffect.Value; //导入依赖的package包/类
/**
 * Prompts the user for a colour value
 *
 * @param name Thename of the value being configured
 * @param currentValue The default value that should be selected
 * @return The value selected
 */
@Nullable
static public Value colorValue(String name, @Nullable Color currentValue) {
    return new DefaultValue(name, EffectUtil.toString(currentValue)) {
        public void showDialog () {
            Color newColor = JColorChooser.showDialog(null, "Choose a color", EffectUtil.fromString(value));
            if (newColor != null) value = EffectUtil.toString(newColor);
        }

        public Object getObject () {
            return EffectUtil.fromString(value);
        }
    };
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:21,代码来源:EffectUtil.java

示例9: intValue

import org.newdawn.slick.font.effects.ConfigurableEffect.Value; //导入依赖的package包/类
/**
 * Prompts the user for int value
 *
 * @param name The name of the dialog to show
 * @param currentValue The current value to be displayed
 * @param description The help text to provide
 * @return The value selected by the user
 */
@Nonnull
static public Value intValue (String name, final int currentValue, final String description) {
    return new DefaultValue(name, String.valueOf(currentValue)) {
        public void showDialog () {
            JSpinner spinner = new JSpinner(new SpinnerNumberModel(currentValue, Short.MIN_VALUE, Short.MAX_VALUE, 1));
            if (showValueDialog(spinner, description)) value = String.valueOf(spinner.getValue());
        }

        public Object getObject () {
            return Integer.valueOf(value);
        }
    };
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:22,代码来源:EffectUtil.java

示例10: floatValue

import org.newdawn.slick.font.effects.ConfigurableEffect.Value; //导入依赖的package包/类
/**
 * Prompts the user for float value
 *
 * @param name The name of the dialog to show
 * @param currentValue The current value to be displayed
 * @param description The help text to provide
 * @param min The minimum value to allow
 * @param max The maximum value to allow
 * @return The value selected by the user
 */
@Nonnull
static public Value floatValue (String name, final float currentValue, final float min, final float max,
    final String description) {
    return new DefaultValue(name, String.valueOf(currentValue)) {
        public void showDialog () {
            JSpinner spinner = new JSpinner(new SpinnerNumberModel(currentValue, min, max, 0.1f));
            if (showValueDialog(spinner, description)) value = String.valueOf(((Double)spinner.getValue()).floatValue());
        }

        public Object getObject () {
            return Float.valueOf(value);
        }
    };
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:25,代码来源:EffectUtil.java

示例11: booleanValue

import org.newdawn.slick.font.effects.ConfigurableEffect.Value; //导入依赖的package包/类
/**
 * Prompts the user for boolean value
 *
 * @param name The name of the dialog to show
 * @param currentValue The current value to be displayed
 * @param description The help text to provide
 * @return The value selected by the user
 */
@Nonnull
static public Value booleanValue (String name, final boolean currentValue, final String description) {
    return new DefaultValue(name, String.valueOf(currentValue)) {
        public void showDialog () {
            JCheckBox checkBox = new JCheckBox();
            checkBox.setSelected(currentValue);
            if (showValueDialog(checkBox, description)) value = String.valueOf(checkBox.isSelected());
        }

        public Object getObject () {
            return Boolean.valueOf(value);
        }
    };
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:23,代码来源:EffectUtil.java


注:本文中的org.newdawn.slick.font.effects.ConfigurableEffect.Value类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。