phoenix_title wx.lib.ogl.basic.Shape

The Shape is the base class for OGL shapes.

The Shape is the top-level, abstract object that all other objects are derived from. All common functionality is represented by Shape members, and overridden members that appear in derived classes and have behaviour as documented for Shape, are not documented separately.


class_hierarchy Class Hierarchy

Inheritance diagram for class Shape:

sub_classes Known Subclasses

wx.lib.ogl.basic.EllipseShape, wx.lib.ogl.basic.PolygonShape, wx.lib.ogl.basic.RectangleShape, wx.lib.ogl.lines.LineShape


super_classes Known Superclasses

wx.lib.ogl.basic.ShapeEvtHandler


method_summary Methods Summary

__init__

Default class constructor.

AddLine

Add a line between this shape and the given other shape, at the

AddRegion

Add a region to the shape.

AddText

Add a line of text to the shape’s default text region.

AddToCanvas

Add the shape to the canvas’s shape list.

AncestorSelected

True if the shape’s ancestor is currently selected.

ApplyAttachmentOrdering

Apply the line ordering in linesToSort to the shape, to reorder

AssignNewIds

Assign new ids to this image and its children.

Attach

Set the shape’s internal canvas pointer to point to the given canvas.

AttachmentIsValid

True if attachment is a valid attachment point.

AttachmentSortTest

Return TRUE if pt1 is less than or equal to pt2, in the sense

CalcSimpleAttachment

Assuming the attachment lies along a vertical or horizontal line,

ClearAttachments

