本文整理汇总了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;
}
}
示例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;
}
示例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;
}
示例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" : "");
}
示例5: getHalign
import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
public BitmapFont.Align getHalign() {
return halign;
}
示例6: setHAlign
import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
public void setHAlign(BitmapFont.Align halign) {
this.halign = halign;
dirtyLayout(false, LayoutType.children, LayoutType.text);
layoutChildren();
}
示例7: getButtonIconAlign
import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
public BitmapFont.Align getButtonIconAlign() {
return icon.getLayoutData() == null ? Align.Left : Align.valueOf(icon.getLayoutData());
}
示例8: getAlign
import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
public BitmapFont.Align getAlign() {
return align;
}
示例9: setAlign
import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
public FlowLayout setAlign(BitmapFont.Align align) {
this.align = align;
return this;
}
示例10: FlowLayout
import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
public FlowLayout(BitmapFont.Align align) {
this(-1, align);
}
示例11: setAlign
import com.jme3.font.BitmapFont; //导入方法依赖的package包/类
public WrappingLayout setAlign(BitmapFont.Align align) {
this.align = align;
return this;
}
示例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;
}
示例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;
}
示例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;
}