示例#1
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);
  }
示例#2
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();
    }
  }
示例#3
0
  public void setLineList(LineList lines) {
    lineObj.setLines(lines);
    lineCanvas.setLineList(lines);
    lineSelector.setLineList(lines);

    if (lines.size() > 0) {
      lineCanvas.setSelectedLine(lines.getLine(0));
    }
  }
示例#4
0
 public void setLocked(boolean locked) {
   lineObj.setLocked(locked);
   lineCanvas.setLocked(locked);
 }
示例#5
0
 public boolean isLocked() {
   return lineObj.isLocked();
 }
示例#6
0
 public void setSeparatorType(String separatorType) {
   lineObj.setSeparatorType(separatorType);
 }
示例#7
0
 public String getSeparatorType() {
   return lineObj.getSeparatorType();
 }
示例#8
0
 public void setRelativeXValues(boolean relativeXValues) {
   lineObj.setRelativeXValues(relativeXValues);
 }
示例#9
0
 public int getCanvasWidth() {
   return lineObj.getCanvasWidth();
 }
示例#10
0
 public LineList getLineList() {
   return lineObj.getLines();
 }
示例#11
0
 public float getXMax() {
   return lineObj.getXMax();
 }
示例#12
0
 public void setLeadingZero(boolean leadingZero) {
   lineObj.setLeadingZero(leadingZero);
 }
示例#13
0
 public boolean isLeadingZero() {
   return lineObj.isLeadingZero();
 }
示例#14
0
 public void setCanvasWidth(int canvasWidth) {
   lineObj.setCanvasWidth(canvasWidth);
 }
示例#15
0
 public void setCanvasHeight(int canvasHeight) {
   lineObj.setCanvasHeight(canvasHeight);
 }
示例#16
0
 public void cleanup() {
   lineObj.removePropertyChangeListener(this);
 }
示例#17
0
 public void setXMax(float max) {
   if (max <= 0.0f) {
     return;
   }
   lineObj.setXMax(max);
 }
示例#18
0
 public boolean isRelativeXValues() {
   return lineObj.isRelativeXValues();
 }
示例#19
0
 public int getCanvasHeight() {
   return lineObj.getCanvasHeight();
 }