Examples of ImageFigure


Examples of org.eclipse.draw2d.ImageFigure

   * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
   */
  @Override
  protected IFigure createFigure() {
    _image = CalibratorUIActivator.getImageDescriptor("icons/cross.png").createImage(); //$NON-NLS-1$
    final ImageFigure fig = new ImageFigure(_image);
    final Rectangle bounds = _image.getBounds();
    fig.setBounds(new org.eclipse.draw2d.geometry.Rectangle(bounds));
    final net.sf.myway.base.db.Point p = (net.sf.myway.base.db.Point) getModel();
    if (p != null)
      fig.setLocation(new Point(p.getX(), p.getY()));
    return fig;
  }
View Full Code Here

Examples of org.eclipse.draw2d.ImageFigure

   */
  @Override
  protected IFigure createFigure() {
    final ScannedMap m = (ScannedMap) getModel();
    final Image image = new Image(Display.getDefault(), m.getFileName());
    final ImageFigure fig = new ImageFigure(image);
    final Rectangle bounds = image.getBounds();
    fig.setBounds(new org.eclipse.draw2d.geometry.Rectangle(bounds));
    fig.setLayoutManager(new XYLayout());
    fig.setAlignment(PositionConstants.NORTH | PositionConstants.WEST);
    if (m.getUpperleft().equals(m.getUpperright()) && m.getUpperleft().equals(m.getLowerleft())) {
      m.setUpperleft(new Point(25, 25));
      m.setUpperright(new Point(bounds.width - 25, 25));
      m.setLowerleft(new Point(25, bounds.height - 25));
      m.setLowerright(new Point(bounds.width - 25, bounds.height - 25));
View Full Code Here

Examples of org.eclipse.draw2d.ImageFigure

    final ImageDescriptor desc = EditUIPlugin.getImageDescriptor("/icons/" + symbol + ".png"); //$NON-NLS-1$ //$NON-NLS-2$
    if (desc == null)
      throw new IllegalArgumentException("Icon for " + obj.getType() + " not found! " //$NON-NLS-1$ //$NON-NLS-2$
        + symbol);
    final Image img = desc.createImage();
    final ImageFigure fig = new ImageFigure(img);
    final Rectangle bounds = img.getBounds();
    final CoordinateSystem cs = getCoordinateSystem();
    final Point p = cs.toPoint(obj.getCenter().getNode().getPosition());
    bounds.x = p.x - bounds.width / 2;
    bounds.y = p.y - bounds.height / 2;
    fig.setBounds(new org.eclipse.draw2d.geometry.Rectangle(bounds));
    fig.setLayoutManager(new XYLayout());
    return fig;
  }
View Full Code Here

Examples of org.eclipse.draw2d.ImageFigure

 
  protected IFigure createFigureForMarker(IMarker marker) {
    Image image = getImage(marker);
    String text = getText(marker);
    if (image != null) {
      ImageFigure imageFigure = new ImageFigure(image);
      if (text != null) {
        imageFigure.setToolTip(new Label(text));
      }
      return imageFigure;
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.draw2d.ImageFigure

        builder.append("\no ").append(text);
      }
    }
       
    if (image != null) {
      ImageFigure imageFigure = new ImageFigure(image);
      imageFigure.setToolTip(new Label( builder.toString() ));
      return imageFigure;
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.draw2d.ImageFigure

  }

  @Override
  protected IFigure createTitleFigure() {
    mainTrayTitleFigure = new MainTrayTitleFigure();
    mainTrayTitleFigure.add(new ImageFigure(getLabelProvider().getImage(getModel())));
    nameLabel = new Label(getLabelProvider().getText(getModel()));
    mainTrayTitleFigure.add(nameLabel);
    decorator = createEditPartMarkerDecorator();
    return decorator.createFigure(mainTrayTitleFigure);
  }
View Full Code Here

Examples of org.eclipse.draw2d.ImageFigure

   */
  protected class TitleLayout extends AbstractLayout {
    private static final int SPACING = 2;
    public void layout(IFigure container) {
      List elements = container.getChildren();
      ImageFigure icon = (ImageFigure)elements.get(0);
      Label text = (Label)elements.get(1);
      Figure removeButton = (Figure)elements.get(2);
      Figure addButton = (Figure)elements.get(3);
     
      Rectangle containerBounds = container.getBounds();
      int x = containerBounds.x + SPACING;
      int y = containerBounds.y;
      int height = containerBounds.height;
     
      Dimension size = icon.getPreferredSize();
      Rectangle bounds = new Rectangle(x, y, size.width, height);
      icon.setBounds(bounds);
     
      size = removeButton.getPreferredSize();
      x = (containerBounds.x + containerBounds.width) - size.width;
      bounds = new Rectangle(x, y, size.width, height);
      removeButton.setBounds(bounds);

      size = addButton.getPreferredSize();
      x = x - size.width;
      bounds = new Rectangle(x, y, size.width, height);
      addButton.setBounds(bounds);

      x = icon.getBounds().x + icon.getBounds().width;
      x = x + SPACING;
      int width = containerBounds.width - (icon.getBounds().width + removeButton.getBounds().width + addButton.getBounds().width);
      bounds = new Rectangle(x, y, width, height);
      text.setBounds(bounds);
    }
View Full Code Here

Examples of org.eclipse.draw2d.ImageFigure

    public TitleFigure() {
      super();
      setLayoutManager(new TitleLayout());
      setOpaque(true);
      setBackgroundColor(CommonUIPlugin.getDefault().getColorRegistry().get(IDetailsColors.COLOR_LIGHT_BACKGROUND));
      add(new ImageFigure(getLabelProvider().getImage(getModel())));
      textLabel = new Label(getLabelProvider().getText(getModel()));
      textLabel.setLabelAlignment(PositionConstants.LEFT);
      add(textLabel);
     
      removeButton = new NoBorderButton(CommonUIPlugin.getDefault().getImageRegistry().get(ICommonUIConstants.ICON_TRAY_CATEGORY_REMOVE_BUTTON)) {
View Full Code Here

Examples of org.eclipse.draw2d.ImageFigure

            }
          }
        });
        trayComposite.addListener(TrayComposite.EVENT_COLLAPSED_STATE_CHANGED, new Listener() {
          public void handleEvent(Event event) {
            setContents(new ImageFigure(getButtonImage()));
          }
        });
      }
View Full Code Here

Examples of org.eclipse.draw2d.ImageFigure

public abstract class Shape extends Figure {

  public Shape() {
    GridLayout layout = new GridLayout(1, false);
    super.setLayoutManager(layout);
    add(new ImageFigure(getShapeImage()), new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 1, 1));
  }
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.