Package org.jrobin.core

Examples of org.jrobin.core.RrdException


  }

  private void parseHRule(RrdGraphDef graphDef, String word) throws RrdException {
    String[] tokens1 = new ColonSplitter(word).split();
    if (tokens1.length < 2 || tokens1.length > 3) {
      throw new RrdException("Invalid HRULE statement: " + word);
    }
    String[] tokens2 = tokens1[1].split("#");
    if (tokens2.length != 2) {
      throw new RrdException("Invalid HRULE statement: " + word);
    }
    double value = parseDouble(tokens2[0]);
    Paint color = Util.parseColor(tokens2[1]);
    graphDef.hrule(value, color, tokens1.length == 3 ? tokens1[2] : null);
  }
View Full Code Here


  }

  private void parseVRule(RrdGraphDef graphDef, String word) throws RrdException {
    String[] tokens1 = new ColonSplitter(word).split();
    if (tokens1.length < 2 || tokens1.length > 3) {
      throw new RrdException("Invalid VRULE statement: " + word);
    }
    String[] tokens2 = tokens1[1].split("#");
    if (tokens2.length != 2) {
      throw new RrdException("Invalid VRULE statement: " + word);
    }
    long timestamp = Util.getTimestamp(tokens2[0]);
    Paint color = Util.parseColor(tokens2[1]);
    graphDef.vrule(timestamp, color, tokens1.length == 3 ? tokens1[2] : null);
  }
View Full Code Here

  }

  private void parseComment(RrdGraphDef graphDef, String word) throws RrdException {
    String[] tokens = new ColonSplitter(word).split();
    if (tokens.length != 2) {
      throw new RrdException("Invalid COMMENT specification: " + word);
    }
    graphDef.comment(tokens[1]);
  }
View Full Code Here


  private void parseDef(RrdGraphDef graphDef, String word) throws RrdException {
    String[] tokens1 = new ColonSplitter(word).split();
    if (tokens1.length != 4) {
      throw new RrdException("Invalid DEF specification: " + word);
    }
    String[] tokens2 = tokens1[1].split("=");
    if (tokens2.length != 2) {
      throw new RrdException("Invalid DEF specification: " + word);
    }
    graphDef.datasource(tokens2[0], tokens2[1], tokens1[2], tokens1[3]);
  }
View Full Code Here

  }

  private void parseCDef(RrdGraphDef graphDef, String word) throws RrdException {
    String[] tokens1 = new ColonSplitter(word).split();
    if (tokens1.length != 2) {
      throw new RrdException("Invalid CDEF specification: " + word);
    }
    String[] tokens2 = tokens1[1].split("=");
    if (tokens2.length != 2) {
      throw new RrdException("Invalid DEF specification: " + word);
    }
    graphDef.datasource(tokens2[0], tokens2[1]);
  }
View Full Code Here

  }

  private void parsePrint(RrdGraphDef graphDef, String word) throws RrdException {
    String[] tokens = new ColonSplitter(word).split();
    if (tokens.length != 4) {
      throw new RrdException("Invalid PRINT specification: " + word);
    }
    graphDef.print(tokens[1], tokens[2], tokens[3]);
  }
View Full Code Here

  }

  private void parseGPrint(RrdGraphDef graphDef, String word) throws RrdException {
    String[] tokens = new ColonSplitter(word).split();
    if (tokens.length != 4) {
      throw new RrdException("Invalid GPRINT specification: " + word);
    }
    graphDef.gprint(tokens[1], tokens[2], tokens[3]);
  }
View Full Code Here

      return;
    }
    for (String colorOption : colorOptions) {
      String[] tokens = colorOption.split("#");
      if (tokens.length != 2) {
        throw new RrdException("Invalid COLOR specification: " + colorOption);
      }
      String colorName = tokens[0];
      Paint paint = Util.parseColor(tokens[1]);
      graphDef.setColor(colorName, paint);
    }
View Full Code Here

      graphDef.setDrawYGrid(false);
      return;
    }
    String[] tokens = new ColonSplitter(ygrid).split();
    if (tokens.length != 2) {
      throw new RrdException("Invalid YGRID settings: " + ygrid);
    }
    double gridStep = parseDouble(tokens[0]);
    int labelFactor = parseInt(tokens[1]);
    graphDef.setValueAxis(gridStep, labelFactor);
  }
View Full Code Here

      graphDef.setDrawXGrid(false);
      return;
    }
    String[] tokens = new ColonSplitter(xgrid).split();
    if (tokens.length != 8) {
      throw new RrdException("Invalid XGRID settings: " + xgrid);
    }
    int minorUnit = resolveUnit(tokens[0]), majorUnit = resolveUnit(tokens[2]),
        labelUnit = resolveUnit(tokens[4]);
    int minorUnitCount = parseInt(tokens[1]), majorUnitCount = parseInt(tokens[3]),
        labelUnitCount = parseInt(tokens[5]);
View Full Code Here

TOP

Related Classes of org.jrobin.core.RrdException

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.