org.jfree.chart.event.AxisChangeEvent Java Examples

The following examples show how to use org.jfree.chart.event.AxisChangeEvent. 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: Cardumen_00144_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets the label for the axis and sends an {@link AxisChangeEvent} to all 
 * registered listeners.
 *
 * @param label  the new label (<code>null</code> permitted).
 * 
 * @see #getLabel()
 * @see #setLabelFont(Font)
 * @see #setLabelPaint(Paint)
 */
public void setLabel(String label) {
    
    String existing = this.label;
    if (existing != null) {
        if (!existing.equals(label)) {
            this.label = label;
            notifyListeners(new AxisChangeEvent(this));
        }
    }
    else {
        if (label != null) {
            this.label = label;
            notifyListeners(new AxisChangeEvent(this));
        }
    }

}
 
Example #2
Source File: jKali_0032_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets the label for the axis and sends an {@link AxisChangeEvent} to all 
 * registered listeners.
 *
 * @param label  the new label (<code>null</code> permitted).
 * 
 * @see #getLabel()
 * @see #setLabelFont(Font)
 * @see #setLabelPaint(Paint)
 */
public void setLabel(String label) {
    
    String existing = this.label;
    if (existing != null) {
        if (!existing.equals(label)) {
            this.label = label;
            notifyListeners(new AxisChangeEvent(this));
        }
    }
    else {
        if (label != null) {
            this.label = label;
            notifyListeners(new AxisChangeEvent(this));
        }
    }

}
 
Example #3
Source File: ModuloAxis.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Sets the display range.  The values will be mapped to the fixed range if
 * necessary.
 *
 * @param start  the start value.
 * @param end  the end value.
 */
public void setDisplayRange(double start, double end) {
    this.displayStart = mapValueToFixedRange(start);
    this.displayEnd = mapValueToFixedRange(end);
    if (this.displayStart < this.displayEnd) {
        setRange(this.displayStart, this.displayEnd);
    }
    else {
        setRange(this.displayStart, this.fixedRange.getUpperBound()
              + (this.displayEnd - this.fixedRange.getLowerBound()));
    }
    notifyListeners(new AxisChangeEvent(this));
}
 
Example #4
Source File: Cardumen_00144_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Sets the insets for the tick labels and sends an {@link AxisChangeEvent}
 * to all registered listeners.
 *
 * @param insets  the insets (<code>null</code> not permitted).
 * 
 * @see #getTickLabelInsets()
 */
public void setTickLabelInsets(RectangleInsets insets) {
    if (insets == null) {
        throw new IllegalArgumentException("Null 'insets' argument.");
    }
    if (!this.tickLabelInsets.equals(insets)) {
        this.tickLabelInsets = insets;
        notifyListeners(new AxisChangeEvent(this));
    }
}
 
Example #5
Source File: Chart_26_Axis_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Sets the font for the axis label and sends an {@link AxisChangeEvent} 
 * to all registered listeners.
 *
 * @param font  the font (<code>null</code> not permitted).
 * 
 * @see #getLabelFont()
 */
public void setLabelFont(Font font) {
    if (font == null) {
        throw new IllegalArgumentException("Null 'font' argument.");
    }
    if (!this.labelFont.equals(font)) {
        this.labelFont = font;
        notifyListeners(new AxisChangeEvent(this));
    }
}
 
Example #6
Source File: JGenProg2017_0082_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Sets the insets for the axis label, and sends an {@link AxisChangeEvent}
 * to all registered listeners.
 *
 * @param insets  the insets (<code>null</code> not permitted).
 * 
 * @see #getLabelInsets()
 */
public void setLabelInsets(RectangleInsets insets) {
    if (insets == null) {
        throw new IllegalArgumentException("Null 'insets' argument.");   
    }
    if (!insets.equals(this.labelInsets)) {
        this.labelInsets = insets;
        notifyListeners(new AxisChangeEvent(this));
    }
}
 
Example #7
Source File: Cardumen_00144_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Sets the font for the tick labels and sends an {@link AxisChangeEvent} 
 * to all registered listeners.
 *
 * @param font  the font (<code>null</code> not allowed).
 * 
 * @see #getTickLabelFont()
 */
public void setTickLabelFont(Font font) {

    if (font == null) {
        throw new IllegalArgumentException("Null 'font' argument.");
    }

    if (!this.tickLabelFont.equals(font)) {
        this.tickLabelFont = font;
        notifyListeners(new AxisChangeEvent(this));
    }

}
 
