GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • @maxgraph/core

This view

  • Original page
  • New address

GeezerVison is showing maxgraph.github.io — StencilShape | @maxgraph/core

  • StencilShape

Class StencilShape

Implements a generic shape which is based on an XML node as a description.

The XSD for the stencil description is available in the stencils.xsd file.

Hierarchy (View Summary)

  • Shape
    • StencilShape
  • Defined in view/shape/stencil/StencilShape.ts:82
Index

Constructors

constructor

Properties

antiAlias aspect bgNode boundingBox bounds constraints cursor desc dialect direction endArrow endSize fgNode fill fillOpacity flipH flipV glass gradient gradientDirection h0 image imageSrc indicator indicatorColor indicatorDirection indicatorGradientColor indicatorImageSrc indicatorShape indicatorStrokeColor isDashed isRounded isShadow minSvgStrokeWidth node oldGradients opacity originalPointerEvents outline overlay pointerEvents points preserveImageAspect rotation scale shapePointerEvents spacing startArrow startSize state stencil stencilPointerEvents stroke strokeOpacity strokeWidth strokeWidthValue style svgPointerEvents svgStrokeTolerance useSvgBoundingBox verticalTextRotation visible w0

Methods

addPoints afterPaint apply augmentBoundingBox beforePaint checkBounds clear computeAspect configureCanvas create createBoundingBox createCanvas createSvgCanvas createTransparentSvgRectangle destroy destroyCanvas drawChildren drawNode drawShape evaluateAttribute evaluateTextAttribute getArcSize getBaseArcSize getCursor getGradientBounds getLabelBounds getLabelMargins getRotation getShapeRotation getSvgScreenOffset getTextRotation init initStyles isHtmlAllowed isPaintBoundsInverted isRoundable paint paintBackground paintEdgeShape paintForeground paintGlassEffect paintVertexShape parseConstraint parseConstraints parseDescription redraw redrawHtmlShape redrawShape releaseSvgGradients resetStyles setCursor setTransparentBackgroundImage updateBoundingBox updateBoundsFromPoints updateTransform

Constructors

constructor

  • new StencilShape(desc: Element): StencilShape

    Parameters

    • desc: Element

    Returns StencilShape

    Overrides Shape.constructor

    • Defined in view/shape/stencil/StencilShape.ts:83

Properties

antiAlias

antiAlias: boolean = true

Rendering hint for configuring the canvas.

Inherited from Shape.antiAlias

  • Defined in view/shape/Shape.ts:187

aspect

aspect: string = 'auto'

Holds the aspect of the shape. Default is 'auto'.

  • Defined in view/shape/stencil/StencilShape.ts:103

bgNode

bgNode: Element | null = null

Holds the XML node with the stencil description.

  • Defined in view/shape/stencil/StencilShape.ts:119

boundingBox

boundingBox: Rectangle | null = null

Contains the bounding box of the shape, that is, the smallest rectangle that includes all pixels of the shape.

Inherited from Shape.boundingBox

  • Defined in view/shape/Shape.ts:223

bounds

bounds: Rectangle | null = null

Holds the Rectangle that specifies the bounds of this shape.

Inherited from Shape.bounds

  • Defined in view/shape/Shape.ts:197

constraints

constraints: ConnectionConstraint[] = []

Holds an array of ConnectionConstraints as defined in the shape.

  • Defined in view/shape/stencil/StencilShape.ts:98

cursor

cursor: string = ''

Inherited from Shape.cursor

  • Defined in view/shape/Shape.ts:166

desc

desc: Element

Holds the XML node with the stencil description.

  • Defined in view/shape/stencil/StencilShape.ts:93

dialect

dialect: DialectValue | null = null

Holds the dialect in which the shape is to be painted.

Inherited from Shape.dialect

  • Defined in view/shape/Shape.ts:177

direction

direction: DirectionValue = 'east'

Inherited from Shape.direction

  • Defined in view/shape/Shape.ts:154

endArrow

endArrow: string = NONE

Inherited from Shape.endArrow

  • Defined in view/shape/Shape.ts:152

endSize

endSize: number = 1

Inherited from Shape.endSize

  • Defined in view/shape/Shape.ts:148

fgNode

fgNode: Element | null = null

Holds the XML node with the stencil description.

  • Defined in view/shape/stencil/StencilShape.ts:124

fill

fill: string = NONE

Inherited from Shape.fill

  • Defined in view/shape/Shape.ts:130

fillOpacity

fillOpacity: number = 100

Inherited from Shape.fillOpacity

  • Defined in view/shape/Shape.ts:136

flipH

flipH: boolean = false

Inherited from Shape.flipH

  • Defined in view/shape/Shape.ts:156

