1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
/* ====================================================================
Copyright 2002-2004 Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.hslf.model;
import org.apache.poi.ddf.*;
/**
* Represents a line in a PowerPoint drawing
*
* @author Yegor Kozlov
*/
public class Line extends SimpleShape {
/**
* Solid (continuous) pen
*/
public static final int PEN_SOLID = 1;
/**
* PS_DASH system dash style
*/
public static final int PEN_PS_DASH = 2;
/**
* PS_DOT system dash style
*/
public static final int PEN_DOT = 3;
/**
* PS_DASHDOT system dash style
*/
public static final int PEN_DASHDOT = 4;
/**
* PS_DASHDOTDOT system dash style
*/
public static final int PEN_DASHDOTDOT = 5;
/**
* square dot style
*/
public static final int PEN_DOTGEL = 6;
/**
* dash style
*/
public static final int PEN_DASH = 7;
/**
* long dash style
*/
public static final int PEN_LONGDASHGEL = 8;
/**
* dash short dash
*/
public static final int PEN_DASHDOTGEL = 9;
/**
* long dash short dash
*/
public static final int PEN_LONGDASHDOTGEL = 10;
/**
* long dash short dash short dash
*/
public static final int PEN_LONGDASHDOTDOTGEL = 11;
/**
* Single line (of width lineWidth)
*/
public static final int LINE_SIMPLE = 0;
/**
* Double lines of equal width
*/
public static final int LINE_DOUBLE = 1;
/**
* Double lines, one thick, one thin
*/
public static final int LINE_THICKTHIN = 2;
/**
* Double lines, reverse order
*/
public static final int LINE_THINTHICK = 3;
/**
* Three lines, thin, thick, thin
*/
public static final int LINE_TRIPLE = 4;
protected Line(EscherContainerRecord escherRecord, Shape parent){
super(escherRecord, parent);
}
public Line(Shape parent){
super(null, parent);
_escherContainer = createSpContainer(parent instanceof ShapeGroup);
}
public Line(){
this(null);
}
protected EscherContainerRecord createSpContainer(boolean isChild){
EscherContainerRecord spcont = super.createSpContainer(isChild);
EscherSpRecord spRecord = spcont.getChildById(EscherSpRecord.RECORD_ID);
short type = (ShapeTypes.Line << 4) | 0x2;
spRecord.setOptions(type);
//set default properties for a line
EscherOptRecord opt = (EscherOptRecord)getEscherChild(spcont, EscherOptRecord.RECORD_ID);
//default line properties
setEscherProperty(opt, EscherProperties.GEOMETRY__SHAPEPATH, 4);
setEscherProperty(opt, EscherProperties.GEOMETRY__FILLOK, 0x10000);
setEscherProperty(opt, EscherProperties.FILL__NOFILLHITTEST, 0x100000);
setEscherProperty(opt, EscherProperties.LINESTYLE__COLOR, 0x8000001);
setEscherProperty(opt, EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0xA0008);
setEscherProperty(opt, EscherProperties.SHADOWSTYLE__COLOR, 0x8000002);
return spcont;
}
}
|