Java Swing Text Style hasDifferentCharacterAttributes(AttributeSet style, AttributeSet base)

Here you can find the source of hasDifferentCharacterAttributes(AttributeSet style, AttributeSet base)

Description

has Different Character Attributes

License

Open Source License

Declaration

public static boolean hasDifferentCharacterAttributes(AttributeSet style, AttributeSet base) 

Method Source Code


//package com.java2s;
/*/* w  ww  .j ava2  s.  c  om*/
 * This file is part of the Jose Project
 * see http://jose-chess.sourceforge.net/
 * (c) 2002-2006 Peter Sch?fer
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 */

import javax.swing.text.*;

public class Main {
    public static boolean hasDifferentCharacterAttributes(AttributeSet style, AttributeSet base) {
        return (StyleConstants.isBold(style) != StyleConstants.isBold(base))
                || (StyleConstants.isItalic(style) != StyleConstants.isItalic(base))
                || (StyleConstants.isUnderline(style) != StyleConstants.isUnderline(base))
                || (StyleConstants.getFontSize(style) != StyleConstants.getFontSize(base))
                || (!StyleConstants.getForeground(style).equals(StyleConstants.getForeground(base)));
    }
}

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. isCentered(AttributeSet attributes)
  6. isLTR(final int level)
  7. overrideStyle(Style originalStyle, Style newStyle)
  8. resolveAttributes(AttributeSet style)