Class: MarkerSvg

Constructor

MarkerSvg

new MarkerSvg(workspace, constants, marker)

Class to draw a marker.

Parameter

workspace

Blockly.WorkspaceSvg

The workspace the marker belongs to.

Value must not be null.

constants

Blockly.blockRendering.ConstantProvider

The constants for the renderer.

Value must not be null.

marker

Blockly.Marker

The marker to draw.

Value must not be null.

Extends
Blockly.blockRendering.MarkerSvg

Properties

colour_

unknown

The colour of the marker.

Inherited from
Blockly.blockRendering.MarkerSvg#colour_

constants_

protected

unknown

The constants necessary to draw the marker.

Inherited from
Blockly.blockRendering.MarkerSvg#constants_

currentMarkerSvg

unknown

The current SVG element for the marker.

Inherited from
Blockly.blockRendering.MarkerSvg#currentMarkerSvg

Methods

applyColour_

protected

applyColour_(_curNode)

Apply the marker's colour.

Parameter

_curNode

The node that we want to draw the marker for.

Value must not be null.

Inherited from
Blockly.zelos.MarkerSvg#applyColour_

createDom

package

createDom() returns SVGElement

Create the DOM element for the marker.

Inherited from
Blockly.blockRendering.MarkerSvg#createDom
Returns

The marker controls SVG group.

createDomInternal_

protected

createDomInternal_() returns Element

Create the marker SVG.

Inherited from
Blockly.zelos.MarkerSvg#createDomInternal_
Returns

The SVG node created.

dispose

dispose()

Dispose of this marker.

Inherited from
Blockly.blockRendering.MarkerSvg#dispose

draw

draw(oldNode, curNode)

Update the marker.

Parameter

oldNode

The previous node the marker was on or null.

curNode

The node that we want to draw the marker for.

Inherited from
Blockly.blockRendering.MarkerSvg#draw

getBlinkProperties_

protected

getBlinkProperties_() returns Object

Get the properties to make a marker blink.

Inherited from
Blockly.blockRendering.MarkerSvg#getBlinkProperties_
Returns

The object holding attributes to make the marker blink.

getMarker

getMarker() returns Blockly.Marker

Get the marker.

Inherited from
Blockly.blockRendering.MarkerSvg#getMarker
Returns

The marker to draw for.

getSvgRoot

getSvgRoot() returns SVGElement

Return the root node of the SVG or null if none exists.

Inherited from
Blockly.blockRendering.MarkerSvg#getSvgRoot
Returns

The root SVG node.

hide

hide()

Hide the marker.

Inherited from
Blockly.zelos.MarkerSvg#hide

isCursor

isCursor() returns boolean

True if the marker should be drawn as a cursor, false otherwise. A cursor is drawn as a flashing line. A marker is drawn as a solid line.

Inherited from
Blockly.blockRendering.MarkerSvg#isCursor
Returns

True if the marker is a cursor, false otherwise.

positionBlock_

protected

positionBlock_(width, markerOffset, markerHeight)

Position the marker for a block. Displays an outline of the top half of a rectangle around a block.

Parameter

width

The width of the block.

markerOffset

The extra padding for around the block.

markerHeight

The height of the marker.

Inherited from
Blockly.blockRendering.MarkerSvg#positionBlock_

positionInput_

protected

positionInput_(connection)

Position the marker for an input connection. Displays a filled in puzzle piece.

Parameter

connection

The connection to position marker around.

Value must not be null.

Inherited from
Blockly.blockRendering.MarkerSvg#positionInput_

positionLine_

protected

positionLine_(x, y, width)

Move and show the marker at the specified coordinate in workspace units. Displays a horizontal line.

Parameter

x

The new x, in workspace units.

y

The new y, in workspace units.

width

The new width, in workspace units.

Inherited from
Blockly.blockRendering.MarkerSvg#positionLine_

positionOutput_

protected

