Java Code Examples for org.jfree.chart.axis.AxisLocation#BOTTOM_OR_LEFT

The following examples show how to use org.jfree.chart.axis.AxisLocation#BOTTOM_OR_LEFT . 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: PaintScaleLegend.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a new instance.
 *
 * @param scale  the scale (<code>null</code> not permitted).
 * @param axis  the axis (<code>null</code> not permitted).
 */
public PaintScaleLegend(PaintScale scale, ValueAxis axis) {
    ParamChecks.nullNotPermitted(axis, "axis");
    this.scale = scale;
    this.axis = axis;
    this.axis.addChangeListener(this);
    this.axisLocation = AxisLocation.BOTTOM_OR_LEFT;
    this.axisOffset = 0.0;
    this.axis.setRange(scale.getLowerBound(), scale.getUpperBound());
    this.stripWidth = 15.0;
    this.stripOutlineVisible = true;
    this.stripOutlinePaint = Color.gray;
    this.stripOutlineStroke = new BasicStroke(0.5f);
    this.backgroundPaint = Color.white;
    this.subdivisions = 100;
}
 
Example 2
Source File: PaintScaleLegend.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Creates a new instance.
 *
 * @param scale  the scale (<code>null</code> not permitted).
 * @param axis  the axis (<code>null</code> not permitted).
 */
public PaintScaleLegend(PaintScale scale, ValueAxis axis) {
    ParamChecks.nullNotPermitted(axis, "axis");
    this.scale = scale;
    this.axis = axis;
    this.axis.addChangeListener(this);
    this.axisLocation = AxisLocation.BOTTOM_OR_LEFT;
    this.axisOffset = 0.0;
    this.axis.setRange(scale.getLowerBound(), scale.getUpperBound());
    this.stripWidth = 15.0;
    this.stripOutlineVisible = true;
    this.stripOutlinePaint = Color.gray;
    this.stripOutlineStroke = new BasicStroke(0.5f);
    this.backgroundPaint = Color.white;
    this.subdivisions = 100;
}
 
Example 3
Source File: PaintScaleLegend.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Creates a new instance.
 *
 * @param scale  the scale (<code>null</code> not permitted).
 * @param axis  the axis (<code>null</code> not permitted).
 */
public PaintScaleLegend(PaintScale scale, ValueAxis axis) {
    ParamChecks.nullNotPermitted(axis, "axis");
    this.scale = scale;
    this.axis = axis;
    this.axis.addChangeListener(this);
    this.axisLocation = AxisLocation.BOTTOM_OR_LEFT;
    this.axisOffset = 0.0;
    this.axis.setRange(scale.getLowerBound(), scale.getUpperBound());
    this.stripWidth = 15.0;
    this.stripOutlineVisible = true;
    this.stripOutlinePaint = Color.gray;
    this.stripOutlineStroke = new BasicStroke(0.5f);
    this.backgroundPaint = Color.white;
    this.subdivisions = 100;
}
 
Example 4
Source File: PaintScaleLegend.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a new instance.
 *
 * @param scale  the scale (<code>null</code> not permitted).
 * @param axis  the axis (<code>null</code> not permitted).
 */
public PaintScaleLegend(PaintScale scale, ValueAxis axis) {
    if (axis == null) {
        throw new IllegalArgumentException("Null 'axis' argument.");
    }
    this.scale = scale;
    this.axis = axis;
    this.axis.addChangeListener(this);
    this.axisLocation = AxisLocation.BOTTOM_OR_LEFT;
    this.axisOffset = 0.0;
    this.axis.setRange(scale.getLowerBound(), scale.getUpperBound());
    this.stripWidth = 15.0;
    this.stripOutlineVisible = true;
    this.stripOutlinePaint = Color.gray;
    this.stripOutlineStroke = new BasicStroke(0.5f);
    this.backgroundPaint = Color.white;
    this.subdivisions = 100;
}
 
