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


Java BitmapFont.Align方法代码示例

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


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

示例1: alignToIdent

import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
public static IdentValue alignToIdent(BitmapFont.Align textAlign) {
	switch (textAlign) {
	case Left:
		return IdentValue.LEFT;
	case Right:
		return IdentValue.RIGHT;
	default:
		return IdentValue.MIDDLE;
	}
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:11,代码来源:CssUtil.java

示例2: setTextAlign

import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
/**
 * Sets the element's text layer horizontal alignment
 * 
 * @param textAlign
 */
@Override
public BaseElement setTextAlign(BitmapFont.Align textAlign) {
	PropertyDeclaration decl = new PropertyDeclaration(CSSName.TEXT_ALIGN,
			new PropertyValue(CssUtil.alignToIdent(textAlign)), false, StylesheetInfo.USER);
	cssState.addAllCssDeclaration(decl);
	applyCss(decl);
	layoutChildren();
	return this;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:15,代码来源:Element.java

示例3: setTextAlign

import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
/**
 * Sets the element's text layer horizontal alignment
 * 
 * @param textAlign
 */
public BaseElement setTextAlign(BitmapFont.Align textAlign) {
	this.textAlign = textAlign;
	if (textElement != null) {
		textElement.setTextAlign(textAlign);

		/*
		 * Text and children because some components use text align for
		 * layout of children
		 */
		dirtyLayout(false, LayoutType.text, LayoutType.children);
	}
	layoutChildren();
	return this;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:20,代码来源:BaseElement.java

示例4: createAndAddButton

import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
private void createAndAddButton(BaseElement p, String type, String control, String text, BitmapFont.Align h,
		BitmapFont.VAlign v, Align iconAlign, boolean fill, boolean icons, ButtonGroup<Button> buttonGroup,
		String styleClass) {
	Button b1 = null;

	/* Create appropriate button type */
	if (type.equals("Button")) {
		/* Ordinary buttons */
		if (control.equals("Toggle"))
			b1 = new ToggleButton();
		else
			b1 = new PushButton();
	} else if (type.equals("CheckBox")) {
		/* Check Box buttons */
		if (control.equals("Normal") || control.equals("Grouped"))
			b1 = new CheckBox();
	} else if (type.equals("RadioButton")) {
		/* Radio buttons */
		if (control.equals("Normal") || control.equals("Grouped"))
			b1 = new RadioButton<>();
	}

	/* If grouped, add to group */
	if (control.equals("Grouped"))
		buttonGroup.addButton(b1);

	b1.setStyleClass(styleClass);
	b1.setText(text);
	b1.setTextAlign(h);
	b1.setTextVAlign(v);
	if (icons)
		FontAwesome.values()[(int) (Math.random() * FontAwesome.values().length)].button(24, b1);
	else
		FontAwesome.clear(b1.getButtonIcon());
	b1.setButtonIconAlign(iconAlign);
	p.addElement(b1, fill ? "growx, growy" : "");
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:38,代码来源:ButtonExample.java

示例5: getHalign

import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
public BitmapFont.Align getHalign() {
	return halign;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:4,代码来源:TableCell.java

示例6: setHAlign

import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
public void setHAlign(BitmapFont.Align halign) {
	this.halign = halign;
	dirtyLayout(false, LayoutType.children, LayoutType.text);
	layoutChildren();
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:6,代码来源:TableCell.java

示例7: getButtonIconAlign

import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
public BitmapFont.Align getButtonIconAlign() {
	return icon.getLayoutData() == null ? Align.Left : Align.valueOf(icon.getLayoutData());
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:4,代码来源:Button.java

示例8: getAlign

import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
public BitmapFont.Align getAlign() {
	return align;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:4,代码来源:FlowLayout.java

示例9: setAlign

import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
public FlowLayout setAlign(BitmapFont.Align align) {
	this.align = align;
	return this;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:5,代码来源:FlowLayout.java

示例10: FlowLayout

import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
public FlowLayout(BitmapFont.Align align) {
	this(-1, align);
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:4,代码来源:FlowLayout.java

示例11: setAlign

import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
public WrappingLayout setAlign(BitmapFont.Align align) {
	this.align = align;
	return this;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:5,代码来源:WrappingLayout.java

示例12: createWindow

import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
protected Frame createWindow(String type, boolean allowIcons) {
	/* Some options to change how the buttons look */
	CheckBox fill = new CheckBox();
	fill.setChecked(true);
	fill.setText("Fill");

	/* Show some example icons */
	CheckBox icons = new CheckBox();
	icons.setChecked(allowIcons);
	icons.setEnabled(allowIcons);
	icons.setText("Icons");

	/* Icon alignment */
	ComboBox<Align> iconAlign = new ComboBox<Align>();
	iconAlign.setEditable(false);
	for (BitmapFont.Align a : BitmapFont.Align.values()) {
		iconAlign.addListItem(a.name(), a);
	}
	iconAlign.setSelectedByValue(Align.Left);

	/* Style **/
	TextField style = new TextField();
	style.setCharacterLength(10);

	/* Tools */
	StyledContainer tools = new StyledContainer();
	tools.setLayoutManager(new FlowLayout(8));
	tools.addElement(fill);
	tools.addElement(icons);
	tools.addElement(iconAlign);
	tools.addElement(new Label("Style"));
	tools.addElement(style);

	/* Container for buttons themselves */
	StyledContainer buttons = new StyledContainer();

	// Frame
	Frame frame1 = new Frame();
	frame1.setResizable(true);
	frame1.setTitle(type);
	frame1.getContentArea().setLayoutManager(new BorderLayout());
	frame1.getContentArea().addElement(buttons, Border.CENTER);
	frame1.getContentArea().addElement(tools, Border.SOUTH);
	rebuildButtons(frame1, buttons, type, fill.isChecked(), icons.isChecked(), iconAlign.getSelectedValue(),
			style.getText());

	/* Bind to control change events */
	iconAlign.onChange(evt -> rebuildButtons(frame1, buttons, type, fill.isChecked(), icons.isChecked(),
			iconAlign.getSelectedValue(), style.getText()));

	fill.onChange(evt -> rebuildButtons(frame1, buttons, type, fill.isChecked(), icons.isChecked(),
			iconAlign.getSelectedValue(), style.getText()));

	icons.onChange(evt -> rebuildButtons(frame1, buttons, type, fill.isChecked(), icons.isChecked(),
			iconAlign.getSelectedValue(), style.getText()));

	style.onKeyboardReleased(evt -> {
		if (evt.getKeyCode() == KeyInput.KEY_RETURN)
			rebuildButtons(frame1, buttons, type, fill.isChecked(), icons.isChecked(), iconAlign.getSelectedValue(),
					style.getText());

	});

	return frame1;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:66,代码来源:ButtonExample.java

示例13: setButtonIconAlign

import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
/**
 * Set the alignment of the icon within the button. If there is text on the
 * button, the icon will appear to the specified side of the text.
 *
 * @param buttonIconAlign
 *            alignment
 */
public Button setButtonIconAlign(BitmapFont.Align buttonIconAlign) {
	if (icon != null)
		icon.setLayoutData(buttonIconAlign.name());
	layoutChildren();
	return this;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:14,代码来源:Button.java

示例14: getTextAlign

import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
/**
 * Returns the element's text layer horizontal alignment
 * 
 * @return Align text Align
 */
public BitmapFont.Align getTextAlign() {
	return textAlign;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:9,代码来源:BaseElement.java


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