Package org.jhotdraw.framework

Examples of org.jhotdraw.framework.Figure


       ConnectionFigure newPrototype) {
    super(newDrawingEditor, newPrototype);
  }

  public Figure implyReservoir(int x, int y, Drawing drawing) {
    Figure target = findConnectableFigure(x, y, drawing);
    if (target == null) {
      target = new ReservoirFigure();
      target.displayBox(new Point(x - 15, y - 15),
          new Point(x + 15, y + 15));
      view().add(target);
    }
    if (target.canConnect()
        && ((target instanceof ReservoirFigure)
        || ((target instanceof ModelElementFigure)
        && (((ModelElementFigure) target).getModelElement()
        instanceof org.nlogo.sdm.Stock)))) {
      return target;
View Full Code Here


    // If there's no start connecter, then we started with an illegal
    // object.
    if (getStartConnector() == null) {
      return;
    }
    Figure c = findTarget(e.getX(), e.getY(), drawing());

    // If there is no figure to connect to, make a Reservoir,
    // but only if we are not already connected to one.
    if (c == null &&
        !(getStartConnector().owner() instanceof ReservoirFigure)) {
View Full Code Here

    if (drawing == null) {
      drawing = new AggregateDrawing();
    } else {
      FigureEnumeration figs = drawing.figures();
      while (figs.hasNextFigure()) {
        Figure fig = figs.nextFigure();
        if (fig instanceof ModelElementFigure &&
            ((ModelElementFigure) fig).getModelElement() != null) {
          drawing.getModel().addElement
              (((ModelElementFigure) fig).getModelElement());
        }
View Full Code Here

TOP

Related Classes of org.jhotdraw.framework.Figure

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.