Exemplo n.º 1
0
  public static Scale makeGradientn(String aes) {
    Scale s = new Scale();
    s.setName("scale_" + aes + "_gradientn");
    s.aesName = aes;

    Param p;
    ParamVector pv;

    p = new ParamScaleLegend("legend", s.aesName, true);
    p.setTitle("");
    p.setViewType(ParamScaleLegend.VIEW_SCALE);
    s.params.add(p);

    pv = new ParamVector();
    pv.setName("colours");
    pv.setTitle("Colours");
    pv.setNumeric(false);
    s.params.add(pv);

    p = new ParamCharacter();
    p.setName("space");
    p.setTitle("Colour space");
    p.setViewType(Param.VIEW_COMBO);
    p.setValue("rgb");
    p.setDefaultValue("rgb");
    p.setOptions(new String[] {"rgb", "Lab"});
    s.params.add(p);

    p = new ParamNone("Data");
    p.setViewType(ParamNone.VIEW_SEPERATOR);
    s.params.add(p);

    p = new ParamVector();
    p.setName("limits");
    p.setTitle("Data range");
    p.setViewType(Param.VIEW_TWO_VALUE_ENTER);
    s.params.add(p);

    p = new ParamCharacter();
    p.setName("trans");
    p.setTitle("Transform");
    p.setViewType(Param.VIEW_COMBO);
    p.setValue("identity");
    p.setDefaultValue("identity");
    p.setOptions(transformations);
    p.setLabels(transformationNames);
    s.params.add(p);

    return s;
  }
Exemplo n.º 2
0
  public static Scale makeGrey(String aes) {
    Scale s = new Scale();
    s.setName("scale_" + aes + "_grey");
    s.aesName = aes;

    Param p;
    ParamNumeric pn;

    p = new ParamScaleLegend("legend", s.aesName, false);
    p.setTitle("");
    p.setViewType(ParamScaleLegend.VIEW_SCALE);
    s.params.add(p);

    p = new ParamNone("Gradient");
    p.setViewType(ParamNone.VIEW_SEPERATOR);
    s.params.add(p);

    pn = new ParamNumeric();
    pn.setName("start");
    pn.setTitle("Low");
    pn.setViewType(Param.VIEW_ENTER);
    pn.setValue(new Double(.2));
    pn.setDefaultValue(new Double(.2));
    pn.setLowerBound(new Double(0));
    pn.setUpperBound(new Double(1));
    s.params.add(pn);

    pn = new ParamNumeric();
    pn.setName("end");
    pn.setTitle("high");
    pn.setViewType(Param.VIEW_ENTER);
    pn.setValue(new Double(.2));
    pn.setDefaultValue(new Double(.2));
    pn.setLowerBound(new Double(0));
    pn.setUpperBound(new Double(1));
    s.params.add(pn);

    p = new ParamNone("Data");
    p.setViewType(ParamNone.VIEW_SEPERATOR);
    s.params.add(p);

    p = new ParamVector();
    p.setName("limits");
    p.setTitle("Data range");
    p.setViewType(Param.VIEW_TWO_VALUE_ENTER);
    s.params.add(p);

    p = new ParamCharacter();
    p.setName("trans");
    p.setTitle("Transform");
    p.setViewType(Param.VIEW_COMBO);
    p.setValue("identity");
    p.setDefaultValue("identity");
    p.setOptions(transformations);
    p.setLabels(transformationNames);
    s.params.add(p);

    return s;
  }
Exemplo n.º 3
0
  public static Scale makeContinuous(String aes) {
    Scale s = new Scale();
    s.setName("scale_" + aes + "_continuous");
    s.aesName = aes;

    Param p;

    p = new ParamScaleLegend("legend", s.aesName, true);
    p.setTitle("");
    p.setViewType(ParamScaleLegend.VIEW_SCALE);
    s.params.add(p);

    /*		p = new ParamCharacter();
    p.setName("name");
    p.setTitle("Title");
    s.params.add(p);

    p = ParamFactory.makeParam("scalebreaks");
    s.params.add(p);

    p = ParamFactory.makeParam("labels");
    s.params.add(p);
    */
    p = new ParamVector();
    p.setName("expand");
    p.setTitle("Expand (*,+)");
    p.setViewType(Param.VIEW_TWO_VALUE_ENTER);
    p.setValue(new String[] {"0.05", "0.55"});
    p.setDefaultValue(new String[] {"0.05", "0.55"});
    s.params.add(p);

    p = new ParamNone("Data");
    p.setViewType(ParamNone.VIEW_SEPERATOR);
    s.params.add(p);

    p = new ParamVector();
    p.setName("limits");
    p.setTitle("Range");
    p.setViewType(Param.VIEW_TWO_VALUE_ENTER);
    s.params.add(p);

    p = new ParamCharacter();
    p.setName("trans");
    p.setTitle("Transform");
    p.setViewType(Param.VIEW_COMBO);
    p.setValue("identity");
    p.setDefaultValue("identity");
    p.setOptions(transformations);
    p.setLabels(transformationNames);
    s.params.add(p);

    return s;
  }
Exemplo n.º 4
0
  public static Scale makeAlpha() {
    Scale s = new Scale();
    s.setName("scale_alpha");
    s.aesName = "alpha";

    Param p;
    ParamNumeric pn;
    ParamVector pv;

    p = new ParamScaleLegend("legend", s.aesName, true);
    p.setTitle("");
    p.setViewType(ParamScaleLegend.VIEW_SCALE);
    s.params.add(p);

    p = new ParamVector();
    p.setName("limits");
    p.setTitle("Data range");

    s.params.add(p);

    pv = new ParamVector();
    pv.setName("range");
    pv.setTitle("Alpha range");
    pv.setViewType(Param.VIEW_TWO_VALUE_ENTER);
    pv.setValue(new String[] {"0", "1"});
    pv.setDefaultValue(new String[] {"0", "1"});
    pv.setLowerBound(new Double(0));
    pv.setUpperBound(new Double(1));
    s.params.add(pv);

    p = new ParamCharacter();
    p.setName("trans");
    p.setTitle("Transform");
    p.setViewType(Param.VIEW_COMBO);
    p.setValue("identity");
    p.setDefaultValue("identity");
    p.setOptions(transformations);
    p.setLabels(transformationNames);
    s.params.add(p);

    return s;
  }
