dojox/drawing/tools/custom/Axes (version 1.10)

dojox/drawing/stencil/Path

Summary

Draws a right-angle Axes (shaped like an L, not a +)

This Stencil is created with a Path so that the L shape is one continuous piece. Arrow heads are placed at the end of each axis. The Axes can be rotated. There are custom label methods.

Usage

var foo = new Axes(options);
dojox/drawing/tools/custom/Axes
Parameter Type Description
options undefined

Property Summary

Method Summary

  • _create(shp,sty) Creates a dojox.gfx.shape based on passed arguments.
  • _postSetPoints(pts) Because Axes only has one anchor, we substitute a special setPoints method
  • _setNodeAtts(shape) Internal.
  • _toggleSelected()
  • addShadow(args)
  • anchorPositionCheck(x,y,anchor) Gets called from anchor to check if its current position is ok.
  • animate(options,create)
  • applyTransform(mx) Applies the transform to the stencil NOTE: PARTIALLY IMPLEMENTED.
  • attr(key,value) Changes properties in the style or disabled styles, depending on whether the object is enabled.
  • checkClosePoint(firstPt,currPt,remove) Checks if points are close enough to indicate that path should be close.
  • connect(o,e,s,m,once) Convenience method for quick connects See comments below for possiblities functions can be strings
  • connectMouse() Internal.
  • connectMult() Convenience method for batches of quick connects Handles are not returned and therefore cannot be disconnected until Shape destroy time
  • createLabels() Creates the label for each axis.
  • dataToPoints(o) Converts data to points.
  • deselect(useDelay) Called when the Stencil is deselected.
  • destroy() Destroys this Stencil
  • disable() Disables Stencil so it is not selectable.
  • disconnect(handles) Removes connections based on passed handles arguments
  • disconnectMouse() Internal.
  • enable() Enables Stencil so it is not selectable (if it was selectable to begin with).
  • exporter() Exports Stencil data
  • getAngle() Gets angle of Stencil NOTE: Only works for Lines, Arrows, Vectors and Axes (works on points, not transforms)
  • getBounds(absolute) Custom getBounds overwrites _Base.getBounds
  • getLabel() Getter for the labels. returns an object.
  • getRadius() Possibility of z-axis makes bounds unreliable.
  • getTransform() Returns the current transform (position) of the Stencil's container
  • highlight() Changes style to the highlight theme.
  • moveToBack() Moves Stencil to the back of all other items on the canvas.
  • moveToFront() Moves Stencil to the front of all other items on the canvas.
  • pointsToData() Converts points to data.
  • preventNegativePos() Internal.
  • remove() Removes shape(s), typically before a re-render No args defaults to this.shape Pass in multiple args to remove multiple shapes
  • removeShadow()
  • render() Renders the 'hit' object (the shape used for an expanded hit area and for highlighting) and the'shape' (the actual display object).
  • select() Called when the Stencil is selected.
  • setData(data) Setter for Stencil data; also converts data to points.
  • setLabel(value) Set the text of the labels.
  • setLabelX() Custom placement for x-axis label
  • setLabelY() Custom placement for y-axis label
  • setLabelZ() Custom placement for z-axis label
  • setPoints(points) Setter for Stencil points; also converts points to data.
  • setTransform(mx) Sets the transform to the stencil NOTE: PARTIALLY IMPLEMENTED.
  • transformPoints(mx) Moves object to a new X Y location mx is additive.
  • unhighlight() Changes style to the current theme.
  • zPoint(obj) Finds the point for the z axis.
  • zSet()

Event Summary

  • _onPostRender(data) Drag-create or programmatic create calls onRender and afterwards, _onPostRender is called and manages further events.
  • onBeforeRender(stencil) Stub - Fires before render occurs.
  • onChangeData(stencil) Stub - fires on change of dimensional properties or a text change
  • onChangeStyle(stencil) Fires when styles of shape has changed
  • onChangeText(value)
  • onDelete(stencil) Stub - fires before this is destroyed
  • onDown(obj) Mouse event, fired on mousedown on canvas
  • onDrag(obj) See stencil._Base.onDrag
  • onModify(stencil) Stub - fires on change of any property, including style properties
  • onMove(obj) Mouse event, fired on mousemove while mouse is not down.
  • onRender(stencil) Stub - Fires on creation.
  • onTransform(anchor) Overwrites _Base.onTransform
  • onTransformBegin(anchor) Overwrites _Base.onTransformBegin
  • onTransformEnd(anchor) Overwrites _Base.onTransformEnd
  • onUp(obj) See stencil._Base.onUp

