Java Doc for AWT.java in  » Testing » abbot-1.0.1 » abbot » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » abbot 1.0.1 » abbot.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   abbot.util.AWT

AWT
public class AWT (Code)
Various AWT utilities to facilitate component-oriented operations.

Inner Class :public static interface ComponentPredicate

Field Summary
final public static  StringCONTAINS_HEAVYWEIGHT_COMPONENT
     Set this client property on components which contain a heavyweight component.
final public static  PointDEFAULT_CASCADE
     Offset from the position of the currently active window to the position of a new window.
public static  intPOPUP_TIMEOUT
    
final static  StringROOT_FRAME_CLASSNAME
    


Method Summary
public static  Coloralpha(Color c, int alpha)
     Return a copy of the given color with a new alpha component.
public static  voidcascade(Window w)
     Cascade the given window based on the currently active Frame .
public static  voidcascade(Window w, int xoff, int yoff)
     Cascade the given window based on the currently active Frame .
public static  voidcenterOnFrame(Window window, Frame frame)
     Center on the specified frame.
public static  voidcenterOnScreen(Window window)
     Center the given Window on the default screen.
public static  Colorcombine(Color c1, Color c2)
     Combine the two colors with equal weight.
public static  Colorcombine(Color c1, Color c2, float weight)
     Combine the two colors, giving the requested weight to the first.
public static  booleancontainsFocus(Component c)
     Return whether the given component either has focus or is the ancestor of the focused component.
public static  voiddismissAWTPopup()
     Ensure any extant AWT popup is dismissed.
public static  voidensureOnScreen(Window w)
     Ensure the given window is visible on screen.
public static  booleaneventTypeEnabled(Component c, int id)
     WARNING: This uses 1.3/1.4 implementation details.
public static  Componentfind(Component root, Class type)
     Find the first instance of the given class under the given component, or null if none found.
public static  Componentfind(Component root, ComponentPredicate test)
     Find the first component matching the given predicate, or null if none found.
public static  MenuItem[]findAWTMenuItems(Frame frame, String path)
     Returns all MenuItems matching the given label or path which are found in the given Frame's MenuBar.
public static  MenuItem[]findAWTPopupMenuItems(Component parent, String path)
     Returns all MenuItems matching the given label or path which are on PopupMenus on the given Component.
public static  JPopupMenufindActivePopupMenu()
     Find the currently active Swing popup menu, if any, waiting up to POPUP_TIMEOUT ms.
public static  AppletfindAppletDescendent(Container c)
     Returns the Applet descendent of the given Container, if any.
public static  RootPaneContainerfindRootPaneContainer(Container c)
     Find the first instance of RootPaneContainer in the given container.
public static  JPopupMenugetActivePopupMenu()
     Returns the currently active popup menu, if any.
public static  WindowgetActiveWindow()
     NOTE: NOT necessarily the same thing as the focused window.
public static  AppContextgetAppContext(Component c)
     For debugging purposes only.
public static  ComponentgetFocusOwner()
     Return the focus owner under the given Window.
public static  WindowgetFocusedWindow()
     NOTE: on pointer-focused systems, the frontmost window is not necessarily the one with focus.
public static  FramegetFrame(Object o)
     Return the Frame corresponding to the given object.
public static  GraphicsConfigurationgetGraphicsConfiguration(Point p)
     Returns the GraphicsConfiguration which contains the given point, or null if none.
public static  InsetsgetInsets(Container c)
    
public static  ComponentgetInvoker(MenuComponent mc)
     Returns the invoker, if any, of the given AWT menu component.
public static  ComponentgetInvoker(Component comp)
     Returns the invoker, if any, of the given component.
public static  StringgetKeyCode(int keycode)
    
public static  intgetKeyCode(String code)
    
public static  StringgetKeyModifiers(int flags)
    
public static  PointgetLocationOnScreen(Component c)
     Safe version of Component.getLocationOnScreen , which avoids lockup if an AWT popup menu is showing.
public static  intgetModifiers(String mods)
     Convert the string representation into the actual modifier mask.
