Package org.eclipse.swt.graphics

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


            for (FontData fd: fontData) fd.setHeight(height);
            Font font = new Font(gc.getDevice(), fontData);
            gc.setFont(font);
            Point extent = gc.stringExtent(text);
            labels.add(new Label(each.px, each.py, extent, height, text, each));
            font.dispose();
        }
        basefont.dispose();
        return labels;
    }
View Full Code Here


            fd.setStyle(fontStyle);
        }
        Font font = new Font(gc.getDevice(), fontData);
        gc.setFont(font);
        CodemapCore.colorScheme().renderLabel(gc, text, bounds);
        font.dispose();
    }

    public void setHasFocus(boolean b) {
        hasFocus = b;
    }
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

    protected void bringDown() {
        Font disposeFont = this.scaledFont;
        this.scaledFont = null;
        super.bringDown();
        if (disposeFont != null) {
            disposeFont.dispose();
        }
    }
   
    protected void unhookListeners() {
        super.unhookListeners();
View Full Code Here

      final Font font = new Font(text.getDisplay(),
          "Lucida Grande", 13, SWT.NORMAL); //$NON-NLS-1$
      text.setFont(font);
      text.addDisposeListener(new DisposeListener() {
        public void widgetDisposed(DisposeEvent e) {
          font.dispose();
        }
      });
    }

    // Add the key listener.
View Full Code Here

        fontData[0].setHeight(designLabelHeight);
        fontData[0].setStyle(SWT.BOLD);
        final Font newFont = new Font(designLabel.getDisplay(), fontData[0]);
        designLabel.addDisposeListener(new DisposeListener() {
            public void widgetDisposed(DisposeEvent event) {
                newFont.dispose();
            }
        });

        designLabel.setFont(newFont);
        designLabel.setBackground(getDisplay().
View Full Code Here

        fontData[0].setHeight(designLabelHeight);
        fontData[0].setStyle(SWT.BOLD);
        final Font newFont = new Font(heading.getDisplay(), fontData[0]);
        heading.addDisposeListener(new DisposeListener() {
            public void widgetDisposed(DisposeEvent event) {
                newFont.dispose();
            }
        });
        heading.setFont(newFont);
        data = new GridData(GridData.FILL_HORIZONTAL);
        data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
View Full Code Here

        fontData[0].setHeight(designLabelHeight);
        fontData[0].setStyle(SWT.BOLD);
        final Font newFont = new Font(designLabel.getDisplay(), fontData[0]);
        designLabel.addDisposeListener(new DisposeListener() {
            public void widgetDisposed(DisposeEvent event) {
                newFont.dispose();
            }
        });

        designLabel.setFont(newFont);
        designLabel.setBackground(parent.getDisplay().
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

      GC gc = new GC(shell);
      gc.setFont(font);
      m_fontMetrics = gc.getFontMetrics();
      gc.dispose();
      shell.dispose();
      font.dispose();
    }
    return m_fontMetrics;
  }
}
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.