本文整理汇总了Java中info.monitorenter.gui.chart.Chart2D.CHART_POSITION_LEFT属性的典型用法代码示例。如果您正苦于以下问题:Java Chart2D.CHART_POSITION_LEFT属性的具体用法?Java Chart2D.CHART_POSITION_LEFT怎么用?Java Chart2D.CHART_POSITION_LEFT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类info.monitorenter.gui.chart.Chart2D
的用法示例。
在下文中一共展示了Chart2D.CHART_POSITION_LEFT属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAccessor
/**
* @see info.monitorenter.gui.chart.axis.AAxis#createAccessor(info.monitorenter.gui.chart.Chart2D,
* int, int)
*/
@Override
protected AChart2DDataAccessor createAccessor(final Chart2D chart, final int dimension,
final int position) {
AChart2DDataAccessor result;
if (dimension == Chart2D.X) {
// Don't allow a combination of dimension and position that is not usable:
if ((position & (Chart2D.CHART_POSITION_BOTTOM | Chart2D.CHART_POSITION_TOP)) == 0) {
throw new IllegalArgumentException("X axis only valid with top or bottom position.");
}
this.setAxisPosition(position);
result = new XDataAccessor(chart);
} else if (dimension == Chart2D.Y) {
// Don't allow a combination of dimension and position that is not usable:
if ((position & (Chart2D.CHART_POSITION_LEFT | Chart2D.CHART_POSITION_RIGHT)) == 0) {
throw new IllegalArgumentException("Y axis only valid with left or right position.");
}
this.setAxisPosition(position);
result = new YDataAccessor(chart);
} else {
throw new IllegalArgumentException("Dimension has to be Chart2D.X or Chart2D.Y!");
}
return result;
}
示例2: createAccessor
/**
* @see info.monitorenter.gui.chart.axis.AAxis#createAccessor(info.monitorenter.gui.chart.Chart2D,
* int, int)
*/
@Override
protected AAxis<T>.AChart2DDataAccessor createAccessor(final Chart2D chart, final int dimension,
final int position) {
AAxis<T>.AChart2DDataAccessor result;
if (dimension == Chart2D.X) {
// Don't allow a combination of dimension and position that is not usable:
if ((position & (Chart2D.CHART_POSITION_BOTTOM | Chart2D.CHART_POSITION_TOP)) == 0) {
throw new IllegalArgumentException("X axis only valid with top or bottom position.");
}
this.setAxisPosition(position);
result = new XDataAccessor(chart);
} else if (dimension == Chart2D.Y) {
// Don't allow a combination of dimension and position that is not usable:
if ((position & (Chart2D.CHART_POSITION_LEFT | Chart2D.CHART_POSITION_RIGHT)) == 0) {
throw new IllegalArgumentException("Y axis only valid with left or right position.");
}
this.setAxisPosition(position);
result = new YDataAccessor(chart);
} else {
throw new IllegalArgumentException("Dimension has to be Chart2D.X or Chart2D.Y!");
}
return result;
}
示例3: createAccessor
/**
* @see info.monitorenter.gui.chart.axis.AAxis#createAccessor(info.monitorenter.gui.chart.Chart2D,
* int, int)
*/
@Override
protected AChart2DDataAccessor createAccessor(final Chart2D chart, final int dimension,
final int position) {
AChart2DDataAccessor result;
if (dimension == Chart2D.X) {
// Don't allow a combination of dimension and position that is not usable:
if ((position & (Chart2D.CHART_POSITION_BOTTOM | Chart2D.CHART_POSITION_TOP)) == 0) {
throw new IllegalArgumentException("X axis only valid with top or bottom position.");
}
this.setAxisPosition(position);
result = new XDataInverseAccessor(chart);
} else if (dimension == Chart2D.Y) {
// Don't allow a combination of dimension and position that is not usable:
if ((position & (Chart2D.CHART_POSITION_LEFT | Chart2D.CHART_POSITION_RIGHT)) == 0) {
throw new IllegalArgumentException("Y axis only valid with left or right position.");
}
this.setAxisPosition(position);
result = new YDataInverseAccessor(chart);
} else {
throw new IllegalArgumentException("Dimension has to be Chart2D.X or Chart2D.Y!");
}
return result;
}
示例4: paint
/**
* @see info.monitorenter.gui.chart.IAxis#paint(java.awt.Graphics)
*/
public void paint(final Graphics g2d) {
if (!this.m_visible) {
return;
}
switch (this.getDimension() | this.getAxisPosition()) {
case (Chart2D.X | Chart2D.CHART_POSITION_BOTTOM): {
this.paintAxisXBottom(g2d);
break;
}
case (Chart2D.X | Chart2D.CHART_POSITION_TOP): {
this.paintAxisXTop(g2d);
break;
}
case (Chart2D.Y | Chart2D.CHART_POSITION_LEFT): {
this.paintAxisYLeft(g2d);
break;
}
case (Chart2D.Y | Chart2D.CHART_POSITION_RIGHT): {
this.paintAxisYRight(g2d);
break;
}
default: {
throw new IllegalStateException("No valid Chart position found for this axis: " + this);
}
}
}