enable.base module

Define a base set of constants and functions used by the remainder of the Enable package.

class enable.base.IDroppedOnHandler[source]

Bases: object

Interface for draggable objects that handle the ‘dropped_on’ event

was_dropped_on(component, event)[source]
enable.base.add_rectangles(rectangle1, rectangle2)[source]

Add two bounds or coordinate rectangles

enable.base.bounding_box(components)[source]

Compute the bounding box for a set of components

enable.base.bounding_coordinates(coordinates_list)[source]

Return the bounding rectangle for a list of rectangles

enable.base.bounds_to_coordinates(bounds)[source]

Convert a bounds rectangle to a coordinate rectangle

enable.base.coordinates_to_bounds(coordinates)[source]

Convert a coordinates rectangle to a bounds rectangle

enable.base.coordinates_to_size(coordinates)[source]

Convert a coordinates rectangle to a size tuple

enable.base.does_disjoint_intersect_coordinates(coordinates_list, coordinates)[source]

Return whether a rectangle intersects a disjoint set of rectangles anywhere

enable.base.intersect_bounds(bounds1, bounds2)[source]

Compute the intersection of two bounds rectangles

enable.base.intersect_coordinates(coordinates1, coordinates2)[source]

Compute the intersection of two coordinate based rectangles

enable.base.send_event_to(components, event_name, event)[source]

Send an event to a specified set of components until it is ‘handled’

enable.base.subclasses_of(klass)[source]

Generate all of the classes (and subclasses) for a specified class

enable.base.union_bounds(bounds1, bounds2)[source]

Compute the union of two bounds rectangles

enable.base.union_coordinates(coordinates1, coordinates2)[source]

Compute the union of two coordinate based rectangles

enable.base.xy_in_bounds(x, y, bounds)[source]

Test whether a specified (x,y) point is in a specified bounds