Package org.pentaho.reporting.designer.core.util

Examples of org.pentaho.reporting.designer.core.util.Unit


    {
      setToolTipText(null);
      return -1;
    }

    final Unit unit = WorkspaceSettings.getInstance().getUnit();
    final GuideLine[] lines = linealModel.getGuideLines();
    for (int i = 0; i < lines.length; i++)
    {
      final GuideLine guideLine = lines[i];
      double start = 0;
      if (showTopBorder)
      {
        start = getTopBorder();
      }
      final int y = (int) ((guideLine.getPosition() + start) * zoomModel.getZoomAsPercentage());
      if (y <= e.getY() + 2 && y >= e.getY() - 2)
      {
        final double unitValue = unit.convertFromPoints(guideLine.getPosition());
        setToolTipText(decimalFormat.format(unitValue));
        return i;
      }
    }

View Full Code Here


  private void drawDots(final Graphics g, double start, final double end)
  {
    g.setColor(Color.GRAY);

    final Unit unit = WorkspaceSettings.getInstance().getUnit();
    final float zoomAsPercentage = zoomModel.getZoomAsPercentage();
    final double factorForUnitAndScale = unit.getTickSize((double) zoomAsPercentage);
    final double increment = unit.getDotsPerUnit() * factorForUnitAndScale;

    start += increment / 2;
    for (double i = start; i < end; i += increment)
    {
      final int x = (int) (i * zoomAsPercentage);
 
View Full Code Here

    }
  }

  private void drawNumbers(final Graphics g, final double start, final double end)
  {
    final Unit unit = WorkspaceSettings.getInstance().getUnit();
    final float zoomAsPercentage = zoomModel.getZoomAsPercentage();
    final double factorForUnitAndScale = unit.getTickSize((double) zoomAsPercentage);

    final double increment = unit.getDotsPerUnit() * factorForUnitAndScale;

    DecimalFormat df = decimalFormatInteger;
    if (factorForUnitAndScale < 1)
    {
      df = decimalFormatNumbersOneDigit;
View Full Code Here

      setToolTipText(null);
      return -1;
    }

    final GuideLine[] lines = linealModel.getGuideLines();
    final Unit unit = WorkspaceSettings.getInstance().getUnit();
    for (int i = 0; i < lines.length; i++)
    {
      final GuideLine guideLine = lines[i];
      double start = 0;
      if (showLeftBorder)
      {
        start = getLeftBorder();
      }
      final int x = (int) ((guideLine.getPosition() + start) * getZoomAsMicropoints());
      if (x <= e.getX() + 2 && x >= e.getX() - 2)
      {
        final double unitValue = unit.convertFromPoints(guideLine.getPosition());
        setToolTipText(DECIMAL_FORMAT.format(unitValue));
        return i;
      }
    }

View Full Code Here

  private void drawDots(final Graphics g, final double start, final double end)
  {
    g.setColor(Color.GRAY);

    final Unit unit = WorkspaceSettings.getInstance().getUnit();
    final float scaleFactor = getZoomAsMicropoints();
    final double factorForUnitAndScale = unit.getTickSize((double) scaleFactor);

    final double increment = unit.getDotsPerUnit() * factorForUnitAndScale;

    for (double i = start + increment / 2; i < end; i += increment)
    {
      final int x = (int) (i * scaleFactor);
      g.drawLine(x, 7, x, 9);
View Full Code Here

  }

  private void drawNumbers(final Graphics g, final double start, final double end)
  {
    final float scaleFactor = getZoomAsMicropoints();
    final Unit unit = WorkspaceSettings.getInstance().getUnit();
    final double factorForUnitAndScale = unit.getTickSize((double) scaleFactor);

    final double increment = unit.getDotsPerUnit() * factorForUnitAndScale;

    DecimalFormat df = DECIMAL_FORMAT_NUMBERS_INTEGER;
    if (factorForUnitAndScale < 1)
    {
      df = DECIMAL_FORMAT_NUMBERS_ONE_DIGIT;
View Full Code Here

    return ObjectUtilities.equal(WorkspaceSettings.getInstance().getUnit(), unit);
  }

  public void settingsChanged()
  {
    final Unit oldState = state;
    state = WorkspaceSettings.getInstance().getUnit();
    firePropertyChange(SELECTED, oldState.equals(unit), state.equals(unit));
  }
View Full Code Here

      setToolTipText(null);
      return -1;
    }

    final GuideLine[] lines = linealModel.getGuideLines();
    final Unit unit = WorkspaceSettings.getInstance().getUnit();
    for (int i = 0; i < lines.length; i++)
    {
      final GuideLine guideLine = lines[i];
      double start = 0;
      if (showLeftBorder)
      {
        start = getLeftBorder();
      }
      final int x = (int) ((guideLine.getPosition() + start) * getZoomAsMicropoints());
      if (x <= e.getX() + 2 && x >= e.getX() - 2)
      {
        final double unitValue = unit.convertFromPoints(guideLine.getPosition());
        setToolTipText(DECIMAL_FORMAT.format(unitValue));
        return i;
      }
    }

View Full Code Here

  private void drawDots(final Graphics g, final double start, final double end)
  {
    g.setColor(Color.GRAY);

    final Unit unit = WorkspaceSettings.getInstance().getUnit();
    final float scaleFactor = getZoomAsMicropoints();
    final double factorForUnitAndScale = unit.getTickSize((double) scaleFactor);

    final double increment = unit.getDotsPerUnit() * factorForUnitAndScale;

    for (double i = start + increment / 2; i < end; i += increment)
    {
      final int x = (int) (i * scaleFactor);
      g.drawLine(x, 7, x, 9);
View Full Code Here

  }

  private void drawNumbers(final Graphics g, final double start, final double end)
  {
    final float scaleFactor = getZoomAsMicropoints();
    final Unit unit = WorkspaceSettings.getInstance().getUnit();
    final double factorForUnitAndScale = unit.getTickSize((double) scaleFactor);

    final double increment = unit.getDotsPerUnit() * factorForUnitAndScale;

    DecimalFormat df = DECIMAL_FORMAT_NUMBERS_INTEGER;
    if (factorForUnitAndScale < 1)
    {
      df = DECIMAL_FORMAT_NUMBERS_ONE_DIGIT;
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.designer.core.util.Unit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.