|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfr.esrf.tangoatk.widget.util.ATKGraphicsUtils
public class ATKGraphicsUtils
A class containing various low level graphics utils.
| Constructor Summary | |
|---|---|
ATKGraphicsUtils()
|
|
| Method Summary | |
|---|---|
static void |
centerDialog(java.awt.Dialog dlg)
Center the given dialog according to its parent and its preferredSize. |
static void |
centerDialog(java.awt.Dialog dlg,
int dlgWidth,
int dlgHeight)
Center the given dialog according to its parent. |
static void |
centerFrame(javax.swing.JComponent parent,
java.awt.Frame fr)
Center the given frame according to the given componenent. |
static void |
centerFrameOnScreen(java.awt.Frame fr)
Center the given frame on screen. |
static java.awt.font.FontRenderContext |
getDefaultRenderContext()
Retreive the default render context. |
static java.awt.font.LineMetrics |
getLineMetrics(java.lang.String s,
java.awt.Font f)
Returns the line metrics for the given font. |
static java.awt.Window |
getWindowForComponent(java.awt.Component aComponent)
Return the parent Window of the given component. |
static java.awt.Dimension |
measureString(java.lang.String s,
java.awt.Font f)
Measure a string (using AA font , zoom and translation of Graphics2D are not supported) |
static void |
printComponent(javax.swing.JComponent comp,
java.lang.String title,
boolean fitToPage,
int printerResolution)
Displays the print dialog and sends a component snapshot to the printer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ATKGraphicsUtils()
| Method Detail |
|---|
public static java.awt.Dimension measureString(java.lang.String s,
java.awt.Font f)
s - String to be measuredf - Font used
public static java.awt.font.FontRenderContext getDefaultRenderContext()
public static java.awt.font.LineMetrics getLineMetrics(java.lang.String s,
java.awt.Font f)
s - String to be measuredf - Font object
public static void centerDialog(java.awt.Dialog dlg,
int dlgWidth,
int dlgHeight)
Note: This function has been designed to work with 'heavyWeight' system dependant awt window which doesn't use a layout manager (null layout).
dlg - the dialog.dlgWidth - desired width of the JDialog content pane.dlgHeight - desired height of the JDialog content pane.public static void centerDialog(java.awt.Dialog dlg)
dlg - the dialog.public static void centerFrameOnScreen(java.awt.Frame fr)
fr - Frame to be centered.
public static void centerFrame(javax.swing.JComponent parent,
java.awt.Frame fr)
parent - Parent componentfr - Frame to be centered.public static java.awt.Window getWindowForComponent(java.awt.Component aComponent)
aComponent - Child componenent
public static void printComponent(javax.swing.JComponent comp,
java.lang.String title,
boolean fitToPage,
int printerResolution)
comp - Component to be printed out.title - Title of the print dialog.fitToPage - True to fit the component to the page (printerResolution ignored).printerResolution - Printer resolution when fitToPage is not enabled.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||