public class MathParagraph extends java.lang.Object implements IMathParagraph
Mathematical paragraph that is a container for mathematical blocks (IMathBlock)
Example:IAutoShape shape = slide.getShapes().addMathShape(x, y, width, height); IMathParagraph mathParagraph = ((MathPortion)shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)).getMathParagraph(); mathParagraph.setJustification(MathJustification.LeftJustified);
| Constructor and Description |
|---|
MathParagraph()
Initializes a new instance of the MathParagraph class.
|
MathParagraph(IMathBlock mathBlock)
Initializes a new instance of the MathParagraph class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(IMathBlock mathBlock)
Adds IMathBlock to the end of collection.
|
void |
clear()
Removes all elements from the collection.
|
boolean |
contains(IMathBlock mathBlock)
Determines whether the collection contains a specific value.
|
IMathBlock |
get_Item(int index)
Gets the item at the specified index.
|
int |
getCount()
Gets the number of elements actually contained in the collection.
|
int |
getJustification()
Paragraph Justification
Default value: CenteredAsGroup
|
com.aspose.slides.IDOMObject |
getParent_Immediate()
Returns Parent_Immediate object.
|
int |
indexOf(IMathBlock mathBlock)
Determines the index of a specific IMathBlock in collection.
|
void |
insert(int index,
IMathBlock mathBlock)
Inserts IMathBlock into the collection at the specified index.
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerator<IMathBlock> |
iterator() |
com.aspose.ms.System.Collections.IEnumerator |
iteratorJava() |
boolean |
remove(IMathBlock mathBlock)
Removes the first occurrence of a specific object from the collection.
|
void |
removeAt(int index)
Removes an item at the specified index of the collection.
|
void |
set_Item(int index,
IMathBlock value)
Gets the item at the specified index.
|
void |
setJustification(int value)
Paragraph Justification
Default value: CenteredAsGroup
|
java.lang.String |
toLatex()
Gets mathematical equation in LaTeX format
|
void |
writeAsMathMl(java.io.OutputStream stream)
Saves content of this
MathParagraph as MathML |
public MathParagraph()
Initializes a new instance of the MathParagraph class.
Example:MathParagraph mathParagraph = new MathParagraph();
public MathParagraph(IMathBlock mathBlock)
Initializes a new instance of the MathParagraph class.
Example:MathParagraph mathParagraph = new MathParagraph(new MathBlock());
public final int getJustification()
Paragraph Justification Default value: CenteredAsGroup
Example:IAutoShape shape = slide.getShapes().addMathShape(x, y, width, height); IMathParagraph mathParagraph = ((MathPortion)shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)).getMathParagraph(); mathParagraph.setJustification(MathJustification.LeftJustified);
getJustification in interface IMathParagraphpublic final void setJustification(int value)
Paragraph Justification Default value: CenteredAsGroup
Example:IAutoShape shape = slide.getShapes().addMathShape(x, y, width, height); IMathParagraph mathParagraph = ((MathPortion)shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)).getMathParagraph(); mathParagraph.setJustification(MathJustification.LeftJustified);
setJustification in interface IMathParagraphpublic final com.aspose.slides.IDOMObject getParent_Immediate()
Returns Parent_Immediate object.
Read-only IDOMObject.
public final int getCount()
Gets the number of elements actually contained in the collection.
Read-only int.
Example:MathParagraph mathParagraph = new MathParagraph(); int blocksCount = mathParagraph.getCount();
getCount in interface IMathBlockCollectionpublic final IMathBlock get_Item(int index)
Gets the item at the specified index.
Read-only IMathBlock.
Example:IAutoShape shape = slide.getShapes().addMathShape(x, y, width, height); IMathParagraph mathParagraph = ((MathPortion)shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)).getMathParagraph(); mathParagraph.add(new MathBlock(new MathematicalText("block1"))); mathParagraph.add(new MathBlock(new MathematicalText("block2"))); IMathBlock block = mathParagraph.get_Item(1);
get_Item in interface IMathBlockCollectionindex - The zero-based index of the item to getpublic final void set_Item(int index,
IMathBlock value)
Gets the item at the specified index.
Read-only IMathBlock.
Example:IAutoShape shape = slide.getShapes().addMathShape(x, y, width, height); IMathParagraph mathParagraph = ((MathPortion)shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)).getMathParagraph(); mathParagraph.add(new MathBlock(new MathematicalText("block1"))); mathParagraph.add(new MathBlock(new MathematicalText("block2"))); IMathBlock block = mathParagraph.get_Item(1);
set_Item in interface IMathBlockCollectionvalue - The block of a mathematical text.index - The zero-based index of the item to getpublic final void clear()
Removes all elements from the collection.
Example:IAutoShape shape = slide.getShapes().addMathShape(x, y, width, height); IMathParagraph mathParagraph = ((MathPortion)shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)).getMathParagraph(); mathParagraph.add(new MathBlock(new MathematicalText("block1"))); mathParagraph.add(new MathBlock(new MathematicalText("block2"))); mathParagraph.clear();
clear in interface IMathBlockCollectionpublic final void add(IMathBlock mathBlock)
Adds IMathBlock to the end of collection.
Example:IAutoShape shape = slide.getShapes().addMathShape(x, y, width, height); IMathParagraph mathParagraph = ((MathPortion)shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)).getMathParagraph(); mathParagraph.add(new MathBlock(new MathematicalText("x")));
add in interface IMathBlockCollectionmathBlock - A mathematical block that will be added to the end of the collectionpublic final boolean remove(IMathBlock mathBlock)
Removes the first occurrence of a specific object from the collection.
Example:IAutoShape shape = slide.getShapes().addMathShape(x, y, width, height); IMathParagraph mathParagraph = ((MathPortion)shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)).getMathParagraph(); mathParagraph.add(new MathBlock(new MathematicalText("x"))); IMathBlock block = new MathBlock(new MathematicalText("y")); mathParagraph.add(block); mathParagraph.remove(block);
remove in interface IMathBlockCollectionmathBlock - The object to remove from the collection.public final boolean contains(IMathBlock mathBlock)
Determines whether the collection contains a specific value.
Example:IAutoShape shape = slide.getShapes().addMathShape(x, y, width, height); IMathParagraph mathParagraph = ((MathPortion)shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)).getMathParagraph(); IMathBlock block = new MathBlock(new MathematicalText("y")); mathParagraph.add(block); boolean contains = mathParagraph.contains(block);
contains in interface IMathBlockCollectionmathBlock - The object to locate in the collection.public final int indexOf(IMathBlock mathBlock)
Determines the index of a specific IMathBlock in collection.
Example:IAutoShape shape = slide.getShapes().addMathShape(x, y, width, height); IMathParagraph mathParagraph = ((MathPortion)shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)).getMathParagraph(); IMathBlock block = new MathBlock(new MathematicalText("y")); mathParagraph.add(block); int index = mathParagraph.indexOf(block);
indexOf in interface IMathBlockCollectionmathBlock - The item to locate in the collection.public final void insert(int index,
IMathBlock mathBlock)
Inserts IMathBlock into the collection at the specified index.
Example:IAutoShape shape = slide.getShapes().addMathShape(x, y, width, height); IMathParagraph mathParagraph = ((MathPortion)shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)).getMathParagraph(); IMathBlock block = new MathBlock(new MathematicalText("y")); mathParagraph.insert(0, block);
insert in interface IMathBlockCollectionindex - The zero-based index at which an item should be inserted.mathBlock - The IMathBlock to insert.public final void removeAt(int index)
Removes an item at the specified index of the collection.
Example:IAutoShape shape = slide.getShapes().addMathShape(x, y, width, height); IMathParagraph mathParagraph = ((MathPortion)shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)).getMathParagraph(); IMathBlock block = new MathBlock(new MathematicalText("y")); mathParagraph.add(block); mathParagraph.removeAt(0);
removeAt in interface IMathBlockCollectionindex - The zero-based index of the item to remove.public final com.aspose.ms.System.Collections.Generic.IGenericEnumerator<IMathBlock> iterator()
iterator in interface com.aspose.ms.System.Collections.Generic.IGenericEnumerable<IMathBlock>iterator in interface com.aspose.ms.System.Collections.IEnumerable<IMathBlock>iterator in interface java.lang.Iterable<IMathBlock>public final com.aspose.ms.System.Collections.IEnumerator iteratorJava()
public final void writeAsMathMl(java.io.OutputStream stream)
Saves content of this MathParagraph as MathML
writeAsMathMl in interface IMathParagraphstream - Target streampublic final java.lang.String toLatex()
Gets mathematical equation in LaTeX format
Example:IAutoShape shape = slide.getShapes().addMathShape(x, y, width, height); IMathParagraph mathParagraph = ((MathPortion)shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)).getMathParagraph(); mathParagraph.add(new MathematicalText("a").join("+").join(new MathematicalText("b").join("=").join(new MathematicalText("c")))); String mathLatex = mathParagraph.toLatex();
toLatex in interface IMathParagraphCopyright © 2004-2025 Aspose Pty Ltd. All Rights Reserved.