Esempio n. 1
0
  /**
   * Refreshes the visual aspects of this, based upon the model (Wire). It changes the wire color
   * depending on the state of Wire.
   */
  protected void updateSelected() {

    final EditPart source = getSource();
    if (source != null) {

      final int sel = source.getSelected();
      final Polyline line = (Polyline) getFigure();
      if (sel != SELECTED_NONE) {
        line.setLineWidth(2);

      } else {
        line.setLineWidth(1);
      }
    }
  }
 /**
  * Lazily creates and returns a <code>Polyline</code> Figure for use as feedback.
  *
  * @return a Polyline figure
  */
 protected Polyline getLineFeedback() {
   if (insertionLine == null) {
     insertionLine = new Polyline();
     insertionLine.setLineWidth(2);
     insertionLine.addPoint(new Point(0, 0));
     insertionLine.addPoint(new Point(10, 10));
     addFeedback(insertionLine);
   }
   return insertionLine;
 }