/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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 Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* 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 4485755 6361370 6448717 5080051 6939417
* @summary dialog doesn't have way to specify margins
* for 6361370, verify exception for offline printer in Windows
* for 6448717, faster display of print dialog
* for 6500903, verify status of printer if accepting jobs or not
* @author prr
*/
public DialogMargins() {
super("Dialog Margins Test");
public void actionPerformed (ActionEvent e) {
new MarginsPrinter();
}
});
addWindowListener (new WindowAdapter() {
public void windowClosing (WindowEvent e) {
dispose();
}
});
pack();
setVisible (true);
}
public MarginsPrinter() {
//aset.add(MediaSizeName.ISO_A4);
//aset.add(new MediaPrintableArea(0f,0f,210f,297f,MediaPrintableArea.MM));
//myPrinterJob.setPrintable(this);
try {
//PrintRequestAttributeSet newaset =
//new HashPrintRequestAttributeSet();
} catch (PrinterException pe ) {
}
}
}
if (pageIndex > 0) {
return Printable.NO_SUCH_PAGE;
}
(int)pageFormat.getImageableHeight());
return Printable.PAGE_EXISTS;
}
}
String[] instructions =
{
"You must have a printer available to perform this test",
"Specify various pageformats and compare the printed results with the",
"request."
};
Sysout.createDialog( );
new DialogMargins();
}
}
class Sysout {
{
println( "Any messages for the tester will display here." );
}
public static void createDialog( )
{
println( "Any messages for the tester will display here." );
}
{
}
{
}
}// Sysout class
/**
This is part of the standard test machinery. It provides a place for the
test instructions to be displayed, and a place for interactive messages
to the user to be displayed.
To have the test instructions displayed, see Sysout.
To have a message to the user be displayed, see Sysout.
Do not call anything in this dialog directly.
*/
//DO NOT call this directly, go through Sysout
{
pack();
show();
}// TestDialog()
//DO NOT call this directly, go through Sysout
{
//Clear out any current instructions
//Go down array of instruction strings
{
//chop up each into pieces maxSringLength long
remainingStr = instructions[ i ];
{
//if longer than max then chop off first max chars to print
{
//Try to chop on a word boundary
int posOfSpace = remainingStr.
}
//else just print
else
{
remainingStr = "";
}
}// while
}// for
}//printInstructions()
//DO NOT call this directly, go through Sysout
{
}
}// TestDialog class