Home | Trees | Index | Help |
|
---|
Package wx :: Package lib :: Package ogl :: Class 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.
Method Summary | |
---|---|
__init__(self)
| |
Add an arrow (or annotation) to the line. | |
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. | |
Delete the arrow with the given name. | |
Delete the arrows at the specified position, or at any position if position is -1. | |
Delete arrowhead by position and name. | |
Delete arrowhead by id. | |
Delete an arbitary point on the line. | |
TRUE if the shape may be dragged by the user. | |
Draw the given arrowhead (or annotation). | |
Draw all arrows. | |
Format one region at this position. | |
Erase one region at this position. | |
Find arrowhead by position and name. | |
Find arrowhead by id. | |
Finds the x, y points at the two ends of the line. | |
Find which position we're talking about at this x, y. | |
Find the horizontal width for drawing a line with arrows in minimum space. | |
Find the position of the line on the given object. | |
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)
| |
Return the attachment point on the 'from' node. | |
Return the attachment point on the 'to' node. | |
Get the minimum bounding box for the shape, that defines the area available for drawing the contents (such as text). | |
Get the visible endpoints of the lines for drawing between two objects. | |
Return the 'from' object. | |
Get the reference point for a label. | |
GetLineControlPoints(self)
| |
Find the next control point in the line after the start / end point, depending on whether the shape is at the start or end. | |
Return the 'to' object. | |
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 the line object. | |
Insert a control point at an optional given position. | |
TRUE if shape is at the end of the line. | |
TRUE if a spline is drawn through the control points. | |
Make handle control points. | |
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)
| |
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)
| |
Reset the positions of the control points (for instance when the shape's shape has changed). | |
Select or deselect the given shape, drawing or erasing control points (handles) as necessary. | |
SetAlignmentOrientation(self,
isEnd,
isHoriz)
| |
SetAlignmentType(self,
isEnd,
alignType)
| |
Set the 'from' shape attachment. | |
Specify which object attachment points should be used at each end of the line. | |
Set the 'to' shape attachment. | |
Set the end positions of the line. | |
Set the 'from' object for the line. | |
Set whether to ignore offsets from the end of the line when drawing. | |
Specifies whether a spline is to be drawn through the control points. | |
Set the 'to' object for the line. | |
Straighten verticals and horizontals. | |
Unlink the line from the nodes at either end. |
Class Variable Summary |
---|
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:
end may currently be one of:
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
ResetControlPoints(self)Reset the positions of the control points (for instance when the shape's shape has changed).
|
Select(self, select, dc=None)Select or deselect the given shape, drawing or erasing control points (handles) as necessary.
|
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. |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:08:01 2007 | http://epydoc.sf.net |