當前位置: 首頁>>代碼示例>>Java>>正文


Java HPos.RIGHT屬性代碼示例

本文整理匯總了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;
			
	}
}
 
開發者ID:ivartanian,項目名稱:JVx.javafx,代碼行數:25,代碼來源:FXAlignmentUtil.java

示例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");
    }
}
 
開發者ID:adrianromero,項目名稱:helloiot,代碼行數:11,代碼來源:EditView.java

示例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");
    }
}
 
開發者ID:adrianromero,項目名稱:helloiot,代碼行數:11,代碼來源:EditEvent.java

示例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");
    }
}
 
開發者ID:adrianromero,項目名稱:helloiot,代碼行數:13,代碼來源:EditStatus.java

示例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);
}
 
開發者ID:dejv78,項目名稱:j.commons,代碼行數:13,代碼來源:ZoomFX.java

示例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());
		}
	}
}
 
開發者ID:ivartanian,項目名稱:JVx.javafx,代碼行數:41,代碼來源:LayoutUtil.java


注:本文中的javafx.geometry.HPos.RIGHT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。