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

## Class draw2d.Line

    Object
       |
       +--draw2d.Line

Direct Known Subclasses:
  draw2d.Connection

class draw2d.Line

Defined in Line.js
Version: 0.9.14
Author: Andreas Herz

Field Summary
`Object` | `zOrder`
`<static> Object` | `ZOrderBaseIndex`

Constructor Summary
`draw2d.Line ()`

Method Summary
`void` | `attachMoveListener( <draw2d.Figure> figure)`
`boolean` | `containsPoint( <int> px, <int> py)` Checks if the hands over coordinate on the line.
`void` | `detachMoveListener( <draw2d.Figure> figure)`
`float` | `getAngle()` Returns the angle of the line in degree
`draw2d.Color The paint color of the line.` | `getColor()` Return the current paint color.
`draw2d.Menu` | `getContextMenu()`
`draw2d.Point` | `getEndPoint()`
`int` | `getEndX()`
`int` | `getEndY()`
`int` | `getLength()` Returns the length of the line.
`draw2d.Point` | `getStartPoint()`
`int` | `getStartX()`
`int` | `getStartY()`
`Workflow` | `getWorkflow()`
`int` | `getZOrder()`
`boolean` | `isDeleteable()` Return false if you avoid that the user can delete your figure.
`boolean` | `isResizeable()` You can't drag&drop the resize handles if the line not resizeable.
`boolean` | `isSelectable()` Return true if the user can select the line.
`void` | `onDoubleClick()` Callback method for the double click event of user interaction.
`void` | `setAlpha( <float> percent)` Set the alpha blending of this figure.
`void` | `setColor( <draw2d.Color> color)` Set the color of the line.
`boolean` | `setDeleteable(flag)` Return false if you avoid that the user can delete your figure.
`void` | `setEndPoint(<int> x, <int> y)` Set the end point of the line.
`void` | `setLineWidth( <int> w)` Set the line width.
`void` | `setSelectable( <boolean> flag)` You can change the selectable behaviour of this object.
`void` | `setStartPoint( <int> x, <int> y)` Set the start point of the line.
`void` | `setZOrder( <int> index)`
`<static> void` | `setZOrderBaseIndex( <int> index)` Set the common z-index of the window element.

Field Detail

### zOrder

    Object zOrder

### ZOrderBaseIndex

    <static> Object ZOrderBaseIndex

Constructor Detail

### draw2d.Line

    draw2d.Line()

Version: 0.9.14
Author: Andreas Herz

Method Detail

### attachMoveListener

    void attachMoveListener( <draw2d.Figure> figure)

Parameters:

`figure` - The figure to monitor any movements

### containsPoint

    boolean containsPoint( <int> px, <int> py)

Checks if the hands over coordinate on the line.

Parameters:

`px` - the x coordinate of the test point

`py` - the y coordinate of the test point

### detachMoveListener

    void detachMoveListener( <draw2d.Figure> figure)

Parameters:

`figure` - The figure to to remove the movement monitor

### getAngle

    float getAngle()

Returns the angle of the line in degree

                                     270°
                                   |
                                   |
                                   |
                                   |
     180° -------------------------+------------------------> +X
                                   |                        0°
                                   |
                                   |
                                   |
                                   V +Y
                                  90°

### getColor

    draw2d.Color The paint color of the line. getColor()

Return the current paint color.

### getContextMenu

    draw2d.Menu getContextMenu()

Returns:

null or the Menu object for this figure.

### getEndPoint

    draw2d.Point getEndPoint()

### getEndX

    int getEndX()

### getEndY

    int getEndY()

### getLength

    int getLength()

Returns the length of the line.

### getStartPoint

    draw2d.Point getStartPoint()

### getStartX

    int getStartX()

### getStartY

    int getStartY()

### getWorkflow

    Workflow getWorkflow()

### getZOrder

    int getZOrder()

Returns:

Returns the z-index of the element.

### isDeleteable

    boolean isDeleteable()

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

### isResizeable

    boolean isResizeable()

You can't drag&drop the resize handles if the line not resizeable.

### isSelectable

    boolean isSelectable()

Return true if the user can select the line.

### onDoubleClick

    void onDoubleClick()

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

### setAlpha

    void setAlpha( <float> percent)

Set the alpha blending of this figure.

Parameters:

`percent` - Value between 0-1.

### setColor

    void setColor( <draw2d.Color> color)

Set the color of the line. This method fires a document dirty event.

Parameters:

`color` - The new color of the line.

### setDeleteable

    boolean setDeleteable(flag)

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

### setEndPoint

    void setEndPoint(<int> x, <int> y)

Set the end point of the line. This method fires a document dirty event.

Parameters:

`x` - the x coordinate of the end point

`y` - the y coordinate of the end point

### setLineWidth

    void setLineWidth( <int> w)

Set the line width. This enforce a repaint of the line. This method fires a document dirty event.

Parameters:

`w` - The new line width of the figure.

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

### setStartPoint

    void setStartPoint( <int> x, <int> y)

Set the start point of the line. This method fires a document dirty event.

Parameters:

`x` - the x coordinate of the start point

`y` - the y coordinate of the start 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 ossible to arange the draw2d elements behind/before other UI elements-

Parameters:

`index` - The z-order for all new line 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