arrow_designer module¶
Arrow tip designer for reaction plugin.
Version 0.01: Author: Gary Geng (2020)
- class arrow_designer.ArrowDesigner[source]
The ArrowDesigner plugin that subclasses WindowedPlugin.
- OnRestore(evt)[source]
Update the arrow point to be set to default values.
- OnSave(evt)[source]
Handler for the “save” button. Save the new arrow tip.
- create_window(dialog)[source]
Called when creating a window. Create the designer window as well as control buttons.
- class arrow_designer.DesignerWindow(parent, arrow_tip)[source]
The arrow designer window.
- Parameters
arrow_tip (
ArrowTip) –
- OnLeftDown(evt)[source]
Handler for mouse left button down event.
- Parameters
evt (
MouseEvent) –
- OnLeftUp(evt)[source]
Handler for mouse left button up event.
- Parameters
evt (
MouseEvent) –
- OnMotion(evt)[source]
Handler for mouse motion events.
- Parameters
self – the Designer Window to initialize.
evt (
MouseEvent) – the event being executed.
- OnPaint(evt)[source]
Overrides wx Paint event to draw the grid, arrow, etc. as if on a canvas.
- Parameters
self – the Designer Window to initialize.
evt – the event being executed.
- draw_background(gc)[source]
Drawing the gridlines background.
- Parameters
gc (
GraphicsContext) –
- draw_point(gc, point, radius)[source]
Drawing a single point.
- Parameters
gc (
GraphicsContext) – Graphics context to modify.point (
Vec2) – Point to be drawn.radius (
float) – Radius of the point.
- draw_points(gc, points, radius)[source]
Drawing points for arrow.
- Parameters
gc (
GraphicsContext) – The Graphics context to modify.points (
List[Vec2]) – The points to be drawn, in counterclockwise order, with the last point being the tip.radius (
float) – The radius of the points.
- projected_landing(point)[source]
Return the projected discrete landing point for the cursor.
This is to make sure the user sees where the dragged arrow tip point will be dropped on the grid.