org.jfree.chart.event.TitleChangeEvent Java Examples

The following examples show how to use org.jfree.chart.event.TitleChangeEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Title.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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));
    }
}
 
Example #2
Source File: TextTitle.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * 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));
    }
}
 
Example #3
Source File: Title.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * 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));
    }
}
 
Example #4
Source File: Title.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * 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));
    }
}
 
Example #5
Source File: Title.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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));
    }
}
 
Example #6
Source File: Title.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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);
            }
        }
    }
}
 
Example #7
Source File: ImageTitle.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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));
}
 
Example #8
Source File: ImageTitle.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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));
}
 
Example #9
Source File: Title.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * 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));
    }
}
 
Example #10
Source File: Title.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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);
            }
        }
    }
}
 
Example #11
Source File: TextTitle.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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));
    }
}
 
Example #12
Source File: LegendTitle.java    From SIMVA-SoS with Apache License 2.0 4 votes vote down vote up
/**
 * Sets the item paint.
 *
 * @param paint  the paint (<code>null</code> not permitted).
 */
public void setItemPaint(Paint paint) {
    ParamChecks.nullNotPermitted(paint, "paint");
    this.itemPaint = paint;
    notifyListeners(new TitleChangeEvent(this));
}
 
Example #13
Source File: LegendTitle.java    From openstock with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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) {
    ParamChecks.nullNotPermitted(padding, "padding");
    this.itemLabelPadding = padding;
    notifyListeners(new TitleChangeEvent(this));
}
 
Example #14
Source File: TextTitle.java    From openstock with GNU General Public License v3.0 3 votes vote down vote up
/**
 * 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).
 *
 * @see #getFont()
 */
public void setFont(Font font) {
    ParamChecks.nullNotPermitted(font, "font");
    if (!this.font.equals(font)) {
        this.font = font;
        notifyListeners(new TitleChangeEvent(this));
    }
}
 
Example #15
Source File: PaintScaleLegend.java    From openstock with GNU General Public License v3.0 3 votes vote down vote up
/**
 * Sets the axis for the paint scale and sends a {@link TitleChangeEvent}
 * to all registered listeners.
 *
 * @param axis  the axis (<code>null</code> not permitted).
 *
 * @see #getAxis()
 */
public void setAxis(ValueAxis axis) {
    ParamChecks.nullNotPermitted(axis, "axis");
    this.axis.removeChangeListener(this);
    this.axis = axis;
    this.axis.addChangeListener(this);
    notifyListeners(new TitleChangeEvent(this));
}
 
Example #16
Source File: TextTitle.java    From ccu-historian with GNU General Public License v3.0 3 votes vote down vote up
/**
 * 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).
 *
 * @see #getFont()
 */
public void setFont(Font font) {
    ParamChecks.nullNotPermitted(font, "font");
    if (!this.font.equals(font)) {
        this.font = font;
        notifyListeners(new TitleChangeEvent(this));
    }
}
 
Example #17
Source File: Title.java    From SIMVA-SoS with Apache License 2.0 3 votes vote down vote up
/**
 * Sets the flag that indicates whether or not the notification mechanism
 * is enabled.  There are certain situations (such as cloning) where you
 * want to turn notification off temporarily.
 *
 * @param flag  the new value of the flag.
 */
public void setNotify(boolean flag) {
    this.notify = flag;
    if (flag) {
        notifyListeners(new TitleChangeEvent(this));
    }
}
 
Example #18
Source File: TextTitle.java    From SIMVA-SoS with Apache License 2.0 3 votes vote down vote up
/**
 * 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).
 *
 * @see #getFont()
 */
public void setFont(Font font) {
    ParamChecks.nullNotPermitted(font, "font");
    if (!this.font.equals(font)) {
        this.font = font;
        notifyListeners(new TitleChangeEvent(this));
    }
}
 
Example #19
Source File: TextTitle.java    From ccu-historian with GNU General Public License v3.0 3 votes vote down vote up
/**
 * 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).
 *
 * @see #getPaint()
 */
public void setPaint(Paint paint) {
    ParamChecks.nullNotPermitted(paint, "paint");
    if (!this.paint.equals(paint)) {
        this.paint = paint;
        notifyListeners(new TitleChangeEvent(this));
    }
}
 
Example #20
Source File: TextTitle.java    From SIMVA-SoS with Apache License 2.0 3 votes vote down vote up
/**
 * 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).
 *
 * @see #getPaint()
 */
public void setPaint(Paint paint) {
    ParamChecks.nullNotPermitted(paint, "paint");
    if (!this.paint.equals(paint)) {
        this.paint = paint;
        notifyListeners(new TitleChangeEvent(this));
    }
}
 
