src/share/classes/sun/print/RasterPrinterJob.java
Print this page
@@ -170,11 +170,11 @@
* can be used to force the printing code to
* use a particular pipeline. Either the raster
* pipeline or the pdl pipeline can be forced.
*/
String forceStr =
- (String)java.security.AccessController.doPrivileged(
+ java.security.AccessController.doPrivileged(
new sun.security.action.GetPropertyAction(FORCE_PIPE_PROP));
if (forceStr != null) {
if (forceStr.equalsIgnoreCase(FORCE_PDL)) {
forcePDL = true;
@@ -182,11 +182,11 @@
forceRaster = true;
}
}
String shapeTextStr =
- (String)java.security.AccessController.doPrivileged(
+ java.security.AccessController.doPrivileged(
new sun.security.action.GetPropertyAction(SHAPE_TEXT_PROP));
if (shapeTextStr != null) {
shapeTextProp = true;
}
@@ -500,15 +500,14 @@
service.getName() == null) {
throw new PrinterException("Null PrintService name.");
} else {
// Check the list of services. This service may have been
// deleted already
- PrinterState prnState = (PrinterState)service.getAttribute(
- PrinterState.class);
+ PrinterState prnState = service.getAttribute(PrinterState.class);
if (prnState == PrinterState.STOPPED) {
PrinterStateReasons prnStateReasons =
- (PrinterStateReasons)service.getAttribute(
+ service.getAttribute(
PrinterStateReasons.class);
if ((prnStateReasons != null) &&
(prnStateReasons.containsKey(PrinterStateReason.SHUTDOWN)))
{
throw new PrinterException("PrintService is no longer available.");
@@ -1305,24 +1304,22 @@
throw new PrinterException("No print service found.");
}
// Check the list of services. This service may have been
// deleted already
- PrinterState prnState = (PrinterState)psvc.getAttribute(
- PrinterState.class);
+ PrinterState prnState = psvc.getAttribute(PrinterState.class);
if (prnState == PrinterState.STOPPED) {
- PrinterStateReasons prnStateReasons =
- (PrinterStateReasons)psvc.getAttribute(
+ PrinterStateReasons prnStateReasons = psvc.getAttribute(
PrinterStateReasons.class);
if ((prnStateReasons != null) &&
(prnStateReasons.containsKey(PrinterStateReason.SHUTDOWN)))
{
throw new PrinterException("PrintService is no longer available.");
}
}
- if ((PrinterIsAcceptingJobs)(psvc.getAttribute(
+ if ((psvc.getAttribute(
PrinterIsAcceptingJobs.class)) ==
PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS) {
throw new PrinterException("Printer is not accepting job.");
}
@@ -1908,11 +1905,11 @@
/* Figure out the number of lines that will fit into
* our maximum band size. The hard coded 3 reflects the
* fact that we can only create 24 bit per pixel 3 byte BGR
* BufferedImages. FIX.
*/
- int bandHeight = (int)(MAX_BAND_SIZE / bandWidth / 3);
+ int bandHeight = (MAX_BAND_SIZE / bandWidth / 3);
int deviceLeft = (int)Math.rint(paper.getImageableX() * xScale);
int deviceTop = (int)Math.rint(paper.getImageableY() * yScale);
/* The device transform is used to move the band down