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 Print ELement.
The input can be multiple lines. The first tab is expanded.
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.
Created in LayoutEngine.StringElement
(String inText, Font font, Paint paint, NamePair ID, boolean translateText) Standard Field Constructor.
Created in LayoutEngine.StringElement
(AttributedString string) Attributed String Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Layout and Calculate Size.
Set p_width and p_height.getDrillAcross
(Point relativePoint, int pageNo) Get Drill Across QuerygetDrillDown
(Point relativePoint, int pageNo) Get Drill Down QuerygetID()
Get optional IDGet Original Stringvoid
paint
(Graphics2D g2D, int pageNo, Point2D pageStart, Properties ctx, boolean isView) Paint/Print.
Calculate actual Size.
The text is printed in the topmost left position - i.e. the leading is below the line.toString()
String Representationvoid
translate
(Properties ctx) Translate Content 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 Content 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 Query- Overrides:
getDrillDown
in classPrintElement
- Parameters:
relativePoint
- point to find print elementpageNo
- page number (ignored)- Returns:
- drill down query or null
-
getDrillAcross
Get Drill Across Query- 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
-