Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Region


   * it wasn't already hidden.
   * </p>
   */
  public void hideRubberband() {
    if (rubberbandHiddenNestingCount++ <= 0) {
      Region region = new Region();
      rubberband.addDamagedRegion(displayFDC, region);
      Rectangle r = region.getBounds();
      paintCanvas.redraw(r.x, r.y, r.width, r.height, true);
      region.dispose();
    }
  }
View Full Code Here


      columnCount = ((Tree) scrollable).getColumnCount();

    if (event.index == columnCount - 1 || columnCount == 0) {
      int width = area.x + area.width - event.x;
      if (width > 0) {
        Region region = new Region();
        gc.getClipping(region);
        region.add(event.x, event.y, width, event.height);
        gc.setClipping(region);
        region.dispose();
      }
    }
  }
View Full Code Here

    fFadeJob = new FadeJob();
    fFadeJob.schedule();
  }

  private void addRegion(Shell shell) {
    Region region = new Region();
    Point s = shell.getSize();

    /* Add entire Shell */
    region.add(0, 0, s.x, s.y);

    /* Subtract Top-Left Corner */
    region.subtract(0, 0, 5, 1);
    region.subtract(0, 1, 3, 1);
    region.subtract(0, 2, 2, 1);
    region.subtract(0, 3, 1, 1);
    region.subtract(0, 4, 1, 1);

    /* Subtract Top-Right Corner */
    region.subtract(s.x - 5, 0, 5, 1);
    region.subtract(s.x - 3, 1, 3, 1);
    region.subtract(s.x - 2, 2, 2, 1);
    region.subtract(s.x - 1, 3, 1, 1);
    region.subtract(s.x - 1, 4, 1, 1);

    /* Subtract Bottom-Left Corner */
    region.subtract(0, s.y, 5, 1);
    region.subtract(0, s.y - 1, 3, 1);
    region.subtract(0, s.y - 2, 2, 1);
    region.subtract(0, s.y - 3, 1, 1);
    region.subtract(0, s.y - 4, 1, 1);

    /* Subtract Bottom-Right Corner */
    region.subtract(s.x - 5, 0, 5, 1);
    region.subtract(s.x - 3, 1, 3, 1);
    region.subtract(s.x - 2, 2, 2, 1);
    region.subtract(s.x - 1, 3, 1, 1);
    region.subtract(s.x - 1, 4, 1, 1);

    /* Dispose old first */
    if (shell.getRegion() != null)
      shell.getRegion().dispose();

View Full Code Here

           */
          int columnCount = getColumnCount();
          if ( event.index == columnCount - 1 || columnCount == 0 ) {
            int width = area.x + area.width - event.x;
            if ( width > 0 ) {
              Region region = new Region();
              gc.getClipping( region );
              region.add( event.x, event.y, width, event.height );
              gc.setClipping( region );
              region.dispose();
            }
          }
          gc.setAdvanced( true );
          if ( gc.getAdvanced() )
            gc.setAlpha( 127 );
View Full Code Here

  {
    int numRegions = hotspots.size();
    for ( int i = 0; i < numRegions; i++ ) {
      Vector v = (Vector)hotspots.elementAt( i );
      int numPolygons = v.size();
      Region r = new Region();
      for ( int j = 0; j < numPolygons; j++ ) {
        int[] poly = (int[])v.elementAt( j );
        r.add( poly );
      }
      if ( r.contains( e.x, e.y ) ) {
        if ( i != currentHotspotIdx ) {
          currentHotspotIdx = i;
          setCursor( handCursor );
          setToolTipText( (String)tooltips.get( i ) );
          redraw();
View Full Code Here

    /*
     * Compute a new shape for the hover shell.
     */
    void setNewShape() {
      Region oldRegion = region;
      region = new Region();
      region.add(getPolygon(false));
      hoverShell.setRegion(region);
      if (oldRegion != null) {
        oldRegion.dispose();
      }

    }
View Full Code Here

    /*
     * Compute a new shape for the hover shell.
     */
    void setNewShape() {
      Region oldRegion = region;
      region = new Region();
      region.add(getPolygon(false));
      hoverShell.setRegion(region);
      if (oldRegion != null) {
        oldRegion.dispose();
      }

    }
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

      final int port = (Integer)args[0];
      Rectangle[] rectangles = (Rectangle[])args[1];
      final String hostAddress = (String)args[2];
      final Control control = getControl();
      ImageData imageData;
      final Region region = new Region();
      for(Rectangle rectangle: rectangles) {
        region.add(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
      }
      if(!NativeInterface.isUIThread(true)) {
        final AtomicReference<Exception> exception = new AtomicReference<Exception>();
        final AtomicReference<ImageData> result = new AtomicReference<ImageData>();
        if(control == null || control.isDisposed()) {
          new Socket(hostAddress, port).close();
          return null;
        }
        final AtomicReference<Boolean> isSocketClosed = new AtomicReference<Boolean>(false);
        control.getDisplay().syncExec(new Runnable() {
          public void run() {
            if(control.isDisposed()) {
              try {
                new Socket(hostAddress, port).close();
                isSocketClosed.set(true);
              } catch(Exception e) {
              }
              return;
            }
            try {
              result.set(getImageData(control, region));
            } catch (Exception e) {
              exception.set(e);
            }
          }
        });
        if(!isSocketClosed.get() && control.isDisposed()) {
          new Socket(hostAddress, port).close();
          return null;
        }
        if(exception.get() != null) {
          new Socket(hostAddress, port).close();
          throw exception.get();
        }
        imageData = result.get();
      } else {
        imageData = getImageData(control, region);
      }
      region.dispose();
      if(imageData == null) {
        new Socket(hostAddress, port).close();
        return null;
      }
      sendImageData(hostAddress, port, imageData, rectangles);
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.