/** * Sets the horizontal alignment to apply. * * @param alignment the horizontal alignment to set * @throws IllegalArgumentException if not one of the constants allowed as horizontal alignment, * that is one of LEADING, LEFT, CENTER, RIGHT, TRAILING */ public void setHorizontalAlignment(int alignment) { if (getHorizontalAlignment() == alignment) return; this.alignment = checkHorizontalAlignment(alignment); fireStateChanged(); }
/** * Instantiates a FontHighlighter with the given HighlightPredicate and null Font. * * @param predicate the HighlightPredicate to use, may be null to default to ALWAYS. * @param alignment the horizontal alignment to use. * @throws IllegalArgumentException if not one of the constants allowed as horizontal alignment, * that is one of LEADING, LEFT, CENTER, RIGHT, TRAILING */ public AlignmentHighlighter(HighlightPredicate predicate, int alignment) { super(predicate); this.alignment = checkHorizontalAlignment(alignment); }
/** * {@inheritDoc} <p> * * Implemented to set the horizontal alignement of the rendering component. */ @Override protected Component doHighlight(Component renderer, ComponentAdapter adapter) { if (renderer instanceof JLabel) { ((JLabel) renderer).setHorizontalAlignment(getHorizontalAlignment()); } else if (renderer instanceof AbstractButton ) { ((AbstractButton) renderer).setHorizontalAlignment(getHorizontalAlignment()); } else { ((JTextField) renderer).setHorizontalAlignment(getHorizontalAlignment()); } return renderer; }
/** * Instantiates a FontHighlighter with the given HighlightPredicate and null Font. * * @param predicate the HighlightPredicate to use, may be null to default to ALWAYS. * @param alignment the horizontal alignment to use. * @throws IllegalArgumentException if not one of the constants allowed as horizontal alignment, * that is one of LEADING, LEFT, CENTER, RIGHT, TRAILING */ public AlignmentHighlighter(HighlightPredicate predicate, int alignment) { super(predicate); this.alignment = checkHorizontalAlignment(alignment); }
/** * {@inheritDoc} <p> * * Implemented to set the horizontal alignement of the rendering component. */ @Override protected Component doHighlight(Component renderer, ComponentAdapter adapter) { if (renderer instanceof JLabel) { ((JLabel) renderer).setHorizontalAlignment(getHorizontalAlignment()); } else if (renderer instanceof AbstractButton ) { ((AbstractButton) renderer).setHorizontalAlignment(getHorizontalAlignment()); } else { ((JTextField) renderer).setHorizontalAlignment(getHorizontalAlignment()); } return renderer; }
/** * Sets the horizontal alignment to apply. * * @param alignment the horizontal alignment to set * @throws IllegalArgumentException if not one of the constants allowed as horizontal alignment, * that is one of LEADING, LEFT, CENTER, RIGHT, TRAILING */ public void setHorizontalAlignment(int alignment) { if (getHorizontalAlignment() == alignment) return; this.alignment = checkHorizontalAlignment(alignment); fireStateChanged(); }
/** * Instantiates a FontHighlighter with the given HighlightPredicate and null Font. * * @param predicate the HighlightPredicate to use, may be null to default to ALWAYS. * @param alignment the horizontal alignment to use. * @throws IllegalArgumentException if not one of the constants allowed as horizontal alignment, * that is one of LEADING, LEFT, CENTER, RIGHT, TRAILING */ public AlignmentHighlighter(HighlightPredicate predicate, int alignment) { super(predicate); this.alignment = checkHorizontalAlignment(alignment); }
/** * {@inheritDoc} <p> * * Implemented to set the horizontal alignement of the rendering component. */ @Override protected Component doHighlight(Component renderer, ComponentAdapter adapter) { if (renderer instanceof JLabel) { ((JLabel) renderer).setHorizontalAlignment(getHorizontalAlignment()); } else if (renderer instanceof AbstractButton ) { ((AbstractButton) renderer).setHorizontalAlignment(getHorizontalAlignment()); } else { ((JTextField) renderer).setHorizontalAlignment(getHorizontalAlignment()); } return renderer; }
/** * Sets the horizontal alignment to apply. * * @param alignment the horizontal alignment to set * @throws IllegalArgumentException if not one of the constants allowed as horizontal alignment, * that is one of LEADING, LEFT, CENTER, RIGHT, TRAILING */ public void setHorizontalAlignment(int alignment) { if (getHorizontalAlignment() == alignment) return; this.alignment = checkHorizontalAlignment(alignment); fireStateChanged(); }
/** * Instantiates a FontHighlighter with the given HighlightPredicate and null Font. * * @param predicate the HighlightPredicate to use, may be null to default to ALWAYS. * @param alignment the horizontal alignment to use. * @throws IllegalArgumentException if not one of the constants allowed as horizontal alignment, * that is one of LEADING, LEFT, CENTER, RIGHT, TRAILING */ public AlignmentHighlighter(HighlightPredicate predicate, int alignment) { super(predicate); this.alignment = checkHorizontalAlignment(alignment); }
/** * {@inheritDoc} <p> * * Implemented to set the horizontal alignement of the rendering component. */ @Override protected Component doHighlight(Component renderer, ComponentAdapter adapter) { if (renderer instanceof JLabel) { ((JLabel) renderer).setHorizontalAlignment(getHorizontalAlignment()); } else if (renderer instanceof AbstractButton ) { ((AbstractButton) renderer).setHorizontalAlignment(getHorizontalAlignment()); } else { ((JTextField) renderer).setHorizontalAlignment(getHorizontalAlignment()); } return renderer; }
/** * Sets the horizontal alignment to apply. * * @param alignment the horizontal alignment to set * @throws IllegalArgumentException if not one of the constants allowed as horizontal alignment, * that is one of LEADING, LEFT, CENTER, RIGHT, TRAILING */ public void setHorizontalAlignment(int alignment) { if (getHorizontalAlignment() == alignment) return; this.alignment = checkHorizontalAlignment(alignment); fireStateChanged(); }