Example 5
Source File: PaintScaleLegend.java    From openstock with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Creates a new instance.
 *
 * @param scale  the scale (<code>null</code> not permitted).
 * @param axis  the axis (<code>null</code> not permitted).
 */
public PaintScaleLegend(PaintScale scale, ValueAxis axis) {
    ParamChecks.nullNotPermitted(axis, "axis");
    this.scale = scale;
    this.axis = axis;
    this.axis.addChangeListener(this);
    this.axisLocation = AxisLocation.BOTTOM_OR_LEFT;
    this.axisOffset = 0.0;
    this.axis.setRange(scale.getLowerBound(), scale.getUpperBound());
    this.stripWidth = 15.0;
    this.stripOutlineVisible = true;
    this.stripOutlinePaint = Color.gray;
    this.stripOutlineStroke = new BasicStroke(0.5f);
    this.backgroundPaint = Color.white;
    this.subdivisions = 100;
}
 
Example 6
Source File: PaintScaleLegend.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new instance.
 *
 * @param scale  the scale (<code>null</code> not permitted).
 * @param axis  the axis (<code>null</code> not permitted).
 */
public PaintScaleLegend(PaintScale scale, ValueAxis axis) {
    ParamChecks.nullNotPermitted(axis, "axis");
    this.scale = scale;
    this.axis = axis;
    this.axis.addChangeListener(this);
    this.axisLocation = AxisLocation.BOTTOM_OR_LEFT;
    this.axisOffset = 0.0;
    this.axis.setRange(scale.getLowerBound(), scale.getUpperBound());
    this.stripWidth = 15.0;
    this.stripOutlineVisible = true;
    this.stripOutlinePaint = Color.gray;
    this.stripOutlineStroke = new BasicStroke(0.5f);
    this.backgroundPaint = Color.white;
    this.subdivisions = 100;
}
 
Example 7
Source File: PaintScaleLegend.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Creates a new instance.
 *
 * @param scale  the scale (<code>null</code> not permitted).
 * @param axis  the axis (<code>null</code> not permitted).
 */
public PaintScaleLegend(PaintScale scale, ValueAxis axis) {
    ParamChecks.nullNotPermitted(axis, "axis");
    this.scale = scale;
    this.axis = axis;
    this.axis.addChangeListener(this);
    this.axisLocation = AxisLocation.BOTTOM_OR_LEFT;
    this.axisOffset = 0.0;
    this.axis.setRange(scale.getLowerBound(), scale.getUpperBound());
    this.stripWidth = 15.0;
    this.stripOutlineVisible = true;
    this.stripOutlinePaint = Color.gray;
    this.stripOutlineStroke = new BasicStroke(0.5f);
    this.backgroundPaint = Color.white;
    this.subdivisions = 100;
}
 
Example 8
Source File: Plot.java    From opensim-gui with Apache License 2.0 4 votes vote down vote up
/**
 * Resolves a domain axis location for a given plot orientation.
 *
 * @param location  the location (<code>null</code> not permitted).
 * @param orientation  the orientation (<code>null</code> not permitted).
 *
 * @return The edge (never <code>null</code>).
 */
public static RectangleEdge resolveDomainAxisLocation(
        AxisLocation location, PlotOrientation orientation) {
    
    if (location == null) {
        throw new IllegalArgumentException("Null 'location' argument.");   
    }
    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }

    RectangleEdge result = null;
    
    if (location == AxisLocation.TOP_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.RIGHT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.TOP;
        }
    }
    else if (location == AxisLocation.TOP_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.LEFT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.TOP;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.RIGHT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.BOTTOM;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.LEFT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.BOTTOM;
        }
    }
    // the above should cover all the options...
    if (result == null) {
        throw new IllegalStateException("resolveDomainAxisLocation()");
    }
    return result;
    
}
 