flipV

flipV: boolean = false

Inherited from Shape.flipV

  • Defined in view/shape/Shape.ts:158

glass

glass: boolean = false

Inherited from Shape.glass

  • Defined in view/shape/Shape.ts:172

gradient

gradient: string = NONE

Inherited from Shape.gradient

  • Defined in view/shape/Shape.ts:132

gradientDirection

gradientDirection: DirectionValue = 'east'

Inherited from Shape.gradientDirection

  • Defined in view/shape/Shape.ts:134

h0

h0: number = 100

Holds the height of the shape. Default is 100.

  • Defined in view/shape/stencil/StencilShape.ts:113

image

image: ImageBox | null = null

Inherited from Shape.image

  • Defined in view/shape/Shape.ts:280

imageSrc

imageSrc: string | null = null

Inherited from Shape.imageSrc

  • Defined in view/shape/Shape.ts:282

indicator

indicator: Shape | null = null

Inherited from Shape.indicator

  • Defined in view/shape/Shape.ts:123

indicatorColor

indicatorColor: string = NONE

Inherited from Shape.indicatorColor

  • Defined in view/shape/Shape.ts:284

indicatorDirection

indicatorDirection: DirectionValue = 'east'

Inherited from Shape.indicatorDirection

  • Defined in view/shape/Shape.ts:290

indicatorGradientColor

indicatorGradientColor: string = NONE

Inherited from Shape.indicatorGradientColor

  • Defined in view/shape/Shape.ts:288

indicatorImageSrc

indicatorImageSrc: string | null = null

Inherited from Shape.indicatorImageSrc

  • Defined in view/shape/Shape.ts:292

indicatorShape

indicatorShape: typeof Shape | null = null

Inherited from Shape.indicatorShape

  • Defined in view/shape/Shape.ts:124

indicatorStrokeColor

indicatorStrokeColor: string = NONE

Inherited from Shape.indicatorStrokeColor

  • Defined in view/shape/Shape.ts:286

isDashed

isDashed: boolean = false

Inherited from Shape.isDashed

  • Defined in view/shape/Shape.ts:128

isRounded

isRounded: boolean = false

Inherited from Shape.isRounded

  • Defined in view/shape/Shape.ts:162

isShadow

isShadow: boolean = false

Inherited from Shape.isShadow

  • Defined in view/shape/Shape.ts:160

minSvgStrokeWidth

minSvgStrokeWidth: number = 1

Minimum stroke width for SVG output.

Inherited from Shape.minSvgStrokeWidth

  • Defined in view/shape/Shape.ts:192

node

node: SVGGElement

Holds the outermost DOM node that represents this shape.

Inherited from Shape.node

  • Defined in view/shape/Shape.ts:207

oldGradients

oldGradients: GradientMap = {}

Inherited from Shape.oldGradients

  • Defined in view/shape/Shape.ts:170

opacity

opacity: number = 100

See

CellHighlight

Inherited from Shape.opacity

  • Defined in view/shape/Shape.ts:127

originalPointerEvents

originalPointerEvents: boolean | null = null

Inherited from Shape.originalPointerEvents

  • Defined in view/shape/Shape.ts:242

outline

outline: boolean = false

Specifies if the shape should be drawn as an outline. This disables all fill colors and can be used to disable other drawing states that should not be painted for outlines. Default is false. This should be set before calling .

Inherited from Shape.outline

  • Defined in view/shape/Shape.ts:267

overlay

overlay: CellOverlay | null = null

Inherited from Shape.overlay

  • Defined in view/shape/Shape.ts:122

pointerEvents

pointerEvents: boolean = true

Specifies if pointer events should be handled. Default is true.

Inherited from Shape.pointerEvents

  • Defined in view/shape/Shape.ts:240

points

points: (Point | null)[] = []

Holds the array of that specify the points of this shape.

Inherited from Shape.points

  • Defined in view/shape/Shape.ts:202

preserveImageAspect

preserveImageAspect: boolean = false

Switch to preserve image aspect.

Default

false

Inherited from Shape.preserveImageAspect

  • Defined in view/shape/Shape.ts:121

rotation

rotation: number = 0

Inherited from Shape.rotation

  • Defined in view/shape/Shape.ts:164

scale

scale: number = 1

Holds the scale in which the shape is being painted.

Inherited from Shape.scale

  • Defined in view/shape/Shape.ts:182

shapePointerEvents

shapePointerEvents: boolean = false

Specifies if pointer events outside of shape should be handled. Default is false.

Inherited from Shape.shapePointerEvents

  • Defined in view/shape/Shape.ts:253

spacing

spacing: number = 0

