Package wx :: Package lib :: Package ogl :: Class LineShape
[frames | no frames]

Type LineShape

     object --+        
              |        
ShapeEvtHandler --+    
                  |    
              Shape --+
                      |
                     LineShape


LineShape may be attached to two nodes; it may be segmented, in which case a control point is drawn for each joint.

A wxLineShape may have arrows at the beginning, end and centre.

Derived from:
Shape

Method Summary
  __init__(self)
  __del__(self)
  AddArrow(self, type, end, size, xOffset, name, mf, arrowId)
Add an arrow (or annotation) to the line.
  AddArrowOrdered(self, arrow, referenceList, end)
Add an arrowhead in the position indicated by the reference list of arrowheads, which contains all legal arrowheads for this line, in the correct order.
  ClearArrow(self, name)
Delete the arrow with the given name.
  ClearArrowsAtPosition(self, end)
Delete the arrows at the specified position, or at any position if position is -1.
  DeleteArrowHead(self, position, name)
Delete arrowhead by position and name.
  DeleteArrowHeadId(self, id)
Delete arrowhead by id.
  DeleteLineControlPoint(self)
Delete an arbitary point on the line.
  Draggable(self)
TRUE if the shape may be dragged by the user.
  DrawArrow(self, dc, arrow, XOffset, proportionalOffset)
Draw the given arrowhead (or annotation).
  DrawArrows(self, dc)
Draw all arrows.
  DrawRegion(self, dc, region, x, y)
Format one region at this position.
  EraseRegion(self, dc, region, x, y)
Erase one region at this position.
  FindArrowHead(self, position, name)
Find arrowhead by position and name.
  FindArrowHeadId(self, arrowId)
Find arrowhead by id.
  FindLineEndPoints(self)
Finds the x, y points at the two ends of the line.
  FindLinePosition(self, x, y)
Find which position we're talking about at this x, y.
  FindMinimumWidth(self)
Find the horizontal width for drawing a line with arrows in minimum space.
  FindNth(self, image, incoming)
Find the position of the line on the given object.
  FormatText(self, dc, s, i)
Format a text string according to the region size, adding strings with positions to region text list.
  GetAlignmentEnd(self)
  GetAlignmentOrientation(self, isEnd)
  GetAlignmentStart(self)
  GetAlignmentType(self, isEnd)
  GetArrows(self)
  GetAttachmentFrom(self)
Return the attachment point on the 'from' node.
  GetAttachmentTo(self)
Return the attachment point on the 'to' node.
  GetBoundingBoxMin(self)
Get the minimum bounding box for the shape, that defines the area available for drawing the contents (such as text).
  GetEnds(self)
Get the visible endpoints of the lines for drawing between two objects.
  GetFrom(self)
Return the 'from' object.
  GetLabelPosition(self, position)
Get the reference point for a label.
  GetLineControlPoints(self)
  GetNextControlPoint(self, shape)
Find the next control point in the line after the start / end point, depending on whether the shape is at the start or end.
  GetTo(self)
Return the 'to' object.
  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.
  Initialise(self)
Initialise the line object.
  InsertLineControlPoint(self, dc, point)
Insert a control point at an optional given position.
  IsEnd(self, nodeObject)
TRUE if shape is at the end of the line.
  IsSpline(self)
TRUE if a spline is drawn through the control points.
  MakeControlPoints(self)
Make handle control points.
  MakeLineControlPoints(self, n)
Make a given number of control points (minimum of two).
  OnBeginDragLeft(self, x, y, keys, attachment)
  OnCreateLabelShape(self, parent, region, w, h)
  OnDragLeft(self, draw, x, y, keys, attachment)
  OnDraw(self, dc)
  OnDrawContents(self, dc)
  OnDrawControlPoints(self, dc)
  OnDrawOutline(self, dc, x, y, w, h)
  OnEndDragLeft(self, x, y, keys, attachment)
  OnErase(self, dc)
  OnEraseControlPoints(self, dc)
  OnLabelMovePre(self, dc, labelShape, x, y, old_x, old_y, display)
  OnMoveLink(self, dc, moveControlPoints)
