Package org.eclipse.swt.graphics

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


        control.setFont(newFont);

        // Since you created the font, you must dispose it
        control.addDisposeListener(new DisposeListener() {
            public void widgetDisposed(DisposeEvent e) {
                newFont.dispose();
            }
        });
    }

    public static void makeBold(Control control) {
View Full Code Here


        control.setFont(newFont);

        // Since you created the font, you must dispose it
        control.addDisposeListener(new DisposeListener() {
            public void widgetDisposed(DisposeEvent e) {
                newFont.dispose();
            }
        });
    }

    public static FontData[] modifyFontData(FontData[] fontData, int style) {
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

                FontDialog dialog = new FontDialog(IComponentTestPanel.this.getShell());
                FontData fdata = dialog.open();
                if (fdata != null) {
                    Font font = new Font(Display.getCurrent(), fdata);
                    theComponent.setCometeFont(FontTool.getCometeFont(font));
                    font.dispose();
                    fontList.deselectAll();
                }
            }
        });
View Full Code Here

            }
          }

          e.gc.setForeground(foreground);
          e.gc.drawText(shell.getText(), 0, (areaHeight - fontHeight) / 2, true);
          tFont.dispose();

          break;
        case SWT.MouseDoubleClick:
          if (getEnabled(ThemeConstants.BUTTON_MAX)
              || getEnabled(ThemeConstants.BUTTON_REV))
View Full Code Here

        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

        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

      gc.drawLine(x+8,y+3, x+5,y+5);
      gc.drawString(chevronString, x+8, y+4, true);
      break;
    }
    }
    f.dispose();
  }
  void drawMaximize(GC gc) {
    int px = maxRect.x +5;
    int py = 8;
    int [] polyline1, polyline2;
View Full Code Here

        separatorLabel.setBackground(colorBg1);
        separatorLabel.setText(">");
      }
      colorBg1.dispose();
      colorFg1.dispose();
      font.dispose();
    }
    location.layout();
  }

  private void createMainPanel() {
View Full Code Here

        colorBg1.dispose();
        colorBg2.dispose();
        colorBg3.dispose();
        colorFg1.dispose();
        colorFg2.dispose();
        font.dispose();
        gc.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.