Graph::Easy::Node::Anon - An anonymous, invisible node in Graph::Easy


Graph-Easy documentation Contained in the Graph-Easy distribution.

Index


Code Index:

NAME

Top

Graph::Easy::Node::Anon - An anonymous, invisible node in Graph::Easy

SYNOPSIS

Top

	use Graph::Easy::Node::Anon;

	my $anon = Graph::Easy::Node::Anon->new();

DESCRIPTION

Top

A Graph::Easy::Node::Anon represents an anonymous, invisible node. These can be used to let edges start and end "nowhere".

The syntax in the Graph::Easy textual description language looks like this:

	[ ] -> [ Bonn ] -> [ ]

EXPORT

Top

None by default.

SEE ALSO

Top

Graph::Easy::Node.

AUTHOR

Top

Copyright (C) 2004 - 2006 by Tels http://bloodgate.com.

See the LICENSE file for more details.


Graph-Easy documentation Contained in the Graph-Easy distribution.

#############################################################################
# (c) by Tels 2004. Part of Graph::Easy. An anonymous (invisible) node.
#
#############################################################################

package Graph::Easy::Node::Anon;

use Graph::Easy::Node;

@ISA = qw/Graph::Easy::Node/;
$VERSION = '0.11';

use strict;

sub _init
  {
  my $self = shift;

  $self->SUPER::_init(@_);

  $self->{name} = '#' . $self->{id};
  $self->{class} = 'node.anon';

  $self->{att}->{label} = ' ';

  $self;
  }

sub _correct_size
  {
  my $self = shift;

  $self->{w} = 3;
  $self->{h} = 3;

  $self;
  }

sub attributes_as_txt
  {
  my $self = shift;

  $self->SUPER::attributes_as_txt( {
     node => {
       label => undef,
       shape => undef,
       class => undef,
       } } );
  }

sub as_pure_txt
  {
  '[ ]';
  }

sub _as_part_txt
  {
  '[ ]';
  }

sub as_txt
  {
  my $self = shift;

  '[ ]' . $self->attributes_as_txt();
  }

sub text_styles_as_css
  {
  '';
  }

sub is_anon
  {
  # is an anon node
  1;
  }

1;
__END__