Overview | Package | Class | Tree | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## application.workbooks.workbook.style.border
Class WpBaseBorderAttribute

    java.lang.Object
      application.workbooks.workbook.style.border.BaseBorderAttribute
          application.workbooks.workbook.style.border.WpBaseBorderAttribute

All Implemented Interfaces:
  BorderAndShadingConstants

public class WpBaseBorderAttribute
extends BaseBorderAttribute

这个类定义了文档的边框属性。

Field Summary

Fields inherited from interface application.constants.BorderAndShadingConstants
`ALL_BORDERS, APPLY_CELL, APPLY_PAGE, APPLY_PARAGRAPH, APPLY_SECTION, APPLY_TABLE, APPLY_TEXT, BORDERTYPE_ALL, BORDERTYPE_BOX, BORDERTYPE_CUSTOM, BORDERTYPE_GRID, BORDERTYPE_NONE, BORDERTYPE_SHADOW, BORDERTYPE_THREED, BOTTOM, BOTTOM_BORDER, BOTTOM_DOUBLE_BORDER, DEFAULT, DIAGONAL_BACKWARD, DIAGONAL_FORWARD, LEFT, LEFT_BORDER, LINESTYLE_DASHDOT, LINESTYLE_DASHDOTDOT, LINESTYLE_DASHLARGEGAP, LINESTYLE_DASHSMALLGAP, LINESTYLE_DOT, LINESTYLE_DOUBLE, LINESTYLE_SINGLE, LINESTYLE_THICKTHINLARGEGAP, LINESTYLE_THICKTHINMEDGAP, LINESTYLE_THICKTHINSMALLGAP, LINESTYLE_THINTHICKLARGEGAP, LINESTYLE_THINTHICKMEDGAP, LINESTYLE_THINTHICKSMALLGAP, LINESTYLE_THINTHICKTHINLARGEGAP, LINESTYLE_THINTHICKTHINMEDGAP, LINESTYLE_THINTHICKTHINSMALLGAP, LINESTYLE_TRIPLE, LINEWIDTH_025PT, LINEWIDTH_050PT, LINEWIDTH_075PT, LINEWIDTH_100PT, LINEWIDTH_150PT, LINEWIDTH_225PT, LINEWIDTH_300PT, LINEWIDTH_450PT, LINEWIDTH_600PT, MIDDLE_HORIZON, MIDDLE_VERTICAL, NO_BORDER, OUTSIDE_BORDERS, RIGHT, RIGHT_BORDER, TEXTURE_10PERCENT, TEXTURE_20PERCENT, TEXTURE_25PERCENT, TEXTURE_30PERCENT, TEXTURE_40PERCENT, TEXTURE_50PERCENT, TEXTURE_5PERCENT, TEXTURE_60PERCENT, TEXTURE_70PERCENT, TEXTURE_75PERCENT, TEXTURE_80PERCENT, TEXTURE_90PERCENT, TEXTURE_DARKDOWNWARDDIAGONAL, TEXTURE_DARKHORIZONTAL, TEXTURE_DARKUPWARDDIAGONAL, TEXTURE_DARKVERTICAL, TEXTURE_DASHEDDOWNWARDDIAGONAL, TEXTURE_DASHEDHORIZONTAL, TEXTURE_DASHEDUPWARDDIAGONAL, TEXTURE_DASHEDVERTICAL, TEXTURE_DIAGONALBRICK, TEXTURE_DIVOT, TEXTURE_DOTTEDDIAMOND, TEXTURE_DOTTEDGRID, TEXTURE_HORIZONTALBRICK, TEXTURE_LARGECHECKERBOARD, TEXTURE_LARGECONFETTI, TEXTURE_LARGEGRID, TEXTURE_LIGHTDOWNWARDDIAGONAL, TEXTURE_LIGHTHORIZONTAL, TEXTURE_LIGHTUPWARDDIAGONAL, TEXTURE_LIGHTVERTICAL, TEXTURE_NARROWHORIZONTAL, TEXTURE_NARROWVERTICAL, TEXTURE_OUTLINEDDIAMOND, TEXTURE_PLAID, TEXTURE_SHINGLE, TEXTURE_SMALLCHECKERBOARD, TEXTURE_SMALLCONFETTI, TEXTURE_SMALLGRID, TEXTURE_SOLIDDIAMOND, TEXTURE_SPHERE, TEXTURE_TRELLIS, TEXTURE_WAVE, TEXTURE_WEAVE, TEXTURE_WIDEDOWNWARDDIAGONAL, TEXTURE_WIDEUPWARDDIAGONAL, TEXTURE_ZIGZAG, THICK_BOTTOM_BORDER, THICK_BOX_BORDER, TOP, TOP_BOTTOM_BORDER, TOP_DOUBLE_BOTTOM_BORDER, TOP_THICK_BOTTOM_BORDER`