Example 9
Source File: Plot.java    From ccu-historian with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Resolves a range axis location for a given plot orientation.
 *
 * @param location  the location (<code>null</code> not permitted).
 * @param orientation  the orientation (<code>null</code> not permitted).
 *
 * @return The edge (never <code>null</code>).
 */
public static RectangleEdge resolveRangeAxisLocation(
        AxisLocation location, PlotOrientation orientation) {

    ParamChecks.nullNotPermitted(location, "location");
    ParamChecks.nullNotPermitted(orientation, "orientation");

    RectangleEdge result = null;
    if (location == AxisLocation.TOP_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.TOP;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.RIGHT;
        }
    }
    else if (location == AxisLocation.TOP_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.TOP;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.LEFT;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.BOTTOM;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.RIGHT;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.BOTTOM;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.LEFT;
        }
    }

    // the above should cover all the options...
    if (result == null) {
        throw new IllegalStateException("resolveRangeAxisLocation()");
    }
    return result;

}
 
Example 10
Source File: Plot.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Resolves a range axis location for a given plot orientation.
 *
 * @param location  the location (<code>null</code> not permitted).
 * @param orientation  the orientation (<code>null</code> not permitted).
 *
 * @return The edge (never <code>null</code>).
 */
public static RectangleEdge resolveRangeAxisLocation(
        AxisLocation location, PlotOrientation orientation) {

    ParamChecks.nullNotPermitted(location, "location");
    ParamChecks.nullNotPermitted(orientation, "orientation");

    RectangleEdge result = null;
    if (location == AxisLocation.TOP_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.TOP;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.RIGHT;
        }
    }
    else if (location == AxisLocation.TOP_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.TOP;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.LEFT;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.BOTTOM;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.RIGHT;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.BOTTOM;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.LEFT;
        }
    }

    // the above should cover all the options...
    if (result == null) {
        throw new IllegalStateException("resolveRangeAxisLocation()");
    }
    return result;

}
 
Example 11
Source File: Plot.java    From SIMVA-SoS with Apache License 2.0 4 votes vote down vote up
/**
 * Resolves a range axis location for a given plot orientation.
 *
 * @param location  the location (<code>null</code> not permitted).
 * @param orientation  the orientation (<code>null</code> not permitted).
 *
 * @return The edge (never <code>null</code>).
 */
public static RectangleEdge resolveRangeAxisLocation(
        AxisLocation location, PlotOrientation orientation) {

    ParamChecks.nullNotPermitted(location, "location");
    ParamChecks.nullNotPermitted(orientation, "orientation");

    RectangleEdge result = null;
    if (location == AxisLocation.TOP_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.TOP;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.RIGHT;
        }
    }
    else if (location == AxisLocation.TOP_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.TOP;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.LEFT;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.BOTTOM;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.RIGHT;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.BOTTOM;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.LEFT;
        }
    }

    // the above should cover all the options...
    if (result == null) {
        throw new IllegalStateException("resolveRangeAxisLocation()");
    }
    return result;

}
 
Example 12
Source File: Plot.java    From ccu-historian with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Resolves a domain axis location for a given plot orientation.
 *
 * @param location  the location (<code>null</code> not permitted).
 * @param orientation  the orientation (<code>null</code> not permitted).
 *
 * @return The edge (never <code>null</code>).
 */
public static RectangleEdge resolveDomainAxisLocation(
        AxisLocation location, PlotOrientation orientation) {

    ParamChecks.nullNotPermitted(location, "location");
    ParamChecks.nullNotPermitted(orientation, "orientation");

    RectangleEdge result = null;
    if (location == AxisLocation.TOP_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.RIGHT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.TOP;
        }
    }
    else if (location == AxisLocation.TOP_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.LEFT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.TOP;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.RIGHT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.BOTTOM;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.LEFT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.BOTTOM;
        }
    }
    // the above should cover all the options...
    if (result == null) {
        throw new IllegalStateException("resolveDomainAxisLocation()");
    }
    return result;

}
 
