Package org.eclipse.graphiti.mm.pictograms

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


    Anchor sAnchor = context.getSourceAnchor();
   
    //Move the source anchor to CI if we have a literal
    Object o = getBusinessObjectForPictogramElement(sAnchor.getParent());
    if (Utility.isObjectLiteral(o)) {
      PictogramElement pe = getFeatureProvider(
          ).getPictogramElementForBusinessObject(
              Utility.getParentLocalVariableStatement(
                  (EObject) o));
      if (pe instanceof AnchorContainer) {
        sAnchor = ((AnchorContainer) pe).getAnchors().get(0);
View Full Code Here


     *
     */
    public IReason updateNeeded(IUpdateContext context) {
        // retrieve name from pictogram model
        String pictogramName = null;
        PictogramElement pictogramElement = context.getPictogramElement();
        if (pictogramElement instanceof ContainerShape) {
            ContainerShape cs = (ContainerShape) pictogramElement;
            for (Shape shape : cs.getChildren()) {
                if (shape.getGraphicsAlgorithm() instanceof Text) {
                    Text text = (Text) shape.getGraphicsAlgorithm();
View Full Code Here

     * Updates PE variable name in line with model.
     */
    public boolean update(IUpdateContext context) {
        // retrieve name from business model
        String businessName = null;
        PictogramElement pictogramElement = context.getPictogramElement();
        Object bo = getBusinessObjectForPictogramElement(pictogramElement);
        if (bo instanceof LocalVariableStatement) {
          LocalVariableStatement lvs = (LocalVariableStatement) bo;
            businessName = lvs.getVariable().getName();
        }
View Full Code Here

     * We need to do an update if pictogram value doesn't match model.
     */
    public IReason updateNeeded(IUpdateContext context) {
        // retrieve name from pictogram model
        String pictogramValue = null;
        PictogramElement pictogramElement = context.getPictogramElement();
        if (pictogramElement instanceof ContainerShape) {
            ContainerShape cs = (ContainerShape) pictogramElement;
            for (Shape shape : cs.getChildren()) {
                if (shape.getGraphicsAlgorithm() instanceof MultiText) {
                  MultiText text = (MultiText) shape.getGraphicsAlgorithm();
View Full Code Here

     * Update pictogram value for literal to be in-line with model value.
     */
    public boolean update(IUpdateContext context) {
        // retrieve name from business model
        String businessValue = null;
        PictogramElement pictogramElement = context.getPictogramElement();
        Object bo = getBusinessObjectForPictogramElement(pictogramElement);
        if (Utility.isObjectLiteral(bo)) {
          businessValue = Utility.getLiteralValue((EObject) bo);
        }

View Full Code Here

   * Only allow editing of text.
   */
  @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 literal
    if (Utility.isObjectLiteral(bo)) {
View Full Code Here

  /**
   * Gets current model value for literal.
   */
  public String getInitialValue(IDirectEditingContext context) {

    PictogramElement pe = context.getPictogramElement();
    EObject eo = (EObject)
        getBusinessObjectForPictogramElement(pe);

    return Utility.getLiteralValue(eo);
  }
View Full Code Here

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

    // set the new value for the literal
    PictogramElement pe = context.getPictogramElement();
 
    EObject eo = (EObject) getBusinessObjectForPictogramElement(pe);
   
    Utility.setLiteralValue(eo, value);

View Full Code Here

  /**
   * Removes bolierplate holding the CI as well as CI itself.
   */
  public void preDelete(IDeleteContext context) {
   
    PictogramElement pe = context.getPictogramElement();
    Object obj = getBusinessObjectForPictogramElement(pe);
    if (obj instanceof LocalVariableStatement) {
      //Get the anchors and delete any connections
     
      if (pe instanceof ContainerShape) {
View Full Code Here

     */
    @Override
    public IDirectEditingFeature getDirectEditingFeature(
        IDirectEditingContext context) {

        PictogramElement pe = context.getPictogramElement();
        Object bo = getBusinessObjectForPictogramElement(pe);
       
        if (bo instanceof LocalVariableStatement) {
          if (Utility.isPEVariable((LocalVariableStatement) bo)) {
            return new DirectEditProcessingElementFeature(this);
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.