flatland.utils.editor_view module#

class flatland.utils.editor_view.View(editor: AbstractModel, sGL='MPL', screen_width=800, screen_height=800)[source]#

Bases: AbstractView

The Jupyter Editor View - creates and holds the widgets comprising the Editor.

clear_output(oDummy)[source]#
display()[source]#
drag_path_element(x, y)[source]#

Add another x,y point to a drag gesture. Just draw a black square on the in-memory copy of the image. With ipyCanvas, we need to adjust the Event x,y coordinates to image x,y.

draw_stroke()[source]#
init_canvas()[source]#
init_widgets()[source]#
log(*args, **kwargs)[source]#
new_env()[source]#

Tell the view to update its graphics when a new env is created.

redisplay_image()[source]#

Redisplay the writable image in the Canvas. Called during image editing, when minor changes are made directly to the image, between redraws.

redraw()[source]#

Redraw the environment and agents. This will erase the current image and draw a new one. See also redisplay_image()

xy_to_rc(x, y)[source]#

Convert from x,y coordinates to row,col coordinates. This is used to convert mouse clicks to row,col coordinates.