Java Doc for JideSwingUtilities.java in  » Swing-Library » jide-common » com » jidesoft » swing » 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 » Swing Library » jide common » com.jidesoft.swing 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.jidesoft.swing.JideSwingUtilities

JideSwingUtilities
public class JideSwingUtilities implements SwingConstants(Code)
A utilities class for Swing.

Inner Class :public interface Handler
Inner Class :public interface ConditionHandler extends Handler
Inner Class :public interface GetHandler

Field Summary
final public static  ObjectAA_TEXT_PROPERTY_KEY
     Key used in client properties to indicate whether or not the component should use aa text.
final public static  StringSET_OPAQUE_RECURSIVELY_EXCLUDED
     setOpaqueRecursively method will make all child components opaque true or false.
static  RenderingHintsrenderingHints
    


Method Summary
public static  voidcenterWindow(Window childToCenter)
     Center the component to it's parent window.
public static  booleancomponentIsPermanentFocusOwner(Component comp)
    
public static  booleancompositeRequestFocus(Component component)
     Copied from BasicLookAndFeel as the method is package local.
public static  booleancontainerContainsFocus(Container cont)
    
public static  VectorconvertDefaultComboBoxModelToVector(DefaultComboBoxModel model)
    
public static  JPanelcreateBottomPanel(Component object)
     Create a Panel around a component so that component aligns to buttom.
public static  JPanelcreateCenterPanel(Component object)
     Create a Panel around a component so that component is right in the middle.
public static  JPanelcreateLeftPanel(Component object)
     Create a Panel around a component so that component aligns to left.
public static  JPanelcreateRightPanel(Component object)
     Create a Panel around a component so that component aligns to right.
public static  JPanelcreateTableModelModifier(DefaultTableModel tableModel)
     For internal usage only.
public static  JPanelcreateTopPanel(Component object)
     Create a Panel around a component so that component aligns to top.
public static  Map<Component, Boolean>disableDoubleBuffered(Component c)
     Disables the double buffered flag of the component and its children.
public static  voiddrawGrip(Graphics g, Rectangle rectangle, int maxLength, int maxThickness)
    
public static  voiddrawGrip(Graphics g, Rectangle rectangle, int maxLength, int maxThickness, boolean isSelected)
    
public static  voiddrawImageBorder(Graphics g, ImageIcon img, Rectangle rect, Insets ins, boolean drawCenter)
     Draws a border based on an image.
public static  voiddrawShadow(Graphics g, Component c, int x, int y, int w, int h)
    
public static  voiddrawString(JComponent c, Graphics g, String text, int x, int y)
    
public static  voiddrawStringUnderlineCharAt(JComponent c, Graphics g, String text, int underlinedIndex, int x, int y)
    
public static  booleandrawTextAntialiased(boolean aaText)
     Returns whether or not text should be drawn antialiased.
Parameters:
  aaText - Whether or not aa text has been turned on for thecomponent.
public static  Map<Component, Boolean>enableDoubleBuffered(Component c)
     Enables the double buffered flag of the component and its children.
public static  voidensureRowVisible(JTable table, int row)
     To make sure the row is visible.
public static  booleanequals(Object o1, Object o2)
     Checks if the two objects equal.
public static  booleanequals(Object o1, Object o2, boolean considerArray)
     Checks if the two objects equal.
public static  voidfillGradient(Graphics g, Rectangle rect, int orientation)
    
public static  voidfillGradient(Graphics2D g2d, Shape s, Color startColor, Color endColor, boolean isVertical)
     Fills a gradient using the startColor and endColor specified.
public static  voidfillNormalGradient(Graphics2D g2d, Shape s, Color startColor, Color endColor, boolean isVertical)
    
public static  voidfillSingleGradient(Graphics g, Rectangle rect, int orientation)
    
public static  voidfillSingleGradient(Graphics g, Rectangle rect, int orientation, int level)
    
public static  intfindDisplayedMnemonicIndex(String text, int mnemonic)
    
public static  ComponentfindSomethingFocusable(Container container)
     Find some subcomponent of the specified container that will accept focus.

Note that this doesn't do something smart like trying to walk the hierarchy horizontally at each level so that the focused subcomponent is as high as possible.

public static  ObjectgetBoldFont(Toolkit toolkit, UIDefaults table)
    
public static  intgetButtonState(AbstractButton b)
    
public static  int[]getButtonState(JideSplitButton b)
    
public static  ObjectgetControlFont(Toolkit toolkit, UIDefaults table)
    
public static  floatgetDefaultFontSize()
    
public static  ComponentgetDescendantOfClass(Class c, Container container)
     Gets the first occurence of the component with specified type in the container.
public static  BufferedImagegetFasterScaledInstance(BufferedImage img, int targetWidth, int targetHeight, Object hint, boolean progressiveBilinear)
     Convenience method that returns a scaled instance of the provided BufferedImage.
public static  ComponentgetFirstChildOf(Class clazz, Component c)
     Gets the first child of the component that is the specified type.
public static  FramegetFrame(Component component)
     Gets the top level Frame of the component.
Parameters:
  component - the top level Frame.
public static  ObjectgetMenuFont(Toolkit toolkit, UIDefaults table)
    
public static  intgetOrientationOf(Component component)
    
public static  JRootPanegetOutermostRootPane(Component c)
     If c is a JRootPane descendant return its outermost JRootPane ancestor.
public static  DimensiongetPreferredButtonSize(AbstractButton b, int textIconGap, boolean isHorizontal)
    
public static  ComponentgetRecursively(Component c, GetHandler handler)
     Gets to a child of a component recursively based on certain condition.
public static  ComponentgetScrollPane(Component innerComponent)
     Gets the scroll pane around the component.
Parameters:
  innerComponent - the scroll pane.
public static  WindowgetTopModalDialog(Window w)
     Gets the top modal dialog of current window.
public static  WindowgetWindow(Component component)
     Gets the top level Window of the component.
Parameters:
  component - the top level Frame.
public static  WindowgetWindowForComponent(Component parentComponent)
    
public static  voidglobalCenterWindow(Window childToCenter)
     Center the window to the whole screen.
public static  voidignoreException(Exception e)
     Ignore the exception.
public static  voidinsertKeyListener(Component component, KeyListener l, int index)
     Inserts the key listener at the particular index in the listeners' chain.
public static  voidinsertMouseListener(Component component, MouseListener l, int index)
     Inserts the mouse listener at the particular index in the listeners' chain.
public static  voidinsertMouseMotionListener(Component component, MouseMotionListener l, int index)
     Inserts the mouse motion listener at the particular index in the listeners' chain.
public static  voidinstallBorder(JComponent c, Border defaultBorder)
    
public static  voidinstallColors(Component c, Color background, Color foreground)
    
public static  voidinstallColorsAndFont(Component c, Color background, Color foreground, Font font)
    
public static  voidinstallFont(Component c, Font font)
    
public static  booleanisAncestorOfFocusOwner(Component component)
    
public static  booleanisKeyListenerRegistered(Component component, KeyListener l)
     Checks if the key listener is already registerd on the component.
Parameters:
  component - the component
Parameters:
  l - the listener true if already registered.
public static  booleanisListenerRegistered(EventListenerList list, Class t, EventListener l)
     Checks if the listener is always registered to the EventListenerList to avoid duplicated registration of the same listener
Parameters:
  list - the EventListenerList to register the listener.
Parameters:
  t - the type of the EventListener.
Parameters:
  l - the listener.
public static  booleanisListenerRegistered(Component component, Class t, EventListener l)
     Checks if the listener is always registered to the Component to avoid duplicated registration of the same listener
Parameters:
  component - the component that you want to register the listener.
Parameters:
  t - the type of the EventListener.
Parameters:
  l - the listener.
public static  booleanisMouseListenerRegistered(Component component, MouseListener l)
     Checks if the mouse listener is already registerd on the component.
Parameters:
  component - the component
Parameters:
  l - the listener true if already registered.
public static  booleanisMouseMotionListenerRegistered(Component component, MouseMotionListener l)
     Checks if the mouse motion listener is already registerd on the component.
Parameters:
  component - the component
Parameters:
  l - the listener true if already registered.
public static  StringlayoutCompoundLabel(JComponent c, FontMetrics fm, String text, Icon icon, boolean isHorizontal, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap)
     Compute and return the location of the icons origin, the location of origin of the text baseline, and a possibly clipped version of the compound labels string.