Called when a connected object has moved, to move the link to correct position
  OnMoveMiddleControlPoint(self, dc, lpt, pt)
  OnMovePre(self, dc, x, y, old_x, old_y, display)
  OnSizingBeginDragLeft(self, pt, x, y, keys, attachment)
  OnSizingDragLeft(self, pt, draw, x, y, keys, attachment)
  OnSizingEndDragLeft(self, pt, x, y, keys, attachment)
  ResetControlPoints(self)
Reset the positions of the control points (for instance when the shape's shape has changed).
  Select(self, select, dc)
Select or deselect the given shape, drawing or erasing control points (handles) as necessary.
  SetAlignmentOrientation(self, isEnd, isHoriz)
  SetAlignmentType(self, isEnd, alignType)
  SetAttachmentFrom(self, attach)
Set the 'from' shape attachment.
  SetAttachments(self, from_attach, to_attach)
Specify which object attachment points should be used at each end of the line.
  SetAttachmentTo(self, attach)
Set the 'to' shape attachment.
  SetEnds(self, x1, y1, x2, y2)
Set the end positions of the line.
  SetFrom(self, object)
Set the 'from' object for the line.
  SetIgnoreOffsets(self, ignore)
Set whether to ignore offsets from the end of the line when drawing.
  SetSpline(self, spline)
Specifies whether a spline is to be drawn through the control points.
  SetTo(self, object)
Set the 'to' object for the line.
  Straighten(self, dc)
Straighten verticals and horizontals.
  Unlink(self)
Unlink the line from the nodes at either end.
    Inherited from Shape
  __str__(self)
  AddLine(self, line, other, attachFrom, attachTo, positionFrom, positionTo)
Add a line between this shape and the given other shape, at the specified attachment points.
  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)
Add the shape to the canvas's shape list.
  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.
  CalcSimpleAttachment(self, pt1, pt2, nth, noArcs, line)
Assuming the attachment lies along a vertical or horizontal line, calculate the position on that point.
  ClearAttachments(self)
Clear internal custom attachment point shapes (of class wxAttachmentPoint).
  ClearRegions(self)
Clear the ShapeRegions from the shape.
  ClearText(self, regionId)
Clear the text from the specified text region.
  Delete(self)
Fully disconnect this shape from parents, children, the canvas, etc.
  DeleteControlPoints(self, dc)
Delete the control points (or handles) for the shape.
  Detach(self)
Disassociates the shape from its canvas.
  Draw(self, dc)
Draw the whole shape and any lines attached to it.
  DrawContents(self, dc)
Draw the internal graphic of the shape (such as text).
  DrawLinks(self, dc, attachment, recurse)
Draws any lines linked to this shape.
  Erase(self, dc)
Erase the shape.
  EraseContents(self, dc)
Erase the shape contents, that is, the area within the shape's minimum bounding box.
  EraseLinks(self, dc, attachment, recurse)
Erase links attached to this shape, but do not repair damage caused to other shapes.
  FindRegion(self, name)
Find the actual image ('this' if non-composite) and region id for the given region name.
  FindRegionNames(self)
Get a list of all region names for this image (composite or simple).
  Flash(self)
Flash the shape.
  GetAttachmentLineCount(self, attachment)
Get the number of lines at this attachment position.
  GetAttachmentMode(self)
Return the attachment mode.
  GetAttachmentPosition(self, attachment, nth, no_arcs, line)
Get the position at which the given attachment point should be drawn.
  GetAttachmentPositionEdge(self, attachment, nth, no_arcs, line)
Only get the attachment position at the _edge_ of the shape, ignoring branching mode.
  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.
  GetBranchingAttachmentInfo(self, attachment)
Get information about where branching connections go.
  GetBranchingAttachmentPoint(self, attachment, n)
  GetBranchingAttachmentRoot(self, attachment)
Get the root point at the given attachment.
  GetBranchStyle(self)
  GetBrush(self)
Return 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)
Return the list of children for this shape.
  GetClassName(self)
  GetDisableLabel(self)
TRUE if the default region will not be shown, FALSE otherwise.
  GetDrawHandles(self)
Return the list of drawhandles.
  GetEventHandler(self)
Return 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)
Get the font for the specified text region.
  GetFormatMode(self, regionId)
  GetId(self)
Return the integer identifier for this shape.
  GetLinePosition(self, line)
Get the zero-based position of line in the list of lines for this shape.
  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)
Return the number of text regions for this shape.
  GetParent(self)
Return the parent of this shape, if it is part of a composite.
  GetPen(self)
Return 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.
  GetRegionId(self, name)
Get the region's identifier by name.
  GetRegionName(self, regionId)
Get the region's name.
  GetRegions(self)
Return the list of ShapeRegions.
  GetRotation(self)
Return the angle of rotation in radians.
  GetSensitivityFilter(self)
Return the sensitivity filter, a bitlist of values.
  GetShadowMode(self)
Return the current shadow mode setting
  GetSpaceAttachments(self)
Return 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)
Get the colour for the specified text region.
  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)
TRUE if image is a descendant of this composite.
  InsertInCanvas(self, theCanvas)
Insert the shape at the front of the shape list of canvas.
  IsHighlighted(self)
TRUE if the shape is highlighted.
  IsShown(self)
TRUE if the shape is in a visible state, FALSE otherwise.
  LogicalToPhysicalAttachment(self, logicalAttachment)
Rotate the standard attachment point from logical to physical (0 is always North).
  MakeMandatoryControlPoints(self)
Make the mandatory control points.
  Move(self, dc, x, y, display)
Move the shape to the given position.
  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.
  MoveLinks(self, dc)
Redraw all the lines attached to the shape.
  NameRegions(self, parentName)
Make unique names for all the regions in a shape or composite shape.
  OnBeginDragRight(self, x, y, keys, attachment)
  OnChangeAttachment(self, attachment, line, ordering)
  OnDragRight(self, draw, x, y, keys, attachment)
  OnDrawBranches(self, dc, erase)
  OnDrawBranchesAttachment(self, dc, attachment, erase)
  OnEndDragRight(self, x, y, keys, attachment)
  OnEraseContents(self, dc)
  OnHighlight(self, dc)
  OnLeftClick(self, x, y, keys, attachment)
  OnMoveLinks(self, dc)
  OnRightClick(self, x, y, keys, attachment)
  OnSize(self, x, y)
  PhysicalToLogicalAttachment(self, physicalAttachment)
Rotate the standard attachment point from physical (0 is always North) to logical (0 -> 1 if rotated by 90 degrees)
  Recentre(self, dc)
Do recentring (or other formatting) for all the text regions for this shape.
  Recompute(self)
Recomputes any constraints associated with the shape.
  RemoveFromCanvas(self, theCanvas)
Remove the shape from the canvas.
  RemoveLine(self, line)
Remove the given line from the shape's list of attached lines.
  ResetMandatoryControlPoints(self)
Reset the mandatory control points.
  Rotate(self, x, y, theta)
Rotate about the given axis by the given amount in radians.
  Selected(self)
TRUE if the shape is currently selected.
  SetAttachmentMode(self, mode)
Set the attachment mode.
  SetAttachmentSize(self, w, h)
  SetBrush(self, the_brush)
Set the brush for filling the shape's shape.
  SetCanvas(self, theCanvas)
Identical to Shape.Attach.
  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)
Set the shape to be draggable or not draggable.
  SetDrawHandles(self, drawH)