Properties

baseRender
closeColor
closePath
closeRadius
drawingType
draws
enabled

Whether the Stencil is enabled or not.

minimumSize
setup

See stencil._Base ToolsSetup

showAngle
StencilData
StencilPoints
zScale

Methods

_create(shp,sty)

Creates a dojox.gfx.shape based on passed arguments. Can be called many times by implementation to create multiple shapes in one stencil.

Parameter Type Description
shp String
sty Object
_postSetPoints(pts)

Because Axes only has one anchor, we substitute a special setPoints method

Parameter Type Description
pts Array
_setNodeAtts(shape)

Internal. Sets the rawNode attribute. (Or in Silverlight an "object attribute". "stencil" is used by the application to determine if something is selectable or not. This also sets the mouse custom events like: "onStencilUp". To disable the selectability, make the att "", which causes a standard mouse event. Labels are special and used to select master stencils.

Parameter Type Description
shape undefined
_toggleSelected()
addShadow(args)
Parameter Type Description
args Object
anchorPositionCheck(x,y,anchor)

Gets called from anchor to check if its current position is ok. If not, its x or y transform will be changed until this passes.

Parameter Type Description
x Number
y Number
anchor manager.Anchor
Returns:object
animate(options,create)
Parameter Type Description
options undefined
create undefined
applyTransform(mx)

Applies the transform to the stencil

NOTE: PARTIALLY IMPLEMENTED. Only applies x y coords.

Parameter Type Description
mx undefined
attr(key,value)

Changes properties in the style or disabled styles, depending on whether the object is enabled. Also can be used to change most position and size props.

Parameter Type Description
key String | Object
value String | Number
Optional
checkClosePoint(firstPt,currPt,remove)

Checks if points are close enough to indicate that path should be close. Provides a visual cue.

Not actually used in stencil.path - this is used for drawable tools that extend it. Note that those tools need to remove the shape created: this.closeGuide, or add arg: remove

Parameter Type Description
firstPt Object
currPt Object
remove Boolean
Returns:boolean
connect(o,e,s,m,once)

Convenience method for quick connects See comments below for possiblities functions can be strings

Parameter Type Description
o undefined
e undefined
s undefined
m undefined
once Boolean

If true, the connection happens only once then disconnects. Five args are required for this functionality.

Returns:undefined
connectMouse()

Internal. Registers this Stencil to receive mouse events.

connectMult()

Convenience method for batches of quick connects Handles are not returned and therefore cannot be disconnected until Shape destroy time

createLabels()

Creates the label for each axis.

dataToPoints(o)

Converts data to points.

Parameter Type Description
o ? Object
Returns:Array
deselect(useDelay)

Called when the Stencil is deselected. NOTE: Calling this will not deselect the Stencil calling this just sets the style to the current theme. 'manager.Stencil' should be used for selecting and deselecting Stencils.

Parameter Type Description
useDelay Boolean

Adds slight delay before the style is set.

destroy()

Destroys this Stencil

disable()

Disables Stencil so it is not selectable. Changes the color to the disabled style.

disconnect(handles)

Removes connections based on passed handles arguments

Parameter Type Description
handles Handle | Array
disconnectMouse()

Internal. Unregisters this Stencil from receiving mouse events.

enable()

Enables Stencil so it is not selectable (if it was selectable to begin with). Changes the color to the current style.

exporter()

Exports Stencil data

Returns:undefined
getAngle()

Gets angle of Stencil NOTE: Only works for Lines, Arrows, Vectors and Axes (works on points, not transforms)

Returns:undefined
getBounds(absolute)

Custom getBounds overwrites _Base.getBounds

Parameter Type Description
absolute Boolean
Returns:object
getLabel()

Getter for the labels. returns an object.

Returns:null | object
getRadius()

Possibility of z-axis makes bounds unreliable. Use these points instead.

Returns:undefined
getTransform()

Returns the current transform (position) of the Stencil's container

Returns:object
highlight()

Changes style to the highlight theme.

moveToBack()

Moves Stencil to the back of all other items on the canvas.

moveToFront()

Moves Stencil to the front of all other items on the canvas.

pointsToData()

Converts points to data.

Returns:object
preventNegativePos()

Internal. Prevent item from being drawn/rendered less than zero on the X or Y.

remove()

Removes shape(s), typically before a re-render No args defaults to this.shape Pass in multiple args to remove multiple shapes

removeShadow()
render()

Renders the 'hit' object (the shape used for an expanded hit area and for highlighting) and the'shape' (the actual display object).

select()

Called when the Stencil is selected. NOTE: Calling this will not select the Stencil calling this just sets the style to the 'selected' theme. 'manager.Stencil' should be used for selecting Stencils.

setData(data)

Setter for Stencil data; also converts data to points. See individual Stencils for specific data properties.

Parameter Type Description
data StencilData
setLabel(value)

Set the text of the labels. The text would be broken up into the two labels.

Parameter Type Description
value String

If no argument is passed, defaults to two labels 'x' and 'y'. If an argument is passed, that text will be split on the word 'and' to determine the two labels.

setLabelX()

Custom placement for x-axis label

Returns:object
setLabelY()

Custom placement for y-axis label

Returns:object
setLabelZ()

Custom placement for z-axis label

Returns:object
setPoints(points)

Setter for Stencil points; also converts points to data. See individual Stencils for specific points properties.

Parameter Type Description
points StencilPoints
setTransform(mx)

Sets the transform to the stencil

NOTE: PARTIALLY IMPLEMENTED. Only applies x y coords.

Parameter Type Description
mx Object
transformPoints(mx)

Moves object to a new X Y location mx is additive. So mx.dx=1 will move the stencil 1 pixel to the right from wherever it was.

Parameter Type Description
mx undefined
unhighlight()

Changes style to the current theme.

zPoint(obj)

Finds the point for the z axis.

Parameter Type Description
obj undefined
Returns:object
zSet()

Events

_onPostRender(data)

Drag-create or programmatic create calls onRender and afterwards, _onPostRender is called and manages further events.

Parameter Type Description
data Object
onBeforeRender(stencil)

Stub - Fires before render occurs.

Parameter Type Description
stencil Object
onChangeData(stencil)

Stub - fires on change of dimensional properties or a text change

Parameter Type Description
stencil Object
onChangeStyle(stencil)

Fires when styles of shape has changed

Parameter Type Description
stencil Object
onChangeText(value)
Parameter Type Description
value undefined
onDelete(stencil)

Stub - fires before this is destroyed

Parameter Type Description
stencil Stencil
onDown(obj)

Mouse event, fired on mousedown on canvas

Parameter Type Description
obj EventObject
onDrag(obj)

See stencil._Base.onDrag

Parameter Type Description
obj EventObject
onModify(stencil)

Stub - fires on change of any property, including style properties

Parameter Type Description
stencil Object
onMove(obj)

Mouse event, fired on mousemove while mouse is not down. NOTE: Not currently implemented

Parameter Type Description
obj EventObject
onRender(stencil)

Stub - Fires on creation. Drawing connects to this (once!) to be notified of drag completion. But only if it was registered as a Tool. Creating Stencil in and of itself does not register it.

This should fire at the end of creation (not during drag)

Parameter Type Description
stencil Object
onTransform(anchor)

Overwrites _Base.onTransform

Parameter Type Description
anchor Number
onTransformBegin(anchor)

Overwrites _Base.onTransformBegin

Parameter Type Description
anchor manager.Anchor
onTransformEnd(anchor)

Overwrites _Base.onTransformEnd

Parameter Type Description
anchor manager.Anchor
onUp(obj)

See stencil._Base.onUp

Parameter Type Description
obj EventObject
Error in the documentation? Can’t find what you are looking for? Let us know!