Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Path.dispose()


    graphics.setForegroundColor(getAdjustedColor(getPositionedContextButton().getOuterLineColor()));
    graphics.drawPath(pathOuterLine);

    pathOuterLine.dispose();
    pathMiddleLine.dispose();
    pathFill.dispose();
    pathOuterLine = null;
    pathMiddleLine = null;
    pathFill = null;

    // change opacity for image (never transparent)
View Full Code Here


    path.lineTo(25, height / 2);
    path.lineTo(width / 3, height / 3);
    path.lineTo(width / 2, 25);
    path.close();
    gc.drawPath(path);
    path.dispose();

    if (pattern != null)
      pattern.dispose();
  }
View Full Code Here

    gc.drawString(GraphicsExample.getResourceString("Cubic"), 0, 175, true);

    Path path = new Path(device);
    path.cubicTo(-200 + sDiffX1, 50 + sDiffY1, 200 + sDiffX2, 100 + sDiffY2, 0, 150);
    gc.drawPath(path);
    path.dispose();

    // draw the spline points
    gc.setTransform(null);
    gc.drawRectangle(sRect1.x + (int) sXPos, sRect1.y + (int) sYPos, sRect1.width, sRect1.height);
    gc.drawRectangle(sRect2.x + (int) sXPos, sRect2.y + (int) sYPos, sRect2.width, sRect2.height);
View Full Code Here

    path = new Path(device);
    path.quadTo(100 + wDiffX1, 300 + wDiffY1, 100, 0);
    path.quadTo(100 + wDiffX2, 300 + wDiffY2, 200, 0);
    gc.drawPath(path);
    path.dispose();

    gc.setTransform(null);
    gc.drawRectangle(wRect1.x + (int) wXPos, wRect1.y + (int) wYPos, wRect1.width, wRect1.height);
    gc.drawRectangle(wRect2.x + (int) wXPos, wRect2.y + (int) wYPos, wRect2.width, wRect2.height);
View Full Code Here

    gc.drawString(GraphicsExample.getResourceString("Cubic"), 25, -50, true);

    path = new Path(device);
    path.cubicTo(33 + tTopDiffX1, -20 + tTopDiffY1, 66 + tTopDiffX2, 20 + tTopDiffY2, 100, 0);
    gc.drawPath(path);
    path.dispose();

    gc.setTransform(null);
    gc.drawRectangle(tTopRect1.x + (int) topTXPos, tTopRect1.y + (int) topTYPos, tTopRect1.width, tTopRect1.height);
    gc.drawRectangle(tTopRect2.x + (int) topTXPos, tTopRect2.y + (int) topTYPos, tTopRect2.width, tTopRect2.height);
View Full Code Here

    gc.drawString(GraphicsExample.getResourceString("Cubic"), 0, 175, true);

    path = new Path(device);
    path.cubicTo(-33 + tBotDiffX1, 50 + tBotDiffY1, 33 + tBotDiffX2, 100 + tBotDiffY2, 0, 150);
    gc.drawPath(path);
    path.dispose();

    gc.setTransform(null);
    gc.drawRectangle(tBottomRect1.x + (int) botTXPos, tBottomRect1.y + (int) botTYPos, tBottomRect1.width,
        tBottomRect1.height);
    gc.drawRectangle(tBottomRect2.x + (int) botTXPos, tBottomRect2.y + (int) botTYPos, tBottomRect2.width,
View Full Code Here

      path.addArc(11.5f * (width - width / 18) / 20, 5 * (height - height / 18) / 18, width / 18, height / 18, 0,
          360);
      path.addArc(8.5f * (width - width / 18) / 20, 13 * (height - height / 18) / 18, width / 18, height / 18, 0,
          360);
      gc.setClipping(path);
      path.dispose();
      break;
    case 1: // rectangle
      path = new Path(device);
      path.addRectangle(100, 100, width - 200, height - 200);
      path.addRectangle(120, 120, width - 240, height - 240);
View Full Code Here

      path = new Path(device);
      path.addRectangle(100, 100, width - 200, height - 200);
      path.addRectangle(120, 120, width - 240, height - 240);
      path.addRectangle(140, 140, width - 280, height - 280);
      gc.setClipping(path);
      path.dispose();
      break;
    case 2: // circle
      path = new Path(device);
      path.addArc(100, 100, width - 200, height - 200, 0, 360);
      path.addArc((width - width / 5) / 2, (height - height / 5) / 2, width / 5, height / 5, 0, 360);
View Full Code Here

      path.addArc(11.5f * (width - width / 18) / 20, 5 * (height - height / 18) / 18, width / 18, height / 18, 0,
          360);
      path.addArc(8.5f * (width - width / 18) / 20, 13 * (height - height / 18) / 18, width / 18, height / 18, 0,
          360);
      gc.setClipping(path);
      path.dispose();
      break;
    case 3: // word
      path = new Path(device);
      String text = GraphicsExample.getResourceString("SWT"); //$NON-NLS-1$
      Font font = new Font(device, "Times", 200, SWT.NORMAL);
View Full Code Here

      gc.setFont(font);
      Point size = gc.stringExtent(text);
      path.addString(text, (width - size.x) / 2, (height - size.y) / 2, font);
      font.dispose();
      gc.setClipping(path);
      path.dispose();
      break;
    case 4: // star
      path = new Path(device);
      path.lineTo(width / 2, 0);
      path.lineTo(5 * width / 8, height / 3);
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.