Package org.eclipse.swt.graphics

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


    gc.setForeground(device.getSystemColor(foreGrdColor));
    gc.setBackground(device.getSystemColor(fillColor));

    gc.fillPath(path);
    gc.drawPath(path);
    font.dispose();
    path.dispose();
  }
}
View Full Code Here


    size = gc.stringExtent(text);
    gc.drawString(text, (width - size.x) / 2, 7 * height / 12, true);
    text = GraphicsExample.getResourceString("DashDotDot"); //$NON-NLS-1$
    size = gc.stringExtent(text);
    gc.drawString(text, (width - size.x) / 2, 9 * height / 12, true);
    font.dispose();
  }
}
View Full Code Here

      String text = GraphicsExample.getResourceString("SWT");
      Point point = gc.stringExtent(text);
      int textWidth = point.x;
      int textHeight = point.y;
      gc.drawString(text, (width - textWidth) / 2, (height - textHeight) / 2, true);
      font.dispose();

    } else {

      Font font = new Font(device, CountDownTab.getPlatformFontFace(0), 6 * diameter / 10, SWT.NONE);
      gc.setFont(font);
View Full Code Here

      gc.setTransform(transform);
      gc.setForeground(device.getSystemColor(SWT.COLOR_RED));
      gc.drawLine(0, 0, diameter / 2, 0);
      transform.dispose();

      font.dispose();
    }
  }
}
View Full Code Here

    gc.setForeground(device.getSystemColor(SWT.COLOR_GRAY));
    gc.drawRectangle(quadHndl.x + (int) quadXPos, quadHndl.y + (int) quadYPos, quadHndl.width, quadHndl.height);
    gc.drawRectangle(quadEndHndl.x + (int) quadXPos, quadEndHndl.y + (int) quadYPos, quadEndHndl.width,
        quadEndHndl.height);

    font.dispose();
  }

  /**
   * This helper method determines whether or not the cursor is positioned over a handle.
   *
 
View Full Code Here

    // high interpolation
    gc.setInterpolation(SWT.HIGH);
    gc.drawImage(image, 3 * bounds.width, 0);

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

    shell.open();
    shell.addListener(SWT.Dispose, new Listener() {
      public void handleEvent(Event event) {
        if (image != null)
          image.dispose();
        font.dispose();
      }
    });
    return shell;
  }
}
View Full Code Here

      oldFont = itemFont;
      itemFont = new Font(display, fontData);
      setItemFont();
      setExampleWidgetSize();
      if (oldFont != null)
        oldFont.dispose();
    }
      break;
    case CELL_FOREGROUND_COLOR: {
      Color oldColor = cellForegroundColor;
      if (oldColor == null)
View Full Code Here

      oldFont = cellFont;
      cellFont = new Font(display, fontData);
      setCellFont();
      setExampleWidgetSize();
      if (oldFont != null)
        oldFont.dispose();
    }
      break;
    default:
      super.changeFontOrColor(index);
    }
View Full Code Here

      oldColor.dispose();
    Font oldFont = font;
    itemFont = null;
    setItemFont();
    if (oldFont != null)
      oldFont.dispose();
    oldColor = cellForegroundColor;
    cellForegroundColor = null;
    setCellForeground();
    if (oldColor != null)
      oldColor.dispose();
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.