package net.sourceforge.phpdt.internal.ui.util;
+import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.jface.dialogs.Dialog;
-
public class PixelConverter {
-
+
private FontMetrics fFontMetrics;
-
+
public PixelConverter(Control control) {
GC gc = new GC(control);
gc.setFont(control.getFont());
- fFontMetrics= gc.getFontMetrics();
+ fFontMetrics = gc.getFontMetrics();
gc.dispose();
}
-
- private FontMetrics fgFontMetrics;
-
+
+ //private FontMetrics fgFontMetrics;
+
/**
* @see org.eclipse.jface.dialogs.DialogPage#convertHeightInCharsToPixels(int)
*/
public int convertVerticalDLUsToPixels(int dlus) {
return Dialog.convertVerticalDLUsToPixels(fFontMetrics, dlus);
}
-
+
/**
* @see org.eclipse.jface.dialogs.DialogPage#convertWidthInCharsToPixels(int)
*/
public int convertWidthInCharsToPixels(int chars) {
return Dialog.convertWidthInCharsToPixels(fFontMetrics, chars);
- }
+ }
}