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


Java View.Y_AXIS屬性代碼示例

本文整理匯總了Java中javax.swing.text.View.Y_AXIS屬性的典型用法代碼示例。如果您正苦於以下問題:Java View.Y_AXIS屬性的具體用法?Java View.Y_AXIS怎麽用?Java View.Y_AXIS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在javax.swing.text.View的用法示例。


在下文中一共展示了View.Y_AXIS屬性的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getPreferredSpan

/**
 * Determines the preferred span for this view along an
 * axis.
 *
 * @param axis may be either X_AXIS or Y_AXIS
 * @return   the span the view would like to be rendered into.
 *           Typically the view is told to render into the span
 *           that is returned, although there is no guarantee.
 *           The parent may choose to resize or break the view.
 * @see View#getPreferredSpan
 */
@Override
public float getPreferredSpan(int axis) {
	switch (axis) {
		case View.X_AXIS:
			float width = getWidth();
			if (width == Integer.MAX_VALUE) {
				// We have been initially set to MAX_VALUE, but we don't
				// want this as our preferred.
				return 100f;
			}
			return width;
		case View.Y_AXIS:
			if (nlines == 0 || widthChanging) {
				nlines = calculateLineCount();
			}
			int h = nlines * ((RSyntaxTextArea)getContainer()).getLineHeight();
			return h;
		default:
			throw new IllegalArgumentException("Invalid axis: " + axis);
	}
}
 
開發者ID:Thecarisma,項目名稱:powertext,代碼行數:32,代碼來源:WrappedSyntaxView.java

示例2: axisToString

public static String axisToString(int axis) {
    switch (axis) {
        case View.X_AXIS:
            return "x"; // NOI18N
            
        case View.Y_AXIS:
            return "y"; // NOI18N
            
        default:
            return "<invalid-axis-value=" + axis + ">"; // NOI18N
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:ViewUtilitiesImpl.java

示例3: isAxisValid

/**
 * Test whether the axis is valid.
 *
 * @param axis integer axis
 * @return true if the axis is either <code>View.X_AXIS</code>
 *  or <code>View.Y_AXIS</code>. False is returned otherwise.
 */
public static boolean isAxisValid(int axis) {
    switch (axis) {
        case View.X_AXIS:
        case View.Y_AXIS:
            return true;
    }
    
    return false;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:16,代碼來源:ViewUtilities.java

示例4: getMajorAxis

protected final int getMajorAxis() {
    return isXMajorAxis() ? View.X_AXIS : View.Y_AXIS;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:3,代碼來源:DrawEngineLineView.java

示例5: getMinorAxis

protected final int getMinorAxis() {
    return isXMajorAxis() ? View.Y_AXIS : View.X_AXIS;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:3,代碼來源:DrawEngineLineView.java

示例6: getLayoutStateMajorAxis

protected final int getLayoutStateMajorAxis() {
    return (isStatusBitsNonZero(LAYOUT_STATE_X_MAJOR_AXIS_BIT))
        ? View.X_AXIS 
        : View.Y_AXIS;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:5,代碼來源:GapBoxView.java

示例7: getLayoutStateMinorAxis

protected final int getLayoutStateMinorAxis() {
    return (isStatusBitsNonZero(LAYOUT_STATE_X_MAJOR_AXIS_BIT))
        ? View.Y_AXIS 
        : View.X_AXIS;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:5,代碼來源:GapBoxView.java

示例8: getMajorAxis

/**
 * Fetch the major axis (the axis the children
 * are tiled along).  This will have a value of
 * either X_AXIS or Y_AXIS.
 */
public final int getMajorAxis() {
    return isXMajorAxis() ? View.X_AXIS : View.Y_AXIS;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:GapBoxView.java

示例9: getMinorAxis

/**
 * Fetch the minor axis (the axis orthoginal
 * to the tiled axis).  This will have a value of
 * either X_AXIS or Y_AXIS.
 */
public final int getMinorAxis() {
    return isXMajorAxis() ? View.Y_AXIS : View.X_AXIS;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:GapBoxView.java

示例10: GapDocumentView

/**
 * Construct a view intended to cover the whole document.
 *
 * @param elem the element of the model to represent.
 * @param hideBottomPadding to avoid adding bottom padding to view
 * @param majorAxis the axis to tile along.  This can be
 *  either X_AXIS or Y_AXIS.
 * @param baselineLayout whether baseline layout should be used
 *  instead of default layout.
 */
public GapDocumentView(Element elem, boolean hideBottomPadding) {
    super(elem, View.Y_AXIS);
    this.hideBottomPadding = hideBottomPadding;
    clearDamageRangeBounds();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:15,代碼來源:GapDocumentView.java


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