com.aspose.words

Class TextureIndex

  • java.lang.Object
    • com.aspose.words.TextureIndex
public class TextureIndex 
extends java.lang.Object

Utility class containing constants. Specifies shading texture.

Example:

Shows how to apply a outline border to a table.
Document doc = new Document(getMyDir() + "Table.EmptyTable.doc");
Table table = (Table) doc.getChild(NodeType.TABLE, 0, true);

// Align the table to the center of the page.
table.setAlignment(TableAlignment.CENTER);

// Clear any existing borders from the table.
table.clearBorders();

// Set a green border around the table but not inside.
table.setBorder(BorderType.LEFT, LineStyle.SINGLE, 1.5, Color.GREEN, true);
table.setBorder(BorderType.RIGHT, LineStyle.SINGLE, 1.5, Color.GREEN, true);
table.setBorder(BorderType.TOP, LineStyle.SINGLE, 1.5, Color.GREEN, true);
table.setBorder(BorderType.BOTTOM, LineStyle.SINGLE, 1.5, Color.GREEN, true);

// Fill the cells with a light green solid color.
table.setShading(TextureIndex.TEXTURE_SOLID, Color.GREEN, Color.GREEN);

doc.save(getMyDir() + "\\Artifacts\\Table.SetOutlineBorders.doc");

Example:

Shows how to apply borders and shading to a paragraph.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Set paragraph borders
BorderCollection borders = builder.getParagraphFormat().getBorders();
borders.setDistanceFromText(20);
borders.getByBorderType(BorderType.LEFT).setLineStyle(LineStyle.DOUBLE);
borders.getByBorderType(BorderType.RIGHT).setLineStyle(LineStyle.DOUBLE);
borders.getByBorderType(BorderType.TOP).setLineStyle(LineStyle.DOUBLE);
borders.getByBorderType(BorderType.BOTTOM).setLineStyle(LineStyle.DOUBLE);

// Set paragraph shading
Shading shading = builder.getParagraphFormat().getShading();
shading.setTexture(TextureIndex.TEXTURE_DIAGONAL_CROSS);
shading.setBackgroundPatternColor(new Color(240, 128, 128));  // Light Coral
shading.setForegroundPatternColor(new Color(255, 160, 122));  // Light Salmon

builder.write("I'm a formatted paragraph with double border and nice shading.");

