Package org.eclipse.graphiti.mm.pictograms

Examples of org.eclipse.graphiti.mm.pictograms.PictogramElement


     * Maps update requests to methods.
     */
    @Override
    public IUpdateFeature getUpdateFeature(IUpdateContext context) {

        PictogramElement pictogramElement = context.getPictogramElement();
        if (pictogramElement instanceof ContainerShape) {
            Object bo = getBusinessObjectForPictogramElement(pictogramElement);
            if (bo instanceof LocalVariableStatement) {
              if (Utility.isPEVariable((LocalVariableStatement) bo)) {
                return new UpdateProcessingElementFeature(this);
View Full Code Here


     * objects are resized, not layouting of complete diagram.
     */
    @Override
    public ILayoutFeature getLayoutFeature(ILayoutContext context) {

        PictogramElement pictogramElement = context.getPictogramElement();
        Object bo = getBusinessObjectForPictogramElement(pictogramElement);

        if (bo instanceof LocalVariableStatement) {
          if (Utility.isPEVariable((LocalVariableStatement) bo)) {
            return new LayoutPEFeature(this);
View Full Code Here

  
      if (getDiagram().getChildren().size() == 0) {
        layout = true;
      }
     
        PictogramElement pictogramElement = context.getPictogramElement();
        eu.admire.dispel.containers.Package pck =
          (eu.admire.dispel.containers.Package)
          getBusinessObjectForPictogramElement(pictogramElement);
       
         //Add any missing
View Full Code Here

  }
 
  @Override
  public void execute(ICustomContext context) {

    PictogramElement pe = context.getPictogramElements()[0];

    Object o = getBusinessObjectForPictogramElement(pe);
   
    //Need to handle both pes and literals here
    if (Utility.isObjectLiteral(o) || o instanceof LocalVariableStatement) {
View Full Code Here

   * Removes any connections to PE.
   */
  public void preDelete(IDeleteContext context) {

    //Need to find any incoming or outgoing connections and delete them
    PictogramElement pe = context.getPictogramElement();

    eu.admire.dispel.containers.Package p =
        Utility.getPackage(getDiagram());
    if (pe instanceof ContainerShape) {
      ContainerShape cs = (ContainerShape) pe;
View Full Code Here

     * Check we have a PE connected to the model.
     */
    public boolean canLayout(ILayoutContext context) {

       // return true, if pictogram element is linked to a LVS
       PictogramElement pe = context.getPictogramElement();
       if (!(pe instanceof ContainerShape)) {
           return false;
       }

       EList<EObject> businessObjects = pe.getLink().getBusinessObjects();

       if (businessObjects.size() == 1
              && businessObjects.get(0) instanceof LocalVariableStatement) {
         return true;
       }
View Full Code Here

   * Allow editing if clicked on variable name.
   */
  @Override
  public boolean canDirectEdit(IDirectEditingContext context) {

    PictogramElement pe = context.getPictogramElement();
    Object bo = getBusinessObjectForPictogramElement(pe);
    GraphicsAlgorithm ga = context.getGraphicsAlgorithm();

    // support direct editing, if it is a PE, and the user clicked
    // directly on the text and not somewhere else in the rectangle
View Full Code Here

  /**
   * Get the current value in the model.
   */
  public String getInitialValue(IDirectEditingContext context) {

    PictogramElement pe = context.getPictogramElement();
    LocalVariableStatement lvs = (LocalVariableStatement)
        getBusinessObjectForPictogramElement(pe);

    return lvs.getVariable().getName();
  }
View Full Code Here

   */
  @Override
  public void setValue(String value, IDirectEditingContext context) {

    // set the new name for the PE
    PictogramElement pe = context.getPictogramElement();
    LocalVariableStatement lvs = (LocalVariableStatement) getBusinessObjectForPictogramElement(pe);

    lvs.getVariable().setName(value);

    updatePictogramElement(((Shape) pe).getContainer());
View Full Code Here

  @Override
  protected void addDefaultMenuGroupRest(IMenuManager manager) {
    addAlignmentSubMenu(manager, GEFActionConstants.GROUP_REST);

    PictogramElement pes[] = getBehavior().getSelectedPictogramElements();
    ICustomContext context = new CustomContext(pes);

    IToolBehaviorProvider tb = getConfigurationProvider().getDiagramTypeProvider().getCurrentToolBehaviorProvider();
    IContextMenuEntry[] contextMenuEntries = tb.getContextMenu(context);
View Full Code Here

TOP

Related Classes of org.eclipse.graphiti.mm.pictograms.PictogramElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.