Package java.awt

Examples of java.awt.Dialog


        this.add(panBoardsAvailable);

        gridbag.setConstraints(panButtons, c);
        this.add(panButtons);

        mapPreviewW = new Dialog(this.client.frame, Messages
                .getString("BoardSelectionDialog.MapPreview"), false); //$NON-NLS-1$

        mapPreviewW.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                setVisible(false);
View Full Code Here


        c.weightx = 1.0;
        c.weighty = 0.0;
        // addBag(labBoard, gridbag, c);
        addBag(panButtons, gridbag, c);

        minimapW = new Dialog(frame,
                Messages.getString("BoardEditor.minimapW"), false); //$NON-NLS-1$
        minimapW.setLocation(GUIPreferences.getInstance().getMinimapPosX(),
                GUIPreferences.getInstance().getMinimapPosY());
        try {
            minimap = new MiniMap(minimapW, game, bv);
View Full Code Here

    public void boardSaveImage() {
        if (curfileImage == null) {
            boardSaveAsImage();
            return;
        }
        final Dialog waitD = new Dialog(this.frame, Messages
                .getString("BoardEditor.waitDialog.title")); //$NON-NLS-1$
        waitD.add(new Label(Messages
                .getString("BoardEditor.waitDialog.message"))); //$NON-NLS-1$
        waitD.setSize(250, 130);
        // move to middle of screen
        waitD.setLocation(
                frame.getSize().width / 2 - waitD.getSize().width / 2, frame
                        .getSize().height
                        / 2 - waitD.getSize().height / 2);
        waitD.setVisible(true);
        frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        waitD.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        // save!
        final int filter = 0; // 0 - no filter; 1 - sub; 2 - up
        final int compressionLevel = 9; // 0 to 9 with 0 being no compression
        final PngEncoder png = new PngEncoder(bv.getEntireBoardImage(),
                PngEncoder.NO_ALPHA, filter, compressionLevel);
        try {
            final FileOutputStream outfile = new FileOutputStream(curfileImage);
            byte[] pngbytes;
            pngbytes = png.pngEncode();
            if (pngbytes == null) {
                System.out.println("Failed to save board as image:Null image"); //$NON-NLS-1$
            } else {
                outfile.write(pngbytes);
            }
            outfile.flush();
            outfile.close();
        } catch (final IOException e) {
            e.printStackTrace();
        }
        waitD.setVisible(false);
        frame.setCursor(Cursor.getDefaultCursor());
    }
View Full Code Here

            }
        });
        frame.add(camo);

        // Construct a dialog.
        dialog = new Dialog(frame, "Choose a pattern", true);
        dialog.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                dialog.setVisible(false);
            }
        });
View Full Code Here

            }

            Window w = (Window) ev.getSource();

            Frame  f = null;
            Dialog d = null;

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

            // Update the cursor
            int cursor = getCursor(calculateCorner(w, ev.getX(), ev.getY()));

            if (cursor != 0
                    && ((f != null && (f.isResizable() && (f.getExtendedState() & Frame.MAXIMIZED_BOTH) == 0))
                        || (d != null && d.isResizable()))) {
                w.setCursor(Cursor.getPredefinedCursor(cursor));
            } else {
                w.setCursor(lastCursor);
            }
        }
View Full Code Here

  }//GEN-LAST:event_keyStoreListMouseClicked

  private void showActiveCertificateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showActiveCertificateButtonActionPerformed
    Certificate cert = contextManager.getDefaultCertificate();
    if(cert!=null) {
      new Dialog(new CertificateView(cert.toString()), false);
    }
  }//GEN-LAST:event_showActiveCertificateButtonActionPerformed
View Full Code Here

  private void showAliasButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showAliasButtonActionPerformed
    int keystore = keyStoreList.getSelectedIndex();
    if(keystore>=0) {
      int alias = aliasTable.getSelectedRow();
      Certificate cert = contextManager.getCertificate(keystore, alias);
      new Dialog(new CertificateView(cert.toString()), false);
    }
  }//GEN-LAST:event_showAliasButtonActionPerformed
View Full Code Here

   * @return java.awt.Dialog
   */
  private Dialog getAboutDialog() {
    if (iAboutDialog == null) {
      try {
        iAboutDialog = new Dialog(this);
        iAboutDialog.setName("AboutDialog");
        iAboutDialog.setResizable(false);
        iAboutDialog.setLayout(new java.awt.BorderLayout());
        iAboutDialog.setBounds(550, 14, 383, 142);
        iAboutDialog.setModal(true);
View Full Code Here

    /*
     * Class under test for void JDialog(Dialog, String, boolean, GraphicsConfiguration)
     */
    public void testJDialogDialogStringbooleanGraphicsConfiguration() {
        Dialog owner = new Dialog(new Frame());
        final GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment()
                .getDefaultScreenDevice().getDefaultConfiguration();
        // test with corrent owner, correct title, modal == true, correct gc
        dialog = new JDialog(owner, "Test JDialog", true, gc);
        // title is set, isModal() == true
View Full Code Here

    /*
     * Class under test for void JDialog(Dialog, String, boolean)
     */
    public void testJDialogDialogStringboolean() {
        Dialog owner = new Dialog(new Frame());
        // test with corrent owner, correct title, modal == false
        dialog = new JDialog(owner, "Test JDialog", false);
        // title is set, isModal() == false
        checkDialogCorrectness(dialog, "Test JDialog", false);
        assertTrue("owner is set", dialog.getOwner() == owner);
View Full Code Here

TOP

Related Classes of java.awt.Dialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.