|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.faceless.pdf2.viewer2.Util
public final class Util
A utility class that handles localized Strings, display of error messages and so on. Developers extending the viewer are welcome to use this class
This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.
Field Summary | |
---|---|
static BFOLogger |
LOGGER
|
Method Summary | |
---|---|
static void |
displayThrowable(Throwable throwable,
Component parent)
Display an Error message, including the stack trace |
static String |
encodeColor(Color c)
Return the standard #RRGGBB representation of a Color |
static void |
fixScrollPaneKeyBindings(JScrollPane scrollpane)
Remove the pageup/pagedown key bindings from ScrollPanes - they're clashing with the pageup/pagedown we're mapping on the DocumentPanel |
static int |
getScreenResolution(Component comp)
Get the screen resolution. |
static String |
getUIString(String key,
String field1)
Return a UIManager string field with the specified fields replaced |
static String |
getUIString(String key,
String field1,
String field2)
Return a UIManager string field with the specified fields replaced |
static boolean |
hasFilePermission()
Return true if the viewer can access the local filesystem |
static boolean |
isBrowserApplet(Component c)
Return true if the viewer is running as an Applet inside a web browser, false otherwise |
static boolean |
isJNLP(Component c)
Return true if the specified component is running in a JNLP environment, false otherwise |
static boolean |
isLAFAqua()
Return true if the LAF uses the Aqua toolkit (OS X) |
static boolean |
isLAFGTK()
Return true if the LAF uses the GTK+ toolkit (UNIX) |
static boolean |
isLAFMetal()
Return true if the LAF uses the Metal toolkit |
static boolean |
isLAFNimbus()
Return true if the LAF uses the Nimbus toolkit |
static boolean |
isLAFWindows()
Return true if the LAF uses the Window toolkit |
static boolean |
isStandaloneApplet(Component c)
Return true if the viewer is running as an Applet that has been dragged outside of the web browser, false otherwise. |
static boolean |
openURL(URL url,
Component c)
Display a URL in a web browser, if possible |
static URL |
toURL(DocumentPanel docpanel,
String path)
Attempt to convert a relative URL to an absolute one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final BFOLogger LOGGER
Method Detail |
---|
public static void displayThrowable(Throwable throwable, Component parent)
throwable
- the Throwable object this error relates toparent
- the parent component (not used)public static boolean isLAFAqua()
public static boolean isLAFGTK()
public static boolean isLAFNimbus()
public static boolean isLAFWindows()
public static boolean isLAFMetal()
public static boolean isBrowserApplet(Component c)
c
- the Componentpublic static boolean isStandaloneApplet(Component c)
c
- the Componentpublic static boolean isJNLP(Component c)
c
- the Componentpublic static boolean openURL(URL url, Component c)
url
- the URL to openc
- the Component
public static String getUIString(String key, String field1)
key
- the message key,field1
- the field to be substituted for {1}
public static String getUIString(String key, String field1, String field2)
key
- the message key,field1
- the field to be substituted for {1}field2
- the field to be substituted for {2}
public static void fixScrollPaneKeyBindings(JScrollPane scrollpane)
public static URL toURL(DocumentPanel docpanel, String path)
public static boolean hasFilePermission()
public static String encodeColor(Color c)
public static int getScreenResolution(Component comp)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |