Package org.eclipse.swt.graphics

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


        }
        final Font newFont = new Font(getSite().getShell().getDisplay(), fontData);
        _toolbarLblProject.setFont(newFont);
        _toolbarLblProject.addDisposeListener(new DisposeListener() {
            public void widgetDisposed(DisposeEvent e) {
                newFont.dispose();
            }
        });
       
        _toolbarLblLocation = new Label(leftComp, SWT.NONE);
       
View Full Code Here


    });

    lstLanguage.addDisposeListener(new DisposeListener() {
      public void widgetDisposed(DisposeEvent e) {
        if (font != null && !font.isDisposed())
          font.dispose();
      }
    });
  }

  /**
 
View Full Code Here

          fds[i].setStyle(fds[i].getStyle() | SWT.BOLD);
        }
        final Font font = new Font(shell.getDisplay(), fds);
        titleLabel.addListener(SWT.Dispose, new Listener() {
          public void handleEvent(Event event) {
            font.dispose();
          }
        });
        titleLabel.setFont(font);
        selectionControls.add(titleLabel);
      }
View Full Code Here

                    tr.rotate(90.0f);
                    g.setTransform(tr);
                    tr.dispose();
                    p.dispose();
                }
                f.dispose();
            }
        }
        g.setForeground(disp.getSystemColor(SWT.COLOR_WHITE));
        if (title != null) {
            g.drawString(title, 2, 20);
View Full Code Here

                    tr.rotate(90.0f);
                    g.setTransform(tr);
                    tr.dispose();
                    p.dispose();
                }
                f.dispose();
            }
        }
        g.setForeground(disp.getSystemColor(SWT.COLOR_WHITE));
        if (title != null) {
            g.drawString(title, 2, 20);
View Full Code Here

            FontData[] fontData = basefont.getFontData();
           
            each.render(gc, fontData);
        }
       
        basefont.dispose();
    }


}
View Full Code Here

    FontData fd = new FontData(fontName, fontSize, FontStyle.toStyleMask(styles));
    Font f = new Font(device, fd);
    setGC();
    gc.setFont(f);
    double result = gc.getFontMetrics().getAscent();
    f.dispose();
    return result;
  }

  public static double textDescent(String fontName, int fontSize,
      FontStyle... styles) {
View Full Code Here

    FontData fd = new FontData(fontName, fontSize, FontStyle.toStyleMask(styles));
    Font f = new Font(device, fd);
    setGC();
    gc.setFont(f);
    double result = gc.getFontMetrics().getDescent();
    f.dispose();
    return result;
  }

  public static double textWidth(String s, String fontName, int fontSize,
      FontStyle... styles) {
View Full Code Here

    FontData fd = new FontData(fontName, fontSize, FontStyle.toStyleMask(styles));
    Font f = new Font(device, fd);
    setGC();
    gc.setFont(f);
    double result = gc.textExtent(s).x;
    f.dispose();
    return result;
  }

  public static Color getRgbColor(int c) {
    setGC();
View Full Code Here

      given(p2.getFont(any())).willReturn(font);

      CompositeCellLabelProvider provider = create(p1, p2);
      assertThat(provider.getFont(""), equalTo(font));
    } finally {
      font.dispose();
    }
  }

  @Test
  public void getForegroundShouldReturnTheForegroundFromTheInternalLabelProvider() {
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.