public static  StringlayoutCompoundLabel(FontMetrics fm, String text, Icon icon, boolean isHorizontal, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap)
     Compute and return the location of the icons origin, the location of origin of the text baseline, and a possibly clipped version of the compound labels string.
public static  voidpaintArrow(Graphics g, Color color, int startX, int startY, int width, int orientation)
     Paints an arrow shape.
public static  voidpaintBackground(Graphics g, Rectangle rect, Color border, Color bk)
    
public static  voidpaintBackground(Graphics2D g2d, Rectangle rect, Color border, Paint paint)
    
public static  voidpaintCross(Graphics g, Color color, int centerX, int centerY, int size, int width)
     Paints a cross shape.
public static  booleanpassesFocusabilityTest(Component comp)
     There are four standard tests which determine if Swing will be able to request focus for a component.
public static  voidprintException(Exception e)
     Prints out the message of the exception.
public static  voidprintUIDefaults()
    
public static  voidregisterTabKey(Container container)
     Register the tab key with the container.
public static  voidrestoreAntialiasing(Component c, Graphics g, Object oldHints)
     Restores the old setting for text anti-alias.
public static  voidrestoreDoubleBuffered(Component c, Map<Component, Boolean> map)
     Restores the double buffered flag of the component and its children.
public static  voidrestoreShapeAntialiasing(Graphics g, Object oldHints)
     Restores the old setting for shape anti-alias.
public static  voidretargetMouseEvent(int id, MouseEvent e, Component target)
    
public static  voidsetChildrenOrientationOf(Container c, int orientation)
    
public static  voidsetEnabledRecursively(Component c, boolean enabled)
     Calls setEnabled method recursively on component.
public static  voidsetOpaqueRecursively(Component c, boolean opaque)
     Calls setOpaque method recursively on each component except for JButton, JComboBox and JTextComponent.
public static  voidsetOrientationOf(Component component, int orientation)
    
public static  voidsetRecursively(Component c, Handler handler)
     Calls the handler recursively on a component.
public static  voidsetRequestFocusEnabledRecursively(Component c, boolean enabled)
     Calls setRequestFocusEnabled method recursively on component.
public static  ObjectsetupAntialiasing(Component c, Graphics g)
     Setups the graphics to draw text using anti-alias.

Under JDK1.4 and JDK5, this method will use a system property "swing.aatext" to determine if anti-alias is used. Under JDK6, we will read the system setting.

public static  ObjectsetupShapeAntialiasing(Graphics g)
     Setups the graphics to draw shape using anti-alias.
Parameters:
  g - the old hints.
public static  booleanshouldUseSystemFont()
     In JDK1.4, it uses a wrong font for Swing component in Windows L&F which is actually one big reason for people to think Swing application ugly. To address this issue, we changed the code to force to use Tahoma font for all the fonts in L&F instead of using the system font.

However this is a downside to this.

public static  voidsynchonizeView(JViewport view1, JViewport view2, int orientation)
    
public static  voidsynchronizeView(JViewport view1, JViewport view2, int orientation)
     Synchonizes the two viewports.
public static  voidthrowException(Exception e)
     Throws the exception.
public static  voidthrowInvocationTargetException(InvocationTargetException e)
     Throws the InvocationTargetException.
public static  voidtoggleRTLnLTR(Component topContainer)
     Toggles between RTL and LTR.
public static  voidtraceFocus()
     For internal usage only.

Field Detail
AA_TEXT_PROPERTY_KEY
final public static Object AA_TEXT_PROPERTY_KEY(Code)
Key used in client properties to indicate whether or not the component should use aa text.



SET_OPAQUE_RECURSIVELY_EXCLUDED
final public static String SET_OPAQUE_RECURSIVELY_EXCLUDED(Code)
setOpaqueRecursively method will make all child components opaque true or false. But if you call jcomponent.putClientProperty(SET_OPAQUE_RECURSIVELY_EXCLUDED, Boolean.TRUE), we will not touch this particular component when setOpaqueRecursively.



renderingHints
static RenderingHints renderingHints(Code)





Method Detail
centerWindow
public static void centerWindow(Window childToCenter)(Code)
Center the component to it's parent window.



componentIsPermanentFocusOwner
public static boolean componentIsPermanentFocusOwner(Component comp)(Code)



compositeRequestFocus
public static boolean compositeRequestFocus(Component component)(Code)
Copied from BasicLookAndFeel as the method is package local.
Parameters:
  component - if request focus is success or not.



