SAM

org.topcased.modeler.sam.edit.policies
Class SAMPortLayoutEditPolicy

java.lang.Object
  extended by ModelerLayoutEditPolicy
      extended by org.topcased.modeler.sam.edit.policies.SAMPortLayoutEditPolicy

public class SAMPortLayoutEditPolicy
extends ModelerLayoutEditPolicy

An EditPolicy that manage creation and moves of a Port inside its container (System or Automaton). The Port is attached to the nearest border (Left, Right or Bottom) Created 6 June 2005


Constructor Summary
SAMPortLayoutEditPolicy()
          Default contructor.
 
Method Summary
protected  org.eclipse.gef.commands.Command createAddCommand(org.eclipse.gef.EditPart child, java.lang.Object constraint, org.eclipse.draw2d.geometry.Point mouseLocation)
          Create and return the Command used to perform the DND of a Port
protected  org.eclipse.gef.commands.Command getAddCommand(org.eclipse.gef.Request generic)
          Copy the code of the LayoutEditPolicy and pass to the createAddCommand the mouseLocation given by the request
protected  boolean isAttachedToBorder(GraphNode node)
           
protected  boolean isValid(EObject child, EObject parent)
          Added a condition to disallow adding new ports to instances of a system/automaton.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAMPortLayoutEditPolicy

public SAMPortLayoutEditPolicy()
Default contructor. None border are available for anchoring a port.

Method Detail

isValid

protected boolean isValid(EObject child,
                          EObject parent)
Added a condition to disallow adding new ports to instances of a system/automaton. Also disallow working with an instanciated port.

See Also:
org.topcased.modeler.edit.policies.ModelerLayoutEditPolicy#isValid(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject)

isAttachedToBorder

protected boolean isAttachedToBorder(GraphNode node)
See Also:
org.topcased.modeler.edit.policies.ModelerLayoutEditPolicy#isAttachedToBorder(org.topcased.modeler.di.model.GraphNode)

getAddCommand

protected org.eclipse.gef.commands.Command getAddCommand(org.eclipse.gef.Request generic)
Copy the code of the LayoutEditPolicy and pass to the createAddCommand the mouseLocation given by the request

See Also:
LayoutEditPolicy.getAddCommand(org.eclipse.gef.Request)

createAddCommand

protected org.eclipse.gef.commands.Command createAddCommand(org.eclipse.gef.EditPart child,
                                                            java.lang.Object constraint,
                                                            org.eclipse.draw2d.geometry.Point mouseLocation)
Create and return the Command used to perform the DND of a Port

Parameters:
child -
constraint -
mouseLocation -
Returns:
the Command to perform the DND Command

SAM

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.