| Modifier and Type | Field and Description |
|---|---|
static int |
COMPONENT_PRINT |
static int |
DISCRETE_PRINT |
static String[] |
fonts
The available fonts (non-null once retrieved).
|
static int |
HOST_PRINT |
static boolean |
is64bit
The Java architecture is 64 bit.
|
static boolean |
isJava16
If Java is 1.6 or better.
|
static boolean |
isJava17
If Java is 1.7 or better.
|
static boolean |
isJava18
If Java is 1.8 or better.
|
static boolean |
isMac
The Mac OS variable indicator.
|
static boolean |
isUnix
The Unix OS variable indicator.
|
static boolean |
isWin7
The indicator for windows 7 or better.
|
static boolean |
isWindows
The Windows OS variable indicator.
|
static String |
javaVersion
The Java version.
|
static int |
LAF_GTK |
static int |
LAF_MAC |
static int |
LAF_METAL |
static int |
LAF_MOTIF |
static int |
LAF_NIMBUS |
static int |
LAF_WIN_STD
LAF variables.
|
static int |
LAF_WIN_XP |
static int |
LINE_ALTERNATE |
static int |
LINE_DASHDOT |
static int |
LINE_DASHDOUBLEDOT |
static int |
LINE_DOT |
static int |
LINE_DOUBLEDOT |
static int |
LINE_INVISIBLE |
static int |
LINE_LONGDASH |
static int |
LINE_SHORTDASH |
static int |
LINE_SOLID
The line types.
|
static String[] |
monospacedFonts
The mono-spaced fonts, null when not yet set.
|
static String |
osVersion
The OS version.
|
static Plaf |
plaf
The reference to the Plaf single instance.
|
static byte |
printVer3
Flag indicating native printing using NetPhantom NPCDDE.DLL as in version 3 is requested if possible,
set zero for none, 1 for included in client JAR, 2 for loading in (Windows) path.
|
static int |
REPORT_PRINT
The print defined print types.
|
static int |
SCREEN_PRINT |
static boolean |
usePrintDialog
Flag to use print dialog.
|
| Modifier and Type | Method and Description |
|---|---|
static Object |
addKeyListener(KeyListener listener)
Adds a key listener and returns it "on" state for the keys
VK_CAPS_LOCK, VK_NUM_LOCK and VK_SCROLL_LOCK.
|
static int |
bgLine(Graphics g,
int x1,
int y1,
int x2,
int y2,
int type,
int phase)
Draws a "Business Graphics" line between two points with the
current color and the same behavior as for "Java lines".
|
static void |
bgMark(Graphics g,
int x,
int y,
int type,
Color fill)
Draws a marker at the specified point.
|
static void |
bgRect(Graphics g,
int x,
int y,
int cx,
int cy,
int lineType,
Color lineColor,
int pattern,
Color foreground,
Color background)
Draws a rectangle for Business Graphics with the specified
line color and type with a fore-/background color of a specified
pattern.
|
static void |
changeUI()
Called when the UI has been changed to reinitialize text anti-aliasing.
|
static PKeyEvent |
copyKeyEvent(Component c,
KeyEvent e)
Copies one KeyEvent into another.
|
static Transferable |
createTransferable(String string,
Image image)
Creates a transferable used by clipboard and drag-drop.
|
static Font |
deriveFont(Graphics g,
Font font,
int cxFont,
int cyFont)
Derives a new font from another one by scaling it.
|
static void |
drawString(Graphics g,
String text,
int x,
int y)
Draws a string hopefully with the correct anti-aliasing using SwingUtilities2.
|
static void |
drawStringUnderlineCharAt(Graphics g,
String text,
int underlinedIndex,
int x,
int y)
Draws a string hopefully with the correct anti-aliasing using SwingUtilities2.
|
static Component |
findFocusOwner(Container c)
Finds the focus owner.
|
static String[] |
getAvailableFonts()
Get available fonts.
|
static String[] |
getAvailableMonospacedFonts()
Get available monospaced fonts.
|
static String |
getClipboardString()
Gets the text from the clipboard.
|
static Color |
getControlBGColor()
Gets the color for background of controls.
|
static Rectangle |
getDesktopBounds(Component c)
Gets the desktop width for a particular window.
|
Component |
getFocusOwner()
Gets the current focus owner.
|
static FontMetrics |
getFontMetrics(Component c,
Font f)
Gets the FontMetrics from the component in question or default toolkit if component is null.
|
static FontMetrics |
getFontMetrics(Font f)
Gets the FontMetrics from the default toolkit.
|
static String |
getKeyModifiersText(int modifiers)
Gets the modifiers String (such as Alt+Ctrl+Shift+) [note the extra '+' sign],
or the special Command button for Mac.
|
static KeyStroke |
getKeyStroke(int keyCode,
int modifiers)
Gets a KeyStroke depending on platform.
|
static KeyStroke |
getKeyStroke(KeyStroke ks)
Gets a KeyStroke depending on platform.
|
static int |
getLAF()
Get the look-and-feel
|
static boolean |
getLockingKeyState(int keyCode)
Returns whether the given locking key on the keyboard is currently
in its "on" state.
|
static int |
getModifiers(int modifiers)
Converts a KeyStroke CONTROL modifier into COMMAND modifier
on the Mac platform.
|
static Rectangle |
getNormalBounds(JInternalFrame f)
Gets the unmaximized window bounds.
|
static String |
getPrintFontName(String name)
Gets an alternate font name for printing (tries to use
e.g.
|
static PrintJob |
getPrintJob(Frame frame,
String title,
int type,
boolean useDefault)
Gets the print job.
|
static PrintJob |
getPrintJob(Frame frame,
String title,
int type,
boolean useDefault,
int landscape)
Gets the print job.
|
static Rectangle |
getScreenRect()
Gets the screen size as a rectangle.
|
static Window |
getWindowForComponent(Component c)
Finds the Window for a component.
|
static boolean |
hasFont(String font)
Checks if a font is available.
|
static void |
initializeLAF()
Initializes LAF.
|
void |
invokeAction(AbstractButton action,
boolean doInvoke)
Invokes a button action (check box, radio button, push button or
a menu item).
|
static boolean |
isContextMenu(KeyEvent e)
Checks if a key event is a pop-up window (context) menu display action,
i.e.
|
static boolean |
isContextMenu(MouseEvent e)
Checks if a mouse event is the context menu trigger.
|
static boolean |
isGTKLF()
Checks if it's GTK L&F.
|
static boolean |
isJava16()
Checks if this is Java 1.6 or better.
|
static boolean |
isMacLF()
Checks if it's a Mac look-and-feel (running on Mac).
|
static boolean |
isMaximized(Frame f)
Checks if a frame is maximized.
|
static boolean |
isMetalLF()
Checks if it's Metal L&F.
|
static boolean |
isMotifLF()
Checks if it's Motif L&F.
|
static boolean |
isNimbusLF()
Checks if it's a Nimbus look-and-feel.
|
static boolean |
isRightCtrl(KeyEvent e)
Checks if the rightmost control key in an event (typically
VK_CONTROL).
|
static boolean |
isWindows()
Checks if it's the Windows operating systems.
|
static boolean |
isWindowsLF()
Checks if it's Windows L&F (standard or XP).
|
static boolean |
isWindowsXPLF()
Checks if it's Windows L&F using XP style.
|
static void |
maximize(Frame f)
Maximizes a frame.
|
static void |
printWindow(LogEvent logger,
Component componentToPrint,
boolean useDefault)
Prints a top-level window (Frame or Dialog) or an internal frame.
|
static void |
removeKeyListener(Object listener)
Removes a key listener and returns it "on" state for the keys
VK_CAPS_LOCK, VK_NUM_LOCK and VK_SCROLL_LOCK.
|
static void |
restorePrintFocus(Component afterPrinting)
Restores focus after a Java2D printing.
|
void |
run()
Invokes the button a little later stage.
|
static boolean |
setAntiAlias(Graphics g,
boolean on)
Sets or removes anti-aliasing (only when using Java2D).
|
static boolean |
setClipboard(Image image)
Sets the clipboard with an Image.
|
static boolean |
setClipboard(String string)
Sets the clipboard with a String.
|
static boolean |
setClipboard(String string,
Image image)
Sets the clipboard with a String and an Image.
|
static void |
setControlBGColor(Component c)
Sets the color for background of controls for a component.
|
static void |
setFocus(JComponent jc)
Sets focus to a component.
|
static void |
setIconImage(Container c,
ImageIcon icon)
Sets the ImageIcon for a JFrame (or Frame), JDialog (or Dialog) or JInternalFrame.
|
static void |
setIconImages(Container c,
ArrayList<ImageIcon> icons)
Sets the ImageIcon(s) for a JFrame (or Frame), JDialog (or Dialog) or JInternalFrame.
|
static void |
setIconImages(Container c,
ImageIcon... icons)
Sets the ImageIcon(s) for a JFrame (or Frame), JDialog (or Dialog) or JInternalFrame.
|
static void |
setLockingKeyState(int keyCode,
boolean on)
Sets the state of the given locking key on the keyboard, JDK 1.3 or better.
|
void |
setMnemonic(AbstractButton b,
char ch,
int index)
Sets the mnemonic for an abstract button.
|
static boolean |
setTextAntiAlias(Graphics g,
boolean on)
Sets or removes text anti-aliasing (only when using Java2D).
|
boolean |
showDocument(Applet applet,
URL url,
String target)
Shows a document using the current browser (if it's an applet),
or tries to launch Microsoft Internet Explorer (under Windows).
|
static void |
togglePrintDialog()
Toggles the usePrintDialog flag.
|
static boolean |
usePrintDialog()
Gets the usePrintDialog flag.
|
public static byte printVer3
public static final int REPORT_PRINT
public static final int HOST_PRINT
public static final int COMPONENT_PRINT
public static final int DISCRETE_PRINT
public static final int SCREEN_PRINT
public static final int LINE_SOLID
public static final int LINE_ALTERNATE
public static final int LINE_DOT
public static final int LINE_SHORTDASH
public static final int LINE_DASHDOT
public static final int LINE_DOUBLEDOT
public static final int LINE_LONGDASH
public static final int LINE_DASHDOUBLEDOT
public static final int LINE_INVISIBLE
public static final Plaf plaf
public static boolean usePrintDialog
public static final String javaVersion
public static final String osVersion
public static final boolean isWindows
public static final boolean isMac
public static final boolean isWin7
public static final boolean isUnix
public static final boolean is64bit
public static final boolean isJava16
public static final boolean isJava17
public static final boolean isJava18
public static String[] fonts
public static String[] monospacedFonts
public static final int LAF_WIN_STD
public static final int LAF_WIN_XP
public static final int LAF_METAL
public static final int LAF_MOTIF
public static final int LAF_GTK
public static final int LAF_NIMBUS
public static final int LAF_MAC
public static final boolean isJava16()
public static KeyStroke getKeyStroke(int keyCode, int modifiers)
public static KeyStroke getKeyStroke(KeyStroke ks)
public static int getModifiers(int modifiers)
public static String getKeyModifiersText(int modifiers)
public static void togglePrintDialog()
public static boolean usePrintDialog()
public static PrintJob getPrintJob(Frame frame, String title, int type, boolean useDefault)
public static PrintJob getPrintJob(Frame frame, String title, int type, boolean useDefault, int landscape)
public static Color getControlBGColor()
public static void setControlBGColor(Component c)
public static Rectangle getScreenRect()
public static Rectangle getDesktopBounds(Component c)
public static boolean isWindows()
public static void initializeLAF()
public static final boolean isWindowsLF()
public static final boolean isWindowsXPLF()
public static final boolean isMetalLF()
public static final boolean isGTKLF()
public static final boolean isMotifLF()
public static final boolean isNimbusLF()
public static final boolean isMacLF()
public static int getLAF()
public static String[] getAvailableFonts()
public static boolean hasFont(String font)
public static String[] getAvailableMonospacedFonts()
public static FontMetrics getFontMetrics(Font f)
public static FontMetrics getFontMetrics(Component c, Font f)
public static final void printWindow(LogEvent logger, Component componentToPrint, boolean useDefault)
public static void setFocus(JComponent jc)
public static Window getWindowForComponent(Component c)
public Component getFocusOwner()
public boolean showDocument(Applet applet, URL url, String target)
If running using JDK 1.6, "Desktop.getDesktop().browse(uri)" is first
tried, and if it worked, no further processing is done.
The parameter target can be null.
public void invokeAction(AbstractButton action, boolean doInvoke)
doInvoke flag is true.public void run()
public void setMnemonic(AbstractButton b, char ch, int index)
For JDK 1.4 the index will be used, otherwise the character itself.
public static void changeUI()
public static void drawString(Graphics g, String text, int x, int y)
public static void drawStringUnderlineCharAt(Graphics g, String text, int underlinedIndex, int x, int y)
public static boolean getLockingKeyState(int keyCode)
public static void setLockingKeyState(int keyCode,
boolean on)
public static PKeyEvent copyKeyEvent(Component c, KeyEvent e)
public static Object addKeyListener(KeyListener listener)
public static void removeKeyListener(Object listener)
listener - The instance of an AWTEventListener, returned by the addKeyListener method.public static void maximize(Frame f)
public static boolean isMaximized(Frame f)
public static Rectangle getNormalBounds(JInternalFrame f)
public static boolean isRightCtrl(KeyEvent e)
public static String getPrintFontName(String name)
public static void restorePrintFocus(Component afterPrinting)
public static Font deriveFont(Graphics g, Font font, int cxFont, int cyFont)
public static boolean setAntiAlias(Graphics g, boolean on)
public static boolean setTextAntiAlias(Graphics g, boolean on)
public static int bgLine(Graphics g, int x1, int y1, int x2, int y2, int type, int phase)
When not using Java 2, the line will be dotted if horizontal or vertical if the line type is not solid (=). The width will be 1.
If the line is invisible, it won't be drawn!
Valid line types are:
SOLID = 0 ALTERNATE = 1 DOT = 2 SHORTDASH = 3 DASHDOT = 4 DOUBLEDOT = 5 LONGDASH = 6 DASHDOUBLEDOT = 7 INVISIBLE = 8
public static void bgMark(Graphics g, int x, int y, int type, Color fill)
The marker types are:
0 = CROSS 1 = PLUS 2 = DIAMOND 3 = SQUARE 4 = SIXPOINTSTAR 5 = EIGHTPOINTSTAR 6 = SOLIDDIAMOND 7 = SOLIDSQUARE 8 = SMALLCIRCLE 9 = DOT 10 = BLANKThe only marker that can be filled in the SQUARE.
public static void bgRect(Graphics g, int x, int y, int cx, int cy, int lineType, Color lineColor, int pattern, Color foreground, Color background)
The patterns are:
0 = SOLID 1 = DENSE1 2 = DENSE2 3 = DENSE3 4 = DENSE4 5 = DENSE5 6 = DENSE6 7 = DENSE7 8 = DENSE8 9 = VERT 10 = HORIZ 11 = DIAG1 12 = DIAG2 13 = DIAG3 14 = DIAG4 15 = NOSHADE (no pattern, only foreground) 16 = HALFTONE 17 = CROSS1 18 = CROSS2 19 = CROSS3The color in the Graphics can be set to any of the color parameters in this function, so don't assume
public static boolean isContextMenu(KeyEvent e)
public static boolean isContextMenu(MouseEvent e)
public static void setIconImage(Container c, ImageIcon icon)
For 1.6, multiple images are supported for [J]Frame and [J]Dialog. Only 1.5 supports it for [J]Frame and has no such method for [J]Dialog at all.
If the c parameter is a JInternalFrame, the setFrameIcon
method is used. Otherwise, the setIconImages will be attempted.
public static void setIconImages(Container c, ArrayList<ImageIcon> icons)
For 1.6, multiple images are supported for [J]Frame and [J]Dialog. Only 1.5 supports it for [J]Frame and has no such method for [J]Dialog at all.
If the c parameter is a JInternalFrame, the setFrameIcon
method is used. Otherwise, the setIconImages will be attempted.
public static void setIconImages(Container c, ImageIcon... icons)
For 1.6, multiple images are supported for [J]Frame and [J]Dialog. Only 1.5 supports it for [J]Frame and has no such method for [J]Dialog at all.
If the c parameter is a JInternalFrame, the setFrameIcon
method is used. Otherwise, the setIconImages will be attempted.
public static String getClipboardString()
public static boolean setClipboard(String string)
public static boolean setClipboard(Image image)
public static boolean setClipboard(String string, Image image)
public static Transferable createTransferable(String string, Image image)
Phantom® and NetPhantom® are registered trademarks of Nexum Technologies SARL.
© Copyright Nexum Technologies SARL, 2011. All rights reserved.