containerContainsFocus
public static boolean containerContainsFocus(Container cont)(Code)
containerContainsFocus, does the specified container contain the current focusOwner?
Parameters:
  cont - the specified container Is the current focusOwner a descendent of the specifiedcontainer, or the container itself?



convertDefaultComboBoxModelToVector
public static Vector convertDefaultComboBoxModelToVector(DefaultComboBoxModel model)(Code)



createBottomPanel
public static JPanel createBottomPanel(Component object)(Code)
Create a Panel around a component so that component aligns to buttom.
Parameters:
  object - a Panel



createCenterPanel
public static JPanel createCenterPanel(Component object)(Code)
Create a Panel around a component so that component is right in the middle.
Parameters:
  object - a Panel



createLeftPanel
public static JPanel createLeftPanel(Component object)(Code)
Create a Panel around a component so that component aligns to left.
Parameters:
  object - a Panel



createRightPanel
public static JPanel createRightPanel(Component object)(Code)
Create a Panel around a component so that component aligns to right.
Parameters:
  object - a Panel



createTableModelModifier
public static JPanel createTableModelModifier(DefaultTableModel tableModel)(Code)
For internal usage only.



createTopPanel
public static JPanel createTopPanel(Component object)(Code)
Create a Panel around a component so that component aligns to top.
Parameters:
  object - a Panel



disableDoubleBuffered
public static Map<Component, Boolean> disableDoubleBuffered(Component c)(Code)
Disables the double buffered flag of the component and its children. The return map contains the components that were double buffered. After this call, you can then restore the double buffered flag using JideSwingUtilities.restoreDoubleBuffered(java.awt.Component,java.util.Map) using the map that is returned from this method.
Parameters:
  c - the parent container. the map that contains all components that were double buffered.



drawGrip
public static void drawGrip(Graphics g, Rectangle rectangle, int maxLength, int maxThickness)(Code)



drawGrip
public static void drawGrip(Graphics g, Rectangle rectangle, int maxLength, int maxThickness, boolean isSelected)(Code)



drawImageBorder
public static void drawImageBorder(Graphics g, ImageIcon img, Rectangle rect, Insets ins, boolean drawCenter)(Code)
Draws a border based on an image. The image can be divided into nine different areas. Each area size is determined by the insets.



drawShadow
public static void drawShadow(Graphics g, Component c, int x, int y, int w, int h)(Code)



drawString
public static void drawString(JComponent c, Graphics g, String text, int x, int y)(Code)



drawStringUnderlineCharAt
public static void drawStringUnderlineCharAt(JComponent c, Graphics g, String text, int underlinedIndex, int x, int y)(Code)



drawTextAntialiased
public static boolean drawTextAntialiased(boolean aaText)(Code)
Returns whether or not text should be drawn antialiased.
Parameters:
  aaText - Whether or not aa text has been turned on for thecomponent. Whether or not text should be drawn antialiased.



enableDoubleBuffered
public static Map<Component, Boolean> enableDoubleBuffered(Component c)(Code)
Enables the double buffered flag of the component and its children. The return map contains the components that weren't double buffered. After this call, you can then restore the double buffered flag using JideSwingUtilities.restoreDoubleBuffered(java.awt.Component,java.util.Map) using the map that is returned from this method.
Parameters:
  c - the parent container. the map that contains all components that weren't double buffered.



ensureRowVisible
public static void ensureRowVisible(JTable table, int row)(Code)
To make sure the row is visible. If the table's horizontal scroll bar is visible, the method will not change the horizontal scroll bar's position.
Parameters:
  table -
Parameters:
  row -



equals
public static boolean equals(Object o1, Object o2)(Code)
Checks if the two objects equal. If both are null, they are equal. If o1 and o2 both are Comparable, we will use compareTo method to see if it equals 0. At last, we will use o1.equals(o2) to compare. If none of the above conditions match, we return false.
Parameters:
  o1 - the first object to compare
Parameters:
  o2 - the second object to compare true if the two objects are equal. Otherwise false.



equals
public static boolean equals(Object o1, Object o2, boolean considerArray)(Code)
Checks if the two objects equal. If both are null, they are equal. If o1 and o2 both are Comparable, we will use compareTo method to see if it equals 0. If considerArray is true and o1 and o2 are both array, we will compare each element in the array. At last, we will use o1.equals(o2) to compare. If none of the above conditions match, we return false.
Parameters:
  o1 - the first object to compare
