< prev index next >

src/java.desktop/share/classes/sun/print/ServiceDialog.java

Print this page




1277             }
1278             snModel.setMinimum(min);
1279             snModel.setMaximum(max);
1280 
1281             int value = cp.getValue();
1282             if ((value < min) || (value > max)) {
1283                 value = min;
1284             }
1285             snModel.setValue(value);
1286 
1287             // setup Collate checkbox
1288             if (psCurrent.isAttributeCategorySupported(scCategory)) {
1289                 scSupported = true;
1290             }
1291             SheetCollate sc = (SheetCollate)asCurrent.get(scCategory);
1292             if (sc == null) {
1293                 sc = (SheetCollate)psCurrent.getDefaultAttributeValue(scCategory);
1294                 if (sc == null) {
1295                     sc = SheetCollate.UNCOLLATED;
1296                 }



1297             }
1298             cbCollate.setSelected(sc == SheetCollate.COLLATED);





1299             updateCollateCB();
1300         }
1301     }
1302 
1303 
1304 
1305 
1306     /**
1307      * The "Page Setup" tab.  Includes the controls for MediaSource/MediaTray,
1308      * OrientationRequested, and Sides.
1309      */
1310     @SuppressWarnings("serial") // Superclass is not serializable across versions
1311     private class PageSetupPanel extends JPanel {
1312 
1313         private MediaPanel pnlMedia;
1314         private OrientationPanel pnlOrientation;
1315         private MarginsPanel pnlMargins;
1316 
1317         public PageSetupPanel() {
1318             super();




1277             }
1278             snModel.setMinimum(min);
1279             snModel.setMaximum(max);
1280 
1281             int value = cp.getValue();
1282             if ((value < min) || (value > max)) {
1283                 value = min;
1284             }
1285             snModel.setValue(value);
1286 
1287             // setup Collate checkbox
1288             if (psCurrent.isAttributeCategorySupported(scCategory)) {
1289                 scSupported = true;
1290             }           
1291             SheetCollate sc = (SheetCollate)asCurrent.get(scCategory);            
1292             if (sc == null) {
1293                 sc = (SheetCollate)psCurrent.getDefaultAttributeValue(scCategory);                             
1294                 if (sc == null) {
1295                     sc = SheetCollate.UNCOLLATED;
1296                 }
1297                 if (sc != null && 
1298                     !psCurrent.isAttributeValueSupported(sc, docFlavor, asCurrent)) {
1299                     scSupported = false;
1300                 }
1301             } else {
1302                 if (!psCurrent.isAttributeValueSupported(sc, docFlavor, asCurrent)) {
1303                     scSupported = false;
1304                 }
1305             }
1306             cbCollate.setSelected(sc == SheetCollate.COLLATED && scSupported);
1307             updateCollateCB();
1308         }
1309     }
1310 
1311 
1312 
1313 
1314     /**
1315      * The "Page Setup" tab.  Includes the controls for MediaSource/MediaTray,
1316      * OrientationRequested, and Sides.
1317      */
1318     @SuppressWarnings("serial") // Superclass is not serializable across versions
1319     private class PageSetupPanel extends JPanel {
1320 
1321         private MediaPanel pnlMedia;
1322         private OrientationPanel pnlOrientation;
1323         private MarginsPanel pnlMargins;
1324 
1325         public PageSetupPanel() {
1326             super();


< prev index next >