Search in sources :

Example 6 with Meter

use of org.apache.pivot.wtk.Meter in project pivot by apache.

the class TerraMeterSkin method paint.

@Override
public void paint(Graphics2D graphics) {
    Meter meter = (Meter) getComponent();
    int width = getWidth();
    int height = getHeight();
    if (meter.getOrientation() == Orientation.HORIZONTAL) {
        drawMeter(meter, graphics, width, height);
    } else {
        graphics.rotate(-Math.PI / 2d);
        graphics.translate(-height, 0);
        drawMeter(meter, graphics, height, width);
    }
}
Also used : Meter(org.apache.pivot.wtk.Meter) GradientPaint(java.awt.GradientPaint)

Example 7 with Meter

use of org.apache.pivot.wtk.Meter in project pivot by apache.

the class TerraMeterSkin method install.

@Override
public void install(Component component) {
    super.install(component);
    Meter meter = (Meter) component;
    meter.getMeterListeners().add(this);
}
Also used : Meter(org.apache.pivot.wtk.Meter)

Aggregations

Meter (org.apache.pivot.wtk.Meter)7 GradientPaint (java.awt.GradientPaint)5 FontRenderContext (java.awt.font.FontRenderContext)4 LineMetrics (java.awt.font.LineMetrics)3 Rectangle2D (java.awt.geom.Rectangle2D)2 Dimensions (org.apache.pivot.wtk.Dimensions)1 Test (org.junit.Test)1