positionOutput_(width, height, connectionShape)

Position the marker for an output connection. Displays a puzzle outline and the top and bottom path.

Parameter

width

The width of the block.

height

The height of the block.

connectionShape

The shape object for the connection.

Value must not be null.

Inherited from
Blockly.blockRendering.MarkerSvg#positionOutput_

positionPrevious_

protected

positionPrevious_(width, markerOffset, markerHeight, connectionShape)

Position the marker for a previous connection. Displays a half rectangle with a notch in the top to represent the previous connection.

Parameter

width

The width of the block.

markerOffset

The offset of the marker from around the block.

markerHeight

The height of the marker.

connectionShape

The shape object for the connection.

Value must not be null.

Inherited from
Blockly.blockRendering.MarkerSvg#positionPrevious_

positionRect_

protected

positionRect_(x, y, width, height)

Move and show the marker at the specified coordinate in workspace units. Displays a filled in rectangle.

Parameter

x

The new x, in workspace units.

y

The new y, in workspace units.

width

The new width, in workspace units.

height

The new height, in workspace units.

Inherited from
Blockly.blockRendering.MarkerSvg#positionRect_

setParent_

protected

setParent_(newParent)

Attaches the SVG root of the marker to the SVG group of the parent.

Parameter

newParent

The workspace, field, or block that the marker SVG element should be attached to.

Value must not be null.

Inherited from
Blockly.blockRendering.MarkerSvg#setParent_

showAtLocation_

protected

showAtLocation_(curNode)

Update the marker's visible state based on the type of curNode..

Parameter

curNode

The node that we want to draw the marker for.

Value must not be null.

Inherited from
Blockly.blockRendering.MarkerSvg#showAtLocation_

showCurrent_

protected

showCurrent_()

Show the current marker.

Inherited from
Blockly.blockRendering.MarkerSvg#showCurrent_

showWithBlock_

showWithBlock_(curNode)

Draw a rectangle around the block.

Parameter

curNode

Blockly.ASTNode

The current node of the marker.

Value must not be null.

showWithCoordinates_

protected

showWithCoordinates_(curNode)

Position and display the marker for a workspace coordinate. This is a horizontal line.

Parameter

curNode

The node to draw the marker for.

Value must not be null.

Inherited from
Blockly.blockRendering.MarkerSvg#showWithCoordinates_

showWithField_

protected

showWithField_(curNode)

Position and display the marker for a field. This is a box around the field.

Parameter

curNode

The node to draw the marker for.

Value must not be null.

Inherited from
Blockly.blockRendering.MarkerSvg#showWithField_

showWithInput_

protected

showWithInput_(curNode)

Position and display the marker for an input. This is a puzzle piece.

Parameter

curNode

The node to draw the marker for.

Value must not be null.

Inherited from
Blockly.zelos.MarkerSvg#showWithInput_

showWithNext_

protected

showWithNext_(curNode)

Position and display the marker for a next connection. This is a horizontal line.

Parameter

curNode

The node to draw the marker for.

Value must not be null.

Inherited from
Blockly.blockRendering.MarkerSvg#showWithNext_

showWithOutput_

protected

showWithOutput_(curNode)

Position and display the marker for an output connection.

Parameter

curNode

The node to draw the marker for.

Value must not be null.

Inherited from
Blockly.zelos.MarkerSvg#showWithOutput_

showWithPrevious_

protected

showWithPrevious_(curNode)

Position and display the marker for a previous connection.

Parameter

curNode

The node to draw the marker for.

Value must not be null.

Inherited from
Blockly.blockRendering.MarkerSvg#showWithPrevious_

showWithStack_

protected

showWithStack_(curNode)

Position and display the marker for a stack. This is a box with extra padding around the entire stack of blocks.

Parameter

curNode

The node to draw the marker for.

Value must not be null.

Inherited from
Blockly.blockRendering.MarkerSvg#showWithStack_