Compiere 3.1

org.compiere.print.layout
Class StringElement

java.lang.Object
  extended by org.compiere.print.layout.PrintElement
      extended by org.compiere.print.layout.StringElement
All Implemented Interfaces:
ImageObserver

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

Field Summary
 
Fields inherited from class org.compiere.print.layout.PrintElement
LINK_COLOR, log, p_FieldAlignmentType, p_height, p_info, 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
StringElement(AttributedString string)
          Attributed String Constructor
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.
 
Method Summary
protected  boolean calculateSize()
          Layout and Calculate Size.
 Query getDrillAcross(Point relativePoint, int pageNo)
          Get Drill Across value
 Query getDrillDown(Point relativePoint, int pageNo)
          Get Drill Down value
 NamePair getID()
          Get optional ID
 String getOriginalString()
          Get Original String
 void paint(Graphics2D g2D, int pageNo, Point2D pageStart, Ctx ctx, boolean isView)
          Paint/Print.
 String toString()
          String Representation
 void translate(Ctx 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, getHeight, getHeight, getLocation, getPageCount, getWidth, imageUpdate, isTranslated, layout, setLocation, setMaxHeight, setMaxWidth, waitForLoad
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringElement

public StringElement(String inText,
                     Font font,
                     Paint paint,
                     NamePair ID,
                     boolean translateText)
Standard Field Constructor. Created in LayoutEngine

Parameters:
inText - text
font - font
paint - paint
ID - 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 boolean
font - font
paint - paint
ID - optional ID (null if document)
label - optional label
labelSuffix - 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(Ctx 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 class PrintElement
Parameters:
ctx - context

calculateSize

protected boolean calculateSize()
Layout and Calculate Size. Set p_width & p_height

Specified by:
calculateSize in class PrintElement
Returns:
Size

getDrillDown

public Query getDrillDown(Point relativePoint,
                          int pageNo)
Get Drill Down value

Overrides:
getDrillDown in class PrintElement
Parameters:
relativePoint - relative Point
pageNo - page number (ignored)
Returns:
if found query or null

getDrillAcross

public Query getDrillAcross(Point relativePoint,
                            int pageNo)
Get Drill Across value

Overrides:
getDrillAcross in class PrintElement
Parameters:
relativePoint - relative Point
pageNo - page number (ignored)
Returns:
null - not implemented

paint

public void paint(Graphics2D g2D,
                  int pageNo,
                  Point2D pageStart,
                  Ctx 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 class PrintElement
Parameters:
g2D - Graphics
pageStart - top left Location of page
pageNo - page number for multi page support (0 = header/footer) - ignored
ctx - print context
isView - true if online view (IDs are links)

toString

public String toString()
String Representation

Overrides:
toString in class PrintElement
Returns:
info

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.