Skip to content

Editor Classes

Information about the various classes that add the editing functionalities on top of hall2d.
These classes provide the functionality inside the canvas, and\or behind the scenes.

For the UI Components see Components.

Editor2D

Gateway into the editor.
After the floorplan & objects are drawn, it initializes all editor-related classes.

EditorObjectManager

Manages the relation between hall2d objects and editor object -
adds editor objects "on top" of the hall2d objects & initializes object editing related classes.

EditorObjectActions

Reacts to events emitted by the EditorObject(s) on the canvas. (e.g. mouseDown, mouseUp)
Responsible for things like showing\hiding the BoundRects, updating smart guidelines, etc.

EditorObjectReactions

Reacts to any changes in global stores (e.g. Hall2DEditorStore).
These changes represent the state of the canvas changing, and acts accordingly.

📝 Example
We don't want to show the BoundRect(s) for objects while we're panning the canvas,
so instead of explicitly hiding them then, we react to the state of pan\not panning, and hide them accordingly.

The idea is to provide one place that applies the same action for different states.

ObjectsUpdateQueue

Keeps track of changes in the layout - new\removed objects, and edited object.
Periodically (5s) sends updates to the server with these changes.

EditorObjectFactory

A factory class that creates EditorObject(s), or classes derived from them.
Currently decides which EditorObject to create by its hall2d object class (e.g. TableEditorTable).
In the future, we might decide which editor class to create by the object's subtype, or any other property.

EditorObject

Base class for all editor objects, composed of a LayoutObject (see Hall2D Objects),
giving it editing abilities both on the canvas, and by exposing functions that change its data.
(Canvas editing abilities are, for example, dragging, rotating, etc.)

🔗 Extending
Any object that needs unique editing abilities can extend this class to do so.
In such cases, hall2d should (probably) have a corresponding object extended from LayoutObject, just like Table and EditorTable.

EditorTable

Extended from EditorObject, provides extra editing abilities for dynamic tables.
(e.g. resizing, chair editing)

EditorGroup

Comoposed of LayoutGroup, and adds editing functionalities to it.
(e.g. dragging, rotating etc.)