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
public class StringElement extends PrintElement
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:
- Serialized Form
-
-
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
Constructors Constructor Description StringElement(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
calculateSize()
Layout and Calculate Size.MQuery
getDrillAcross(Point relativePoint, int pageNo)
Get Drill Across valueMQuery
getDrillDown(Point relativePoint, int pageNo)
Get Drill Down valueNamePair
getID()
Get optional IDString
getOriginalString()
Get Original Stringvoid
paint(Graphics2D g2D, int pageNo, Point2D pageStart, Properties ctx, boolean isView)
Paint/Print.String
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 Detail
-
StringElement
public StringElement(String inText, Font font, Paint paint, NamePair ID, boolean translateText)
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
public StringElement(AttributedString string)
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 Detail
-
getID
public NamePair getID()
Get optional ID- Returns:
- ID or null
-
getOriginalString
public String getOriginalString()
Get Original String- Returns:
- original (may be null)
-
translate
public void 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.- 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
public MQuery getDrillDown(Point relativePoint, int pageNo)
Get Drill Down value- Overrides:
getDrillDown
in classPrintElement
- Parameters:
relativePoint
- relative PointpageNo
- page number (ignored)- Returns:
- if found query or null
-
getDrillAcross
public MQuery getDrillAcross(Point relativePoint, int pageNo)
Get Drill Across value- Overrides:
getDrillAcross
in classPrintElement
- Parameters:
relativePoint
- relative PointpageNo
- page number (ignored)- Returns:
- null - not implemented
-
paint
public void 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- 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
public String toString()
String Representation- Overrides:
toString
in classPrintElement
- Returns:
- info
-
-