Field Summary
static final intTEXTURE_10_PERCENT = 3
static final intTEXTURE_12_PT_5_PERCENT = 37
static final intTEXTURE_15_PERCENT = 38
static final intTEXTURE_17_PT_5_PERCENT = 39
static final intTEXTURE_20_PERCENT = 4
static final intTEXTURE_22_PT_5_PERCENT = 40
static final intTEXTURE_25_PERCENT = 5
static final intTEXTURE_27_PT_5_PERCENT = 41
static final intTEXTURE_2_PT_5_PERCENT = 35
static final intTEXTURE_30_PERCENT = 6
static final intTEXTURE_32_PT_5_PERCENT = 42
static final intTEXTURE_35_PERCENT = 43
static final intTEXTURE_37_PT_5_PERCENT = 44
static final intTEXTURE_40_PERCENT = 7
static final intTEXTURE_42_PT_5_PERCENT = 45
static final intTEXTURE_45_PERCENT = 46
static final intTEXTURE_47_PT_5_PERCENT = 47
static final intTEXTURE_50_PERCENT = 8
static final intTEXTURE_52_PT_5_PERCENT = 48
static final intTEXTURE_55_PERCENT = 49
static final intTEXTURE_57_PT_5_PERCENT = 50
static final intTEXTURE_5_PERCENT = 2
static final intTEXTURE_60_PERCENT = 9
static final intTEXTURE_62_PT_5_PERCENT = 51
static final intTEXTURE_65_PERCENT = 52
static final intTEXTURE_67_PT_5_PERCENT = 53
static final intTEXTURE_70_PERCENT = 10
static final intTEXTURE_72_PT_5_PERCENT = 54
static final intTEXTURE_75_PERCENT = 11
static final intTEXTURE_77_PT_5_PERCENT = 55
static final intTEXTURE_7_PT_5_PERCENT = 36
static final intTEXTURE_80_PERCENT = 12
static final intTEXTURE_82_PT_5_PERCENT = 56
static final intTEXTURE_85_PERCENT = 57
static final intTEXTURE_87_PT_5_PERCENT = 58
static final intTEXTURE_90_PERCENT = 13
static final intTEXTURE_92_PT_5_PERCENT = 59
static final intTEXTURE_95_PERCENT = 60
static final intTEXTURE_97_PT_5_PERCENT = 61
static final intTEXTURE_CROSS = 24
static final intTEXTURE_DARK_CROSS = 18
static final intTEXTURE_DARK_DIAGONAL_CROSS = 19
static final intTEXTURE_DARK_DIAGONAL_DOWN = 16
static final intTEXTURE_DARK_DIAGONAL_UP = 17
static final intTEXTURE_DARK_HORIZONTAL = 14
static final intTEXTURE_DARK_VERTICAL = 15
static final intTEXTURE_DIAGONAL_CROSS = 25
static final intTEXTURE_DIAGONAL_DOWN = 22
static final intTEXTURE_DIAGONAL_UP = 23
static final intTEXTURE_HORIZONTAL = 20
static final intTEXTURE_NONE = 0
static final intTEXTURE_SOLID = 1
static final intTEXTURE_VERTICAL = 21
static final intTEXTURE_NIL = 65535
Specifies that there shall be no pattern used on the current shaded region (i.e. the pattern shall be a complete fill with the background color).
 

    • Field Detail

      • TEXTURE_10_PERCENT = 3

        public static final int TEXTURE_10_PERCENT
      • TEXTURE_12_PT_5_PERCENT = 37

        public static final int TEXTURE_12_PT_5_PERCENT
      • TEXTURE_15_PERCENT = 38

        public static final int TEXTURE_15_PERCENT
      • TEXTURE_17_PT_5_PERCENT = 39

        public static final int TEXTURE_17_PT_5_PERCENT
      • TEXTURE_20_PERCENT = 4

        public static final int TEXTURE_20_PERCENT
      • TEXTURE_22_PT_5_PERCENT = 40

        public static final int TEXTURE_22_PT_5_PERCENT
      • TEXTURE_25_PERCENT = 5

        public static final int TEXTURE_25_PERCENT
      • TEXTURE_27_PT_5_PERCENT = 41

        public static final int TEXTURE_27_PT_5_PERCENT
      • TEXTURE_2_PT_5_PERCENT = 35

        public static final int TEXTURE_2_PT_5_PERCENT
      • TEXTURE_30_PERCENT = 6

        public static final int TEXTURE_30_PERCENT
      • TEXTURE_32_PT_5_PERCENT = 42

        public static final int TEXTURE_32_PT_5_PERCENT
      • TEXTURE_35_PERCENT = 43

        public static final int TEXTURE_35_PERCENT
      • TEXTURE_37_PT_5_PERCENT = 44

        public static final int TEXTURE_37_PT_5_PERCENT
      • TEXTURE_40_PERCENT = 7

        public static final int TEXTURE_40_PERCENT
      • TEXTURE_42_PT_5_PERCENT = 45

        public static final int TEXTURE_42_PT_5_PERCENT
      • TEXTURE_45_PERCENT = 46

        public static final int TEXTURE_45_PERCENT
      • TEXTURE_47_PT_5_PERCENT = 47

        public static final int TEXTURE_47_PT_5_PERCENT
      • TEXTURE_50_PERCENT = 8

        public static final int TEXTURE_50_PERCENT
      • TEXTURE_52_PT_5_PERCENT = 48

        public static final int TEXTURE_52_PT_5_PERCENT
      • TEXTURE_55_PERCENT = 49

        public static final int TEXTURE_55_PERCENT
      • TEXTURE_57_PT_5_PERCENT = 50

        public static final int TEXTURE_57_PT_5_PERCENT
      • TEXTURE_5_PERCENT = 2

        public static final int TEXTURE_5_PERCENT
      • TEXTURE_60_PERCENT = 9

        public static final int TEXTURE_60_PERCENT
      • TEXTURE_62_PT_5_PERCENT = 51

        public static final int TEXTURE_62_PT_5_PERCENT
      • TEXTURE_65_PERCENT = 52

        public static final int TEXTURE_65_PERCENT
      • TEXTURE_67_PT_5_PERCENT = 53

        public static final int TEXTURE_67_PT_5_PERCENT
      • TEXTURE_70_PERCENT = 10

        public static final int TEXTURE_70_PERCENT
      • TEXTURE_72_PT_5_PERCENT = 54

        public static final int TEXTURE_72_PT_5_PERCENT
      • TEXTURE_75_PERCENT = 11

        public static final int TEXTURE_75_PERCENT
      • TEXTURE_77_PT_5_PERCENT = 55

        public static final int TEXTURE_77_PT_5_PERCENT
      • TEXTURE_7_PT_5_PERCENT = 36

        public static final int TEXTURE_7_PT_5_PERCENT
      • TEXTURE_80_PERCENT = 12

        public static final int TEXTURE_80_PERCENT
      • TEXTURE_82_PT_5_PERCENT = 56

        public static final int TEXTURE_82_PT_5_PERCENT
      • TEXTURE_85_PERCENT = 57

        public static final int TEXTURE_85_PERCENT
      • TEXTURE_87_PT_5_PERCENT = 58

        public static final int TEXTURE_87_PT_5_PERCENT
      • TEXTURE_90_PERCENT = 13

        public static final int TEXTURE_90_PERCENT
      • TEXTURE_92_PT_5_PERCENT = 59

        public static final int TEXTURE_92_PT_5_PERCENT
      • TEXTURE_95_PERCENT = 60

        public static final int TEXTURE_95_PERCENT
      • TEXTURE_97_PT_5_PERCENT = 61

        public static final int TEXTURE_97_PT_5_PERCENT
      • TEXTURE_CROSS = 24

        public static final int TEXTURE_CROSS
      • TEXTURE_DARK_CROSS = 18

        public static final int TEXTURE_DARK_CROSS
      • TEXTURE_DARK_DIAGONAL_CROSS = 19

        public static final int TEXTURE_DARK_DIAGONAL_CROSS
      • TEXTURE_DARK_DIAGONAL_DOWN = 16

        public static final int TEXTURE_DARK_DIAGONAL_DOWN
      • TEXTURE_DARK_DIAGONAL_UP = 17

        public static final int TEXTURE_DARK_DIAGONAL_UP
      • TEXTURE_DARK_HORIZONTAL = 14

        public static final int TEXTURE_DARK_HORIZONTAL
      • TEXTURE_DARK_VERTICAL = 15

        public static final int TEXTURE_DARK_VERTICAL
      • TEXTURE_DIAGONAL_CROSS = 25

        public static final int TEXTURE_DIAGONAL_CROSS
      • TEXTURE_DIAGONAL_DOWN = 22

        public static final int TEXTURE_DIAGONAL_DOWN
      • TEXTURE_DIAGONAL_UP = 23

        public static final int TEXTURE_DIAGONAL_UP
      • TEXTURE_HORIZONTAL = 20

        public static final int TEXTURE_HORIZONTAL
      • TEXTURE_NONE = 0

        public static final int TEXTURE_NONE
      • TEXTURE_SOLID = 1

        public static final int TEXTURE_SOLID
      • TEXTURE_VERTICAL = 21

        public static final int TEXTURE_VERTICAL
      • TEXTURE_NIL = 65535

        public static final int TEXTURE_NIL
        Specifies that there shall be no pattern used on the current shaded region (i.e. the pattern shall be a complete fill with the background color).