PERGOLA LOGO

pergola.RubberBox

System events: YES.

User events and functions: YES.

System component. The pergola.rubberBox is normally used in conjunction with the pergola.dragarea. Example of initialization (context: a selection tool):

 pergola.rubberBox.set({
    user : this.currentLayer,
    fn : fn,
    point : pergola.mousePoint(evt)
  });

  pergola.dragarea.resize(this.absoluteX(this.container), this.absoluteY(this.container), this.visibleW, this.visibleH)
  .activate({
    callback : pergola.rubberBox.update,
    handle : pergola.rubberBox,
    offset : this.getOffset(),
    updateCoordinates : false
  });

Example (lens tool zoom region).

Listed: class properties/methods; prototype properties and methods; instance properties. Prototype properties and methods inherited by the Class superclass are not listed.

class

None

prototype

PROPERTIES

parent

pergola.systemComponents. Overriding values are rejected.

"stroke-width"

Defined in pergola.presentationAttributes – number (user space units).

"stroke-dasharray"

Defined in pergola.presentationAttributes – string.

maskStroke

Defined in pergola.presentationAttributes – string.

METHODS

set(object)

this inherits the required properties specified in object: user; point; fn.

release(evt)

This method is invoked upon release of pergola.dragarea. Invokes this fn passing the event and an array containing the vertices of this rect. You don't need to invoke this method explicitly.

update(evt)

Callback for pergola.dragarea, invoked as a method of pergola.dragarea where the handle property refers to pergola.rubberBox. You don't need to invoke this method explicitly.

reset()

Invoked by this release(). Restores initial values. You don't need to invoke this method explicitly.

build(object)

this inherits the properties specified in object. Prototype properties specified in object are overridden. Creates elements. Returns this.

instance

name

String. If not passed to the constructor, gets a generated XML name (Class).

id

String. The return value of this name.toXML(). This container ID. Used as prefix where other elements' IDs are attributed.

owner

If specified, designates the owner object. Note: for the pergola.rubberBox created at runtime this property is not specified.

container

<g> element.

mask

<rect> element.

rect

<rect> element.

width

Number (user space units).

height

Number (user space units).

tempX

Stores the value of this x.

tempY

Stores the value of this y.

user

Must be specified in the initialization object passed to this set(); designates the object requesting the use of the pergola.rubberBox.

point

Must be specified in the initialization object passed to this set(); object specifying x,y number mouse coordinates (typically the value returned by pergola.mousePoint()).

fn

Must be specified in the initialization object passed to this set(); the name (string) of the method to be invoked as a method of user upon release().