Example #21
Source File: PaintScaleLegend.java    From SIMVA-SoS with Apache License 2.0 3 votes vote down vote up
/**
 * Sets the subdivision count and sends a {@link TitleChangeEvent} to
 * all registered listeners.
 *
 * @param count  the count.
 *
 * @since 1.0.11
 */
public void setSubdivisionCount(int count) {
    if (count <= 0) {
        throw new IllegalArgumentException("Requires 'count' > 0.");
    }
    this.subdivisions = count;
    notifyListeners(new TitleChangeEvent(this));
}
 
Example #22
Source File: Title.java    From openstock with GNU General Public License v3.0 3 votes vote down vote up
/**
 * Sets the flag that indicates whether or not the notification mechanism
 * is enabled.  There are certain situations (such as cloning) where you
 * want to turn notification off temporarily.
 *
 * @param flag  the new value of the flag.
 */
public void setNotify(boolean flag) {
    this.notify = flag;
    if (flag) {
        notifyListeners(new TitleChangeEvent(this));
    }
}
 
Example #23
Source File: PaintScaleLegend.java    From openstock with GNU General Public License v3.0 3 votes vote down vote up
/**
 * Receives notification of an axis change event and responds by firing
 * a title change event.
 *
 * @param event  the event.
 *
 * @since 1.0.13
 */
@Override
public void axisChanged(AxisChangeEvent event) {
    if (this.axis == event.getAxis()) {
        notifyListeners(new TitleChangeEvent(this));
    }
}
 
Example #24
Source File: PaintScaleLegend.java    From SIMVA-SoS with Apache License 2.0 3 votes vote down vote up
/**
 * Receives notification of an axis change event and responds by firing
 * a title change event.
 *
 * @param event  the event.
 *
 * @since 1.0.13
 */
@Override
public void axisChanged(AxisChangeEvent event) {
    if (this.axis == event.getAxis()) {
        notifyListeners(new TitleChangeEvent(this));
    }
}
 
Example #25
Source File: PaintScaleLegend.java    From openstock with GNU General Public License v3.0 3 votes vote down vote up
/**
 * Sets the subdivision count and sends a {@link TitleChangeEvent} to
 * all registered listeners.
 *
 * @param count  the count.
 *
 * @since 1.0.11
 */
public void setSubdivisionCount(int count) {
    if (count <= 0) {
        throw new IllegalArgumentException("Requires 'count' > 0.");
    }
    this.subdivisions = count;
    notifyListeners(new TitleChangeEvent(this));
}
 
Example #26
Source File: TextTitle.java    From ccu-historian with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Sets the background paint and sends a {@link TitleChangeEvent} to all
 * registered listeners.  If you set this attribute to <code>null</code>,
 * no background is painted (which makes the title background transparent).
 *
 * @param paint  the background paint (<code>null</code> permitted).
 */
public void setBackgroundPaint(Paint paint) {
    this.backgroundPaint = paint;
    notifyListeners(new TitleChangeEvent(this));
}
 
Example #27
Source File: TextTitle.java    From SIMVA-SoS with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the maximum number of lines to display and sends a
 * {@link TitleChangeEvent} to all registered listeners.
 *
 * @param max  the maximum.
 *
 * @since 1.0.10.
 *
 * @see #getMaximumLinesToDisplay()
 */
public void setMaximumLinesToDisplay(int max) {
    this.maximumLinesToDisplay = max;
    notifyListeners(new TitleChangeEvent(this));
}
 
Example #28
Source File: PaintScaleLegend.java    From SIMVA-SoS with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the paint used to draw the outline of the paint strip, and sends
 * a {@link TitleChangeEvent} to all registered listeners.
 *
 * @param paint  the paint (<code>null</code> not permitted).
 *
 * @see #getStripOutlinePaint()
 */
public void setStripOutlinePaint(Paint paint) {
    ParamChecks.nullNotPermitted(paint, "paint");
    this.stripOutlinePaint = paint;
    notifyListeners(new TitleChangeEvent(this));
}
 
Example #29
Source File: TextTitle.java    From SIMVA-SoS with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the tool tip text to the specified text and sends a
 * {@link TitleChangeEvent} to all registered listeners.
 *
 * @param text  the text (<code>null</code> permitted).
 */
public void setToolTipText(String text) {
    this.toolTipText = text;
    notifyListeners(new TitleChangeEvent(this));
}
 
Example #30
Source File: CompositeTitle.java    From openstock with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Sets the background paint and sends a {@link TitleChangeEvent} to all
 * registered listeners.  If you set this attribute to <code>null</code>,
 * no background is painted (which makes the title background transparent).
 *
 * @param paint  the background paint (<code>null</code> permitted).
 *
 * @since 1.0.11
 */
public void setBackgroundPaint(Paint paint) {
    this.backgroundPaint = paint;
    notifyListeners(new TitleChangeEvent(this));
}