Constructor Summary
`WpBaseBorderAttribute()`

Method Summary
`int` | `getOptionBottom()` 获取页面边框与页面下边距或纸张下边缘之间的距离。
`int` | `getOptionFromIndex()` 获取边框的度量依据（即设置的距离是页面与边框之间的距离，还是正文与边框之间的距离）。
`int` | `getOptionLeft()` 获取页面边框与页面左边距或纸张左边缘之间的距离。
`int` | `getOptionRight()` 获取页面边框与页面右边距或纸张右边缘之间的距离。
`int` | `getOptionTop()` 获取页面边框与页面上边距或纸张上边缘之间的距离。
`boolean` | `isOptionsFooter()` 判断是否将页脚包含在页面边框之内。
`boolean` | `isOptionsHeader()` 判断是否将页眉包含在页面边框之内。
`void` | `setOptionBottom(int bottom)` 设置页面边框与页面下边距或纸张下边缘之间的距离。
`void` | `setOptionFromIndex(int ind)` 设置边框的度量依据（即设置的距离是页边距与边框之间的距离，还是纸张边缘与边框之间的距离）。
`void` | `setOptionLeft(int left)` 设置页面边框与页面左边距或纸张左边缘之间的距离
`void` | `setOptionRight(int right)` 设置页面边框与页面右边距或纸张右边缘之间的距离。
`void` | `setOptionsFooter(boolean flag)` 将页脚包含在页面边框之内。
`void` | `setOptionsHeader(boolean flag)` 将页眉包含在页面边框之内。
`void` | `setOptionTop(int top)` 设置页面边框与页面上边距或纸张上边缘之间的距离。

Methods inherited from class application.workbooks.workbook.style.border.BaseBorderAttribute
`getBorderLineColor, getBorderLineType, getBorderLineWidth, getBordersApplyType, getBorderType, isSideBorderValid, setBorderLineColor, setBorderLineColor, setBorderLineType, setBorderLineWidth, setBordersApplyType, setBorderType, setSideBorderValid`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### WpBaseBorderAttribute

    public WpBaseBorderAttribute()

Method Detail

### getOptionBottom

    public int getOptionBottom()

  获取页面边框与页面下边距或纸张下边缘之间的距离。

  Returns:
    页面边框与页面下边距或纸张下边缘之间的距离（以磅为单位）

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveDocument();
         WpBaseBorderAttribute wpBaseBorder = new WpBaseBorderAttribute();
         wpBaseBorder.setBordersApplyType(BorderAndShadingConstants.APPLY_PAGE);
         wpBaseBorder.setSideBorderValid(BorderAndShadingConstants.BOTTOM,true);
         wpBaseBorder.setOptionBottom(12);
         wpBaseBorder.setBorderType(BorderAndShadingConstants.BORDERTYPE_THREED);
         doc.setBorder(wpBaseBorder);
         int optionBottom = wpBaseBorder.getOptionBottom();
         System.out.println("边框与页面之间下边距的距离是：" + optionBottom);

  See Also:
    `setOptionBottom(int)`, `BaseBorderAttribute`