Clear internal custom attachment point shapes (of class

ClearRegions

Clear the ShapeRegions from the shape.

ClearText

Clear the text from the specified text region.

Delete

Fully disconnect this shape from parents, children, the

DeleteControlPoints

Delete the control points (or handles) for the shape.

Detach

Disassociates the shape from its canvas.

Draggable

Is shape draggable?

Draw

Draw the whole shape and any lines attached to it.

DrawContents

Draw the internal graphic of the shape (such as text).

DrawLinks

Draws any lines linked to this shape.

Erase

Erase the shape.

EraseContents

Erase the shape contents, that is, the area within the shape’s

EraseLinks

Erase links attached to this shape, but do not repair damage

FindRegion

Find the actual image (‘this’ if non-composite) and region id

FindRegionNames

Get a list of all region names for this image (composite or simple).

Flash

Flash the shape.

FormatText

Reformat the given text region; defaults to formatting the

GetAttachmentLineCount

Get the number of lines at this attachment position.

GetAttachmentMode

Get the attachment mode.

GetAttachmentPosition

Get the position at which the given attachment point should be drawn.

GetAttachmentPositionEdge

Only get the attachment position at the _edge_ of the shape,

GetBackgroundBrush

Return brush of the right colour for the background.

GetBackgroundPen

Return pen of the right colour for the background.

GetBoundingBoxMax

Get the maximum bounding box for the shape, taking into account

GetBoundingBoxMin

Get the minimum bounding box for the shape, that defines the area

GetBranchingAttachmentInfo

Get information about where branching connections go.

GetBranchingAttachmentPoint

Get branching attachment point.

GetBranchingAttachmentRoot

Get the root point at the given attachment.

GetBranchStyle

Get the branch style.

GetBrush

Get the brush used for filling the shape.

GetCanvas

Get the internal canvas.

GetCentreResize

True if the shape is to be resized from the centre (the centre stands

GetChildren

Get the list of children for this shape.

GetClassName

GetDisableLabel

True if the default region will not be shown, False otherwise.

GetDrawHandles

Get the list of drawhandles.

GetEventHandler

Get the event handler for this shape.

GetFixedHeight

True if the shape cannot be resized in the vertical plane.

GetFixedSize

Return flags indicating whether the shape is of fixed size in

GetFixedWidth

True if the shape cannot be resized in the horizontal plane.

GetFont

Get the font for the specified text region.

GetFormatMode

Get the format mode.

GetId

Get the integer identifier for this shape.

GetLinePosition

Get the zero-based position of line in the list of lines

GetLines

Return the list of lines connected to this shape.

GetMaintainAspectRatio

True if shape keeps aspect ratio during resize.

GetNumberOfAttachments

Get the number of attachment points for this shape.

GetNumberOfTextRegions

Get the number of text regions for this shape.

GetParent

Get the parent of this shape, if it is part of a composite.

GetPen

Get the pen used for drawing the shape’s outline.

GetPerimeterPoint

Get the point at which the line from (x1, y1) to (x2, y2) hits

GetRegionId

Get the region’s identifier by name.

GetRegionName

Get the region’s name.

GetRegions

Get the list of ShapeRegions.

GetRotation

Return the angle of rotation in radians.

GetSensitivityFilter

Get the sensitivity filter, a bitlist of values.

GetShadowMode

Get the current shadow mode setting.

GetSpaceAttachments

Get whether lines should be spaced out evenly at the point they

GetTextColour

Get the colour for the specified text region.

GetTopAncestor

Return the top-most ancestor of this shape (the root of

GetX

Get the x position of the centre of the shape.

GetY

Get the y position of the centre of the shape.

HasDescendant

Is image a descendant of this composite.

HitTest

Given a point on a canvas, returns True if the point was on the

InsertInCanvas

Insert the shape at the front of the shape list of canvas.

IsHighlighted

True if the shape is highlighted. Shape highlighting is unimplemented.

IsShown

True if the shape is in a visible state, False otherwise.

LogicalToPhysicalAttachment

Rotate the standard attachment point from logical

MakeControlPoints

Make a list of control points (draggable handles) appropriate to

MakeMandatoryControlPoints

Make the mandatory control points.

Move

Move the shape to the given position.

MoveLineToNewAttachment

Move the given line (which must already be attached to the shape)

MoveLinks

Redraw all the lines attached to the shape.

NameRegions

Make unique names for all the regions in a shape or composite shape.

OnBeginDragLeft

The begin drag left handler.

OnBeginDragRight

The begin drag right handler.

OnChangeAttachment

Change attachment handler.

OnDragLeft

The drag left handler.

OnDragRight

The drag right handler.

OnDraw

not implemented???

OnDrawBranches

The draw branches handler.

OnDrawBranchesAttachment

The draw branches attachment handler.

OnDrawContents

The draw contents handler.

OnDrawControlPoints

The draw control points handler.

OnDrawOutline

The draw outline handler.

OnEndDragLeft

The end drag left handler.

OnEndDragRight

The end drag right handler.

OnErase

The erase handler.

OnEraseContents

The erase contents handler.

OnEraseControlPoints

The erase control points handler.

OnHighlight

not implemented???

OnLeftClick

The left click handler.

OnMoveLinks

The move links handler.

OnMovePre

The pre move handler.

OnRightClick

The right click handler.

OnSize

not implemented???

OnSizingBeginDragLeft

The sizing begin drag left handler.

OnSizingDragLeft

The sizing drag left handler.

OnSizingEndDragLeft

The sizing end drag left handler.

PhysicalToLogicalAttachment

Rotate the standard attachment point from physical

Recentre

Recentre (or other formatting) all the text regions for this shape.

Recompute

Recomputes any constraints associated with the shape.

RemoveFromCanvas

Remove the shape from the canvas.

RemoveLine

Remove the given line from the shape’s list of attached lines.

ResetControlPoints

Reset the positions of the control points (for instance when the

ResetMandatoryControlPoints

Reset the mandatory control points.

Rotate

Rotate about the given axis by the given amount in radians.

Select

Select or deselect the given shape, drawing or erasing control points

Selected

True if the shape is currently selected.

SetAttachmentMode

Set the attachment mode.

SetAttachmentSize

Set the attachment size.

SetBrush

Set the brush for filling the shape’s shape.

SetCanvas

Set the canvas, identical to Shape.Attach.

SetCentreResize

Specify whether the shape is to be resized from the centre (the

SetDefaultRegionSize

Set the default region to be consistent with the shape size.

SetDisableLabel

Set flag to True to stop the default region being shown.

SetDraggable

Set the shape to be draggable or not draggable.

SetDrawHandles

Set the drawHandles flag for this shape and all descendants.

SetEventHandler

Set the event handler for this shape.

SetFixedSize

Set the shape to be fixed size.

SetFont

Set the font for the specified text region.

SetFormatMode

Set the format mode of the region.

SetHighlight

Set the highlight for a shape. Shape highlighting is unimplemented.

SetId

Set the integer identifier for this shape.

SetMaintainAspectRatio

Set whether a shape that resizes should not change the aspect ratio

SetParent

Set the parent

SetPen

Set the pen for drawing the shape’s outline.

SetRegionName

Set the name for this region.

SetRotation

Set rotation

SetSensitivityFilter

Set the shape to be sensitive or insensitive to specific mouse

SetShadowMode

Set the shadow mode (whether a shadow is drawn or not).

SetShape

Set shape ???

SetSize

Set the shape’s size.

SetSpaceAttachments

Indicate whether lines should be spaced out evenly at the point

SetTextColour

Set the colour for the specified text region.

SetX

Set the x position of the shape.

SetY

Set the y position of the shape.

Show

Set a flag indicating whether the shape should be drawn.

SortLines

Reorder the lines coming into the node image at this attachment


api Class API

class Shape(ShapeEvtHandler)

The Shape is the base class for OGL shapes.

The Shape is the top-level, abstract object that all other objects are derived from. All common functionality is represented by Shape members, and overridden members that appear in derived classes and have behaviour as documented for Shape, are not documented separately.


Methods

__init__(self, canvas = None)

Default class constructor.

Parameters:

canvas – an instance of Canvas



AddLine(self, line, other, attachFrom = 0, attachTo = 0, positionFrom = -1, positionTo = -1)

Add a line between this shape and the given other shape, at the specified attachment points.

Parameters:
  • line – the line an instance of LineShape

  • other – the other shape, an instance of Shape

  • attachFrom – the attachment from point ???

  • attachTo – the attachment to point ???

  • positionFrom – the from position

  • positionTo – the to position

Note

The position in the list of lines at each end can also be specified, so that the line will be drawn at a particular point on its attachment point.



AddRegion(self, region)

Add a region to the shape.



AddText(self, string)

Add a line of text to the shape’s default text region.



AddToCanvas(self, theCanvas, addAfter = None)

Add the shape to the canvas’s shape list.

Parameters:
  • theCanvas – an instance of Canvas

  • addAfter – if not None, will add the shape after this shape



AncestorSelected(self)

True if the shape’s ancestor is currently selected.



ApplyAttachmentOrdering(self, linesToSort)

Apply the line ordering in linesToSort to the shape, to reorder the way lines are attached.



AssignNewIds(self)

Assign new ids to this image and its children.



Attach(self, can)

Set the shape’s internal canvas pointer to point to the given canvas.



AttachmentIsValid(self, attachment)

True if attachment is a valid attachment point.



AttachmentSortTest(self, attachmentPoint, pt1, pt2)

Return TRUE if pt1 is less than or equal to pt2, in the sense that one point comes before another on an edge of the shape.

attachment is the attachment point (side) in question.

This function is used in Shape.MoveLineToNewAttachment to determine the new line ordering.



CalcSimpleAttachment(self, pt1, pt2, nth, noArcs, line)

Assuming the attachment lies along a vertical or horizontal line, calculate the position on that point.

Parameters:
  • pt1 – The first point of the line representing the edge of the shape

  • pt2 – The second point of the line representing the edge of the shape

  • nth – The position on the edge (for example there may be 6 lines at this attachment point, and this may be the 2nd line.

  • noArcs – The number of lines at this edge.

  • line – The line shape.

Note

This function expects the line to be either vertical or horizontal, and determines which.



ClearAttachments(self)

Clear internal custom attachment point shapes (of class AttachmentPoint)



ClearRegions(self)

Clear the ShapeRegions from the shape.



ClearText(self, regionId = 0)

Clear the text from the specified text region.

Parameters:

regionId – the region identifier



Delete(self)

Fully disconnect this shape from parents, children, the canvas, etc.



DeleteControlPoints(self, dc = None)

Delete the control points (or handles) for the shape.

Does not redraw the shape.



Detach(self)

Disassociates the shape from its canvas.



Draggable(self)

Is shape draggable?

Returns:

True if the shape may be dragged by the user.



Draw(self, dc)

Draw the whole shape and any lines attached to it.

Do not override this function: override OnDraw, which is called by this function.



DrawContents(self, dc)

Draw the internal graphic of the shape (such as text).

Do not override this function: override OnDrawContents, which is called by this function.



Draws any lines linked to this shape.

Parameters:
  • dc – the device context

  • attachment – ???

  • recurse – if True recurse through the children



Erase(self, dc)

Erase the shape.

Does not repair damage caused to other shapes.



EraseContents(self, dc)

Erase the shape contents, that is, the area within the shape’s minimum bounding box.



Erase links attached to this shape, but do not repair damage caused to other shapes.

Parameters:
  • dc – the device context

  • attachment – ???

  • recurse – if True recurse through the children



FindRegion(self, name)

Find the actual image (‘this’ if non-composite) and region id for the given region name.

Parameters:

name (str) – the region name



FindRegionNames(self)

Get a list of all region names for this image (composite or simple).



Flash(self)

Flash the shape.



FormatText(self, dc, s, i = 0)

Reformat the given text region; defaults to formatting the default region.

Parameters:
  • dc – the device contexr

  • s (str) – the text string

  • i (int) – the region identifier



GetAttachmentLineCount(self, attachment)

Get the number of lines at this attachment position.

Parameters:

attachment – ???

Returns:

the count of lines at this position



GetAttachmentMode(self)

Get the attachment mode.

See Shape.SetAttachmentMode



GetAttachmentPosition(self, attachment, nth = 0, no_arcs = 1, line = None)

Get the position at which the given attachment point should be drawn.

Parameters:
  • attachment – the attachment ???

  • nth – get nth attachment ???

  • no_arcs – ???

  • line – ???

If attachment isn’t found among the attachment points of the shape, returns None.



GetAttachmentPositionEdge(self, attachment, nth = 0, no_arcs = 1, line = None)

Only get the attachment position at the _edge_ of the shape, ignoring branching mode. This is used e.g. to indicate the edge of interest, not the point on the attachment branch.

Parameters:
  • attachment – the attachment ???

  • nth – get nth attachment ???

  • no_arcs – ???

  • line – ???



GetBackgroundBrush(self)

Return brush of the right colour for the background.



GetBackgroundPen(self)

Return pen of the right colour for the background.



GetBoundingBoxMax(self)

Get the maximum bounding box for the shape, taking into account external features such as shadows.



GetBoundingBoxMin(self)

Get the minimum bounding box for the shape, that defines the area available for drawing the contents (such as text).

Must be overridden.



GetBranchingAttachmentInfo(self, attachment)

Get information about where branching connections go.

Parameters:

attachment – ???

Returns:

False if there are no lines at this attachment.



GetBranchingAttachmentPoint(self, attachment, n)

Get branching attachment point.

Parameters:
  • attachment – ???

  • n – ???



GetBranchingAttachmentRoot(self, attachment)

Get the root point at the given attachment.

Parameters:

attachment – ???



GetBranchStyle(self)

Get the branch style.



GetBrush(self)

Get the brush used for filling the shape.



GetCanvas(self)

Get the internal canvas.



GetCentreResize(self)

True if the shape is to be resized from the centre (the centre stands still), or False if from the corner or side being dragged (the other corner or side stands still)



GetChildren(self)

Get the list of children for this shape.



GetClassName(self)


GetDisableLabel(self)

True if the default region will not be shown, False otherwise.



GetDrawHandles(self)

Get the list of drawhandles.



GetEventHandler(self)

Get the event handler for this shape.



GetFixedHeight(self)

True if the shape cannot be resized in the vertical plane.



GetFixedSize(self)

Return flags indicating whether the shape is of fixed size in either direction.



GetFixedWidth(self)

True if the shape cannot be resized in the horizontal plane.



GetFont(self, regionId = 0)

Get the font for the specified text region.

Parameters:

regionId – the region identifier



GetFormatMode(self, regionId = 0)

Get the format mode.

Parameters:

regionId – the region identifier, default=0



GetId(self)

Get the integer identifier for this shape.



GetLinePosition(self, line)

Get the zero-based position of line in the list of lines for this shape.

Parameters:

line – line to find position for



GetLines(self)

Return the list of lines connected to this shape.



GetMaintainAspectRatio(self)

True if shape keeps aspect ratio during resize.



GetNumberOfAttachments(self)

Get the number of attachment points for this shape.



GetNumberOfTextRegions(self)

Get the number of text regions for this shape.



GetParent(self)

Get the parent of this shape, if it is part of a composite.



GetPen(self)

Get the pen used for drawing the shape’s outline.



GetPerimeterPoint(self, x1, y1, x2, y2)

Get the point at which the line from (x1, y1) to (x2, y2) hits the shape.

Parameters:
  • x1 – the x1 position

  • y1 – the y1 position

  • x2 – the x2 position

  • y2 – the y2 position

Returns:

False if the line doesn’t hit the perimeter.



GetRegionId(self, name)

Get the region’s identifier by name.

Parameters:

name (str) – the regions name

Note

This is not unique for within an entire composite, but is unique for the image.



GetRegionName(self, regionId = 0)

Get the region’s name.

Parameters:

regionId – the region identifier

Note

A region’s name can be used to uniquely determine a region within an entire composite image hierarchy. .. seealso:: SetRegionName.



GetRegions(self)

Get the list of ShapeRegions.



GetRotation(self)

Return the angle of rotation in radians.



GetSensitivityFilter(self)

Get the sensitivity filter, a bitlist of values.

See Shape.SetSensitivityFilter



GetShadowMode(self)

Get the current shadow mode setting.



GetSpaceAttachments(self)

Get whether lines should be spaced out evenly at the point they touch the node (True), or whether they should join at a single point (False).



GetTextColour(self, regionId = 0)

Get the colour for the specified text region.

Parameters:

regionId – the region identifier



GetTopAncestor(self)

Return the top-most ancestor of this shape (the root of the composite).



GetX(self)

Get the x position of the centre of the shape.



GetY(self)

Get the y position of the centre of the shape.



HasDescendant(self, image)

Is image a descendant of this composite.

Parameters:

image – the image, is this a shape???

Returns:

True if it is a descendant



HitTest(self, x, y)

Given a point on a canvas, returns True if the point was on the shape, and returns the nearest attachment point and distance from the given point and target.

Parameters:
  • x – the x position

  • y – the y position



InsertInCanvas(self, theCanvas)

Insert the shape at the front of the shape list of canvas.

Parameters:

theCanvas – an instance of Canvas



IsHighlighted(self)

True if the shape is highlighted. Shape highlighting is unimplemented.



IsShown(self)

True if the shape is in a visible state, False otherwise.

Note

That this has nothing to do with whether the window is hidden or the shape has scrolled off the canvas; it refers to the internal visibility flag.



LogicalToPhysicalAttachment(self, logicalAttachment)

Rotate the standard attachment point from logical to physical (0 is always North).

Parameters:

logicalAttachment – ???



MakeControlPoints(self)

Make a list of control points (draggable handles) appropriate to the shape.



MakeMandatoryControlPoints(self)

Make the mandatory control points.

For example, the control point on a dividing line should appear even if the divided rectangle shape’s handles should not appear (because it is the child of a composite, and children are not resizable).



Move(self, dc, x, y, display = True)

Move the shape to the given position.

Parameters:
  • dc – the device context

  • x – the x position

  • y – the y position

  • display – if True redraw



MoveLineToNewAttachment(self, dc, to_move, x, y)

Move the given line (which must already be attached to the shape) to a different attachment point on the shape, or a different order on the same attachment.

Calls Shape.AttachmentSortTest and then ShapeEvtHandler.OnChangeAttachment.



Redraw all the lines attached to the shape.



NameRegions(self, parentName="")

Make unique names for all the regions in a shape or composite shape.

Parameters:

parentName (str) – a prefix for the region names



OnBeginDragLeft(self, x, y, keys = 0, attachment = 0)

The begin drag left handler.



OnBeginDragRight(self, x, y, keys = 0, attachment = 0)

The begin drag right handler.



OnChangeAttachment(self, attachment, line, ordering)

Change attachment handler.



OnDragLeft(self, draw, x, y, keys = 0, attachment = 0)

The drag left handler.



OnDragRight(self, draw, x, y, keys = 0, attachment = 0)

The drag right handler.



OnDraw(self, dc)

not implemented???



OnDrawBranches(self, dc, erase = False)

The draw branches handler.



OnDrawBranchesAttachment(self, dc, attachment, erase = False)

The draw branches attachment handler.



OnDrawContents(self, dc)

The draw contents handler.



OnDrawControlPoints(self, dc)

The draw control points handler.



OnDrawOutline(self, dc, x, y, w, h)

The draw outline handler.



OnEndDragLeft(self, x, y, keys = 0, attachment = 0)

The end drag left handler.



OnEndDragRight(self, x, y, keys = 0, attachment = 0)

The end drag right handler.



OnErase(self, dc)

The erase handler.



OnEraseContents(self, dc)

The erase contents handler.



OnEraseControlPoints(self, dc)

The erase control points handler.



OnHighlight(self, dc)

not implemented???



OnLeftClick(self, x, y, keys = 0, attachment = 0)

The left click handler.



The move links handler.



OnMovePre(self, dc, x, y, old_x, old_y, display = True)

The pre move handler.



OnRightClick(self, x, y, keys = 0, attachment = 0)

The right click handler.



OnSize(self, x, y)

not implemented???



OnSizingBeginDragLeft(self, pt, x, y, keys = 0, attachment = 0)

The sizing begin drag left handler.



OnSizingDragLeft(self, pt, draw, x, y, keys = 0, attachment = 0)

The sizing drag left handler.



OnSizingEndDragLeft(self, pt, x, y, keys = 0, attachment = 0)

The sizing end drag left handler.



PhysicalToLogicalAttachment(self, physicalAttachment)

Rotate the standard attachment point from physical (0 is always North) to logical (0 -> 1 if rotated by 90 degrees)

Parameters:

physicalAttachment – ???



Recentre(self, dc)

Recentre (or other formatting) all the text regions for this shape.



Recompute(self)

Recomputes any constraints associated with the shape.

Normally applicable to CompositeShapes only, but harmless for other classes of Shape.



RemoveFromCanvas(self, theCanvas)

Remove the shape from the canvas.

Parameters:

theCanvas – an instance of Canvas



RemoveLine(self, line)

Remove the given line from the shape’s list of attached lines.

Parameters:

line – an instance of LineShape



ResetControlPoints(self)

Reset the positions of the control points (for instance when the shape’s shape has changed).



ResetMandatoryControlPoints(self)

Reset the mandatory control points.



Rotate(self, x, y, theta)

Rotate about the given axis by the given amount in radians.

Parameters:
  • x – the x position

  • y – the y position

  • theta – the theta



Select(self, select, dc = None)

Select or deselect the given shape, drawing or erasing control points (handles) as necessary.

Parameters:
  • selectTrue to select

  • dc – the device context



Selected(self)

True if the shape is currently selected.



SetAttachmentMode(self, mode)

Set the attachment mode.

Parameters:

mode – if True attachment points will be significant when drawing lines to and from this shape. If False lines will be drawn as if to the centre of the shape.



SetAttachmentSize(self, w, h)

Set the attachment size.

Parameters:
  • w – width

  • h – height



SetBrush(self, the_brush)

Set the brush for filling the shape’s shape.



SetCanvas(self, theCanvas)

Set the canvas, identical to Shape.Attach.

Parameters:

theCanvas – an instance of Canvas



SetCentreResize(self, cr)

Specify whether the shape is to be resized from the centre (the centre stands still) or from the corner or side being dragged (the other corner or side stands still).



SetDefaultRegionSize(self)

Set the default region to be consistent with the shape size.



SetDisableLabel(self, flag)

Set flag to True to stop the default region being shown.



SetDraggable(self, drag, recursive = False)

Set the shape to be draggable or not draggable.

Parameters:
  • drag – if True make shape draggable

  • recursive – if True recurse through children



SetDrawHandles(self, drawH)

Set the drawHandles flag for this shape and all descendants.

Parameters:

drawH – if True (the default), any handles (control points) will be drawn. Otherwise, the handles will not be drawn.



SetEventHandler(self, handler)

Set the event handler for this shape.

Parameters:

handler – an instance of ShapeEvtHandler



SetFixedSize(self, x, y)

Set the shape to be fixed size.

Parameters:
  • x – the width

  • y – the height



SetFont(self, the_font, regionId = 0)

Set the font for the specified text region.

Parameters:
  • the_font – an instance of wx.Font ???

  • regionId – the region identifier



SetFormatMode(self, mode, regionId = 0)

Set the format mode of the region.

Parameters:

mode – can be a bit list of the following

Format mode

Description

FORMAT_NONE

No formatting

FORMAT_CENTRE_HORIZ

Horizontal centring

FORMAT_CENTRE_VERT

Vertical centring

Parameters:

regionId – the region identifier, default=0



SetHighlight(self, hi, recurse = False)

Set the highlight for a shape. Shape highlighting is unimplemented.



SetId(self, i)

Set the integer identifier for this shape.



SetMaintainAspectRatio(self, ar)

Set whether a shape that resizes should not change the aspect ratio (width and height should be in the original proportion).



SetParent(self, p)

Set the parent

Parameters:

p – the parent



SetPen(self, the_pen)

Set the pen for drawing the shape’s outline.



SetRegionName(self, name, regionId = 0)

Set the name for this region.

Parameters:
  • name (str) – the name to set

  • regionId – the region identifier

Note

The name for a region is unique within the scope of the whole composite, whereas a region id is unique only for a single image.



SetRotation(self, rotation)

Set rotation

Parameters:

rotation (int) – rotation



SetSensitivityFilter(self, sens = OP_ALL, recursive = False)

Set the shape to be sensitive or insensitive to specific mouse operations.

Parameters:

sens – is a bitlist of the following:

Mouse operation

Description

OP_CLICK_LEFT

left clicked

OP_CLICK_RIGHT

right clicked

OP_DRAG_LEFT

left drag

OP_DRAG_RIGHT

right drag

OP_ALL

all of the above

Parameters:

recursive – if True recurse through children



SetShadowMode(self, mode, redraw = False)

Set the shadow mode (whether a shadow is drawn or not).

Parameters:

mode – can be one of the following:

Shadow mode

Description

SHADOW_NONE

No shadow (the default)

SHADOW_LEFT

Shadow on the left side

SHADOW_RIGHT

Shadow on the right side



SetShape(self, sh)

Set shape ???

Parameters:

sh – an instance of Shape



SetSize(self, x, y, recursive = True)

Set the shape’s size.

Parameters:
  • x – the x position

  • y – the y position

  • recursive – not used



SetSpaceAttachments(self, sp)

Indicate whether lines should be spaced out evenly at the point they touch the node.

Parameters:

sp – if True space out evently, else they should join at a single point.



SetTextColour(self, the_colour, regionId = 0)

Set the colour for the specified text region.

Parameters:
  • the_colour (str) – a valid colour name, see wx.ColourDatabase

  • regionId – the region identifier



SetX(self, x)

Set the x position of the shape.

Parameters:

x – the x position



SetY(self, y)

Set the y position of the shape.

Parameters:

y – the y position



Show(self, show)

Set a flag indicating whether the shape should be drawn.



SortLines(self, attachment, linesToSort)

Reorder the lines coming into the node image at this attachment position, in the order in which they appear in linesToSort.

Any remaining lines not in the list will be added to the end.