| 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 | |
Method Summary | |
public static void | centerWindow(Window childToCenter) Center the component to it's parent window. | public static boolean | componentIsPermanentFocusOwner(Component comp) | public static boolean | compositeRequestFocus(Component component) Copied from BasicLookAndFeel as the method is package local. | public static boolean | containerContainsFocus(Container cont) | public static Vector | convertDefaultComboBoxModelToVector(DefaultComboBoxModel model) | public static JPanel | createBottomPanel(Component object) Create a Panel around a component so that
component aligns to buttom. | public static JPanel | createCenterPanel(Component object) Create a Panel around a component so that
component is right in the middle. | public static JPanel | createLeftPanel(Component object) Create a Panel around a component so that
component aligns to left. | public static JPanel | createRightPanel(Component object) Create a Panel around a component so that
component aligns to right. | public static JPanel | createTableModelModifier(DefaultTableModel tableModel) For internal usage only. | public static JPanel | createTopPanel(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 void | drawGrip(Graphics g, Rectangle rectangle, int maxLength, int maxThickness) | public static void | drawGrip(Graphics g, Rectangle rectangle, int maxLength, int maxThickness, boolean isSelected) | public static void | drawImageBorder(Graphics g, ImageIcon img, Rectangle rect, Insets ins, boolean drawCenter) Draws a border based on an image. | public static void | drawShadow(Graphics g, Component c, int x, int y, int w, int h) | public static void | drawString(JComponent c, Graphics g, String text, int x, int y) | public static void | drawStringUnderlineCharAt(JComponent c, Graphics g, String text, int underlinedIndex, int x, int y) | public static boolean | drawTextAntialiased(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 void | ensureRowVisible(JTable table, int row) To make sure the row is visible. | public static boolean | equals(Object o1, Object o2) Checks if the two objects equal. | public static boolean | equals(Object o1, Object o2, boolean considerArray) Checks if the two objects equal. | public static void | fillGradient(Graphics g, Rectangle rect, int orientation) | public static void | fillGradient(Graphics2D g2d, Shape s, Color startColor, Color endColor, boolean isVertical) Fills a gradient using the startColor and endColor specified. | public static void | fillNormalGradient(Graphics2D g2d, Shape s, Color startColor, Color endColor, boolean isVertical) | public static void | fillSingleGradient(Graphics g, Rectangle rect, int orientation) | public static void | fillSingleGradient(Graphics g, Rectangle rect, int orientation, int level) | public static int | findDisplayedMnemonicIndex(String text, int mnemonic) | public static Component | findSomethingFocusable(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 Object | getBoldFont(Toolkit toolkit, UIDefaults table) | public static int | getButtonState(AbstractButton b) | public static int[] | getButtonState(JideSplitButton b) | public static Object | getControlFont(Toolkit toolkit, UIDefaults table) | public static float | getDefaultFontSize() | public static Component | getDescendantOfClass(Class c, Container container) Gets the first occurence of the component with specified type in the container. | public static BufferedImage | getFasterScaledInstance(BufferedImage img, int targetWidth, int targetHeight, Object hint, boolean progressiveBilinear) Convenience method that returns a scaled instance of the
provided BufferedImage. | public static Component | getFirstChildOf(Class clazz, Component c) Gets the first child of the component that is the specified type. | public static Frame | getFrame(Component component) Gets the top level Frame of the component.
Parameters: component - the top level Frame. | public static Object | getMenuFont(Toolkit toolkit, UIDefaults table) | public static int | getOrientationOf(Component component) | public static JRootPane | getOutermostRootPane(Component c) If c is a JRootPane descendant return its outermost JRootPane ancestor. | public static Dimension | getPreferredButtonSize(AbstractButton b, int textIconGap, boolean isHorizontal) | public static Component | getRecursively(Component c, GetHandler handler) Gets to a child of a component recursively based on certain condition. | public static Component | getScrollPane(Component innerComponent) Gets the scroll pane around the component.
Parameters: innerComponent - the scroll pane. | public static Window | getTopModalDialog(Window w) Gets the top modal dialog of current window. | public static Window | getWindow(Component component) Gets the top level Window of the component.
Parameters: component - the top level Frame. | public static Window | getWindowForComponent(Component parentComponent) | public static void | globalCenterWindow(Window childToCenter) Center the window to the whole screen. | public static void | ignoreException(Exception e) Ignore the exception. | public static void | insertKeyListener(Component component, KeyListener l, int index) Inserts the key listener at the particular index in the listeners' chain. | public static void | insertMouseListener(Component component, MouseListener l, int index) Inserts the mouse listener at the particular index in the listeners' chain. | public static void | insertMouseMotionListener(Component component, MouseMotionListener l, int index) Inserts the mouse motion listener at the particular index in the listeners' chain. | public static void | installBorder(JComponent c, Border defaultBorder) | public static void | installColors(Component c, Color background, Color foreground) | public static void | installColorsAndFont(Component c, Color background, Color foreground, Font font) | public static void | installFont(Component c, Font font) | public static boolean | isAncestorOfFocusOwner(Component component) | public static boolean | isKeyListenerRegistered(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 boolean | isListenerRegistered(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 boolean | isListenerRegistered(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 boolean | isMouseListenerRegistered(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 boolean | isMouseMotionListenerRegistered(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 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) 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 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) 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 void | paintArrow(Graphics g, Color color, int startX, int startY, int width, int orientation) Paints an arrow shape. | public static void | paintBackground(Graphics g, Rectangle rect, Color border, Color bk) | public static void | paintBackground(Graphics2D g2d, Rectangle rect, Color border, Paint paint) | public static void | paintCross(Graphics g, Color color, int centerX, int centerY, int size, int width) Paints a cross shape. | public static boolean | passesFocusabilityTest(Component comp) There are four standard tests which determine if Swing will be able to
request focus for a component. | public static void | printException(Exception e) Prints out the message of the exception. | public static void | printUIDefaults() | public static void | registerTabKey(Container container) Register the tab key with the container. | public static void | restoreAntialiasing(Component c, Graphics g, Object oldHints) Restores the old setting for text anti-alias. | public static void | restoreDoubleBuffered(Component c, Map<Component, Boolean> map) Restores the double buffered flag of the component and its children. | public static void | restoreShapeAntialiasing(Graphics g, Object oldHints) Restores the old setting for shape anti-alias. | public static void | retargetMouseEvent(int id, MouseEvent e, Component target) | public static void | setChildrenOrientationOf(Container c, int orientation) | public static void | setEnabledRecursively(Component c, boolean enabled) Calls setEnabled method recursively on component. | public static void | setOpaqueRecursively(Component c, boolean opaque) Calls setOpaque method recursively on each component except
for JButton, JComboBox and JTextComponent. | public static void | setOrientationOf(Component component, int orientation) | public static void | setRecursively(Component c, Handler handler) Calls the handler recursively on a component. | public static void | setRequestFocusEnabledRecursively(Component c, boolean enabled) Calls setRequestFocusEnabled method recursively on component. | public static Object | setupAntialiasing(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 Object | setupShapeAntialiasing(Graphics g) Setups the graphics to draw shape using anti-alias.
Parameters: g - the old hints. | public static boolean | shouldUseSystemFont() 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 void | synchonizeView(JViewport view1, JViewport view2, int orientation) | public static void | synchronizeView(JViewport view1, JViewport view2, int orientation) Synchonizes the two viewports. | public static void | throwException(Exception e) Throws the exception. | public static void | throwInvocationTargetException(InvocationTargetException e) Throws the InvocationTargetException. | public static void | toggleRTLnLTR(Component topContainer) Toggles between RTL and LTR. | public static void | traceFocus() For internal usage only. |
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.
|
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? |
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 |
createTopPanel | public static JPanel createTopPanel(Component object)(Code) | | Create a Panel around a component so that
component aligns to top.
Parameters: object - a Panel |
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.
|
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. |
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(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 - |
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 |
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. |
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 . |
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. |
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 - |
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 - |
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 - |
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. |
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). |
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. |
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.
|
|
|