Namespace vonline.Base
Defined in: base.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Base class for canvas objects
|
Field Attributes | Field Name and Description |
---|---|
<static> |
vonline.Base.defaultData
default values and json format specification
|
Method Attributes | Method Name and Description |
---|---|
sets the correct position of the inlined text
|
|
changeText(text)
|
|
clickEventHandler(event)
|
|
returns the object id
|
|
creates a text within the object
|
|
dragEventHandler(event)
catches the mouse events
|
|
fitsIn(bounding)
Checks if bounding contains the current object
|
|
getId()
|
|
isConnectedTo(obj)
tests if an object with given id is connected to the current object
|
|
setAnnotationMode(active)
show annotation handles
|
|
setCanvas(canvas)
Displays the element on the canvas
|
|
setClickEventMode(active)
|
|
setColor(color)
|
|
setConnectionMode(active)
show connection handles
|
|
setDragEventMode(objects, ondrag)
|
|
setPosition(x, y)
Set the position of the component
Note that this function sets the absolute position by the top-left corner of the bounding box
|
|
setRotation(deg)
|
|
setRotationMode(active)
|
|
setScale(x, y, origX, origY)
|
|
setSelection(active, selected)
|
|
setTextMode(active)
enables/disables the object text show/hide event
|
|
setTranslation(x, y)
Translates the object by the given values
|
|
toJSON()
Returns the JSON representation of the object
|
|
updates rotation-circle and rotation-handle on object changes
|
|
updateSelection(controls)
|
Field Detail
<static>
vonline.Base.defaultData
default values and json format specification
Method Detail
adjustText()
sets the correct position of the inlined text
changeText(text)
- Parameters:
- {string} text
clickEventHandler(event)
- Parameters:
- event
createObjectId()
returns the object id
createText()
creates a text within the object
dragEventHandler(event)
catches the mouse events
- Parameters:
- event
fitsIn(bounding)
Checks if bounding contains the current object
- Parameters:
- {object} bounding
- Specified by (x, y, width, height)
getId()
isConnectedTo(obj)
tests if an object with given id is connected to the current object
- Parameters:
- {vonline.Base} obj
isResizeable()
setAnnotationMode(active)
show annotation handles
- Parameters:
- active
setBorder()
setCanvas(canvas)
Displays the element on the canvas
- Parameters:
- {vonline.Canvas} canvas
setClickEventMode(active)
- Parameters:
- {boolean} active
setColor(color)
- Parameters:
- {string} color
- See:
- http://raphaeljs.com/reference.html#colour
setConnectionMode(active)
show connection handles
- Parameters:
- active
setDragEventMode(objects, ondrag)
- Parameters:
- {vonline.Base / array} objects
- {function} ondrag
- (optional) is executed on drag (e.g. for updating interface)
setPosition(x, y)
Set the position of the component
Note that this function sets the absolute position by the top-left corner of the bounding box
- Parameters:
- {integer} x
- {integer} y
setRotation(deg)
- Parameters:
- {int} deg
- Degree between 0...360°
setRotationMode(active)
- Parameters:
- {boolean} active
setScale(x, y, origX, origY)
- Parameters:
- {float} x
- {float} y
- {number} origX
- {number} origY
setSelection(active, selected)
- Parameters:
- {boolean} active
- {number} selected
- Number of selected objects
setTextMode(active)
enables/disables the object text show/hide event
- Parameters:
- active
setTranslation(x, y)
Translates the object by the given values
- Parameters:
- {integer} x
- {integer} y
{json}
toJSON()
Returns the JSON representation of the object
- Returns:
- {json} this.data
updateAnnotationHandle()
updateConnectionHandles()
updateInlineTextHandle()
updateRotationHandles()
updates rotation-circle and rotation-handle on object changes
updateSelection(controls)
- Parameters:
- {boolean} controls
- Show controls