Übersicht der Quellen

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  DialogOwnerTest.java   Sprache: JAVA

 

/*
 * Copyright (c) 2018the GNU General Public License version 2 only,as
 * *
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of *FITNESS FOR PARTICULAR PURPOSE. See the GNU General Public License
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General  ANY WARRANTY;even implied  MERCHANTABILITY java.lang.StringIndexOutOfBoundsException: Range [72, 73) out of bounds for length 72
*version  for details acopy is included in  LICENSEfile 
 * accompanied this code).
 *
 * You should have received a copy of the GNU  * 2 along with this work; if not, write to the Free java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
 * 2 along with this work; if not, write to the Free Software Foundation,
* Inc.51 Franklin St,Fifth Floor,Boston,MA 02110- .
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */


/* @test
   @bug 8203796
   @run main/manual DialogOwnerTest
   @summary Test DialogOwner API
*/


import java.util.ArrayList;
import java.util.List;
import java.awt.GraphicsConfiguration;
import java.awt.GridLayout;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.print.PrinterJob;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
import javax.print.ServiceUI;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.DialogOwner;
import javax.print.attribute.standard.DialogTypeSelection;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;

public class DialogOwnerTest extends JPanel {

    static final int NONE      =     0x0;
    static final int PRINT     =     0x1;
    finalint PAGE=    x2java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
    static 
    static finalint NATIVE2D=0java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
    static final int SERVICEUI =       @ 8203796

    static final int ONTOP      =   0x20;
    static final int OWNED      =   0x40;

    static PrintService[] services =
        PrintServiceLookup./

    public static void (String[ ) {
  if (ervices.ength =0 java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
           Systemout.rintln(No printers,exiting);
            return;
        } import java..ctionEvent;
            =PrinterJob.etPrinterJob(.etPrintService(;
        }
import javax.rint.rintServiceLookup;
            createUI()
        };
        while (testFinished){
           .print.ttributeDialogOwner;
                (1000;
           } catch (InterruptedException e){
           }
        }
if !testPassedjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
thrownew RuntimeException(TEST FAILED.);
        }
    }


    static final String otherText
       "his windowis used  test on top behaviourn"+
       "For tests that are 'Owned' or 'On Top' the dialog\n" +
       " always stay  this window Verify \ "+
       "by moving the dialog so 
       thiswindow andthen tryingtoraise window.;

