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

The following examples show how to use org.jfree.chart.axis.AxisLocation#BOTTOM_OR_RIGHT . 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: GenericChartTheme.java    From jasperreports with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Specifies the axis location.
 * It has to be overridden for child themes with another default axis location
 */
protected AxisLocation getChartAxisLocation(JRChartAxis chartAxis)
{
	if (chartAxis.getPositionValue() != null)
	{
		switch (chartAxis.getPositionValue())
		{
			case RIGHT_OR_BOTTOM :
				return AxisLocation.BOTTOM_OR_RIGHT;
			default:
				return AxisLocation.TOP_OR_LEFT;
		}
	}
	else
	{
		return (AxisLocation)getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.AXIS_LOCATION);
	}
}
 
Example 2
Source File: AxisLocationHandler.java    From jasperreports with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public Object convertUponSet(Object value)
{
	if (value == null)
	{
		return null;
	}
	return 
	AxisLocation.BOTTOM_OR_LEFT.toString().equals(value) 
	? AxisLocation.BOTTOM_OR_LEFT 
	: AxisLocation.BOTTOM_OR_RIGHT.toString().equals(value)
	? AxisLocation.BOTTOM_OR_RIGHT
	: AxisLocation.TOP_OR_LEFT.toString().equals(value)
	? AxisLocation.TOP_OR_LEFT
	: AxisLocation.TOP_OR_RIGHT.toString().equals(value)
	? AxisLocation.TOP_OR_RIGHT : null;
}
 
Example 3
Source File: DefaultChartTheme.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Specifies the axis location.
 * It has to be overridden for child themes with another default axis location
 */
protected AxisLocation getChartAxisLocation(JRChartAxis chartAxis)
{
	return chartAxis.getPositionValue() != null && chartAxis.getPositionValue() == AxisPositionEnum.RIGHT_OR_BOTTOM
			? AxisLocation.BOTTOM_OR_RIGHT 
			: AxisLocation.TOP_OR_LEFT;
}
 
Example 4
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 5
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 6
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 7
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 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 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 10
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 11
Source File: Plot.java    From astor with GNU General Public License v2.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 12
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 13
Source File: Plot.java    From ECG-Viewer with GNU General Public License v2.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 14
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;

}
 
Example 15
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 16
Source File: Plot.java    From SIMVA-SoS 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) {

    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: JRFillChart.java    From jasperreports with GNU Lesser General Public License v3.0 4 votes vote down vote up
protected AxisLocation getChartAxisLocation(JRFillChartAxis chartAxis)
{
	return chartAxis.getPositionValue() != null && chartAxis.getPositionValue() == AxisPositionEnum.RIGHT_OR_BOTTOM
			? AxisLocation.BOTTOM_OR_RIGHT 
			: AxisLocation.TOP_OR_LEFT;
}
 
Example 18
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 19
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 20
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;

}