line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (c) 2007 by Christoph Lamprecht. All rights reserved. |
2
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or |
3
|
|
|
|
|
|
|
# modify it under the same terms as Perl itself. |
4
|
|
|
|
|
|
|
# ch.l.ngre@online.de |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Tk::GraphItems::TiedCoord; |
7
|
4
|
|
|
4
|
|
21
|
use strict; |
|
4
|
|
|
|
|
579
|
|
|
4
|
|
|
|
|
135
|
|
8
|
4
|
|
|
4
|
|
18
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
104
|
|
9
|
4
|
|
|
4
|
|
50
|
use Scalar::Util (qw/weaken/); |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
1074
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.11'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub TIESCALAR{ |
13
|
0
|
|
|
0
|
|
|
my($class,$t_b,$c_in)=@_; |
14
|
0
|
|
|
|
|
|
my $self = bless{TkGNode =>$t_b, |
15
|
|
|
|
|
|
|
coord_index =>$c_in},$class; |
16
|
0
|
|
|
|
|
|
weaken ($self->{TkGNode}); |
17
|
0
|
|
|
|
|
|
$self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub FETCH{ |
21
|
0
|
|
|
0
|
|
|
my $self = shift; |
22
|
0
|
|
|
|
|
|
my $i = $self->{coord_index}; |
23
|
0
|
0
|
|
|
|
|
if ($self->{TkGNode}) { |
24
|
0
|
|
|
|
|
|
return ($self->{TkGNode}->get_coords)[$i]; |
25
|
|
|
|
|
|
|
} |
26
|
0
|
|
0
|
|
|
|
return $self->{cached}[$i]||0; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub STORE{ |
30
|
0
|
|
|
0
|
|
|
my ($self,$value) = @_; |
31
|
0
|
|
|
|
|
|
my $i = $self->{coord_index}; |
32
|
0
|
|
|
|
|
|
my $tb = $self->{TkGNode}; |
33
|
0
|
|
|
|
|
|
$self->{cached}[$i]= $value; |
34
|
0
|
0
|
|
|
|
|
return unless $tb; |
35
|
0
|
|
|
|
|
|
my @coords = $tb->get_coords; |
36
|
0
|
|
|
|
|
|
$coords[$i] = $value; |
37
|
0
|
|
|
|
|
|
$tb->set_coords(@coords); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |