Package org.eclipse.draw2d

Examples of org.eclipse.draw2d.Figure


    /* (non-Javadoc)
     * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
     */
    protected IFigure createFigure() {
        Figure f = new FreeformLayer();
        f.setBorder( new MarginBorder( 3 ) );
        f.setLayoutManager( new FreeformLayout() );
        return f;
    }
View Full Code Here


    ToolbarLayout membersLayout = new ToolbarLayout();
    membersLayout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
    membersLayout.setStretchMinorAxis(false);
    membersLayout.setSpacing(4);
   
    Figure membersFigure = new Figure();
    membersFigure.setLayoutManager(membersLayout);
    membersFigure.setBorder(new CompartmentFigureBorder());
    for(ITypeService<?, ?> typeSrv : typeServices) {
      if(extendedDisplay) {
        if(typeSrv instanceof IClassService) {
          IClassService<?, ?> classSrv =
            (IClassService<?, ?>)typeSrv;
          membersFigure.add(new ClassFigure(classSrv));
        }
        else if(typeSrv instanceof IInterfaceService) {
          IInterfaceService<?, ?> interfaceSrv =
            (IInterfaceService<?, ?>)typeSrv;
          membersFigure.add(
              new InterfaceFigure<IInterfaceService<?, ?>>(
                  interfaceSrv
              )
          );
        }
      }
      else {
        if(typeSrv instanceof IClassService) {
          Label classLabel =
            new Label(
                typeSrv.getSimpleName(),
                ClassFigure.createClassIcon()
            );
          membersFigure.add(classLabel);
        }
        else if(typeSrv instanceof IInterfaceService) {
          Label interfaceLabel =
            new Label(
                typeSrv.getSimpleName(),
                InterfaceFigure.createInterfaceIcon()
            );
          membersFigure.add(interfaceLabel);
        }
        else {
          Label label = new Label(typeSrv.getSimpleName());
          membersFigure.add(label);
        }
      }
    }
    add(membersFigure);
  }
View Full Code Here

   *
   * @return Figure.
   */
  @Override
  protected IFigure createFigure() {
    Figure f = new MusicDiagramDrawableFreeformLayer(
        (MusicDiagram) getModel());
    f.setLayoutManager(new FreeformLayout());
    f.setBorder(new MarginBorder(10));   
    return f;
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  void addNodes(NodeList nodes) {
    subgraph = new Subgraph(this);
    subgraph.innerPadding = new Insets(0, 0, 0, 0);
    subgraph.insets = new Insets(20, 0, 0, 0);
    Figure figure = (Figure) getFigure();
    subgraph.setSize(figure.getPreferredSize());
    subgraph.setPadding(new Insets(2, 2, 2, 2));
    nodes.add(subgraph);

    for (Object child : getChildren()) {
      if (child instanceof VertexEditPart) {
View Full Code Here

  @Override
  protected IFigure createFigure() {
    // The figure associated with this graph edit part is only a
    // free form layer
    Figure f = new FreeformLayer();
    f.setLayoutManager(new FreeformLayout());

    // Create the static router for the connection layer
    ConnectionLayer connLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
    ShortestPathConnectionRouter router = new ShortestPathConnectionRouter(
        f);
View Full Code Here

  @Override
  protected IFigure createFigure() {
    // The figure associated with this graph edit part is only a
    // free form layer
    Figure root = new FreeformLayer();
    root.setLayoutManager(new FreeformLayout());

    IStatus status = (IStatus) getModel();
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    Throwable exc = status.getException();
    Throwable cause = exc.getCause();
    if (cause == null) {
      exc.printStackTrace(new PrintStream(bos));
    } else {
      cause.printStackTrace(new PrintStream(bos));
    }

    Display d = Display.getCurrent();
    Image image = d.getSystemImage(SWT.ICON_ERROR);
    Label labelImage = new Label(image);
    root.add(labelImage, new Rectangle(5, 5, -1, -1));

    Label label = new Label(status.getMessage() + ": " + exc.getMessage()
        + "\n" + bos.toString());
    root.add(label, new Rectangle(10 + image.getBounds().width, 5, -1, -1));

    return root;
  }
View Full Code Here

  void addNodes(NodeList nodes, Subgraph parent) {
    node = new Node(this, parent);
    nodes.add(node);

    // Graphical stuff
    Figure figure = (Figure) getFigure();
    node.setSize(figure.getPreferredSize());
    node.setPadding(new Insets(35, 35, 35, 35));
  }
View Full Code Here

  /**
   * @generated
   */
  protected IFigure createFocusFeedbackFigure() {
    return new Figure() {

      protected void paintFigure(Graphics graphics) {
        graphics.drawFocus(getBounds().getResized(-1, -1));
      }
    };
View Full Code Here

  /**
   * @generated
   */
  protected IFigure createFocusFeedbackFigure() {
    return new Figure() {

      protected void paintFigure(Graphics graphics) {
        graphics.drawFocus(getBounds().getResized(-1, -1));
      }
    };
View Full Code Here

  /**
   * @generated
   */
  protected IFigure createFocusFeedbackFigure() {
    return new Figure() {

      protected void paintFigure(Graphics graphics) {
        graphics.drawFocus(getBounds().getResized(-1, -1));
      }
    };
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.Figure

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.