get_z_level()
set_z_level($z)
get_source()
set_source($source)
set_zone($zone)
set_special_scale($scale)
get_scale()
set_background_color($color)
set_foreground_color($color)
get_background_color()
get_foreground_color()
A graphical object is a part of a graphic. It can display itself on a picture.
Each graphic object will have to implement these two functions (methods).
This function is called with the trailing arguments (e,g, $args[2] and up) given to the generic new constructor defined here.
Display the graphic object on the picture using the given driver. It may use $o->{'source'} and $o->{'zone'} (e.g. the graphic objects argument hash $self->{'source'} and $self->{'zone'} to get the data to display and display itself in the correct zone.
The generic new constructor declared and defined here takes the first 2 arguments (e.g. $datasource and $zone) and assigns them to the objects argument hash $self->{'source'} and $self->{'zone'}, respectively, and passes the remaining arguments, if any, to the init method which must be provided by the GT::Graphics::Object::<Something> package.
in addition, the new constructor sets the objects argument hash keys 'bg_color' and 'fg_color' (e.g. $self->{'bg_color'} and $self->{'fg_color'}) to the gt config key-values corresponding with Graphic::BackgroundColor and Graphic::ForegroundColor respectively.
get_z_level()
set_z_level($z)
Those two functions are used to manage the order in which the orders are displayed. An object with a low Z level is drawn first.
get_source()
set_source($source)
set/get the datasource associated to this object.
set_zone($zone)
Set the zone in which the object will be displayed.
set_special_scale($scale)
Use a special scale to draw this object.
get_scale()
Return the associated scale. If it exists, it uses the special scale, otherwise returns the default scale associated to the zone.
set_background_color($color)
Use this color as background color.
set_foreground_color($color)
Use this color as foreground color.
get_background_color()
return the objects background color.
get_foreground_color()
return the objects foreground color.