com.aspose.slides

Interfaces

Classes

Exceptions

com.aspose.slides

Class MathParagraph

  • java.lang.Object
    • com.aspose.slides.MathParagraph
  • All Implemented Interfaces:
    com.aspose.ms.System.Collections.Generic.IGenericEnumerable<IMathBlock>, com.aspose.ms.System.Collections.IEnumerable<IMathBlock>, IMathBlockCollection, IMathParagraph, java.lang.Iterable<IMathBlock>


    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 Summary

      Constructors 
      Constructor and Description
      MathParagraph()
      Initializes a new instance of the MathParagraph class.
      MathParagraph(IMathBlock mathBlock)
      Initializes a new instance of the MathParagraph class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • MathParagraph

        public MathParagraph()

        Initializes a new instance of the MathParagraph class.


        Example:
         
         MathParagraph mathParagraph = new MathParagraph();
         
      • MathParagraph

        public MathParagraph(IMathBlock mathBlock)

        Initializes a new instance of the MathParagraph class.


        Example:
         
         MathParagraph mathParagraph = new MathParagraph(new MathBlock());
         
    • Method Detail

      • getJustification

        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);
         
        Specified by:
        getJustification in interface IMathParagraph
      • setJustification

        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);
         
        Specified by:
        setJustification in interface IMathParagraph
      • getParent_Immediate

        public final com.aspose.slides.IDOMObject getParent_Immediate()

        Returns Parent_Immediate object. Read-only IDOMObject.

      • getCount

        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();
         
        Specified by:
        getCount in interface IMathBlockCollection
      • get_Item

        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);
         
        Specified by:
        get_Item in interface IMathBlockCollection
        Parameters:
        index - The zero-based index of the item to get
      • set_Item

        public 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);
         
        Specified by:
        set_Item in interface IMathBlockCollection
        Parameters:
        index - The zero-based index of the item to get
      • clear

        public 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();
         
        Specified by:
        clear in interface IMathBlockCollection
      • add

        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")));
         
        Specified by:
        add in interface IMathBlockCollection
        Parameters:
        mathBlock - A mathematical block that will be added to the end of the collection
      • remove

        public 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);
         
        Specified by:
        remove in interface IMathBlockCollection
        Parameters:
        mathBlock - The object to remove from the collection.
        Returns:
        true if mathBlock was successfully removed from the collection; otherwise, false. This method also returns false if mathBlock is not found in the original collection.
      • contains

        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);
         
        Specified by:
        contains in interface IMathBlockCollection
        Parameters:
        mathBlock - The object to locate in the collection.
        Returns:
        true if mathBlock is found in the collection; otherwise, false.
      • indexOf

        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);
         
        Specified by:
        indexOf in interface IMathBlockCollection
        Parameters:
        mathBlock - The item to locate in the collection.
        Returns:
        The index of mathBlock if found in the collection; otherwise, -1.
      • insert

        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);
         
        Specified by:
        insert in interface IMathBlockCollection
        Parameters:
        index - The zero-based index at which an item should be inserted.
        mathBlock - The IMathBlock to insert.
      • removeAt

        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);
         
        Specified by:
        removeAt in interface IMathBlockCollection
        Parameters:
        index - The zero-based index of the item to remove.
      • iterator

        public final com.aspose.ms.System.Collections.Generic.IGenericEnumerator<IMathBlock> iterator()
        Specified by:
        iterator in interface com.aspose.ms.System.Collections.Generic.IGenericEnumerable<IMathBlock>
        Specified by:
        iterator in interface com.aspose.ms.System.Collections.IEnumerable<IMathBlock>
        Specified by:
        iterator in interface java.lang.Iterable<IMathBlock>
      • iteratorJava

        public final com.aspose.ms.System.Collections.IEnumerator iteratorJava()
      • writeAsMathMl

        public final void writeAsMathMl(java.io.OutputStream stream)

        Saves content of this MathParagraph as MathML

        Specified by:
        writeAsMathMl in interface IMathParagraph
        Parameters:
        stream - Target stream