Overview | File | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class draw2d.Figure

    Object
       |
       +--draw2d.Figure

Direct Known Subclasses:
  draw2d.Window, draw2d.Annotation, draw2d.Rectangle, draw2d.Node, draw2d.Label, draw2d.Menu

class draw2d.Figure

Defined in Figure.js
Version: 0.8.7
Author: Andreas Herz

Constructor Summary
`draw2d.Figure ()`

Method Summary
`void` | `attachMoveListener( <draw2d.Figure> figure)`
`void` | `detachMoveListener( <draw2d.Figure> figure)`
`int` | `getAbsoluteX()`
`int` | `getAbsoluteY()`
`draw2d.Dimension` | `getBounds()`
`boolean` | `getCanSnapToHelper()` Returns true if the figure cna snap to any helper like a grid, guide, geometrie or something else.
`draw2d.Menu` | `getContextMenu()`
`int` | `getHeight()`
`String` | `getId()` Return the document unique id of this element.
`int` | `getMinHeight()` This value is relevant for the interactive resize of the figure.
`int` | `getMinWidth()` This value is relevant for the interactive resize of the figure.
`draw2d.CompartmentFigure` | `getParent()` Get the parent of this figure.
`draw2d.Point` | `getPosition()` Returns the position of the figure.
`Map` | `getProperties()` A figure can store user defined attributes.
`String` | `getProperty( key)` A figure can store user defined attributes.
`draw2d.Point` | `getSnapToGridAnchor()`
`int` | `getWidth()`
`Workflow` | `getWorkflow()`
`int` | `getX()`
`int` | `getY()`
`int` | `getZOrder()`
`boolean` | `hasFixedPosition()` Return true if the origin of the Object is the window and not the document.
`boolean` | `isDeleteable()` Return false if you avoid that the user can delete your figure.
`Object` | `isOver( iX , iY)`
`boolean` | `isResizeable()` Returns the true if the figure can be resized.
`boolean` | `isSelectable()`
`boolean` | `isStrechable()` Return true if the object doesn't care about the aspect ratio.
`void` | `onDoubleClick()` Callback method for the double click event of user interaction.
`boolean` | `onDragstart( x, y)` Will be called if the drag and drop action beginns.
`void` | `onKeyDown( <int> keyCode, ctrl)` This method will be called from the framework if the objects is selected and the user press any key.
`void` | `onMouseEnter()` Callback method for the mouse enter event.
`void` | `onMouseLeave()` Callback method for the mouse leave event.
`void` | `setAlpha( <float> percent)` Set the alpha blending of this figure.
`void` | `setBorder( <draw2d.Border> border)`
`void` | `setCanDrag(<boolean> flag)` Switch on/off the drag drop behaviour of this object
`void` | `setCanSnapToHelper(<boolean> flag)` Set the flag if this object can snap to grid or geometry.
`void` | `setDeleteable(<boolean> flag)` Return false if you avoid that the user can delete your figure.
`void` | `setDimension( <int> w, <int> h)` Set the new width and height of the figure.
`void` | `setPosition( <int> xPos , <int> yPos )` Set the position of the object.
`void` | `setProperty( <String> key, <String> value)` A figure can store any type of information.
`void` | `setResizeable( <boolean> flag)` You can change the resizeable behaviour of this object.
`void` | `setSelectable( <boolean> flag)` You can change the selectable behaviour of this object.
`draw2d.Point` | `setSnapToGridAnchor( point)`
`void` | `setZOrder( <int> index)`
`<static> void` | `setZOrderBaseIndex( <int> index)` Set the common z-index of the window element.

Constructor Detail

### draw2d.Figure

    draw2d.Figure()

Version: 0.8.7
Author: Andreas Herz

Method Detail

### attachMoveListener

    void attachMoveListener( <draw2d.Figure> figure)

Parameters:

`figure` - The figure to monitor

### detachMoveListener

    void detachMoveListener( <draw2d.Figure> figure)

Parameters:

`figure` - The figure to remove the monitor

### getAbsoluteX

    int getAbsoluteX()

Returns:

The X coordinate in relation to the canvas

### getAbsoluteY

    int getAbsoluteY()

Returns:

The Y coordinate in relation the Canvas.

### getBounds

    draw2d.Dimension getBounds()

### getCanSnapToHelper

    boolean getCanSnapToHelper()

Returns true if the figure cna snap to any helper like a grid, guide, geometrie or something else.

### getContextMenu

    draw2d.Menu getContextMenu()

Returns:

null or the Menu object for this figure.

### getHeight

    int getHeight()

### getId

    String getId()

Return the document unique id of this element. It is not an uuid or guid

### getMinHeight

    int getMinHeight()

This value is relevant for the interactive resize of the figure.

Returns:

Returns the min height of this object.

### getMinWidth

    int getMinWidth()

This value is relevant for the interactive resize of the figure.

Returns:

Returns the min width of this object.

### getParent

    draw2d.CompartmentFigure getParent()

Get the parent of this figure.

### getPosition

    draw2d.Point getPosition()

Returns the position of the figure.

Deprecated

### getProperties

    Map getProperties()

A figure can store user defined attributes. This method returns all properties stored in this figure.

Returns:

All user defined properties of the figure

See:

- setProperty()

### getProperty

    String getProperty( key)

A figure can store user defined attributes. This method returns the requested property.

Returns:

The user defined property of this figure.

See:

- setProperty()

### getSnapToGridAnchor

    draw2d.Point getSnapToGridAnchor()

### getWidth

    int getWidth()

### getWorkflow

    Workflow getWorkflow()

### getX

    int getX()

Returns:

the x-offset to the parent figure

### getY

    int getY()

Returns:

The y-offset to the parent figure.

### getZOrder

    int getZOrder()

Returns:

Returns the z-index of the element.

### hasFixedPosition

    boolean hasFixedPosition()

Return true if the origin of the Object is the window and not the document. This is usefull if you want implement a window or a dialog element. The element doesn't move if the user scroll the document.

Returns:

Returns [true] if the origin of the object the window.

### isDeleteable

    boolean isDeleteable()

Return false if you avoid that the user can delete your figure. Sub class can override this method.

### isOver

    Object isOver( iX , iY)

### isResizeable

    boolean isResizeable()

Returns the true if the figure can be resized.

See:

- setResizeable()

### isSelectable

    boolean isSelectable()

### isStrechable

    boolean isStrechable()

Return true if the object doesn't care about the aspect ratio. You can change the hight and width indipendent.

### onDoubleClick

    void onDoubleClick()

Callback method for the double click event of user interaction. Sub classes can override this method to implement their own behaviour.

### onDragstart

    boolean onDragstart( x, y)

Will be called if the drag and drop action beginns. You can return [false] if you want avoid the that the figure can be move.

### onKeyDown

    void onKeyDown( <int> keyCode, ctrl)

This method will be called from the framework if the objects is selected and the user press any key. Sub class can override this method to implement their own stuff.

Parameters:

`keyCode` - The code of the pressed key

### onMouseEnter

    void onMouseEnter()

Callback method for the mouse enter event. Usefull for mouse hover-effects. Sub classes can override this method to implement their own behaviour.

### onMouseLeave

    void onMouseLeave()

Callback method for the mouse leave event. Usefull for mouse hover-effects.

### setAlpha

    void setAlpha( <float> percent)

Set the alpha blending of this figure.

Parameters:

`percent` - Value between 0-1.

### setBorder

    void setBorder( <draw2d.Border> border)

Parameters:

`border` - Set the border for this figure

### setCanDrag

    void setCanDrag(<boolean> flag)

Switch on/off the drag drop behaviour of this object

Parameters:

`flag` - The new drag drop indicator

### setCanSnapToHelper

    void setCanSnapToHelper(<boolean> flag)

Set the flag if this object can snap to grid or geometry. A window of dialog should set this flag to false.

Parameters:

`flag` - The snap to grid/geometry enable flag.

### setDeleteable

    void setDeleteable(<boolean> flag)

Return false if you avoid that the user can delete your figure.

Parameters:

`flag` - Enable or disable flag for the delete operation

### setDimension

    void setDimension( <int> w, <int> h)

Set the new width and height of the figure.

Parameters:

`w` - The new width of the figure

`h` - The new height of the figure

See:

- getMinWidth()
- getMinHeight()

### setPosition

    void setPosition( <int> xPos , <int> yPos )

Set the position of the object.

Parameters:

`xPos` - The new x coordinate of the figure

`yPos` - The new y coordinate of the figure

### setProperty

    void setProperty( <String> key, <String> value)

A figure can store any type of information. You can use this to attach any String or Object to this figure.

Parameters:

`key` - The key of the property.

`value` - The value of the property.

See:

- getProperty()

### setResizeable

    void setResizeable( <boolean> flag)

You can change the resizeable behaviour of this object. Hands over [false] and the figure has no resizehandles if you select them with the mouse.

Parameters:

`flag` - The resizeable flag.

See:

- getResizeable

### setSelectable

    void setSelectable( <boolean> flag)

You can change the selectable behaviour of this object. Hands over [false] and the figure has no selection handles if you try to select them with the mouse.

Parameters:

`flag` - The selectable flag.

### setSnapToGridAnchor

    draw2d.Point setSnapToGridAnchor( point)

### setZOrder

    void setZOrder( <int> index)

Parameters:

`index` - Set the new z-index of the element

### setZOrderBaseIndex

    <static> void setZOrderBaseIndex( <int> index)

Set the common z-index of the window element. This method exists for compatibility reason to dojo or another UI javascript library. It is now possible to arange the draw2d elements behind/before other UI elements-

Parameters:

`index` - The z-order for all new figure objects.

See:

- setZOrder()

Overview | File | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Thu Feb 7 23:45:47 2008