Set the drawHandles flag for this shape and all descendants.
  SetEventHandler(self, handler)
Set the event handler for this shape.
  SetFixedSize(self, x, y)
Set the shape to be fixed size.
  SetFont(self, the_font, regionId)
Set the font for the specified text region.
  SetFormatMode(self, mode, regionId)
Set the format mode of the default text region.
  SetHighlight(self, hi, recurse)
Set the highlight for a shape.
  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)
  SetPen(self, the_pen)
Set the pen for drawing the shape's outline.
  SetRegionName(self, name, regionId)
Set the name for this region.
  SetRotation(self, rotation)
  SetSensitivityFilter(self, sens, recursive)
Set the shape to be sensitive or insensitive to specific mouse operations.
  SetShadowMode(self, mode, redraw)
Set the shadow mode (whether a shadow is drawn or not).
  SetShape(self, sh)
  SetSize(self, x, y, recursive)
Set the shape's size.
  SetSpaceAttachments(self, sp)
Indicate whether lines should be spaced out evenly at the point they touch the node (sp = True), or whether they should join at a single point (sp = False).
  SetTextColour(self, the_colour, regionId)
Set the colour for the specified text region.
  SetX(self, x)
Set the x position of the shape.
  SetY(self, y)
Set the y position of the shape.
  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.
    Inherited from ShapeEvtHandler
  GetPreviousHandler(self)
  GetShape(self)
  OnBeginSize(self, w, h)
  OnDelete(self)
  OnEndSize(self, w, h)
  OnLeftDoubleClick(self, x, y, keys, attachment)
  OnMovePost(self, dc, x, y, old_x, old_y, display)
  SetPreviousHandler(self, handler)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
Return hash(x)...
  __new__(T, S, ...)
Return a new object with type S, a subtype of T...
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
Return repr(x)...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value

Class Variable Summary
    Inherited from Shape
bool GraphicsInSizeToContents = False

Method Details

AddArrow(self, type, end=1, size=10.0, xOffset=0.0, name='', mf=None, arrowId=-1)

Add an arrow (or annotation) to the line.

type may currently be one of:

ARROW_HOLLOW_CIRCLE
Hollow circle.
ARROW_FILLED_CIRCLE
Filled circle.
ARROW_ARROW
Conventional arrowhead.
ARROW_SINGLE_OBLIQUE
Single oblique stroke.
ARROW_DOUBLE_OBLIQUE
Double oblique stroke.
ARROW_DOUBLE_METAFILE
Custom arrowhead.

end may currently be one of:

ARROW_POSITION_END
Arrow appears at the end.
ARROW_POSITION_START
Arrow appears at the start.

arrowSize specifies the length of the arrow.

xOffset specifies the offset from the end of the line.

name specifies a name for the arrow.

mf can be a wxPseduoMetaFile, perhaps loaded from a simple Windows metafile.

arrowId is the id for the arrow.

AddArrowOrdered(self, arrow, referenceList, end)

Add an arrowhead in the position indicated by the reference list of arrowheads, which contains all legal arrowheads for this line, in the correct order. E.g.

Reference list: a b c d e Current line list: a d

Add c, then line list is: a c d.

If no legal arrowhead position, return FALSE. Assume reference list is for one end only, since it potentially defines the ordering for any one of the 3 positions. So we don't check the reference list for arrowhead position.

ClearArrow(self, name)

Delete the arrow with the given name.

ClearArrowsAtPosition(self, end)

Delete the arrows at the specified position, or at any position if position is -1.

DeleteArrowHead(self, position, name)

Delete arrowhead by position and name.

if position is -1, matches any position.

DeleteArrowHeadId(self, id)

Delete arrowhead by id.

DeleteLineControlPoint(self)

Delete an arbitary point on the line.

Draggable(self)

TRUE if the shape may be dragged by the user.

Overrides:
wx.lib.ogl.Shape.Draggable (inherited documentation)