public static  StringgetModifiers(InputEvent event)
     Convert the integer modifier flags into a string representation.
public static  StringgetMouseModifiers(int flags)
    
public static  StringgetPath(MenuItem item)
     Returns a unique path to the given MenuItem.
public static  intgetPopupMask()
     Returns the InputEvent mask for the popup trigger button.
public static  PopupMenu[]getPopupMenus(Component c)
     Return all AWT popup menus associated with the given component.
public static  booleangetPopupOnPress()
     Returns whether the platform registers a popup on mouse press.
public static  intgetTertiaryMask()
     Returns the InputEvent mask for the tertiary button.
public static  RectanglegetVirtualDisplayBounds(boolean includeInsets)
     Returns a Rectangle spanning all screens.
public static  RectanglegetVisibleBounds(GraphicsConfiguration gc)
     Return the visible bounds for the graphics configuration.
public static  WindowgetWindow(Object o)
     Return the window corresponding to the given object.
public static  WindowgetWindow(Component comp)
     Similar to SwingUtilities.getWindowAncestor(), but returns the component itself if it is a Window, or the invoker's window if on a popup.
public static  booleanhasDefaultName(Component c)
     Return whether the given Component has only its default name set.
public static  booleanhierarchyHasHeavyweightComponent(Component base)
     whether the hierarchy within which the given Component sitscontains a heavyweight component.
public static  voidinvokeAction(Runnable action)
     Ensure the given action happens on the event dispatch thread.
public static  voidinvokeAndWait(Runnable action)
     Ensure the given action happens on the event dispatch thread.
public static  booleanisAWTPopupMenuBlocking()
     Returns whether there is an AWT popup menu currently showing.
public static  booleanisAWTTreeLockHeld(EventQueue eq)
     Returns whether the AWT Tree Lock is currently held.
public static  booleanisAppletViewerFrame(Component c)
    
public static  booleanisContentPane(Component c)
     Returns whether the given Component is the content pane for a RootPaneContainer .
public static  booleanisGlassPane(Component c)
     Returns whether the given Component is the Glass Pane for a JRootPane .
public static  booleanisHeavyweightPopup(Component c)
     Returns whether the given component is a heavyweight popup, that is, a container for a JPopupMenu that is implemented with a heavyweight component (usually a Window).
public static  booleanisInternalFrameDecoration(Component c)
     Return whether the given component is part of an internal frame's LAF decoration.
public static  booleanisLightweightPopup(Component c)
     Returns whether the given component is a lightweight popup, that is, a container for a JPopupMenu that is implemented with a lightweight component (usually JPanel).
public static  booleanisMenuActive(Component c)
     Returns true if there is an active menu on the JFrame (if any) containing the given component.
public static  booleanisModifier(int keycode)
    
public static  booleanisOnMenuBar(MenuComponent mc)
     Returns whether the menu component is on a MenuBar.
