Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

  • new mxCellOverlay(image: mxImage, tooltip: string, align?: string, verticalAlign?: string, offset?: mxPoint, cursor?: string): mxCellOverlay

Properties

align

align: string

Variable: align

Holds the horizontal alignment for the overlay. Default is <mxConstants.ALIGN_RIGHT>. For edges, the overlay always appears in the center of the edge.

cursor

cursor: string

Variable: cursor

Holds the cursor for the overlay. Default is 'help'.

defaultOverlap

defaultOverlap: number

Variable: defaultOverlap

Defines the overlapping for the overlay, that is, the proportional distance from the origin to the point defined by the alignment. Default is 0.5.

eventListeners

eventListeners: any[]

Variable: eventListeners

Holds the event names and associated listeners in an array. The array contains the event name followed by the respective listener for each registered listener.

eventSource

eventSource: any

Variable: eventSource

Optional source for events. Default is null.

eventsEnabled

eventsEnabled: boolean

Variable: eventsEnabled

Specifies if events can be fired. Default is true.

image

image: mxImage

Variable: image

Holds the to be used as the icon.

offset

offset: mxPoint

Variable: offset

Holds the offset as an . The offset will be scaled according to the current scale.

Optional tooltip

tooltip: string

Variable: tooltip

Holds the optional string to be used as the tooltip.

verticalAlign

verticalAlign: string

Variable: verticalAlign

Holds the vertical alignment for the overlay. Default is <mxConstants.ALIGN_BOTTOM>. For edges, the overlay always appears in the center of the edge.

Methods

addListener

  • addListener(name: string, funct: (...args: any[]) => any): void
  • Function: addListener

    Binds the specified function to the given event name. If no event name is given, then the listener is registered for all events.

    The parameters of the listener are the sender and an .

    Parameters

    • name: string
    • funct: (...args: any[]) => any
        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    Returns void

fireEvent

  • Function: fireEvent

    Dispatches the given event to the listeners which are registered for the event. The sender argument is optional. The current execution scope ("this") is used for the listener invocation (see <mxUtils.bind>).

    Example:

    (code) fireEvent(new mxEventObject("eventName", key1, val1, .., keyN, valN)) (end)

    Parameters:

    evt - that represents the event. sender - Optional sender to be passed to the listener. Default value is the return value of .

    Parameters

    Returns void

getBounds

  • Function: getBounds

    Returns the bounds of the overlay for the given as an . This should be overridden when using multiple overlays per cell so that the overlays do not overlap.

    The following example will place the overlay along an edge (where x=[-1..1] from the start to the end of the edge and y is the orthogonal offset in px).

    (code) overlay.getBounds = function(state) { var bounds = getBounds.apply(this, arguments);

    if (state.view.graph.getModel().isEdge(state.cell)) { var pt = state.view.getPoint(state, {x: 0, y: 0, relative: true});

    bounds.x = pt.x - bounds.width / 2;
    bounds.y = pt.y - bounds.height / 2;
    

    }

    return bounds; }; (end)

    Parameters:

    state - that represents the current state of the associated cell.

    Parameters

    Returns mxRectangle

getEventSource

  • getEventSource(): any

isEventsEnabled

  • isEventsEnabled(): boolean

removeListener

  • removeListener(funct: (...args: any[]) => any): void
  • Function: removeListener

    Removes all occurrences of the given listener from .

    Parameters

    • funct: (...args: any[]) => any
        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    Returns void

setEventSource

  • setEventSource(value: any): void

setEventsEnabled

  • setEventsEnabled(value: boolean): void

toString

  • toString(): string
  • Function: toString

    Returns the textual representation of the overlay to be used as the tooltip. This implementation returns .

    Returns string

Generated using TypeDoc