edu.stanford.hci.r3.paper.regions
Class TextRegion
java.lang.Object
edu.stanford.hci.r3.paper.Region
edu.stanford.hci.r3.paper.regions.TextRegion
public class TextRegion
- extends Region
Represents some text that can be drawn on a page.
This software is distributed under the BSD License.
Constructor Summary |
TextRegion(java.lang.String name,
java.lang.String theText,
java.awt.Font theFont,
Units origX,
Units origY)
|
TextRegion(java.lang.String name,
java.lang.String theText,
java.awt.Font theFont,
Units origX,
Units origY,
Units width,
Units height)
|
Methods inherited from class edu.stanford.hci.r3.paper.Region |
addEventHandler, getEventHandlers, getFillColor, getHeight, getIsActiveString, getName, getOpacity, getOriginX, getOriginY, getParentSheet, getScaleX, getScaleY, getShape, getStrokeColor, getUnits, getUnscaledBounds2D, getUnscaledBoundsHeight, getUnscaledBoundsWidth, getUnscaledShapeCopy, getWidth, isActive, isVisible, resetScale, scaleRegion, scaleRegionUniformly, setActive, setFillColor, setName, setOpacity, setParentSheet, setScale, setShape, setStrokeColor, setVisible |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TextRegion
public TextRegion(java.lang.String name,
java.lang.String theText,
java.awt.Font theFont,
Units origX,
Units origY)
- Parameters:
theText
- What text is displayed.theFont
- The Font Family. Specify the size in points through the font object. We will
consider the point size of the font as an exact 1/72nd of an inch translation,
regardless of the device.origX
- origY
-
TextRegion
public TextRegion(java.lang.String name,
java.lang.String theText,
java.awt.Font theFont,
Units origX,
Units origY,
Units width,
Units height)
- Parameters:
name
- theText
- theFont
- origX
- origY
- width
- override the text's actual width with this valueheight
- override the text's actual height with this value
getColor
public java.awt.Color getColor()
- Returns:
getFont
public java.awt.Font getFont()
- Returns:
getLinesOfText
public java.lang.String[] getLinesOfText()
- Returns:
getRenderer
public RegionRenderer getRenderer()
- Description copied from class:
Region
- Subclasses should override this, to customize rendering. Otherwise, you'll just get gray
boxes, which is what RegionRenderer does.
- Overrides:
getRenderer
in class Region
- Returns:
- the renderer for this region
- See Also:
Region.getRenderer()
getText
public java.lang.String getText()
- Returns:
- the internal text to be rendered.
getX
public Units getX()
- Returns:
getY
public Units getY()
- Returns:
setColor
public void setColor(java.awt.Color c)
- Parameters:
c
-
setLineWrapped
public void setLineWrapped(boolean b)
- Parameters:
b
- whether automatic line wrapping should occur. If ture, the text will be
constrained to the region boundaries.
isLineWrapped
public boolean isLineWrapped()
- Returns:
- whether automatic line wrapping should occur. If true, the text will be
constrained to the region boundaries.
setMaxLines
public void setMaxLines(int i)
- Parameters:
i
- the maximum number of lies to set. If <= 0, all lines will be set.
getMaxLines
public int getMaxLines()
- Returns:
- the maximum number of lines to be set. If <= 0, all lines will be set.
toString
public java.lang.String toString()
- Description copied from class:
Region
- Please override for more interesting output. This will print the name of the class along with
all the segments of the shape.
- Overrides:
toString
in class Region
- Returns:
- the String representation of this Region
- See Also:
Region.toString()