protected void buildColumnAndSectionData() {
    int hw = 45;
    int pw = 180;
    int vw = 50;
    int pnw = 45;
    int sw = 55;
    rowHeaderColumnData = new ColumnData("", hw, JLabel.LEFT, 0, Object.class);
    columnData = new ColumnData[4];
    sectionData = new SectionData[2];
    columnData[0] =
        new ColumnData("Preset", pw, JLabel.LEFT, 0, ReadablePreset.class, null, mmptce);
    columnData[1] =
        new ColumnData("Volume", vw, JLabel.LEFT, 1, ReadableParameterModel.class, null, pmtce);
    columnData[2] =
        new ColumnData("Pan", pnw, JLabel.LEFT, 1, ReadableParameterModel.class, null, pmtce);
    columnData[3] =
        new ColumnData("Submix", sw, JLabel.LEFT, 1, ReadableParameterModel.class, null, pmtce);
    // replace "" below with " " to make the section headers visible
    String sStr = "";
    // if (totalChnls > 16)
    //    sStr = " ";

    sectionData[0] =
        new SectionData(
            UIColors.getTableFirstSectionBG(), UIColors.getTableFirstSectionFG(), pw, sStr);
    sectionData[1] =
        new SectionData(
            UIColors.getTableSecondSectionBG(),
            UIColors.getTableSecondSectionFG(),
            vw + pnw + sw,
            sStr);
  }
Ejemplo n.º 2
0
  public FilterPanel init(
      final ReadablePreset.ReadableVoice voice, TableExclusiveSelectionContext tsc)
      throws ParameterException, DeviceException {
    this.setLayout(new FlowLayout());
    final List filterIds =
        voice
            .getPreset()
            .getDeviceParameterContext()
            .getVoiceContext()
            .getIdsForCategory(ParameterCategories.VOICE_FILTER);

    filterModels = new ReadableParameterModel[filterIds.size()];

    try {
      for (int i = 0, j = filterIds.size(); i < j; i++)
        filterModels[i] = voice.getParameterModel((Integer) filterIds.get(i));
    } catch (IllegalParameterIdException e) {
      ZUtilities.zDisposeCollection(Arrays.asList(filterModels));
      throw e;
    }

    Action ra =
        new AbstractAction() {
          public void actionPerformed(ActionEvent e) {
            try {
              voice
                  .getPreset()
                  .refreshVoiceParameters(
                      voice.getVoiceNumber(),
                      (Integer[]) filterIds.toArray(new Integer[filterIds.size()]));
            } catch (PresetException e1) {
              e1.printStackTrace();
            }
          }
        };
    ra.putValue("tip", "Refresh Filter");

    FilterParameterTableModel model = new FilterParameterTableModel(filterModels);

    RowHeaderedAndSectionedTablePanel ampPanel;
    VoiceParameterTable vpt =
        new VoiceParameterTable(voice, ParameterCategories.VOICE_FILTER, model, "Filter");
    tsc.addTableToContext(vpt);
    ampPanel =
        new RowHeaderedAndSectionedTablePanel()
            .init(vpt, "Show Filter", UIColors.getTableBorder(), ra);
    this.add(ampPanel);
    return this;
  }
Ejemplo n.º 3
0
 public void paintIcon(Component component, Graphics graphics, int x, int y) {
   Graphics2D g2d = ((Graphics2D) graphics);
   RenderingHints hints = g2d.getRenderingHints();
   g2d.setRenderingHints(UIColors.iconRH);
   Shape c;
   if (pi != null) {
     pi.paintIcon(component, graphics, x, y);
   } else {
     c = new Ellipse2D.Double(x, y, w, h);
     GradientPaint gp = new GradientPaint(x, y, c1, x + w, y + h, c2, false);
     g2d.setPaint(gp);
     g2d.fill(c);
   }
   // c = new RoundRectangle2D.Double(x + Math.round(w / 3.0), y, Math.round(w / 3.0), h, 2, 2);
   g2d.setColor(UIColors.applyAlpha(c1, 175));
   Ellipse2D.Double e = new Ellipse2D.Double();
   e.setFrame(x + w / 2.0, y + h / 2.0, w / 2.0, h / 2.0);
   g2d.fill(e);
   e.setFrame(x, y, w / 2.0, h / 2.0);
   g2d.fill(e);
   g2d.setRenderingHints(hints);
 }
Ejemplo n.º 4
0
 public VoiceEditingIcon(int w, int h, Color c1, Color c2) {
   this.w = w;
   this.h = h;
   this.c1 = UIColors.applyAlpha(c1, UIColors.iconAlpha);
   this.c2 = UIColors.applyAlpha(c2, UIColors.iconAlpha);
 }
Ejemplo n.º 5
0
 public Color getBackground() {
   return UIColors.getDefaultBG();
 }