Search in sources :

Example 6 with Axis

use of org.knime.base.node.viz.plotter.Axis in project knime-core by knime.

the class ScatterMatrixDrawingPane method paintHorizontalCoordinate.

/**
 * Paints the horizontal coordinates of the matrix elements at the border
 * of the drawing pane.
 *
 * @param g graphics
 * @param element the element to provide position and coordinate
 * @param y y position
 * @param top true if the coordinate is painted at the top.
 */
protected void paintHorizontalCoordinate(final Graphics g, final ScatterMatrixElement element, final int y, final boolean top) {
    Axis paintAxis = new Axis(Axis.HORIZONTAL, element.getWidth(), top);
    paintAxis.setCoordinate(element.getXCoordinate());
    int axisX = element.getCorner().x;
    g.translate(axisX, y);
    paintAxis.paintComponent(g);
    g.translate(-axisX, -y);
}
Also used : Axis(org.knime.base.node.viz.plotter.Axis)

Example 7 with Axis

use of org.knime.base.node.viz.plotter.Axis in project knime-core by knime.

the class ScatterMatrixDrawingPane method paintVerticalCoordinate.

/**
 * Paints the vertical coordinates at the border of the drawing pane.
 *
 * @param g graphics
 * @param element element to provide position and coordinate
 * @param x the x position
 * @param left true if the coordinate is painted on the left side.
 */
protected void paintVerticalCoordinate(final Graphics g, final ScatterMatrixElement element, final int x, final boolean left) {
    Axis paintAxis = new Axis(Axis.VERTICAL, element.getHeight(), !left);
    paintAxis.setCoordinate(element.getYCoordinate());
    int axisY = element.getCorner().y;
    int transX = x - Axis.SIZE;
    g.translate(transX, axisY);
    paintAxis.paintComponent(g);
    g.translate(-transX, -axisY);
}
Also used : Axis(org.knime.base.node.viz.plotter.Axis)

Aggregations

Axis (org.knime.base.node.viz.plotter.Axis)7 Coordinate (org.knime.base.util.coordinate.Coordinate)4 NumericCoordinate (org.knime.base.util.coordinate.NumericCoordinate)4 DataColumnSpec (org.knime.core.data.DataColumnSpec)2 Point (java.awt.Point)1