public void setTitleSuffix(String suffix) { final JLabel label = (JLabel) titledSeparator.getLabelComponent(); if (suffix == null || suffix.trim().length() == 0) { label.setText(axisName); } else { label.setText(axisName + " (" + suffix.trim() + ")"); } titledSeparator.repaint(); }
/** * Sets the bars vertical alignment. * * @param barAlignment Valid values are: SwingConstants.TOP, SwingConstants.CENTER or SwingConstants.BOTTOM. * @see #getBarAlignment */ public void setBarAlignment(int barAlignment) { int oldValue = _barAlignment; if (barAlignment != oldValue) { _barAlignment = barAlignment; firePropertyChange(PROPERTY_BAR_ALIGNMENT, oldValue, _barAlignment); validateTitledSeparator(); repaint(); } }
/** * Sets the texts horizontal alignment. * * @param textAlignment an int representing the texts horizontal position. Valid values are: SwingConstants.LEFT, * SwingConstants.RIGHT, SwingConstants.LEADING or SwingConstants.TRAILING. * @see #getTextAlignment */ public void setTextAlignment(int textAlignment) { int oldValue = _textAlignment; if (textAlignment != oldValue) { _textAlignment = textAlignment; firePropertyChange(PROPERTY_TEXT_ALIGNMENT, oldValue, _textAlignment); validateTitledSeparator(); repaint(); } }
/** * Sets the labelComponent part of this Titled Separator. * * @param labelComponent the component holding the text to display as the title. * @see #getLabelComponent */ public void setLabelComponent(JComponent labelComponent) { JComponent oldValue = _labelComponent; if (!JideSwingUtilities.equals(oldValue, labelComponent)) { _labelComponent = labelComponent; firePropertyChange(PROPERTY_LABEL, oldValue, _labelComponent); validateTitledSeparator(); repaint(); } }
/** * Sets the border to be used as the graphical line region of this Titled Separator. * * @param border Any border of type: com.jidesoft.swing.PartialEtchedBorder, com.jidesoft.swing.PartialLineBorder or * com.jidesoft.swing.PartialGradientLineBorder. * @see #getSeparatorBorder */ public void setSeparatorBorder(Border border) { Border oldValue = _border; if (!JideSwingUtilities.equals(oldValue, border)) { _border = border; firePropertyChange(PROPERTY_SEPARATOR_BORDER, oldValue, _border); validateTitledSeparator(); repaint(); } }