Package org.pau.assetmanager.viewmodel.utils

Examples of org.pau.assetmanager.viewmodel.utils.ProperitesChartDataModel


   */
  public static DefaultCategoryDataset getTotalsOverTimePerBook(
      List<Annotation> annotations, int year, Book selectedBook,
      List<PropertyBook> listOfProperties) {

    ProperitesChartDataModel properitesChartDataModel = getTotalsPerBookChartDataModel(
        annotations, year, listOfProperties);

    List<String> listOfLabels = getListOfMonthTimeLabelsForYear(year);

    DefaultCategoryDataset model = new DefaultCategoryDataset();

    for (String bookName : properitesChartDataModel.getChartData().keySet()) {
      Map<String, Double> valuesMapHacienda = properitesChartDataModel
          .getChartData().get(bookName);
      for (String currentLabel : listOfLabels) {
        Double currentValue = valuesMapHacienda.get(currentLabel);
        model.addValue(currentValue, bookName, currentLabel);
      }
View Full Code Here


   * @return the chart model
   */
  public static DefaultCategoryDataset getIncomeExpensesSimpleOverTime(
      List<Annotation> annotations, int year, Book selectedBook) {

    ProperitesChartDataModel properitesChartDataModel = getIncomeExpensesOverTimeChartDataModel(
        annotations, year);

    List<String> listOfLabels = getListOfMonthTimeLabelsForYear(year);

    DefaultCategoryDataset model = new DefaultCategoryDataset();

    Map<String, Double> valuesMapIncome = properitesChartDataModel
        .getChartData().get(INCOME_PROPERTIES);
    Map<String, Double> valuesMapIncomeOwn = properitesChartDataModel
        .getChartData().get(INCOME_OWN);
    Map<String, Double> valuesMapIncomeStocks = properitesChartDataModel
        .getChartData().get(INCOME_STOCKS);
    Map<String, Double> valuesMapIncomeMovement = properitesChartDataModel
        .getChartData().get(INCOME_MOVEMENT);
    for (String currentLabel : listOfLabels) {
      Double currentValue = valuesMapIncome.get(currentLabel);
      Double currentValueOwn = valuesMapIncomeOwn.get(currentLabel);
      Double currentValueStocks = valuesMapIncomeStocks.get(currentLabel);
      Double currentValueMovement = valuesMapIncomeMovement.get(currentLabel);
      model.addValue(currentValueMovement + currentValue + currentValueOwn + currentValueStocks,
          INCOME, currentLabel);
    }

    Map<String, Double> valuesMapExpenses = properitesChartDataModel
        .getChartData().get(EXPENSES_PROPERITES);
    Map<String, Double> valuesMapExpensesOwn = properitesChartDataModel
        .getChartData().get(EXPENSES_OWN);
    Map<String, Double> valuesMapExpensesStocks = properitesChartDataModel
        .getChartData().get(EXPENSES_STOCKS);
    Map<String, Double> valuesMapExpensesMovement = properitesChartDataModel
        .getChartData().get(EXPENSES_MOVEMENT);
    for (String currentLabel : listOfLabels) {
      Double currentValue = valuesMapExpenses.get(currentLabel);
      Double currentValueOwn = valuesMapExpensesOwn.get(currentLabel);
      Double currentValueStocks = valuesMapExpensesStocks
          .get(currentLabel);
      Double currentValueMovement = valuesMapExpensesMovement.get(currentLabel);
      model.addValue(currentValueMovement + currentValue + currentValueOwn + currentValueStocks,
          EXPENSES, currentLabel);
    }

    Map<String, Double> valuesMap = properitesChartDataModel.getChartData()
        .get(TOTAL);
    for (String currentLabel : listOfLabels) {
      Double currentValue = valuesMap.get(currentLabel);
      model.addValue(currentValue, TOTAL, currentLabel);
    }
View Full Code Here

   */
  public static DefaultCategoryDataset getIncomeExpensesOverTime(
      List<Annotation> annotations, int year, Book selectedBook,
      BookSelectionType bookSelectionType) {

    ProperitesChartDataModel properitesChartDataModel = getIncomeExpensesOverTimeChartDataModel(
        annotations, year);

    List<String> listOfLabels = getListOfMonthTimeLabelsForYear(year);

    DefaultCategoryDataset model = new DefaultCategoryDataset();

    if (bookSelectionType.getIsAllBooks()
        || (selectedBook instanceof PropertyBook)) {
      Map<String, Double> valuesMapIncome = properitesChartDataModel
          .getChartData().get(INCOME_PROPERTIES);
      for (String currentLabel : listOfLabels) {
        Double currentValue = valuesMapIncome.get(currentLabel);
        model.addValue(currentValue, INCOME_PROPERTIES, currentLabel);
      }
    }

    if (bookSelectionType.getIsAllBooks()
        || !(selectedBook instanceof PropertyBook)) {
      Map<String, Double> valuesMapIncomeOwn = properitesChartDataModel
          .getChartData().get(INCOME_OWN);
      for (String currentLabel : listOfLabels) {
        Double currentValue = valuesMapIncomeOwn.get(currentLabel);
        model.addValue(currentValue, INCOME_OWN, currentLabel);
      }
    }

    if (bookSelectionType.getIsAllBooks()
        || !(selectedBook instanceof PropertyBook)) {
      Map<String, Double> valuesMapIncomeStocks = properitesChartDataModel
          .getChartData().get(INCOME_STOCKS);
      for (String currentLabel : listOfLabels) {
        Double currentValue = valuesMapIncomeStocks.get(currentLabel);
        model.addValue(currentValue, INCOME_STOCKS, currentLabel);
      }
    }

    if (bookSelectionType.getIsAllBooks()
        || (selectedBook instanceof PropertyBook)) {
      Map<String, Double> valuesMapExpenses = properitesChartDataModel
          .getChartData().get(EXPENSES_PROPERITES);
      for (String currentLabel : listOfLabels) {
        Double currentValue = valuesMapExpenses.get(currentLabel);
        model.addValue(currentValue, EXPENSES_PROPERITES, currentLabel);
      }
    }

    if (bookSelectionType.getIsAllBooks()
        || !(selectedBook instanceof PropertyBook)) {
      Map<String, Double> valuesMapExpensesOwn = properitesChartDataModel
          .getChartData().get(EXPENSES_OWN);
      for (String currentLabel : listOfLabels) {
        Double currentValue = valuesMapExpensesOwn.get(currentLabel);
        model.addValue(currentValue, EXPENSES_OWN, currentLabel);
      }
    }

    if (bookSelectionType.getIsAllBooks()
        || !(selectedBook instanceof PropertyBook)) {
      Map<String, Double> valuesMapExpensesStocks = properitesChartDataModel
          .getChartData().get(EXPENSES_STOCKS);
      for (String currentLabel : listOfLabels) {
        Double currentValue = valuesMapExpensesStocks.get(currentLabel);
        model.addValue(currentValue, EXPENSES_STOCKS, currentLabel);
      }
    }

    if (!bookSelectionType.getIsAllBooks()) {

      Map<String, Double> valuesMap = properitesChartDataModel
          .getChartData().get(TOTAL);
      for (String currentLabel : listOfLabels) {
        Double currentValue = valuesMap.get(currentLabel);
        model.addValue(currentValue, TOTAL, currentLabel);
      }
View Full Code Here

                + annotation.getSignedAmount());
          }
        }
      }
    }
    ProperitesChartDataModel properitesChartDataModel = new ProperitesChartDataModel();
    Map<String, Map<String, Double>> chartData = properitesChartDataModel
        .getChartData();
    chartData.put(INCOME_STOCKS, incomeDataStocks);
    chartData.put(EXPENSES_STOCKS, expensesDataStocks);
    chartData.put(INCOME_OWN, incomeDataOwn);
    chartData.put(EXPENSES_OWN, expensesDataOwn);
View Full Code Here

   * @return the grouping bar model
   */
  private static ProperitesChartDataModel getTotalsPerBookChartDataModel(
      List<Annotation> annotations, int year,
      List<PropertyBook> listOfProperties) {
    ProperitesChartDataModel properitesChartDataModel = new ProperitesChartDataModel();
    Map<String, Map<String, Double>> chartData = properitesChartDataModel
        .getChartData();
    for (Book book : listOfProperties) {
      Map<String, Double> currentBookData = new HashMap<String, Double>();
      chartData.put(book.getName(), currentBookData);
      for (int month = 0; month < 12; month++) {
View Full Code Here

TOP

Related Classes of org.pau.assetmanager.viewmodel.utils.ProperitesChartDataModel

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.