Examples of StyleLabel


Examples of it.eng.spagobi.engines.chart.utils.StyleLabel

    }

    logger.debug("Style Labels");

    Color colorSubInvisibleTitle=Color.decode("#FFFFFF");
    StyleLabel styleSubSubTitle=new StyleLabel("Arial",12,colorSubInvisibleTitle);
    TextTitle subsubTitle =setStyleTitle("", styleSubSubTitle);
    chart.addSubtitle(subsubTitle);
    // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...

    // set the background color for the chart...
View Full Code Here

Examples of it.eng.spagobi.engines.chart.utils.StyleLabel

            size=Integer.valueOf(sizeS).intValue();
          }else{
            size = defaultLabelsStyle.getSize();
          }
         
          labelsTickStyle=new StyleLabel(fontS,size,color);

        }
        catch (Exception e) {
          logger.error("Wrong style labels settings, use default");
        }

      }else{
        labelsTickStyle = defaultLabelsStyle;
      }
     
      SourceBean styleValueLabelsSB = (SourceBean)content.getAttribute(STYLE_VALUE_LABEL);
      if(styleValueLabelsSB!=null){

        String fontS = (String)styleValueLabelsSB.getAttribute(FONT_STYLE);
        if(fontS==null){
          fontS = defaultLabelsStyle.getFontName();
        }
        String sizeS = (String)styleValueLabelsSB.getAttribute(SIZE_STYLE);
        String colorS = (String)styleValueLabelsSB.getAttribute(COLOR_STYLE);
       
        try{
          Color color= Color.BLACK;
          if(colorS!=null){
            color=Color.decode(colorS);
          }else{
            defaultLabelsStyle.getColor();
          }
          int size= 12;
          if(sizeS!=null){
            size=Integer.valueOf(sizeS).intValue();
          }else{
            size = defaultLabelsStyle.getSize();
          }
          labelsValueStyle=new StyleLabel(fontS,size,color);

        }
        catch (Exception e) {
          logger.error("Wrong style labels settings, use default");
        }
View Full Code Here

Examples of it.eng.spagobi.engines.chart.utils.StyleLabel

          size=Integer.valueOf(sizeS).intValue();
        }else{
          size = defaultLabelsStyle.getSize();
        }

        styleXaxesLabels=new StyleLabel(fontS,size,color);

      }
      catch (Exception e) {
        logger.error("Wrong style labels settings, use default");
      }

    }else{
      styleXaxesLabels = defaultLabelsStyle;
    }

    SourceBean styleYaxisLabelsSB = (SourceBean)content.getAttribute("STYLE_Y_AXIS_LABELS");
    if(styleYaxisLabelsSB!=null){

      String fontS = (String)content.getAttribute("STYLE_Y_AXIS_LABELS.font");
      if(fontS==null){
        fontS = defaultLabelsStyle.getFontName();
      }
      String sizeS = (String)content.getAttribute("STYLE_Y_AXIS_LABELS.size");
      String colorS = (String)content.getAttribute("STYLE_Y_AXIS_LABELS.color");
      String orientationS = (String)content.getAttribute("STYLE_Y_AXIS_LABELS.orientation");
      if(orientationS==null){
        orientationS = "horizontal";
      }

      try{
        Color color= Color.BLACK;
        if(colorS!=null){
          color=Color.decode(colorS);
        }else{
          defaultLabelsStyle.getColor();
        }
        int size= 12;
        if(sizeS!=null){
          size=Integer.valueOf(sizeS).intValue();
        }else{
          size = defaultLabelsStyle.getSize();
        }

        styleYaxesLabels=new StyleLabel(fontS,size,color);

      }
      catch (Exception e) {
        logger.error("Wrong style labels settings, use default");
      }

    }else{
      styleYaxesLabels = defaultLabelsStyle;
    }

    SourceBean styleValueLabelsSB = (SourceBean)content.getAttribute("STYLE_VALUE_LABELS");
    if(styleValueLabelsSB!=null){

      String fontS = (String)content.getAttribute("STYLE_VALUE_LABELS.font");
      if(fontS==null){
        fontS = defaultLabelsStyle.getFontName();
      }
      String sizeS = (String)content.getAttribute("STYLE_VALUE_LABELS.size");
      String colorS = (String)content.getAttribute("STYLE_VALUE_LABELS.color");
      String orientationS = (String)content.getAttribute("STYLE_VALUE_LABELS.orientation");
      if(orientationS==null){
        orientationS = "horizontal";
      }

      try{
        Color color= Color.BLACK;
        if(colorS!=null){
          color=Color.decode(colorS);
        }else{
          defaultLabelsStyle.getColor();
        }
        int size= 12;
        if(sizeS!=null){
          size=Integer.valueOf(sizeS).intValue();
        }else{
          size = defaultLabelsStyle.getSize();
        }

        styleValueLabels=new StyleLabel(fontS,size,color,orientationS);

      }
      catch (Exception e) {
        logger.error("Wrong style labels settings, use default");
      }
View Full Code Here

Examples of it.eng.spagobi.engines.chart.utils.StyleLabel


      try{
        Color color=Color.decode(colorS);
        int size=Integer.valueOf(sizeS).intValue();
        styleTitle=new StyleLabel(fontS,size,color);
       
      }
      catch (Exception e) {
        logger.error("Wrong style Title settings, use default");
      }

    }
   
    SourceBean styleSubTitleSB = (SourceBean)content.getAttribute(STYLE_SUBTITLE);
    if(styleSubTitleSB!=null){

      String subTitle = (String)styleSubTitleSB.getAttribute(NAME_STYLE);
      if(subTitle!=null) {
        String tmpSubTitle = subTitle;
        while (!tmpSubTitle.equals("")){
          if (tmpSubTitle.indexOf("$P{") >= 0){
            String parName = tmpSubTitle.substring(tmpSubTitle.indexOf("$P{")+3, tmpSubTitle.indexOf("}"));
            String parValue = (parametersObject.get(parName)==null)?"":(String)parametersObject.get(parName);
            parValue = parValue.replaceAll("\'", "");
            if(parValue.equals("%")) parValue = "";
            int pos = tmpSubTitle.indexOf("$P{"+parName+"}") + (parName.length()+4);
            subTitle = subTitle.replace("$P{" + parName + "}", parValue);
            tmpSubTitle = tmpSubTitle.substring(pos);
          }
          else
            tmpSubTitle = "";
        }
        setSubName(subTitle);
      }
      else setSubName("");
     
      String fontS = (String)styleSubTitleSB.getAttribute(FONT_STYLE);
      String sizeS = (String)styleSubTitleSB.getAttribute(SIZE_STYLE);
      String colorS = (String)styleSubTitleSB.getAttribute(COLOR_STYLE);


      try{
        Color color=Color.decode(colorS);
        int size=Integer.valueOf(sizeS).intValue();
        styleSubTitle=new StyleLabel(fontS,size,color);       
      }
      catch (Exception e) {
        logger.error("Wrong style SubTitle settings, use default");
      }

    }

    SourceBean styleLabelsSB = (SourceBean)content.getAttribute(STYLE_LABELS_DEFAULT);
    if(styleLabelsSB!=null){

      String fontS = (String)styleLabelsSB.getAttribute(FONT_STYLE);
      if(fontS==null){
        fontS = "Arial";
      }
      String sizeS = (String)styleLabelsSB.getAttribute(SIZE_STYLE);
      if(sizeS==null){
        sizeS = "12";
      }
      String colorS = (String)styleLabelsSB.getAttribute(COLOR_STYLE);
      if(colorS==null){
        colorS = "#000000";
      }
      String orientationS = (String)styleLabelsSB.getAttribute(ORIENTATION_STYLE);
      if(orientationS==null){
        orientationS = "horizontal";
      }

      try{
        Color color=Color.decode(colorS);
        int size=Integer.valueOf(sizeS).intValue();
        defaultLabelsStyle=new StyleLabel(fontS,size,color,orientationS);

      }
      catch (Exception e) {
        logger.error("Wrong style labels settings, use default");
      }

    }else{
      defaultLabelsStyle=new StyleLabel("Arial", 12,Color.BLACK);
    }

    if(content.getAttribute("title_dimension")!=null)
    {
      String titleD=((String)content.getAttribute(TITLE_DIMENSION));
      titleDimension=Integer.valueOf(titleD).intValue();
    }
    else setTitleDimension(18);


    String colS = (String)content.getAttribute(COLORS_BACKGROUND);
    if(colS!=null)
    {
      Color col=new Color(Integer.decode(colS).intValue());
      if(col!=null){
        setColor(col);}
      else{
        setColor(Color.white);
      }
    }
    else {  
      setColor(Color.white);
    }

    String widthS = (String)content.getAttribute(DIMENSION_WIDTH);
    String heightS = (String)content.getAttribute(DIMENSION_HEIGHT);
    if(widthS==null || heightS==null){
      logger.warn("Width or height non defined, use default ones");
      widthS="400";
      heightS="300";
    }

    width=Integer.valueOf(widthS).intValue();
    height=Integer.valueOf(heightS).intValue();

    // get all the data parameters


    try{         
      Map dataParameters = new HashMap();
      SourceBean dataSB = (SourceBean)content.getAttribute(CONF);
      List dataAttrsList = dataSB.getContainedSourceBeanAttributes();
      Iterator dataAttrsIter = dataAttrsList.iterator();
      while(dataAttrsIter.hasNext()) {
        SourceBeanAttribute paramSBA = (SourceBeanAttribute)dataAttrsIter.next();
        SourceBean param = (SourceBean)paramSBA.getValue();
        String nameParam = (String)param.getAttribute("name");
        String valueParam = (String)param.getAttribute("value");
        dataParameters.put(nameParam, valueParam);
      }


      if(dataParameters.get(CONF_DATASET)!=null && !(((String)dataParameters.get(CONF_DATASET)).equalsIgnoreCase("") )){ 
        confDataset=(String)dataParameters.get(CONF_DATASET);
        isLovConfDefined=true;
      }
      else {
        isLovConfDefined=false;
      }

      legend=true;
      if(dataParameters.get(LEGEND)!=null && !(((String)dataParameters.get(LEGEND)).equalsIgnoreCase("") )){ 
        String leg=(String)dataParameters.get(LEGEND);
        if(leg.equalsIgnoreCase("false"))
          legend=false;
      }

      legendPosition="bottom";
      if(dataParameters.get(LEGEND_POSITION)!=null && !(((String)dataParameters.get(LEGEND_POSITION)).equalsIgnoreCase("") )){ 
        String leg=(String)dataParameters.get(LEGEND_POSITION);
        if(leg.equalsIgnoreCase("bottom") || leg.equalsIgnoreCase("left") || leg.equalsIgnoreCase("right") || leg.equalsIgnoreCase("top"))
          legendPosition=leg;
      }
     
      filter=true;
      if(dataParameters.get(VIEW_FILTER)!=null && !(((String)dataParameters.get(VIEW_FILTER)).equalsIgnoreCase("") )){ 
        String fil=(String)dataParameters.get(VIEW_FILTER);
        if(fil.equalsIgnoreCase("false"))
          filter=false;
      }

      slider=true;
      if(dataParameters.get(VIEW_SLIDER)!=null && !(((String)dataParameters.get(VIEW_SLIDER)).equalsIgnoreCase("") )){ 
        String sli=(String)dataParameters.get(VIEW_SLIDER);
        if(sli.equalsIgnoreCase("false"))
          slider=false;
      }

      sliderStartFromEnd=false;
      if(dataParameters.get(SLIDER_START_FROM_END)!=null && !(((String)dataParameters.get(SLIDER_START_FROM_END)).equalsIgnoreCase("") )){ 
        String sli=(String)dataParameters.get(SLIDER_START_FROM_END);
        if(sli.equalsIgnoreCase("true"))
          sliderStartFromEnd=true;
      }
     
      positionSlider="top";
      if(dataParameters.get(POSITION_SLIDER)!=null && !(((String)dataParameters.get(POSITION_SLIDER)).equalsIgnoreCase("") )){ 
        positionSlider=(String)dataParameters.get(POSITION_SLIDER);
      }
     
      //reading series orders if present
      SourceBean sbSerieLabels = (SourceBean)content.getAttribute(SERIES_LABELS);
      // back compatibility
      if(sbSerieLabels==null){
        sbSerieLabels = (SourceBean)content.getAttribute("CONF.SERIES_LABELS");
      }
      if(sbSerieLabels!=null){
        seriesLabelsMap=new LinkedHashMap();
        List atts=sbSerieLabels.getContainedAttributes();
        String serieLabel="";
        for (Iterator iterator = atts.iterator(); iterator.hasNext();) {
          SourceBeanAttribute object = (SourceBeanAttribute) iterator.next();
          String serieName=(String)object.getKey();
          serieLabel=new String((String)object.getValue());
          if(serieLabel!=null){
            seriesLabelsMap.put(serieName, serieLabel);
          }
        }   
      }
     
      SourceBean styleLegendSB = (SourceBean)content.getAttribute(LEGEND_STYLE);
      if(styleLegendSB!=null){

        String fontS = (String)styleLegendSB.getAttribute(FONT_STYLE);
        String sizeS = (String)styleLegendSB.getAttribute(SIZE_STYLE);
        String colorS = (String)styleLegendSB.getAttribute(COLOR_STYLE);


        try{
          Color color=Color.decode(colorS);
          int size=Integer.valueOf(sizeS).intValue();
          styleLegend=new StyleLabel(fontS,size,color);
         
        }
        catch (Exception e) {
          logger.error("Wrong style Legend settings, use default");
        }
View Full Code Here

Examples of it.eng.spagobi.engines.chart.utils.StyleLabel

      TextTitle subTitle =setStyleTitle(subName, styleSubTitle);
      chart.addSubtitle(subTitle);
    }

    Color colorSubInvisibleTitle=Color.decode("#FFFFFF");
    StyleLabel styleSubSubTitle=new StyleLabel("Arial",12,colorSubInvisibleTitle);
    TextTitle subsubTitle =setStyleTitle("", styleSubSubTitle);
    chart.addSubtitle(subsubTitle);
   
    chart.setBackgroundPaint(color);
    XYPlot plot = (XYPlot) chart.getPlot();
View Full Code Here

Examples of it.eng.spagobi.engines.chart.utils.StyleLabel


      try{
        Color color=Color.decode(colorS);
        int size=Integer.valueOf(sizeS).intValue();
        addLabelsStyle=new StyleLabel(fontS,size,color,orientationS);

      }
      catch (Exception e) {
        logger.error("Wrong style labels settings, use default");
      }
View Full Code Here

Examples of it.eng.spagobi.engines.chart.utils.StyleLabel

      String colorS = (String)styleAnnotationSB.getAttribute(COLOR_STYLE);
      if(colorS==null)colorS="#000000";
      try{
        Color color=Color.decode(colorS);
        int size=Integer.valueOf(sizeS).intValue();
        styleAnnotation=new StyleLabel(fontS,size,color);
      }
      catch (Exception e) {
        logger.error("Wrong style Annotation settings, use default");
      }
View Full Code Here

Examples of it.eng.spagobi.engines.chart.utils.StyleLabel

          size=Integer.valueOf(sizeS).intValue();
        }else{
          size = defaultLabelsStyle.getSize();
        }

        styleXaxesLabels=new StyleLabel(fontS,size,color);

      }
      catch (Exception e) {
        logger.error("Wrong style labels settings, use default");
      }

    }else{
      styleXaxesLabels = defaultLabelsStyle;
    }

    SourceBean styleYaxisLabelsSB = (SourceBean)content.getAttribute("STYLE_Y_AXIS_LABELS");
    if(styleYaxisLabelsSB!=null){

      String fontS = (String)content.getAttribute("STYLE_Y_AXIS_LABELS.font");
      if(fontS==null){
        fontS = defaultLabelsStyle.getFontName();
      }
      String sizeS = (String)content.getAttribute("STYLE_Y_AXIS_LABELS.size");
      String colorS = (String)content.getAttribute("STYLE_Y_AXIS_LABELS.color");
      String orientationS = (String)content.getAttribute("STYLE_Y_AXIS_LABELS.orientation");
      if(orientationS==null){
        orientationS = "horizontal";
      }

      try{
        Color color= Color.BLACK;
        if(colorS!=null){
          color=Color.decode(colorS);
        }else{
          defaultLabelsStyle.getColor();
        }
        int size= 12;
        if(sizeS!=null){
          size=Integer.valueOf(sizeS).intValue();
        }else{
          size = defaultLabelsStyle.getSize();
        }

        styleYaxesLabels=new StyleLabel(fontS,size,color);

      }
      catch (Exception e) {
        logger.error("Wrong style labels settings, use default");
      }

    }else{
      styleYaxesLabels = defaultLabelsStyle;
    }

    SourceBean styleValueLabelsSB = (SourceBean)content.getAttribute("STYLE_VALUE_LABELS");
    if(styleValueLabelsSB!=null){

      String fontS = (String)content.getAttribute("STYLE_VALUE_LABELS.font");
      if(fontS==null){
        fontS = defaultLabelsStyle.getFontName();
      }
      String sizeS = (String)content.getAttribute("STYLE_VALUE_LABELS.size");
      String colorS = (String)content.getAttribute("STYLE_VALUE_LABELS.color");
      String orientationS = (String)content.getAttribute("STYLE_VALUE_LABELS.orientation");
      if(orientationS==null){
        orientationS = "horizontal";
      }

      try{
        Color color= Color.BLACK;
        if(colorS!=null){
          color=Color.decode(colorS);
        }else{
          defaultLabelsStyle.getColor();
        }
        int size= 12;
        if(sizeS!=null){
          size=Integer.valueOf(sizeS).intValue();
        }else{
          size = defaultLabelsStyle.getSize();
        }

        styleValueLabels=new StyleLabel(fontS,size,color);

      }
      catch (Exception e) {
        logger.error("Wrong style labels settings, use default");
      }
View Full Code Here

Examples of it.eng.spagobi.engines.chart.utils.StyleLabel

          size=Integer.valueOf(sizeS).intValue();
        }else{
          size = defaultLabelsStyle.getSize();
        }

        styleValueLabels=new StyleLabel(fontS,size,color,orientationS);

      }
      catch (Exception e) {
        logger.error("Wrong style labels settings, use default");
      }