Parameters:
  o2 - the second object to compare
Parameters:
  considerArray - If true, and if o1 and o2 are both array, we will compare each element in the array instead of just compare the two array objects. true if the two objects are equal. Otherwise false.



fillGradient
public static void fillGradient(Graphics g, Rectangle rect, int orientation)(Code)



fillGradient
public static void fillGradient(Graphics2D g2d, Shape s, Color startColor, Color endColor, boolean isVertical)(Code)
Fills a gradient using the startColor and endColor specified. This is a fast version of fill gradient which will not only leverage hardware acceleration, but also cache GradientPaint and reuse it.

We also leave an option to use the normal GradientPaint to paint the gradient. To do so, just set a system property "normalGradientPaint" to "false".
Parameters:
  g2d -
Parameters:
  s -
Parameters:
  startColor -
Parameters:
  endColor -
Parameters:
  isVertical -




fillNormalGradient
public static void fillNormalGradient(Graphics2D g2d, Shape s, Color startColor, Color endColor, boolean isVertical)(Code)



fillSingleGradient
public static void fillSingleGradient(Graphics g, Rectangle rect, int orientation)(Code)



fillSingleGradient
public static void fillSingleGradient(Graphics g, Rectangle rect, int orientation, int level)(Code)



findDisplayedMnemonicIndex
public static int findDisplayedMnemonicIndex(String text, int mnemonic)(Code)



findSomethingFocusable
public static Component findSomethingFocusable(Container container)(Code)
Find some subcomponent of the specified container that will accept focus.

Note that this doesn't do something smart like trying to walk the hierarchy horizontally at each level so that the focused subcomponent is as high as possible. Rather, it drills vertically. It's just a safety valve so that focus can be requested somewhere rather than being lost.
Parameters:
  container - a focusable subcomponent




getBoldFont
public static Object getBoldFont(Toolkit toolkit, UIDefaults table)(Code)



getButtonState
public static int getButtonState(AbstractButton b)(Code)



getButtonState
public static int[] getButtonState(JideSplitButton b)(Code)



getControlFont
public static Object getControlFont(Toolkit toolkit, UIDefaults table)(Code)



getDefaultFontSize
public static float getDefaultFontSize()(Code)



getDescendantOfClass
public static Component getDescendantOfClass(Class c, Container container)(Code)
Gets the first occurence of the component with specified type in the container. It used deep-first searching to find it.
Parameters:
  c -
Parameters:
  container - the first occurence of the component with specified type in the container. Null if nothing is found.



getFasterScaledInstance
public static BufferedImage getFasterScaledInstance(BufferedImage img, int targetWidth, int targetHeight, Object hint, boolean progressiveBilinear)(Code)
Convenience method that returns a scaled instance of the provided BufferedImage.
Parameters:
  img - the original image to be scaled
Parameters:
  targetWidth - the desired width of the scaled instance,in pixels
Parameters:
  targetHeight - the desired height of the scaled instance,in pixels
Parameters:
  hint - one of the rendering hints that corresponds toRenderingHints.KEY_INTERPOLATION (e.g.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR,RenderingHints.VALUE_INTERPOLATION_BILINEAR,RenderingHints.VALUE_INTERPOLATION_BICUBIC)
Parameters:
  progressiveBilinear - if true, this method will use a multi-stepscaling technique that provides higher quality than the usualone-step technique (only useful in down-scaling cases, wheretargetWidth or targetHeight issmaller than the original dimensions) a scaled version of the original BufferedImage



getFirstChildOf
public static Component getFirstChildOf(Class clazz, Component c)(Code)
Gets the first child of the component that is the specified type.
Parameters:
  clazz -
Parameters:
  c - the first child of the component that is the specified type.



getFrame
public static Frame getFrame(Component component)(Code)
Gets the top level Frame of the component.
Parameters:
  component - the top level Frame. Null if we didn't find an ancestor which is instance of Frame.



getMenuFont
public static Object getMenuFont(Toolkit toolkit, UIDefaults table)(Code)



getOrientationOf
public static int getOrientationOf(Component component)(Code)



