Ejemplo n.º 1
0
  /**
   * (non-Javadoc)
   *
   * @see fuml.graphic.model.abstraction.AbstractModelElement#init()
   */
  public void init() {
    super.init();
    // Add a popup Menu
    this.popupMenu = new DirectedEdgeMenu(this);
    this.hasPopupMenu = true;
    line.setActionListener(getActionListener());
    line.init();

    line.setCutLineToPoint2(true);
    updateGlyph();
  }
Ejemplo n.º 2
0
  /**
   * (non-Javadoc)
   *
   * @see fuml.graphic.model.abstraction.AbstractModelElement#updateGlyph()
   */
  public void updateGlyph() {
    super.updateGlyph();
    Font f;
    Color fc;
    long fHeight;

    // Get some important values
    fc = (Color) CM.getConfig().get("graph.DirectedEdge.CaptionColor");
    f = Font.decode((String) CM.getConfig().get("graph.DirectedEdge.Font"));
    fHeight = owner.getActiveDisplay().getFontHeight(f);

    if (line == null) {
      LongPoint[] lp1 = new LongPoint[4];
      for (int i = 0; i < lp1.length; i++) lp1[i] = new LongPoint(0, 0);
      glyph = new VPolygon(lp1, Color.WHITE);
      glyph.setVisible(false);
    }
    // Delegation for the line
    else {

      // Draw the caption
      if (caption != null) {
        try {
          drawCaption(f, fc, fHeight);
        } catch (Exception e) {

        }
      }

      drawArrow(
          line.getCutPoint2().x,
          line.getCutPoint2().y,
          line.get2ndConnectionPoint().getX(),
          line.get2ndConnectionPoint().getY());
    }
  }
Ejemplo n.º 3
0
 /**
  * (non-Javadoc)
  *
  * @see fuml.graphic.model.abstraction.AbstractModelElement#onTop()
  */
 public void onTop() {
   super.onTop();
   owner.getActiveDisplay().getVirtualSpace().onTop(glyph);
   line.onTop();
 }
Ejemplo n.º 4
0
 /**
  * (non-Javadoc)
  *
  * @see fuml.graphic.model.abstraction.AbstractModelElement#show()
  */
 public void show() {
   super.show();
   line.show();
   if (gName != null) gName.setVisible(true);
 }
Ejemplo n.º 5
0
 /**
  * (non-Javadoc)
  *
  * @see fuml.graphic.model.abstraction.AbstractModelElement#hide()
  */
 public void hide() {
   super.hide();
   line.hide();
   if (gName != null) gName.setVisible(false);
 }
Ejemplo n.º 6
0
 /**
  * (non-Javadoc)
  *
  * @see fuml.graphic.model.abstraction.AbstractModelElement#draw(java.awt.Graphics2D)
  */
 public void addGlyphs() {
   super.addGlyphs();
 }