Package org.eclipse.swt.graphics

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


      oldColor.dispose();
    oldFont = font;
    cellFont = null;
    setCellFont();
    if (oldFont != null)
      oldFont.dispose();
  }

  /**
   * Sets the background color of the Row 0 TableItem in column 1.
   */
 
View Full Code Here


      randX = randX > textWidth ? randX - textWidth : randX;
      randY = randY > textHeight ? randY - textHeight : randY;
    }

    gc.drawString(text, randX, randY, true);
    font.dispose();

    // gray donut
    gc.setAlpha(100);
    Path path = new Path(device);
    path.addArc((width - diameter) / 2, (height - diameter) / 2, diameter, diameter, 0, 360);
View Full Code Here

        FontMetrics fontMetrics = e.gc.getFontMetrics();
        int stringWidth = fontMetrics.getAverageCharWidth() * string.length();
        int stringHeight = fontMetrics.getHeight();
       
        e.gc.drawString(string, (point.x-stringWidth)/2 , (point.y-stringHeight)/2, true);
        font.dispose();
      }
    });
 
    button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    progressBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
View Full Code Here

                } catch (Exception e) {
                    Log.log(e);
                } finally {
                    colorBackground.dispose();
                    colorForeground.dispose();
                    font.dispose();
                    gc.dispose();
                }

            }
            return image;
View Full Code Here

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {}
      });
      next.setFont(newFont);
      newFont.dispose();
      group.layout();
      update();
    }

    /**
 
View Full Code Here

      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
    image.dispose();
    font.dispose();
    display.dispose();
  }
}
View Full Code Here

            gc.drawString(featureValue, newX, bounds.y + bounds.height - 1, true);
            gc.setFont(currentFont);
           
            // After done using the tag font it must be disposed, otherwise
            // eclipse on windows runs out of handles and crashes
            tagFont.dispose();
          } else {
           
            // The area into which the tag will be drawn must be marked
            // to be redrawn, that requires a calculation of that area.
           
View Full Code Here

         
          Font font = new Font(fTextWidget.getDisplay(),data);
          gc.setFont(font);
          gc.drawText(fTextWidget.getText(offset,offset),left.x,left.y+1);
          gc.setFont(oldFont);
          font.dispose();
          break;
        }
      }
     
     
View Full Code Here

        {
            @Override
            public void widgetDisposed(DisposeEvent e)
            {
                boldFont.dispose();
                bigFont.dispose();
            }
        });

        // first column: logo
        Label image = new Label(container, SWT.NONE);
View Full Code Here

            tmpGC.setFont(tmpFont);
            if (tmpGC.textExtent(Az).x
                    > DUMMY_PANEL.getFontMetrics(font).stringWidth(Az)) {
                while (tmpGC.textExtent(Az).x
                        > DUMMY_PANEL.getFontMetrics(font).stringWidth(Az)) {
                    tmpFont.dispose();
                    height--;
                    fontData.setHeight(height);
                    tmpFont = new Font(device, fontData);
                    tmpGC.setFont(tmpFont);
                }
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.