Example 13
Source File: Plot.java    From ECG-Viewer with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Resolves a domain axis location for a given plot orientation.
 *
 * @param location  the location (<code>null</code> not permitted).
 * @param orientation  the orientation (<code>null</code> not permitted).
 *
 * @return The edge (never <code>null</code>).
 */
public static RectangleEdge resolveDomainAxisLocation(
        AxisLocation location, PlotOrientation orientation) {

    ParamChecks.nullNotPermitted(location, "location");
    ParamChecks.nullNotPermitted(orientation, "orientation");

    RectangleEdge result = null;
    if (location == AxisLocation.TOP_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.RIGHT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.TOP;
        }
    }
    else if (location == AxisLocation.TOP_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.LEFT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.TOP;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.RIGHT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.BOTTOM;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.LEFT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.BOTTOM;
        }
    }
    // the above should cover all the options...
    if (result == null) {
        throw new IllegalStateException("resolveDomainAxisLocation()");
    }
    return result;

}
 
Example 14
Source File: Plot.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Resolves a domain axis location for a given plot orientation.
 *
 * @param location  the location (<code>null</code> not permitted).
 * @param orientation  the orientation (<code>null</code> not permitted).
 *
 * @return The edge (never <code>null</code>).
 */
public static RectangleEdge resolveDomainAxisLocation(
        AxisLocation location, PlotOrientation orientation) {

    ParamChecks.nullNotPermitted(location, "location");
    ParamChecks.nullNotPermitted(orientation, "orientation");

    RectangleEdge result = null;
    if (location == AxisLocation.TOP_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.RIGHT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.TOP;
        }
    }
    else if (location == AxisLocation.TOP_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.LEFT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.TOP;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.RIGHT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.BOTTOM;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.LEFT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.BOTTOM;
        }
    }
    // the above should cover all the options...
    if (result == null) {
        throw new IllegalStateException("resolveDomainAxisLocation()");
    }
    return result;

}
 
Example 15
Source File: Plot.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Resolves a domain axis location for a given plot orientation.
 *
 * @param location  the location (<code>null</code> not permitted).
 * @param orientation  the orientation (<code>null</code> not permitted).
 *
 * @return The edge (never <code>null</code>).
 */
public static RectangleEdge resolveDomainAxisLocation(
        AxisLocation location, PlotOrientation orientation) {

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

    RectangleEdge result = null;

    if (location == AxisLocation.TOP_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.RIGHT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.TOP;
        }
    }
    else if (location == AxisLocation.TOP_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.LEFT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.TOP;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.RIGHT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.BOTTOM;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.LEFT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.BOTTOM;
        }
    }
    // the above should cover all the options...
    if (result == null) {
        throw new IllegalStateException("resolveDomainAxisLocation()");
    }
    return result;

}
 
Example 16
Source File: Plot.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Resolves a domain axis location for a given plot orientation.
 *
 * @param location  the location (<code>null</code> not permitted).
 * @param orientation  the orientation (<code>null</code> not permitted).
 *
 * @return The edge (never <code>null</code>).
 */
public static RectangleEdge resolveDomainAxisLocation(
        AxisLocation location, PlotOrientation orientation) {

    ParamChecks.nullNotPermitted(location, "location");
    ParamChecks.nullNotPermitted(orientation, "orientation");

    RectangleEdge result = null;
    if (location == AxisLocation.TOP_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.RIGHT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.TOP;
        }
    }
    else if (location == AxisLocation.TOP_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.LEFT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.TOP;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.RIGHT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.BOTTOM;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.LEFT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.BOTTOM;
        }
    }
    // the above should cover all the options...
    if (result == null) {
        throw new IllegalStateException("resolveDomainAxisLocation()");
    }
    return result;

}
 
Example 17
Source File: Plot.java    From openstock with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Resolves a range axis location for a given plot orientation.
 *
 * @param location  the location (<code>null</code> not permitted).
 * @param orientation  the orientation (<code>null</code> not permitted).
 *
 * @return The edge (never <code>null</code>).
 */