### getOptionFromIndex

    public int getOptionFromIndex()

  获取边框的度量依据（即设置的距离是页面与边框之间的距离，还是正文与边框之间的距离）。

  Returns:
    度量依据，只能取以下两个整形值之一：

                0 - 表示设置的距离是页边距与边框之间的距离
                1 - 表示示设置的距离是纸张边缘与边框之间的距离

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveDocument();
         WpBaseBorderAttribute wpBaseBorder = new WpBaseBorderAttribute();
         wpBaseBorder.setBordersApplyType(BorderAndShadingConstants.APPLY_PAGE);
         wpBaseBorder.setSideBorderValid(BorderAndShadingConstants.RIGHT,true);
         wpBaseBorder.setOptionRight(2);
         wpBaseBorder.setBorderType(BorderAndShadingConstants.BORDERTYPE_THREED);
         wpBaseBorder.setOptionFromIndex(0);
         doc.setBorder(wpBaseBorder);
         int fromIndex = wpBaseBorder.getOptionFromIndex();
         System.out.println("得到当前的度量值为：" + fromIndex);

### getOptionLeft

    public int getOptionLeft()

  获取页面边框与页面左边距或纸张左边缘之间的距离。

  Returns:
    页面边框与页面左边距或纸张左边缘之间的距离（以磅为单位）

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveDocument();
         WpBaseBorderAttribute wpBaseBorder = new WpBaseBorderAttribute();
         wpBaseBorder.setBordersApplyType(BorderAndShadingConstants.APPLY_PAGE);
         wpBaseBorder.setSideBorderValid(BorderAndShadingConstants.LEFT,true);
         wpBaseBorder.setOptionLeft(12);
         wpBaseBorder.setBorderType(BorderAndShadingConstants.BORDERTYPE_THREED);
         doc.setBorder(wpBaseBorder);
         int optionLeft = wpBaseBorder.getOptionLeft();
         System.out.println("边框与页面之间左边距的距离是：" + optionLeft);

  See Also:
    `setOptionLeft(int)`, `BaseBorderAttribute`

### getOptionRight

    public int getOptionRight()

  获取页面边框与页面右边距或纸张右边缘之间的距离。

  Returns:
    页面边框与页面右边距或纸张右边缘之间的距离（以磅为单位）

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveDocument();
         WpBaseBorderAttribute wpBaseBorder = new WpBaseBorderAttribute();
         wpBaseBorder.setBordersApplyType(BorderAndShadingConstants.APPLY_PAGE);
         wpBaseBorder.setSideBorderValid(BorderAndShadingConstants.RIGHT,true);
         wpBaseBorder.setOptionRight(12);
         wpBaseBorder.setBorderType(BorderAndShadingConstants.BORDERTYPE_THREED);
         doc.setBorder(wpBaseBorder);
         int optionRight = wpBaseBorder.getOptionRight();
         System.out.println("边框与页面之间右边距的距离是：" + optionRight);

  See Also:
    `setOptionRight(int)`, `BaseBorderAttribute`

### getOptionTop

    public int getOptionTop()

  获取页面边框与页面上边距或纸张上边缘之间的距离。

  Returns:
    页面边框与页面上边距或纸张上边缘之间的距离（以磅为单位）

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveDocument();
         WpBaseBorderAttribute wpBaseBorder = new WpBaseBorderAttribute();
         wpBaseBorder.setBordersApplyType(BorderAndShadingConstants.APPLY_PAGE);
         wpBaseBorder.setSideBorderValid(BorderAndShadingConstants.TOP,true);
         wpBaseBorder.setOptionTop(12);
         wpBaseBorder.setBorderType(BorderAndShadingConstants.BORDERTYPE_THREED);
         doc.setBorder(wpBaseBorder);
         int optionTop = wpBaseBorder.getOptionTop();
         System.out.println("边框与页面之间上边距的距离是：" + optionTop);

  See Also:
    `setOptionTop(int)`, `BaseBorderAttribute`

