/** * Sets the image for the title and notifies registered listeners that the * title has been modified. * * @param image the new image (<code>null</code> not permitted). */ public void setImage(Image image) { if (image == null) { throw new NullPointerException("ImageTitle.setImage (..): Image must not be null."); } this.image = image; notifyListeners(new TitleChangeEvent(this)); }
/** * Sets the position for the title and sends a {@link TitleChangeEvent} to all registered * listeners. * * @param position the position (<code>null</code> not permitted). */ public void setPosition(RectangleEdge position) { if (position == null) { throw new IllegalArgumentException("Null 'position' argument."); } if (this.position != position) { this.position = position; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the horizontal alignment for the title and sends a {@link TitleChangeEvent} to * all registered listeners. * * @param alignment the horizontal alignment (<code>null</code> not permitted). */ public void setHorizontalAlignment(HorizontalAlignment alignment) { if (alignment == null) { throw new IllegalArgumentException("Null 'alignment' argument."); } if (this.horizontalAlignment != alignment) { this.horizontalAlignment = alignment; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the vertical alignment for the title, and notifies any registered * listeners of the change. * * @param alignment the new vertical alignment (TOP, MIDDLE or BOTTOM, * <code>null</code> not permitted). */ public void setVerticalAlignment(VerticalAlignment alignment) { if (alignment == null) { throw new IllegalArgumentException("Argument 'alignment' cannot be null."); } if (this.verticalAlignment != alignment) { this.verticalAlignment = alignment; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the spacer for the title and sends a {@link TitleChangeEvent} to all registered * listeners. * * @param spacer the new spacer (<code>null</code> not permitted). */ public void setSpacer(Spacer spacer) { if (spacer == null) { throw new NullPointerException("AbstractTitle.setSpacer(): null not permitted."); } if (!this.spacer.equals(spacer)) { this.spacer = spacer; notifyListeners(new TitleChangeEvent(this)); } }
/** * Notifies all registered listeners that the chart title has changed in some way. * * @param event an object that contains information about the change to the title. */ protected void notifyListeners(TitleChangeEvent event) { if (this.notify) { Object[] listeners = this.listenerList.getListenerList(); for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == TitleChangeListener.class) { ((TitleChangeListener) listeners[i + 1]).titleChanged(event); } } } }
/** * Sets the title to the specified text and sends a {@link TitleChangeEvent} to all * registered listeners. * * @param text the text (<code>null</code> not permitted). */ public void setText(String text) { if (text == null) { throw new NullPointerException("TextTitle.setText(..): Text is null"); } if (!this.text.equals(text)) { this.text = text; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the font used to display the title string. Registered listeners are notified that * the title has been modified. * * @param font the new font (<code>null</code> not permitted). */ public void setFont(Font font) { // check argument... if (font == null) { throw new IllegalArgumentException("TextTitle.setFont(...): null font not permitted."); } // make the change... if (!this.font.equals(font)) { this.font = font; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the paint used to display the title string. Registered listeners are notified that * the title has been modified. * * @param paint the new paint (<code>null</code> not permitted). */ public void setPaint(Paint paint) { if (paint == null) { throw new IllegalArgumentException( "TextTitle.setPaint(...): null paint not permitted." ); } if (!this.paint.equals(paint)) { this.paint = paint; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the image for the title and notifies registered listeners that the * title has been modified. * * @param image the new image (<code>null</code> not permitted). */ public void setImage(Image image) { if (image == null) { throw new NullPointerException("Null 'image' argument."); } this.image = image; notifyListeners(new TitleChangeEvent(this)); }
/** * Sets the legend item sources and sends a {@link TitleChangeEvent} to * all registered listeners. * * @param sources the sources (<code>null</code> not permitted). */ public void setSources(LegendItemSource[] sources) { if (sources == null) { throw new IllegalArgumentException("Null 'sources' argument."); } this.sources = sources; notifyListeners(new TitleChangeEvent(this)); }
/** * Sets the location of the shape within each legend item. * * @param edge the edge (<code>null</code> not permitted). */ public void setLegendItemGraphicEdge(RectangleEdge edge) { if (edge == null) { throw new IllegalArgumentException("Null 'edge' argument."); } this.legendItemGraphicEdge = edge; notifyListeners(new TitleChangeEvent(this)); }
/** * Sets the padding that will be applied to each item graphic in the * legend and sends a {@link TitleChangeEvent} to all registered listeners. * * @param padding the padding (<code>null</code> not permitted). */ public void setLegendItemGraphicPadding(RectangleInsets padding) { if (padding == null) { throw new IllegalArgumentException("Null 'padding' argument."); } this.legendItemGraphicPadding = padding; notifyListeners(new TitleChangeEvent(this)); }
/** * Sets the item font and sends a {@link TitleChangeEvent} to * all registered listeners. * * @param font the font (<code>null</code> not permitted). */ public void setItemFont(Font font) { if (font == null) { throw new IllegalArgumentException("Null 'font' argument."); } this.itemFont = font; notifyListeners(new TitleChangeEvent(this)); }
/** * Sets the item paint. * * @param paint the paint (<code>null</code> not permitted). */ public void setItemPaint(Paint paint) { if (paint == null) { throw new IllegalArgumentException("Null 'paint' argument."); } this.itemPaint = paint; notifyListeners(new TitleChangeEvent(this)); }
/** * Sets the padding used for the item labels in the legend. * * @param padding the padding (<code>null</code> not permitted). */ public void setItemLabelPadding(RectangleInsets padding) { if (padding == null) { throw new IllegalArgumentException("Null 'padding' argument."); } this.itemLabelPadding = padding; notifyListeners(new TitleChangeEvent(this)); }
/** * Sets the position for the title and sends a {@link TitleChangeEvent} to * all registered listeners. * * @param position the position (<code>null</code> not permitted). */ public void setPosition(RectangleEdge position) { if (position == null) { throw new IllegalArgumentException("Null 'position' argument."); } if (this.position != position) { this.position = position; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the horizontal alignment for the title and sends a * {@link TitleChangeEvent} to all registered listeners. * * @param alignment the horizontal alignment (<code>null</code> not * permitted). */ public void setHorizontalAlignment(HorizontalAlignment alignment) { if (alignment == null) { throw new IllegalArgumentException("Null 'alignment' argument."); } if (this.horizontalAlignment != alignment) { this.horizontalAlignment = alignment; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the vertical alignment for the title, and notifies any registered * listeners of the change. * * @param alignment the new vertical alignment (TOP, MIDDLE or BOTTOM, * <code>null</code> not permitted). */ public void setVerticalAlignment(VerticalAlignment alignment) { if (alignment == null) { throw new IllegalArgumentException("Null 'alignment' argument."); } if (this.verticalAlignment != alignment) { this.verticalAlignment = alignment; notifyListeners(new TitleChangeEvent(this)); } }
/** * Notifies all registered listeners that the chart title has changed in * some way. * * @param event an object that contains information about the change to * the title. */ protected void notifyListeners(TitleChangeEvent event) { if (this.notify) { Object[] listeners = this.listenerList.getListenerList(); for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == TitleChangeListener.class) { ((TitleChangeListener) listeners[i + 1]).titleChanged( event); } } } }
/** * Sets the title to the specified text and sends a * {@link TitleChangeEvent} to all registered listeners. * * @param text the text (<code>null</code> not permitted). */ public void setText(String text) { if (text == null) { throw new NullPointerException("Null 'text' argument."); } if (!this.text.equals(text)) { this.text = text; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the text alignment. * * @param alignment the alignment (<code>null</code> not permitted). */ public void setTextAlignment(HorizontalAlignment alignment) { if (alignment == null) { throw new IllegalArgumentException("Null 'alignment' argument."); } this.textAlignment = alignment; notifyListeners(new TitleChangeEvent(this)); }
/** * Sets the font used to display the title string. Registered listeners * are notified that the title has been modified. * * @param font the new font (<code>null</code> not permitted). */ public void setFont(Font font) { if (font == null) { throw new IllegalArgumentException("Null 'font' argument."); } if (!this.font.equals(font)) { this.font = font; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the paint used to display the title string. Registered listeners * are notified that the title has been modified. * * @param paint the new paint (<code>null</code> not permitted). */ public void setPaint(Paint paint) { if (paint == null) { throw new IllegalArgumentException("Null 'paint' argument."); } if (!this.paint.equals(paint)) { this.paint = paint; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the image for the title and notifies registered listeners that the * title has been modified. * * @param image the new image ({@code null} not permitted). */ public void setImage(Image image) { if (image == null) { throw new NullPointerException("Null 'image' argument."); } this.image = image; notifyListeners(new TitleChangeEvent(this)); }
/** * Sets the position for the title and sends a {@link TitleChangeEvent} to * all registered listeners. * * @param position the position (<code>null</code> not permitted). */ public void setPosition(RectangleEdge position) { ParamChecks.nullNotPermitted(position, "position"); if (this.position != position) { this.position = position; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the horizontal alignment for the title and sends a * {@link TitleChangeEvent} to all registered listeners. * * @param alignment the horizontal alignment (<code>null</code> not * permitted). */ public void setHorizontalAlignment(HorizontalAlignment alignment) { ParamChecks.nullNotPermitted(alignment, "alignment"); if (this.horizontalAlignment != alignment) { this.horizontalAlignment = alignment; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the vertical alignment for the title, and notifies any registered * listeners of the change. * * @param alignment the new vertical alignment (TOP, MIDDLE or BOTTOM, * <code>null</code> not permitted). */ public void setVerticalAlignment(VerticalAlignment alignment) { ParamChecks.nullNotPermitted(alignment, "alignment"); if (this.verticalAlignment != alignment) { this.verticalAlignment = alignment; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the title to the specified text and sends a * {@link TitleChangeEvent} to all registered listeners. * * @param text the text (<code>null</code> not permitted). */ public void setText(String text) { ParamChecks.nullNotPermitted(text, "text"); if (!this.text.equals(text)) { this.text = text; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the position for the title and sends a {@link TitleChangeEvent} to * all registered listeners. * * @param position the position ({@code null} not permitted). */ public void setPosition(RectangleEdge position) { Args.nullNotPermitted(position, "position"); if (this.position != position) { this.position = position; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the horizontal alignment for the title and sends a * {@link TitleChangeEvent} to all registered listeners. * * @param alignment the horizontal alignment ({@code null} not * permitted). */ public void setHorizontalAlignment(HorizontalAlignment alignment) { Args.nullNotPermitted(alignment, "alignment"); if (this.horizontalAlignment != alignment) { this.horizontalAlignment = alignment; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the vertical alignment for the title, and notifies any registered * listeners of the change. * * @param alignment the new vertical alignment (TOP, MIDDLE or BOTTOM, * {@code null} not permitted). */ public void setVerticalAlignment(VerticalAlignment alignment) { Args.nullNotPermitted(alignment, "alignment"); if (this.verticalAlignment != alignment) { this.verticalAlignment = alignment; notifyListeners(new TitleChangeEvent(this)); } }
/** * Sets the title to the specified text and sends a * {@link TitleChangeEvent} to all registered listeners. * * @param text the text ({@code null} not permitted). */ public void setText(String text) { Args.nullNotPermitted(text, "text"); if (!this.text.equals(text)) { this.text = text; notifyListeners(new TitleChangeEvent(this)); } }