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 — Morphing | @maxgraph/core

  • Morphing

Class Morphing

Implements animation for morphing cells.

Here is an example of using this class for animating the result of a layout algorithm:

graph.getDataModel().beginUpdate();
try {
const circleLayout = new CircleLayout(graph);
circleLayout.execute(graph.getDefaultParent());
} finally {
const morph = new Morphing(graph);
morph.addListener(mxEvent.DONE, () => {
graph.getDataModel().endUpdate();
});

morph.startAnimation();
}

Hierarchy (View Summary)

  • Animation
    • Morphing
  • Defined in view/animate/Morphing.ts:48
Index

Constructors

constructor

Properties

cells delay ease eventListeners eventsEnabled eventSource graph step steps thread

Methods

addListener animateCell destroy fireEvent getDelta getEventSource getOriginForCell isEventsEnabled isRunning removeListener setEventsEnabled setEventSource show startAnimation stopAnimation stopRecursion updateAnimation

Constructors

constructor

  • new Morphing(
        graph: AbstractGraph,
        steps?: number,
        ease?: number,
        delay?: number,
    ): Morphing

    Constructs an animation.

    Parameters

    • graph: AbstractGraph

      Reference to the enclosing AbstractGraph.

    • steps: number = 6

      Optional number of steps in the morphing animation. Default is 6.

    • ease: number = 1.5

      Optional easing constant for the animation. Default is 1.5.

    • Optionaldelay: number

      Optional delay between the animation steps. Passed to Animation.

    Returns Morphing

    Overrides Animation.constructor

    • Defined in view/animate/Morphing.ts:57

Properties

cells

cells: Cell[] | null = null

Optional array of cells to be animated. If this is not specified then all cells are checked and animated if they have been moved in the current transaction.

  • Defined in view/animate/Morphing.ts:87

delay

delay: number

Specifies the delay between the animation steps.

Default

20ms

Inherited from Animation.delay

  • Defined in view/animate/Animation.ts:38

ease

ease: number

Ease-off for movement towards the given vector. Larger values are slower and smoother. Default is 4.

  • Defined in view/animate/Morphing.ts:80

eventListeners

eventListeners: EventListenerObject[] = []

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.

Inherited from Animation.eventListeners

  • Defined in view/event/EventSource.ts:58

eventsEnabled

eventsEnabled: boolean = true

Specifies if events can be fired. Default is true.

Inherited from Animation.eventsEnabled

  • Defined in view/event/EventSource.ts:63

eventSource

eventSource: EventTarget | null = null

Optional source for events.

Default

null

Inherited from Animation.eventSource

  • Defined in view/event/EventSource.ts:69

graph

graph: AbstractGraph
  • Defined in view/animate/Morphing.ts:64

step

step: number = 0

Contains the current step.

  • Defined in view/animate/Morphing.ts:74

steps

steps: number

Specifies the maximum number of steps for the morphing.

  • Defined in view/animate/Morphing.ts:69

thread

thread: number | null = null

Reference to the thread while the animation is running.

Inherited from Animation.thread

  • Defined in view/animate/Animation.ts:43

Methods

addListener

  • addListener(name: string, funct: Function): void

    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 EventObject.

    Parameters

    • name: string
    • funct: Function

    Returns void

    Inherited from Animation.addListener

    • Defined in view/event/EventSource.ts:105

animateCell

  • animateCell(cell: Cell, move: CellStatePreview, recurse?: boolean): void

    Animates the given cell state using <CellStatePreview.moveState>.

    Parameters

    • cell: Cell
    • move: CellStatePreview
    • recurse: boolean = false

    Returns void

    • Defined in view/animate/Morphing.ts:124

destroy

  • destroy(): void

    Clears all registered event listeners.

    Subclasses with a destroy method should call super.destroy() at the end of their own cleanup to ensure no stale listeners remain.

    Returns void

    Inherited from Animation.destroy

    • Defined in view/event/EventSource.ts:166

