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
|
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 IMathParagraph
public 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 IMathParagraph
public 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 IMathBlockCollection
public 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 IMathBlockCollection
index
- 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 IMathBlockCollection
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 IMathBlockCollection
public 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 IMathBlockCollection
mathBlock
- 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 IMathBlockCollection
mathBlock
- The object to remove from the collection.mathBlock
was successfully removed from the collection; otherwise, false.
This method also returns false if mathBlock
is not found in the original 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 IMathBlockCollection
mathBlock
- The object to locate in the collection.mathBlock
is found in the collection; otherwise, false.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 IMathBlockCollection
mathBlock
- The item to locate in the collection.mathBlock
if found in the collection; otherwise, -1.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 IMathBlockCollection
index
- 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 IMathBlockCollection
index
- 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 IMathParagraph
stream
- Target streamCopyright © 2004-2020 Aspose Pty Ltd. All Rights Reserved.