public class TextBaselineShift extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BASELINE |
static TextBaselineShift |
DEFAULT_SHIFT |
static int |
LENGTH |
static int |
PERCENTAGE |
static int |
SUBSCRIPT |
static int |
SUPERSCRIPT |
| Constructor and Description |
|---|
TextBaselineShift()
Default constructor.
|
TextBaselineShift(double dPercentage)
Create a baseline shift with a percentage offset
|
TextBaselineShift(int eType,
int nLevel)
Create a baseline shift by type, with optional level.
|
TextBaselineShift(String sString,
boolean bSuppressInversion)
Create a baseline shift from a string
|
TextBaselineShift(TextBaselineShift oSource)
Copy constructor
|
TextBaselineShift(UnitSpan oLength)
Create a baseline shift with a fixed offset
|
| Modifier and Type | Method and Description |
|---|---|
UnitSpan |
applyShift(UnitSpan oStartingBaseline,
UnitSpan oLineHeight)
Apply this baseline shift to a baseline value
|
TextBaselineShift |
copyFrom(TextBaselineShift oSource)
Assignment operator
|
boolean |
equals(Object object)
Equality operator
|
UnitSpan[] |
flatten(UnitSpan oStartingBaseline,
UnitSpan oLineHeight,
UnitSpan poFontSize)
Apply this baseline shift to a baseline value and return font size
|
UnitSpan |
getLength()
Return the absolute shift.
|
int |
getLevel()
Return the subscript or superscript level.
|
double |
getPercentage()
Return the percentage shift.
|
String |
getString(boolean bSuppressInversion)
Represent the value of this shift as a string
|
int |
getType()
Return the type of shift.
|
int |
hashCode() |
boolean |
isDownShift()
Find out whether this shift adjusts in the positive (down/subscript)
direction or not.
|
boolean |
isNeutral()
Find out whether this shift has no effect.
|
boolean |
notEqual(TextBaselineShift oCompare)
Inequality operator
|
public static final int BASELINE
public static final int PERCENTAGE
public static final int LENGTH
public static final int SUBSCRIPT
public static final int SUPERSCRIPT
public static final TextBaselineShift DEFAULT_SHIFT
public TextBaselineShift()
public TextBaselineShift(TextBaselineShift oSource)
oSource - the TextBaselineShift object to copypublic TextBaselineShift(double dPercentage)
dPercentage - the amount to shift by. Negative percentages shift
up, positive values shift down. The percentage is relative to the current
line height.public TextBaselineShift(UnitSpan oLength)
oLength - the absolute value to shift by. Negative values shift up,
positive values shift down.public TextBaselineShift(int eType,
int nLevel)
This constructor is intended primarily to create subscript and superscript baseline shifts. It can take any type code, but if that code is not for a subscript or superscript, the shift is effectively neutral.
eType - - Type code for the new shift object.nLevel - - Subscript or superscript level. Ignored if the type
code is for something other than subscript or superscript. Defaults
to one.public TextBaselineShift(String sString, boolean bSuppressInversion)
sString - a textual representation of the baseline value. Should be
something like "baseline" or "15%" or "2pt".public UnitSpan[] flatten(UnitSpan oStartingBaseline, UnitSpan oLineHeight, UnitSpan poFontSize)
oStartingBaseline - the current baseline positionoLineHeight - The height of the current linepublic UnitSpan applyShift(UnitSpan oStartingBaseline, UnitSpan oLineHeight)
oStartingBaseline - the current baseline positionoLineHeight - The height of the current linepublic String getString(boolean bSuppressInversion)
public int getType()
public UnitSpan getLength()
public double getPercentage()
public int getLevel()
public boolean isNeutral()
public boolean isDownShift()
public TextBaselineShift copyFrom(TextBaselineShift oSource)
oSource - the object to copypublic boolean equals(Object object)
public boolean notEqual(TextBaselineShift oCompare)
oCompare - the object to compareCopyright © 2010 - 2020 Adobe. All Rights Reserved