package de.ivu.elect.business.gruppe.entity;

import de.ivu.elect.presentation.charts.BarChartSize;

/**
 *  on 22.07.2015.
 */
public enum ChartGroesse {

  AUTO {
    @Override
    public BarChartSize getBarChartSize() {
      return BarChartSize.AUTO;
    }

    @Override
    public long getWidthSvg() {
      return 400;
    }

    @Override
    public long getHeightSvg() {
      return 300;
    }

  },

  W800_H600,
  W1024_H768,
  W1152_H864,
  W1440_H900,
  W1536_H864,
  W1600_H1200,
  W1920_H1080,
  W1920_H1200,
  W3000_H2000,
  W6000_H4000,
  W12000_H8000;

  public BarChartSize getBarChartSize() {
    return new BarChartSize(getWidth(), getHeight());
  }

  protected long getWidth() {
    return Long.parseLong(name().substring(name().indexOf("W") + 1, name().indexOf("_H")));
  }

  protected long getHeight() {
    return Long.parseLong(name().substring(name().indexOf("H") + 1));
  }

  public long getWidthSvg() {
    return getWidth();
  }

  public long getHeightSvg() {
    return getHeight();
  }

}
