本文整理汇总了Java中info.monitorenter.gui.chart.IAxis.getMax方法的典型用法代码示例。如果您正苦于以下问题:Java IAxis.getMax方法的具体用法?Java IAxis.getMax怎么用?Java IAxis.getMax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类info.monitorenter.gui.chart.IAxis
的用法示例。
在下文中一共展示了IAxis.getMax方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getScaleValues
import info.monitorenter.gui.chart.IAxis; //导入方法依赖的package包/类
/**
* Uses the transformation function callbacks ({@link AAxisTransformation#transform(double)}, {@link AAxisTransformation#untransform(double)})
* of the {@link AAxisTransformation} this instance may be used with to have the scale transformed accordingly.
* <p>
*/
@SuppressWarnings("unchecked")
public List<LabeledValue> getScaleValues(final Graphics g2d, final IAxis<?> axis) {
// Might give a class cast exception in case this was not called from the AAxisTranfsormation itself:
AAxisTransformation<AxisScalePolicyTransformation> axisTransformation = (AAxisTransformation<AxisScalePolicyTransformation>) axis;
final List<LabeledValue> collect = new LinkedList<LabeledValue>();
LabeledValue label;
final Range domain = axis.getRange();
double min = domain.getMin();
double max = domain.getMax();
min = axisTransformation.transform(min);
max = axisTransformation.transform(max);
double range = max - min;
double exp = 0.;
double val = axisTransformation.untransform(0);
while (val <= axis.getMax()) {
if (val >= axis.getMin()) {
label = new LabeledValue();
label.setValue(val);
label.setLabel(axis.getFormatter().format(label.getValue()));
label.setMajorTick(true);
label.setValue((axisTransformation.transform(label.getValue()) - min) / range);
collect.add(label);
}
exp += 1.;
val = axisTransformation.untransform(exp);
}
return collect;
}
示例2: initPaintIteration
import info.monitorenter.gui.chart.IAxis; //导入方法依赖的package包/类
/**
* @see info.monitorenter.gui.chart.IAxisScalePolicy#initPaintIteration(info.monitorenter.gui.chart.IAxis)
*/
public void initPaintIteration(IAxis<?> axis) {
// get the powers of ten of the range, a minor Tick of 1.0 has to be
// able to be 100 times in a range of 100 (match 1,2,3,... instead of
// 10,20,30,....
final double range = axis.getMax() - axis.getMin();
double computeRange = range;
if ((range == 0) || !MathUtil.isDouble(range)) {
computeRange = 1;
}
double tmpPower = 0;
if (computeRange > 1) {
while (computeRange > 50) {
computeRange /= 10;
tmpPower++;
}
tmpPower = Math.pow(10, tmpPower - 1);
} else {
while (computeRange < 5) {
computeRange *= 10;
tmpPower++;
}
tmpPower = 1 / Math.pow(10, tmpPower);
}
this.m_power = tmpPower;
}
示例3: mousePressed
import info.monitorenter.gui.chart.IAxis; //导入方法依赖的package包/类
/**
* Handle mouse press events
*
*/
public void mousePressed(MouseEvent e)
{
if (maybeShowPopup(e))
{
return;
}
IAxis xAxis = this.getAxisX();
IAxis yAxis = this.getAxisY();
double xAxisRange = xAxis.getRange().getExtent();
mouseDownValPerPxY.clear();
mouseDownMinY.clear();
mouseDownMaxY.clear();
mouseDownStartX = e.getX();
mouseDownStartY = e.getY();
double xAxisWidth = this.getXChartEnd() - this.getXChartStart();
double yAxisHeight = this.getYChartStart() - this.getYChartEnd();
mouseDownValPerPxX = xAxisRange / xAxisWidth;
mouseDownMinX = xAxis.getMin();
mouseDownMaxX = xAxis.getMax();
double yAxisRange = yAxis.getRange().getExtent();
mouseDownValPerPxY.add(yAxisRange / yAxisHeight);
mouseDownMinY.add(yAxis.getMin());
mouseDownMaxY.add(yAxis.getMax());
for (AAxis yAxisRight : rightYAxis)
{
double yAxisRangeRight = yAxisRight.getMax() - yAxisRight.getMin();
mouseDownValPerPxY.add(yAxisRangeRight / yAxisHeight);
mouseDownMinY.add(yAxisRight.getMin());
mouseDownMaxY.add(yAxisRight.getMax());
}
}