Documentation ¶
Index ¶
- Variables
- func InitializeBaseDiagramLink(diagramLink DiagramLink, diagram *DiagramWidget, linkID string)
- func InitializeBaseDiagramNode(diagramNode DiagramNode, diagram *DiagramWidget, obj fyne.CanvasObject, ...)
- func StepForceLayout(dw *DiagramWidget, targetLength float64)
- type AnchoredText
- func (at *AnchoredText) CreateRenderer() fyne.WidgetRenderer
- func (at *AnchoredText) DataChanged()
- func (at *AnchoredText) Displace(delta fyne.Position)
- func (at *AnchoredText) DragEnd()
- func (at *AnchoredText) Dragged(event *fyne.DragEvent)
- func (at *AnchoredText) GetDisplayedTextBinding() binding.String
- func (at *AnchoredText) GetTextEntry() *widget.Entry
- func (at *AnchoredText) MinSize() fyne.Size
- func (at *AnchoredText) MouseIn(event *desktop.MouseEvent)
- func (at *AnchoredText) MouseMoved(event *desktop.MouseEvent)
- func (at *AnchoredText) MouseOut()
- func (at *AnchoredText) Move(position fyne.Position)
- func (at *AnchoredText) SetForegroundColor(fc color.Color)
- func (at *AnchoredText) SetReferencePosition(position fyne.Position)
- type Arrowhead
- func (a *Arrowhead) CreateRenderer() fyne.WidgetRenderer
- func (a *Arrowhead) GetReferenceLength() float32
- func (a *Arrowhead) LeftPoint() fyne.Position
- func (a *Arrowhead) MinSize() fyne.Size
- func (a *Arrowhead) Resize(s fyne.Size)
- func (a *Arrowhead) RightPoint() fyne.Position
- func (a *Arrowhead) SetFillColor(fillColor color.Color)
- func (a *Arrowhead) SetSolid(bool)
- func (a *Arrowhead) SetStrokeColor(strokeColor color.Color)
- func (a *Arrowhead) SetStrokeWidth(strokeWidth float32)
- func (a *Arrowhead) Size() fyne.Size
- type BaseDiagramLink
- func (bdl *BaseDiagramLink) AddMidpointAnchoredText(key string, displayedText string) *AnchoredText
- func (bdl *BaseDiagramLink) AddMidpointDecoration(decoration Decoration)
- func (bdl *BaseDiagramLink) AddSourceAnchoredText(key string, displayedText string) *AnchoredText
- func (bdl *BaseDiagramLink) AddSourceDecoration(decoration Decoration)
- func (bdl *BaseDiagramLink) AddTargetAnchoredText(key string, displayedText string) *AnchoredText
- func (bdl *BaseDiagramLink) AddTargetDecoration(decoration Decoration)
- func (bdl *BaseDiagramLink) CreateRenderer() fyne.WidgetRenderer
- func (de *BaseDiagramLink) GetBackgroundColor() color.Color
- func (de *BaseDiagramLink) GetConnectionPads() map[string]ConnectionPad
- func (bdl *BaseDiagramLink) GetDefaultConnectionPad() ConnectionPad
- func (de *BaseDiagramLink) GetDiagram() *DiagramWidget
- func (de *BaseDiagramLink) GetDiagramElementID() string
- func (de *BaseDiagramLink) GetForegroundColor() color.Color
- func (de *BaseDiagramLink) GetHandle(handleName string) *Handle
- func (de *BaseDiagramLink) GetHandleColor() color.Color
- func (bdl *BaseDiagramLink) GetLinkPoints() []*LinkPoint
- func (bdl *BaseDiagramLink) GetMidPad() ConnectionPad
- func (bdl *BaseDiagramLink) GetMidpointAnchoredText(key string) *AnchoredText
- func (de *BaseDiagramLink) GetPadColor() color.Color
- func (de *BaseDiagramLink) GetProperties() DiagramElementProperties
- func (bdl *BaseDiagramLink) GetSourceAnchoredText(key string) *AnchoredText
- func (bdl *BaseDiagramLink) GetSourceHandle() *Handle
- func (bdl *BaseDiagramLink) GetSourcePad() ConnectionPad
- func (bdl *BaseDiagramLink) GetTargetAnchoredText(key string) *AnchoredText
- func (bdl *BaseDiagramLink) GetTargetHandle() *Handle
- func (bdl *BaseDiagramLink) GetTargetPad() ConnectionPad
- func (de *BaseDiagramLink) HideHandles()
- func (bdl *BaseDiagramLink) IsLink() bool
- func (bdl *BaseDiagramLink) IsNode() bool
- func (bdl *BaseDiagramLink) MouseIn(event *desktop.MouseEvent)
- func (bdl *BaseDiagramLink) MouseMoved(event *desktop.MouseEvent)
- func (bdl *BaseDiagramLink) MouseOut()
- func (de *BaseDiagramLink) SetBackgroundColor(backgroundColor color.Color)
- func (de *BaseDiagramLink) SetForegroundColor(foregroundColor color.Color)
- func (de *BaseDiagramLink) SetHandleColor(handleColor color.Color)
- func (de *BaseDiagramLink) SetProperties(properties DiagramElementProperties)
- func (bdl *BaseDiagramLink) SetSourcePad(pad ConnectionPad)
- func (bdl *BaseDiagramLink) SetTargetPad(pad ConnectionPad)
- func (de *BaseDiagramLink) ShowHandles()
- type BaseDiagramNode
- func (bdn *BaseDiagramNode) Center() fyne.Position
- func (bdn *BaseDiagramNode) CreateRenderer() fyne.WidgetRenderer
- func (bdn *BaseDiagramNode) Cursor() desktop.Cursor
- func (bdn *BaseDiagramNode) DragEnd()
- func (bdn *BaseDiagramNode) Dragged(event *fyne.DragEvent)
- func (de *BaseDiagramNode) GetBackgroundColor() color.Color
- func (de *BaseDiagramNode) GetConnectionPads() map[string]ConnectionPad
- func (bdn *BaseDiagramNode) GetDefaultConnectionPad() ConnectionPad
- func (de *BaseDiagramNode) GetDiagram() *DiagramWidget
- func (de *BaseDiagramNode) GetDiagramElementID() string
- func (bdn *BaseDiagramNode) GetEdgePad() ConnectionPad
- func (de *BaseDiagramNode) GetForegroundColor() color.Color
- func (de *BaseDiagramNode) GetHandle(handleName string) *Handle
- func (de *BaseDiagramNode) GetHandleColor() color.Color
- func (de *BaseDiagramNode) GetPadColor() color.Color
- func (de *BaseDiagramNode) GetProperties() DiagramElementProperties
- func (de *BaseDiagramNode) HideHandles()
- func (bdn *BaseDiagramNode) IsLink() bool
- func (bdn *BaseDiagramNode) IsNode() bool
- func (bdn *BaseDiagramNode) Move(position fyne.Position)
- func (bdn *BaseDiagramNode) R2Box() r2.Box
- func (bdn *BaseDiagramNode) R2Center() r2.Vec2
- func (bdn *BaseDiagramNode) R2Position() r2.Vec2
- func (de *BaseDiagramNode) SetBackgroundColor(backgroundColor color.Color)
- func (de *BaseDiagramNode) SetForegroundColor(foregroundColor color.Color)
- func (de *BaseDiagramNode) SetHandleColor(handleColor color.Color)
- func (bdn *BaseDiagramNode) SetInnerObject(obj fyne.CanvasObject)
- func (de *BaseDiagramNode) SetProperties(properties DiagramElementProperties)
- func (de *BaseDiagramNode) ShowHandles()
- func (bdn *BaseDiagramNode) Tapped(event *fyne.PointEvent)
- type ConnectionPad
- type ConnectionTransaction
- type Decoration
- type DiagramElement
- type DiagramElementProperties
- type DiagramLink
- type DiagramNode
- type DiagramWidget
- func (dw *DiagramWidget) BringForward(elementID string)
- func (dw *DiagramWidget) BringToFront(elementID string)
- func (dw *DiagramWidget) ClearSelection()
- func (dw *DiagramWidget) ClearSelectionNoCallback()
- func (dw *DiagramWidget) CreateRenderer() fyne.WidgetRenderer
- func (dw *DiagramWidget) Cursor() desktop.Cursor
- func (dw *DiagramWidget) DiagramElementTapped(de DiagramElement)
- func (dw *DiagramWidget) DiagramNodeDragged(node *BaseDiagramNode, event *fyne.DragEvent)
- func (dw *DiagramWidget) DisplaceNode(node DiagramNode, delta fyne.Position)
- func (dw *DiagramWidget) GetBackgroundColor() color.Color
- func (dw *DiagramWidget) GetDiagramElement(elementID string) DiagramElement
- func (dw *DiagramWidget) GetDiagramElements() []DiagramElement
- func (dw *DiagramWidget) GetDiagramLink(id string) DiagramLink
- func (dw *DiagramWidget) GetDiagramLinks() []DiagramLink
- func (dw *DiagramWidget) GetDiagramNode(id string) DiagramNode
- func (dw *DiagramWidget) GetDiagramNodes() []DiagramNode
- func (dw *DiagramWidget) GetForegroundColor() color.Color
- func (dw *DiagramWidget) GetPrimarySelection() DiagramElement
- func (dw *DiagramWidget) IsSelected(de DiagramElement) bool
- func (dw *DiagramWidget) RemoveElement(elementID string)
- func (dw *DiagramWidget) SelectDiagramElement(element DiagramElement)
- func (dw *DiagramWidget) SelectDiagramElementNoCallback(id string)
- func (dw *DiagramWidget) SendBackward(elementID string)
- func (dw *DiagramWidget) SendToBack(elementID string)
- func (dw *DiagramWidget) StartNewLinkConnectionTransaction(link DiagramLink)
- type Handle
- type LinkEnd
- type LinkPoint
- type LinkSegment
- type PointPad
- func (pp *PointPad) CreateRenderer() fyne.WidgetRenderer
- func (pp *PointPad) GetCenterInDiagramCoordinates() fyne.Position
- func (cp *PointPad) GetPadOwner() DiagramElement
- func (pp *PointPad) MouseDown(event *desktop.MouseEvent)
- func (pp *PointPad) MouseIn(event *desktop.MouseEvent)
- func (pp *PointPad) MouseMoved(event *desktop.MouseEvent)
- func (pp *PointPad) MouseOut()
- func (pp *PointPad) MouseUp(event *desktop.MouseEvent)
- func (pp *PointPad) SetPadColor(c color.Color)
- type Polygon
- func (p *Polygon) CreateRenderer() fyne.WidgetRenderer
- func (p *Polygon) GetReferenceLength() float32
- func (p *Polygon) MinSize() fyne.Size
- func (p *Polygon) SetClosed(closed bool)
- func (p *Polygon) SetFillColor(fillColor color.Color)
- func (p *Polygon) SetSolid(value bool)
- func (p *Polygon) SetStrokeColor(strokeColor color.Color)
- func (p *Polygon) SetStrokeWidth(strokeWidth float32)
- type RectanglePad
- func (rp *RectanglePad) CreateRenderer() fyne.WidgetRenderer
- func (rp *RectanglePad) GetCenterInDiagramCoordinates() fyne.Position
- func (cp *RectanglePad) GetPadOwner() DiagramElement
- func (rp *RectanglePad) MouseDown(event *desktop.MouseEvent)
- func (rp *RectanglePad) MouseIn(event *desktop.MouseEvent)
- func (rp *RectanglePad) MouseMoved(event *desktop.MouseEvent)
- func (rp *RectanglePad) MouseOut()
- func (rp *RectanglePad) MouseUp(event *desktop.MouseEvent)
- func (rp *RectanglePad) SetPadColor(c color.Color)
Constants ¶
This section is empty.
Variables ¶
var LinkEnds [2]LinkEnd = [2]LinkEnd{SOURCE, TARGET}
LinkEnds contains the enumerated LinkEnd values
Functions ¶
func InitializeBaseDiagramLink ¶
func InitializeBaseDiagramLink(diagramLink DiagramLink, diagram *DiagramWidget, linkID string)
InitializeBaseDiagramLink initializes the BaseDiagramLink. It must be called by any extensions to BaseDiagramLink
func InitializeBaseDiagramNode ¶
func InitializeBaseDiagramNode(diagramNode DiagramNode, diagram *DiagramWidget, obj fyne.CanvasObject, nodeID string)
InitializeBaseDiagramNode is used to initailize the BaseDiagramNode. It must be called by any extensions to the BaseDiagramNode
func StepForceLayout ¶
func StepForceLayout(dw *DiagramWidget, targetLength float64)
StepForceLayout calculates one step of force directed graph layout, with the target distance between adjacent nodes being targetLength.
Types ¶
type AnchoredText ¶
type AnchoredText struct { widget.BaseWidget ForegroundColor color.Color // contains filtered or unexported fields }
AnchoredText provides a text annotation for a path that is anchored to one of the path's reference points (e.g. end or middle). The anchored text may be moved independently, but it keeps track of its position relative to the reference point. If the reference point moves, the AnchoredText will also move by the same amount
func NewAnchoredText ¶
func NewAnchoredText(text string) *AnchoredText
NewAnchoredText creates an textual annotation for a link. After it is created, one of the three Add<position>AnchoredText methods must be called on the link to actually associate the anchored text with the appropriate reference point on the link.
func (*AnchoredText) CreateRenderer ¶
func (at *AnchoredText) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is the required method for a widget extension
func (*AnchoredText) DataChanged ¶
func (at *AnchoredText) DataChanged()
DataChanged is the callback function for the displayedTextBinding.
func (*AnchoredText) Displace ¶
func (at *AnchoredText) Displace(delta fyne.Position)
Displace moves the anchored text relative to its reference position.
func (*AnchoredText) DragEnd ¶
func (at *AnchoredText) DragEnd()
DragEnd is one of the required methods for a draggable widget. It just refreshes the widget.
func (*AnchoredText) Dragged ¶
func (at *AnchoredText) Dragged(event *fyne.DragEvent)
Dragged is the required method for a draggable widget. It moves the anchored text relative to its reference position
func (*AnchoredText) GetDisplayedTextBinding ¶
func (at *AnchoredText) GetDisplayedTextBinding() binding.String
GetDisplayedTextBinding returns the binding for the displayed text
func (*AnchoredText) GetTextEntry ¶
func (at *AnchoredText) GetTextEntry() *widget.Entry
GetTextEntry returns the entry widget
func (*AnchoredText) MinSize ¶
func (at *AnchoredText) MinSize() fyne.Size
MinSize returns the size of the entry widget plus a one-pixel border
func (*AnchoredText) MouseIn ¶
func (at *AnchoredText) MouseIn(event *desktop.MouseEvent)
MouseIn is one of the required methods for a mouseable widget.
func (*AnchoredText) MouseMoved ¶
func (at *AnchoredText) MouseMoved(event *desktop.MouseEvent)
MouseMoved is one of the required methods for a mouseable widget
func (*AnchoredText) MouseOut ¶
func (at *AnchoredText) MouseOut()
MouseOut is one of the required methods for a mouseable widget
func (*AnchoredText) Move ¶
func (at *AnchoredText) Move(position fyne.Position)
Move overrides the BaseWidget's Move method. It updates the anchored text's offset and then calls the normal BaseWidget.Move method.
func (*AnchoredText) SetForegroundColor ¶
func (at *AnchoredText) SetForegroundColor(fc color.Color)
SetForegroundColor sets the text color
func (*AnchoredText) SetReferencePosition ¶
func (at *AnchoredText) SetReferencePosition(position fyne.Position)
SetReferencePosition sets the reference position of the anchored text and calls the BaseWidget.Move() method to actually move the displayed text
type Arrowhead ¶
type Arrowhead struct { widget.BaseWidget // Position() is the point at which the tip of the arrow will be placed. // StrokeWidth is the width of the arrowhead lines StrokeWidth float32 // StrokeColor is the color of the arrowhead StrokeColor color.Color // Theta is the angle between each of the tails and the nominal reference axis. // This angle is in radians. Theta float64 // Length is the length of the two "tails" that intersect at the tip. Length int // contains filtered or unexported fields }
Arrowhead defines a canvas object which renders an arrow. The arrowhead is defined with reference to X axis, with the tip of the arrow being at the origin. When rendered, the arrowhead is rotated to match the angle of the link's line segment with which it is oriented, indicated by the baseAngle.
func (*Arrowhead) CreateRenderer ¶
func (a *Arrowhead) CreateRenderer() fyne.WidgetRenderer
CreateRenderer creates a renderer for the Arrowhead
func (*Arrowhead) GetReferenceLength ¶
GetReferenceLength returns the length of the decoration along the reference axis
func (*Arrowhead) LeftPoint ¶
func (a *Arrowhead) LeftPoint() fyne.Position
LeftPoint returns the position of the end of the left half of the arrowhead
func (*Arrowhead) MinSize ¶
func (a *Arrowhead) MinSize() fyne.Size
MinSize returns the minimum size which is the actual size of the arrowhead
func (*Arrowhead) RightPoint ¶
func (a *Arrowhead) RightPoint() fyne.Position
RightPoint returns the position of the end of the right half of the arrowhead
func (*Arrowhead) SetFillColor ¶
SetFillColor is a noop for the arrowhead
func (*Arrowhead) SetStrokeColor ¶
SetStrokeColor sets the color used to draw the arrowhead
func (*Arrowhead) SetStrokeWidth ¶
SetStrokeWidth sets the width of the lines used to render the arrowhead
type BaseDiagramLink ¶
type BaseDiagramLink struct { SourceDecorations []Decoration TargetDecorations []Decoration MidpointDecorations []Decoration // contains filtered or unexported fields }
BaseDiagramLink is a directed graphic connection between two DiagramElements that are referred to as the Source and Target. The link consists of one or more line segments. By default a single line segment connects the Source and Target. The Link connects to ConnectionPads on the DiagramElements. There are three key points on a Link: the Source connection point, the Target connection point, and a MidPoint. For a single segment, the MidPoint is the middle of the segment. When there are two or more segments, the MidPoint is the source end of the next-to-last segment. Graphic Decoration widgets may be added at each of these points. Multiple decorations may be added at each point Multiple decorations are "stacked" along the line in the order added. These graphic decorations rotate with their associated line segments to maintain their orientation with respect to the line segment. Textual AnchoredText widgets may be added at each of the key points. These may be moved with respect to their associated key points. When the key point is moved, associated anchored texts move by the same amount, maintaining the existing offset between the anchored text and the key point. Multiple AnchoredText widgets may be associated with each key point. AnchoredText widgets are indexed by string key values provided at the time the AnchoredText is added. These key values can be used to retrieve the AnchoredText widget so that the displayed text value (among other things) can be set programatically. By default, there is a single ConnectionPad (a PointPad) associated with a Link and located at the MidPoint. Thus a Link can connect to another Link using this ConnectionPad.
func NewDiagramLink ¶
func NewDiagramLink(diagram *DiagramWidget, linkID string) *BaseDiagramLink
NewDiagramLink creates a DiagramLink widget connecting the two indicated ConnectionPads. It adds itself to the DiagramWidget, indexed by the supplied LinkID. This id must be unique across all of the DiagramElements in the Diagram. It can be used to retrieve the DiagramLink from the Diagram. The ID is intended to be used to facilitate mapping the DiagramLink to the information it represents in the application. The DiagramLink uses the DiagramWidget's ForegroundColor as the default color for the line segments.
func (*BaseDiagramLink) AddMidpointAnchoredText ¶
func (bdl *BaseDiagramLink) AddMidpointAnchoredText(key string, displayedText string) *AnchoredText
AddMidpointAnchoredText creates a new AnchoredText widget and adds it to the DiagramLink at the Midpoint position. It uses the supplied key to index the widget so that it can be retrieved later. Multiple AnchoredText widgets can be added.
func (*BaseDiagramLink) AddMidpointDecoration ¶
func (bdl *BaseDiagramLink) AddMidpointDecoration(decoration Decoration)
AddMidpointDecoration adds the supplied Decoration widget at the Midpoint position. Multiple calls to this function will stack the decorations along the line segment at the Midpoint position.
func (*BaseDiagramLink) AddSourceAnchoredText ¶
func (bdl *BaseDiagramLink) AddSourceAnchoredText(key string, displayedText string) *AnchoredText
AddSourceAnchoredText creates a new AnchoredText widget and adds it to the DiagramLink at the Source position. It uses the supplied key to index the widget so that it can be retrieved later. Multiple AnchoredText widgets can be added.
func (*BaseDiagramLink) AddSourceDecoration ¶
func (bdl *BaseDiagramLink) AddSourceDecoration(decoration Decoration)
AddSourceDecoration adds the supplied Decoration widget at the Source position. Multiple calls to this function will stack the decorations along the line segment at the Source position.
func (*BaseDiagramLink) AddTargetAnchoredText ¶
func (bdl *BaseDiagramLink) AddTargetAnchoredText(key string, displayedText string) *AnchoredText
AddTargetAnchoredText creates a new AnchoredText widget and adds it to the DiagramLink at the Target position. It uses the supplied key to index the widget so that it can be retrieved later. Multiple AnchoredText widgets can be added.
func (*BaseDiagramLink) AddTargetDecoration ¶
func (bdl *BaseDiagramLink) AddTargetDecoration(decoration Decoration)
AddTargetDecoration adds the supplied Decoration widget at the Target position. Multiple calls to this function will stack the decorations along the line segment at the Target position.
func (*BaseDiagramLink) CreateRenderer ¶
func (bdl *BaseDiagramLink) CreateRenderer() fyne.WidgetRenderer
CreateRenderer creates the WidgetRenderer for a DiagramLink
func (*BaseDiagramLink) GetBackgroundColor ¶
func (*BaseDiagramLink) GetConnectionPads ¶
func (de *BaseDiagramLink) GetConnectionPads() map[string]ConnectionPad
func (*BaseDiagramLink) GetDefaultConnectionPad ¶
func (bdl *BaseDiagramLink) GetDefaultConnectionPad() ConnectionPad
GetDefaultConnectionPad returns the midPad of the Link
func (*BaseDiagramLink) GetDiagram ¶
func (de *BaseDiagramLink) GetDiagram() *DiagramWidget
func (*BaseDiagramLink) GetDiagramElementID ¶
func (de *BaseDiagramLink) GetDiagramElementID() string
func (*BaseDiagramLink) GetForegroundColor ¶
func (*BaseDiagramLink) GetHandleColor ¶
func (*BaseDiagramLink) GetLinkPoints ¶
func (bdl *BaseDiagramLink) GetLinkPoints() []*LinkPoint
GetLinkPoints returns an array of points that define the vertices of the link including the endpoints
func (*BaseDiagramLink) GetMidPad ¶
func (bdl *BaseDiagramLink) GetMidPad() ConnectionPad
GetMidPad returns the PointPad at the midpoint so that it can be used as either the Source or Target pad for another Link.
func (*BaseDiagramLink) GetMidpointAnchoredText ¶
func (bdl *BaseDiagramLink) GetMidpointAnchoredText(key string) *AnchoredText
GetMidpointAnchoredText returns the midpoint anchored text indexed under the supplied key
func (*BaseDiagramLink) GetPadColor ¶
func (*BaseDiagramLink) GetProperties ¶
func (de *BaseDiagramLink) GetProperties() DiagramElementProperties
func (*BaseDiagramLink) GetSourceAnchoredText ¶
func (bdl *BaseDiagramLink) GetSourceAnchoredText(key string) *AnchoredText
GetSourceAnchoredText returns the source end anchored text indexed under the skupplied key
func (*BaseDiagramLink) GetSourceHandle ¶
func (bdl *BaseDiagramLink) GetSourceHandle() *Handle
GetSourceHandle returns the handle associated with the source end
func (*BaseDiagramLink) GetSourcePad ¶
func (bdl *BaseDiagramLink) GetSourcePad() ConnectionPad
GetSourcePad returns the pad (on another DiagramElement) to which the source end is connected
func (*BaseDiagramLink) GetTargetAnchoredText ¶
func (bdl *BaseDiagramLink) GetTargetAnchoredText(key string) *AnchoredText
GetTargetAnchoredText returns the target tend anchored text indexed under the supplied key
func (*BaseDiagramLink) GetTargetHandle ¶
func (bdl *BaseDiagramLink) GetTargetHandle() *Handle
GetTargetHandle returns the handle associated with the target end
func (*BaseDiagramLink) GetTargetPad ¶
func (bdl *BaseDiagramLink) GetTargetPad() ConnectionPad
GetTargetPad returns the pad (on another DiagramElement) to which the target end is connected
func (*BaseDiagramLink) HideHandles ¶
func (de *BaseDiagramLink) HideHandles()
func (*BaseDiagramLink) IsLink ¶
func (bdl *BaseDiagramLink) IsLink() bool
IsLink returns true because this is a link
func (*BaseDiagramLink) IsNode ¶
func (bdl *BaseDiagramLink) IsNode() bool
IsNode returns false because this is a link
func (*BaseDiagramLink) MouseIn ¶
func (bdl *BaseDiagramLink) MouseIn(event *desktop.MouseEvent)
MouseIn responds to the mouse entering the bounding rectangle of the Link
func (*BaseDiagramLink) MouseMoved ¶
func (bdl *BaseDiagramLink) MouseMoved(event *desktop.MouseEvent)
MouseMoved responds to the mouse moving while within the bounding rectangle of the Link
func (*BaseDiagramLink) MouseOut ¶
func (bdl *BaseDiagramLink) MouseOut()
MouseOut responds to the mouse leaving the bounding rectangle of the Link
func (*BaseDiagramLink) SetBackgroundColor ¶
func (*BaseDiagramLink) SetForegroundColor ¶
func (*BaseDiagramLink) SetHandleColor ¶
func (*BaseDiagramLink) SetProperties ¶
func (de *BaseDiagramLink) SetProperties(properties DiagramElementProperties)
func (*BaseDiagramLink) SetSourcePad ¶
func (bdl *BaseDiagramLink) SetSourcePad(pad ConnectionPad)
SetSourcePad sets the source pad (belonging to another DiagramElement) and adds the link dependency to the diagram
func (*BaseDiagramLink) SetTargetPad ¶
func (bdl *BaseDiagramLink) SetTargetPad(pad ConnectionPad)
SetTargetPad sets the target pad (belonging to another DiagramElement) and adds the link dependency to the diagram
func (*BaseDiagramLink) ShowHandles ¶
func (de *BaseDiagramLink) ShowHandles()
type BaseDiagramNode ¶
type BaseDiagramNode struct { // InnerSize stores size that the inner object should have, may not // be respected if not large enough for the object. InnerSize fyne.Size // MovedCallback, if present, is invoked when the node is moved MovedCallback func() // contains filtered or unexported fields }
BaseDiagramNode represents a node in the diagram widget. It contains an inner widget, and also draws a border, and a "handle" that can be used to drag it around.
func (*BaseDiagramNode) Center ¶
func (bdn *BaseDiagramNode) Center() fyne.Position
Center reurns the position of the center of the node
func (*BaseDiagramNode) CreateRenderer ¶
func (bdn *BaseDiagramNode) CreateRenderer() fyne.WidgetRenderer
CreateRenderer creates the renderer for the diagram node
func (*BaseDiagramNode) Cursor ¶
func (bdn *BaseDiagramNode) Cursor() desktop.Cursor
Cursor returns the desktop default cursor
func (*BaseDiagramNode) DragEnd ¶
func (bdn *BaseDiagramNode) DragEnd()
DragEnd is presently a no-op
func (*BaseDiagramNode) Dragged ¶
func (bdn *BaseDiagramNode) Dragged(event *fyne.DragEvent)
Dragged passes the DragEvent to the diagram for processing
func (*BaseDiagramNode) GetBackgroundColor ¶
func (*BaseDiagramNode) GetConnectionPads ¶
func (de *BaseDiagramNode) GetConnectionPads() map[string]ConnectionPad
func (*BaseDiagramNode) GetDefaultConnectionPad ¶
func (bdn *BaseDiagramNode) GetDefaultConnectionPad() ConnectionPad
GetDefaultConnectionPad returns the edge pad for the node
func (*BaseDiagramNode) GetDiagram ¶
func (de *BaseDiagramNode) GetDiagram() *DiagramWidget
func (*BaseDiagramNode) GetDiagramElementID ¶
func (de *BaseDiagramNode) GetDiagramElementID() string
func (*BaseDiagramNode) GetEdgePad ¶
func (bdn *BaseDiagramNode) GetEdgePad() ConnectionPad
GetEdgePad returns the edge pad for the node
func (*BaseDiagramNode) GetForegroundColor ¶
func (*BaseDiagramNode) GetHandleColor ¶
func (*BaseDiagramNode) GetPadColor ¶
func (*BaseDiagramNode) GetProperties ¶
func (de *BaseDiagramNode) GetProperties() DiagramElementProperties
func (*BaseDiagramNode) HideHandles ¶
func (de *BaseDiagramNode) HideHandles()
func (*BaseDiagramNode) IsLink ¶
func (bdn *BaseDiagramNode) IsLink() bool
IsLink returns false because this is a node
func (*BaseDiagramNode) IsNode ¶
func (bdn *BaseDiagramNode) IsNode() bool
IsNode returns true because this is a node
func (*BaseDiagramNode) Move ¶
func (bdn *BaseDiagramNode) Move(position fyne.Position)
Move moves the node and invokes the callback if present.
func (*BaseDiagramNode) R2Box ¶
func (bdn *BaseDiagramNode) R2Box() r2.Box
R2Box returns the bounding box in r2 coordinates
func (*BaseDiagramNode) R2Center ¶
func (bdn *BaseDiagramNode) R2Center() r2.Vec2
R2Center returns the r2 vector for the center of the bounding box
func (*BaseDiagramNode) R2Position ¶
func (bdn *BaseDiagramNode) R2Position() r2.Vec2
R2Position returns the position of the node as an r2 vector
func (*BaseDiagramNode) SetBackgroundColor ¶
func (*BaseDiagramNode) SetForegroundColor ¶
func (*BaseDiagramNode) SetHandleColor ¶
func (*BaseDiagramNode) SetInnerObject ¶
func (bdn *BaseDiagramNode) SetInnerObject(obj fyne.CanvasObject)
SetInnerObject makes the skupplied canvas object the center of the node
func (*BaseDiagramNode) SetProperties ¶
func (de *BaseDiagramNode) SetProperties(properties DiagramElementProperties)
func (*BaseDiagramNode) ShowHandles ¶
func (de *BaseDiagramNode) ShowHandles()
func (*BaseDiagramNode) Tapped ¶
func (bdn *BaseDiagramNode) Tapped(event *fyne.PointEvent)
Tapped passes the tapped event on to the Diagram
type ConnectionPad ¶
type ConnectionPad interface { fyne.Widget desktop.Hoverable GetPadOwner() DiagramElement GetCenterInDiagramCoordinates() fyne.Position MouseDown(*desktop.MouseEvent) MouseUp(*desktop.MouseEvent) SetPadColor(color.Color) // contains filtered or unexported methods }
ConnectionPad is an interface to a connection shape on a DiagramElement.
type ConnectionTransaction ¶
type ConnectionTransaction struct { LinkPoint *LinkPoint Link DiagramLink InitialPad ConnectionPad InitialPosition fyne.Position PendingPad ConnectionPad }
ConnectionTransaction holds transient data during the creation of a link. It is public for testing purposes only
func NewConnectionTransaction ¶
func NewConnectionTransaction(linkPoint *LinkPoint, link DiagramLink, initialPad ConnectionPad, initialPosition fyne.Position) *ConnectionTransaction
NewConnectionTransaction returns an instance of ConnectionTransaction
type Decoration ¶
type Decoration interface { fyne.Widget SetFillColor(color color.Color) // SetSolid determines whether the stroke color is used to fill the decoration // It has no impact if the decoration is open SetSolid(bool) // SetStrokeColor sets the color to be used for lines in the decoration SetStrokeColor(color color.Color) // SetStrokeWidth sets the width of the lines to be used in the decoration SetStrokeWidth(width float32) // GetReferenceLength returns the length of the decoration along the reference axis GetReferenceLength() float32 // contains filtered or unexported methods }
Decoration is a widget intended to be used as a decoration on a Link widget The graphical representation of the widget is defined along a reference axis with one point on that axis designated as the reference point (generally the origin). Depending on the Link widget's use of the decoration, the reference point will either be aligned with one of the endpoints of the link or with some intermediate point on the link. The Link will move the Decoration's reference point as the link itself is modified. The Link will also determine the slope of the Link's line at the reference point and direct the Decoration to rotate about the reference point to achieve the correct alignment of the decoration with respect to the Link's line. The Link may have more than one decoration stacked along the line at the reference point. To accomplish this, it needs to know the length of the decoration along the reference axis so that it can adjust the position of the next decoration appropriately.
type DiagramElement ¶
type DiagramElement interface { fyne.Widget // GetBackgroundColor returns the background color for the widget GetBackgroundColor() color.Color // GetConnectionPads() returns all of the connection pads on the element GetConnectionPads() map[string]ConnectionPad // GetForegroundColor returns the foreground color for the widget GetForegroundColor() color.Color // GetDefaultConnectionPad returns the default pad for the DiagramElement GetDefaultConnectionPad() ConnectionPad // GetDiagram returns the DiagramWidget to which the DiagramElement belongs GetDiagram() *DiagramWidget // GetDiagramElementID returns the string identifier provided at the time the DiagramElement was created GetDiagramElementID() string // GetHandle returns the handle with the indicated index name GetHandle(string) *Handle // GetHandleColor returns the color for the element's handles GetHandleColor() color.Color // GetPadColor returns the color for the element's pads GetPadColor() color.Color // GetProperties returns the properties of the DiagramElement GetProperties() DiagramElementProperties // HideHandles hides the handles on the DiagramElement HideHandles() // IsLink returns true if the diagram element is a link IsLink() bool // IsNode returns true of the diagram element is a node IsNode() bool // Position returns the position of the diagram element Position() fyne.Position // SetForegroundColor sets the foreground color for the widget SetForegroundColor(color.Color) // SetBackgroundColor sets the background color for the widget SetBackgroundColor(color.Color) // SetProperties sets the foreground, background, and handle colors SetProperties(DiagramElementProperties) // ShowHandles shows the handles on the DiagramElement ShowHandles() // Size returns the size of the diagram element Size() fyne.Size // contains filtered or unexported methods }
DiagramElement is a widget that can be placed directly in a diagram. The most common elements are Node and Link widgets.
type DiagramElementProperties ¶
type DiagramElementProperties struct { ForegroundColor color.Color BackgroundColor color.Color HandleColor color.Color PadColor color.Color TextSize float32 CaptionTextSize float32 Padding float32 StrokeWidth float32 PadStrokeWidth float32 HandleStrokeWidth float32 }
DiagramElementProperties are the rendering properties of a DiagramElement
type DiagramLink ¶
type DiagramLink interface { DiagramElement GetLinkPoints() []*LinkPoint GetSourcePad() ConnectionPad GetSourceHandle() *Handle GetTargetPad() ConnectionPad GetTargetHandle() *Handle SetSourcePad(ConnectionPad) SetTargetPad(ConnectionPad) // contains filtered or unexported methods }
DiagramLink is a DiagramElement that connects two other DiagramElements
type DiagramNode ¶
type DiagramNode interface { DiagramElement GetEdgePad() ConnectionPad R2Center() r2.Vec2 SetInnerObject(fyne.CanvasObject) // contains filtered or unexported methods }
DiagramNode is a rectangular DiagramElement typically containing one or more widgets
func NewDiagramNode ¶
func NewDiagramNode(diagram *DiagramWidget, obj fyne.CanvasObject, nodeID string) DiagramNode
NewDiagramNode creates a DiagramNode widget and adds it to the DiagramWidget. The user-supplied nodeID string must be unique across all of the DiagramElements in the diagram. It can be used to retrieve the DiagramNode from the DiagramWidget. It is permissible for the canvas object to be nil when this function is called and then add the canvas object later.
type DiagramWidget ¶
type DiagramWidget struct { widget.BaseWidget // ID is expected to be unique across all DiagramWidgets in the application. ID string Offset fyne.Position // DesiredSize specifies the size of the displayed diagram. Defaults to 800 x 600 DesiredSize fyne.Size DefaultDiagramElementProperties DiagramElementProperties DiagramElements *list.List // ConnectionTransaction holds transient data during the creation of a link. It is public for testing purposes ConnectionTransaction *ConnectionTransaction // IsConnectionAllowedCallback is called to determine whether a particular connection between a link and a pad is allowed IsConnectionAllowedCallback func(DiagramLink, LinkEnd, ConnectionPad) bool // LinkConnectionChangedCallback is called when a link connection changes. The string can either be // "source" or "target". The first pad is the old pad, the second one is the new pad LinkConnectionChangedCallback func(DiagramLink, string, ConnectionPad, ConnectionPad) // LinkSegmentMouseDownSecondaryCallback is called when a secondary button MouseDown occurs in a link segment LinkSegmentMouseDownSecondaryCallback func(DiagramLink, *desktop.MouseEvent) // LinkSegmentMouseUpCallback is called when a MouseUp occurs in a link segment and it was either the // secondary button or it was the primary button but at a different location than the MouseDown LinkSegmentMouseUpCallback func(DiagramLink, *desktop.MouseEvent) // MouseDownCallback is called when a MouseDown occurs in the diagram MouseDownCallback func(*desktop.MouseEvent) // MouseInCallback is called when a MouseIn occurs in the diagram MouseInCallback func(*desktop.MouseEvent) // MouseMovedCallback is called when a MouseMove occurs in the diagram MouseMovedCallback func(*desktop.MouseEvent) // MouseOutCallback is called when a MouseOut occurs in the diagram MouseOutCallback func() // MouseUpCallback is invoked when a MouseUp occurs in the diagram MouseUpCallback func(*desktop.MouseEvent) // OnTappedCallback is called when the diagram background is tapped. If present, it overrides the default // diagram behavior for Tapped() OnTappedCallback func(*DiagramWidget, *fyne.PointEvent) // PrimaryDiagramElementSelectionChangedCallback is called when the primary element selection changes PrimaryDiagramElementSelectionChangedCallback func(string) // ElementTappedExtendsSelection determines the behavior when one or more elements are already selected and // an element that is not currently selected is tapped. When true, the new element is added to the selection. // When false, the selection is cleared and the new element is made the only selected element. ElementTappedExtendsSelection bool // contains filtered or unexported fields }
DiagramWidget maintains a diagram consisting of DiagramNodes and DiagramLinks. The layout of the nodes and links does not change when the DiagramWidget is resized: they are either positioned manually (interactively) or programmatically.
func NewDiagramWidget ¶
func NewDiagramWidget(id string) *DiagramWidget
NewDiagramWidget creates a DiagramWidget. The user-supplied ID can be used to map the diagram to data structures within the of the application. It is expected to be unique within the application
func (*DiagramWidget) BringForward ¶
func (dw *DiagramWidget) BringForward(elementID string)
BringForward moves the diagram element on top of the next element of the display list
func (*DiagramWidget) BringToFront ¶
func (dw *DiagramWidget) BringToFront(elementID string)
BringToFront moves the diagram element to the top of the display list (which is the back of the DiagramElements list)
func (*DiagramWidget) ClearSelection ¶
func (dw *DiagramWidget) ClearSelection()
ClearSelection clears the selection and invokes the PrimaryDiagramElementSelectionChangedCallback
func (*DiagramWidget) ClearSelectionNoCallback ¶
func (dw *DiagramWidget) ClearSelectionNoCallback()
ClearSelectionNoCallback clears the selection. It does not invoke the PrimaryDiagramElementSelectionChangedCallback
func (*DiagramWidget) CreateRenderer ¶
func (dw *DiagramWidget) CreateRenderer() fyne.WidgetRenderer
CreateRenderer creates the renderer for the diagram
func (*DiagramWidget) Cursor ¶
func (dw *DiagramWidget) Cursor() desktop.Cursor
Cursor returns the default cursor
func (*DiagramWidget) DiagramElementTapped ¶
func (dw *DiagramWidget) DiagramElementTapped(de DiagramElement)
DiagramElementTapped adds the element to the selection when the element is tapped
func (*DiagramWidget) DiagramNodeDragged ¶
func (dw *DiagramWidget) DiagramNodeDragged(node *BaseDiagramNode, event *fyne.DragEvent)
DiagramNodeDragged moves the indicated node and refreshes any links that may be attached to it
func (*DiagramWidget) DisplaceNode ¶
func (dw *DiagramWidget) DisplaceNode(node DiagramNode, delta fyne.Position)
DisplaceNode moves the indicated node, refreshes any links that may be attached to it, and adjusts the bounds of the drawing area
func (*DiagramWidget) GetBackgroundColor ¶
func (dw *DiagramWidget) GetBackgroundColor() color.Color
GetBackgroundColor returns the background color for the widget from the diagram's theme, which may be different from the application's theme.
func (*DiagramWidget) GetDiagramElement ¶
func (dw *DiagramWidget) GetDiagramElement(elementID string) DiagramElement
GetDiagramElement returns the diagram element with the specified ID, whether it is a node or a link
func (*DiagramWidget) GetDiagramElements ¶
func (dw *DiagramWidget) GetDiagramElements() []DiagramElement
GetDiagramElements returns an array all of the diagram's DiagramElements
func (*DiagramWidget) GetDiagramLink ¶
func (dw *DiagramWidget) GetDiagramLink(id string) DiagramLink
GetDiagramLink returns the diagram link with the indicated ID
func (*DiagramWidget) GetDiagramLinks ¶
func (dw *DiagramWidget) GetDiagramLinks() []DiagramLink
GetDiagramLinks returns a map of all of the diagram's DiagramElements
func (*DiagramWidget) GetDiagramNode ¶
func (dw *DiagramWidget) GetDiagramNode(id string) DiagramNode
GetDiagramNode returns the diagram node with the indicated ID
func (*DiagramWidget) GetDiagramNodes ¶
func (dw *DiagramWidget) GetDiagramNodes() []DiagramNode
GetDiagramNodes returns a map of all of the diagram's DiagramElements
func (*DiagramWidget) GetForegroundColor ¶
func (dw *DiagramWidget) GetForegroundColor() color.Color
GetForegroundColor returns the foreground color from the diagram's theme, which may be different from the application's theme
func (*DiagramWidget) GetPrimarySelection ¶
func (dw *DiagramWidget) GetPrimarySelection() DiagramElement
GetPrimarySelection returns the diagram element that is currently selected
func (*DiagramWidget) IsSelected ¶
func (dw *DiagramWidget) IsSelected(de DiagramElement) bool
IsSelected returns true if the indicated element is currently part of the selection
func (*DiagramWidget) RemoveElement ¶
func (dw *DiagramWidget) RemoveElement(elementID string)
RemoveElement removes the element from the diagram. It also removes any linkss to the element
func (*DiagramWidget) SelectDiagramElement ¶
func (dw *DiagramWidget) SelectDiagramElement(element DiagramElement)
SelectDiagramElement clears the selection, makes the indicated element the primary selection, and invokes the PrimaryDiagramElementSelectionChangedCallback
func (*DiagramWidget) SelectDiagramElementNoCallback ¶
func (dw *DiagramWidget) SelectDiagramElementNoCallback(id string)
SelectDiagramElementNoCallback makes the indicated element the PrimarySelection. It does not invoke the PrimaryDiagramElementSelectionChangedCallback
func (*DiagramWidget) SendBackward ¶
func (dw *DiagramWidget) SendBackward(elementID string)
SendBackward moves the diagram element on top of the next element of the display list
func (*DiagramWidget) SendToBack ¶
func (dw *DiagramWidget) SendToBack(elementID string)
SendToBack moves the diagram element to the top of the display list (which is the front of the DiagramElements list)
func (*DiagramWidget) StartNewLinkConnectionTransaction ¶
func (dw *DiagramWidget) StartNewLinkConnectionTransaction(link DiagramLink)
StartNewLinkConnectionTransaction starts the process of adding a link, setting up for the source connection
type Handle ¶
type Handle struct { widget.BaseWidget // contains filtered or unexported fields }
Handle is a widget used to manipulate the size or shape of its owning DiagramElement
func NewHandle ¶
func NewHandle(diagramElement DiagramElement) *Handle
NewHandle creates a handle for the specified DiagramElement
func (*Handle) CreateRenderer ¶
func (h *Handle) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is the required method for the Handle widget
func (*Handle) DragEnd ¶
func (h *Handle) DragEnd()
DragEnd passes the event on to the owning DiagramElement
type LinkPoint ¶
type LinkPoint struct { widget.BaseWidget // contains filtered or unexported fields }
LinkPoint identifies the point at which a link end is connected to another diagram element's connection pad
func NewLinkPoint ¶
func NewLinkPoint(link DiagramLink) *LinkPoint
NewLinkPoint creates an instance of a LinkPoint for a specific DiagramLink
func (*LinkPoint) CreateRenderer ¶
func (lp *LinkPoint) CreateRenderer() fyne.WidgetRenderer
CreateRenderer creates the renderere for a LinkPoint
func (*LinkPoint) GetLink ¶
func (lp *LinkPoint) GetLink() DiagramLink
GetLink returns the Link to which the LinkPoint belongs
func (*LinkPoint) IsConnectionAllowed ¶
func (lp *LinkPoint) IsConnectionAllowed(connectionPad ConnectionPad) bool
IsConnectionAllowed returns true if a connection is permitted with the indicated pad. The question is passed to the owning link
type LinkSegment ¶
type LinkSegment struct { widget.BaseWidget // contains filtered or unexported fields }
LinkSegment is a widget representing a single line segment belonging to a link
func NewLinkSegment ¶
func NewLinkSegment(link *BaseDiagramLink, p1 fyne.Position, p2 fyne.Position) *LinkSegment
NewLinkSegment returns a LinkSegment belonging to the indicated Link
func (*LinkSegment) CreateRenderer ¶
func (ls *LinkSegment) CreateRenderer() fyne.WidgetRenderer
CreateRenderer creates the renderer for the LinkSegment
func (*LinkSegment) MouseDown ¶
func (ls *LinkSegment) MouseDown(event *desktop.MouseEvent)
MouseDown behavior depends upon the mouse event. If it is the primary button, it records the locateion of the MouseDown in preparation for a MouseUp at the same location, which will trigger Tapped() behavior. Otherwise, if it is the seconday button and a callback is present, it will invoke the callback
func (*LinkSegment) MouseUp ¶
func (ls *LinkSegment) MouseUp(event *desktop.MouseEvent)
MouseUp behavior depends on the mouse event. If it is the primary button and it is at the same location as the MouseDown, the Tapped() behavior is invoked. Otherwise, if there is a callback present, the callback is invoked.
func (*LinkSegment) SetPoints ¶
func (ls *LinkSegment) SetPoints(p1 fyne.Position, p2 fyne.Position)
SetPoints sets the endpoints of the LinkSegment
type PointPad ¶
type PointPad struct { widget.BaseWidget // contains filtered or unexported fields }
PointPad is a ConnectionPad consisting of a single point (the Position of the PointPad)
func NewPointPad ¶
func NewPointPad(padOwner DiagramElement) *PointPad
NewPointPad creates a PointPad and associates it with the DiagramElement. Note that, by default, the position of the PointPad will be (0,0), i.e. the origin of the DiagramElement.
func (*PointPad) CreateRenderer ¶
func (pp *PointPad) CreateRenderer() fyne.WidgetRenderer
CreateRenderer creates the WidgetRenderer for a PointPad
func (*PointPad) GetCenterInDiagramCoordinates ¶
func (pp *PointPad) GetCenterInDiagramCoordinates() fyne.Position
GetCenterInDiagramCoordinates returns the position in diagram coordinates
func (*PointPad) GetPadOwner ¶
func (cp *PointPad) GetPadOwner() DiagramElement
func (*PointPad) MouseDown ¶
func (pp *PointPad) MouseDown(event *desktop.MouseEvent)
MouseDown responds to mouse down events
func (*PointPad) MouseIn ¶
func (pp *PointPad) MouseIn(event *desktop.MouseEvent)
MouseIn responds to mouse movements within the pointPadSize distance of the center
func (*PointPad) MouseMoved ¶
func (pp *PointPad) MouseMoved(event *desktop.MouseEvent)
MouseMoved responds to mouse movements within the pointPadSize distance of the center
func (*PointPad) MouseOut ¶
func (pp *PointPad) MouseOut()
MouseOut responds to mouse movements within the pointPadSize distance of the center
func (*PointPad) MouseUp ¶
func (pp *PointPad) MouseUp(event *desktop.MouseEvent)
MouseUp responds to mouse up events
func (*PointPad) SetPadColor ¶
SetPadColor sets the color to be used in rendering the pad
type Polygon ¶
type Polygon struct { widget.BaseWidget // StrokeWidth is the width of the polygon perimeter line StrokeWidth float32 // StrokeColor is the color of the polygon perimeter line StrokeColor color.Color // FillColor is the color if the polygon interior. A nil value indicates // no fill FillColor color.Color // contains filtered or unexported fields }
Polygon defines a canvas object which renders a polygon defined with respect to a reference point (the Position of the canvas object). The polygon is intended to be a decoration on a line. The nominal definition of the polygon assumes that the nominal line lays along the X axis extending to the right of the reference point. The polygon is defined as a series of points, with (0,0) corresponting to the the polygon's Position. When rendered, the polygon is rotated by the BaseAngle. The BaseAngle is supplied by the Link for which the Polygon is a decoration. By default, the polygon is a closed structure that can optionally be filled by providing p fill color (the default is no fill). SetClosed(false) can be used to make the structure open, which makes it a polyline. Fill color is ignored in this case. By default, stroke color and fill color are color.Black
func NewPolygon ¶
func NewPolygon(definingPoints []fyne.Position) *Polygon
NewPolygon creates a Polygon as defined by the supplied points
func (*Polygon) CreateRenderer ¶
func (p *Polygon) CreateRenderer() fyne.WidgetRenderer
CreateRenderer creates an instance of the renderer for the Polygon
func (*Polygon) GetReferenceLength ¶
GetReferenceLength returns the length of the decoration along the reference axis
func (*Polygon) MinSize ¶
func (p *Polygon) MinSize() fyne.Size
MinSize returns the minimum size based on nominal polygon points, base angle, and stroke width
func (*Polygon) SetClosed ¶
SetClosed determines whether the polygon is open or closed. A value of false makes the polygon a polyline
func (*Polygon) SetFillColor ¶
SetFillColor sets the color that will be used for the polygon interior A nil value indicates there is no fill
func (*Polygon) SetSolid ¶
SetSolid determines whether the foreground color should be used to fill the polygon. It has no effect if the polygon is open instead of closed
func (*Polygon) SetStrokeColor ¶
SetStrokeColor sets the color that will be used for the polygon perimeter
func (*Polygon) SetStrokeWidth ¶
SetStrokeWidth sets the width of the linke that will be used for the polygon perimeter
type RectanglePad ¶
type RectanglePad struct { widget.BaseWidget // contains filtered or unexported fields }
RectanglePad provides a ConnectionPad corresponding to the perimeter of the DiagramElement owning the pad.
func NewRectanglePad ¶
func NewRectanglePad(padOwner DiagramElement) *RectanglePad
NewRectanglePad creates a RectanglePad and associates it with the DiagramElement. The size of the pad becomes the size of the padOwner.
func (*RectanglePad) CreateRenderer ¶
func (rp *RectanglePad) CreateRenderer() fyne.WidgetRenderer
CreateRenderer creates the WidgetRenderer for the RectanglePad
func (*RectanglePad) GetCenterInDiagramCoordinates ¶
func (rp *RectanglePad) GetCenterInDiagramCoordinates() fyne.Position
GetCenterInDiagramCoordinates returns the center of the pad in the diagram's coordinate system
func (*RectanglePad) GetPadOwner ¶
func (cp *RectanglePad) GetPadOwner() DiagramElement
func (*RectanglePad) MouseDown ¶
func (rp *RectanglePad) MouseDown(event *desktop.MouseEvent)
MouseDown responds to mouse down events
func (*RectanglePad) MouseIn ¶
func (rp *RectanglePad) MouseIn(event *desktop.MouseEvent)
MouseIn responds to the mouse entering the bounds of the RectanglePad
func (*RectanglePad) MouseMoved ¶
func (rp *RectanglePad) MouseMoved(event *desktop.MouseEvent)
MouseMoved responds to mouse movements within the rectangle pad
func (*RectanglePad) MouseOut ¶
func (rp *RectanglePad) MouseOut()
MouseOut responds to mouse movements leaving the rectangle pad
func (*RectanglePad) MouseUp ¶
func (rp *RectanglePad) MouseUp(event *desktop.MouseEvent)
MouseUp responds to mouse up events
func (*RectanglePad) SetPadColor ¶
func (rp *RectanglePad) SetPadColor(c color.Color)
SetPadColor sets the color to be used in rendering the pad