Class ChangedEvent

A ChangedEvent represents a change to an object, typically a GraphObject, but also for model data, a Model, or a Diagram. The most common case is for remembering the name of a property and the before-and-after values for that property. You can listen for changed events on the model using Model#addChangedListener and on the Diagram using Diagram#addChangedListener.

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(): ChangedEvent

The ChangedEvent class constructor produces an empty ChangedEvent object.

Returns

ChangedEvent

Properties

public static Insert: EnumValue

For inserting into collections, and used as the value for ChangedEvent#change.

public static Property: EnumValue

For simple property changes, and used as the value for ChangedEvent#change.

public static Remove: EnumValue

For removing from collections, and used as the value for ChangedEvent#change.

public static Transaction: EnumValue

For informational events, such as transactions and undo/redo operations, and used as the value for ChangedEvent#change.

public change: EnumValue

Gets or sets the nature of change that occurred.

public diagram: Diagram

Gets or sets the Diagram that was modified.

public model: Model

Gets or sets the Model or TreeModel or GraphLinksModel that was modified.

public modelChange: string

Gets the name of the model change, reflecting a change to model data in addition to a change to the model itself.

public newParam: any

Gets or sets an optional value associated with the new value.

public newValue: any

Gets or sets the next or current value that the property has.

public object: Object

Gets or sets the Object that was modified.

public oldParam: any

Gets or sets an optional value associated with the old value.

public oldValue: any

Gets or sets the previous or old value that the property had.

public propertyName: any

Gets or sets the name of the property change.

Methods

public canRedo(): boolean

This predicate returns true if you can call redo().

Returns

boolean

public canUndo(): boolean

This predicate returns true if you can call undo().

Returns

boolean

public clear(): any

Forget any object references that this ChangedEvent may have.

Returns

any

public copy(): ChangedEvent

Make a copy of this ChangedEvent.

Returns

ChangedEvent

public getParam(undo: boolean): any

This is a convenient method to get the right parameter value, depending on the value of undo, when implementing a state change as part of an undo or a redo.

Parameters

  • undo: boolean

    If true, returns the oldParam, otherwise returns the newParam.

Returns

any

public getValue(undo: boolean): any

This is a convenient method to get the right value, depending on the value of undo, when implementing a state change as part of an undo or a redo.

Parameters

  • undo: boolean

    If true, returns the oldValue, otherwise returns the newValue.

Returns

any

public redo(): any

Re-perform this object change after an undo().

Returns

any

public undo(): any

Reverse the effects of this object change.

Returns

any