Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Region


        String url = null;
        if (this.getItemURLGenerator(row, column) != null) {
          url = this.getItemURLGenerator(row, column).generateURL(
              dataset, row, column);
        }
        final Region reg = new Region();
        reg.add(bar);
        final CategoryItemEntity entity = new CategoryItemEntity(reg,
            tip, url, dataset, row, dataset.getColumnKey(column),
            column);
        entities.add(entity);
      }
View Full Code Here


      }

      // add an item entity, if this information is being collected
      final EntityCollection entities = state.getEntityCollection();
      if (entities != null) {
        final Region region = new Region();
        region.add(bar);
        this.addItemEntity(entities, dataset, row, column, region);
      }
    } else if (pass == 1) {
      final CategoryItemLabelGenerator generator = this
          .getItemLabelGenerator(row, column);
View Full Code Here

                systemControlsBar.setLocation(shellSize.x - marginRight
                    - systemControlsBar.getSize().x, titleLocY
                    + (realTitleHeight - systemControlsBar.getSize().y) / 2);
        }

        final Region region = new Region();
        region.add(createOutline(shellSize, anchor, true));

        shell.setRegion(region);
        shell.addListener(SWT.Dispose, new Listener() {
            public void handleEvent(Event event) {
                region.dispose();
            }
        });

        final int[] outline = createOutline(shellSize, anchor, false);
        shell.addListener(SWT.Paint, new Listener() {
View Full Code Here

    }

    // add an item entity, if this information is being collected
    final EntityCollection entities = state.getEntityCollection();
    if (entities != null) {
      final Region region = new Region();
      region.add(bar);
      this.addItemEntity(entities, dataset, row, column, region);
    }

  }
View Full Code Here

              .getEntityCollection();
          if (entities != null) {
            final String tooltip = this
                .getCategoryLabelToolTip(tick.getCategory());

            final Region boundRegion = new Region();
            boundRegion.add(bounds);
            entities
                .add(new CategoryLabelEntity(
                    tick.getCategory(), boundRegion,
                    tooltip, null));
          }