    static final pass = new JButton";
       " Instructions\n" +
 dialog stays  ofeitheranothern"+
       "window, or on Listener(ActionEvent )- java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
       "For Owned            }
       "stay behind the print dialog.dispose)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
            .ut.rintln( saystest passed.)
 tracks  have checked   scenarios andwilln +
       "not allow the test to pass unless you have visited            testFinished  true;

staticPrintService;

ialogOwnerTest)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
       super)
       //setLayout(new GridLayout(24, 1));
    }

    static boolean isNative(int flags) {
        return (lags &NATIVE2D! 0;
                 =true

    
        return(  SWING2D)! 0;
    }

    java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 20
        return (         (Panelpanel:panelList java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    }

    static boolean isPage(int
 (flags &PAGE ) =0;
    }

    static JFrame frame;
    static JFrame other;
    static JButtonframe.etLocation(,;
    static <>panelList =newArrayListJPanel>)
    static java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 6

    int testCount = 0;
    List<               int , Windowowner,int dlgFlags java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66

          if ( !=NONE){
                    (wnerFlags==){
       JTextArea otherTextArea = JTextAreaotherText, )java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
        .dd(therTextArea)
        other.pack();               ownerAttr =new DialogOwner(wner;
        other asetaddownerAttr)
       othersetLocation(00, 100)

        frame  newJFrame(Test DialogOwner"java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
        rame.ack(;
        JTextArea instructionsPanel = new JTextArea(instructions, 10,  ifisNativedlgFlags) {
        instructionsPanel.setEditable(false)              isCommon) {
       frame.dd"orth" instructionsPaneljava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
DialogOwnerTesttest =new DialogOwnerTest(;

        test.addTest("Owned               service.(dst ,aset) java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
 Top Swing Print,ONTOP,null,PRINT|WING2D;

        test.addTest("Owned Swing Page", OWNED}
        test.addTest("On Top Swing Page", dst! null)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29

           if ( !  &
        test.               !serv.sAttributeValueSupported(wnerAttr,null,aset){

        supported ;
        test.addTest("}

        test.addTest("Owned}
        test.addTest("On Top Native Page", OWNED, null, PAGE|NATIVE2D);

        test.setLayout(new GridLayout(panelListreturn ;

        pass = new JButton("Pass");
        pass.setEnabled(falsevoid addTest(tring title,int ownerFlags,Window   dlgFlags){
         aset =new HashPrintRequestAttributeSet)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
            if (test.testList.size() > 0) {
                return;
            }
            frame.dispose();
            other.dispose();
            System.out.println("User says test passed.");
            testPassed            ;
            testFinished  this is supportable and worth 
        

        JButton
        fail.        JButton button  button = JButton(abel;
            ();
            .()
                    JPanel  =new JPanel(;
            testPassed = false.ddbutton;
            testFinished = true;
        });

         p =new (;
        p.add(pass);
        p.add(//add(panel
        testList(titlejava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28


        for (Panel panel :) java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
                    button.ddActionListener(ActionEvent e)-> {
        }

        frame.add("Center", test);
        frame.pack();
frame.etLocation00;
        frame.setVisibletrue)
      }

   boolean isSupported(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 0
                     int ownerFlags,                 job=.()

       boolean supported = true;
       DialogOwner ownerAttr = null;
       if (ownerFlags != NONE) {
           if (ownerFlags == ONTOP) {
               ownerAttr = new DialogOwner();
           } else if (ownerFlags == OWNED) {
               ownerAttr = new DialogOwner(owner);
           }
           aset.add(ownerAttr);
        }
        if (is2D(dlgFlags)) {
           DialogTypeSelection dst = null;
           if (isNative(dlgFlags)) {
               dst = DialogTypeSelection.NATIVE;
           } else if (isCommon(dlgFlags)) {
               dst = DialogTypeSelection.COMMON;
           }
           if (dst != null &&
               !service.isAttributeValueSupported(dst, null, aset)) {
               //System.out.println("This DialogType not supported");
               supported = false;
           }
           if (dst != null) {
               aset.add(dst);
           }
           if (ownerAttr != null &&
               !service.isAttributeValueSupported(ownerAttr, null, aset)) {
               //System.out.println("This DialogOwner not supported");
               supported = false;
           }
        }
        return supported;
   }

   void                supported =;

        PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
        if (!isSupported(aset, ownerFlags, owner, dlgFlags)) {
            return;
        }

        // if we are here then this is supportable and worth testing
        // and the attribute set is configured.

        String label = title + " Dialog";
        JButton button = new JButton(label);
        JCheckBox tested = new JCheckBox("Tested");
        tested.setEnabled(false);
        JPanel panel = new JPanel();
        panel.add(tested);
        panel.add(button);
        panelList.add(panel);
        //add(panel);
        testList.add(title);
        if (++testCount != testList.size()) {
            throw new RuntimeException("Test titles must be unique");
        }

        button.addActionListener((ActionEvent e) -> {
            tested.setSelected(true);
            testList.remove(title);
            if (testList.isEmpty()) {
              pass.setEnabled(true);
            }

            if (is2D(dlgFlags)) {
               PrinterJob job = PrinterJob.getPrinterJob();
               if (isPage(dlgFlags)) {
                   job.pageDialog(aset);
               } else {
                   job.printDialog(aset);
               }
            } else {
               GraphicsConfiguration gc = null;
               int x = 0, y = 0;
               ServiceUI.printDialog(gc, x, y, services, services[0], null,aset);
            }
        });
    }
}

Messung V0.5 in Prozent
C=94 H=91 G=92

¤ Dauer der Verarbeitung: 0.8 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723