If.java :  » UML » umlet » com » umlet » element » base » activity » Java Open Source

Java Open Source » UML » umlet 
umlet » com » umlet » element » base » activity » If.java
package com.umlet.element.base.activity;

import java.awt.Graphics2D;

public class If extends StartElement {

  private int h=40;
  private int w=40;
  
  public If(Graphics2D g, String id) {
    super(g, Const.PAD, id==null?"If":id);
    this.setHeight(h);
    this.setWidth(w);
  }

  @Override
  public void paint() {
    int x = this.getPosition().x;
    int y = this.getPosition().y;
    this.getGraphics().drawLine(x, y-h/2, x+w/2, y);
    this.getGraphics().drawLine(x, y-h/2, x-w/2, y);
    this.getGraphics().drawLine(x, y+h/2, x+w/2, y);
    this.getGraphics().drawLine(x, y+h/2, x-w/2, y);
  }
  
  @Override
  public boolean arrowIn() {
    return true;
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.