Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
ee8bb1e9
Commit
ee8bb1e9
authored
May 17, 2019
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Web: Added GrowSubAnnot.
parent
7325c6de
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
0 deletions
+85
-0
java/jsw/grow/src/grow_subannot.ts
java/jsw/grow/src/grow_subannot.ts
+85
-0
No files found.
java/jsw/grow/src/grow_subannot.ts
0 → 100644
View file @
ee8bb1e9
class
GrowSubAnnot
extends
GlowAnnot
{
trf
:
GlowTransform
;
rect
:
GlowRect
;
n_name
=
null
;
ll_x
:
Number
;
ll_y
:
Number
;
ur_x
:
Number
;
ur_y
:
Number
;
adjustment
:
Adjustment
;
text
:
GlowText
;
constructor
(
ctx
)
{
super
(
ctx
);
this
.
trf
=
new
GlowTransform
();
this
.
rect
=
new
GlowRect
(
ctx
);
this
.
text
=
new
GlowText
(
ctx
);
}
open
(
lines
,
row
)
{
let
i
;
for
(
i
=
row
;
i
<
lines
.
length
;
i
++
)
{
let
tokens
=
lines
[
i
].
split
(
'
'
);
let
key
=
parseInt
(
tokens
[
0
],
10
);
switch
(
key
)
{
case
GlowSave
.
GrowSubAnnot
:
break
;
case
GlowSave
.
GrowSubAnnot_n_name
:
if
(
tokens
.
length
>
1
)
{
this
.
n_name
=
tokens
[
1
];
}
break
;
case
GlowSave
.
GrowSubAnnot_x_right
:
this
.
ur_x
=
parseFloat
(
tokens
[
1
]);
break
;
case
GlowSave
.
GrowSubAnnot_x_left
:
this
.
ll_x
=
parseFloat
(
tokens
[
1
]);
break
;
case
GlowSave
.
GrowSubAnnot_y_high
:
this
.
ur_y
=
parseFloat
(
tokens
[
1
]);
break
;
case
GlowSave
.
GrowSubAnnot_y_low
:
this
.
ll_y
=
parseFloat
(
tokens
[
1
]);
break
;
case
GlowSave
.
GrowSubAnnot_text
:
this
.
text
=
tokens
[
1
];
break
;
case
GlowSave
.
GrowSubAnnot_rect
:
i
=
this
.
rect
.
open
(
lines
,
i
+
1
);
break
;
case
GlowSave
.
GrowSubAnnot_annot_part
:
i
=
super
.
open
(
lines
,
i
+
1
);
break
;
case
GlowSave
.
GrowSubAnnot_trf
:
i
=
this
.
trf
.
open
(
lines
,
i
+
1
);
break
;
case
GlowSave
.
GrowSubAnnot_adjustment
:
this
.
adjustment
=
parseInt
(
tokens
[
1
],
10
);
case
GlowSave
.
End
:
return
i
;
default
:
console
.
log
(
"
Syntax error in GrowSubAnnot
"
);
break
;
}
}
return
i
;
}
event_handler
(
event
,
fx
,
fy
)
{
return
0
;
}
draw
(
t
=
null
,
highlight
=
0
,
hot
=
0
,
node
=
null
,
colornode
=
null
)
{
let
p
=
new
Point
();
if
(
t
)
{
p
=
Matrix
.
multiply
(
this
.
trf
,
t
).
apply
(
this
.
p
);
let
p2
=
this
.
trf
.
apply
(
this
.
p
);
p
.
x
-=
p2
.
x
;
p
.
y
-=
p2
.
y
;
}
this
.
rect
.
draw
(
p
,
highlight
,
hot
);
this
.
text
.
draw
(
p
,
highlight
,
hot
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment