simtools.diagram
Class DiagramSelectedLineShape

java.lang.Object
  extended by simtools.diagram.DiagramSelectedShape
      extended by simtools.diagram.DiagramSelectedLineShape
Direct Known Subclasses:
ConnectionShape.SelectedConnectionShape

public abstract class DiagramSelectedLineShape
extends DiagramSelectedShape

A DiagramSelectedShape to manage LineInterface

Author:
cazenave_c

Nested Class Summary
 class DiagramSelectedLineShape.TranslatePointsEdit
           
 
Field Summary
 
Fields inherited from class simtools.diagram.DiagramSelectedShape
p, pd, s
 
Constructor Summary
protected DiagramSelectedLineShape(java.awt.Shape s, java.awt.Point p)
           
 
Method Summary
 boolean canBeSelectedAt(int ox, int oy)
           
 boolean canDrawBounds()
          Allows to overload selected shape bounds drawing
 void drawBounds(java.awt.Graphics2D g2)
          Allows to overload selected shape bounds drawing
 java.awt.geom.Rectangle2D getInnerBounds()
           
 int getPointIndex(int ox, int oy)
           
 boolean getSelectionStatus(boolean selected)
          Check if all the points are selected or if none are selected
protected abstract  boolean isSelectedPoint(int index)
           
 void selectAll(boolean selected)
           
protected abstract  void selectPoint(int index, boolean selected)
           
 java.awt.Point selectPointAt(int ox, int oy, boolean selected)
          Method used to select a point at a given coordinate
 java.awt.Point selectPointsInside(java.awt.geom.Rectangle2D bounds)
          Method used to select the points that are inside a rectangle
 javax.swing.undo.UndoableEdit translate(int depx, int depy)
           
 
Methods inherited from class simtools.diagram.DiagramSelectedShape
setOrigin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiagramSelectedLineShape

protected DiagramSelectedLineShape(java.awt.Shape s,
                                   java.awt.Point p)
Parameters:
s -
p -
Method Detail

selectPoint

protected abstract void selectPoint(int index,
                                    boolean selected)

isSelectedPoint

protected abstract boolean isSelectedPoint(int index)

getPointIndex

public int getPointIndex(int ox,
                         int oy)

selectPointAt

public java.awt.Point selectPointAt(int ox,
                                    int oy,
                                    boolean selected)
Method used to select a point at a given coordinate

Parameters:
ox - the x coordinate
oy - the y coordinate
selected - true to select the point false overwise
Returns:
the point coordinates if it exists and if it selection status changes

selectPointsInside

public java.awt.Point selectPointsInside(java.awt.geom.Rectangle2D bounds)
Method used to select the points that are inside a rectangle

Parameters:
bounds - the rectangle
Returns:
the first point coordinate or null if none

getInnerBounds

public java.awt.geom.Rectangle2D getInnerBounds()

selectAll

public void selectAll(boolean selected)
Parameters:
selected -

getSelectionStatus

public boolean getSelectionStatus(boolean selected)
Check if all the points are selected or if none are selected

Parameters:
selected - is set to true to check if all selected and set to false to check if none selectes
Returns:
the status

canBeSelectedAt

public boolean canBeSelectedAt(int ox,
                               int oy)
Parameters:
ox -
oy -
Returns:

translate

public javax.swing.undo.UndoableEdit translate(int depx,
                                               int depy)
Parameters:
depx -
depy -
Returns:

canDrawBounds

public boolean canDrawBounds()
Description copied from class: DiagramSelectedShape
Allows to overload selected shape bounds drawing

Overrides:
canDrawBounds in class DiagramSelectedShape
Returns:

drawBounds

public void drawBounds(java.awt.Graphics2D g2)
Description copied from class: DiagramSelectedShape
Allows to overload selected shape bounds drawing

Overrides:
drawBounds in class DiagramSelectedShape