Package simtools.ui

Examples of simtools.ui.ColorMapper


        dst.setDataSourceCollection((DataSourceCollection)o);
        chart.setTitle(dst.getName());
        for (int i=0; i<mappers.size(); ++i) {
          DataSource ds = (DataSource)mapperSources.get(i);
          if (ds!=null) ds.removeListener(this);
          ColorMapper cm = (ColorMapper)mappers.get(i);
          if (cm!=null) cm.removeListener(this);
        }
        for (int i=0; i<((DataSourceCollection)o).size(); ++i) {
          mappers.add(null); mapperSources.add(null); // no mapper by default
        }
        notifyChange();
View Full Code Here


    CategoryPlot plot = chart.getCategoryPlot();
    CategoryItemRenderer renderer = plot.getRenderer();
    boolean hasChanged = false;
    for (int i=0; i<mapperSources.size(); ++i) {
      if (ds.equals(mapperSources.get(i))) {
        ColorMapper cm = (ColorMapper)mappers.get(i);
        if (cm!=null) {
          Paint p1 = hasChanged ? null : renderer.getSeriesPaint(i);
          renderer.setSeriesPaint(i,cm.getPaint(ds,index));
          // check colors only if useful => when one color changed, don't check the others
          if (!hasChanged) {
            Paint p2 = renderer.getSeriesPaint(i);
            if (!p1.equals(p2)) hasChanged = true;
          }
View Full Code Here

        CategoryItemRenderer renderer = plot.getRenderer();
        DataSource ds = (DataSource)mapperSources.get(i);
        if ((e.source==null) && (ds!=null)) ds.removeListener(BarChartShape.this);
        mapperSources.set(i,e.source);
        if (e.source!=null) e.source.addListener(BarChartShape.this);
        ColorMapper cm = (ColorMapper)mappers.get(i);
        if ((e.mapper==null) && (cm!=null)) cm.removeListener(BarChartShape.this);
        mappers.set(i,e.mapper);
        if (e.mapper!=null) e.mapper.addListener(BarChartShape.this);
       
        if ((e.mapper!=null) && (e.source!=null)) {
          e.mapper.setDefaultPaint(e.color);
View Full Code Here

        dst.setDataSourceCollection((DataSourceCollection)o);
        chart.setTitle(dst.getName());
        for (int i=0; i<mappers.size(); ++i) {
          DataSource ds = (DataSource)mapperSources.get(i);
          if (ds!=null) ds.removeListener(this);
          ColorMapper cm = (ColorMapper)mappers.get(i);
          if (cm!=null) cm.removeListener(this);
        }
        for (int i=0; i<((DataSourceCollection)o).size(); ++i) {
          mappers.add(null); mapperSources.add(null); // no mapper by default
        }
        notifyChange();
View Full Code Here

    PiePlot plot = (PiePlot)chart.getPlot();
    SourcePieDataset dst = (SourcePieDataset)plot.getDataset();
    boolean hasChanged = false;
    for (int i=0; i<mapperSources.size(); ++i) {
      if (ds.equals(mapperSources.get(i))) {
        ColorMapper cm = (ColorMapper)mappers.get(i);
        if (cm!=null) {
          Paint p1 = hasChanged ? null : plot.getSectionPaint(i);
          plot.setSectionPaint(i,cm.getPaint(ds,index));
          // check colors only if useful => when one color changed, don't check the others
          if (!hasChanged) {
            Paint p2 = plot.getSectionPaint(i);
            if (!p1.equals(p2)) hasChanged = true;
          }
View Full Code Here

        mapperSources.set(i,e.source);
        if (e.source!=null) {
            e.source.addListener(PieChartShape.this);
            e.source.addEndNotificationListener(PieChartShape.this);
        }
        ColorMapper cm = (ColorMapper)mappers.get(i);
        if ((e.mapper==null) && (cm!=null)) cm.removeListener(PieChartShape.this);
        mappers.set(i,e.mapper);
        if (e.mapper!=null) e.mapper.addListener(PieChartShape.this);
       
        if ((e.mapper!=null) && (e.source!=null)) {
          e.mapper.setDefaultPaint(e.color);
View Full Code Here

        } else {
            cp.side=Gate.WEST;
        }

        DataSource ds = (DataSource) emitterPanel.getPropertyValue(DynamicColorPanel.DYNAMIC_COLOR_SOURCE);
        ColorMapper cm = (ColorMapper) emitterPanel.getPropertyValue(DynamicColorPanel.DYNAMIC_COLOR_MAPPER);
        cp.isInput = ds==null && cm == null;
       
        cp.ds = ds;
        cp.cm = cm;
    }
View Full Code Here

  /* (non-Javadoc)
   * @see org.jfree.chart.renderer.AbstractRenderer#getItemPaint(int, int)
   */
  public Paint getItemPaint(JSynopticXYItemRenderer renderer, int row, int column) {
    ColorMapper colorMapper = getColorMapper(row);
   
    if (colorMapper!=null) {
      DataSource ds = getDataSource(row);
      Paint ret;
      try {
        ret = colorMapper.getPaint(ds,ds.getStartIndex()+column);
      } catch (UnsupportedOperation e) {
        ret = null;
      }
      if (ret!=null) return ret;
    }
View Full Code Here

TOP

Related Classes of simtools.ui.ColorMapper

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.