public class RMText extends RMRectangle
RMXString xstring = new RMXString("Hello world!", RMFont.getFont("Arial", 12), RMColor.red); RMText text = new RMText(xstring); template.getPage(0).addChild(text); text.setXY(36, 36); text.setSizeToFit();
Modifier and Type | Field and Description |
---|---|
static byte |
ALIGN_BOTTOM |
static byte |
ALIGN_CENTER |
static byte |
ALIGN_FULL |
static byte |
ALIGN_LEFT |
static byte |
ALIGN_MIDDLE |
static byte |
ALIGN_RIGHT |
static byte |
ALIGN_TOP |
static byte |
WRAP_BASIC |
static byte |
WRAP_NONE |
static byte |
WRAP_SCALE |
WRAP_TYPE_BOTH, WRAP_TYPE_NONE
Constructor and Description |
---|
RMText()
Creates an empty text instance.
|
RMText(RMXString string)
Creates a text instance initialized with the given RMXString.
|
RMText(java.lang.String plainText)
Creates a text instance initialized with the given plain text String.
|
Modifier and Type | Method and Description |
---|---|
RMText |
clone()
Standard clone implementation.
|
void |
copyText(RMText aText)
Copies attributes from given object.
|
boolean |
equals(java.lang.Object anObj)
Standard equals implementation.
|
void |
fromXMLFinish(com.reportmill.archiver.RXArchiver anArchiver,
com.reportmill.archiver.RXElement anElement)
XML reference unarchival - to unarchive linked text.
|
java.lang.Object |
fromXMLShape(com.reportmill.archiver.RXArchiver anArchiver,
com.reportmill.archiver.RXElement anElement,
java.lang.Object anOwner)
XML unarchival.
|
byte |
getAlign()
Returns the alignment for char 0.
|
java.lang.String |
getAlignString()
Returns the alignment as a string, one of: "left", "center" or "right".
|
byte |
getAlignVertical()
Returns the vertical alignment.
|
java.lang.String |
getAlignVerticalString()
Returns the vertical alignment as a string (one of: "top", "middle" or "bottom").
|
RMRect |
getBoundsFromTextBounds(RMRect aRect)
Returns bounds from given text bounds, adjusted to account for text margins.
|
float |
getCharSpacing()
Returns the char spacing at char 0.
|
boolean |
getCoalesceNewlines()
Returns whether text should coalesce consecutive newlines in rpgClone.
|
boolean |
getDrawsSelectionRect()
Returns whether text should always draw at least a light gray border (useful when editing).
|
RMFont |
getFont()
Returns the font for char 0.
|
RMFormat |
getFormat()
Returns the format for char 0.
|
float |
getHeightToFit()
Returns the ideal height for this RMText.
|
float |
getHeightToFit(boolean includeFinalEmptyLine)
Returns the ideal height for this RMText.
|
float |
getLineGap()
Returns the line gap at char 0.
|
float |
getLineHeightMax()
Returns the maximum line height at char 0.
|
float |
getLineHeightMin()
Returns the minimum line height at char 0.
|
float |
getLineSpacing()
Returns the line spacing at char 0.
|
com.reportmill.shape.RMLinkedText |
getLinkedText()
Returns the linked text for this text (if any).
|
java.awt.Insets |
getMargin()
Returns margin.
|
int |
getMarginBottom()
Returns the bottom margin of the text (defaults to 0).
|
java.awt.Insets |
getMarginDefault()
Returns the default margin of the text (top=1, left=2, right=2, bottom=0).
|
int |
getMarginLeft()
Returns the left margin of the text (default to 2).
|
int |
getMarginRight()
Returns the right margin of the text (defaults to 2).
|
java.lang.String |
getMarginString()
Returns the margin as a string.
|
int |
getMarginTop()
Returns the top margin of the text (defaults to 1).
|
RMPath |
getMaskPath()
Overridden from RMShape to provide the outlines of all the glyphs
|
java.lang.Object |
getObject()
Bogus accessor to provide type information for setObject.
|
RMXString.Outline |
getOutline()
Returns the outline for char 0.
|
RMPath |
getPath()
Returns the path for this shape.
|
RMPath |
getPathInBounds()
Overrides shape implementation to pass through getPathInBounds(inset).
|
RMPath |
getPathInBounds(int inset)
Returns the shape's path scaled to the shape's current bounds.
|
RMShape |
getPathShape()
Returns the shape that provides the path for this text to wrap text to.
|
boolean |
getPerformsWrap()
Returns whether text should wrap around other shapes that cause wrap.
|
RMSize |
getPreferredSizeImpl()
Override to return layout preferred size (unless this text is scaling fonts to fit).
|
java.lang.String |
getText()
Returns the text associated with this RMText as a plain String.
|
RMRect |
getTextBounds()
Returns the actual bounding rect of the text (currently just inset 2 pixels on either side).
|
RMColor |
getTextColor()
Returns the color of the first character of the xstring associated with this RMText.
|
com.reportmill.text.RMTextLayout |
getTextLayout()
Returns a text layout configured for this text, with layout already performed.
|
com.reportmill.text.RMTextLayout |
getTextLayout(boolean performLayout)
Returns a text layout configured for this text, with an option to perform layout.
|
int |
getVisibleEnd()
Returns the last character index visible in this text.
|
int |
getVisibleStart()
Returns the first character index visible in this text.
|
float |
getWidthToFit()
Returns the ideal width for this RMText.
|
byte |
getWraps()
Returns the wrapping behavior for over-filled rpgCloned text (NONE, WRAP, SHRINK).
|
RMXString |
getXString()
Returns the XString associated with this RMText.
|
boolean |
isAllTextVisible()
Returns whether all characters can be visibly rendered in text bounds.
|
boolean |
isStructured()
Editor method.
|
boolean |
isUnderlined()
Returns if char 0 is underlined.
|
int |
length()
Returns the length, in characters, of the XString associated with this RMText.
|
java.util.List<RMText> |
paginate()
Paginates this text by creating linked texts to show all text and returns a list of this text and the linked texts.
|
void |
paintShape(com.reportmill.shape.RMShapePainter aPainter,
java.awt.Graphics2D g)
Paints a text shape.
|
void |
peerDidChange(RMShape aShape)
This notification method is called when any peer is changed.
|
void |
repaint()
Editor method - passes on repaints to linked text.
|
void |
resolvePageReferences(com.reportmill.base.ReportMill aReportMill,
java.lang.Object userInfo)
Re-does the RPG clone to resolve any @Page@ keys (assumed to be present in userInfo).
|
void |
scaleFonts(float aFactor)
Resizes all the font's in text string by given factor.
|
void |
setAlign(int align)
Sets the align for all chars.
|
void |
setAlignVertical(byte anAlignment)
Sets the vertical alignment.
|
void |
setAlignVerticalString(java.lang.String aString)
Sets the vertical alignment by a string (one of "top", "middle" or "bottom").
|
void |
setCharSpacing(float aValue)
Sets the char spacing for the text string.
|
void |
setCoalesceNewlines(boolean aFlag)
Sets whether text should coalesce consecutive newlines in rpgClone.
|
void |
setDrawsSelectionRect(boolean aValue)
Sets whether text should always draw at least a light-gray border (useful when editing).
|
void |
setFont(RMFont aFont)
Sets the font for all characters.
|
void |
setFormat(RMFormat aFormat)
Sets the format for all characters.
|
void |
setHeightToFit(float aValue)
Sets the text's height to fit (often called with -1 to force recalc).
|
void |
setLineGap(float aHeight)
Sets the line gap for all chars.
|
void |
setLineHeightMax(float aHeight)
Sets the maximum line height for all chars.
|
void |
setLineHeightMin(float aHeight)
Sets the minimum line height for all chars.
|
void |
setLineSpacing(float aHeight)
Sets the line spacing for all chars.
|
void |
setLinkedText(com.reportmill.shape.RMLinkedText anLinkedText)
Sets the linked text for this text (if any).
|
void |
setMargin(java.awt.Insets aMargin)
Sets margin.
|
void |
setMarginString(java.lang.String aString)
Sets the margin as a string.
|
void |
setObject(java.lang.Object anObj)
Sets an object for text to perform substitution on.
|
void |
setOutline(RMXString.Outline anOutline)
Sets the Outline for all characters.
|
void |
setPathShape(RMShape aShape)
Sets the shape that provides the path for this text to wrap text to.
|
void |
setPerformsWrap(boolean aFlag)
Sets whether text should wrap around other shapes that cause wrap.
|
void |
setRadius(float aValue)
Overrides rectangle implementation to potentially force text relayout.
|
void |
setReportMill(com.reportmill.base.ReportMill aReportMill)
This method handles basic (non-wrapping) rpgCloning for RMText, with key substitution.
|
void |
setText(java.lang.String aString)
Replaces the current text associated with this RMText with the given String.
|
void |
setTextColor(RMColor aColor)
Sets the color of the characters in the XString associated with this RMText.
|
void |
setUnderlined(boolean aFlag)
Sets all chars to be underlined.
|
void |
setWraps(byte aValue)
Sets the wrapping behavior for over-filled rpgCloned text (NONE, WRAP, SHRINK).
|
void |
setXString(RMXString xString)
Sets the XString associated with this RMText.
|
boolean |
superSelectable()
Editor method - indicates that this shape can be super selected.
|
void |
textDidChange()
Sends Text property changed event.
|
java.lang.String |
toString()
Standard toSring implementation.
|
com.reportmill.archiver.RXElement |
toXMLShape(com.reportmill.archiver.RXArchiver anArchiver,
java.lang.Object anOwner)
XML archival.
|
getRadius
acceptsChildren, acceptsMouse, addBinding, addChild, addChild, addChild, addChild, animUpdate, bounds, bringShapesToFront, checkBindings, childrenSuperSelectImmediately, cloneDeep, contains, convertedPointFromShape, convertedPointToShape, convertedRectFromShape, convertedRectToShape, convertedSizeFromShape, convertedSizeToShape, convertedVectorFromShape, convertedVectorToShape, convertFromShape, convertPathFromShape, convertPathToShape, convertPointFromShape, convertPointToShape, convertRectFromShape, convertRectToShape, convertSizeFromShape, convertSizeToShape, convertToShape, convertVectorFromShape, convertVectorToShape, copyShape, createDivideShapeRemainder, createLayout, createPartClone, divideShapeFromEdge, divideShapeFromTop, doLayout, firePropertyChange, fromXML, fromXMLShapeChildren, fromXMLShapeLayout, get, get, getAction, getAncestor, getAncestorCount, getAncestorInCommon, getAnim, getAnim, getAnimator, getAnimator, getAspectMapped, getAspects, getAutosizing, getAutosizingDefault, getBinder, getBinding, getBinding, getBindingCount, getBounds, getBoundsInside, getBoundsMarked, getBoundsMarkedDeep, getBoundsOfChildren, getCausesWrap, getCausesWrapType, getChild, getChildAnimator, getChildAnimator, getChildArray, getChildClipShape, getChildContaining, getChildCount, getChildLast, getChildren, getChildrenIntersecting, getChildrenWhoCauseWrap, getChildrenWithClass, getChildrenWithClass, getChildWithClass, getChildWithName, getClipShape, getColor, getDatasetEntity, getDatasetKey, getDocument, getEffect, getFill, getFloat, getFrame, getFrame, getFrameMaxX, getFrameMaxY, getFrameX, getFrameXY, getFrameY, getHeight, getHover, getImageFill, getLayout, getLineWidth, getMaximumSize, getMaximumSizeProperty, getMaxX, getMaxY, getMinimumSize, getMinimumSizeProperty, getName, getOpacity, getOpacityDeep, getOriginal, getPageBreak, getPageBreakMax, getPageBreakPage, getPageBreakPageMax, getPageShape, getParent, getParentWithClass, getPart, getPartCount, getPartDeep, getPartDeepCount, getPreferredSize, getPreferredSizeProperty, getPreferredSizeX, getReportMill, getRoll, getRootShape, getScaleX, getScaleY, getShapesToAncestor, getShapesToDescendant, getShapesToShape, getSize, getSizeP, getSkewX, getSkewY, getStroke, getStrokeColor, getStrokeWidth, getTransform, getTransformFromShape, getTransformInverse, getTransformToShape, getUndoer, getUrl, getVisbileBounds, getVisibleBounds, getVisibleBounds, getVisibleBounds, getWidth, getX, getXY, getXYP, getY, height, indexOf, indexOfChild, intersects, isAncestor, isAnimProperty, isDescendant, isEditing, isHittable, isHittableChild, isLocked, isMouseDown, isMouseOver, isRoot, isShowing, isValid, isViewing, isVisible, isVisibleChild, isVisibleDeep, layoutReset, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, notRSS, offsetChildrenXY, offsetXY, page, pageMax, paint, paintShapeAll, paintShapeChildren, paintShapeOver, propertyChange, put, removeBinding, removeBinding, removeChild, removeChild, removeChildren, removeFromParent, repaint, revalidate, sendShapesToBack, setAction, setAutosizing, setBounds, setBounds, setCausesWrap, setCausesWrapType, setColor, setEffect, setFill, setFrame, setFrame, setFrameSize, setFrameX, setFrameXY, setFrameXY, setFrameY, setHeight, setHeightToFit, setHover, setLayout, setLayoutEnabled, setLineWidth, setLocked, setMaximumSize, setMinimumSize, setName, setOpacity, setParent, setPreferredSize, setReportMillBindings, setReportMillDeep, setRoll, setScaleX, setScaleXY, setScaleY, setSize, setSize, setSizeP, setSizeToFit, setSizeToFit, setSkewX, setSkewXY, setSkewY, setStroke, setStrokeColor, setStrokeWidth, setTime, setUrl, setVisible, setWidth, setX, setXY, setXY, setXYP, setY, shapeHidden, shapeShown, toXML, toXMLShapeChildren, toXMLShapeLayout, undoerDisable, undoerEnable, undoerSetUndoTitle, validate, width, x, y
public static final byte ALIGN_LEFT
public static final byte ALIGN_CENTER
public static final byte ALIGN_RIGHT
public static final byte ALIGN_FULL
public static final byte ALIGN_TOP
public static final byte ALIGN_MIDDLE
public static final byte ALIGN_BOTTOM
public static final byte WRAP_NONE
public static final byte WRAP_BASIC
public static final byte WRAP_SCALE
public RMText()
public RMText(RMXString string)
public RMText(java.lang.String plainText)
public RMXString getXString()
public void setXString(RMXString xString)
public int length()
public java.lang.String getText()
public void setText(java.lang.String aString)
public int getVisibleStart()
public int getVisibleEnd()
public boolean isAllTextVisible()
public void setFont(RMFont aFont)
public RMFormat getFormat()
public void setFormat(RMFormat aFormat)
public RMColor getTextColor()
getTextColor
in class RMShape
public void setTextColor(RMColor aColor)
setTextColor
in class RMShape
public boolean isUnderlined()
isUnderlined
in class RMShape
public void setUnderlined(boolean aFlag)
setUnderlined
in class RMShape
public RMXString.Outline getOutline()
getOutline
in class RMShape
public void setOutline(RMXString.Outline anOutline)
setOutline
in class RMShape
public byte getAlign()
public void setAlign(int align)
public java.lang.String getAlignString()
public byte getAlignVertical()
public void setAlignVertical(byte anAlignment)
public java.lang.String getAlignVerticalString()
public void setAlignVerticalString(java.lang.String aString)
public byte getWraps()
public void setWraps(byte aValue)
public boolean getPerformsWrap()
public void setPerformsWrap(boolean aFlag)
public boolean getCoalesceNewlines()
public void setCoalesceNewlines(boolean aFlag)
public boolean getDrawsSelectionRect()
public void setDrawsSelectionRect(boolean aValue)
public float getCharSpacing()
public void setCharSpacing(float aValue)
public float getLineSpacing()
public void setLineSpacing(float aHeight)
public float getLineGap()
public void setLineGap(float aHeight)
public float getLineHeightMin()
public void setLineHeightMin(float aHeight)
public float getLineHeightMax()
public void setLineHeightMax(float aHeight)
public java.awt.Insets getMargin()
public void setMargin(java.awt.Insets aMargin)
public java.awt.Insets getMarginDefault()
public java.lang.String getMarginString()
public void setMarginString(java.lang.String aString)
public int getMarginLeft()
public int getMarginRight()
public int getMarginTop()
public int getMarginBottom()
public RMRect getTextBounds()
public RMRect getBoundsFromTextBounds(RMRect aRect)
public RMPath getPath()
getPath
in class RMRectangle
public RMPath getPathInBounds()
getPathInBounds
in class RMShape
public RMPath getPathInBounds(int inset)
public void textDidChange()
public void peerDidChange(RMShape aShape)
public RMShape getPathShape()
public void setPathShape(RMShape aShape)
public void setRadius(float aValue)
setRadius
in class RMRectangle
public com.reportmill.shape.RMLinkedText getLinkedText()
public void setLinkedText(com.reportmill.shape.RMLinkedText anLinkedText)
public com.reportmill.text.RMTextLayout getTextLayout()
public com.reportmill.text.RMTextLayout getTextLayout(boolean performLayout)
public RMSize getPreferredSizeImpl()
getPreferredSizeImpl
in class RMShape
public float getWidthToFit()
public float getHeightToFit()
public float getHeightToFit(boolean includeFinalEmptyLine)
public void setHeightToFit(float aValue)
public void scaleFonts(float aFactor)
public void setReportMill(com.reportmill.base.ReportMill aReportMill)
setReportMill
in class RMShape
public java.lang.Object getObject()
public void setObject(java.lang.Object anObj)
public java.util.List<RMText> paginate()
public void resolvePageReferences(com.reportmill.base.ReportMill aReportMill, java.lang.Object userInfo)
resolvePageReferences
in class RMShape
public RMPath getMaskPath()
getMaskPath
in class RMShape
public boolean superSelectable()
superSelectable
in class RMShape
public boolean isStructured()
public void repaint()
public void paintShape(com.reportmill.shape.RMShapePainter aPainter, java.awt.Graphics2D g)
paintShape
in class RMShape
public void copyText(RMText aText)
public boolean equals(java.lang.Object anObj)
equals
in class RMRectangle
public com.reportmill.archiver.RXElement toXMLShape(com.reportmill.archiver.RXArchiver anArchiver, java.lang.Object anOwner)
toXMLShape
in class RMRectangle
public java.lang.Object fromXMLShape(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement, java.lang.Object anOwner)
fromXMLShape
in class RMRectangle
public void fromXMLFinish(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement)