public interface IGenericPrinter
Any class that implements this may be used as a Elastic COBOL printer.
Modifier and Type | Field and Description |
---|---|
static int |
CONNECT_ALL |
static int |
CONNECT_DOUBLE |
static int |
CONNECT_DOWN |
static int |
CONNECT_HORIZONTAL |
static int |
CONNECT_LEFT |
static int |
CONNECT_RIGHT |
static int |
CONNECT_ROUND |
static int |
CONNECT_SHADE |
static int |
CONNECT_SINGLE |
static int |
CONNECT_TYPE |
static int |
CONNECT_UP |
static int |
CONNECT_VERTICAL |
static int |
PD_RETURN_CANCELLED |
static int |
PD_RETURN_ERROR |
static int |
PD_RETURN_OK |
static int |
PITCH_COMPRESSED_VALUE |
static int |
PITCH_EXPANDED_VALUE |
static int |
PITCH_NORMAL_VALUE |
Modifier and Type | Method and Description |
---|---|
void |
clearDialog()
Set the dialog to initial unset default values.
|
void |
clearFont()
Clear the font to default.
|
void |
close()
Close the printer access.
|
java.lang.String |
command(java.lang.String command)
Command
Send arbitrary text commands to the Elastic COBOL printer driver; this may
be interpreted in any manner by the Elastic COBOL printer driver.
|
boolean |
displayDialog()
Display Dialog Box to user.
|
void |
draw(java.awt.Component component,
double xpos,
double ypos,
double width,
double height)
Draw a Component
|
void |
draw(java.awt.Image image,
double xpos,
double ypos,
double width,
double height)
Draw a Bitmap.
|
void |
drawArc(double xpos,
double ypos,
double width,
double height,
boolean shade,
int startAngle,
int endAngle)
Draw a partial Oval, optionally shaded.
|
void |
drawBox(double xpos,
double ypos,
double width,
double height,
boolean shade,
boolean _3d,
boolean raised)
Draw a Box, shaded or 3d.
|
void |
drawBox(double xpos,
double ypos,
double width,
double height,
boolean shade,
int arcWidth,
int arcHeight)
Draw a Rounded Box, optionally shaded.
|
void |
drawLine(double x1,
double y1,
double x2,
double y2)
Draw a line; set the next from to the current to.
|
void |
drawLineFrom(double x1,
double y1)
Set the initial drawing location for the next drawLineTo; does
not render anything.
|
void |
drawLineTo(double x2,
double y2)
Draw a line to the given coordinates, from the last drawn line.
|
void |
drawOval(double xpos,
double ypos,
double width,
double height,
boolean shade)
Draw an Oval
|
void |
eject()
Eject the current page.
|
double |
getBottomMargin()
Get the bottom margin.
|
java.awt.Component |
getComponent()
Return a component related to the printing; this is suitable ONLY
for usage with obtaining an image, and it is NOT guaranteed to
be anything other than null for a CobolPrinter, especially on
later edition servers.
|
java.lang.String |
getDeviceCapability(java.lang.String attrib)
Get the value of a device attribute.
|
java.lang.String |
getDialog(java.lang.String attribute)
Get Dialog attributes.
|
java.awt.Font |
getFont()
Get the current font.
|
java.awt.FontMetrics |
getFontMetrics()
Get the current font metrics.
|
double |
getLeftMargin()
Get the left margin.
|
double |
getPositionX()
Set the pen attributes.
|
double |
getPositionY()
Set the pen attributes.
|
java.lang.String |
getPrinterInfo(java.lang.String attrib)
Get printer info attribute.
|
double |
getScaleX(java.lang.String unitName)
Get scale in the X direction
|
double |
getScaleY(java.lang.String unitName)
Get scale in the Y direction
|
java.awt.Color |
getShadeColor()
Get shading color;
|
java.awt.Color |
getTextColor()
Get the text color.
|
java.awt.Dimension |
getTextExtent(java.lang.String text)
Get renderable text extend in width and height as Dimension.
|
double |
getTextPositionX(boolean bottom) |
double |
getTextPositionY(boolean bottom) |
double |
getTopMargin()
Get the top margin.
|
boolean |
isFontStrikeOut()
indicate if this item is in strike-thru font
|
boolean |
isFontUnderline()
indicate if this item is underlined
|
boolean |
open(boolean enableDialog,
boolean rawMode,
java.lang.String filename)
Open the printer according to filename.
|
void |
setBottomMargin(double bottomMargin)
Set the bottom margin.
|
void |
setConnector(double xpos,
double ypos,
int type)
Set a connector of the given type on the page; the page
is responsible for connecting connectors appropriately.
|
void |
setConnectorThickness(int thickness)
Set the connector thickness, in pixels away from the center.
|
void |
setDeviceMode(java.lang.String attrib,
java.lang.String value)
Set device modes.
|
void |
setDialog(java.lang.String attribute,
java.lang.String value)
Set Dialog attributes.
|
void |
setEscapeSequences(boolean state)
Enable or disable escape sequences.
|
void |
setFont(java.awt.Font f,
boolean underline,
boolean strikeOut,
boolean doubleStrike)
Set the current font.
|
void |
setLeftMargin(double leftMargin)
Set the left margin.
|
void |
setLineExtend(double extend)
Set the amount of space between two overwritten lines.
|
void |
setPaintMode()
PaintMode
This is the normal painting mode for drawing to the printer.
|
void |
setPen(int penStyle,
double penWidth,
java.awt.Color penColor)
Set the pen attributes.
|
void |
setPitch(int pitchType)
Set the pitch of the font.
|
void |
setPositionX(double xpos)
Set the pen attributes.
|
void |
setPositionY(double ypos)
Set the pen attributes.
|
void |
setShadeColor(java.awt.Color shade)
Set shading color.
|
void |
setTabStop(double tabStops)
Set the tab stop increment.
|
void |
setTextColor(java.awt.Color textColor)
Set the text color.
|
void |
setTextPositionX(double xpos,
boolean bottom)
Set the text position x.
|
void |
setTextPositionY(double ypos,
boolean bottom)
Set the text position y.
|
void |
setTopMargin(double topMargin)
Set the top margin.
|
void |
setXORMode(java.awt.Color c)
XORMode
This painting mode for drawing to the printer has the attribute
such that drawing the object twice will return the graphics to
the original state.
|
void |
textOut(java.lang.String text,
double xpos,
double ypos,
boolean box,
boolean shade)
Output text at position, with a box or shade.
|
boolean |
write(java.lang.String text)
Write plain text, with possible escapes if enabled; this MAY cause
a page eject and movement to the next page.
|
static final int PD_RETURN_OK
static final int PD_RETURN_CANCELLED
static final int PD_RETURN_ERROR
static final int PITCH_NORMAL_VALUE
static final int PITCH_EXPANDED_VALUE
static final int PITCH_COMPRESSED_VALUE
static final int CONNECT_LEFT
static final int CONNECT_RIGHT
static final int CONNECT_UP
static final int CONNECT_DOWN
static final int CONNECT_HORIZONTAL
static final int CONNECT_VERTICAL
static final int CONNECT_ALL
static final int CONNECT_SHADE
static final int CONNECT_SINGLE
static final int CONNECT_DOUBLE
static final int CONNECT_ROUND
static final int CONNECT_TYPE
void clearDialog()
boolean displayDialog()
java.lang.String getDialog(java.lang.String attribute)
attribute
- the Dialog attribute.void setDialog(java.lang.String attribute, java.lang.String value)
attribute
- The Dialog attribute.value
- The value of the attribute.java.awt.Component getComponent()
double getScaleX(java.lang.String unitName)
unitName
- - the String name of the printer unitdouble getScaleY(java.lang.String unitName)
unitName
- - the String name of the printer unitvoid draw(java.awt.Image image, double xpos, double ypos, double width, double height)
image
- - the image to drawxpos
- - the x positionypos
- - the y positionwidth
- - the widthheight
- - the heightvoid draw(java.awt.Component component, double xpos, double ypos, double width, double height)
component
- - the component to drawxpos
- - the x positionypos
- - the y positionwidth
- - the widthheight
- - the heightvoid drawBox(double xpos, double ypos, double width, double height, boolean shade, boolean _3d, boolean raised)
xpos
- - the x positionypos
- - the y positionwidth
- - the widthheight
- - the heightshade
- - shade the box_3d
- - draw in 3Draised
- - raised fontvoid drawBox(double xpos, double ypos, double width, double height, boolean shade, int arcWidth, int arcHeight)
xpos
- - the x positionypos
- - the y positionwidth
- - the widthheight
- - the heightshade
- - shade the boxarcWidth
- - amount of arc, width wisearcHeight
- - amount of arc, height wisevoid drawOval(double xpos, double ypos, double width, double height, boolean shade)
xpos
- - the x positionypos
- - the y positionwidth
- - the widthheight
- - the heightshade
- - shade the boxvoid drawArc(double xpos, double ypos, double width, double height, boolean shade, int startAngle, int endAngle)
xpos
- - the x positionypos
- - the y positionwidth
- - the widthheight
- - the heightshade
- - shade the boxstartAngle
- - the angle to start atendAngle
- - the angle to end atvoid drawLine(double x1, double y1, double x2, double y2)
x1
- - start x positiony1
- - start y positionx2
- - end x positiony2
- - end y positionvoid drawLineFrom(double x1, double y1)
x1
- - start x positiony1
- - start y positionvoid drawLineTo(double x2, double y2)
x2
- - end x positiony2
- - end y positionvoid setShadeColor(java.awt.Color shade)
shade
- - the shading colorjava.awt.Color getShadeColor()
void setPen(int penStyle, double penWidth, java.awt.Color penColor)
penStyle
- - from PEN_STYLE_SOLID (0), PEN_STYLE_DASH (1), PEN_STYLE_DOT (2), PEN_STYLE_DASH_DOT (3), PEN_STYLE_DASH_DOT_DOT (4), PEN_STYLE_NULL (5)penWidth
- - the widthpenColor
- - the colordouble getPositionX()
double getPositionY()
void setPositionX(double xpos)
xpos
- - set position X of next printvoid setPositionY(double ypos)
ypos
- - set position Y of next printvoid eject()
boolean open(boolean enableDialog, boolean rawMode, java.lang.String filename)
enableDialog
- true if dialog should be enabledrawMode
- true if should open in rawMode, false if cookedfilename
- the String file name to openvoid close()
void clearFont()
double getTextPositionX(boolean bottom)
bottom
- is false if top of text, true if bottomdouble getTextPositionY(boolean bottom)
bottom
- is false if top of text, true if bottomvoid setFont(java.awt.Font f, boolean underline, boolean strikeOut, boolean doubleStrike)
f
- current font.underline
- current font.strikeOut
- current font.doubleStrike
- strikeOut font.boolean isFontUnderline()
boolean isFontStrikeOut()
java.awt.Font getFont()
java.awt.FontMetrics getFontMetrics()
void setLineExtend(double extend)
extend
- - extend the line (true) or don't (false)void setPitch(int pitchType)
pitchType
- - the amount of pitchvoid setTabStop(double tabStops)
tabStops
- - the number of tabsjava.awt.Color getTextColor()
void setTextColor(java.awt.Color textColor)
textColor
- - the text colorvoid setTextPositionX(double xpos, boolean bottom)
xpos
- is the text positionbottom
- is true if bottom, false if topvoid setTextPositionY(double ypos, boolean bottom)
ypos
- is the text positionbottom
- is true if bottom, false if topvoid textOut(java.lang.String text, double xpos, double ypos, boolean box, boolean shade)
text
- - the textxpos
- - the position of the textypos
- - the position of the textbox
- - draw a box around the textshade
- - the shading of the textboolean write(java.lang.String text)
text
- - the text to writejava.awt.Dimension getTextExtent(java.lang.String text)
text
- - the text to extendvoid setLeftMargin(double leftMargin)
leftMargin
- - the left margin to setdouble getLeftMargin()
void setTopMargin(double topMargin)
topMargin
- - the top margin to setdouble getTopMargin()
void setBottomMargin(double bottomMargin)
bottomMargin
- - the bottom margin to setdouble getBottomMargin()
void setDeviceMode(java.lang.String attrib, java.lang.String value)
attrib
- - the attributes to setvalue
- - the value to setjava.lang.String getDeviceCapability(java.lang.String attrib)
attrib
- the String attribute namevoid setEscapeSequences(boolean state)
state
- - true if escape if sequences are to be enabled.java.lang.String getPrinterInfo(java.lang.String attrib)
attrib
- - the attrib to getvoid setConnectorThickness(int thickness)
thickness
- - the thickness to setvoid setConnector(double xpos, double ypos, int type)
xpos
- - the x position to setypos
- - the y position to settype
- - the type of connectorvoid setXORMode(java.awt.Color c)
c
- - the color to XORvoid setPaintMode()
java.lang.String command(java.lang.String command)
command
- - the command to get