public static RectangleEdge resolveRangeAxisLocation(
        AxisLocation location, PlotOrientation orientation) {

    ParamChecks.nullNotPermitted(location, "location");
    ParamChecks.nullNotPermitted(orientation, "orientation");

    RectangleEdge result = null;
    if (location == AxisLocation.TOP_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.TOP;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.RIGHT;
        }
    }
    else if (location == AxisLocation.TOP_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.TOP;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.LEFT;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.BOTTOM;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.RIGHT;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.BOTTOM;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.LEFT;
        }
    }

    // the above should cover all the options...
    if (result == null) {
        throw new IllegalStateException("resolveRangeAxisLocation()");
    }
    return result;

}
 
Example 18
Source File: Plot.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Resolves a domain axis location for a given plot orientation.
 *
 * @param location  the location (<code>null</code> not permitted).
 * @param orientation  the orientation (<code>null</code> not permitted).
 *
 * @return The edge (never <code>null</code>).
 */
public static RectangleEdge resolveDomainAxisLocation(
        AxisLocation location, PlotOrientation orientation) {
    
    if (location == null) {
        throw new IllegalArgumentException("Null 'location' argument.");   
    }
    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }

    RectangleEdge result = null;
    
    if (location == AxisLocation.TOP_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.RIGHT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.TOP;
        }
    }
    else if (location == AxisLocation.TOP_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.LEFT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.TOP;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.RIGHT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.BOTTOM;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.LEFT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.BOTTOM;
        }
    }
    // the above should cover all the options...
    if (result == null) {
        throw new IllegalStateException("resolveDomainAxisLocation()");
    }
    return result;
    
}
 
Example 19
Source File: Plot.java    From opensim-gui with Apache License 2.0 4 votes vote down vote up
/**
 * Resolves a range axis location for a given plot orientation.
 *
 * @param location  the location (<code>null</code> not permitted).
 * @param orientation  the orientation (<code>null</code> not permitted).
 *
 * @return The edge (never <code>null</code>).
 */
public static RectangleEdge resolveRangeAxisLocation(
        AxisLocation location, PlotOrientation orientation) {

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

    RectangleEdge result = null;
    
    if (location == AxisLocation.TOP_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.TOP;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.RIGHT;
        }
    }
    else if (location == AxisLocation.TOP_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.TOP;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.LEFT;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.BOTTOM;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.RIGHT;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.BOTTOM;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.LEFT;
        }
    }

    // the above should cover all the options...
    if (result == null) {
        throw new IllegalStateException("resolveRangeAxisLocation()");
    }
    return result;
    
}
 
Example 20
Source File: Plot.java    From openstock with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Resolves a domain axis location for a given plot orientation.
 *
 * @param location  the location (<code>null</code> not permitted).
 * @param orientation  the orientation (<code>null</code> not permitted).
 *
 * @return The edge (never <code>null</code>).
 */
public static RectangleEdge resolveDomainAxisLocation(
        AxisLocation location, PlotOrientation orientation) {

    ParamChecks.nullNotPermitted(location, "location");
    ParamChecks.nullNotPermitted(orientation, "orientation");

    RectangleEdge result = null;
    if (location == AxisLocation.TOP_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.RIGHT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.TOP;
        }
    }
    else if (location == AxisLocation.TOP_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.LEFT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.TOP;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_RIGHT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.RIGHT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.BOTTOM;
        }
    }
    else if (location == AxisLocation.BOTTOM_OR_LEFT) {
        if (orientation == PlotOrientation.HORIZONTAL) {
            result = RectangleEdge.LEFT;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            result = RectangleEdge.BOTTOM;
        }
    }
    // the above should cover all the options...
    if (result == null) {
        throw new IllegalStateException("resolveDomainAxisLocation()");
    }
    return result;

}