View Full Code Here

   *            specify an offset y coordinate.
   * @return Calculated graphics path
   */
  public static Region calculateControlGraphicsPath(ImageData data,
      int transparentPixel, int offsetX, int offsetY) {
    Region region = new Region();
    if (data == null)
      return region;
    int colorTransparentPixel;
    // Use the top left pixel as our transparent color
    if (transparentPixel <= 0) {
      if (data.transparentPixel == -1)
        colorTransparentPixel = data.getPixel(0, 0);
      else
        colorTransparentPixel = data.transparentPixel;
    } else
      colorTransparentPixel = transparentPixel;

    // This is to store the column value where an opaque pixel is first
    // found.This value will determine where we start scanning for trailing
    // opaque pixels.
    int colOpaquePixel = 0;

    int width = data.width;
    int height = data.height;

    // Go through all rows (Y axis)
    for (int row = 0; row < height; row++) {
      // Reset value
      colOpaquePixel = 0;

      // Go through all columns (X axis)
      for (int col = 0; col < width; col++) {
        // If this is an opaque pixel, mark it and search for anymore
        // trailing behind
        if (data.getPixel(col, row) != colorTransparentPixel) {
          // Opaque pixel found, mark current position
          colOpaquePixel = col;

          // Create another variable to set the current pixel position
          int colNext = col;

          // Starting from current found opaque pixel, search for
          // anymore opaque pixels trailing behind, until a
          // transparent pixel is found or minimum width is reached
          for (colNext = colOpaquePixel; colNext < width; colNext++)
            if (data.getPixel(colNext, row) == colorTransparentPixel)
              break;

          // Form a rectangle for line of opaque pixels found and add
          // // it to our graphics path
          region.add(new int[] { offsetX + colOpaquePixel,
              offsetY + row, offsetX + colNext, offsetY + row,
              offsetX + colNext, offsetY + row + 1,
              offsetX + colOpaquePixel, offsetY + row + 1 });

          // No need to scan the line of opaque pixels just found
View Full Code Here

   *            specify an offset y coordinate.
   * @return Calculated graphics path
   */
  public static Region calculateOpaquePath(ImageData data,
      int transparentPixel, int offsetX, int offsetY) {
    Region region = new Region();
    region.add(new int[] { offsetX, offsetY, offsetX + data.width, offsetY,
        offsetX + data.width, data.height + offsetY, offsetX,
        data.height + offsetY });
    Region graphicsRegion = calculateControlGraphicsPath(data, transparentPixel,
        offsetX, offsetY);
    region.subtract(graphicsRegion);
    graphicsRegion.dispose();
    return region;
  }
View Full Code Here

    if (!UIManager.isInstall(this))
    {
      Extension.SetWindowRgn(shell.handle, 0, true);
      return;
    }
    Region region = new Region();
    Rectangle rect = shell.getClientArea();
    region.add(rect);
    if (!shell.getMaximized())
    {
      ImageData data = ((ImageSkin) Window.this.getSkin(IContainer.BORDER_NW))
          .getImage().getImageData();
      Region opaqueRegion = ImageRegion.calculateOpaquePath(data, data.transparentPixel);
      region.subtract(opaqueRegion);
      opaqueRegion.dispose();

      data = ((ImageSkin) Window.this.getSkin(IContainer.BORDER_NE)).getImage()
          .getImageData();
      opaqueRegion = ImageRegion.calculateOpaquePath(data, data.transparentPixel,
          rect.width - data.width, 0);
      region.subtract(opaqueRegion);
      opaqueRegion.dispose();
      data = ((ImageSkin) Window.this.getSkin(IContainer.BORDER_SW)).getImage()
          .getImageData();
      opaqueRegion = ImageRegion.calculateOpaquePath(data, data.transparentPixel, 0,
          rect.height - data.height);
      region.subtract(opaqueRegion);
      opaqueRegion.dispose();

      data = ((ImageSkin) Window.this.getSkin(IContainer.BORDER_SE)).getImage()
          .getImageData();
      opaqueRegion = ImageRegion.calculateOpaquePath(data, data.transparentPixel,
          rect.width - data.width, rect.height - data.height);
      region.subtract(opaqueRegion);
      opaqueRegion.dispose();
    }

    int hRegion = 0;
    hRegion = Extension.CreateRectRgn(0, 0, 0, 0);
    Extension.CombineRgn(hRegion, region.handle, hRegion, Win32.RGN_OR);
View Full Code Here

      else titleLabel.setLocation(marginLeft, titleLocY + (realTitleHeight-titleLabel.getSize().y)/2);
      if(systemControlsBar != null)
        systemControlsBar.setLocation(shellSize.x - marginRight - systemControlsBar.getSize().x, titleLocY + (realTitleHeight-systemControlsBar.getSize().y)/2);
    }
   
    final Region region = new Region();
    region.add(createOutline(shellSize, anchor, true));

    shell.setRegion(region);
    shell.addListener(SWT.Dispose, new Listener()
    {
      public void handleEvent(Event event)
      {
        region.dispose();
      }
    });

    final int[] outline = createOutline(shellSize, anchor, false);
    shell.addListener(SWT.Paint, new Listener()
View Full Code Here

      else titleLabel.setLocation(marginLeft, titleLocY + (realTitleHeight-titleLabel.getSize().y)/2);
      if(systemControlsBar != null)
        systemControlsBar.setLocation(shellSize.x - marginRight - systemControlsBar.getSize().x, titleLocY + (realTitleHeight-systemControlsBar.getSize().y)/2);
    }
   
    final Region region = new Region();
    region.add(createOutline(shellSize, anchor, true));

    shell.setRegion(region);
    shell.addListener(SWT.Dispose, new Listener()
    {
      public void handleEvent(Event event)
      {
        region.dispose();
      }
    });

    final int[] outline = createOutline(shellSize, anchor, false);
    shell.addListener(SWT.Paint, new Listener()
View Full Code Here

TOP

Related Classes of org.eclipse.swt.graphics.Region

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.