Exemplo n.º 1
0
  public Component add(JInternalFrame frame) {
    JInternalFrame[] array = getAllFrames();
    Point p;
    int w;
    int h;

    Component retval = super.add(frame);
    checkDesktopSize();
    if (array.length > 0) {
      p = array[0].getLocation();
      p.x = p.x + FRAME_OFFSET;
      p.y = p.y + FRAME_OFFSET;
    } else {
      p = new Point(0, 0);
    }
    frame.setLocation(p.x, p.y);
    /* Jimmy: this is a bit buggy (frames get constant size)
    if (frame.isResizable()) {
        w = getWidth() - (getWidth()/3);
        h = getHeight() - (getHeight()/3);
        if (w < frame.getMinimumSize().getWidth()) w = (int)frame.getMinimumSize().getWidth();
        if (h < frame.getMinimumSize().getHeight()) h = (int)frame.getMinimumSize().getHeight();
        frame.setSize(w, h);
    }*/
    moveToFront(frame);
    frame.setVisible(true);
    try {
      frame.setSelected(true);
    } catch (PropertyVetoException e) {
      frame.toBack();
    }
    return retval;
  }
 public void openInBox() {
   JInternalFrame doc = new MetalworksInBox();
   desktop.add(doc, DOCLAYER);
   try {
     doc.setVisible(true);
     doc.setSelected(true);
   } catch (java.beans.PropertyVetoException e2) {
   }
 }
 public void openHelpWindow() {
   JInternalFrame help = new MetalworksHelp();
   desktop.add(help, HELPLAYER);
   try {
     help.setVisible(true);
     help.setSelected(true);
   } catch (java.beans.PropertyVetoException e2) {
   }
 }