private void createRadialShapeOfMeasureValuesArea() { if (bounds.width > 1 && bounds.height > 1 && Double.compare(getMinMeasuredValue(), getMaxMeasuredValue()) != 0) { final double ANGLE_STEP = Math.toDegrees(getGaugeType().ANGLE_RANGE) / (getMaxValue() - getMinValue()); final double RADIUS = bounds.width * 0.35f - bounds.height * 0.04f; final double FREE_AREA = bounds.width / 2.0 - RADIUS; ((Arc2D) radialShapeOfMeasuredValues).setFrame(new Rectangle2D.Double(bounds.x + FREE_AREA, bounds.y + FREE_AREA, 2 * RADIUS, 2 * RADIUS)); ((Arc2D) radialShapeOfMeasuredValues).setAngleStart(getGaugeType().ORIGIN_CORRECTION - (getMinMeasuredValue() * ANGLE_STEP) + (getMinValue() * ANGLE_STEP)); ((Arc2D) radialShapeOfMeasuredValues).setAngleExtent(-(getMaxMeasuredValue() - getMinMeasuredValue()) * ANGLE_STEP); ((Arc2D) radialShapeOfMeasuredValues).setArcType(Arc2D.PIE); } }
private void createRadialShapeOfMeasureValuesArea() { if (bounds.width > 1 && bounds.height > 1 && Double.compare(getMinMeasuredValue(), getMaxMeasuredValue()) != 0) { final double ANGLE_STEP = Math.toDegrees(getAngleRange()) / (getMaxValue() - getMinValue()); final double RADIUS = bounds.width * 0.35f - bounds.height * 0.04f; final double FREE_AREA = bounds.width / 2.0 - RADIUS; ((Arc2D) radialShapeOfMeasuredValues).setFrame(new Rectangle2D.Double(bounds.x + FREE_AREA, bounds.y + FREE_AREA, 2 * RADIUS, 2 * RADIUS)); ((Arc2D) radialShapeOfMeasuredValues).setAngleStart(getOriginCorrection() - (getMinMeasuredValue() * ANGLE_STEP) + (getMinValue() * ANGLE_STEP)); ((Arc2D) radialShapeOfMeasuredValues).setAngleExtent(-(getMaxMeasuredValue() - getMinMeasuredValue()) * ANGLE_STEP); ((Arc2D) radialShapeOfMeasuredValues).setArcType(Arc2D.PIE); } }
/** * Replays the command on the given WmfFile. * * @param file the meta file. */ public void replay( final WmfFile file ) { final Graphics2D graph = file.getGraphics2D(); final Rectangle rec = getScaledBounds(); final Point start = getScaledStartingIntersection(); final Point end = getScaledEndingIntersection(); final Arc2D arc = new Arc2D.Double(); arc.setArcType( Arc2D.PIE ); arc.setFrame( rec.x, rec.y, rec.width, rec.height ); arc.setAngles( start.x, start.y, end.x, end.y ); final MfDcState state = file.getCurrentState(); if ( state.getLogBrush().isVisible() ) { state.preparePaint(); graph.fill( arc ); state.postPaint(); } if ( state.getLogPen().isVisible() ) { state.prepareDraw(); graph.draw( arc ); state.postDraw(); } }
/** * Replays the command on the given WmfFile. * * @param file the meta file. */ public void replay( final WmfFile file ) { final Graphics2D graph = file.getGraphics2D(); final Rectangle rec = getScaledBounds(); final Point start = getScaledStartingIntersection(); final Point end = getScaledEndingIntersection(); final Arc2D arc = new Arc2D.Double(); arc.setArcType( Arc2D.OPEN ); arc.setFrame( rec.x, rec.y, rec.width, rec.height ); arc.setAngles( start.x, start.y, end.x, end.y ); final MfDcState state = file.getCurrentState(); if ( state.getLogBrush().isVisible() ) { state.preparePaint(); graph.fill( arc ); state.postPaint(); } if ( state.getLogPen().isVisible() ) { state.prepareDraw(); graph.draw( arc ); state.postDraw(); } }
/** * Replays the command on the given WmfFile. * * @param file the meta file. */ public void replay( final WmfFile file ) { final Graphics2D graph = file.getGraphics2D(); final Rectangle rec = getBounds(); final Point start = getStartingIntersection(); final Point end = getEndingIntersection(); final Arc2D arc = new Arc2D.Double(); arc.setArcType( Arc2D.CHORD ); arc.setFrame( rec.x, rec.y, rec.width, rec.height ); arc.setAngles( start.x, start.y, end.x, end.y ); final MfDcState state = file.getCurrentState(); if ( state.getLogBrush().isVisible() ) { state.preparePaint(); graph.fill( arc ); state.postPaint(); } if ( state.getLogPen().isVisible() ) { state.prepareDraw(); graph.draw( arc ); state.postDraw(); } }