Package it.eng.spagobi.engines.kpi.utils

Examples of it.eng.spagobi.engines.kpi.utils.KpiInterval


            }else if(min.doubleValue()<0){
              upper = 0;
            }         
          }
       
          KpiInterval interval = new KpiInterval();
         
          if(c!=null)  {
            interval.setColor(c);
          }else{
            interval.setColor(Color.WHITE);
          }
          if(label!=null)  {
            interval.setLabel(label);
          }else{
            interval.setLabel("");
          }
         
          if(max!=null)  {
            interval.setMax(max);
          }else{           
            interval.setMax(upper);
          }
         
          if(min!=null)  {
            interval.setMin(min);
          }else{
            interval.setMin(lower);
          }
          String color = Integer.toHexString( interval.getColor().getRGB() & 0x00ffffff ) ;
          intervals.add(interval);
        }else if (type.equals("MINIMUM")){
         
          if (min.doubleValue()<lower){
            lower = min.doubleValue()*2;
         
          if(min.doubleValue()>0){
            upper = min.doubleValue()*2;
          }else if(min.doubleValue()==0){
            upper = 10;
            lower = -10;
          }
         
          KpiInterval interval1 = new KpiInterval();
         
          if(c!=null)  {
            interval1.setColor(c);
          }else{
            interval1.setColor(Color.WHITE);
          }
          if(label!=null)  {
            interval1.setLabel(label);
          }else{
            interval1.setLabel("");
          }
            interval1.setMax(min);
            interval1.setMin(lower);
          String color1 = Integer.toHexString( interval1.getColor().getRGB() & 0x00ffffff ) ;
          intervals.add(interval1);
          KpiInterval interval2 = new KpiInterval();
            interval2.setColor(Color.WHITE);
            interval2.setLabel("");
            interval2.setMax(upper);
            interval2.setMin(min);
          String color2 = Integer.toHexString( interval2.getColor().getRGB() & 0x00ffffff ) ;
          intervals.add(interval2);
         
        }else if (type.equals("MAXIMUM")){
         
          if (max.doubleValue()>upper){
            upper = max.doubleValue()*2;
         
          if (max.doubleValue()<0){
            lower = max.doubleValue()*2;
          }else if(max.doubleValue()==0){
            lower = -10;
            upper = 10;
          }
         
          KpiInterval interval1 = new KpiInterval();
            interval1.setColor(Color.WHITE);
         
            interval1.setLabel("");
            interval1.setMax(max);
            interval1.setMin(lower)
          String color1 = Integer.toHexString( interval1.getColor().getRGB() & 0x00ffffff )
          intervals.add(interval1);
          KpiInterval interval2 = new KpiInterval();
          if(c!=null)  {
            interval2.setColor(c);
          }else{
            interval2.setColor(Color.WHITE);
          }
          if(label!=null)  {
            interval2.setLabel(label);
          }else{
            interval2.setLabel("");
          }
            interval2.setMax(upper);
            interval2.setMin(max)
          String color2 = Integer.toHexString( interval2.getColor().getRGB() & 0x00ffffff )
          intervals.add(interval2);       
        }       
        logger.debug("New interval added to the Vector");
      }
    }
View Full Code Here


    StandardDialScale scale=null;
    scale = new StandardDialScale(lower, upper, 115.0,-50.0, increment, minorTickCount);

    // sets intervals
    for (Iterator iterator = intervals.iterator(); iterator.hasNext();) {
      KpiInterval interval = (KpiInterval)iterator.next();
      StandardDialRange range = new StandardDialRange(interval.getMin(), interval.getMax(), interval.getColor());
      range.setInnerRadius(0.70);
      range.setOuterRadius(0.75);
      plot.addLayer(range);

    }
View Full Code Here

    DialCap cap = new DialCap();
    plot.setCap(cap);

    // sets intervals
    for (Iterator iterator = intervals.iterator(); iterator.hasNext();) {
      KpiInterval interval = (KpiInterval) iterator.next();
      StandardDialRange range = new StandardDialRange(interval.getMin(), interval.getMax(), interval.getColor());
      range.setInnerRadius(0.52);
      range.setOuterRadius(0.55);
      plot.addLayer(range);
      logger.debug("new range added to the plot");
    }
View Full Code Here

    plot.setUnits(ThermometerPlot.UNITS_NONE);
    logger.debug("Setted all the properties of the plot");

    // set subranges 
    for (Iterator iterator = intervals.iterator(); iterator.hasNext();){
      KpiInterval subrange = (KpiInterval) iterator.next();
      int range=0;
      //For the thermometer the number of intervals is forced to 3 and they have to have as labels the following ones
      if(subrange.getLabel().equalsIgnoreCase("NORMAL"))range=(ThermometerPlot.NORMAL);
      else if(subrange.getLabel().equalsIgnoreCase("WARNING"))range=(ThermometerPlot.WARNING);
      else if(subrange.getLabel().equalsIgnoreCase("CRITICAL"))range=(ThermometerPlot.CRITICAL);

      plot.setSubrange(range, subrange.getMin(), subrange.getMax());
      if(subrange.getColor()!=null){
        plot.setSubrangePaint(range, subrange.getColor());
      }
      logger.debug("Setted new range of the plot");
    }
 
    logger.debug("OUT");
View Full Code Here

    plot.setRange(new Range(lower, upper));
    logger.debug("Setted plot range");


    for (Iterator iterator = intervals.iterator(); iterator.hasNext();) {
      KpiInterval interval = (KpiInterval) iterator.next();
      plot.addInterval(new MeterInterval(interval.getLabel(), new Range(interval.getMin(), interval.getMax()),
          Color.lightGray, new BasicStroke(2.0f), interval.getColor()));
      logger.debug("Added new interval to the plot");
    }

    plot.setNeedlePaint(Color.darkGray);
    plot.setDialBackgroundPaint(Color.white);
View Full Code Here

        }
       
       
        //sets different marks
        for (Iterator iterator = intervals.iterator(); iterator.hasNext();) {
      KpiInterval interval = (KpiInterval) iterator.next();
      // add the marks
            IntervalMarker marker = new IntervalMarker(interval.getMin(), interval.getMax(), interval.getColor());
            plot.addRangeMarker(marker, Layer.BACKGROUND);
      logger.debug("Added new interval to the plot");
    }
       
        // customize axes
View Full Code Here

TOP

Related Classes of it.eng.spagobi.engines.kpi.utils.KpiInterval

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.