fireEvent

  • fireEvent(evt: EventObject, sender?: EventTarget | null): void

    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.

    Example:

    fireEvent(new EventObject("eventName", key1, val1, .., keyN, valN))
    

    Parameters

    • evt: EventObject

      EventObject that represents the event.

    • sender: EventTarget | null = null

      Optional sender to be passed to the listener. Default value is the return value of getEventSource.

    Returns void

    Inherited from Animation.fireEvent

    • Defined in view/event/EventSource.ts:139

getDelta

  • getDelta(state: CellState): Point

    Returns the vector between the current rendered state and the future location of the state after the display will be updated.

    Parameters

    • state: CellState

    Returns Point

    • Defined in view/animate/Morphing.ts:168

getEventSource

  • getEventSource(): EventTarget | null

    Returns eventSource.

    Returns EventTarget | null

    Inherited from Animation.getEventSource

    • Defined in view/event/EventSource.ts:88

getOriginForCell

  • getOriginForCell(cell?: Cell | null): Point | null

    Returns the top, left corner of the given cell. TODO: Improve performance by using caching inside this method as the result per cell never changes during the lifecycle of this object.

    Parameters

    • cell: Cell | null = null

    Returns Point | null

    • Defined in view/animate/Morphing.ts:183

isEventsEnabled

  • isEventsEnabled(): boolean

    Returns eventsEnabled.

    Returns boolean

    Inherited from Animation.isEventsEnabled

    • Defined in view/event/EventSource.ts:74

isRunning

  • isRunning(): boolean

    Returns true if the animation is running.

    Returns boolean

    Inherited from Animation.isRunning

    • Defined in view/animate/Animation.ts:48

removeListener

  • removeListener(funct: Function): void

    Removes all occurrences of the given listener from eventListeners.

    Parameters

    • funct: Function

    Returns void

    Inherited from Animation.removeListener

    • Defined in view/event/EventSource.ts:112

setEventsEnabled

  • setEventsEnabled(value: boolean): void

    Sets eventsEnabled.

    Parameters

    • value: boolean

    Returns void

    Inherited from Animation.setEventsEnabled

    • Defined in view/event/EventSource.ts:81

setEventSource

  • setEventSource(value: EventTarget | null): void

    Sets eventSource.

    Parameters

    • value: EventTarget | null

    Returns void

    Inherited from Animation.setEventSource

    • Defined in view/event/EventSource.ts:95

show

  • show(move: CellStatePreview): void

    Shows the changes in the given .

    Parameters

    • move: CellStatePreview

    Returns void

    • Defined in view/animate/Morphing.ts:117

startAnimation

  • startAnimation(): void

    Starts the animation by repeatedly invoking updateAnimation.

    Returns void

    Inherited from Animation.startAnimation

    • Defined in view/animate/Animation.ts:55

stopAnimation

  • stopAnimation(): void

    Stops the animation by deleting the timer and fires an Event#DONE.

    Returns void

    Inherited from Animation.stopAnimation

    • Defined in view/animate/Animation.ts:73

stopRecursion

  • stopRecursion(state?: CellState | null, delta?: Point | null): boolean

    Returns true if the animation should not recursively find more deltas for children if the given parent state has been animated.

    Parameters

    • state: CellState | null = null
    • delta: Point | null = null

    Returns boolean

    • Defined in view/animate/Morphing.ts:160

updateAnimation

  • updateAnimation(): void

    Animation step.

    Returns void

    Overrides Animation.updateAnimation

    • Defined in view/animate/Morphing.ts:92

Settings

Member Visibility
  • Protected
  • Inherited
Theme

On This Page

Constructors
constructor
Properties
cellsdelayeaseeventListenerseventsEnabledeventSourcegraphstepstepsthread
Methods
addListeneranimateCelldestroyfireEventgetDeltagetEventSourcegetOriginForCellisEventsEnabledisRunningremoveListenersetEventsEnabledsetEventSourceshowstartAnimationstopAnimationstopRecursionupdateAnimation
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.