javax.swing

Class SwingUtilities

Implemented Interfaces:
SwingConstants

public class SwingUtilities
extends Object
implements SwingConstants

A collection of utility methods for Swing.

Fields inherited from interface javax.swing.SwingConstants

BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST

Method Summary

static @Deprecated
Component findFocusOwner(Component c)
Deprecated. As of 1.4, replaced by KeyboardFocusManager.getFocusOwner().
static Rectangle
calculateInnerArea(JComponent c, Rectangle r)
Stores the position and size of the inner painting area of the specified component in r and returns r.
static Rectangle[]
computeDifference(Rectangle rectA, Rectangle rectB)
Convenience returning an array of rect representing the regions within rectA that do not overlap with rectB.
static Rectangle
computeIntersection(int x, int y, int width, int height, Rectangle dest)
Convenience to calculate the intersection of two rectangles without allocating a new rectangle.
static int
computeStringWidth(FontMetrics fm, String str)
Compute the width of the string using a font with the specified "metrics" (sizes).
static Rectangle
computeUnion(int x, int y, int width, int height, Rectangle dest)
Convenience method that calculates the union of two rectangles without allocating a new rectangle.
static MouseEvent
convertMouseEvent(Component source, MouseEvent sourceEvent, Component destination)
Returns a MouseEvent similar to sourceEvent except that its x and y members have been converted to destination's coordinate system.
static Point
convertPoint(Component source, int x, int y, Component destination)
Convert the point (x,y) in source coordinate system to destination coordinate system.
static Point
convertPoint(Component source, Point aPoint, Component destination)
Convert a aPoint in source coordinate system to destination coordinate system.
static void
convertPointFromScreen(Point p, Component c)
Convert a point from a screen coordinates to a component's coordinate system
static void
convertPointToScreen(Point p, Component c)
Convert a point from a component's coordinate system to screen coordinates.
static Rectangle
convertRectangle(Component source, Rectangle aRectangle, Component destination)
Convert the rectangle aRectangle in source coordinate system to destination coordinate system.
static Accessible
getAccessibleAt(Component c, Point p)
Returns the Accessible child contained at the local coordinate Point, if one exists.
static Accessible
getAccessibleChild(Component c, int i)
Return the nth Accessible child of the object.
static int
getAccessibleChildrenCount(Component c)
Returns the number of accessible children in the object.
static int
getAccessibleIndexInParent(Component c)
Get the index of this object in its accessible parent.
static AccessibleStateSet
getAccessibleStateSet(Component c)
Get the state of this object.
static Container
getAncestorNamed(String name, Component comp)
Convenience method for searching above comp in the component hierarchy and returns the first object of name it finds.
static Container
getAncestorOfClass(Class c, Component comp)
Convenience method for searching above comp in the component hierarchy and returns the first object of class c it finds.
static Component
getDeepestComponentAt(Component parent, int x, int y)
Returns the deepest visible descendent Component of parent that contains the location x, y.
static Rectangle
getLocalBounds(Component aComponent)
Return the rectangle (0,0,bounds.width,bounds.height) for the component aComponent
static Component
getRoot(Component c)
Returns the root component for the current component tree.
static JRootPane
getRootPane(Component c)
If c is a JRootPane descendant return its JRootPane ancestor.
static ActionMap
getUIActionMap(JComponent component)
Returns the ActionMap provided by the UI in component component.
static InputMap
getUIInputMap(JComponent component, int condition)
Returns the InputMap provided by the UI for condition condition in component component.
static Window
getWindowAncestor(Component c)
Returns the first Window ancestor of c, or null if c is not contained inside a Window.
static void
invokeAndWait(Runnable doRun)
Causes doRun.run() to be executed synchronously on the AWT event dispatching thread.
static void
invokeLater(Runnable doRun)
Causes doRun.run() to be executed asynchronously on the AWT event dispatching thread.
static boolean
isDescendingFrom(Component a, Component b)
Return true if a component a descends from a component b
static boolean
isEventDispatchThread()
Returns true if the current thread is an AWT event dispatching thread.
static boolean
isLeftMouseButton(MouseEvent anEvent)
Returns true if the mouse event specifies the left mouse button.
static boolean
isMiddleMouseButton(MouseEvent anEvent)
Returns true if the mouse event specifies the middle mouse button.
static boolean
isRectangleContainingRectangle(Rectangle a, Rectangle b)
Return true if a contains b
static boolean
isRightMouseButton(MouseEvent anEvent)
Returns true if the mouse event specifies the right mouse button.
static String
layoutCompoundLabel(FontMetrics fm, String text, Icon icon, 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.
static String
layoutCompoundLabel(JComponent c, FontMetrics fm, String text, Icon icon, 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.
static boolean
notifyAction(Action action, KeyStroke ks, KeyEvent event, Object sender, int modifiers)
Invokes actionPerformed on action if action is enabled (and non null).
static void
paintComponent(Graphics g, Component c, Container p, int x, int y, int w, int h)
Paints a component c on an arbitrary graphics g in the specified rectangle, specifying the rectangle's upper left corner and size.
static void
paintComponent(Graphics g, Component c, Container p, Rectangle r)
Paints a component c on an arbitrary graphics g in the specified rectangle, specifying a Rectangle object.
static boolean
processKeyBindings(KeyEvent event)
Process the key bindings for the Component associated with event.
static void
replaceUIActionMap(JComponent component, ActionMap uiActionMap)
Convenience method to change the UI ActionMap for component to uiActionMap.
static void
replaceUIInputMap(JComponent component, int type, InputMap uiInputMap)
Convenience method to change the UI InputMap for component to uiInputMap.
static void
updateComponentTreeUI(Component c)
A simple minded look and feel change: ask each node in the tree to updateUI() -- that is, to initialize its UI property with the current look and feel.
static Window
windowForComponent(Component c)
Returns the first Window ancestor of c, or null if c is not contained inside a Window.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Details

Component findFocusOwner

public static @Deprecated Component findFocusOwner(Component c)

Deprecated. As of 1.4, replaced by KeyboardFocusManager.getFocusOwner().

Return the child Component of the specified Component that is the focus owner, if any.
Parameters:
c - the root of the Component hierarchy to search for the focus owner
Returns:
the focus owner, or null if there is no focus owner, or if the focus owner is not comp, or a descendant of comp

calculateInnerArea

public static Rectangle calculateInnerArea(JComponent c,
                                           Rectangle r)
Stores the position and size of the inner painting area of the specified component in r and returns r. The position and size specify the bounds of the component, adjusted so as not to include the border area (the insets). This method is useful for classes that implement painting code.
Parameters:
c - the JComponent in question; if null, this method returns null
r - the Rectangle instance to be modified; may be null
Returns:
null if the Component is null; otherwise, returns the passed-in rectangle (if non-null) or a new rectangle specifying position and size information
Since:
1.4
Usages and Demos :

View More Examples of calculateInnerArea(JComponent c,Rectangle r)
   1: import jp.ujihara.javax.swing.JPopupMenu;
   2: import jp.ujihara.javax.swing.SwingUtilities;
   3: import jp.ujihara.javax.swing.plaf.ComponentUI;
   4:         ...
   5:     Rectangle r = new Rectangle();
   6:     SwingUtilities.calculateInnerArea(c, r);
   7:     Color saved = g.getColor();
   8: 
   9:     int midAB = r.width / 2 + r.x;

View Full Code Here
   1: import jp.ujihara.javax.swing.JSeparator;
   2: import jp.ujihara.javax.swing.SwingUtilities;
   3: import jp.ujihara.javax.swing.UIDefaults;
   4:         ...
   5:     Rectangle r = new Rectangle();
   6:     SwingUtilities.calculateInnerArea(c, r);
   7:     Color saved = g.getColor();
   8:     
   9:     int midAB = r.width / 2 + r.x;

View Full Code Here
   1: import jp.ujihara.javax.swing.SwingConstants;
   2: import jp.ujihara.javax.swing.SwingUtilities;
   3: import jp.ujihara.javax.swing.UIDefaults;
   4:         ...
   5:     FontMetrics fm = tip.getToolkit().getFontMetrics(tip.getFont());
   6:     SwingUtilities.layoutCompoundLabel(tip, fm, tip.getTipText(), null,
   7:                                        SwingConstants.CENTER,
   8:         ...
   9:     Rectangle vr = new Rectangle();
  10:     vr = SwingUtilities.calculateInnerArea(tip, vr);
  11:     Rectangle ir = new Rectangle();
  12:         ...
  13:     FontMetrics fm = tip.getToolkit().getFontMetrics(tip.getFont());
  14:     SwingUtilities.layoutCompoundLabel(tip, fm, tip.getTipText(), null,

View Full Code Here
   1: import jp.ujihara.javax.swing.JComponent;
   2: import jp.ujihara.javax.swing.SwingUtilities;
   3: import jp.ujihara.javax.swing.UIDefaults;
   4:         ...
   5: 
   6:     SwingUtilities.calculateInnerArea(b, br);
   7:         ...
   8:     SwingUtilities.calculateInsetArea(br, b.getMargin(), vr);    
   9:         ...
  10:     String text = SwingUtilities.layoutCompoundLabel(c, g.getFontMetrics(f), 

View Full Code Here
   1: import jp.ujihara.javax.swing.JLabel;
   2: import jp.ujihara.javax.swing.SwingUtilities;
   3: import jp.ujihara.javax.swing.UIDefaults;
   4:         ...
   5: 
   6:     vr = SwingUtilities.calculateInnerArea(c, vr);
   7: 
   8:         ...
   9:   {
  10:     return SwingUtilities.layoutCompoundLabel(label, fontMetrics, text, icon,
  11:                                               label.getVerticalAlignment(),

View Full Code Here

computeDifference

public static Rectangle[] computeDifference(Rectangle rectA,
                                            Rectangle rectB)
Convenience returning an array of rect representing the regions within rectA that do not overlap with rectB. If the two Rects do not overlap, returns an empty array

computeIntersection

public static Rectangle computeIntersection(int x,
                                            int y,
                                            int width,
                                            int height,
                                            Rectangle dest)
Convenience to calculate the intersection of two rectangles without allocating a new rectangle. If the two rectangles don't intersect, then the returned rectangle begins at (0,0) and has zero width and height.
Parameters:
x - the X coordinate of the first rectangle's top-left point
y - the Y coordinate of the first rectangle's top-left point
width - the width of the first rectangle
height - the height of the first rectangle
dest - the second rectangle
Returns:
dest, modified to specify the intersection
Usages and Demos :

View More Examples of computeIntersection(int x,int y,int width,int height,Rectangle dest)
   1:     Rectangle bounds = originalClip.getBounds();
   2:     SwingUtilities.computeIntersection(x, y, width, height, bounds);
   3:     return bounds;
   4:   }
   5: }

View Full Code Here
   1: import javax.swing.JComponent;
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:                         int imageY = (component.getHeight() - imgHeight) / 2;
   6:                         Rectangle r = SwingUtilities.computeIntersection(imageX, imageY, imgWidth, imgHeight, clipRect);
   7:                         if (r.x == 0 && r.y == 0 && (r.width == 0 || r.height == 0)) {
   8:                             return;
   9:                         }

View Full Code Here
   1:             p = new Point(absBounds.x,absBounds.y);
   2:             SwingUtilities.convertPointFromScreen(p,comboBox);
   3:             absBounds.x = p.x;
   4:         ...
   5: 
   6:         if ( SwingUtilities.isRectangleContainingRectangle(absBounds,r) ) {
   7:             r.x = r.x + offset.x;
   8:         ...
   9:             Rectangle r2      = new Rectangle(0,-r.height,r.width,r.height);
  10:             if ( SwingUtilities.isRectangleContainingRectangle(absBounds,r2) ) {
  11:             r2.x = offset.x;
  12:         ...
  13:             if ( inModalDialog ) {
  14:             SwingUtilities.computeIntersection(absBounds.x,absBounds.y,absBounds.width,absBounds.height,r);

View Full Code Here
   1: import javax.swing.JLabel;
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:                     int imageY = (ph - imgHeight) / 2 + insets.top;
   6:                     Rectangle r = SwingUtilities.computeIntersection(imageX, imageY, imgWidth, imgHeight, clipRect);
   7:                     if (r.x == 0 && r.y == 0 && (r.width == 0 || r.height == 0)) {
   8:                         return;
   9:                     }

View Full Code Here

computeStringWidth

public static int computeStringWidth(FontMetrics fm,
                                     String str)
Compute the width of the string using a font with the specified "metrics" (sizes).
Parameters:
fm - a FontMetrics object to compute with
str - the String to compute
Returns:
an int containing the string width
Usages and Demos :

View More Examples of computeStringWidth(FontMetrics fm,String str)
   1: import javax.swing.JOptionPane;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.UIManager;
   4:         ...
   5:                 frameTitle = getTitle(frameTitle, fm, titleW);
   6:                 xOffset -= SwingUtilities.computeStringWidth(fm, frameTitle);
   7:             }
   8:         ...
   9: 
  10:             titleLength = SwingUtilities.computeStringWidth(fm, frameTitle);
  11:             g.drawString(frameTitle, xOffset, yOffset);

View Full Code Here
   1: import javax.swing.JTextArea;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.event.ChangeEvent;
   4:         ...
   5:             int width = DEFAULT_ICON.getIconWidth();
   6:             return Math.max(width, SwingUtilities.computeStringWidth(fontMetrics, userName));
   7:         }
   8: 
   9:         public int getIconHeight()

View Full Code Here
   1: import javax.swing.SwingConstants;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.plaf.LabelUI;
   4:         ...
   5:                 String clipString = "...";
   6:                 int totalWidth = SwingUtilities.computeStringWidth(fm, clipString);
   7:                 int nChars;
   8:         ...
   9:                 rettext = text[0].substring(0, nChars) + clipString;
  10:                 textR.width = SwingUtilities.computeStringWidth(fm, rettext);
  11:             }
  12:         ...
  13:         for (i = 0, c = strs.length; i < c; i++)
  14:             width = Math.max(width, SwingUtilities.computeStringWidth(fm, strs[i]));

View Full Code Here
   1:         String secondLine = title.substring(pos+1);
   2:         width += Math.max(SwingUtilities.computeStringWidth(metrics, firstLine),
   3:         ...
   4:             SwingUtilities.computeStringWidth(metrics, secondLine));
   5:         return width;
   6:         ...
   7:         textRect.x = textRect.y = iconRect.x = iconRect.y = 0;
   8:         SwingUtilities.layoutCompoundLabel(tabPane,
   9:             metrics, title, icon,

View Full Code Here
   1: import javax.swing.JSeparator;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.UIManager;
   4:         ...
   5: 
   6:         window = SwingUtilities.getWindowAncestor(this);
   7:         if (window != null)
   8:         ...
   9:             {
  10:                 xOffset -= SwingUtilities.computeStringWidth(fm, theTitle);
  11:             }
  12:         ...
  13:             int titleLength = SwingUtilities.computeStringWidth(fm, theTitle);

View Full Code Here

computeUnion

public static Rectangle computeUnion(int x,
                                     int y,
                                     int width,
                                     int height,
                                     Rectangle dest)
Convenience method that calculates the union of two rectangles without allocating a new rectangle.
Parameters:
x - the x-coordinate of the first rectangle
y - the y-coordinate of the first rectangle
width - the width of the first rectangle
height - the height of the first rectangle
dest - the coordinates of the second rectangle; the union of the two rectangles is returned in this rectangle
Returns:
the dest Rectangle
Usages and Demos :

View More Examples of computeUnion(int x,int y,int width,int height,Rectangle dest)
   1:     rect.setLocation( x, y );
   2:     SwingUtilities.computeUnion( rect.x, rect.y, rect.width, rect.height, unionRect );
   3:     mSlider.repaint( unionRect.x, unionRect.y, unionRect.width, unionRect.height );
   4:   }

View Full Code Here
   1: import java.util.Stack;
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:                         } else {
   6:                             SwingUtilities.computeUnion(rectangle1.x, rectangle1.y, rectangle1.width, rectangle1.height, rectangle);
   7:                         }
   8:                     }
   9:                 }

View Full Code Here
   1:     r.setBounds(textRect);
   2:     r = SwingUtilities.computeUnion(iconRect.x, iconRect.y, iconRect.width, iconRect.height, r);
   3: 
   4:         ...
   5: 
   6:         SwingUtilities.layoutCompoundLabel(
   7:                             menuItem, fm, text, icon, verticalAlignment,
   8:         ...
   9:         {
  10:             acceleratorRect.width = SwingUtilities.computeStringWidth( fmAccel, acceleratorText );
  11:             acceleratorRect.height = fmAccel.getHeight();

View Full Code Here
   1:                 Rectangle rectangle1 = getCellBounds(aobj[i]);
   2:                 SwingUtilities.computeUnion(rectangle1.x, rectangle1.y, rectangle1.width, rectangle1.height, rectangle);
   3:             }
   4: 
   5:             return rectangle;

View Full Code Here

convertMouseEvent

public static MouseEvent convertMouseEvent(Component source,
                                           MouseEvent sourceEvent,
                                           Component destination)
Returns a MouseEvent similar to sourceEvent except that its x and y members have been converted to destination's coordinate system. If source is null, sourceEvent x and y members are assumed to be into destination's root component coordinate system. If destination is null, the returned MouseEvent will be in source's coordinate system. sourceEvent will not be changed. A new event is returned. the source field of the returned event will be set to destination if destination is non null use the translateMouseEvent() method to translate a mouse event from one component to another without changing the source.
Usages and Demos :

View More Examples of convertMouseEvent(Component source,MouseEvent sourceEvent,Component destination)
   1: 
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         Component source = e.getComponent();
   6:         SwingUtilities.convertMouseEvent(source, e, w);
   7:         return e.getPoint();
   8:     }
   9: }

View Full Code Here
   1: import java.awt.event.MouseMotionListener;
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:                 Component appc = (Component)e.getSource();
   6:                 MouseEvent ne = SwingUtilities.convertMouseEvent(appc, e, cnt);
   7:                 fireMouseClicked(ne,appc);
   8:         ...
   9:                 Component appc = (Component)e.getSource();
  10:                 MouseEvent ne = SwingUtilities.convertMouseEvent(appc, e, cnt);
  11:                 fireMousePressed(ne,appc);
  12:         ...
  13:                 Component appc = (Component)e.getSource();
  14:                 MouseEvent ne = SwingUtilities.convertMouseEvent(appc, e, cnt);

View Full Code Here

convertPoint

public static Point convertPoint(Component source,
                                 int x,
                                 int y,
                                 Component destination)
Convert the point (x,y) in source coordinate system to destination coordinate system. If source>is null,(x,y) is assumed to be in destination's root component coordinate system. If destinationis null, (x,y) will be converted to source's root component coordinate system. If both source and destination are null, return (x,y) without any conversion.
Usages and Demos :

View More Examples of convertPoint(Component source,int x,int y,Component destination)
   1:     if (layeredPane != null) {
   2:       Point p = SwingUtilities.convertPoint((Component) e.getSource(), e.getPoint(), layeredPane);
   3:         ...
   4:       Point p2 = SwingUtilities.convertPoint(this.getParent(), getLocation(), layeredPane);
   5:       Dimension size = innerArea.getSize();
   6:         ...
   7:       Dimension minimumSize = getMinimumSize();
   8:       Point offset = SwingUtilities.convertPoint(innerArea, 0, 0, layeredPane);

View Full Code Here
   1:     Component r=s.getTopLevelAncestor();
   2:     Point     p=SwingUtilities.convertPoint(s,x,y,r);
   3:     Rectangle b=r.getBounds();
   4:         ...
   5:       {
   6:         q=SwingUtilities.convertPoint(d,q.x,q.y,c);
   7:         again=true;
   8: 

View Full Code Here
   1:     if (enabled && mousePressed) {
   2:       Point p = SwingUtilities.convertPoint((JComponent) e.getSource(), e.getPoint(), component);
   3:       if (dragStarted || enableInsideDrag || !component.contains(p)) {
   4:         ...
   5:     else if (!checkParentContains(
   6:         SwingUtilities.convertPoint((JComponent) e.getSource(), e.getPoint(), component.getParent()))) {
   7:       restoreComponentOrder();
   8:         ...
   9: 
  10:     Point p2 = SwingUtilities.convertPoint(component, p, parent);
  11:     int toIndex = getMoveComponentIndex(p2);
  12:         ...
  13:         fromDimension = fromComponent.getHeight();
  14:         toPos = (int) SwingUtilities.convertPoint(parent, p2, getComponent(parent, toIndex)).getY();

View Full Code Here
   1:     if (paintTabAreaShadow) {
   2:       Rectangle bounds = SwingUtilities.calculateInnerArea(componentsPanel, new Rectangle());
   3: 
   4:         ...
   5:   private int paintHighlightedTabShadow(Graphics g, Direction tabOrientation, Rectangle contentPanelBounds) {
   6:     Point p = SwingUtilities.convertPoint(highlightedTab.getParent(), highlightedTab.getLocation(), component);
   7: 
   8:         ...
   9:     Rectangle bounds = tabAreaComponentsPanel.isVisible() ?
  10:                        SwingUtilities.convertRectangle(tabAreaComponentsPanel.getParent(),
  11:                                                        tabAreaComponentsPanel.getBounds(),
  12:         ...
  13:                                      0);
  14:     Point tabsPos = SwingUtilities.convertPoint(tabBox, 0, 0, component);

View Full Code Here
   1: import jp.ujihara.javax.accessibility.Accessible;
   2: import jp.ujihara.javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         candidate =
   6:           SwingUtilities.getDeepestComponentAt(parent, p.x, p.y);
   7:         if (candidate == null || (candidate.eventMask & me.getID()) == 0)
   8:         ...
   9:           candidate = null;
  10:           p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent);
  11:           parent = parent.parent;
  12:         ...
  13:       {
  14:         if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer))

View Full Code Here

convertPoint

public static Point convertPoint(Component source,
                                 Point aPoint,
                                 Component destination)
Convert a aPoint in source coordinate system to destination coordinate system. If source>is null,aPoint is assumed to be in destination's root component coordinate system. If destinationis null, aPoint will be converted to source's root component coordinate system. If both source and destination are null, return aPoint without any conversion.
Usages and Demos :

View More Examples of convertPoint(Component source,Point aPoint,Component destination)
   1:         Point containerPoint = 
   2:             SwingUtilities.convertPoint(this, pt,contentPane);
   3:     
   4:         ...
   5:         Component component = SwingUtilities.getDeepestComponentAt(
   6:                     contentPane,
   7:         ...
   8:     
   9:         Point componentPoint = SwingUtilities.convertPoint(
  10:             this,

View Full Code Here
   1:     public void hierarchyChanged(final HierarchyEvent e) {
   2:       SwingUtilities.invokeLater(new Runnable() {
   3:         public void run() {
   4:         ...
   5:         else if (!((Component) event.getSource()).contains(event.getPoint())) {
   6:           final Point p = SwingUtilities.convertPoint((Component) event.getSource(), event.getPoint(), top);
   7:           if (!top.contains(p.x, p.y)) {
   8:         ...
   9:           else if (top instanceof Container) {
  10:             SwingUtilities.invokeLater(new Runnable() {
  11:               public void run() {
  12:         ...
  13:                     if (c != null) {
  14:                       Point p2 = SwingUtilities.convertPoint(top, p, c);

View Full Code Here
   1:             Point p = e.getPoint();
   2:             Point p2 = SwingUtilities.convertPoint(header, p, editorComponent);
   3:         ...
   4:             dispatchComponent = SwingUtilities.getDeepestComponentAt(editorComponent, p2.x, p2.y);
   5:          }
   6:         ...
   7: 
   8:             MouseEvent e2 = SwingUtilities.convertMouseEvent(header, e, dispatchComponent);
   9:             dispatchComponent.dispatchEvent(e2);
  10:         ...
  11:          {
  12:             if (!SwingUtilities.isLeftMouseButton(e))

View Full Code Here
   1:         ((RootPaneContainer) top).getLayeredPane().findComponentAt(
   2:             SwingUtilities.convertPoint(top, p, ((RootPaneContainer) top).getLayeredPane()));
   3:       else
   4:         c = ((Container) top).findComponentAt(p);
   5:     }

View Full Code Here
   1:                 p = e.getPoint();
   2:                 mp.setSelectedPoint(SwingUtilities.convertPoint(MButtonChanger.this, p, mp));
   3:             }
   4:         });
   5:         add(date, BorderLayout.CENTER);

View Full Code Here

convertPointFromScreen

public static void convertPointFromScreen(Point p,
                                          Component c)
Convert a point from a screen coordinates to a component's coordinate system
Parameters:
p - a Point object (converted to the new coordinate system)
c - a Component object
Usages and Demos :

View More Examples of convertPointFromScreen(Point p,Component c)
   1: 
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         Point p = (Point) e.getPoint().clone();
   6:         SwingUtilities.convertPointToScreen(p, c);
   7:         ...
   8:         SwingUtilities.convertPointFromScreen(p, glassPane);
   9:         glassPane.setPoint(p);

View Full Code Here
   1: 
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         Point p = (Point) e.getPoint().clone();
   6:         SwingUtilities.convertPointToScreen(p, c);
   7:         ...
   8:         SwingUtilities.convertPointFromScreen(p, glassPane);
   9: 
  10:         ...
  11:         Point p = (Point) e.getPoint().clone();
  12:         SwingUtilities.convertPointToScreen(p, c);

View Full Code Here
   1: 
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         Point p = (Point) e.getPoint().clone();
   6:         SwingUtilities.convertPointToScreen(p, c);
   7:         ...
   8:         SwingUtilities.convertPointFromScreen(p, glassPane);
   9: 
  10:         ...
  11:         Point p = (Point) e.getPoint().clone();
  12:         SwingUtilities.convertPointToScreen(p, c);

View Full Code Here
   1:         Point p = new Point(books[i].getLocation());
   2:         SwingUtilities.convertPointToScreen(p, books[i].getParent());
   3:         ...
   4:         SwingUtilities.convertPointFromScreen(p, glassPane);
   5:         glassPane.addSpotlight(p.x - 4, p.y - 4, 96, 152);
   6:     }

View Full Code Here
   1:             Point p = new Point(x,y);
   2:             SwingUtilities.convertPointFromScreen(p,parent);
   3:             return p;
   4:         }
   5:         else

View Full Code Here

convertPointToScreen

public static void convertPointToScreen(Point p,
                                        Component c)
Convert a point from a component's coordinate system to screen coordinates.
Parameters:
p - a Point object (converted to the new coordinate system)
c - a Component object
Usages and Demos :

View More Examples of convertPointToScreen(Point p,Component c)
   1: 
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         Point p = (Point) e.getPoint().clone();
   6:         SwingUtilities.convertPointToScreen(p, c);
   7:         ...
   8:         SwingUtilities.convertPointFromScreen(p, glassPane);
   9:         glassPane.setPoint(p);

View Full Code Here
   1: 
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         Point p = (Point) e.getPoint().clone();
   6:         SwingUtilities.convertPointToScreen(p, c);
   7:         ...
   8:         SwingUtilities.convertPointFromScreen(p, glassPane);
   9: 
  10:         ...
  11:         Point p = (Point) e.getPoint().clone();
  12:         SwingUtilities.convertPointToScreen(p, c);

View Full Code Here
   1: 
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         Point p = (Point) e.getPoint().clone();
   6:         SwingUtilities.convertPointToScreen(p, c);
   7:         ...
   8:         SwingUtilities.convertPointFromScreen(p, glassPane);
   9: 
  10:         ...
  11:         Point p = (Point) e.getPoint().clone();
  12:         SwingUtilities.convertPointToScreen(p, c);

View Full Code Here
   1:       Point ps= new Point(xs, ys);
   2:       SwingUtilities.convertPointToScreen(ps, (JComponent)_evt.getSource());
   3:       if (ps.x + mnSize.width > scSize.width)
   4:         xmn -= mnSize.width;
   5:       if (ps.y + mnSize.height > scSize.height)

View Full Code Here
   1: import javax.swing.RootPaneContainer;
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         Point location = contentPane.getLocation();
   6:         SwingUtilities.convertPointToScreen(location, contentPane);
   7:         Dimension size = contentPane.getSize();
   8:         Rectangle rectangle = new Rectangle(location.x, location.y, size.width, size.height);
   9:         

View Full Code Here

convertRectangle

public static Rectangle convertRectangle(Component source,
                                         Rectangle aRectangle,
                                         Component destination)
Convert the rectangle aRectangle in source coordinate system to destination coordinate system. If source>is null,aRectangle is assumed to be in destination's root component coordinate system. If destinationis null, aRectangle will be converted to source's root component coordinate system. If both source and destination are null, return aRectangle without any conversion.
Usages and Demos :

View More Examples of convertRectangle(Component source,Rectangle aRectangle,Component destination)
   1:     JComponent invoker=getTopComponent
   2:       (SwingUtilities.getDeepestComponentAt
   3:        (KorteMain.getInstance(),x,y));
   4:         ...
   5:         Rectangle rn =new Rectangle(_evt.getX(),_evt.getY(),0,0);
   6:         rn=SwingUtilities.convertRectangle(kmi,rn,mp);
   7:         kmi.setHighlightArea(rn);
   8:         ...
   9:     current_=getTopComponent
  10:       (SwingUtilities.getDeepestComponentAt
  11:        (KorteMain.getInstance(),x,y));
  12:         ...
  13:       position_=dt.getPosition(current_);
  14:       origin_=SwingUtilities.convertPoint

View Full Code Here
   1: import javax.swing.JComponent;
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:     {
   6:         return SwingUtilities.convertPoint(component,
   7:                                            ReferenceConstants.ORIGIN,
   8:         ...
   9:             Rectangle visibleRect = viewer.getVisibleRect();
  10:             visibleRect = SwingUtilities.convertRectangle(viewer, visibleRect, referencePanel);
  11:             ViewPoint globalAll = new ViewPoint(location);

View Full Code Here

getAccessibleAt

public static Accessible getAccessibleAt(Component c,
                                         Point p)
Returns the Accessible child contained at the local coordinate Point, if one exists. Otherwise returns null.
Returns:
the Accessible at the specified location, if it exists; otherwise null

getAccessibleChild

public static Accessible getAccessibleChild(Component c,
                                            int i)
Return the nth Accessible child of the object.

Note: as of the Java 2 platform v1.3, it is recommended that developers call Component.AccessibleAWTComponent.getAccessibleIndexInParent() instead of using this method.

Parameters:
i - zero-based index of child
Returns:
the nth Accessible child of the object

getAccessibleChildrenCount

public static int getAccessibleChildrenCount(Component c)
Returns the number of accessible children in the object. If all of the children of this object implement Accessible, than this method should return the number of children of this object.

Note: as of the Java 2 platform v1.3, it is recommended that developers call Component.AccessibleAWTComponent.getAccessibleIndexInParent() instead of using this method.

Returns:
the number of accessible children in the object.

getAccessibleIndexInParent

public static int getAccessibleIndexInParent(Component c)
Get the index of this object in its accessible parent.

Note: as of the Java 2 platform v1.3, it is recommended that developers call Component.AccessibleAWTComponent.getAccessibleIndexInParent() instead of using this method.

Returns:
-1 of this object does not have an accessible parent. Otherwise, the index of the child in its accessible parent.

getAccessibleStateSet

public static AccessibleStateSet getAccessibleStateSet(Component c)
Get the state of this object.

Note: as of the Java 2 platform v1.3, it is recommended that developers call Component.AccessibleAWTComponent.getAccessibleIndexInParent() instead of using this method.

Returns:
an instance of AccessibleStateSet containing the current state set of the object

getAncestorNamed

public static Container getAncestorNamed(String name,
                                         Component comp)
Convenience method for searching above comp in the component hierarchy and returns the first object of name it finds. Can return null, if name cannot be found.

getAncestorOfClass

public static Container getAncestorOfClass(Class c,
                                           Component comp)
Convenience method for searching above comp in the component hierarchy and returns the first object of class c it finds. Can return null, if a class c cannot be found.
Usages and Demos :

View More Examples of getAncestorOfClass(Class c,Component comp)
   1:             final JInternalFrame jif = (JInternalFrame)
   2:                SwingUtilities.getAncestorOfClass(JInternalFrame.class, FindView.this);
   3:             jif.dispose();
   4:          }
   5:       });

View Full Code Here
   1: import javax.swing.JScrollPane;
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:                         {
   6:                             Container refPanel = SwingUtilities.getAncestorOfClass(ReferencePanel.class, parent);
   7:                             if (refPanel != null)
   8:         ...
   9:                         {
  10:                             Container refPanel = SwingUtilities.getAncestorOfClass(ReferencePanel.class, parent);
  11:                             if (refPanel != null)

View Full Code Here
   1:             final JInternalFrame jif = (JInternalFrame)
   2:                   SwingUtilities.getAncestorOfClass(JInternalFrame.class, ParamListView.this);
   3: 
   4:         ...
   5:                {
   6:                   SwingUtilities.invokeLater(new Runnable()
   7:                      {
   8:         ...
   9:             final JInternalFrame jif = (JInternalFrame)
  10:             SwingUtilities.getAncestorOfClass(JInternalFrame.class, ParamListView.this);
  11:             jif.dispose();

View Full Code Here
   1:     {
   2:         return (ImageSlidesViewer) javax.swing.SwingUtilities.getAncestorOfClass(ImageSlidesViewer.class, this);
   3:     }
   4: 
   5:     public ImageViewer(IImage imageDoc)

View Full Code Here
   1: import javax.swing.JViewport;
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:     {
   6:         return (ReferencePanel) SwingUtilities.getAncestorOfClass(ReferencePanel.class, source);
   7:     }
   8: 
   9:     class ReferencingComponentChecker implements ContainerListener

View Full Code Here

getDeepestComponentAt

public static Component getDeepestComponentAt(Component parent,
                                              int x,
                                              int y)
Returns the deepest visible descendent Component of parent that contains the location x, y. If parent does not contain the specified location, then null is returned. If parent is not a container, or none of parent's visible descendents contain the specified location, parent is returned.
Parameters:
parent - the root component to begin the search
x - the x target location
y - the y target location
Usages and Demos :

View More Examples of getDeepestComponentAt(Component parent,int x,int y)
   1: import jp.ujihara.javax.accessibility.Accessible;
   2: import jp.ujihara.javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         candidate =
   6:           SwingUtilities.getDeepestComponentAt(parent, p.x, p.y);
   7:         if (candidate == null || (candidate.eventMask & me.getID()) == 0)
   8:         ...
   9:           candidate = null;
  10:           p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent);
  11:           parent = parent.parent;
  12:         ...
  13:       {
  14:         if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer))

View Full Code Here

getLocalBounds

public static Rectangle getLocalBounds(Component aComponent)
Return the rectangle (0,0,bounds.width,bounds.height) for the component aComponent

getRoot

public static Component getRoot(Component c)
Returns the root component for the current component tree.
Returns:
the first ancestor of c that's a Window or the last Applet ancestor
Usages and Demos :

View More Examples of getRoot(Component c)
   1: 
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         if (source instanceof Component) {
   6:             result = SwingUtilities.getRoot((Component)source);
   7:         } else if (source instanceof MenuComponent) {
   8:         ...
   9:             if (mParent instanceof Component) {
  10:                 result = SwingUtilities.getRoot((Component)mParent);
  11:             }

View Full Code Here
   1: import javax.swing.Icon;
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:    {
   6:       Component root = SwingUtilities.getRoot(c);
   7:       if (root instanceof Window)
   8:       {
   9:          ((Window) root).dispose();

View Full Code Here
   1: 
   2:       Component root = SwingUtilities.getRoot(c);
   3: 
   4:       if(root instanceof JFrame)
   5:       {

View Full Code Here
   1: import javax.swing.PopupFactory;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.event.DocumentEvent;
   4:         ...
   5:       owner.addComponentListener(this);      
   6:       Component root = SwingUtilities.getRoot(getDisplayOwner());
   7:       if (root != null)
   8:         ...
   9:       System.out.print("owner " + p + " to ");
  10:       SwingUtilities.convertPointToScreen(p, getDisplayOwner());
  11:       System.out.print(p);
  12:         ...
  13:       owner.removeComponentListener(this);
  14:       Component root = SwingUtilities.getRoot(getDisplayOwner());

View Full Code Here
   1: import javax.swing.JScrollPane;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.filechooser.FileFilter;
   4:         ...
   5:             final Component parent =
   6:                 SwingUtilities.getRoot(ParseTreeInfoPanel.this);
   7:             fc.showDialog(parent, "Open");
   8:         ...
   9:             final Component parent =
  10:                 SwingUtilities.getRoot(ParseTreeInfoPanel.this);
  11:             openFile(mCurrentFile, parent);
  12:         ...
  13:         };
  14:         SwingUtilities.invokeLater(showError);

View Full Code Here

getRootPane

public static JRootPane getRootPane(Component c)
If c is a JRootPane descendant return its JRootPane ancestor. If c is a RootPaneContainer then return its JRootPane.
Returns:
the JRootPane for Component c or null.
Usages and Demos :

View More Examples of getRootPane(Component c)
   1:       findDialog = new JDialog((Frame)
   2:                                SwingUtilities.
   3:                                getRootPane(szap).getParent(),"Find");
   4:         ...
   5:       findDialog.setLocationRelativeTo(
   6:         SwingUtilities.getRootPane(szap).getParent());
   7:       FindPanel fp = new FindPanel(szap,szap.getController());
   8:       findDialog.addWindowListener(new FindWindowListener());
   9:       findDialog.getContentPane().add(fp);

View Full Code Here
   1:             private void setDefaultButton() {
   2:                 SwingUtilities.getRootPane(buttonBarPanel).setDefaultButton(okButton);
   3:                 buttonBarPanel.removeAncestorListener(this);
   4:             }
   5:             public void ancestorAdded(javax.swing.event.AncestorEvent event) {

View Full Code Here
   1:             private void setDefaultButton() {
   2:                 SwingUtilities.getRootPane(OkCancelDeclarationPanel.this).setDefaultButton(getJButtonOk());
   3:                 removeAncestorListener(this);
   4:             }
   5:             public void ancestorAdded(AncestorEvent event) {

View Full Code Here

getUIActionMap

public static ActionMap getUIActionMap(JComponent component)
Returns the ActionMap provided by the UI in component component.

This will return null if the UI has not installed an ActionMap.

Since:
1.3

getUIInputMap

public static InputMap getUIInputMap(JComponent component,
                                     int condition)
Returns the InputMap provided by the UI for condition condition in component component.

This will return null if the UI has not installed a InputMap of the specified type.

Since:
1.3

getWindowAncestor

public static Window getWindowAncestor(Component c)
Returns the first Window ancestor of c, or null if c is not contained inside a Window.
Parameters:
c - Component to get Window ancestor of.
Returns:
the first Window ancestor of c, or null if c is not contained inside a Window.
Usages and Demos :

View More Examples of getWindowAncestor(Component c)
   1: import javax.swing.JPanel;
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:     public JFrame getFrame(){        
   6:         return (JFrame)SwingUtilities.getWindowAncestor(this);
   7:     }
   8:         
   9:     public Point getAppletLocationOnScreen(){

View Full Code Here
   1: import javax.swing.JProgressBar;
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         setSize(getSize().width * 2, getSize().height);
   6:         setLocationRelativeTo(SwingUtilities.getWindowAncestor(this));
   7: 
   8:         ...
   9:             {
  10:                 SwingUtilities.invokeLater(new Runnable()
  11:                 {
  12:         ...
  13:             {
  14:                 SwingUtilities.invokeLater(new Runnable()

View Full Code Here
   1: import javax.swing.JPanel;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.event.ChangeEvent;
   4:         ...
   5:     JFileChooser chooser = getResinHomeChooser();
   6:     int ret = chooser.showDialog(SwingUtilities.getWindowAncestor(this),
   7:                  "Choose Resin Home");
   8:         
   9:     if (ret == JFileChooser.APPROVE_OPTION)

View Full Code Here
   1: import javax.swing.PopupFactory;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.ToolTipManager;
   4:         ...
   5: 
   6:             Window ttip = SwingUtilities.getWindowAncestor(getParent());
   7:             if ( ttip == null || !ttip.isVisible() ) {
   8:         ...
   9:                     c, JCustomTooltip.this, point.x, point.y);
  10:             Window w = SwingUtilities.getWindowAncestor(JCustomTooltip.this);
  11:             w.addMouseListener(this);
  12:         ...
  13:             {
  14:                 Window w = SwingUtilities.getWindowAncestor(JCustomTooltip.this);

View Full Code Here
   1: import javax.swing.JWindow;
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:             if (newValue instanceof Component) {
   6:                 Window w = SwingUtilities.getWindowAncestor((Component) newValue);
   7:                 if (w != PopupWindow.this) {
   8:                     dispose();
   9:                 }

View Full Code Here

invokeAndWait

public static void invokeAndWait(Runnable doRun)
            throws InterruptedException,
                   InvocationTargetException
Causes doRun.run() to be executed synchronously on the AWT event dispatching thread. This call blocks until all pending AWT events have been processed and (then) doRun.run() returns. This method should be used when an application thread needs to update the GUI. It should'nt be called from the EventDispatchThread. Here's an example that creates a new application thread that uses invokeAndWait to print a string from the event dispatching thread and then, when that's finished, print a string from the application thread.
 final Runnable doHelloWorld = new Runnable() {
     public void run() {
         System.out.println("Hello World on " + Thread.currentThread());
     }
 };

 Thread appThread = new Thread() {
     public void run() {
         try {
             SwingUtilities.invokeAndWait(doHelloWorld);
         }
         catch (Exception e) {
             e.printStackTrace();
         }
         System.out.println("Finished on " + Thread.currentThread());
     }
 };
 appThread.start();
 
Note that if the Runnable.run method throws an uncaught exception (on the event dispatching thread) it's caught and rethrown, as an InvocationTargetException, on the caller's thread.

Additional documentation and examples for this method can be found in How to Use Threads, in The Java Tutorial.

As of 1.3 this method is just a cover for java.awt.EventQueue.invokeAndWait().

Throws:
InterruptedException - if we're interrupted while waiting for the event dispatching thread to finish excecuting doRun.run()
InvocationTargetException - if an exception is thrown while running doRun
Usages and Demos :

View More Examples of invokeAndWait(Runnable doRun)
   1:                 
   2:                 SwingUtilities.invokeAndWait(cact) ;
   3:             }
   4:             catch(Exception ex)
   5:             {

View Full Code Here
   1: 
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.JScrollPane;
   4:         ...
   5:     };
   6:     SwingUtilities.invokeLater(finisher);
   7:     }
   8:         ...
   9:     try {
  10:         SwingUtilities.invokeAndWait(errorDisplay);
  11:     } catch (Throwable e) {

View Full Code Here
   1: 
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         try {
   6:             SwingUtilities.invokeAndWait(adapter);
   7:         } catch (InterruptedException ex) {
   8:             throw new RuntimeException(ex);
   9:         } catch (InvocationTargetException ex) {

View Full Code Here
   1: import javax.swing.Action;
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:                             {
   6:                                 SwingUtilities.invokeAndWait(doFinished);
   7:                             }
   8:                             catch (InterruptedException ex)
   9:                             {

View Full Code Here
   1:         ErrorDisplay ed = new ErrorDisplay(errObjs);
   2:         if (SwingUtilities.isEventDispatchThread()) {
   3:         ed.run();
   4:         ...
   5:         try {
   6:             SwingUtilities.invokeAndWait(ed);
   7:         } catch (Exception e) {
   8:         ...
   9:         if (importController.importData(conflictImport)) {
  10:             SwingUtilities.invokeLater(finisher);
  11:         }

View Full Code Here

invokeLater

public static void invokeLater(Runnable doRun)
Causes doRun.run() to be executed asynchronously on the AWT event dispatching thread. This will happen after all pending AWT events have been processed. This method should be used when an application thread needs to update the GUI. In the following example the invokeLater call queues the Runnable object doHelloWorld on the event dispatching thread and then prints a message.
 Runnable doHelloWorld = new Runnable() {
     public void run() {
         System.out.println("Hello World on " + Thread.currentThread());
     }
 };

 SwingUtilities.invokeLater(doHelloWorld);
 System.out.println("This might well be displayed before the other message.");
 
If invokeLater is called from the event dispatching thread -- for example, from a JButton's ActionListener -- the doRun.run() will still be deferred until all pending events have been processed. Note that if the doRun.run() throws an uncaught exception the event dispatching thread will unwind (not the current thread).

Additional documentation and examples for this method can be found in How to Use Threads, in The Java Tutorial.

As of 1.3 this method is just a cover for java.awt.EventQueue.invokeLater().

Usages and Demos :

View More Examples of invokeLater(Runnable doRun)
   1: import javax.swing.UIManager;
   2: import javax.swing.SwingUtilities;
   3: import java.net.InetAddress;
   4:         ...
   5:       };
   6:       SwingUtilities.invokeLater(resetIt);
   7:   }
   8:         ...
   9:   };
  10:   SwingUtilities.invokeLater(addIt);
  11:  }
  12:         ...
  13:   };
  14:   SwingUtilities.invokeLater(removeIt);

View Full Code Here
   1:                 {
   2:                     javax.swing.SwingUtilities.invokeLater(ListScroller.this);
   3:                 }
   4:             }
   5:             );

View Full Code Here
   1: 
   2:     SwingUtilities.invokeLater(new disposeIt(this));
   3: 
   4:         ...
   5:       };
   6:       SwingUtilities.invokeLater(resetIt);
   7:   }
   8:         ...
   9:     };
  10:     SwingUtilities.invokeLater(addIt);
  11:   }
  12:         ...
  13:     };
  14:     SwingUtilities.invokeLater(removeIt);

View Full Code Here
   1:           arrayDirectories.setFid(fid);
   2:           SwingUtilities.invokeLater(arrayDirectories);
   3:         }
   4:         ...
   5:             arraySortFiles[i].setFid(fid);
   6:             SwingUtilities.invokeLater(arraySortFiles[i]);
   7:           }
   8:         ...
   9:           arrayFiles.setFid(fid);
  10:           SwingUtilities.invokeLater(arrayFiles);
  11:         }

View Full Code Here
   1:     public void run() {
   2:       ld = new JDialog((JFrame)SwingUtilities.getAncestorOfClass(ApolloFrame.class,szap),"Loading sequence");
   3:         ...
   4:       ld.setLocationRelativeTo(SwingUtilities.getRootPane(szap).getParent());
   5:       JPanel p = new JPanel();
   6:         ...
   7:     if (evt.getType() == LazyLoadEvent.BEFORE_LOAD) {
   8:       if (!SwingUtilities.isEventDispatchThread()) {
   9:         ...
  10:         SwingUtilities.invokeLater(beforeLazyLoad);

View Full Code Here

isDescendingFrom

public static boolean isDescendingFrom(Component a,
                                       Component b)
Return true if a component a descends from a component b

isEventDispatchThread

public static boolean isEventDispatchThread()
Returns true if the current thread is an AWT event dispatching thread.

As of 1.3 this method is just a cover for java.awt.EventQueue.isDispatchThread().

Returns:
true if the current thread is an AWT event dispatching thread
Usages and Demos :

View More Examples of isEventDispatchThread()
   1:   {
   2:     FuLog.debug("JSH: eval task swing="+SwingUtilities.isEventDispatchThread());
   3: 
   4:     int r=0;

View Full Code Here
   1: 
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         if (! isNotifyOnEDT()
   6:             || SwingUtilities.isEventDispatchThread()) {
   7:             super.firePropertyChange(evt);
   8:         ...
   9:         } else {
  10:             SwingUtilities.invokeLater(
  11:                 new Runnable() {

View Full Code Here
   1: 
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         if (! isNotifyOnEDT()
   6:             || SwingUtilities.isEventDispatchThread()) {
   7:             super.firePropertyChange(evt);
   8:         ...
   9:         } else {
  10:             SwingUtilities.invokeLater(
  11:                 new Runnable() {

View Full Code Here
   1: import javax.swing.ListModel;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.event.ListDataEvent;
   4:         ...
   5:    {
   6:       assert SwingUtilities.isEventDispatchThread();
   7:       ListDataEvent evt = 
   8:          new ListDataEvent(me, eventType, index0, index1);
   9:       for (int i = 0; i < ldls.length; i++)

View Full Code Here
   1: 
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.event.TableModelEvent;
   4:         ...
   5:       {
   6:          assert SwingUtilities.isEventDispatchThread();
   7:          fireTableEvent(this, ls, firstrow, lastrow, column, type);
   8:       }
   9:    }

View Full Code Here

isLeftMouseButton

public static boolean isLeftMouseButton(MouseEvent anEvent)
Returns true if the mouse event specifies the left mouse button.
Parameters:
anEvent - a MouseEvent object
Returns:
true if the left mouse button was active
Usages and Demos :

View More Examples of isLeftMouseButton(MouseEvent anEvent)
   1: 
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         if ( item instanceof NodeItem && 
   6:              SwingUtilities.isLeftMouseButton(e))
   7:         {
   8:             final FocusManager focusManager = registry.getFocusManager();
   9:             final FocusSet focusSet = focusManager.getFocusSet(focusKey);

View Full Code Here
   1: import javax.swing.Icon;
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:     private boolean isOnlyLeftMouseButton(MouseEvent e) {
   6:         return SwingUtilities.isLeftMouseButton(e) &&
   7:         ...
   8:         !SwingUtilities.isRightMouseButton(e);
   9:     }

View Full Code Here
   1: 
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.event.MouseInputListener;
   4:         ...
   5:         if (table.isPointSelected(e.getPoint()) &&
   6:             SwingUtilities.isLeftMouseButton(e) ) {
   7:             dndArmed = true;
   8:             e.consume();
   9:             delegate.mousePressed(e);

View Full Code Here
   1: 
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         if ( isAllowedType(item) && ccount > 0 && 
   6:              SwingUtilities.isLeftMouseButton(e)    && 
   7:              e.getClickCount() == ccount )
   8:         {
   9:             Entity focus = item.getEntity();

View Full Code Here
   1: 
   2: import javax.swing.SwingUtilities;
   3: 
   4: import edu.umd.cs.piccolo.PCamera;
   5: import edu.umd.cs.piccolo.PComponent;

View Full Code Here

isMiddleMouseButton

public static boolean isMiddleMouseButton(MouseEvent anEvent)
Returns true if the mouse event specifies the middle mouse button.
Parameters:
anEvent - a MouseEvent object
Returns:
true if the middle mouse button was active
Usages and Demos :

View More Examples of isMiddleMouseButton(MouseEvent anEvent)
   1: 
   2: import javax.swing.SwingUtilities;
   3: 
   4: import edu.umd.cs.piccolo.PCamera;
   5: import edu.umd.cs.piccolo.PComponent;

View Full Code Here

isRectangleContainingRectangle

public static final boolean isRectangleContainingRectangle(Rectangle a,
                                                           Rectangle b)
Return true if a contains b

isRightMouseButton

public static boolean isRightMouseButton(MouseEvent anEvent)
Returns true if the mouse event specifies the right mouse button.
Parameters:
anEvent - a MouseEvent object
Returns:
true if the right mouse button was active
Usages and Demos :

View More Examples of isRightMouseButton(MouseEvent anEvent)
   1: 
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:     protected boolean isPopupTrigger(MouseEvent e) {
   6:         return SwingUtilities.isRightMouseButton(e) && !e.isShiftDown();
   7:     }
   8:     public void mousePressed(MouseEvent e) {
   9:         if ( !isPopupTrigger(e) )

View Full Code Here
   1: import javax.swing.Icon;
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:         try {
   6:             double zoomFactor = SwingUtilities.isRightMouseButton(e)
   7:                 ? (1 / ZOOM_IN_FACTOR) : ZOOM_IN_FACTOR;
   8:         ...
   9:         try {
  10:             if (SwingUtilities.isLeftMouseButton(e)) {
  11:                 super.mousePressed(e);

View Full Code Here
   1:                 {
   2:                     mouseEvent(e.getPoint(), e.isControlDown(), SwingUtilities.isRightMouseButton(e));
   3:                 }
   4:             }
   5:     );

View Full Code Here
   1:                 {
   2:                     mouseEvent(e.getPoint(), e.isControlDown(), SwingUtilities.isRightMouseButton(e));
   3:                 }
   4:             }
   5:         );

View Full Code Here
   1: 
   2: import javax.swing.SwingUtilities;
   3: 
   4: import edu.umd.cs.piccolo.PCamera;
   5: import edu.umd.cs.piccolo.PComponent;

View Full Code Here

layoutCompoundLabel

public static String layoutCompoundLabel(FontMetrics fm,
                                         String text,
                                         Icon icon,
                                         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. 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.

layoutCompoundLabel

public static String layoutCompoundLabel(JComponent c,
                                         FontMetrics fm,
                                         String text,
                                         Icon icon,
                                         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. 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.

notifyAction

public static boolean notifyAction(Action action,
                                   KeyStroke ks,
                                   KeyEvent event,
                                   Object sender,
                                   int modifiers)
Invokes actionPerformed on action if action is enabled (and non null). The command for the ActionEvent is determined by:
  1. If the action was registered via registerKeyboardAction, then the command string passed in (null will be used if null was passed in).
  2. Action value with name Action.ACTION_COMMAND_KEY, unless null.
  3. String value of the KeyEvent, unless getKeyChar returns KeyEvent.CHAR_UNDEFINED..
This will return true if action is non-null and actionPerformed is invoked on it.
Since:
1.3

paintComponent

public static void paintComponent(Graphics g,
                                  Component c,
                                  Container p,
                                  int x,
                                  int y,
                                  int w,
                                  int h)
Paints a component c on an arbitrary graphics g in the specified rectangle, specifying the rectangle's upper left corner and size. The component is reparented to a private container (whose parent becomes p) which prevents c.validate() and c.repaint() calls from propagating up the tree. The intermediate container has no other effect.

The component should either descend from JComponent or be another kind of lightweight component. A lightweight component is one whose "lightweight" property (returned by the Component isLightweight method) is true. If the Component is not lightweight, bad things map happen: crashes, exceptions, painting problems...

Parameters:
g - the Graphics object to draw on
c - the Component to draw
p - the intermediate Container
x - an int specifying the left side of the area draw in, in pixels, measured from the left edge of the graphics context
y - an int specifying the top of the area to draw in, in pixels measured down from the top edge of the graphics context
w - an int specifying the width of the area draw in, in pixels
h - an int specifying the height of the area draw in, in pixels

paintComponent

public static void paintComponent(Graphics g,
                                  Component c,
                                  Container p,
                                  Rectangle r)
Paints a component c on an arbitrary graphics g in the specified rectangle, specifying a Rectangle object. The component is reparented to a private container (whose parent becomes p) which prevents c.validate() and c.repaint() calls from propagating up the tree. The intermediate container has no other effect.

The component should either descend from JComponent or be another kind of lightweight component. A lightweight component is one whose "lightweight" property (returned by the Component isLightweight method) is true. If the Component is not lightweight, bad things map happen: crashes, exceptions, painting problems...

Parameters:
g - the Graphics object to draw on
c - the Component to draw
p - the intermediate Container
r - the Rectangle to draw in
Usages and Demos :

View More Examples of paintComponent(Graphics g,Component c,Container p,Rectangle r)
   1: import javax.swing.JTree;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.event.MouseInputAdapter;
   4:         ...
   5:             c.setFont(tree.getFont());
   6:             Rectangle paintBounds = SwingUtilities.convertRectangle(tree,
   7:                     bounds, this);
   8:         ...
   9:             SwingUtilities.paintComponent(g, renderer, this, paintBounds);
  10:             if (selected)

View Full Code Here
   1: import javax.swing.SwingConstants;
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5: 
   6:                 SwingUtilities.paintComponent(g2d, component, this, rectangle);
   7: 
   8:         ...
   9:             } else
  10:                 SwingUtilities.paintComponent(g2d, component, this, rectangle);

View Full Code Here
   1: import javax.swing.SwingConstants;
   2: import javax.swing.SwingUtilities;
   3: public class HexagonalTilesPanel extends JPanel implements Scrollable {
   4:         ...
   5:         }
   6:         SwingUtilities.paintComponent(g2d, component, this, polygonBounds);
   7:         if ((component instanceof JComponent) && wasDoubleBuffered) {
   8:             ((JComponent)component).setDoubleBuffered(true);
   9:         }

View Full Code Here
   1: import jp.ujihara.javax.swing.SwingConstants;
   2: import jp.ujihara.javax.swing.SwingUtilities;
   3: import jp.ujihara.javax.swing.UIDefaults;
   4:         ...
   5:     title.setText(getTitle(frame.getTitle(), fm, title.getBounds().width));
   6:     SwingUtilities.paintComponent(g, title, null, title.getBounds());
   7:     g.setColor(saved);
   8:         ...
   9:     Rectangle tr = new Rectangle();
  10:     String value = SwingUtilities.layoutCompoundLabel(this, fm, text, null,
  11:                                                       SwingConstants.CENTER,

View Full Code Here
   1: import jp.ujihara.javax.swing.JSlider;
   2: import jp.ujihara.javax.swing.SwingUtilities;
   3: import jp.ujihara.javax.swing.Timer;
   4:         ...
   5:     insetCache = slider.getInsets();
   6:     focusRect = SwingUtilities.calculateInnerArea(slider, focusRect);
   7: 
   8:         ...
   9:     label.setBounds(xpos, ypos, w, h);
  10:     jp.ujihara.javax.swing.SwingUtilities.paintComponent(g, label, null, label.getBounds());
  11:   }
  12:         ...
  13:     label.setBounds(xpos, ypos, w, h);
  14:     jp.ujihara.javax.swing.SwingUtilities.paintComponent(g, label, null, label.getBounds());

View Full Code Here

processKeyBindings

public static boolean processKeyBindings(KeyEvent event)
Process the key bindings for the Component associated with event. This method is only useful if event.getComponent() does not descend from JComponent, or your are not invoking super.processKeyEvent from within your JComponent subclass. JComponent automatically processes bindings from within its processKeyEvent method, hence you rarely need to directly invoke this method.
Parameters:
event - KeyEvent used to identify which bindings to process, as well as which Component has focus.
Returns:
true if a binding has found and processed
Since:
1.4
Usages and Demos :

View More Examples of processKeyBindings(KeyEvent event)
   1:         }finally{
   2:             SwingUtilities.invokeLater(new Runnable() {
   3:                 public void run() {
   4:         ...
   5:         KeyEvent aa =new KeyEvent(jtxt,evt.getID(),evt.getWhen(),evt.getModifiers(),evt.getKeyCode(),evt.getKeyChar(),evt.getKeyLocation());
   6:         return SwingUtilities.processKeyBindings(aa);
   7:     }
   8:         ...
   9:                 if (me.getButton()==MouseEvent.BUTTON1){
  10:                     Component dispatchComponent = SwingUtilities.getDeepestComponentAt(
  11:                             this, me.getX(), me.getY());

View Full Code Here

replaceUIActionMap

public static void replaceUIActionMap(JComponent component,
                                      ActionMap uiActionMap)
Convenience method to change the UI ActionMap for component to uiActionMap. If uiActionMap is null, this removes any previously installed UI ActionMap.
Since:
1.3
Usages and Demos :

View More Examples of replaceUIActionMap(JComponent component,ActionMap uiActionMap)
   1: import javax.swing.JComponent;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.UIManager;
   4:         ...
   5:         }
   6:         SwingUtilities.replaceUIActionMap(c, map);
   7:     }
   8: 
   9:     static ActionMap getActionMap(Class loaderClass, String defaultsKey) {

View Full Code Here
   1: import javax.swing.LookAndFeel;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.UIManager;
   4:         ...
   5:       window = (parentComponent instanceof Window)?(Window)parentComponent
   6:         :SwingUtilities.getWindowAncestor(parentComponent);
   7:     }
   8:         ...
   9:     if (map != null) {
  10:       SwingUtilities.replaceUIActionMap(tipPane, map);
  11:     }

View Full Code Here
   1:     fc.removePropertyChangeListener(model);
   2:     SwingUtilities.replaceUIInputMap(fc, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null);
   3:         ...
   4:     SwingUtilities.replaceUIActionMap(fc, null);
   5:     fc.removeAncestorListener(ancestorListener);
   6:         ...
   7:     InputMap inputMap = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
   8:     SwingUtilities.replaceUIInputMap(fc, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, inputMap);
   9:     ActionMap actionMap = getActionMap();
  10:         ...
  11:     SwingUtilities.replaceUIActionMap(fc, actionMap);

View Full Code Here
   1: import javax.swing.LookAndFeel;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.UIManager;
   4:         ...
   5:     if (inputMap != null) {
   6:       SwingUtilities.replaceUIInputMap(
   7:         group,
   8:         ...
   9:     if (map != null) {
  10:       SwingUtilities.replaceUIActionMap(group, map);
  11:     }
  12:         ...
  13:   protected void ensureVisible() {
  14:     SwingUtilities.invokeLater(new Runnable() {

View Full Code Here
   1: import javax.swing.LookAndFeel;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.UIManager;
   4:         ...
   5:     if (inputMap != null) {
   6:       SwingUtilities.replaceUIInputMap(
   7:         group,
   8:         ...
   9:     if (map != null) {
  10:       SwingUtilities.replaceUIActionMap(group, map);
  11:     }
  12:         ...
  13:   protected void ensureVisible() {
  14:     SwingUtilities.invokeLater(new Runnable() {

View Full Code Here

replaceUIInputMap

public static void replaceUIInputMap(JComponent component,
                                     int type,
                                     InputMap uiInputMap)
Convenience method to change the UI InputMap for component to uiInputMap. If uiInputMap is null, this removes any previously installed UI InputMap.
Since:
1.3
Usages and Demos :

View More Examples of replaceUIInputMap(JComponent component,int type,InputMap uiInputMap)
   1:     fc.removePropertyChangeListener(model);
   2:     SwingUtilities.replaceUIInputMap(fc, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null);
   3:         ...
   4:     SwingUtilities.replaceUIActionMap(fc, null);
   5:     fc.removeAncestorListener(ancestorListener);
   6:         ...
   7:     InputMap inputMap = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
   8:     SwingUtilities.replaceUIInputMap(fc, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, inputMap);
   9:     ActionMap actionMap = getActionMap();
  10:         ...
  11:     SwingUtilities.replaceUIActionMap(fc, actionMap);

View Full Code Here
   1: 
   2:       SwingUtilities.replaceUIInputMap(list, JComponent.WHEN_FOCUSED, inputMap);
   3:       LazyActionMap.installLazyActionMap(list, BasicGridListUI.class, "GridList.actionMap");
   4:         ...
   5:    {
   6:       SwingUtilities.replaceUIActionMap(list, null);
   7:         ...
   8:       SwingUtilities.replaceUIInputMap(list, JComponent.WHEN_FOCUSED, null);
   9:    }
  10:         ...
  11:             InputMap inputMap = getInputMap(JComponent.WHEN_FOCUSED);
  12:             SwingUtilities.replaceUIInputMap(list, JComponent.WHEN_FOCUSED,

View Full Code Here
   1: import javax.swing.KeyStroke;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.Timer;
   4:         ...
   5:         InputMap km = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
   6:         SwingUtilities.replaceUIInputMap(graph,
   7:                 JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, km);
   8:         ...
   9:         km = getInputMap(JComponent.WHEN_FOCUSED);
  10:         SwingUtilities.replaceUIInputMap(graph, JComponent.WHEN_FOCUSED, km);
  11:         ...
  12:         SwingUtilities.replaceUIActionMap(graph, createActionMap());

View Full Code Here
   1: import javax.swing.KeyStroke;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.Timer;
   4:         ...
   5:             if (destination != null) {
   6:                 destination.dispatchEvent(SwingUtilities.convertMouseEvent(
   7:                         source, mouseevent, destination));
   8:         ...
   9:             if (destination != null) {
  10:                 destination.dispatchEvent(SwingUtilities.convertMouseEvent(
  11:                         source, mouseevent, destination));
  12:         ...
  13:         InputMap inputmap = getInputMap(1);
  14:         SwingUtilities.replaceUIInputMap(graph, 1, inputmap);

View Full Code Here

updateComponentTreeUI

public static void updateComponentTreeUI(Component c)
A simple minded look and feel change: ask each node in the tree to updateUI() -- that is, to initialize its UI property with the current look and feel.
Usages and Demos :

View More Examples of updateComponentTreeUI(Component c)
   1:                   UIManager.setLookAndFeel(plafName);
   2:                   SwingUtilities.updateComponentTreeUI(PlafPanel.this);
   3:                }
   4:                catch(Exception e) { e.printStackTrace(); }
   5:             }

View Full Code Here
   1:           catch (Exception e) { System.out.println(e); }
   2:           SwingUtilities.updateComponentTreeUI(QuickChange.this);
   3:         }
   4:       });
   5:       buttonGroup.add(item);

View Full Code Here
   1: import javax.swing.JPanel;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.WindowConstants;
   4:         ...
   5:         
   6:                     SwingUtilities.updateComponentTreeUI(LionShareGUIMediator.getAppFrame());
   7:         
   8:                     updateThemeObservers();
   9:                     LionShareGUIMediator.setAppVisible(true);

View Full Code Here
   1:               public void actionPerformed(ActionEvent e) {
   2:                   SwingUtilities.updateComponentTreeUI(ScribbleApp.this);
   3:               }
   4:            }));

View Full Code Here
   1:   protected void setTheme(final javax.swing.plaf.metal.MetalTheme t) {
   2:     SwingUtilities.invokeLater(new Runnable() {
   3:       public void run() {
   4:         ...
   5:           UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
   6:           SwingUtilities.updateComponentTreeUI(ApplicationFrame.this);
   7:         } catch (Exception e) {
   8:           System.out.println("Error whilst setting theme.");
   9:         }

View Full Code Here

windowForComponent

public static Window windowForComponent(Component c)
Returns the first Window ancestor of c, or null if c is not contained inside a Window.

Note: This method provides the same functionality as getWindowAncestor.

Parameters:
c - Component to get Window ancestor of.
Returns:
the first Window ancestor of c, or null if c is not contained inside a Window.
Usages and Demos :

View More Examples of windowForComponent(Component c)
   1:     ApolloFrame win = (ApolloFrame)
   2:                       SwingUtilities.windowForComponent(ap);
   3: 
   4:     colouring = add(view.getColouringAction());
   5:   }

View Full Code Here
   1:     ApolloFrame win = (ApolloFrame)
   2:                       SwingUtilities.windowForComponent(ap);
   3:     colour          = new JMenuItem("Plot colour ...");
   4:     windowSize      = new JMenuItem("Plot window length ...");

View Full Code Here
   1: import javax.swing.JTextArea;
   2: import javax.swing.SwingUtilities;
   3: import javax.swing.border.BevelBorder;
   4:         ...
   5:     public static Window getOwner(Component aComponent) {
   6:         return SwingUtilities.windowForComponent(aComponent);
   7:     }
   8: }

View Full Code Here
   1: import javax.swing.JPanel;
   2: import javax.swing.SwingUtilities;
   3: 
   4:         ...
   5:     void changeButton_actionPerformed(ActionEvent e) {
   6:         Color newColor = JColorChooser.showDialog(SwingUtilities.windowForComponent(this), "Choose Colour", color);
   7: 
   8:         if (newColor == null) {
   9:             return;

View Full Code Here
   1:     ApolloFrame win = (ApolloFrame)
   2:                       SwingUtilities.windowForComponent(panel);
   3:     adapter = win.getAdapter();
   4: 
   5:     featureSetIds = getFeatureSets(selection.getSelectedData());

View Full Code Here