Example #8
Source File: Cardumen_0080_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Sets the insets for the axis label, and sends an {@link AxisChangeEvent}
 * to all registered listeners.
 *
 * @param insets  the insets (<code>null</code> not permitted).
 * 
 * @see #getLabelInsets()
 */
public void setLabelInsets(RectangleInsets insets) {
    if (insets == null) {
        throw new IllegalArgumentException("Null 'insets' argument.");   
    }
    if (!insets.equals(this.labelInsets)) {
        this.labelInsets = insets;
        notifyListeners(new AxisChangeEvent(this));
    }
}
 
Example #9
Source File: Cardumen_007_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Sets the font for the tick labels and sends an {@link AxisChangeEvent} 
 * to all registered listeners.
 *
 * @param font  the font (<code>null</code> not allowed).
 * 
 * @see #getTickLabelFont()
 */
public void setTickLabelFont(Font font) {

    if (font == null) {
        throw new IllegalArgumentException("Null 'font' argument.");
    }

    if (!this.tickLabelFont.equals(font)) {
        this.tickLabelFont = font;
        notifyListeners(new AxisChangeEvent(this));
    }

}
 
Example #10
Source File: Chart_26_Axis_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Sets the font for the tick labels and sends an {@link AxisChangeEvent} 
 * to all registered listeners.
 *
 * @param font  the font (<code>null</code> not allowed).
 * 
 * @see #getTickLabelFont()
 */
public void setTickLabelFont(Font font) {

    if (font == null) {
        throw new IllegalArgumentException("Null 'font' argument.");
    }

    if (!this.tickLabelFont.equals(font)) {
        this.tickLabelFont = font;
        notifyListeners(new AxisChangeEvent(this));
    }

}
 
Example #11
Source File: Axis.java    From opensim-gui with Apache License 2.0 5 votes vote down vote up
/**
 * Sets the insets for the tick labels and sends an {@link AxisChangeEvent}
 * to all registered listeners.
 *
 * @param insets  the insets (<code>null</code> not permitted).
 * 
 * @see #getTickLabelInsets()
 */
public void setTickLabelInsets(RectangleInsets insets) {
    if (insets == null) {
        throw new IllegalArgumentException("Null 'insets' argument.");
    }
    if (!this.tickLabelInsets.equals(insets)) {
        this.tickLabelInsets = insets;
        notifyListeners(new AxisChangeEvent(this));
    }
}
 
Example #12
Source File: JGenProg2017_006_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Sets the font for the tick labels and sends an {@link AxisChangeEvent} 
 * to all registered listeners.
 *
 * @param font  the font (<code>null</code> not allowed).
 * 
 * @see #getTickLabelFont()
 */
public void setTickLabelFont(Font font) {

    if (font == null) {
        throw new IllegalArgumentException("Null 'font' argument.");
    }

    if (!this.tickLabelFont.equals(font)) {
        this.tickLabelFont = font;
        notifyListeners(new AxisChangeEvent(this));
    }

}
 
Example #13
Source File: Cardumen_00144_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Sets the insets for the tick labels and sends an {@link AxisChangeEvent}
 * to all registered listeners.
 *
 * @param insets  the insets (<code>null</code> not permitted).
 * 
 * @see #getTickLabelInsets()
 */
public void setTickLabelInsets(RectangleInsets insets) {
    if (insets == null) {
        throw new IllegalArgumentException("Null 'insets' argument.");
    }
    if (!this.tickLabelInsets.equals(insets)) {
        this.tickLabelInsets = insets;
        notifyListeners(new AxisChangeEvent(this));
    }
}
 
Example #14
Source File: Cardumen_00144_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Notifies all registered listeners that the axis has changed.
 * The AxisChangeEvent provides information about the change.
 *
 * @param event  information about the change to the axis.
 */
protected void notifyListeners(AxisChangeEvent event) {

    Object[] listeners = this.listenerList.getListenerList();
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == AxisChangeListener.class) {
            ((AxisChangeListener) listeners[i + 1]).axisChanged(event);
        }
    }

}
 
Example #15
Source File: Cardumen_00144_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Sets the font for the tick labels and sends an {@link AxisChangeEvent} 
 * to all registered listeners.
 *
 * @param font  the font (<code>null</code> not allowed).
 * 
 * @see #getTickLabelFont()
 */
