Examples of SelectionPresentation


Examples of org.eclipse.sapphire.ui.diagram.shape.def.SelectionPresentation

  @Override
  protected void fillShape(Graphics graphics)
  {
    BackgroundDef bg = null;
    if (selected) {
      SelectionPresentation selectionPresentation = this.rectPresentation.getSelectionPresentation();
      bg = (selectionPresentation != null) ? selectionPresentation.getBackground().content() : null;
    }
    if (bg == null) {
      bg = this.rectPresentation.getBackground();
    }
   
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.shape.def.SelectionPresentation

  protected List<?> createSelectionHandles()
  {
    List<AbstractHandle> list = new ArrayList<AbstractHandle>();
    GraphicalEditPart owner = (GraphicalEditPart) getHost();
    ShapeEditPart shapeEditPart = (ShapeEditPart)owner;
    SelectionPresentation selectionPresentation = shapeEditPart.getShapePresentation().getSelectionPresentation();
    DiagramResourceCache resourceCache = shapeEditPart.getNodeEditPart().getCastedModel().getDiagramModel().getResourceCache();
    SapphireSurroundingHandle selectionHandle = new SapphireSurroundingHandle(owner, shapeEditPart.getConfigurationManager(),
        resourceCache, isDragAllowed());
    if (selectionPresentation != null)
    {
      selectionHandle.setLineOffset(selectionPresentation.getOffset().content());
      selectionHandle.setLineWidth(selectionPresentation.getWeight().content());
      selectionHandle.setLineStyle(FigureUtil.convertLineStyle(selectionPresentation.getStyle().content()));
      selectionHandle.setLineColor(selectionPresentation.getColor().content());
    }
    list.add(selectionHandle);
    return list;
  }
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.shape.def.SelectionPresentation

    DiagramNodeEditPart owner = (DiagramNodeEditPart) getHost();
    return owner.getCastedModel().getShapeModel().getShapePresentation().getSelectionPresentation();
  }
 
  private Color getOutlineColor() {
    SelectionPresentation selectionPresentation = getSelectionPresentation();
    if (selectionPresentation != null) {
      return resourceCache.getColor(selectionPresentation.getColor().content());
    } else {
      return resourceCache.getOutlineColor();
    }
  }
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.shape.def.SelectionPresentation

      // display 'move' handle to allow dragging
      MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost());
      moveHandle.setDragTracker(getDragTracker());
      moveHandle.setCursor(Cursors.SIZEALL);
      LineBorder border = new LineBorder(resourceCache.getOutlineColor(), 1, Graphics.LINE_DASH);
      SelectionPresentation selectionPresentation = getSelectionPresentation();
      if (selectionPresentation != null) {
        border.setColor(resourceCache.getColor(selectionPresentation.getColor().content()));
        border.setStyle(FigureUtil.convertLineStyle(selectionPresentation.getStyle().content()));
        border.setWidth(selectionPresentation.getWeight().content());
      }
      moveHandle.setBorder(border);
      handles.add(moveHandle);
    } else {
      // display 'move' handle only to indicate selection
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.shape.def.SelectionPresentation

  protected List<?> createSelectionHandles()
  {
    List<AbstractHandle> list = new ArrayList<AbstractHandle>();
    GraphicalEditPart owner = (GraphicalEditPart) getHost();
    DiagramResourceCache resourceCache = ((DiagramNodeEditPart)owner).getCastedModel().getDiagramModel().getResourceCache();
    SelectionPresentation selectionPresentation = ((DiagramNodeEditPart)owner).getCastedModel().getShapeModel().getShapePresentation().getSelectionPresentation();
    SapphireSurroundingHandle selectionHandle = new SapphireSurroundingHandle(owner, ((DiagramNodeEditPart)owner).getConfigurationManager(),
        resourceCache, isDragAllowed());
    if (selectionPresentation != null)
    {
      selectionHandle.setLineOffset(selectionPresentation.getOffset().content());
      selectionHandle.setLineWidth(selectionPresentation.getWeight().content());
      selectionHandle.setLineStyle(FigureUtil.convertLineStyle(selectionPresentation.getStyle().content()));
      selectionHandle.setLineColor(selectionPresentation.getColor().content());
    }
    list.add(selectionHandle);
    return list;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.