|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.instantbank.component.lettertemplate.util.Template
In memory representation of a letter template.
Field Summary | |
private LetterComponent |
body
The body component. |
private int |
bottomMargin
Bottom margin (in twips = 1/1440 inches). |
private long |
category
The category code (for the template) in the data base. |
private LetterComponent |
closing
The closing component. |
private long |
code
The Template code in the data base. |
private LetterComponent |
header
The header component. |
static int |
LASER
Integer code for the LASER print type. |
private int |
leftMargin
Left margin (in twips = 1/1440 inches). |
private java.lang.String |
name
The name of the template |
static int |
NEW_COMPONENT
The template has changed one of its components. |
static int |
OK
The template can be saved without worrying about its components. |
private int |
printType
The print type: LASER/TYPEWRITTER |
private int |
rightMargin
Right margin (in twips = 1/1440 inches). |
int |
saveStatus
Save status for the template: OK or NEW_COMPONENT. |
private java.lang.String |
stamp
The time stamp of the last time the template was saved. |
private int |
topMargin
Top margin (in twips = 1/1440 inches). |
static int |
TYPEWRITTER
Integer code for the TYPEWRITTER print type. |
Constructor Summary | |
Template(int printType)
Basic constructor used to initialize the Template when the editor starts. |
|
Template(long code,
java.lang.String name,
long category,
int printType,
LetterComponent header,
LetterComponent body,
LetterComponent closing,
java.lang.String timeStamp,
int leftMargin,
int rightMargin,
int topMargin,
int bottomMargin)
Big constructor, defines explicitly all the attributes of the Template. |
Method Summary | |
private java.lang.String |
buildRtfMargins()
|
java.lang.String |
codesToString()
Produces a human readable/printable version of the code, name and stamp attributes of this template and its components. |
java.lang.String |
extractRtf()
Produces the append of the rtf text contained in the header, body and closing of this template. |
java.util.ArrayList[] |
getAllImages()
Produces an array with information of images, in ascending order through all the text. |
java.util.ArrayList[] |
getAllVariables()
Produces an array with information of variables, in ascending order through all the text. |
LetterComponent |
getBody()
Getter method for body |
int |
getBottomMargin()
Getter method for bottomMargin |
long |
getCategory()
Getter method for category |
LetterComponent |
getClosing()
Getter method for closing |
long |
getCode()
Getter method for code |
LetterComponent |
getComponent(int compType)
Gets a component of the template from its type. |
LetterComponent |
getHeader()
Getter method for header |
int |
getLeftMargin()
Getter method for leftMargin |
java.lang.String |
getName()
Getter method for name |
int |
getPrintType()
Getter method for printType |
int |
getRightMargin()
Getter method for rightMargin |
int |
getSaveStatus()
Getter methos for saveStatus . |
java.lang.String |
getStamp()
Getter method for stamp |
int |
getTopMargin()
Getter method for topMargin |
boolean |
hasChanged()
Test if this template has changed; i.e, if any of its components has changed. |
boolean |
hasImages()
Tests if this template contains images. |
boolean |
hasVariables()
Tests if this template contains variables. |
void |
outOfDate()
Sets to true all of its component's "hasChanged" attribute. |
void |
setBody(LetterComponent cmp)
Setter method for body |
void |
setBottomMargin(int twips)
Setter method for Margin |
void |
setCategory(long c)
Setter method for category |
void |
setClosing(LetterComponent cmp)
Setter method for closing |
void |
setCode(long code)
Setter method for code |
void |
setComponent(int compType,
LetterComponent comp)
Changes a template's component. |
void |
setHeader(LetterComponent cmp)
Setter method for header |
void |
setLeftMargin(int twips)
Setter method for leftMargin |
void |
setName(java.lang.String nm)
Setter method for name |
java.util.ArrayList[] |
setOfVariables()
Calculates the set --without repetitions-- of codes of variables mentioned in any of the components of this template. |
void |
setPrintType(int p)
Setter method for printType |
void |
setRightMargin(int twips)
Setter method for rightMargin |
void |
setSaveStatus(int status)
Setter method for saveStatus |
void |
setStamp(java.lang.String s)
Setter method for stamp |
void |
setTopMargin(int twips)
Setter method for topMargin |
java.lang.String |
toFoTemplate()
Transform this LetterTemplate in a "fo-template" without external references to image files. |
void |
upToDate()
Sets to false all of its component's "hasChanged" attribute. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int LASER
public static final int TYPEWRITTER
public static final int OK
public static final int NEW_COMPONENT
private LetterComponent header
private LetterComponent body
private LetterComponent closing
private java.lang.String name
private long code
private long category
private int printType
private java.lang.String stamp
public int saveStatus
private int leftMargin
private int rightMargin
private int topMargin
private int bottomMargin
Constructor Detail |
public Template(int printType)
printType
- The print type: LASER, TYPEWRITER.public Template(long code, java.lang.String name, long category, int printType, LetterComponent header, LetterComponent body, LetterComponent closing, java.lang.String timeStamp, int leftMargin, int rightMargin, int topMargin, int bottomMargin)
code
- Template's codename
- Template's descriptioncategory
- Template's categoryprintType
- Print type (lase, typewriter)header
- Header componentbody
- Body componentclosing
- Closing componenttimeStamp
- Time stamp when this template was saved for the last time.leftMargin
- Left margin when printed/previewed (in twips)rightMargin
- Left margin when printed/previewed (in twips)topMargin
- Left margin when printed/previewed (in twips)bottomMargin
- Left margin when printed/previewed (in twips)Method Detail |
public long getCode()
code
getCode
in interface LetterViewable
public void setCode(long code)
code
code
- The new code valuepublic long getCategory()
category
public void setCategory(long c)
category
c
- The new category valuepublic int getPrintType()
printType
getPrintType
in interface LetterViewable
public void setPrintType(int p)
printType
p
- The new printType valuepublic java.lang.String getName()
name
getName
in interface LetterViewable
public void setName(java.lang.String nm)
name
nm
- The new name valuepublic LetterComponent getHeader()
header
public void setHeader(LetterComponent cmp)
header
cmp
- The new header valuepublic LetterComponent getBody()
body
public void setBody(LetterComponent cmp)
body
cmp
- The new body valuepublic LetterComponent getClosing()
closing
public void setClosing(LetterComponent cmp)
closing
cmp
- The new closing valuepublic java.lang.String getStamp()
stamp
public void setStamp(java.lang.String s)
stamp
s
- The new stamp valuepublic int getSaveStatus()
saveStatus
.public void setSaveStatus(int status)
saveStatus
status
- The new saveStatus valuepublic LetterComponent getComponent(int compType)
compType
- Type of the component: LetterComponent.HEADER
,
LetterComponent.BODY
, LetterComponent.CLOSING
.public void setComponent(int compType, LetterComponent comp)
compType
- The type of the component to be changed: LetterComponent.HEADER
, LetterComponent.BODY
, LetterComponent.CLOSING
.comp
- The component that replaces the original one.public int getLeftMargin()
public void setLeftMargin(int twips)
twips
- left margin (in twips).public int getRightMargin()
public void setRightMargin(int twips)
twips
- right margin (in twips).public int getTopMargin()
public void setTopMargin(int twips)
twips
- margin (in twips).public int getBottomMargin()
public void setBottomMargin(int twips)
twips
- margin (in twips).public java.lang.String codesToString()
public java.util.ArrayList[] setOfVariables()
setOfVariables
in interface LetterViewable
public java.util.ArrayList[] getAllImages()
getAllImages
in interface LetterViewable
public java.util.ArrayList[] getAllVariables()
public boolean hasVariables()
hasVariables
in interface LetterViewable
public boolean hasImages()
public boolean hasChanged()
public void upToDate()
public void outOfDate()
public java.lang.String extractRtf()
{\fonttbl\f0\fnil Monospaced;\f1\fnil Times New Roman;\f2\fnil Arial;}by something with actual font families like:
{\fonttbl\f0\fmodern Courier;\f1\froman Times;\f2\fswiss helvetica;}
public java.lang.String toFoTemplate()
toFoTemplate
in interface LetterViewable
private java.lang.String buildRtfMargins()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |