/[classpath]/classpath/java/awt/Window.java
ViewVC logotype

Diff of /classpath/java/awt/Window.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.38 by mkoch, Tue Nov 16 09:59:11 2004 UTC revision 1.39 by mark, Sat Dec 11 08:20:49 2004 UTC
# Line 731  public class Window extends Container im Line 731  public class Window extends Container im
731      return super.isShowing();      return super.isShowing();
732    }    }
733    
734      public void setLocationRelativeTo (Component c)
735      {
736        if (c == null || !c.isShowing ())
737          {
738            int x = 0;
739            int y = 0;
740    
741            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment ();
742            Point center = ge.getCenterPoint ();
743            x = center.x - (width / 2);
744            y = center.y - (height / 2);
745            setLocation (x, y);
746          }
747        // FIXME: handle case where component is non-null.
748      }
749    
750    /**    /**
751     * @since 1.2     * @since 1.2
752     *     *
# Line 866  public class Window extends Container im Line 882  public class Window extends Container im
882      this.y = y;      this.y = y;
883      width = w;      width = w;
884      height = h;      height = h;
885      if (resized)      if (resized && isShowing ())
886        {        {
887          ComponentEvent ce =          ComponentEvent ce =
888            new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED);            new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED);
889          getToolkit().getSystemEventQueue().postEvent(ce);          getToolkit().getSystemEventQueue().postEvent(ce);
890        }        }
891      if (moved)      if (moved && isShowing ())
892        {        {
893          ComponentEvent ce =          ComponentEvent ce =
894            new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED);            new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED);

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26