simtools.diagram.test
Class TestComponent.TestSelection

java.lang.Object
  extended by java.awt.geom.RectangularShape
      extended by java.awt.geom.Rectangle2D
          extended by java.awt.Rectangle
              extended by simtools.diagram.DiagramSelection
                  extended by simtools.diagram.test.TestComponent.TestSelection
All Implemented Interfaces:
java.awt.Shape, java.io.Serializable, java.lang.Cloneable
Enclosing class:
TestComponent

public class TestComponent.TestSelection
extends DiagramSelection

A model selection enables to select and edit several parts of a model diagram at a time

See Also:
DiagramSelection, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class simtools.diagram.DiagramSelection
DiagramSelection.ShapeHorizontalPositionComparator, DiagramSelection.ShapeVerticalPositionComparator
 
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float
 
Field Summary
 
Fields inherited from class java.awt.Rectangle
height, width, x, y
 
Fields inherited from class java.awt.geom.Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
 
Constructor Summary
TestComponent.TestSelection()
           
 
Method Summary
protected  boolean addShapeAt(int ox, int oy)
          The first shape which contains the given coordinates is added to the selected shapes list.
protected  boolean addShapesInside()
          All the shapes which are inside the selection area
protected  void clear()
          Remove all the selected shapes
 java.awt.Shape copyConnectionShape(java.awt.Shape s, DiagramConnector in, DiagramConnector out)
          Copy a connection shape This implementation creates nothing By overriding this method, specif shapes can be managed
 java.awt.Shape copyShape(java.awt.Shape s)
          Copy a shape (into the clipboard)
 void deleteShape(java.awt.Shape s)
          Delete a shape By overriding this method, one can use an other iterator on the shapes.
 void translateConnectionShape(java.awt.Shape s, DiagramConnector c, int dx, int dy)
          Translate a shape connected to an other one This implementation translates links
 void translateShape(java.awt.Shape s, int dx, int dy)
          Translate a shape
 
Methods inherited from class simtools.diagram.DiagramSelection
add, addAllShapes, addListener, addPoint, alignSelection, alignSelectionHCenter, alignSelectionToBottom, alignSelectionToLeft, alignSelectionToRight, alignSelectionToTop, alignSelectionVCenter, bringSelectionForward, bringSelectionToFront, checkResizeWay, copySelection, deleteSelection, distributeSelectionHorizontally, distributeSelectionVertically, getComponent, getGrid, getSelectedShape, getSelectedShape, getSelectedShapeAt, getSelection, getShape, getShapeCount, getShapeOrigin, gridPosition, isEmpty, isSelected, isSelected, isSizing, propagate, removeAllListeners, removeListener, removeShapeAt, resizeSelection, resizeShape, selectAll, selectArea, selectAreaEnd, selectPoint, sendSelectionBackward, sendSelectionToBack, setGrid, setShapes, translateSelection, unselect
 
Methods inherited from class java.awt.Rectangle
add, add, add, contains, contains, contains, contains, createIntersection, createUnion, equals, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, toString, translate, union
 
Methods inherited from class java.awt.geom.Rectangle2D
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union
 
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects
 

Constructor Detail

TestComponent.TestSelection

public TestComponent.TestSelection()
Method Detail

clear

protected void clear()
Remove all the selected shapes

Overrides:
clear in class DiagramSelection

copyShape

public java.awt.Shape copyShape(java.awt.Shape s)
Copy a shape (into the clipboard)

Overrides:
copyShape in class DiagramSelection
Parameters:
s - the shape
Returns:
a copy

copyConnectionShape

public java.awt.Shape copyConnectionShape(java.awt.Shape s,
                                          DiagramConnector in,
                                          DiagramConnector out)
Copy a connection shape This implementation creates nothing By overriding this method, specif shapes can be managed

Overrides:
copyConnectionShape in class DiagramSelection
Parameters:
s - the shape
in - the input connector
out - the output connector
Returns:
a copy

deleteShape

public void deleteShape(java.awt.Shape s)
Delete a shape By overriding this method, one can use an other iterator on the shapes.

Overrides:
deleteShape in class DiagramSelection
Parameters:
s - the shape

translateShape

public void translateShape(java.awt.Shape s,
                           int dx,
                           int dy)
Translate a shape

Overrides:
translateShape in class DiagramSelection
Parameters:
s - the shape
dx - x translation
dy - y translation

translateConnectionShape

public void translateConnectionShape(java.awt.Shape s,
                                     DiagramConnector c,
                                     int dx,
                                     int dy)
Translate a shape connected to an other one This implementation translates links

Overrides:
translateConnectionShape in class DiagramSelection
Parameters:
s - the shape
c - the connector
dx - x translation
dy - y translation

addShapeAt

protected boolean addShapeAt(int ox,
                             int oy)
The first shape which contains the given coordinates is added to the selected shapes list.

Overrides:
addShapeAt in class DiagramSelection
Parameters:
ox - the x coordinate
oy - the y coordinate

addShapesInside

protected boolean addShapesInside()
All the shapes which are inside the selection area

Overrides:
addShapesInside in class DiagramSelection