Java JTabbedPane getParagraphStyle(SimpleAttributeSet attrSet, int align, float firstLineIndent, float leftIndent, float rightIndent, float lineSpace, float spaceAbove, float spaceBelow, TabSet tabs)

Here you can find the source of getParagraphStyle(SimpleAttributeSet attrSet, int align, float firstLineIndent, float leftIndent, float rightIndent, float lineSpace, float spaceAbove, float spaceBelow, TabSet tabs)

Description

get Paragraph Style

License

LGPL

Declaration

public static SimpleAttributeSet getParagraphStyle(SimpleAttributeSet attrSet, int align, float firstLineIndent,
        float leftIndent, float rightIndent, float lineSpace, float spaceAbove, float spaceBelow, TabSet tabs) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.StyleConstants;
import javax.swing.text.TabSet;

public class Main {

    public static SimpleAttributeSet getParagraphStyle(SimpleAttributeSet attrSet, int align, float firstLineIndent,
            float leftIndent, float rightIndent, float lineSpace, float spaceAbove, float spaceBelow, TabSet tabs) {
        if (attrSet == null) {
            attrSet = new SimpleAttributeSet();
        }//from   w  ww. j a v  a  2 s  . co  m

        if (align >= 0)
            StyleConstants.setAlignment(attrSet, align);
        if (firstLineIndent >= 0)
            StyleConstants.setFirstLineIndent(attrSet, firstLineIndent);
        if (leftIndent >= 0)
            StyleConstants.setLeftIndent(attrSet, leftIndent);
        if (rightIndent >= 0)
            StyleConstants.setRightIndent(attrSet, rightIndent);
        if (lineSpace >= 0)
            StyleConstants.setLineSpacing(attrSet, lineSpace);
        if (spaceAbove >= 0)
            StyleConstants.setSpaceAbove(attrSet, spaceAbove);
        if (spaceBelow >= 0)
            StyleConstants.setSpaceBelow(attrSet, spaceBelow);
        if (tabs != null)
            StyleConstants.setTabSet(attrSet, tabs);

        return attrSet;
    }
}

Related

  1. getIndexOf(JTabbedPane tabbedPane, Component component)
  2. getJTabbedPaneAncestor(Component c)
  3. getLineTabs(StyledDocument doc, int startOffset)
  4. getNextSubTabIndex(JTabbedPane tabs, int tabIndex)
  5. getOffsetOfVirtualColumn(Segment seg, int tabSize, int column, int[] totalVirtualWidth)
  6. getTabbedPaneComponentIndex(JTabbedPane tabbedPane, String title)
  7. getTabbedPaneFor(Component c)
  8. getTabComponentIndex(JTabbedPane tbp, Component component)
  9. getTabIndex(final JTabbedPane tabs, final String title)