Inherited from Shape.spacing

  • Defined in view/shape/Shape.ts:144

startArrow

startArrow: string = NONE

Inherited from Shape.startArrow

  • Defined in view/shape/Shape.ts:150

startSize

startSize: number = 1

Inherited from Shape.startSize

  • Defined in view/shape/Shape.ts:146

state

state: CellState | null = null

Optional reference to the corresponding .

Inherited from Shape.state

  • Defined in view/shape/Shape.ts:212

stencil

stencil: StencilShape | null = null

Holds the StencilShape that defines the shape.

Inherited from Shape.stencil

  • Defined in view/shape/Shape.ts:228

stencilPointerEvents

stencilPointerEvents: boolean = false

Specifies if pointer events outside of stencils should be handled. Default is false. Set this to true for backwards compatibility with the 1.x branch.

Inherited from Shape.stencilPointerEvents

  • Defined in view/shape/Shape.ts:259

stroke

stroke: string = NONE

Inherited from Shape.stroke

  • Defined in view/shape/Shape.ts:140

strokeOpacity

strokeOpacity: number = 100

Inherited from Shape.strokeOpacity

  • Defined in view/shape/Shape.ts:138

strokeWidth

strokeWidth: number = 1

Inherited from Shape.strokeWidth

  • Defined in view/shape/Shape.ts:142

strokeWidthValue

strokeWidthValue: string | null = null

Holds the strokewidth direction from the description.

  • Defined in view/shape/stencil/StencilShape.ts:129

style

style: CellStateStyle | null = null

Optional reference to the style of the corresponding .

Inherited from Shape.style

  • Defined in view/shape/Shape.ts:217

svgPointerEvents

svgPointerEvents: string = 'all'

Specifies if pointer events should be handled. Default is true.

Inherited from Shape.svgPointerEvents

  • Defined in view/shape/Shape.ts:247

svgStrokeTolerance

svgStrokeTolerance: number = 8

Event-tolerance for SVG strokes (in px). This is only passed to the canvas in createSvgCanvas if pointerEvents is true.

Default

8

Inherited from Shape.svgStrokeTolerance

  • Defined in view/shape/Shape.ts:235

useSvgBoundingBox

useSvgBoundingBox: boolean = true

Allows to use the SVG bounding box in SVG. Default is false for performance reasons.

Inherited from Shape.useSvgBoundingBox

  • Defined in view/shape/Shape.ts:278

verticalTextRotation

verticalTextRotation: number = 0

Inherited from Shape.verticalTextRotation

  • Defined in view/shape/Shape.ts:168

visible

visible: boolean = true

Specifies if the shape is visible. Default is true.

Inherited from Shape.visible

  • Defined in view/shape/Shape.ts:272

w0

w0: number = 100

Holds the width of the shape. Default is 100.

  • Defined in view/shape/stencil/StencilShape.ts:108

Methods

addPoints

  • addPoints(
        c: AbstractCanvas2D,
        pts: Point[],
        rounded?: boolean,
        arcSize: number,
        close?: boolean,
        exclude?: number[],
        initialMove?: boolean,
    ): void

    Paints the given points with rounded corners.

    Parameters

    • c: AbstractCanvas2D
    • pts: Point[]
    • rounded: boolean = false
    • arcSize: number
    • close: boolean = false
    • exclude: number[] = []
    • initialMove: boolean = true

    Returns void

    Inherited from Shape.addPoints

    • Defined in view/shape/Shape.ts:839

afterPaint

  • afterPaint(c: AbstractCanvas2D): void

    Invokes after paint was called.

    Parameters

    • c: AbstractCanvas2D

    Returns void

    Inherited from Shape.afterPaint

    • Defined in view/shape/Shape.ts:589

apply

  • apply(state: CellState): void

    Applies the style of the given to the shape. This implementation assigns the following styles to local fields:

    • <'fillColor'> => fill
    • <'gradientColor'> => gradient
    • <'gradientDirection'> => gradientDirection
    • <'opacity'> => opacity
    • Constants#STYLE_FILL_OPACITY => fillOpacity
    • Constants#STYLE_STROKE_OPACITY => strokeOpacity
    • <'strokeColor'> => stroke
    • <'strokeWidth'> => strokewidth
    • <'shadow'> => isShadow
    • <'dashed'> => isDashed
    • <'spacing'> => spacing
    • <'startSize'> => startSize
    • <'endSize'> => endSize
    • <'rounded'> => isRounded
    • <'startArrow'> => startArrow
    • <'endArrow'> => endArrow
    • <'rotation'> => rotation
    • <'direction'> => direction
    • <'glass'> => glass

    This keeps a reference to the

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.