Shape is an abstract JavaScript object from which other shape-manipulating objects are sub-classed. This code is used in the 2D Geometry section of this site.
Shape inherits from the EventHandler object.
constructor - new Shape(svgNode);
This method creates a new Shape object. All initialization is handled by the init() method.
init() initialized all properties for this object.
svgNode is a reference to the SVG node that is being managed by this object.
show() controls the visibility of the SVG node that is being managed by this object.
refresh() applies the handle positions to the SVG element associated with this object.
update() calls the callback, if defined, associated with this object.
translate() translates the SVG element and the associated handles by the specified amount.
delta is a Point2D.
select() sets the selected flag of this object.
registerHandles() adds all handles used by this object to the mouser's handle list.
unregisterHandles() removes all handles used by this object from the mouser's handle list.
selectHandles() set the current select value for all handles used by this object.
showHandles() sets the current visibility value for all handles used by this object.
mousedown(e);
mousedown() handles a mousedown event that is fired on the SVG node managed by this object. This method manipulates the currently selected shapes and handles.
svgNode is the SVG DOM node that is being managed by this object.
locked is a Boolean that determines if this object can be selected or not
visible is a Boolean that determines if the SVG graphic is visible or not.
selected is a Boolean that determines if this object is selected or not.
callback is a function reference that will be invoked each time this object is updated.
lastUpdate is used by the mouser when determining which shapes have been effected by a drag.
Shape.js - the shape object only...cannot be used in isolation
2D.js.gz - all objects needed to use this object and other 2D geometry objects