Methods
translate the view just enough so that a given element is fully visible
Parameter | Type | Description |
---|
node | ibm_ilog.diagram.Node | |
margin | Number | Optional. |
Centers the viewport at the requested point, without changing the zoom.
Parameter | Type | Description |
---|
p | Point | |
options | | |
returns a matrix that transforms a client coordinate into a content coordinate
returns a matrix that transforms a content coordinate into a client coordinate
Gracefully destroys the receiver
Parameter | Type | Description |
---|
e | | |
Parameter | Type | Description |
---|
e | | |
Returns the content air percentage with respect to the client size
Returns the current viewport client size
This value is updated by content BB change notifications (see _onContentBoundingBoxChanged)
Returns the current maximum zoom constraint.
Returns the current minimum zoom constraint.
getRefreshContentsInterval getRefreshContentsSuspended The currently displayed area in diagram coordinates.
getViewportInverseTransform Returns the current zoom level based on the current view rectangle and content size.
Parameter | Type | Description |
---|
src | | |
evt | | |
object | | |
handler | | |
Parameter | Type | Description |
---|
handle | | |
src | | |
Initializes a Viewport for collaborating with the diagram.
Parameter | Type | Description |
---|
diagram | ibm_ilog.diagram.widget.Diagram | The diagram
this._scrollbars = diagram.scrollbarsNode;
this._scrollbarsContent = diagram.scrollbarsContentNode; |
transforms a client coordinate into a content coordinate
Parameter | Type | Description |
---|
p | Point | |
transforms a content coordinate into a client coordinate
Parameter | Type | Description |
---|
p | Point | |
Some corrections may be applied to r before assigning it
as the current View Rectangle:
- if width xor height are set, set the other based on current viewport aspect ratio
- for each axis:
- if origin is not defined and length is, make origin so that center is preserved
- if origin is defined but width is not, keep current length
- if both width and height are set but the aspect ratio is not correct, correct short
side to match correct aspect ratio and maintain visibility of desired area.
- if r goes beyond height or width, constrain location to make r within
- if r lies before the origin, set location to origin
- apply zoom constraints
Parameter | Type | Description |
---|
r | dojox.gfx.Rectangle | |
viewRect | dojox.gfx.Rectangle | |
Forces a refresh contents procedure, where the content rect is updated and consequently
associated scrollbars and other features.
Parameter | Type | Description |
---|
component | | |
Sets the content air percentage with respect to the client size
Parameter | Type | Description |
---|
factor | Number | |
Parameter | Type | Description |
---|
milliseconds | Number | |
Parameter | Type | Description |
---|
steps | Number | |
Parameter | Type | Description |
---|
animated | Boolean | |
Sets the client Size
Parameter | Type | Description |
---|
sz | Size | |
Parameter | Type | Description |
---|
b | Boolean | |
setHudZoomFeedbackEnabled Parameter | Type | Description |
---|
b | Boolean | |
Sets a maximum zoom and updates the view rectangle based on new constraints.
Parameter | Type | Description |
---|
z | Number | |
Sets a minimum zoom and updates the view rectangle based on new constraints.
Parameter | Type | Description |
---|
z | Number | |
setRefreshContentsInverval Parameter | Type | Description |
---|
msInterval | Number | |
setRefreshContentsSuspended Parameter | Type | Description |
---|
suspended | Boolean | |
Parameter | Type | Description |
---|
m | Number | |
Sets the Viewport Size
Parameter | Type | Description |
---|
sz | Size | |
Some corrections are applied to r. See prepareViewRect.
Parameter | Type | Description |
---|
r | dojox.gfx.Rectangle | |
options | Obj | Optional. .animate animation of the viewport
.instant
cancel animated viewport
.forceApply
causes the view rect to be applied even if it has not changed
.center
causes the view rect to be centered |
This method is a helper that actually controls setSourceRect expanding or shrinking
the view rectangle size to achieve the zoom effect.
Parameter | Type | Description |
---|
zoom | Number | |
options | .animate | animation of the viewport
.instant
cancel animated viewport
.forceApply
causes the view rect to be applied even if it has not changed |
This method is must return the template that the Diagram widget must use
in order to use the receiver as viewport.
diagram: ibm_ilog.diagram.widget.Diagram
The diagram
updateScrollbarVisibilityFlags Makes the r rectangle visible, givin it an extra air between the
area and the borders of the viewport if possible. The view may be
zoomed out if required, but it is never zoomed in.
Parameter | Type | Description |
---|
r | dojox.gfx.Rectangle | The area to make visible.
airFactor:
Percent of the area that is reserved as air. Overrides the default air
factor defined bu the member _focusAirFactor. |
options | {expandCurrent,airFactor} | |
Scales the current zooms by a given factor z, using point p as pivot.
Parameter | Type | Description |
---|
p | Point | |
z | Number | |
options | | |
Events
The viewport has been resized (implies the related onSourceChanged event)
Event triggered when the content rect has changed.
The view rectangle has been updated.
scrollbars may have reappeared/disappeared