
Classes | |
| class | MissingPrintableObjectException |
| class | SettingsNotCorrectException |
Public Member Functions | |
| PrintUtil () | |
| boolean | printDialog () throws MissingPrintableObjectException |
| void | print () throws SettingsNotCorrectException |
| void | setPrintable (Printable painter) |
| boolean | print (File printableFile, char fileType, String nameOfPrinter) |
Static Public Member Functions | |
| static String | getBuildingNumber () |
| static String[] | getPrintersInBuilding (String buildingNumber) throws Exception |
| static String[] | getPrintersInThisBuilding () throws Exception |
| static boolean | checkPrinter (String printerName) |
| static void | main (String[] args) |
Private Member Functions | |
| File | createTempFile () throws IOException |
Static Private Member Functions | |
| static String | getSwitchIP (String ip) throws ArrayIndexOutOfBoundsException |
| static String | getSwitchName (String switchIP) |
| static boolean | waitForData (BufferedReader reader, int timeout) throws IOException |
Private Attributes | |
| Printable | toPrint |
| String | printerName |
| int | numberOfCopies |
| boolean | isTwoSidePrint |
| boolean | isAllPagePrint |
| boolean | isRangePagePrint |
| int | rangeFrom |
| int | rangeTo |
| boolean | isPrintToFile |
| File | fileToPrint |
| boolean | isLandscape |
| boolean | settingsOK |
| int | sendStatus |
| int | nextJob = 1 |
| String | cfName |
| String | dfName |
| String | controlFile |
| String | userName = "null" |
| String | jobName = "null" |
| int | printOptions = USE_DEFAULTS |
| int | widthCode = -1 |
| String | pagePosition = "twopage" |
| String | rectoVerso = "rverso" |
| Socket | sock = null |
| int | nextPort = 721 |
| final int | timeout = 30 |
Static Private Attributes | |
| static final int | USE_DEFAULTS = 1 |
| static final int | USE_FORM_CODES = 2 |
| static final int | USE_OPTIONS = 3 |
Class for printing objects which implements interface Printable.
| cern::laser::guiplatform::printing::PrintUtil::PrintUtil | ( | ) | [inline] |
Creates a new instance of PrintUtil
References sendStatus, settingsOK, toPrint, and userName.
| static boolean cern::laser::guiplatform::printing::PrintUtil::checkPrinter | ( | String | printerName | ) | [inline, static] |
Checks if printer with given name exists in network
| printerName | name of printer ( without suffix .print.cern.ch ) |
| File cern::laser::guiplatform::printing::PrintUtil::createTempFile | ( | ) | throws IOException [inline, private] |
Method creates temporary file. It file is used later for storing Postscript file created before sending it to printer. It is created in temporary directory.
| IOException | problem with creation file in temporary directory |
Referenced by print().
| static String cern::laser::guiplatform::printing::PrintUtil::getBuildingNumber | ( | ) | [inline, static] |
Method obtains building number on the basis of ip address
References getSwitchIP(), and getSwitchName().
Referenced by getPrintersInThisBuilding().
| static String [] cern::laser::guiplatform::printing::PrintUtil::getPrintersInBuilding | ( | String | buildingNumber | ) | throws Exception [inline, static] |
Method returns printers available in building with given number
| buildingNumber | Number of building |
| Exception | occures when is problem with connection to IT Print Support web script or the format of returned data has changed |
Referenced by getPrintersInThisBuilding().
| static String [] cern::laser::guiplatform::printing::PrintUtil::getPrintersInThisBuilding | ( | ) | throws Exception [inline, static] |
Method returns printers available in client's building
| Exception | occures when is problem with connection to IT Print Support web script or the format of returned data has changed |
References getBuildingNumber(), and getPrintersInBuilding().
| static String cern::laser::guiplatform::printing::PrintUtil::getSwitchIP | ( | String | ip | ) | throws ArrayIndexOutOfBoundsException [inline, static, private] |
Method obtains building number on the basis of ip address
| ip | IP od client in text format |
| ArrayIndexOutOfBoundsException | when the IP from parameter is in incorect format |
Referenced by getBuildingNumber().
| static String cern::laser::guiplatform::printing::PrintUtil::getSwitchName | ( | String | switchIP | ) | [inline, static, private] |
Method returns host name of switch with a given IP
| switchIP | switch IP |
Referenced by getBuildingNumber().
| static void cern::laser::guiplatform::printing::PrintUtil::main | ( | String[] | args | ) | [inline, static] |
| boolean cern::laser::guiplatform::printing::PrintUtil::print | ( | File | printableFile, | |
| char | fileType, | |||
| String | nameOfPrinter | |||
| ) | [inline] |
Sends a file to a printer to be printed. (method from cern.printing package)
This method returns true if the job was sent successfully or returns false if an error or timeout occured.
The file's format must be specified as a single character, and must be one of the following types:
| printableFile | The file to be printed | |
| fileType | The format of the file (see above) | |
| nameOfPrinter | The name of the printer to use |
References cfName, controlFile, dfName, fileToPrint, jobName, nextJob, nextPort, pagePosition, printerName, printOptions, rectoVerso, sendStatus, sock, timeout, USE_DEFAULTS, USE_FORM_CODES, USE_OPTIONS, userName, waitForData(), and widthCode.
| void cern::laser::guiplatform::printing::PrintUtil::print | ( | ) | throws SettingsNotCorrectException [inline] |
method prints printable object on printer choosen in dialog with respecting settings from this dialog
| SettingsNotCorrectException | you should use printDialog() method before invoking print() method |
References createTempFile(), fileToPrint, isLandscape, isPrintToFile, isRangePagePrint, isTwoSidePrint, numberOfCopies, printerName, rangeFrom, rangeTo, settingsOK, and toPrint.
Referenced by cern::laser::guiplatform::actions::PrintActiveListAction::performAction().
| boolean cern::laser::guiplatform::printing::PrintUtil::printDialog | ( | ) | throws MissingPrintableObjectException [inline] |
Displays print dialog. When obtaining of printers from OS is successfull it displays regular print dialog. In other case it displays dialog which obtains printers on the base of building number from IT Print Support web script. Obtaining client's building number is automatic, as well.
| MissingPrintableObjectException | Printable object is missing. Use: setPrintable method |
References cern::laser::guiplatform::printing::PrintDialog::areSettingsOK(), fileToPrint, cern::laser::guiplatform::printing::PrintDialog::getFileToPrint(), cern::laser::guiplatform::printing::PrintDialog::getNumberOfCopies(), cern::laser::guiplatform::printing::PrintDialog::getPrinterName(), cern::laser::guiplatform::printing::PrintDialog::getRangeFrom(), cern::laser::guiplatform::printing::PrintDialog::getRangeTo(), cern::laser::guiplatform::printing::PrintDialog::isAllPagePrint(), isAllPagePrint, cern::laser::guiplatform::printing::PrintDialog::isLandscape(), isLandscape, cern::laser::guiplatform::printing::PrintDialog::isPrintToFile(), isPrintToFile, cern::laser::guiplatform::printing::PrintDialog::isRangePagePrint(), isRangePagePrint, cern::laser::guiplatform::printing::PrintDialog::isTwoSidedPrint(), isTwoSidePrint, numberOfCopies, printerName, rangeFrom, rangeTo, settingsOK, and toPrint.
Referenced by cern::laser::guiplatform::actions::PrintActiveListAction::performAction().
| void cern::laser::guiplatform::printing::PrintUtil::setPrintable | ( | Printable | painter | ) | [inline] |
sets reference to object which will be printed
| painter | reference to printable object. It have to implement interface Printable |
References toPrint.
Referenced by cern::laser::guiplatform::actions::PrintActiveListAction::performAction().
| static boolean cern::laser::guiplatform::printing::PrintUtil::waitForData | ( | BufferedReader | reader, | |
| int | timeout | |||
| ) | throws IOException [inline, static, private] |
Waits for data to become available from a reader, or a timeout. Returns true if some data is received before the timeout specified.
| reader | The reader to read data from | |
| timeout | The timeout in seconds |
| IOException | if an I/O error occurs |
References timeout.
Referenced by print().
String cern::laser::guiplatform::printing::PrintUtil::cfName [private] |
Referenced by print().
String cern::laser::guiplatform::printing::PrintUtil::controlFile [private] |
Referenced by print().
String cern::laser::guiplatform::printing::PrintUtil::dfName [private] |
Referenced by print().
File cern::laser::guiplatform::printing::PrintUtil::fileToPrint [private] |
destination file for printing ( mode: printing to file in dialog )
Referenced by print(), and printDialog().
boolean cern::laser::guiplatform::printing::PrintUtil::isAllPagePrint [private] |
if true all pages printing
Referenced by printDialog().
boolean cern::laser::guiplatform::printing::PrintUtil::isLandscape [private] |
if true, printing in landscape mode
Referenced by print(), and printDialog().
boolean cern::laser::guiplatform::printing::PrintUtil::isPrintToFile [private] |
if true, printing to file
Referenced by print(), and printDialog().
boolean cern::laser::guiplatform::printing::PrintUtil::isRangePagePrint [private] |
if true range printing
Referenced by print(), and printDialog().
boolean cern::laser::guiplatform::printing::PrintUtil::isTwoSidePrint [private] |
if true two side printing
Referenced by print(), and printDialog().
String cern::laser::guiplatform::printing::PrintUtil::jobName = "null" [private] |
Referenced by print().
int cern::laser::guiplatform::printing::PrintUtil::nextJob = 1 [private] |
Referenced by print().
int cern::laser::guiplatform::printing::PrintUtil::nextPort = 721 [private] |
Referenced by print().
number of copies
Referenced by print(), and printDialog().
String cern::laser::guiplatform::printing::PrintUtil::pagePosition = "twopage" [private] |
Referenced by print().
String cern::laser::guiplatform::printing::PrintUtil::printerName [private] |
name of printer (without suffix .print.cern.ch)
Referenced by print(), and printDialog().
Referenced by print().
int cern::laser::guiplatform::printing::PrintUtil::rangeFrom [private] |
first page to print
Referenced by print(), and printDialog().
int cern::laser::guiplatform::printing::PrintUtil::rangeTo [private] |
last page to print
Referenced by print(), and printDialog().
String cern::laser::guiplatform::printing::PrintUtil::rectoVerso = "rverso" [private] |
Referenced by print().
status of printing
Referenced by print(), and PrintUtil().
boolean cern::laser::guiplatform::printing::PrintUtil::settingsOK [private] |
id true, all properties needed for printing are correct
Referenced by print(), printDialog(), and PrintUtil().
Socket cern::laser::guiplatform::printing::PrintUtil::sock = null [private] |
Referenced by print().
final int cern::laser::guiplatform::printing::PrintUtil::timeout = 30 [private] |
Referenced by print(), and waitForData().
Printable cern::laser::guiplatform::printing::PrintUtil::toPrint [private] |
printable object
Referenced by print(), printDialog(), PrintUtil(), and setPrintable().
final int cern::laser::guiplatform::printing::PrintUtil::USE_DEFAULTS = 1 [static, private] |
Referenced by print().
final int cern::laser::guiplatform::printing::PrintUtil::USE_FORM_CODES = 2 [static, private] |
Referenced by print().
final int cern::laser::guiplatform::printing::PrintUtil::USE_OPTIONS = 3 [static, private] |
Referenced by print().
String cern::laser::guiplatform::printing::PrintUtil::userName = "null" [private] |
Referenced by print(), and PrintUtil().
int cern::laser::guiplatform::printing::PrintUtil::widthCode = -1 [private] |
Referenced by print().
1.6.2