simtools.diagram
Interface LineShapeInterface

All Superinterfaces:
SelectableShapeInterface
All Known Implementing Classes:
ConnectionShape

public interface LineShapeInterface
extends SelectableShapeInterface

An interface for shapes based on a set of lines that we need to modify at point level instead of bounds of the shape. A simple straight line can be modified using the bounds of the shape or using one of its ends. If the line is horizontal or vertical the bounds widht or height is equal to zero and this generates problems to resize it. It is also more natural to change the line shape by moving one of its ends instead of resising its bounds.

Author:
cazenave_c

Method Summary
 int getX(int index)
          Get point coordinates
 int getY(int index)
          Get point coordinates
 int pointsNumber()
           
 void translatePoint(int index, int dx, int dy)
          Translate a point
 
Methods inherited from interface simtools.diagram.SelectableShapeInterface
createSelectedShape, createSelectedShape, createSelectedShape
 

Method Detail

pointsNumber

int pointsNumber()
Returns:
number of points for this line (minimum is 2)

getX

int getX(int index)
Get point coordinates

Parameters:
index - the index of the point between 0 and pointsNumber
Returns:
the x coordinate

getY

int getY(int index)
Get point coordinates

Parameters:
index - the index of the point between 0 and pointsNumber
Returns:
the y coordinate

translatePoint

void translatePoint(int index,
                    int dx,
                    int dy)
Translate a point

Parameters:
index - the index of the point between 0 and pointsNumber
dx - the x value for the translation
dy - the y value for the translation