Exemplo n.º 5
0
  public static Scale makeSize() {
    Scale s = new Scale();
    s.setName("scale_size");
    s.aesName = "size";

    Param p;

    p = new ParamScaleLegend("legend", s.aesName, true);
    p.setTitle("");
    p.setViewType(ParamScaleLegend.VIEW_SCALE);
    s.params.add(p);

    p = new ParamVector();
    p.setName("limits");
    p.setTitle("Data range");
    p.setViewType(Param.VIEW_TWO_VALUE_ENTER);
    s.params.add(p);

    p = new ParamVector();
    p.setName("range");
    p.setTitle("size range");
    p.setViewType(Param.VIEW_TWO_VALUE_ENTER);
    p.setValue(new String[] {"1", "6"});
    p.setDefaultValue(new String[] {"1", "6"});
    s.params.add(p);

    p = new ParamCharacter();
    p.setName("trans");
    p.setTitle("Transform");
    p.setViewType(Param.VIEW_COMBO);
    p.setValue("identity");
    p.setDefaultValue("identity");
    p.setOptions(transformations);
    p.setLabels(transformationNames);
    s.params.add(p);

    return s;
  }
Exemplo n.º 6
0
  public static Scale makeBrewer(String aes) {
    Scale s = new Scale();
    s.setName("scale_" + aes + "_brewer");
    s.aesName = aes;

    Param p;

    p = new ParamScaleLegend("legend", s.aesName, false);
    p.setTitle("");
    p.setViewType(ParamScaleLegend.VIEW_SCALE);
    s.params.add(p);

    p = new ParamVector();
    p.setName("limits");
    p.setTitle("Included levels");
    s.params.add(p);

    p = new ParamCharacter();
    p.setName("palette");
    p.setTitle("Colour palette");
    p.setViewType(Param.VIEW_COMBO);
    p.setValue("Blues");
    p.setDefaultValue("Blues");
    p.setOptions(
        new String[] {
          "YlOrRd",
          "YlOrBr",
          "YlGnBu",
          "YlGn",
          "Reds",
          "RdPu",
          "Purples",
          "PuRd",
          "PuBuGn",
          "PuBu",
          "OrRd",
          "Oranges",
          "Greys",
          "Greens",
          "GnBu",
          "BuPu",
          "BuGn",
          "Blues",
          "",
          "Set3",
          "Set2",
          "Set1",
          "Pastel2",
          "Pastel1",
          "Paired",
          "Dark2",
          "Accent",
          "",
          "Spectral",
          "RdYlGn",
          "RdYlBu",
          "RdGy",
          "RdBu",
          "PuOr",
          "PRGn",
          "PiYG",
          "BrBG"
        });
    s.params.add(p);

    return s;
  }
Exemplo n.º 7
0
  public static Scale makeGradient2(String aes) {
    Scale s = new Scale();
    s.setName("scale_" + aes + "_gradient2");
    s.aesName = aes;

    Param p;
    ParamNumeric pn;

    p = new ParamScaleLegend("legend", s.aesName, true);
    p.setTitle("");
    p.setViewType(ParamScaleLegend.VIEW_SCALE);
    s.params.add(p);

    p = new ParamNone("Colours");
    p.setViewType(ParamNone.VIEW_SEPERATOR);
    s.params.add(p);

    p = new ParamColor();
    p.setName("low");
    p.setTitle("Low");
    p.setViewType(Param.VIEW_COLOR);
    p.setValue(Color.decode("#3B4FB8"));
    p.setDefaultValue(Color.decode("#3B4FB8"));
    s.params.add(p);

    p = new ParamColor();
    p.setName("mid");
    p.setTitle("Mid-point");
    p.setViewType(Param.VIEW_COLOR);
    s.params.add(p);

    p = new ParamColor();
    p.setName("high");
    p.setTitle("High");
    p.setViewType(Param.VIEW_COLOR);
    p.setValue(Color.decode("#B71B1A"));
    p.setDefaultValue(Color.decode("#B71B1A"));
    s.params.add(p);

    p = new ParamCharacter();
    p.setName("space");
    p.setTitle("Space");
    p.setViewType(Param.VIEW_COMBO);
    p.setValue("rgb");
    p.setDefaultValue("rgb");
    p.setOptions(new String[] {"rgb", "Lab"});
    s.params.add(p);

    p = new ParamNone("Data");
    p.setViewType(ParamNone.VIEW_SEPERATOR);
    s.params.add(p);

    pn = new ParamNumeric();
    pn.setName("midpoint");
    pn.setTitle("Mid-point value");
    pn.setViewType(Param.VIEW_ENTER);
    s.params.add(pn);

    p = new ParamVector();
    p.setName("limits");
    p.setTitle("Data range");
    p.setViewType(Param.VIEW_TWO_VALUE_ENTER);
    s.params.add(p);

    p = new ParamCharacter();
    p.setName("trans");
    p.setTitle("Transform");
    p.setViewType(Param.VIEW_COMBO);
    p.setValue("identity");
    p.setDefaultValue("identity");
    p.setOptions(transformations);
    p.setLabels(transformationNames);
    s.params.add(p);

    return s;
  }