DrawArrow(self, dc, arrow, XOffset, proportionalOffset)

Draw the given arrowhead (or annotation).

DrawArrows(self, dc)

Draw all arrows.

DrawRegion(self, dc, region, x, y)

Format one region at this position.

EraseRegion(self, dc, region, x, y)

Erase one region at this position.

FindArrowHead(self, position, name)

Find arrowhead by position and name.

if position is -1, matches any position.

FindArrowHeadId(self, arrowId)

Find arrowhead by id.

FindLineEndPoints(self)

Finds the x, y points at the two ends of the line.

This function can be used by e.g. line-routing routines to get the actual points on the two node images where the lines will be drawn to / from.

FindLinePosition(self, x, y)

Find which position we're talking about at this x, y.

Returns ARROW_POSITION_START, ARROW_POSITION_MIDDLE, ARROW_POSITION_END.

FindMinimumWidth(self)

Find the horizontal width for drawing a line with arrows in minimum space. Assume arrows at end only.

FindNth(self, image, incoming)

Find the position of the line on the given object.

Specify whether incoming or outgoing lines are being considered with incoming.

FormatText(self, dc, s, i)

Format a text string according to the region size, adding strings with positions to region text list.

Overrides:
wx.lib.ogl.Shape.FormatText

GetAttachmentFrom(self)

Return the attachment point on the 'from' node.

GetAttachmentTo(self)

Return the attachment point on the 'to' node.

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.

Overrides:
wx.lib.ogl.Shape.GetBoundingBoxMin (inherited documentation)

GetEnds(self)

Get the visible endpoints of the lines for drawing between two objects.

GetFrom(self)

Return the 'from' object.

GetLabelPosition(self, position)

Get the reference point for a label.

Region x and y are offsets from this. position is 0 (middle), 1 (start), 2 (end).

GetNextControlPoint(self, shape)

Find the next control point in the line after the start / end point, depending on whether the shape is at the start or end.

GetTo(self)

Return the 'to' object.

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.

Overrides:
wx.lib.ogl.Shape.HitTest (inherited documentation)

Initialise(self)

Initialise the line object.

InsertLineControlPoint(self, dc=None, point=None)

Insert a control point at an optional given position.

IsEnd(self, nodeObject)

TRUE if shape is at the end of the line.

IsSpline(self)

TRUE if a spline is drawn through the control points.

MakeControlPoints(self)

Make handle control points.

Overrides:
wx.lib.ogl.Shape.MakeControlPoints

MakeLineControlPoints(self, n)

Make a given number of control points (minimum of two).

OnMoveLink(self, dc, moveControlPoints=True)

Called when a connected object has moved, to move the link to correct position

Overrides:
wx.lib.ogl.ShapeEvtHandler.OnMoveLink

ResetControlPoints(self)

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

Overrides:
wx.lib.ogl.Shape.ResetControlPoints (inherited documentation)

Select(self, select, dc=None)

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

Overrides:
wx.lib.ogl.Shape.Select (inherited documentation)

SetAttachmentFrom(self, attach)

Set the 'from' shape attachment.

SetAttachments(self, from_attach, to_attach)

Specify which object attachment points should be used at each end of the line.

SetAttachmentTo(self, attach)

Set the 'to' shape attachment.

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

Set the end positions of the line.

SetFrom(self, object)

Set the 'from' object for the line.

SetIgnoreOffsets(self, ignore)

Set whether to ignore offsets from the end of the line when drawing.

SetSpline(self, spline)

Specifies whether a spline is to be drawn through the control points.

SetTo(self, object)

Set the 'to' object for the line.

Straighten(self, dc=None)

Straighten verticals and horizontals.

Unlink(self)

Unlink the line from the nodes at either end.


Generated by Epydoc 2.1.20050511.rpd on Sat Jun 16 16:50:44 2007 http://epydoc.sf.net