Package org.timepedia.chronoscope.client.canvas

Examples of org.timepedia.chronoscope.client.canvas.Color


public class ChartPanelTest extends ChronoscopeTestCaseBase {

  public void testGssContextOverride() {
    ChartPanel cp = Chronoscope
        .createTimeseriesChart(Fixtures.getTestDataset(), 600, 400);
    final Color color = new Color("#ff0000");
   
    cp.setGssContext(new IEGssContext() {
      public GssProperties getProperties(GssElement gssElem, String pseudoElt) {
        if ("axes".equals(gssElem.getType())) {
          return new GssProperties() {
            {
              this.bgColor = color;
            }
          };
        }
        return super.getProperties(gssElem, pseudoElt);
      }
    });
    cp.setReadyListener(new ViewReadyCallback() {
      public void onViewReady(View view) {
        GssProperties props = view
            .getGssProperties(new GssElementImpl("axes", null), "");
        assertEquals(color.toString(), "#ff0000");
        finishTest();
      }
    });
    delayTestFinish(15000);
    RootPanel.get().add(cp);
View Full Code Here


      p.transparency = 0.3f;
    }
  }

  private void configDomainMarkerProps(GssProperties p) {
    p.bgColor = new Color("#10f410");
    p.color = Color.GRAY;
    p.transparency = 0.1f;
    p.lineThickness = 2;
    p.visible = true;
    p.fontSize = "8pt";
View Full Code Here

    p.bgColor = datasetColorMap.get(elt);
    p.transparency = 0.0f;
  }
 
  private void configGridProps(GssProperties p) {
    p.color = new Color("gainsboro");
    p.visible = false;
  }
View Full Code Here

    p.color = new Color("gainsboro");
    p.visible = false;
  }
 
  private void configMarkerProps(GssProperties p) {
    p.bgColor = new Color("peachpuff");
    p.color = new Color("navy");
    p.lineThickness = 0.5;
    p.fontSize = "8pt";
  }
View Full Code Here

    p.fontSize = "8pt";
    p.display = "framed"; // use actual min, max to denote range axis frame
  }

  private void configRangeMarkerProps(GssProperties p) {
    p.bgColor = new Color("powderblue");
    p.color = Color.GRAY;
    p.transparency = 0.1f;
    p.lineThickness = 5;
    p.visible = true;
  }
View Full Code Here

    backingCanvas.moveTo(x - 1, y);
    backingCanvas.lineTo(x + labelWidth + 3, y);
    backingCanvas.lineTo(x + labelWidth + 3, y + labelHeight);
    backingCanvas.lineTo(x - 1, y + labelHeight);
    backingCanvas.closePath();
    backingCanvas.setFillColor(new Color(200, 200, 200));
    backingCanvas.fill();
    backingCanvas.setLineWidth(1);
    backingCanvas.stroke();
    return x;
  }
View Full Code Here

    return value;
  }

  public Color getColor(String propName) {
    return new Color(get(propName));
  }
View Full Code Here

  public void setComposite(int mode) {
    composite = mode;
  }

  public void setFillColor(String color) {
    fillColor = new Color(color);
  }
View Full Code Here

  public void setShadowOffsetY(double y) {
  }

  public void setStrokeColor(String color) {
    strokeColor = new Color(color);
  }
View Full Code Here

  // TODO - alignment
  public void drawText(double x, double y, String label, String fontFamily,
      String fontWeight, String fontSize, String layerName,
      Cursor cursorStyle) {
    log(layerId + " drawText " +x+", "+y+" " + label + " " +fontSize + " " + layerName + " "+cursorStyle);
    Color _prevStrokeColor = _strokeColor;
    Color _prevFillColor = _fillColor;

    if (cursorStyle == Cursor.CONTRASTED) {
        setLineWidth(2);
        setStrokeColor(Color.WHITE);
        strokeText(label, x, y, fontFamily, fontSize, TEXT_BASELINE[TEXT_BASELINE_ALPHABETIC]);
View Full Code Here

TOP

Related Classes of org.timepedia.chronoscope.client.canvas.Color

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.