Ejemplo n.º 1
0
  public void setLineList(LineList lines) {
    lineObj.setLines(lines);
    lineCanvas.setLineList(lines);
    lineSelector.setLineList(lines);

    if (lines.size() > 0) {
      lineCanvas.setSelectedLine(lines.getLine(0));
    }
  }
Ejemplo n.º 2
0
  public BSBLineObjectView(BSBLineObject lineObj) {
    this.lineObj = lineObj;
    super.setBSBObject(this.lineObj);

    this.setLayout(new BorderLayout());
    this.add(lineCanvas, BorderLayout.CENTER);
    this.add(lineSelector, BorderLayout.SOUTH);

    lineCanvas.setLocked(lineObj.isLocked());

    lineSelector.setLineCanvas(lineCanvas);

    this.setBorder(new LineBorder(Color.GRAY));

    revalidate();

    setLineList(lineObj.getLines());

    this.setSize(
        lineObj.getCanvasWidth(),
        lineObj.getCanvasHeight() + lineSelector.getPreferredSize().height);

    repaint();

    lineObj.addPropertyChangeListener(this);
  }
Ejemplo n.º 3
0
  public void editSoundObject(SoundObject sObj) {
    if (sObj == null) {
      // this.line = null;

      return;
    }

    if (!(sObj instanceof LineObject)) {
      return;
    }

    LineObject lineObj = (LineObject) sObj;

    lineTable.setLineList(lineObj.getLines());
    lineCanvas.setLineList(lineObj.getLines());
  }
Ejemplo n.º 4
0
  public void propertyChange(PropertyChangeEvent evt) {
    if (evt.getSource() != lineObj) {
      return;
    }

    String prop = evt.getPropertyName();

    if (prop.equals("canvasWidth") || prop.equals("canvasHeight")) {
      int w = lineObj.getCanvasWidth();
      int h = lineObj.getCanvasHeight();
      lineCanvas.setSize(new Dimension(w, h));
      this.setSize(w, h + lineSelector.getPreferredSize().height);
      this.revalidate();
    } else if (prop.equals("presetValue")) {
      this.repaint();
    }
  }
Ejemplo n.º 5
0
 public void setLocked(boolean locked) {
   lineObj.setLocked(locked);
   lineCanvas.setLocked(locked);
 }
Ejemplo n.º 6
0
 private void fireLineSelection() {
   if (lineCanvas != null) {
     lineCanvas.setSelectedLine(currentLine);
   }
 }