本文整理汇总了Java中de.lessvoid.nifty.layout.align.HorizontalAlign类的典型用法代码示例。如果您正苦于以下问题:Java HorizontalAlign类的具体用法?Java HorizontalAlign怎么用?Java HorizontalAlign使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HorizontalAlign类属于de.lessvoid.nifty.layout.align包,在下文中一共展示了HorizontalAlign类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTextHAlign
import de.lessvoid.nifty.layout.align.HorizontalAlign; //导入依赖的package包/类
@Override
public void setTextHAlign(@Nonnull final HorizontalAlign newTextHAlign) {
if (buttonTextRenderer != null) {
buttonTextRenderer.setTextHAlign(newTextHAlign);
} else {
log.warning("Failed to set the horizontal text align. Maybe the element is not bound yet?");
}
}
示例2: bind
import de.lessvoid.nifty.layout.align.HorizontalAlign; //导入依赖的package包/类
@Override
public void bind(
final Nifty nifty,
final Screen screenParam,
final Element element,
final Properties parameter,
final Attributes controlDefinitionAttributes)
{
if (this.element != null)
{
throw new IllegalStateException();
}
this.element = element;
progressBarElement = element.findElementByName("#progress");
progressTextElement = element.findElementByName("#progress-text");
if (progressBarElement != null)
{
String align = controlDefinitionAttributes.get("barAlign");
if (align != null)
{
progressBarElement.setConstraintHorizontalAlign(HorizontalAlign.valueOf(align));
}
}
Float min = controlDefinitionAttributes.getAsFloat("min"); // exclusive
Float max = controlDefinitionAttributes.getAsFloat("max"); // inclusive
if (min == null) { min = -0.1f; }
if (max == null) { max = 1f; }
this.min = min;
this.max = max;
}
示例3: getTextHAlign
import de.lessvoid.nifty.layout.align.HorizontalAlign; //导入依赖的package包/类
@Nonnull
@Override
public HorizontalAlign getTextHAlign() {
return buttonTextRenderer != null ? buttonTextRenderer.getTextHAlign() : HorizontalAlign.center;
}
示例4: getTextHAlign
import de.lessvoid.nifty.layout.align.HorizontalAlign; //导入依赖的package包/类
/**
* Get the Horizontal Align of the Button text.
*
* @return HorizontalAlign
*/
@Nonnull
HorizontalAlign getTextHAlign();
示例5: setTextHAlign
import de.lessvoid.nifty.layout.align.HorizontalAlign; //导入依赖的package包/类
/**
* Set the Horizontal Align of the Button text.
*
* @param newTextHAlign HorizontalAlign
*/
void setTextHAlign(@Nonnull final HorizontalAlign newTextHAlign);