blockly > blockRendering > MarkerSvg

blockRendering.MarkerSvg 類別

標記的類別,包含能以圖形方式將標記算繪為 SVG 的方法。

Signature:

export declare class MarkerSvg 

建構函式

建構函式 修飾符 說明
(建構函式)(工作區, 常數, 標記) 建構 MarkerSvg 類別的新例項

屬性

屬性 修飾符 類型 說明
colour_ 字串
constants_ protected ConstantProvider 繪製標記所需的常數。
currentMarkerSvg SVGElement | 空值 標記目前的 SVG 元素。
markerBlock_ protected SVGPathElement | 空值
markerInput_ protected SVGPathElement | 空值
markerSvg_ protected SVGGElement | 空值 包含標記的根 SVG 群組。
markerSvgLine_ protected SVGRectElement | 空值
markerSvgRect_ protected SVGRectElement | 空值
svgGroup_ protected SVGGElement | 空值

方法

方法 修飾符 說明
applyColour_(_curNode) protected 套用標記的顏色。
createDom() 建立標記的 DOM 元素。
createDomInternal_() protected 建立 SVG 標記。
dispose() 丟棄這個標記。
draw(oldNode, curNode) 更新標記。
getBlinkProperties_() protected 取得屬性,讓標記閃爍。
getMarker() 取得標記。
getSvgRoot() 傳回 SVG 的根節點。如果沒有,則傳回空值。
hide() 隱藏標記。
isCursor() 如果標記應繪製為遊標,則為「true」,否則為 false。遊標繪製成閃爍的線條。標記會以實線繪製。
positionBlock_(width, markerOffset, markerHeight) protected 放置區塊的標記。顯示矩形上方矩形的外框輪廓,圍繞區塊的區塊。
positionInput_(connection) protected 放置輸入連線的標記。顯示已填滿的拼圖。
positionLine_(x, y, width) protected 將標記移動到工作區單元中的指定座標。顯示水平線。
positionOutput_(width, height, connectionShape) protected 為輸出連線放置標記。顯示謎題輪廓、頂端和底部路徑。
positionPrevious_(width, markerOffset, markerHeight, connectionShape) protected 將標記放置於上一個連線。顯示半矩形,頂端有凹槽,代表上一個連線。
positionRect_(x, y, width, height) protected 將標記移動到工作區單元中的指定座標。顯示填滿的矩形。
setParent_(newParent) protected 將標記的 SVG 根目錄附加至父項的 SVG 群組。
showAtLocation_(curNode) protected 根據 curNode 類型更新標記的可見狀態。
showCurrent_() protected 顯示目前的標記。
showWithBlock_(curNode) protected 放置及顯示區塊的標記。
showWithButton_(curNode) protected 放置及顯示飛出按鈕的標記。這個方塊在按鈕周圍留有額外的邊框間距。
showWithCoordinates_(curNode) protected 放置及顯示工作區座標的標記。這條水平線。
showWithField_(curNode) protected 放置及顯示欄位的標記。這是球場周圍的方塊。
showWithInput_(curNode) protected 放置及顯示輸入項目的標記。這是拼圖。
showWithNext_(curNode) protected 定位並顯示標記以供下一個連線使用。這條水平線。
showWithOutput_(curNode) protected 放置及顯示輸出連線的標記。
showWithPrevious_(curNode) protected 放置及顯示先前連線的標記。
showWithStack_(curNode) protected 放置及顯示堆疊的標記。這是在整個區塊堆疊周圍有額外邊框間距的方塊。