Changeset 1220 for trunk/src


Ignore:
Timestamp:
01/30/19 13:04:22 (5 years ago)
Author:
bln4
Message:

FrameUtils.java -> Ability to detect the cursor is over something in the MailBay.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/FrameUtils.java

    r1200 r1220  
    4040import java.util.zip.ZipEntry;
    4141
     42import org.expeditee.auth.gui.MailBay;
    4243import org.expeditee.core.Colour;
    4344import org.expeditee.core.Point;
     
    12091210         * @return The Item at the given coordinates, or NULL if none is found.
    12101211         */
    1211         public static Item onItem(Frame toCheck, float floatX, float floatY, boolean bResetLastEdited)
    1212         {
     1212        public static Item onItem(Frame toCheck, float floatX, float floatY, boolean bResetLastEdited) {
    12131213                // System.out.println("MouseX: " + floatX + " MouseY: " + floatY);
    12141214                int x = Math.round(floatX);
     
    12221222                // if the mouse is in the message area
    12231223                if (y >= DisplayController.getMessageBayPaintArea().getMinY()) {
    1224                         // check the individual message items
    1225                         for (Item message : MessageBay.getMessages()) {
     1224                        // check the individual bay items (MessageBay + MailBay)
     1225                        List<Item> bayItems = new LinkedList<Item>();
     1226                        if (DisplayController.isMailMode()) {
     1227                                bayItems.addAll(MailBay.getPreviewMessages());
     1228                        } else {
     1229                                bayItems.addAll(MessageBay.getMessages());
     1230                        }
     1231                        for (Item message : bayItems) {
    12261232                                if (message != null) {
    12271233                                        if (message.contains(new Point(x, y))) {
     
    12371243                        }
    12381244
    1239                         // check the link to the message frame
    1240                         if (MessageBay.getMessageLink() != null) {
    1241                                 if (MessageBay.getMessageLink().contains(new Point(x, y))) {
    1242                                         MessageBay.getMessageLink().setOverlayPermission(UserAppliedPermission.copy);
    1243                                         possibles.add(MessageBay.getMessageLink());
    1244                                 }
     1245                        // check the link to the message/mail frame
     1246                        Item linkItem = DisplayController.isMailMode() ? MailBay.getMailLink() : MessageBay.getMessageLink();
     1247                        if (linkItem != null && linkItem.contains(new Point(x, y))) {
     1248                                linkItem.setOverlayPermission(UserAppliedPermission.copy);
     1249                                possibles.add(linkItem);
    12451250                        }
    12461251
     
    12871292                                                        }
    12881293                                                }
    1289                                         }
    1290                                        
    1291                                         if (i.getData() != null && !i.getData().isEmpty() && i.getText().isEmpty()) {
    1292                                                 System.err.println();
    12931294                                        }
    12941295
Note: See TracChangeset for help on using the changeset viewer.