### isOptionsFooter

    public boolean isOptionsFooter()

  判断是否将页脚包含在页面边框之内。
  注：必须设置当前的度量依据为正文，边框属性才能设置环绕页眉页脚。 环绕页脚就是使边框的下边距为边框与页脚底边之间的距离。

  Returns:
    布尔型值，如果将页脚包含在页面边框之内，返回true；否则，返回false

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveDocument();
         WpBaseBorderAttribute wpBaseBorder = new WpBaseBorderAttribute();
         wpBaseBorder.setBordersApplyType(BorderAndShadingConstants.APPLY_PAGE);
         wpBaseBorder.setOptionFromIndex(0);
         wpBaseBorder.setOptionsFooter(true);
         wpBaseBorder.setSideBorderValid(BorderAndShadingConstants.BOTTOM,true);
         wpBaseBorder.setOptionBottom(2);
         wpBaseBorder.setBorderType(BorderAndShadingConstants.BORDERTYPE_THREED);
         doc.setBorder(wpBaseBorder);
         boolean isOptionsFooter = wpBaseBorder.isOptionsFooter();
         System.out.println("返回是否环绕页脚：" + isOptionsFooter);

### isOptionsHeader

    public boolean isOptionsHeader()

  判断是否将页眉包含在页面边框之内。
  (注：必须设置当前的度量依据为正文，边框属性才能设置环绕页眉页脚。 环绕页眉就是使边框的上边距为边框与页眉顶边之间的距离。)

  Returns:
    布尔型值，如果页眉包含在页面边框之内，返回true；否则，返回false

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveDocument();
         WpBaseBorderAttribute wpBaseBorder = new WpBaseBorderAttribute();
         wpBaseBorder.setBordersApplyType(BorderAndShadingConstants.APPLY_PAGE);
         wpBaseBorder.setOptionFromIndex(0);
         wpBaseBorder.setOptionsHeader(true);
         wpBaseBorder.setSideBorderValid(BorderAndShadingConstants.TOP,true);
         wpBaseBorder.setOptionTop(2);
         wpBaseBorder.setBorderType(BorderAndShadingConstants.BORDERTYPE_THREED);
         doc.setBorder(wpBaseBorder);
         boolean isOptionsHeader = wpBaseBorder.isOptionsHeader();
         System.out.println("返回是否环绕页眉：" + isOptionsHeader);

### setOptionBottom

    public void setOptionBottom(int bottom)

  设置页面边框与页面下边距或纸张下边缘之间的距离。

  Parameters:
    `bottom` - 页面边框与页面下边距或纸张下边缘之间的距离（以磅为单位）

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveDocument();
         WpBaseBorderAttribute wpBaseBorder = new WpBaseBorderAttribute();
         wpBaseBorder.setBordersApplyType(BorderAndShadingConstants.APPLY_PAGE);
         wpBaseBorder.setSideBorderValid(BorderAndShadingConstants.BOTTOM,true);
         wpBaseBorder.setOptionBottom(2);
         wpBaseBorder.setBorderType(BorderAndShadingConstants.BORDERTYPE_THREED);
         doc.setBorder(wpBaseBorder);

  See Also:
    `getOptionBottom()`, `setOptionTop(int)`, `setOptionRight(int)`, `setOptionLeft(int)`, `BaseBorderAttribute`

### setOptionFromIndex

    public void setOptionFromIndex(int ind)

  设置边框的度量依据（即设置的距离是页边距与边框之间的距离，还是纸张边缘与边框之间的距离）。

  Parameters:
    `ind` - 度量依据，只能取以下两个整形值之一：

                0 - 表示设置的距离是页边距与边框之间的距离
                1 - 表示示设置的距离是纸张边缘与边框之间的距离

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveDocument();
         WpBaseBorderAttribute wpBaseBorder = new WpBaseBorderAttribute();
         wpBaseBorder.setBordersApplyType(BorderAndShadingConstants.APPLY_PAGE);
         wpBaseBorder.setSideBorderValid(BorderAndShadingConstants.RIGHT,true);
         wpBaseBorder.setOptionRight(2);
         wpBaseBorder.setBorderType(BorderAndShadingConstants.BORDERTYPE_THREED);
         wpBaseBorder.setOptionFromIndex(0);
         doc.setBorder(wpBaseBorder);

