本文整理汇总了Java中javafx.geometry.HPos.RIGHT属性的典型用法代码示例。如果您正苦于以下问题:Java HPos.RIGHT属性的具体用法?Java HPos.RIGHT怎么用?Java HPos.RIGHT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javafx.geometry.HPos
的用法示例。
在下文中一共展示了HPos.RIGHT属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: alignmentToHPos
/**
* Converts the given horizontal alignment to {@link HPos}.
*
* @param pHorizontalAlignment the horizontal alignment.
* @param pDefaultValue the default value to use.
* @return the appropriate {@link HPos}, or the given default value.
*/
public static HPos alignmentToHPos(int pHorizontalAlignment, HPos pDefaultValue)
{
switch (pHorizontalAlignment)
{
case IAlignmentConstants.ALIGN_LEFT:
return HPos.LEFT;
case IAlignmentConstants.ALIGN_CENTER:
return HPos.CENTER;
case IAlignmentConstants.ALIGN_RIGHT:
return HPos.RIGHT;
default:
return pDefaultValue;
}
}
示例2: setDevice
public void setDevice(DeviceSubscribe device) {
this.device = device;
if (Strings.isNullOrEmpty(getLabel())) {
setLabel(device.getProperties().getProperty("label"));
}
if (device.getFormat().alignment().getHpos() == HPos.RIGHT) {
statusview.getStyleClass().add("textinput-right");
} else {
statusview.getStyleClass().remove("textinput-right");
}
}
示例3: setDevice
public void setDevice(TransmitterSimple device) {
this.device = device;
if (Strings.isNullOrEmpty(getLabel())) {
setLabel(device.getProperties().getProperty("label"));
}
if (device.getFormat().alignment().getHpos() == HPos.RIGHT) {
payload.getStyleClass().add("textinput-right");
} else {
payload.getStyleClass().remove("textinput-right");
}
}
示例4: setDevice
public void setDevice(DeviceSimple device) {
this.device = device;
if (Strings.isNullOrEmpty(getLabel())) {
setLabel(device.getProperties().getProperty("label"));
}
if (device.getFormat().alignment().getHpos() == HPos.RIGHT) {
statusview.getStyleClass().add("textinput-right");
statusedit.getStyleClass().add("textinput-right");
} else {
statusview.getStyleClass().remove("textinput-right");
statusedit.getStyleClass().remove("textinput-right");
}
}
示例5: setupConstraints
private void setupConstraints() {
final ColumnConstraints c1 = new ColumnConstraints(0.0, 0.0, Double.MAX_VALUE, Priority.ALWAYS, HPos.CENTER, true);
final ColumnConstraints c2 = new ColumnConstraints(0.0, USE_COMPUTED_SIZE, USE_COMPUTED_SIZE, Priority.NEVER, HPos.RIGHT, false);
final RowConstraints r1 = new RowConstraints(0.0, 0.0, Double.MAX_VALUE, Priority.ALWAYS, VPos.CENTER, true);
final RowConstraints r2 = new RowConstraints(0.0, USE_COMPUTED_SIZE, USE_COMPUTED_SIZE, Priority.NEVER, VPos.BOTTOM, false);
getColumnConstraints().addAll(c1, c2);
getRowConstraints().addAll(r1, r2);
GridPane.setConstraints(contentPane, 0, 0);
GridPane.setConstraints(hscroll, 0, 1);
GridPane.setConstraints(vscroll, 1, 0);
}
示例6: alignRelativeToContent
/**
* Aligns the given node according to the given settings relative to the
* anchor node.
*
* @param pAnchorNode the node that is used for alignment.
* @param pNodeToAlign the node that is going to be aligned.
* @param pContentDisplay the content display to use.
* @param pHorizontalAlignment the horizontal alignment to use.
* @param pVerticalAlignment the vertical alignment to use.
*/
public static void alignRelativeToContent(Node pAnchorNode, Node pNodeToAlign, ContentDisplay pContentDisplay, HPos pHorizontalAlignment, VPos pVerticalAlignment)
{
if (pAnchorNode == null || pNodeToAlign == null)
{
return;
}
if (pContentDisplay == ContentDisplay.CENTER || pContentDisplay == ContentDisplay.BOTTOM || pContentDisplay == ContentDisplay.TOP)
{
if (pHorizontalAlignment == HPos.LEFT)
{
pNodeToAlign.setLayoutX(pAnchorNode.getLayoutX());
}
else if (pHorizontalAlignment == HPos.RIGHT)
{
pNodeToAlign.setLayoutX(pAnchorNode.getLayoutX() + pAnchorNode.prefWidth(-1) - pNodeToAlign.getLayoutBounds().getWidth());
}
}
if (pContentDisplay == ContentDisplay.CENTER || pContentDisplay == ContentDisplay.LEFT || pContentDisplay == ContentDisplay.RIGHT)
{
if (pVerticalAlignment == VPos.TOP)
{
pNodeToAlign.setLayoutY(pAnchorNode.getLayoutY() - pNodeToAlign.getLayoutBounds().getMinY());
}
else if (pVerticalAlignment == VPos.BOTTOM)
{
pNodeToAlign.setLayoutY(pAnchorNode.getLayoutY() - pNodeToAlign.getLayoutBounds().getMinY() + pAnchorNode.prefHeight(-1)
- pNodeToAlign.getLayoutBounds().getHeight());
}
}
}