Java Swing Text Style isCentered(AttributeSet attributes)

Here you can find the source of isCentered(AttributeSet attributes)

Description

is Centered

License

Apache License

Declaration

public static boolean isCentered(AttributeSet attributes) 

Method Source Code

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

import javax.swing.text.AttributeSet;

import javax.swing.text.StyleConstants;

public class Main {
    protected static final String ALIGN_CENTER = "align-center";

    public static boolean isCentered(AttributeSet attributes) {
        if (attributes != null) {
            if (attributes.getAttribute(StyleConstants.Alignment) != null) {
                Integer value = (Integer) attributes
                        .getAttribute(StyleConstants.Alignment);
                if (value == StyleConstants.ALIGN_CENTER) {
                    return true;
                }/* w  w  w .ja  v  a  2 s . co m*/
            }
        }

        return false;
    }
}

Related

  1. createStyle(String logicalName)
  2. getBooleanValue(Element element, Object constant)
  3. getIntegerValue(Element element, Object constant)
  4. getNextVisualPosition(final View v, final int pos, final Position.Bias b0, final int direction, final Position.Bias[] biasRet)
  5. hasDifferentCharacterAttributes(AttributeSet style, AttributeSet base)
  6. isLTR(final int level)
  7. overrideStyle(Style originalStyle, Style newStyle)
  8. resolveAttributes(AttributeSet style)
  9. unRTF(String s)