Package org.compiere.print.layout
Class StringElement
java.lang.Object
org.compiere.print.layout.PrintElement
org.compiere.print.layout.StringElement
- All Implemented Interfaces:
ImageObserver
,Serializable
String Form Print ELement.
The input can be multiple lines. The first tab is expanded.
- Version:
- $Id: StringElement.java,v 1.2 2006/07/30 00:53:02 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
-
Field Summary
Fields inherited from class org.compiere.print.layout.PrintElement
LINK_COLOR, log, p_FieldAlignmentType, p_height, p_maxHeight, p_maxWidth, p_pageLocation, p_sizeCalculated, p_width
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
ConstructorDescriptionStringElement
(Object content, Font font, Paint paint, NamePair ID, String label, String labelSuffix) Field Constructor.StringElement
(String inText, Font font, Paint paint, NamePair ID, boolean translateText) Standard Field Constructor.StringElement
(AttributedString string) Attributed String Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Layout and Calculate Size.getDrillAcross
(Point relativePoint, int pageNo) Get Drill Across valuegetDrillDown
(Point relativePoint, int pageNo) Get Drill Down valuegetID()
Get optional IDGet Original Stringvoid
paint
(Graphics2D g2D, int pageNo, Point2D pageStart, Properties ctx, boolean isView) Paint/Print.toString()
String Representationvoid
translate
(Properties ctx) Translate Context if required If content is translated, the element needs to stay in the bounds of the originally calculated size and need to align the field.Methods inherited from class org.compiere.print.layout.PrintElement
getAbsoluteLocation, getBounds, getCurrentPage, getDetailInfo, getHeight, getHeight, getLocation, getPageCount, getPageLogic, getPrintData, getRowIndex, getWidth, imageUpdate, isTranslated, layout, setCurrentPage, setLocation, setMaxHeight, setMaxWidth, setPageLogic, setPrintData, setRowIndex, waitForLoad
-
Constructor Details
-
StringElement
Standard Field Constructor. Created in LayoutEngine- Parameters:
inText
- textfont
- fontpaint
- paintID
- optional ID (null if document)translateText
- if true, check for optional text translation
-
StringElement
Attributed String Constructor- Parameters:
string
- attributed string
-
StringElement
public StringElement(Object content, Font font, Paint paint, NamePair ID, String label, String labelSuffix) Field Constructor. Created in LayoutEngine- Parameters:
content
- text or booleanfont
- fontpaint
- paintID
- optional ID (null if document)label
- optional labellabelSuffix
- optional label suffix
-
-
Method Details
-
getID
Get optional ID- Returns:
- ID or null
-
getOriginalString
Get Original String- Returns:
- original (may be null)
-
translate
Translate Context if required If content is translated, the element needs to stay in the bounds of the originally calculated size and need to align the field.- Overrides:
translate
in classPrintElement
- Parameters:
ctx
- context
-
calculateSize
protected boolean calculateSize()Layout and Calculate Size. Set p_width and p_height- Specified by:
calculateSize
in classPrintElement
- Returns:
- Size
-
getDrillDown
Get Drill Down value- Overrides:
getDrillDown
in classPrintElement
- Parameters:
relativePoint
- relative PointpageNo
- page number (ignored)- Returns:
- if found query or null
-
getDrillAcross
Get Drill Across value- Overrides:
getDrillAcross
in classPrintElement
- Parameters:
relativePoint
- relative PointpageNo
- page number (ignored)- Returns:
- null - not implemented
-
paint
Paint/Print. Calculate actual Size. The text is printed in the topmost left position - i.e. the leading is below the line- Specified by:
paint
in classPrintElement
- Parameters:
g2D
- GraphicspageStart
- top left Location of pagepageNo
- page number for multi page support (0 = header/footer) - ignoredctx
- print contextisView
- true if online view (IDs are links)
-
toString
String Representation- Overrides:
toString
in classPrintElement
- Returns:
- info
-