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/Actions/RepelTextDownAction.java

    r967 r1102  
    11package org.expeditee.items.MagneticConstraint.Actions;
    22
    3 import java.awt.Point;
    4 
    5 import org.expeditee.gui.DisplayIO;
     3import org.expeditee.core.Point;
     4import org.expeditee.gui.DisplayController;
    65import org.expeditee.gui.FrameIO;
    76import org.expeditee.gui.FrameUtils;
     
    2827                                (FrameUtils.getCurrentItem().getPosition().equals(item.getPosition())
    2928                                && remainderOfLine.size() > 0
    30                                 && TextLogic.XIsTowardsRight(DisplayIO.getMouseX(), (Text) remainderOfLine.getFirst()))) {
     29                                && TextLogic.XIsTowardsRight(DisplayController.getMouseX(), (Text) remainderOfLine.getFirst()))) {
    3130                        remainderOfLine.removeFirst();
    3231                }
     
    4241                if(!remainderOfLine.isEmpty() && currentParagraph.contains(nextLine) && MergeSameLineParagraphCollisions) {
    4342                        nextLine.prependLine(remainderOfLine);
    44                         DisplayIO.setTextCursor((Text) remainderOfLine.getFirst(), Text.HOME);
     43                        DisplayController.setTextCursor((Text) remainderOfLine.getFirst(), Text.HOME);
    4544                        callback(remainderOfLine.getFirst());
    4645                        FrameIO.SaveFrame(remainderOfLine.getLast().getParent());
    4746                } else if(!remainderOfLine.isEmpty()) {
    4847                        newLineAt = currentParagraph.split(currentLine);
    49                         final Point first = remainderOfLine.getBoundingBox().getLocation();
     48                        final Point first = remainderOfLine.getBoundingBox().getTopLeft();
    5049                        for(final Item token : remainderOfLine) {
    5150                                double newX = token.getX() - first.getX() + newLineAt.getX();
    5251                                token.setPosition((float) newX, (float) newLineAt.getY());
    5352                        }
    54                         DisplayIO.setTextCursor((Text) remainderOfLine.getFirst(), Text.HOME);
     53                        DisplayController.setTextCursor((Text) remainderOfLine.getFirst(), Text.HOME);
    5554                        callback(remainderOfLine.getFirst());
    5655                        FrameIO.SaveFrame(remainderOfLine.getLast().getParent());
     
    5857                                //3a No. Move the cursor
    5958                        newLineAt = currentParagraph.split(currentLine);
    60                         DisplayIO.setCursorPosition(newLineAt);
     59                        DisplayController.setCursorPosition(newLineAt);
    6160                }
    6261               
Note: See TracChangeset for help on using the changeset viewer.