本文整理匯總了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);
}
}
示例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
}
}
示例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;
}
示例4: getMajorAxis
protected final int getMajorAxis() {
return isXMajorAxis() ? View.X_AXIS : View.Y_AXIS;
}
示例5: getMinorAxis
protected final int getMinorAxis() {
return isXMajorAxis() ? View.Y_AXIS : View.X_AXIS;
}
示例6: getLayoutStateMajorAxis
protected final int getLayoutStateMajorAxis() {
return (isStatusBitsNonZero(LAYOUT_STATE_X_MAJOR_AXIS_BIT))
? View.X_AXIS
: View.Y_AXIS;
}
示例7: getLayoutStateMinorAxis
protected final int getLayoutStateMinorAxis() {
return (isStatusBitsNonZero(LAYOUT_STATE_X_MAJOR_AXIS_BIT))
? View.Y_AXIS
: View.X_AXIS;
}
示例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;
}
示例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;
}
示例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();
}