use of org.knime.base.node.viz.plotter.Axis in project knime-core by knime.
the class ParallelCoordinateDrawingPane method drawNominalAxis.
/**
* Draws a nominal axis with the labels of all possible values.
*
* @param g the graphics object
* @param axis the axis
*/
protected void drawNominalAxis(final Graphics g, final NominalParallelAxis axis) {
// check whether the axis is on the right side of the center
boolean right = getWidth() / 2.0 < axis.getXPosition();
Axis paintAxis = new Axis(Axis.VERTICAL, axis.getHeight(), right);
paintAxis.setCoordinate(axis.getCoordinate());
int x = axis.getXPosition() - Axis.SIZE + 1;
int y = TOP_SPACE;
g.translate(x, y);
paintAxis.paintComponent(g);
g.translate(-x, -y);
}
use of org.knime.base.node.viz.plotter.Axis in project knime-core by knime.
the class AbstractHistogramPlotter method setXCoordinates.
/**
* Sets the x coordinates for the current
* {@link AbstractHistogramVizModel}.
*/
protected void setXCoordinates() {
final DataColumnSpec colSpec = getXColumnSpec();
// tell the headers to display the new column names
final Coordinate xCoordinate = Coordinate.createCoordinate(colSpec);
if (xCoordinate == null) {
throw new IllegalStateException("Internal exception: " + " Unable to create x coordinates");
}
if (getXAxis() == null) {
final Axis xAxis = new Axis(Axis.HORIZONTAL, getDrawingPaneDimension().width);
setXAxis(xAxis);
}
getXAxis().setCoordinate(xCoordinate);
getXAxis().setToolTipText(colSpec.getName());
}
use of org.knime.base.node.viz.plotter.Axis in project knime-core by knime.
the class AbstractHistogramPlotter method getAggregationCoordinate.
/**
* @return the {@link Coordinate} of the aggregation axis.
*/
private Coordinate getAggregationCoordinate() {
final Axis aggrAxis = getYAxis();
if (aggrAxis == null) {
throw new IllegalStateException("Aggregation axis must not be null");
}
final Coordinate aggrCoordinate = aggrAxis.getCoordinate();
if (aggrCoordinate == null) {
throw new IllegalStateException("Aggregation coordinate must not be null");
}
return aggrCoordinate;
}
use of org.knime.base.node.viz.plotter.Axis in project knime-core by knime.
the class AbstractHistogramPlotter method getXCoordinate.
/**
* @return the {@link Coordinate} of the x axis.
*/
private Coordinate getXCoordinate() {
final Axis xAxis = getXAxis();
if (xAxis == null) {
throw new IllegalStateException("X axis must not be null");
}
final Coordinate xCoordinate = xAxis.getCoordinate();
if (xCoordinate == null) {
throw new IllegalStateException("X coordinate must not be null");
}
return xCoordinate;
}
use of org.knime.base.node.viz.plotter.Axis in project knime-core by knime.
the class AbstractHistogramPlotter method setYCoordinates.
/**
* Sets the y coordinates for the current
* {@link AbstractHistogramVizModel}.
*/
protected void setYCoordinates() {
final DataColumnSpec aggrColSpec = getAggregationColSpec();
// setYColName(aggrColSpec.getName());
// tell the headers to display the new column names
final Coordinate yCoordinate = Coordinate.createCoordinate(aggrColSpec);
if (getYAxis() == null) {
final Axis yAxis = new Axis(Axis.VERTICAL, getDrawingPaneDimension().height);
setYAxis(yAxis);
}
getYAxis().setCoordinate(yCoordinate);
getYAxis().setToolTipText(aggrColSpec.getName());
}
Aggregations