Ignore:
Timestamp:
05/10/18 16:04:51 (6 years ago)
Author:
davidb
Message:

Reworking of the code-base to separate logic from graphics. This version of Expeditee now supports a JFX graphics as an alternative to SWING

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/items/MagneticConstraint/Utilities/Line.java

    r966 r1102  
    11package org.expeditee.items.MagneticConstraint.Utilities;
    22
    3 import java.awt.Rectangle;
    43import java.util.LinkedList;
    54
     5import org.expeditee.core.bounds.AxisAlignedBoxBounds;
    66import org.expeditee.items.Item;
    77
     
    1818       
    1919        public Line prependLine(final Line line) {
    20                 final int x = this.getBoundingBox().x;
    21                 final int width = line.getBoundingBox().width;
     20                final int x = this.getBoundingBox().getMinX();
     21                final int width = line.getBoundingBox().getWidth();
    2222                this.deltaX(width);
    2323                line.setX(x);
     
    2727       
    2828        public Line appendLine(final Line line) {
    29                 final int x = this.getBoundingBox().x;
    30                 final int width = this.getBoundingBox().width;
     29                final int x = this.getBoundingBox().getMinX();
     30                final int width = this.getBoundingBox().getWidth();
    3131                line.setX(x + width);
    3232                line.setY(this.getFirst().getY());
     
    8383        }
    8484       
    85         public Rectangle getBoundingBox() {
     85        public AxisAlignedBoxBounds getBoundingBox() {
    8686//              final Rectangle rect = new Rectangle(this.getFirst().getX(), this.getFirst().getY(), this.getFirst().getBoundsWidth(), this.getFirst().getBoundsHeight());
    8787//              for(final Item token : this)
    8888//                      rect.add(new Rectangle(token.getX(), token.getY(), token.getBoundsWidth(), token.getBoundsHeight()));
    8989//              return rect;
    90                 final Rectangle rect = this.getFirst().getArea().getBounds();
     90                final AxisAlignedBoxBounds rect = this.getFirst().getBoundingBox();
    9191                for(final Item token : this)
    92                         rect.add(token.getArea().getBounds());
     92                        rect.combineWith(token.getBoundingBox());
    9393                return rect;
    9494        }
Note: See TracChangeset for help on using the changeset viewer.