The main class for tracking Stencils that are cretaed, added, selected, or deleted. Also handles selections, multiple selections, adding and removing from selections, and dragging selections. It's this class that triggers the anchors to appear on a Stencil and whther there are anchor on a multiple select or not (currently not)
| Parameter | Type | Description |
|---|---|---|
| options | undefined |
Deletes a stencil. NOTE: supports limited undo.
| Parameter | Type | Description |
|---|---|---|
| stencil | Object |
Deselect passed stencil
| Parameter | Type | Description |
|---|---|---|
| stencil | Object |
Collects all Stencil data and returns an Array of objects.
Returns the stencil most recently interacted with whether it's last created or last selected
Returns number of selected (generally used as truthy or falsey)
Returns if passed stencil is selected or not based on internal collection, not on stencil boolean
| Parameter | Type | Description |
|---|---|---|
| stencil | Object |
Key method for adding Stencils. Stencils can be added to the canvas without adding them to this, but they won't have selection or drag ability.
| Parameter | Type | Description |
|---|---|---|
| stencil | Object |
Internal. Used for the prototype undo stack. Saves selection position.
Internal. Used for the prototype undo stack. Prevents an undo point on every mouse move. Only does a point when the mouse hesitates.
Method used to select a stencil.
| Parameter | Type | Description |
|---|---|---|
| idOrItem | String | Object |
Internal. Gets all selected stencils' coordinates and determines how far left and up the selection can go without going below zero
Keeps track of the most recent stencil interacted with, whether created or selected.
| Parameter | Type | Description |
|---|---|---|
| stencil | undefined |
Internal. Creates a new selection group used to hold selected stencils.
Convenience function calls function within all selected stencils
| Parameter | Type | Description |
|---|---|---|
| func | String |
Undeletes a stencil. Used in undo stack.
| Parameter | Type | Description |
|---|---|---|
| stencils | Array |
Method for removing Stencils from the manager. This doesn't delete them, only removes them from the list.
| Parameter | Type | Description |
|---|---|---|
| stencil | Object |
Convenience function calls function on all selected stencils
| Parameter | Type | Description |
|---|---|---|
| func | Function |
Convenience function calls function on all stencils
| Parameter | Type | Description |
|---|---|---|
| func | Function |
Convenience function calls function on all stencils that are not selected
| Parameter | Type | Description |
|---|---|---|
| func | Function |
Moves selection based on keyboard arrow keys
| Parameter | Type | Description |
|---|---|---|
| evt | Key Event |
Event fired at the beginning of a stencil drag
| Parameter | Type | Description |
|---|---|---|
| obj | EventObject |
Event fired on deletion of a stencil
| Parameter | Type | Description |
|---|---|---|
| noundo | Boolean |
Event fired on deselection of a stencil
| Parameter | Type | Description |
|---|---|---|
| stencil | undefined | |
| keepObject | undefined |
Event fired on mousedown on the canvas
| Parameter | Type | Description |
|---|---|---|
| obj | EventObject |
Event fired at the end of a stencil drag
| Parameter | Type | Description |
|---|---|---|
| obj | EventObject |
Event to connect a textbox to for label edits
| Parameter | Type | Description |
|---|---|---|
| obj | EventObject |
Event fired on mousedown of a stencil's label Because it's an annotation the id will be the master stencil.
| Parameter | Type | Description |
|---|---|---|
| obj | EventObject | |
| evt | undefined |
| Parameter | Type | Description |
|---|---|---|
| obj | EventObject |
Event fired on selection of a stencil
| Parameter | Type | Description |
|---|---|---|
| stencil | Object |
Event fired on the double-click of a stencil
| Parameter | Type | Description |
|---|---|---|
| obj | EventObject |
Event fired on mousedown on a stencil
| Parameter | Type | Description |
|---|---|---|
| obj | EventObject | |
| evt | undefined |
Event fired on every mousemove of a stencil drag
| Parameter | Type | Description |
|---|---|---|
| obj | EventObject |
This restores the cursor.
| Parameter | Type | Description |
|---|---|---|
| obj | undefined |
This changes the cursor when hovering over a selectable stencil.
| Parameter | Type | Description |
|---|---|---|
| obj | undefined |
Event fired on mouseup off of a stencil
| Parameter | Type | Description |
|---|---|---|
| obj | EventObject |