Exemplo n.º 1
0
  // WComponentPeer overrides
  @SuppressWarnings("unchecked")
  protected void disposeImpl() {
    AppContext appContext = SunToolkit.targetToAppContext(target);
    synchronized (appContext) {
      List<WWindowPeer> l = (List<WWindowPeer>) appContext.get(ACTIVE_WINDOWS_KEY);
      if (l != null) {
        l.remove(this);
      }
    }

    // Remove ourself from the Map of DisplayChangeListeners
    GraphicsConfiguration gc = getGraphicsConfiguration();
    ((Win32GraphicsDevice) gc.getDevice()).removeDisplayChangedListener(this);

    synchronized (getStateLock()) {
      TranslucentWindowPainter currentPainter = painter;
      if (currentPainter != null) {
        currentPainter.flush();
        // don't set the current one to null here; reduces the chances of
        // MT issues (like NPEs)
      }
    }

    super.disposeImpl();
  }
Exemplo n.º 2
0
 @Override
 public void setBackground(Color c) {
   super.setBackground(c);
   synchronized (getStateLock()) {
     if (!isOpaque && ((Window) target).isVisible()) {
       updateWindow(true);
     }
   }
 }
Exemplo n.º 3
0
  @Override
  public void setBounds(int x, int y, int width, int height, int op) {
    sysX = x;
    sysY = y;
    sysW = width;
    sysH = height;

    super.setBounds(x, y, width, height, op);
  }
Exemplo n.º 4
0
 public void hide() {
   WindowListener listener = windowListener;
   if (listener != null) {
     // We're not getting WINDOW_CLOSING from the native code when hiding
     // the window programmatically. So, create it and notify the listener.
     listener.windowClosing(new WindowEvent((Window) target, WindowEvent.WINDOW_CLOSING));
   }
   super.hide();
 }
Exemplo n.º 5
0
 @Override
 public void print(Graphics g) {
   // We assume we print the whole frame,
   // so we expect no clip was set previously
   Shape shape = AWTAccessor.getWindowAccessor().getShape((Window) target);
   if (shape != null) {
     g.setClip(shape);
   }
   super.print(g);
 }
Exemplo n.º 6
0
  void initialize() {
    super.initialize();

    updateInsets(insets_);

    Font f = ((Window) target).getFont();
    if (f == null) {
      f = defaultFont;
      ((Window) target).setFont(f);
      setFont(f);
    }
    // Express our interest in display changes
    GraphicsConfiguration gc = getGraphicsConfiguration();
    ((Win32GraphicsDevice) gc.getDevice()).addDisplayChangedListener(this);

    initActiveWindowsTracking((Window) target);

    updateIconImages();

    Shape shape = ((Window) target).getShape();
    if (shape != null) {
      applyShape(Region.getInstance(shape, null));
    }

    float opacity = ((Window) target).getOpacity();
    if (opacity < 1.0f) {
      setOpacity(opacity);
    }

    synchronized (getStateLock()) {
      // default value of a boolean field is 'false', so set isOpaque to
      // true here explicitly
      this.isOpaque = true;
      setOpaque(((Window) target).isOpaque());
    }
  }
Exemplo n.º 7
0
 // should be overriden in WDialogPeer
 protected void realShow() {
   super.show();
 }