Package com.dmissoh.biologic.models

Examples of com.dmissoh.biologic.models.Event


    return events;
  }

  private void addEvent(List<Event> events, String name, long t1, long t2,
      long startTime, Color color) {
    Event event = new Event();
    event.setFamily(name);
    event.setBegin(t1);
    event.setEnd(t2);

    int xPos = (int) getScaledXValue((t2 - startTime))
        + GraFixConstants.xOffset;
    int width = (int) getScaledXValue(((t1 - startTime) - (t2 - startTime)));

    event.setLayout(new Rectangle(xPos, ypos, width, 15));
    event.setColor(color);
    events.add(event);
  }
View Full Code Here


    events.add(event);
  }

  private void addPunctualEvent(List<Event> events, String name, long t,
      long startTime, Color color) {
    Event event = new Event();
    event.setFamily(name);
    event.setBegin(t);
    event.setPunctual(true);

    int xPos = (int) getScaledXValue((t - startTime))
        + GraFixConstants.xOffset;

    event.setLayout(new Rectangle(xPos, ypos, 8, 8));
    event.setColor(color);
    events.add(event);
  }
View Full Code Here

public class EventPart extends AbstractGraphicalEditPart {

  @Override
  protected IFigure createFigure() {
    Event model = (Event) getModel();
    IFigure figure = null;
    if (model.isPunctual()) {
      figure = new PunctualEventFigure(model.getFamily(), model.getBegin());
    } else {
      figure = new EventFigure(model.getFamily(), model.getBegin(), model.getEnd());
    }
    return figure;
  }
View Full Code Here

   * @see
   * org.eclipse.gef.editparts.AbstractGraphicalEditPart#registerVisuals()
   */
  @Override
  protected void registerVisuals() {
    Event model = (Event) getModel();
    if (model.isPunctual()) {
      PunctualEventFigure figure = (PunctualEventFigure) getFigure();
      figure.setLayout(model.getLayout());
      figure.setBackgroundColor(model.getColor());
    } else {
      EventFigure figure = (EventFigure) getFigure();
      figure.setLayout(model.getLayout());
      figure.setBackgroundColor(model.getColor());
    }

  }
View Full Code Here

TOP

Related Classes of com.dmissoh.biologic.models.Event

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.