Table Of Contents

Previous topic

_diagram

Next topic

_divided

This Page

phoenix_title Diagram

Encapsulates an entire diagram, with methods for drawing. A diagram has an associated ShapeCanvas.

Derived from:
Object

class_hierarchy Inheritance Diagram

Inheritance diagram for class Diagram

Inheritance diagram of Diagram


method_summary Methods Summary

__init__  
AddShape Adds a shape to the diagram. If addAfter is not None, the shape
Clear Clear the specified device context.
DeleteAllShapes Remove and delete all shapes in the diagram.
DrawOutline Draw an outline rectangle on the current device context.
FindShape Return the shape for the given identifier.
GetCanvas Return the shape canvas associated with this diagram.
GetCount Return the number of shapes in the diagram.
GetGridSpacing Return the grid spacing.
GetMouseTolerance Return the tolerance within which a mouse move is ignored.
GetQuickEditMode Return quick edit mode.
GetShapeList Return the internal shape list.
GetSnapToGrid Return snap-to-grid mode.
InsertShape Insert a shape at the front of the shape list.
RecentreAll Make sure all text that should be centred, is centred.
Redraw Draw the shapes in the diagram on the specified device context.
RemoveAllShapes Remove all shapes from the diagram but do not delete the shapes.
RemoveShape Remove the shape from the diagram (non-recursively) but do not
SetCanvas Set the canvas associated with this diagram.
SetGridSpacing Sets grid spacing.
SetMouseTolerance Set the tolerance within which a mouse move is ignored.
SetQuickEditMode Set quick-edit-mode on of off.
SetSnapToGrid Sets snap-to-grid mode.
ShowAll Call Show for each shape in the diagram.
Snap ‘Snaps’ the coordinate to the nearest grid position, if

api Class API



class Diagram(object)

Encapsulates an entire diagram, with methods for drawing. A diagram has an associated ShapeCanvas.

Derived from:
Object

Methods



__init__(self)


AddShape(self, object, addAfter = None)

Adds a shape to the diagram. If addAfter is not None, the shape will be added after addAfter.



Clear(self, dc)

Clear the specified device context.



DeleteAllShapes(self)

Remove and delete all shapes in the diagram.



DrawOutline(self, dc, x1, y1, x2, y2)

Draw an outline rectangle on the current device context.



FindShape(self, id)

Return the shape for the given identifier.



GetCanvas(self)

Return the shape canvas associated with this diagram.



GetCount(self)

Return the number of shapes in the diagram.



GetGridSpacing(self)

Return the grid spacing.



GetMouseTolerance(self)

Return the tolerance within which a mouse move is ignored.



GetQuickEditMode(self)

Return quick edit mode.



GetShapeList(self)

Return the internal shape list.



GetSnapToGrid(self)

Return snap-to-grid mode.



InsertShape(self, object)

Insert a shape at the front of the shape list.



RecentreAll(self, dc)

Make sure all text that should be centred, is centred.



Redraw(self, dc)

Draw the shapes in the diagram on the specified device context.



RemoveAllShapes(self)

Remove all shapes from the diagram but do not delete the shapes.



RemoveShape(self, object)

Remove the shape from the diagram (non-recursively) but do not delete it.



SetCanvas(self, canvas)

Set the canvas associated with this diagram.



SetGridSpacing(self, spacing)

Sets grid spacing.



SetMouseTolerance(self, tolerance)

Set the tolerance within which a mouse move is ignored.

The default is 3 pixels.



SetQuickEditMode(self, mode)

Set quick-edit-mode on of off.

In this mode, refreshes are minimized, but the diagram may need manual refreshing occasionally.



SetSnapToGrid(self, snap)

Sets snap-to-grid mode.



ShowAll(self, show)

Call Show for each shape in the diagram.



Snap(self, x, y)

‘Snaps’ the coordinate to the nearest grid position, if snap-to-grid is on.