public void setTickLabelFont(Font font) {

    if (font == null) {
        throw new IllegalArgumentException("Null 'font' argument.");
    }

    if (!this.tickLabelFont.equals(font)) {
        this.tickLabelFont = font;
        notifyListeners(new AxisChangeEvent(this));
    }

}
 
Example #16
Source File: ValueAxis.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets a flag indicating whether or not the tick unit is automatically
 * selected from a range of standard tick units.
 *
 * @param flag  the new value of the flag.
 * @param notify  notify listeners?
 * 
 * @see #isAutoTickUnitSelection()
 */
public void setAutoTickUnitSelection(boolean flag, boolean notify) {

    if (this.autoTickUnitSelection != flag) {
        this.autoTickUnitSelection = flag;
        if (notify) {
            notifyListeners(new AxisChangeEvent(this));
        }
    }
}
 
Example #17
Source File: Cardumen_00144_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Sets the stroke used to draw tick marks and sends
 * an {@link AxisChangeEvent} to all registered listeners.
 *
 * @param stroke  the stroke (<code>null</code> not permitted).
 * 
 * @see #getTickMarkStroke()
 */
public void setTickMarkStroke(Stroke stroke) {
    if (stroke == null) {
        throw new IllegalArgumentException("Null 'stroke' argument.");
    }
    if (!this.tickMarkStroke.equals(stroke)) {
        this.tickMarkStroke = stroke;
        notifyListeners(new AxisChangeEvent(this));
    }
}
 
Example #18
Source File: jMutRepair_0046_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Sets the stroke used to draw tick marks and sends
 * an {@link AxisChangeEvent} to all registered listeners.
 *
 * @param stroke  the stroke (<code>null</code> not permitted).
 * 
 * @see #getTickMarkStroke()
 */
public void setTickMarkStroke(Stroke stroke) {
    if (stroke == null) {
        throw new IllegalArgumentException("Null 'stroke' argument.");
    }
    if (!this.tickMarkStroke.equals(stroke)) {
        this.tickMarkStroke = stroke;
        notifyListeners(new AxisChangeEvent(this));
    }
}
 
Example #19
Source File: jKali_0032_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Sets the insets for the tick labels and sends an {@link AxisChangeEvent}
 * to all registered listeners.
 *
 * @param insets  the insets (<code>null</code> not permitted).
 * 
 * @see #getTickLabelInsets()
 */
public void setTickLabelInsets(RectangleInsets insets) {
    if (insets == null) {
        throw new IllegalArgumentException("Null 'insets' argument.");
    }
    if (!this.tickLabelInsets.equals(insets)) {
        this.tickLabelInsets = insets;
        notifyListeners(new AxisChangeEvent(this));
    }
}
 
Example #20
Source File: jKali_0041_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Sets the insets for the tick labels and sends an {@link AxisChangeEvent}
 * to all registered listeners.
 *
 * @param insets  the insets (<code>null</code> not permitted).
 * 
 * @see #getTickLabelInsets()
 */
public void setTickLabelInsets(RectangleInsets insets) {
    if (insets == null) {
        throw new IllegalArgumentException("Null 'insets' argument.");
    }
    if (!this.tickLabelInsets.equals(insets)) {
        this.tickLabelInsets = insets;
        notifyListeners(new AxisChangeEvent(this));
    }
}
 
Example #21
Source File: ValueAxis.java    From opensim-gui with Apache License 2.0 5 votes vote down vote up
/**
 * Sets the auto range attribute.  If the <code>notify</code> flag is set, 
 * an {@link AxisChangeEvent} is sent to registered listeners.
 *
 * @param auto  the flag.
 * @param notify  notify listeners?
 * 
 * @see #isAutoRange()
 */
protected void setAutoRange(boolean auto, boolean notify) {
    if (this.autoRange != auto) {
        this.autoRange = auto;
        if (this.autoRange) {
            autoAdjustRange();
        }
        if (notify) {
            notifyListeners(new AxisChangeEvent(this));
        }
    }
}
 
Example #22
Source File: jMutRepair_0046_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Sets the font for the axis label and sends an {@link AxisChangeEvent} 
 * to all registered listeners.
 *
 * @param font  the font (<code>null</code> not permitted).
 * 
 * @see #getLabelFont()
 */
public void setLabelFont(Font font) {
    if (font == null) {
        throw new IllegalArgumentException("Null 'font' argument.");
    }
    if (!this.labelFont.equals(font)) {
        this.labelFont = font;
        notifyListeners(new AxisChangeEvent(this));
    }
}
 
