Package Gnumed :: Package timelinelib :: Package canvas :: Package drawing :: Package drawers :: Module default :: Class DefaultDrawingAlgorithm
[frames] | no frames]

Class DefaultDrawingAlgorithm

source code

      object --+    
               |    
interface.Drawer --+
                   |
                  DefaultDrawingAlgorithm

Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
set_event_box_drawer(self, event_box_drawer) source code
 
set_background_drawer(self, background_drawer) source code
 
increment_font_size(self, step=2) source code
 
decrement_font_size(self, step=2) source code
 
event_is_period(self, time_period)
Return True if the event time_period will make the event appear below the center line, as a period event.
source code
 
get_closest_overlapping_event(self, event_to_move, up=True) source code
 
draw(self, dc, timeline, view_properties, appearance, fast_draw=False)
Draw a representation of a timeline.
source code
 
snap(self, time, snap_region=10)
Snap time to minor strip if within snap_region pixels.
source code
 
snap_selection(self, period_selection)
Return a tuple where the selection has been stretched to fit to minor strip.
source code
 
event_at(self, x, y, alt_down=False)
Return the event at pixel coordinate (x, y) or None if no event there.
source code
 
get_events_in_rect(self, rect) source code
 
event_with_rect_at(self, x, y, alt_down=False)
Return the event at pixel coordinate (x, y) and its rect in a tuple (event, rect) or None if no event there.
source code
 
event_rect(self, evt) source code
 
balloon_at(self, x, y) source code
 
get_time(self, x) source code
 
get_hidden_event_count(self) source code
 
get_period_xpos(self, time_period) source code
 
period_is_visible(self, time_period) source code

Inherited from interface.Drawer: event_rect_at, is_balloon_at

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

event_is_period(self, time_period)

source code 

Return True if the event time_period will make the event appear below the center line, as a period event.

Overrides: interface.Drawer.event_is_period
(inherited documentation)

get_closest_overlapping_event(self, event_to_move, up=True)

source code 
Overrides: interface.Drawer.get_closest_overlapping_event

draw(self, dc, timeline, view_properties, appearance, fast_draw=False)

source code 

Draw a representation of a timeline.

The dc is used to do the actual drawing. The timeline is used to get the events to visualize. The view properties contains information like which events are selected in the view we are drawing for and what period is currently displayed.

When the dc is temporarily stored in a class variable such as self.dc, this class variable must be deleted before the draw method ends.

Overrides: interface.Drawer.draw
(inherited documentation)

snap(self, time, snap_region=10)

source code 

Snap time to minor strip if within snap_region pixels.

Overrides: interface.Drawer.snap
(inherited documentation)

snap_selection(self, period_selection)

source code 

Return a tuple where the selection has been stretched to fit to minor strip.

period_selection: (start, end) Return: (new_start, new_end)

Overrides: interface.Drawer.snap_selection
(inherited documentation)

event_at(self, x, y, alt_down=False)

source code 

Return the event at pixel coordinate (x, y) or None if no event there.

Overrides: interface.Drawer.event_at
(inherited documentation)

event_with_rect_at(self, x, y, alt_down=False)

source code 

Return the event at pixel coordinate (x, y) and its rect in a tuple (event, rect) or None if no event there.

Overrides: interface.Drawer.event_with_rect_at
(inherited documentation)