|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
java.lang.Object
|
+--com.sas.Component
|
+--com.sas.awt.print.Annotation
The Annotation class can be used to construct page annotations,
such as Headers and Footers.
You can specify message strings with argument values that will be substituted appropriately. The following argument values are supported:
{page} = page number
{date} = Current date
{time} = Current time
You can also specify a TransformInterface implementation to perform
specific translations
Here's a sample usage via the constructor
Annotation myHeader = new Annotation("",
"Page {page}",
"");
Note that all line number indexes are 1-based.
TransformInterface, Serialized Form| Field Summary | |
static int |
BOTTOM
|
static String |
DATE_VARIABLE
|
protected static DateFormat |
dateFormat
|
protected static Font |
defaultFont
|
protected Length |
mBottomMargin
|
protected OrderedCollection |
mCenterMessages
|
protected Color |
mColor
|
protected Font |
mFont
|
protected Hashtable |
mFormatters
|
protected Length |
mLeftMargin
|
protected OrderedCollection |
mLeftMessages
|
protected OrderedCollection |
mLineAttributes
|
protected Length |
mRightMargin
|
protected OrderedCollection |
mRightMessages
|
protected int |
mStartPageNumber
|
protected Length |
mTopMargin
|
protected int |
mVertJust
|
static String |
PAGE_VARIABLE
|
static String |
RB_KEY
|
static String |
TIME_VARIABLE
|
protected static DateFormat |
timeFormat
|
static int |
TOP
|
| Fields inherited from interface com.sas.visuals.Alignment |
BEGIN, CENTER, END |
| Constructor Summary | |
Annotation()
Constructors |
|
Annotation(String leftMessage,
String centerMessage,
String rightMessage)
|
|
Annotation(String leftMessage,
String centerMessage,
String rightMessage,
int verticalJustification)
|
|
| Method Summary | |
void |
addTransformInterface(String text,
TransformInterface formatter)
add a TransformInterface for the given string |
Object |
clone()
clone the implementation |
protected OrderedCollection |
copyElements(OrderedCollection inCollection)
|
boolean |
equals(Object o)
|
Length |
getBottomMargin()
return bottom margin value |
protected OrderedCollection |
getCollection(int align)
|
protected Annotation.Element |
getElement(int line,
int align)
get element at given line and position; may return null if nothing is defined at the specified position |
Font |
getFont(int lineNumber,
int align)
get the Font for a specific line in the annotation at the specific Alignment |
Color |
getForeground(int lineNumber,
int align)
get the color for the text for a specific line in the annotation at the specific position (Alignment) |
Length |
getLeftMargin()
return left margin value |
protected String |
getLine(int align)
|
int |
getLineCount()
return the number of lines in the annotation |
String |
getMessage(int lineNumber,
int align)
return the message format string for the given line at the given position (Alignment) in the annotation; may return null if nothing has been defined |
Length |
getRightMargin()
return right margin value |
int |
getStartPageNumber()
gets the starting page number. |
String |
getText(int lineNumber,
int align)
get the text to be displayed at the requested Alignment on the page for a given line; any subsitution (formatting) is performed |
Length |
getTopMargin()
return top margin value |
TransformInterface |
getTransformInterface(String text)
get the TransformInterface for the given string |
Enumeration |
getTransformInterfaceKeys()
get the keys for all TransformInterfaces |
int |
getVerticalJustification()
get the vertical justification for the annotation. |
void |
removeAllTransformInterfaces()
remove all TransformInterfaces |
void |
removeTransformInterface(String text)
remove a TransformInterface for the given string |
void |
setBottomMargin(Length margin)
set the bottom margin |
void |
setFont(Font font)
set the font for all lines in the annotation |
void |
setFont(Font font,
int lineNumber)
set the font for a specific line (all Alignments) in the annotation |
void |
setFont(Font font,
int lineNumber,
int align)
set the font for a specific line (all Alignments) in the annotation |
void |
setForeground(Color color)
set the color for all lines in the annotation |
void |
setForeground(Color color,
int lineNumber)
set the color for a specific line (all Alignments) in the annotation |
void |
setForeground(Color color,
int lineNumber,
int align)
set the color for a specific line at a specific Alignment in the annotation |
void |
setLeftMargin(Length margin)
set the left margin |
void |
setMessage(String message,
int lineNumber,
int align)
set the message format string for a line at a given Alignment. |
void |
setRightMargin(Length margin)
set the right margin |
void |
setTopMargin(Length margin)
sets the top margin |
void |
setVerticalJustification(int justification)
set the vertical justification for the annotation. |
String |
toString()
override toString to return a string that represents the lines in the annotation |
| Methods inherited from class com.sas.Component |
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, beansIsDesignTime, beansSetDesignTime, clone, detachModel, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getExtendedBeanInfo, getLinkInfo, getModelInterface, getRequiredInterfaces, getResources, getStringResource, getViewInterfaceSupportInfo, initialize, initializeComponent, isDesignTime, isLinked, propertyChange, queryLinks, queryLinks, refresh, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setComponentDescription, setComponentSupportInfo, setDefaultValues, setLinkInfo, setModelInterface, setRequiredInterfaces, setViewInterfaceSupportInfo, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, validateObject |
| Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final String RB_KEY
public static final String PAGE_VARIABLE
public static final String DATE_VARIABLE
public static final String TIME_VARIABLE
protected OrderedCollection mLeftMessages
protected OrderedCollection mRightMessages
protected OrderedCollection mCenterMessages
protected OrderedCollection mLineAttributes
protected static final Font defaultFont
protected int mStartPageNumber
protected int mVertJust
protected Color mColor
protected Font mFont
protected Length mTopMargin
protected Length mBottomMargin
protected Length mLeftMargin
protected Length mRightMargin
public static final int TOP
public static final int BOTTOM
protected static DateFormat dateFormat
protected static DateFormat timeFormat
protected Hashtable mFormatters
| Constructor Detail |
public Annotation()
public Annotation(String leftMessage,
String centerMessage,
String rightMessage)
public Annotation(String leftMessage,
String centerMessage,
String rightMessage,
int verticalJustification)
| Method Detail |
public void setMessage(String message,
int lineNumber,
int align)
setMessage in interface AnnotationInterfaceString - message format stringint - - line numberint - - Alignment value
public void addTransformInterface(String text,
TransformInterface formatter)
addTransformInterface in interface AnnotationInterfaceString - to translateTransformInterface - - formatterpublic TransformInterface getTransformInterface(String text)
String - to translatepublic Enumeration getTransformInterfaceKeys()
public void removeTransformInterface(String text)
String - to translatepublic void removeAllTransformInterfaces()
public String getMessage(int lineNumber,
int align)
getMessage in interface StaticAnnotationInterfaceint - - line numberint - - Alignment valuepublic void setForeground(Color color)
setForeground in interface AnnotationInterfacecolor - - the new line color.
public void setForeground(Color color,
int lineNumber)
setForeground in interface AnnotationInterfacecolor - - the new line color.lineNumber - - the line number of the message
public void setForeground(Color color,
int lineNumber,
int align)
setForeground in interface AnnotationInterfacecolor - - the new line color.int - - the line number of the messageint - - Alignment value
public Color getForeground(int lineNumber,
int align)
getForeground in interface StaticAnnotationInterfaceint - - the line number of the messageint - - alignment valuepublic void setFont(Font font)
setFont in interface AnnotationInterfacefont - - the new line font.
public void setFont(Font font,
int lineNumber)
setFont in interface AnnotationInterfacefont - - the new line font.lineNumber - - the line number of the message
public void setFont(Font font,
int lineNumber,
int align)
setFont in interface AnnotationInterfaceFont - - the new line font.int - - the line number of the messageint - - Alignment value
public Font getFont(int lineNumber,
int align)
getFont in interface StaticAnnotationInterfaceint - - the line number of the annotationint - - Alignment valuepublic void setTopMargin(Length margin)
setTopMargin in interface AnnotationInterfaceLength - com.sas.measures.Length specifying the top marginpublic Length getTopMargin()
getTopMargin in interface StaticAnnotationInterfacepublic void setBottomMargin(Length margin)
setBottomMargin in interface AnnotationInterfaceLength - com.sas.measures.Length specifying the bottom marginpublic Length getBottomMargin()
getBottomMargin in interface StaticAnnotationInterfacepublic void setLeftMargin(Length margin)
setLeftMargin in interface AnnotationInterfaceLength - com.sas.measures.Length specifying the left marginpublic Length getLeftMargin()
getLeftMargin in interface StaticAnnotationInterfacepublic void setRightMargin(Length margin)
setRightMargin in interface AnnotationInterfaceLength - com.sas.measures.Length specifying the right marginpublic Length getRightMargin()
getRightMargin in interface StaticAnnotationInterfacepublic int getStartPageNumber()
public String getText(int lineNumber,
int align)
getText in interface StaticAnnotationInterfaceint - - line numberint - - Alignment valuepublic int getVerticalJustification()
getVerticalJustification in interface StaticAnnotationInterfacepublic void setVerticalJustification(int justification)
setVerticalJustification in interface AnnotationInterfaceint - vertical justificationpublic int getLineCount()
getLineCount in interface StaticAnnotationInterfacepublic String toString()
toString in class Objectprotected String getLine(int align)
public boolean equals(Object o)
equals in class Objectprotected final OrderedCollection getCollection(int align)
public Object clone()
AnnotationInterfaceclone in interface AnnotationInterfaceclone in class com.sas.Component
protected final Annotation.Element getElement(int line,
int align)
protected OrderedCollection copyElements(OrderedCollection inCollection)
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||