예제 #1
0
    public void mouseClicked(MouseEvent ev) {
      Window w = (Window) ev.getSource();
      Frame f = null;

      if (w instanceof Frame) {
        f = (Frame) w;
      } else {
        return;
      }

      Point convertedPoint = SwingUtilities.convertPoint(w, ev.getPoint(), getTitlePane());

      int state = f.getExtendedState();
      if (getTitlePane() != null && getTitlePane().contains(convertedPoint)) {
        if ((ev.getClickCount() % 2) == 0 && ((ev.getModifiers() & InputEvent.BUTTON1_MASK) != 0)) {
          if (f.isResizable()) {
            if ((state & Frame.MAXIMIZED_BOTH) != 0) {
              f.setExtendedState(state & ~Frame.MAXIMIZED_BOTH);
            } else {
              f.setExtendedState(state | Frame.MAXIMIZED_BOTH);
            }
            return;
          }
        }
      }
    }
예제 #2
0
 /*      */ private void restore() /*      */ {
   /*  407 */ Frame localFrame = getFrame();
   /*      */
   /*  409 */ if (localFrame == null) {
     /*  410 */ return;
     /*      */ }
   /*      */
   /*  413 */ if ((this.state & 0x1) != 0)
     /*  414 */ localFrame.setExtendedState(this.state & 0xFFFFFFFE);
   /*      */ else /*  416 */ localFrame.setExtendedState(this.state & 0xFFFFFFF9);
   /*      */ }
  private void restore() {
    Frame frame = getFrame();

    if (frame == null) {
      return;
    }

    if ((myState & Frame.ICONIFIED) != 0) {
      frame.setExtendedState(myState & ~Frame.ICONIFIED);
    } else {
      frame.setExtendedState(myState & ~Frame.MAXIMIZED_BOTH);
    }
  }
예제 #4
0
 protected void fileOpened(final DocumentView documentView, File file, Object value) {
   final DocumentOrientedApplication application = getApplication();
   if (value == null) {
     documentView.setFile(file);
     documentView.setEnabled(true);
     Frame w = (Frame) SwingUtilities.getWindowAncestor(documentView.getComponent());
     if (w != null) {
       w.setExtendedState(w.getExtendedState() & ~Frame.ICONIFIED);
       w.toFront();
     }
     documentView.getComponent().requestFocus();
     application.addRecentFile(file);
     application.setEnabled(true);
   } else {
     if (value instanceof Throwable) {
       ((Throwable) value).printStackTrace();
     }
     JSheet.showMessageSheet(
         documentView.getComponent(),
         "<html>"
             + UIManager.getString("OptionPane.css")
             + "<b>Couldn't open the file \""
             + file
             + "\".</b><br>"
             + value,
         JOptionPane.ERROR_MESSAGE,
         new SheetListener() {
           public void optionSelected(SheetEvent evt) {
             // application.dispose(documentView);
           }
         });
   }
 }
  private void createPlayerFrame() {
    if (playerFrame == null) {
      GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
      GraphicsDevice[] gs = ge.getScreenDevices();

      GraphicsDevice graphicsDevice =
          (screenNumber >= 0 && screenNumber < gs.length) ? gs[screenNumber] : gs[0];

      playerFrame = new Frame(graphicsDevice.getDefaultConfiguration());
      playerFrame.setLayout(new BorderLayout());
      playerFrame.setUndecorated(true);
      playerFrame.setExtendedState(Frame.MAXIMIZED_BOTH);
      playerFrame.setBackground(new java.awt.Color(0, 0, 0));
      playerFrame.setVisible(true);
    }
  }
 private void maximize() {
   Frame frame = getFrame();
   if (frame != null) {
     frame.setExtendedState(myState | Frame.MAXIMIZED_BOTH);
   }
 }
 private void iconify() {
   Frame frame = getFrame();
   if (frame != null) {
     frame.setExtendedState(myState | Frame.ICONIFIED);
   }
 }
예제 #8
0
 /*      */ private void maximize() /*      */ {
   /*  397 */ Frame localFrame = getFrame();
   /*  398 */ if (localFrame != null) /*  399 */ localFrame.setExtendedState(this.state | 0x6);
   /*      */ }
예제 #9
0
 /*      */ private void iconify() /*      */ {
   /*  387 */ Frame localFrame = getFrame();
   /*  388 */ if (localFrame != null) /*  389 */ localFrame.setExtendedState(this.state | 0x1);
   /*      */ }