Package org.jrobin.core

Examples of org.jrobin.core.RrdException


  }

  Object execute() throws RrdException, IOException {
    String[] words = getRemainingWords();
    if (words.length != 2) {
      throw new RrdException("Invalid rrdinfo syntax");
    }
    String path = words[1], info;
    RrdDb rrd = getRrdDbReference(path);
    try {
      info = getInfo(rrd);
View Full Code Here


            worker.drawPolyline(x, lastY, stack.getParentColor(), new BasicStroke(0));
          }
        }
        else {
          // should not be here
          throw new RrdException("Unknown plot source: " + source.getClass().getName());
        }
        lastY = y;
      }
    }
    worker.reset();
View Full Code Here

    im.xsize = gdef.width;
    im.ysize = gdef.height;
    im.unitslength = gdef.unitsLength;
    if (gdef.onlyGraph) {
      if (im.ysize > 64) {
        throw new RrdException("Cannot create graph only, height too big");
      }
      im.xorigin = 0;
    }
    else {
      im.xorigin = (int) (PADDING_LEFT + im.unitslength * getSmallFontCharWidth());
 
View Full Code Here

  }

  Object execute() throws RrdException, IOException {
    String[] words = getRemainingWords();
    if (words.length != 2) {
      throw new RrdException("Invalid rrddump syntax");
    }
    String path = words[1];
    RrdDb rrdDb = getRrdDbReference(path);
    try {
      String xml = rrdDb.getXml();
View Full Code Here

  static long parseLong(String value) throws RrdException {
    try {
      return Long.parseLong(value);
    }
    catch (NumberFormatException nfe) {
      throw new RrdException(nfe);
    }
  }
View Full Code Here

  static int parseInt(String value) throws RrdException {
    try {
      return Integer.parseInt(value);
    }
    catch (NumberFormatException nfe) {
      throw new RrdException(nfe);
    }
  }
View Full Code Here

    }
    try {
      return Double.parseDouble(value);
    }
    catch (NumberFormatException nfe) {
      throw new RrdException(nfe);
    }
  }
View Full Code Here

    // NON-OPTIONS

    String[] words = getRemainingWords();
    // the first word must be a filename
    if (words.length < 2) {
      throw new RrdException("Image filename must be specified");
    }
    gdef.setFilename(words[1]);
    // parse remaining words, in no particular order
    for (int i = 2; i < words.length; i++) {
      if (words[i].startsWith("DEF:")) {
        parseDef(words[i]);
      }
      else if (words[i].startsWith("CDEF:")) {
        parseCDef(words[i]);
      }
      else if (words[i].startsWith("PRINT:")) {
        parsePrint(words[i]);
      }
      else if (words[i].startsWith("GPRINT:")) {
        parseGPrint(words[i]);
      }
      else if (words[i].startsWith("COMMENT:")) {
        parseComment(words[i]);
      }
      else if (words[i].startsWith("HRULE:")) {
        parseHRule(words[i]);
      }
      else if (words[i].startsWith("VRULE:")) {
        parseVRule(words[i]);
      }
      else if (words[i].startsWith("LINE1:") || words[i].startsWith("LINE2:") || words[i].startsWith("LINE3:")) {
        parseLine(words[i]);
      }
      else if (words[i].startsWith("AREA:")) {
        parseArea(words[i]);
      }
      else if (words[i].startsWith("STACK:")) {
        parseStack(words[i]);
      }
      else {
        throw new RrdException("Unexpected GRAPH token encountered: " + words[i]);
      }
    }
   
    return gdef;
    }
View Full Code Here

    }

  private void parseLine(String word) throws RrdException {
    String[] tokens1 = new ColonSplitter(word).split();
    if (tokens1.length != 2 && tokens1.length != 3) {
      throw new RrdException("Invalid LINE statement: " + word);
    }
    String[] tokens2 = tokens1[1].split("#");
    if (tokens2.length != 1 && tokens2.length != 2) {
      throw new RrdException("Invalid LINE statement: " + word);
    }
    float width = Integer.parseInt(tokens1[0].substring(tokens1[0].length() - 1));
    String name = tokens2[0];
    Paint color = tokens2.length == 2 ? Util.parseColor(tokens2[1]) : BLIND_COLOR;
    String legend = tokens1.length == 3 ? tokens1[2] : null;
View Full Code Here

  }

  private void parseArea(String word) throws RrdException {
    String[] tokens1 = new ColonSplitter(word).split();
    if (tokens1.length != 2 && tokens1.length != 3) {
      throw new RrdException("Invalid AREA statement: " + word);
    }
    String[] tokens2 = tokens1[1].split("#");
    if (tokens2.length != 1 && tokens2.length != 2) {
      throw new RrdException("Invalid AREA statement: " + word);
    }
    String name = tokens2[0];
    Paint color = tokens2.length == 2 ? Util.parseColor(tokens2[1]) : BLIND_COLOR;
    String legend = tokens1.length == 3 ? tokens1[2] : null;
    gdef.area(name, color, legend);
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.