### setOptionLeft

    public void setOptionLeft(int left)

  设置页面边框与页面左边距或纸张左边缘之间的距离

  Parameters:
    `left` - 页面边框与页面左边距或纸张左边缘之间的距离（以磅为单位）

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveDocument();
         WpBaseBorderAttribute wpBaseBorder = new WpBaseBorderAttribute();
         wpBaseBorder.setBordersApplyType(BorderAndShadingConstants.APPLY_PAGE);
         wpBaseBorder.setSideBorderValid(BorderAndShadingConstants.LEFT,true);
         wpBaseBorder.setOptionLeft(2);
         wpBaseBorder.setBorderType(BorderAndShadingConstants.BORDERTYPE_THREED);
         doc.setBorder(wpBaseBorder);

  See Also:
    `getOptionLeft()`, `setOptionTop(int)`, `setOptionRight(int)`, `setOptionBottom(int)`, `BaseBorderAttribute`

### setOptionRight

    public void setOptionRight(int right)

  设置页面边框与页面右边距或纸张右边缘之间的距离。

  See Also:
    `getOptionRight()`, `setOptionTop(int)`, `setOptionBottom(int)`, `setOptionLeft(int)`, `BaseBorderAttribute`

### setOptionsFooter

    public void setOptionsFooter(boolean flag)

  将页脚包含在页面边框之内。（即设置“环绕页脚”）
  注：必须设置当前的度量依据为正文，边框属性才能设置环绕页眉页脚。 环绕页脚就是使边框的下边距为边框与页脚底边之间的距离。

  Parameters:
    `flag` - 布尔型，如为true，将页脚包含在页面边框之内；否则，页脚不包含在页面边框之内

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveDocument();
         WpBaseBorderAttribute wpBaseBorder = new WpBaseBorderAttribute();
         wpBaseBorder.setBordersApplyType(BorderAndShadingConstants.APPLY_PAGE);
         wpBaseBorder.setOptionFromIndex(0);
         wpBaseBorder.setOptionsFooter(true);
         wpBaseBorder.setSideBorderValid(BorderAndShadingConstants.BOTTOM,true);
         wpBaseBorder.setOptionBottom(2);
         wpBaseBorder.setBorderType(BorderAndShadingConstants.BORDERTYPE_THREED);
         doc.setBorder(wpBaseBorder);

### setOptionsHeader

    public void setOptionsHeader(boolean flag)

  将页眉包含在页面边框之内。（即设置“环绕页眉”）
  注：必须设置当前的度量依据为正文，边框属性才能设置环绕页眉页脚。 环绕页眉就是使边框的上边距为边框与页眉顶边之间的距离。）

  Parameters:
    `flag` - 布尔型值，如为true，表示将页眉包含在页面边框之内；否则，页眉不包含在页面边框之内

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveDocument();
         WpBaseBorderAttribute wpBaseBorder = new WpBaseBorderAttribute();
         wpBaseBorder.setBordersApplyType(BorderAndShadingConstants.APPLY_PAGE);
         wpBaseBorder.setOptionFromIndex(0);
         wpBaseBorder.setOptionsHeader(true);
         wpBaseBorder.setSideBorderValid(BorderAndShadingConstants.TOP,true);
         wpBaseBorder.setOptionTop(2);
         wpBaseBorder.setBorderType(BorderAndShadingConstants.BORDERTYPE_THREED);
         doc.setBorder(wpBaseBorder);

### setOptionTop

    public void setOptionTop(int top)

  设置页面边框与页面上边距或纸张上边缘之间的距离。

  Parameters:
    `top` - 页面边框与页面上边距或纸张上边缘之间的距离（以磅为单位）

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveDocument();
         WpBaseBorderAttribute wpBaseBorder = new WpBaseBorderAttribute();
         wpBaseBorder.setBordersApplyType(BorderAndShadingConstants.APPLY_PAGE);
         wpBaseBorder.setSideBorderValid(BorderAndShadingConstants.TOP,true);
         wpBaseBorder.setOptionTop(2);
         wpBaseBorder.setBorderType(BorderAndShadingConstants.BORDERTYPE_THREED);
         doc.setBorder(wpBaseBorder);

  See Also:
    `getOptionTop()`, `setOptionLeft(int)`, `setOptionRight(int)`, `setOptionBottom(int)`, `BaseBorderAttribute`

Overview | Package | Class | Tree | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

版权所有 2001-2004 无锡永中科技有限公司