View Full Code Here

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

      String sizeS = (String) content.getAttribute("STYLE_TITLE.size");
      String colorS = (String) content.getAttribute("STYLE_TITLE.color");
      try {
        Color color = Color.decode(colorS);
        int size = Integer.valueOf(sizeS).intValue();
        styleTitle = new StyleLabel(fontS, size, color);
      } catch (Exception e) {
        logger.error("Wrong style Title settings, use default");
      }

    } else {
      styleTitle = new StyleLabel("Arial", 16, new Color(255, 0, 0));
    }
    this.confMap.put("styleTitle", styleTitle);

    //Getting SUBTITLE and setting its style
    SourceBean styleSubTitleSB = (SourceBean) content.getAttribute("STYLE_SUBTITLE");
    if (styleSubTitleSB != null) {

      String subTitle = (String) content.getAttribute("STYLE_SUBTITLE.name");
      subTitle = replaceParsInString(subTitle);
      setSubName(subTitle);   
      String fontS = (String) content.getAttribute("STYLE_SUBTITLE.font");
      String sizeS = (String) content.getAttribute("STYLE_SUBTITLE.size");
      String colorS = (String) content.getAttribute("STYLE_SUBTITLE.color");
      try {
        Color color = Color.decode(colorS);
        int size = Integer.valueOf(sizeS).intValue();
        styleSubTitle = new StyleLabel(fontS, size, color);
      } catch (Exception e) {
        logger.error("Wrong style SubTitle settings, use default");
      }
    } else {
      styleSubTitle = new StyleLabel("Arial", 12, new Color(0, 0, 0));
    }
    this.confMap.put("styleSubTitle", styleSubTitle);

    // get all the other template parameters
    try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.