Example #23
Source File: Axis.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Notifies all registered listeners that the axis has changed.
 * The AxisChangeEvent provides information about the change.
 *
 * @param event  information about the change to the axis.
 */
protected void notifyListeners(AxisChangeEvent event) {
    Object[] listeners = this.listenerList.getListenerList();
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == AxisChangeListener.class) {
            ((AxisChangeListener) listeners[i + 1]).axisChanged(event);
        }
    }
}
 
Example #24
Source File: PeriodAxis.java    From opensim-gui with Apache License 2.0 5 votes vote down vote up
/**
 * Sets the paint used to display minor tick marks, if they are 
 * visible, and sends a {@link AxisChangeEvent} to all registered 
 * listeners.
 * 
 * @param paint  the paint (<code>null</code> not permitted).
 */
public void setMinorTickMarkPaint(Paint paint) {
    if (paint == null) {
        throw new IllegalArgumentException("Null 'paint' argument.");
    }
    this.minorTickMarkPaint = paint;
    notifyListeners(new AxisChangeEvent(this));
}
 
Example #25
Source File: JGenProg2017_006_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Sets the insets for the axis label, and sends an {@link AxisChangeEvent}
 * to all registered listeners.
 *
 * @param insets  the insets (<code>null</code> not permitted).
 * 
 * @see #getLabelInsets()
 */
public void setLabelInsets(RectangleInsets insets) {
    if (insets == null) {
        throw new IllegalArgumentException("Null 'insets' argument.");   
    }
    if (!insets.equals(this.labelInsets)) {
        this.labelInsets = insets;
        notifyListeners(new AxisChangeEvent(this));
    }
}
 
Example #26
Source File: LogAxis.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the base for the logarithm calculation and sends an 
 * {@link AxisChangeEvent} to all registered listeners.
 * 
 * @param base  the base value (must be > 1.0).
 * 
 * @see #getBase()
 */
public void setBase(double base) {
    if (base <= 1.0) {
        throw new IllegalArgumentException("Requires 'base' > 1.0.");
    }
    this.base = base;
    this.baseLog = Math.log(base);
    notifyListeners(new AxisChangeEvent(this));
}
 
Example #27
Source File: ModuloAxis.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Sets the display range.  The values will be mapped to the fixed range if
 * necessary.
 *
 * @param start  the start value.
 * @param end  the end value.
 */
public void setDisplayRange(double start, double end) {
    this.displayStart = mapValueToFixedRange(start);
    this.displayEnd = mapValueToFixedRange(end);
    if (this.displayStart < this.displayEnd) {
        setRange(this.displayStart, this.displayEnd);
    }
    else {
        setRange(this.displayStart, this.fixedRange.getUpperBound()
              + (this.displayEnd - this.fixedRange.getLowerBound()));
    }
    notifyListeners(new AxisChangeEvent(this));
}
 
Example #28
Source File: jKali_0032_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Sets the font for the tick labels and sends an {@link AxisChangeEvent} 
 * to all registered listeners.
 *
 * @param font  the font (<code>null</code> not allowed).
 * 
 * @see #getTickLabelFont()
 */
public void setTickLabelFont(Font font) {

    if (font == null) {
        throw new IllegalArgumentException("Null 'font' argument.");
    }

    if (!this.tickLabelFont.equals(font)) {
        this.tickLabelFont = font;
        notifyListeners(new AxisChangeEvent(this));
    }

}
 
Example #29
Source File: CategoryAxis.java    From opensim-gui with Apache License 2.0 4 votes vote down vote up
/**
 * Clears the category label tooltips and sends an {@link AxisChangeEvent} 
 * to all registered listeners.
 */
public void clearCategoryLabelToolTips() {
    this.categoryLabelToolTips.clear();
    notifyListeners(new AxisChangeEvent(this));
}
 
Example #30
Source File: JGenProg2017_006_t.java    From coming with MIT License 3 votes vote down vote up
/**
 * Sets the paint used to draw the axis label and sends an 
 * {@link AxisChangeEvent} to all registered listeners.
 *
 * @param paint  the paint (<code>null</code> not permitted).
 * 
 * @see #getLabelPaint()
 */
public void setLabelPaint(Paint paint) {
    if (paint == null) {
        throw new IllegalArgumentException("Null 'paint' argument.");
    }
    this.labelPaint = paint;
    notifyListeners(new AxisChangeEvent(this));
}