public static  booleanisOnPopup(MenuComponent mc)
     Returns whether the given MenuComponent is on a top-level AWT popup (that is, not under a MenuBar.
public static  booleanisOnPopup(Component comp)
     Returns whether the given component is on a top-level popup.
public static  booleanisSharedInvisibleFrame(Component c)
    
public static  booleanisTertiaryButton(int mods)
     Return whether this is the tertiary button, considering primary to be button1 and secondary to be the popup trigger button.
public static  booleanisToolTip(Component c)
     Return whether the given component is part of the transient wrapper around a tooltip.
public static  booleanisTransientDialog(Component c)
     Return whether the given component is part of a transient dialog.
public static  booleanisTransientPopup(Component c)
     Return whether the given component is part of the transient wrapper around a popup.
public static  intkeyCodeToMask(int code)
    
public static  intmaskToKeyCode(int mask)
     Convert the given modifier event mask to the equivalent key code.
public static  voidmoveFrameRelativeTo(Frame frame, Component relativeTo)
    
public static  booleanonScreen(Point p)
     Return whether the given Point is visible on any screen.
public static  booleanonScreen(Window w)
     Returns whether one of the upper corners of the given window is accessible.
public static  ComponentretargetMouseEvent(Component comp, int id, Point pt)
     If a component does not have mouse events enabled, use the first ancestor which does.
public static  voidsetHTMLPreferredWidth(JComponent c, int width)
     Ensure the given component renders its initial HTML wrapped at the given preferred width.
public static  voidsetLocationByPlatform(Window w)
     Set the position of the window in a platform-specific manner. Uses Window.setLocationByPlatform if available, otherwise centers on screen.
public static  voidshowFrameRelative(Frame frame, Component relativeTo)
     Display a frame relative to the given component.

Field Detail
CONTAINS_HEAVYWEIGHT_COMPONENT
final public static String CONTAINS_HEAVYWEIGHT_COMPONENT(Code)
Set this client property on components which contain a heavyweight component. Use Boolean.TRUE as the value.



DEFAULT_CASCADE
final public static Point DEFAULT_CASCADE(Code)
Offset from the position of the currently active window to the position of a new window.



POPUP_TIMEOUT
public static int POPUP_TIMEOUT(Code)



ROOT_FRAME_CLASSNAME
final static String ROOT_FRAME_CLASSNAME(Code)





Method Detail
alpha
public static Color alpha(Color c, int alpha)(Code)
Return a copy of the given color with a new alpha component.



cascade
public static void cascade(Window w)(Code)
Cascade the given window based on the currently active Frame .



cascade
public static void cascade(Window w, int xoff, int yoff)(Code)
Cascade the given window based on the currently active Frame .



centerOnFrame
public static void centerOnFrame(Window window, Frame frame)(Code)
Center on the specified frame.



centerOnScreen
public static void centerOnScreen(Window window)(Code)
Center the given Window on the default screen.



combine
public static Color combine(Color c1, Color c2)(Code)
Combine the two colors with equal weight.



combine
public static Color combine(Color c1, Color c2, float weight)(Code)
Combine the two colors, giving the requested weight to the first.



containsFocus
public static boolean containsFocus(Component c)(Code)
Return whether the given component either has focus or is the ancestor of the focused component.



dismissAWTPopup
public static void dismissAWTPopup()(Code)
Ensure any extant AWT popup is dismissed. This should only be called from off the EDT, since (at least on w32) the EDT is blocked while an AWT popup is showing.



ensureOnScreen
public static void ensureOnScreen(Window w)(Code)
Ensure the given window is visible on screen.



eventTypeEnabled
public static boolean eventTypeEnabled(Component c, int id)(Code)
WARNING: This uses 1.3/1.4 implementation details.



find
public static Component find(Component root, Class type)(Code)
Find the first instance of the given class under the given component, or null if none found.



find
public static Component find(Component root, ComponentPredicate test)(Code)
Find the first component matching the given predicate, or null if none found.



findAWTMenuItems
public static MenuItem[] findAWTMenuItems(Frame frame, String path)(Code)
Returns all MenuItems matching the given label or path which are found in the given Frame's MenuBar.



findAWTPopupMenuItems
public static MenuItem[] findAWTPopupMenuItems(Component parent, String path)(Code)
Returns all MenuItems matching the given label or path which are on PopupMenus on the given Component.



findActivePopupMenu
public static JPopupMenu findActivePopupMenu()(Code)
Find the currently active Swing popup menu, if any, waiting up to POPUP_TIMEOUT ms. Returns null if no popup found.



findAppletDescendent
public static Applet findAppletDescendent(Container c)(Code)
Returns the Applet descendent of the given Container, if any.



findRootPaneContainer
public static RootPaneContainer findRootPaneContainer(Container c)(Code)
Find the first instance of RootPaneContainer in the given container. Basically finds applets.



getActivePopupMenu
public static JPopupMenu getActivePopupMenu()(Code)
Returns the currently active popup menu, if any. If no popup is currently showing, returns null.



getActiveWindow
public static Window getActiveWindow()(Code)
NOTE: NOT necessarily the same thing as the focused window.



getAppContext
public static AppContext getAppContext(Component c)(Code)
For debugging purposes only.



getFocusOwner
public static Component getFocusOwner()(Code)
Return the focus owner under the given Window. As of 1.4.x, components will report that they do not have focus if asked from a different AppContext than their own. Account for that here.



getFocusedWindow
public static Window getFocusedWindow()(Code)
NOTE: on pointer-focused systems, the frontmost window is not necessarily the one with focus.



getFrame
public static Frame getFrame(Object o)(Code)
Return the Frame corresponding to the given object.



getGraphicsConfiguration
public static GraphicsConfiguration getGraphicsConfiguration(Point p)(Code)
Returns the GraphicsConfiguration which contains the given point, or null if none.



getInsets
public static Insets getInsets(Container c)(Code)



getInvoker
public static Component getInvoker(MenuComponent mc)(Code)
Returns the invoker, if any, of the given AWT menu component. Returns null if the menu component is not attached to anything, or if it is within a MenuBar hierarchy.



getInvoker
public static Component getInvoker(Component comp)(Code)
Returns the invoker, if any, of the given component. Returns null if the component is not on a popup of any sort.



getKeyCode
public static String getKeyCode(int keycode)(Code)



getKeyCode
public static int getKeyCode(String code)(Code)



getKeyModifiers
public static String getKeyModifiers(int flags)(Code)



getLocationOnScreen
public static Point getLocationOnScreen(Component c)(Code)
Safe version of Component.getLocationOnScreen , which avoids lockup if an AWT popup menu is showing. The AWT popup holds the AWT tree lock when showing, which lock is required by Component.getLocationOnScreen .



getModifiers
public static int getModifiers(String mods)(Code)
Convert the string representation into the actual modifier mask.



getModifiers
public static String getModifiers(InputEvent event)(Code)
Convert the integer modifier flags into a string representation.



getMouseModifiers
public static String getMouseModifiers(int flags)(Code)



getPath
public static String getPath(MenuItem item)(Code)
Returns a unique path to the given MenuItem.



getPopupMask
public static int getPopupMask()(Code)
Returns the InputEvent mask for the popup trigger button.



getPopupMenus
public static PopupMenu[] getPopupMenus(Component c)(Code)
Return all AWT popup menus associated with the given component.



getPopupOnPress
public static boolean getPopupOnPress()(Code)
Returns whether the platform registers a popup on mouse press.



getTertiaryMask
public static int getTertiaryMask()(Code)
Returns the InputEvent mask for the tertiary button.



getVirtualDisplayBounds
public static Rectangle getVirtualDisplayBounds(boolean includeInsets)(Code)
Returns a Rectangle spanning all screens. Note that not all pixels within the rectangle are necessarily on a display.

Includes any toolbar/dashboard regions.




getVisibleBounds
public static Rectangle getVisibleBounds(GraphicsConfiguration gc)(Code)
Return the visible bounds for the graphics configuration. This will exclude any permanent menu bar or dashboard decorations.



getWindow
public static Window getWindow(Object o)(Code)
Return the window corresponding to the given object.



getWindow
public static Window getWindow(Component comp)(Code)
Similar to SwingUtilities.getWindowAncestor(), but returns the component itself if it is a Window, or the invoker's window if on a popup.



hasDefaultName
public static boolean hasDefaultName(Component c)(Code)
Return whether the given Component has only its default name set.



hierarchyHasHeavyweightComponent
public static boolean hierarchyHasHeavyweightComponent(Component base)(Code)
whether the hierarchy within which the given Component sitscontains a heavyweight component.



invokeAction
public static void invokeAction(Runnable action)(Code)
Ensure the given action happens on the event dispatch thread. Any component modifications must be invoked this way. Note that this is not the same as EventQueue.invokeLater, since if the current thread is the dispatch thread, the action is invoked immediately.



invokeAndWait
public static void invokeAndWait(Runnable action)(Code)
Ensure the given action happens on the event dispatch thread. Any component modifications must be invoked this way.



isAWTPopupMenuBlocking
public static boolean isAWTPopupMenuBlocking()(Code)
Returns whether there is an AWT popup menu currently showing.



isAWTTreeLockHeld
public static boolean isAWTTreeLockHeld(EventQueue eq)(Code)
Returns whether the AWT Tree Lock is currently held.



isAppletViewerFrame
public static boolean isAppletViewerFrame(Component c)(Code)



isContentPane
public static boolean isContentPane(Component c)(Code)
Returns whether the given Component is the content pane for a RootPaneContainer .
See Also:   javax.swing.RootPaneContainer.getContentPane



isGlassPane
public static boolean isGlassPane(Component c)(Code)
Returns whether the given Component is the Glass Pane for a JRootPane .
See Also:   javax.swing.JRootPane.getGlassPane



isHeavyweightPopup
public static boolean isHeavyweightPopup(Component c)(Code)
Returns whether the given component is a heavyweight popup, that is, a container for a JPopupMenu that is implemented with a heavyweight component (usually a Window).



isInternalFrameDecoration
public static boolean isInternalFrameDecoration(Component c)(Code)
Return whether the given component is part of an internal frame's LAF decoration.



isLightweightPopup
public static boolean isLightweightPopup(Component c)(Code)
Returns whether the given component is a lightweight popup, that is, a container for a JPopupMenu that is implemented with a lightweight component (usually JPanel).



isMenuActive
public static boolean isMenuActive(Component c)(Code)
Returns true if there is an active menu on the JFrame (if any) containing the given component.



isModifier
public static boolean isModifier(int keycode)(Code)



isOnMenuBar
public static boolean isOnMenuBar(MenuComponent mc)(Code)
Returns whether the menu component is on a MenuBar.



isOnPopup
public static boolean isOnPopup(MenuComponent mc)(Code)
Returns whether the given MenuComponent is on a top-level AWT popup (that is, not under a MenuBar.



isOnPopup
public static boolean isOnPopup(Component comp)(Code)
Returns whether the given component is on a top-level popup. A top-level popup is one generated by a popup trigger, which means popups generated from a JMenu are not included.



isSharedInvisibleFrame
public static boolean isSharedInvisibleFrame(Component c)(Code)
Is the given component the default Swing hidden frame?



isTertiaryButton
public static boolean isTertiaryButton(int mods)(Code)
Return whether this is the tertiary button, considering primary to be button1 and secondary to be the popup trigger button.



isToolTip
public static boolean isToolTip(Component c)(Code)
Return whether the given component is part of the transient wrapper around a tooltip.



isTransientDialog
public static boolean isTransientDialog(Component c)(Code)
Return whether the given component is part of a transient dialog. This includes dialogs generated by JFileChooser, JOptionPane, JColorChooser, and ProgressMonitor.

Note that it is possible to use JOptionPane.createDialog to create a reusable dialog, so just because it's transient doesn't mean it will be disposed of when it is hidden.

Note that this won't detect transient Dialogs after their components have been reassigned to a new transient Dialog.




isTransientPopup
public static boolean isTransientPopup(Component c)(Code)
Return whether the given component is part of the transient wrapper around a popup.



keyCodeToMask
public static int keyCodeToMask(int code)(Code)



maskToKeyCode
public static int maskToKeyCode(int mask)(Code)
Convert the given modifier event mask to the equivalent key code.



moveFrameRelativeTo
public static void moveFrameRelativeTo(Frame frame, Component relativeTo)(Code)



onScreen
public static boolean onScreen(Point p)(Code)
Return whether the given Point is visible on any screen.



onScreen
public static boolean onScreen(Window w)(Code)
Returns whether one of the upper corners of the given window is accessible.



retargetMouseEvent
public static Component retargetMouseEvent(Component comp, int id, Point pt)(Code)
If a component does not have mouse events enabled, use the first ancestor which does.



setHTMLPreferredWidth
public static void setHTMLPreferredWidth(JComponent c, int width)(Code)
Ensure the given component renders its initial HTML wrapped at the given preferred width.



setLocationByPlatform
public static void setLocationByPlatform(Window w)(Code)
Set the position of the window in a platform-specific manner. Uses Window.setLocationByPlatform if available, otherwise centers on screen.



showFrameRelative
public static void showFrameRelative(Frame frame, Component relativeTo)(Code)
Display a frame relative to the given component.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.