getOutermostRootPane
public static JRootPane getOutermostRootPane(Component c)(Code)
If c is a JRootPane descendant return its outermost JRootPane ancestor. If c is a RootPaneContainer then return its JRootPane. the outermost JRootPane for Component c or null .



getPreferredButtonSize
public static Dimension getPreferredButtonSize(AbstractButton b, int textIconGap, boolean isHorizontal)(Code)



getRecursively
public static Component getRecursively(Component c, GetHandler handler)(Code)
Gets to a child of a component recursively based on certain condition.
Parameters:
  c - component
Parameters:
  handler - handler to be called



getScrollPane
public static Component getScrollPane(Component innerComponent)(Code)
Gets the scroll pane around the component.
Parameters:
  innerComponent - the scroll pane. Null if the component is not in any JScrollPane.



getTopModalDialog
public static Window getTopModalDialog(Window w)(Code)
Gets the top modal dialog of current window.
Parameters:
  w - the top modal dialog of current window.



getWindow
public static Window getWindow(Component component)(Code)
Gets the top level Window of the component.
Parameters:
  component - the top level Frame. Null if we didn't find an ancestor which is instance of Frame.JideSwingUtilities.getWindowForComponent(java.awt.Component)javax.swing.JOptionPane.getRootFrame



getWindowForComponent
public static Window getWindowForComponent(Component parentComponent) throws HeadlessException(Code)



globalCenterWindow
public static void globalCenterWindow(Window childToCenter)(Code)
Center the window to the whole screen.



ignoreException
public static void ignoreException(Exception e)(Code)
Ignore the exception. This method does nothing. However it's a good practice to use this method so that we can easily find out the place that ignoring exception. In development phase, we can log a message in this method so that we can verify if it makes sense to ignore.
Parameters:
  e -



insertKeyListener
public static void insertKeyListener(Component component, KeyListener l, int index)(Code)
Inserts the key listener at the particular index in the listeners' chain.
Parameters:
  component -
Parameters:
  l -
Parameters:
  index -



insertMouseListener
public static void insertMouseListener(Component component, MouseListener l, int index)(Code)
Inserts the mouse listener at the particular index in the listeners' chain.
Parameters:
  component -
Parameters:
  l -
Parameters:
  index -



insertMouseMotionListener
public static void insertMouseMotionListener(Component component, MouseMotionListener l, int index)(Code)
Inserts the mouse motion listener at the particular index in the listeners' chain.
Parameters:
  component -
Parameters:
  l -
Parameters:
  index -



installBorder
public static void installBorder(JComponent c, Border defaultBorder)(Code)



installColors
public static void installColors(Component c, Color background, Color foreground)(Code)



installColorsAndFont
public static void installColorsAndFont(Component c, Color background, Color foreground, Font font)(Code)



installFont
public static void installFont(Component c, Font font)(Code)



isAncestorOfFocusOwner
public static boolean isAncestorOfFocusOwner(Component component)(Code)



isKeyListenerRegistered
public static boolean isKeyListenerRegistered(Component component, KeyListener l)(Code)
Checks if the key listener is already registerd on the component.
Parameters:
  component - the component
Parameters:
  l - the listener true if already registered. Otherwise false.



isListenerRegistered
public static boolean isListenerRegistered(EventListenerList list, Class t, EventListener l)(Code)
Checks if the listener is always registered to the EventListenerList to avoid duplicated registration of the same listener
Parameters:
  list - the EventListenerList to register the listener.
Parameters:
  t - the type of the EventListener.
Parameters:
  l - the listener. true if already registered. Otherwise false.



isListenerRegistered
public static boolean isListenerRegistered(Component component, Class t, EventListener l)(Code)
Checks if the listener is always registered to the Component to avoid duplicated registration of the same listener
Parameters:
  component - the component that you want to register the listener.
Parameters:
  t - the type of the EventListener.
Parameters:
  l - the listener. true if already registered. Otherwise false.



isMouseListenerRegistered
public static boolean isMouseListenerRegistered(Component component, MouseListener l)(Code)
Checks if the mouse listener is already registerd on the component.
Parameters:
  component - the component
Parameters:
  l - the listener true if already registered. Otherwise false.



isMouseMotionListenerRegistered
public static boolean isMouseMotionListenerRegistered(Component component, MouseMotionListener l)(Code)
Checks if the mouse motion listener is already registerd on the component.
Parameters:
  component - the component
Parameters:
  l - the listener true if already registered. Otherwise false.



layoutCompoundLabel
public static String layoutCompoundLabel(JComponent c, FontMetrics fm, String text, Icon icon, boolean isHorizontal, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap)(Code)
Compute and return the location of the icons origin, the location of origin of the text baseline, and a possibly clipped version of the compound labels string. Locations are computed relative to the viewR rectangle. The JComponents orientation (LEADING/TRAILING) will also be taken into account and translated into LEFT/RIGHT values accordingly.



layoutCompoundLabel
public static String layoutCompoundLabel(FontMetrics fm, String text, Icon icon, boolean isHorizontal, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap)(Code)
Compute and return the location of the icons origin, the location of origin of the text baseline, and a possibly clipped version of the compound labels string. Locations are computed relative to the viewR rectangle. This layoutCompoundLabel() does not know how to handle LEADING/TRAILING values in horizontalTextPosition (they will default to RIGHT) and in horizontalAlignment (they will default to CENTER). Use the other version of layoutCompoundLabel() instead.



paintArrow
public static void paintArrow(Graphics g, Color color, int startX, int startY, int width, int orientation)(Code)
Paints an arrow shape.
Parameters:
  g -
Parameters:
  color -
Parameters:
  startX -
Parameters:
  startY -
Parameters:
  width -
Parameters:
  orientation -



paintBackground
public static void paintBackground(Graphics g, Rectangle rect, Color border, Color bk)(Code)



paintBackground
public static void paintBackground(Graphics2D g2d, Rectangle rect, Color border, Paint paint)(Code)



paintCross
public static void paintCross(Graphics g, Color color, int centerX, int centerY, int size, int width)(Code)
Paints a cross shape.
Parameters:
  g -
Parameters:
  color -
Parameters:
  centerX -
Parameters:
  centerY -
Parameters:
  size -
Parameters:
  width -



passesFocusabilityTest
public static boolean passesFocusabilityTest(Component comp)(Code)
There are four standard tests which determine if Swing will be able to request focus for a component. Test them.
Parameters:
  comp - does the specified component pass the four focusability tests



printException
public static void printException(Exception e)(Code)
Prints out the message of the exception.
Parameters:
  e -



printUIDefaults
public static void printUIDefaults()(Code)



registerTabKey
public static void registerTabKey(Container container)(Code)
Register the tab key with the container.
Parameters:
  container -



restoreAntialiasing
public static void restoreAntialiasing(Component c, Graphics g, Object oldHints)(Code)
Restores the old setting for text anti-alias.
Parameters:
  c -
Parameters:
  g -
Parameters:
  oldHints - the value returned from JideSwingUtilities.setupAntialiasing(java.awt.Component,java.awt.Graphics).



restoreDoubleBuffered
public static void restoreDoubleBuffered(Component c, Map<Component, Boolean> map)(Code)
Restores the double buffered flag of the component and its children. Only components that are in the map will be changed.
Parameters:
  c - the parent container.
Parameters:
  map - a map maps from component to a boolean. If the boolean is true, it means the component was double buffered bore.Otherwise, not double buffered.



restoreShapeAntialiasing
public static void restoreShapeAntialiasing(Graphics g, Object oldHints)(Code)
Restores the old setting for shape anti-alias.
Parameters:
  g -
Parameters:
  oldHints - the value returned from JideSwingUtilities.setupShapeAntialiasing(java.awt.Graphics).



retargetMouseEvent
public static void retargetMouseEvent(int id, MouseEvent e, Component target)(Code)



setChildrenOrientationOf
public static void setChildrenOrientationOf(Container c, int orientation)(Code)



setEnabledRecursively
public static void setEnabledRecursively(Component c, boolean enabled)(Code)
Calls setEnabled method recursively on component. Component c is usually a Container
Parameters:
  c - component
Parameters:
  enabled - true if enable; false otherwise



setOpaqueRecursively
public static void setOpaqueRecursively(Component c, boolean opaque)(Code)
Calls setOpaque method recursively on each component except for JButton, JComboBox and JTextComponent. Component c is usually a Container. If you would like certain child component not affected by this call, you can call jcomponent.putClientProperty(SET_OPAQUE_RECURSIVELY_EXCLUDED, Boolean.TRUE) before calling this method.
Parameters:
  c - component
Parameters:
  opaque - true if setOpaque to true; false otherwise



setOrientationOf
public static void setOrientationOf(Component component, int orientation)(Code)



setRecursively
public static void setRecursively(Component c, Handler handler)(Code)
Calls the handler recursively on a component.
Parameters:
  c - component
Parameters:
  handler - handler to be called



setRequestFocusEnabledRecursively
public static void setRequestFocusEnabledRecursively(Component c, boolean enabled)(Code)
Calls setRequestFocusEnabled method recursively on component. Component c is usually a Container
Parameters:
  c - component
Parameters:
  enabled - true if setRequestFocusEnabled to true; false otherwise



setupAntialiasing
public static Object setupAntialiasing(Component c, Graphics g)(Code)
Setups the graphics to draw text using anti-alias.

Under JDK1.4 and JDK5, this method will use a system property "swing.aatext" to determine if anti-alias is used. Under JDK6, we will read the system setting. For example, on Windows XP, there is a check box to turn on clear type anti-alias. We will use the same settings.
Parameters:
  c -
Parameters:
  g - the old hints. You will need this value as the third parameter in JideSwingUtilities.restoreAntialiasing(java.awt.Component,java.awt.Graphics,Object).




setupShapeAntialiasing
public static Object setupShapeAntialiasing(Graphics g)(Code)
Setups the graphics to draw shape using anti-alias.
Parameters:
  g - the old hints. You will need this value as the third parameter in JideSwingUtilities.restoreShapeAntialiasing(java.awt.Graphics,Object).



shouldUseSystemFont
public static boolean shouldUseSystemFont()(Code)
In JDK1.4, it uses a wrong font for Swing component in Windows L&F which is actually one big reason for people to think Swing application ugly. To address this issue, we changed the code to force to use Tahoma font for all the fonts in L&F instead of using the system font.

However this is a downside to this. Tahoma cannot display unicode characters such as Chinese, Japanese and Korean. So if the locale is CJK ( SystemInfo.isCJKLocale , we shouldn't use Tahoma. If you are on JDK 1.5 and above, you shouldn't force to use Tahoma either because JDK fixed it in 1.5 and above.

There are also a few system properties you can set to control if system font should be used. "swing.useSystemFontSettings" is the one for all Swing applications. "Application.useSystemFontSettings" is the one for a particular Swing application.

This method considers all the cases above. If JDK is 1.5 and above, this method will return true. If you are on Chinese, Japanese or Korean locale, it will return true. If "swing.useSystemFontSettings" property us true, it will return true. If "Application.useSystemFontSettings" property is true, it will return true. Otherwise, it will return false. All JIDE L&F considered the returned value and decide if Tahoma font should be used or not. true if the L&F should use system font.




synchonizeView
public static void synchonizeView(JViewport view1, JViewport view2, int orientation)(Code)

Parameters:
  view1 -
Parameters:
  view2 -
Parameters:
  orientation - JideSwingUtilities.synchronizeView(javax.swing.JViewport,javax.swing.JViewport,int)



synchronizeView
public static void synchronizeView(JViewport view1, JViewport view2, int orientation)(Code)
Synchonizes the two viewports. The view position in one view changes, the other view's view position will change too. Generally speaking, if you want the two viewports to synchronize vertically, they should have the same height. If horizonally, the same width.
Parameters:
  view1 - the first viewport
Parameters:
  view2 - the second viewport
Parameters:
  orientation - the orientation. It could be either SwingConstants.HORIZONTAL or SwingConstants.VERTICAL.



throwException
public static void throwException(Exception e)(Code)
Throws the exception. If the exception is RuntimeException, just throw it. Otherwise, wrap it in RuntimeException and throw it.
Parameters:
  e -



throwInvocationTargetException
public static void throwInvocationTargetException(InvocationTargetException e)(Code)
Throws the InvocationTargetException. Usually InvocationTargetException has a nested exception as target exception. If the target exception is a RuntimeException or Error, we will throw it. Otherwise, we will wrap it inside RuntimeException and throw it.
Parameters:
  e -



toggleRTLnLTR
public static void toggleRTLnLTR(Component topContainer)(Code)
Toggles between RTL and LTR.
Parameters:
  topContainer -



traceFocus
public static void traceFocus()(Code)
For internal usage only.



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.