Ignore:
Timestamp:
07/03/08 16:48:09 (16 years ago)
Author:
bjn8
Message:

Added invalidation for graphics... biiiig commit. LOts of effeciency improvements - now can animate

File:
1 edited

Legend:

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

    r115 r121  
    8282                // permission check
    8383                if (on != null && !on.hasPermission(Permission.full)) {
    84                         FrameGraphics
    85                                         .DisplayMessage("Insufficient permission to edit this item");
     84                        MessageBay
     85                                        .displayMessage("Insufficient permission to edit this item");
    8686                        return;
    8787                }
     
    577577                                                        && clicked.getParent() != null
    578578                                                        && clicked.getParent().getNameItem() != clicked) {
    579                                                 FrameGraphics.DisplayMessage("Insufficient Permission");
     579                                                MessageBay.displayMessage("Insufficient Permission");
    580580                                                return;
    581581                                        }
     
    621621                        if (current instanceof Text) {
    622622                                if (current != null && !current.hasPermission(Permission.copy)) {
    623                                         FrameGraphics
    624                                                         .DisplayMessage("Insufficient permission to copy that item");
     623                                        MessageBay
     624                                                        .displayMessage("Insufficient permission to copy that item");
    625625                                        return;
    626626                                }
    627627                                copyItemToClipboard(current);
    628                                 // FrameGraphics.DisplayMessage("Item copied to clipboard");
     628                                // MessageBay.displayMessage("Item copied to clipboard");
    629629                                return;
    630630                        }
    631631                        if (current != null && !current.hasPermission(Permission.full)) {
    632                                 FrameGraphics
    633                                                 .DisplayMessage("Insufficient permission edit that item");
     632                                MessageBay
     633                                                .displayMessage("Insufficient permission edit that item");
    634634                                return;
    635635                        }
     
    656656                                return;
    657657                        if (current != null && !current.hasPermission(Permission.full)) {
    658                                 FrameGraphics
    659                                                 .DisplayMessage("Insufficient permission to cut that item");
     658                                MessageBay
     659                                                .displayMessage("Insufficient permission to cut that item");
    660660                                return;
    661661                        }
     
    667667                                return;
    668668                        if (current != null && !current.hasPermission(Permission.full)) {
    669                                 FrameGraphics
    670                                                 .DisplayMessage("Insufficient permission toggle the items mark");
     669                                MessageBay
     670                                                .displayMessage("Insufficient permission toggle the items mark");
    671671                                return;
    672672                        }
     
    742742
    743743                if (item != null && !item.hasPermission(Permission.full)) {
    744                         FrameGraphics
    745                                         .DisplayMessage("Insufficient permission to copy that item");
     744                        MessageBay
     745                                        .displayMessage("Insufficient permission to copy that item");
    746746                        return null;
    747747                }
     
    840840                                break;
    841841                        default:
    842                                 FrameGraphics.DisplayMessageOnce(displayMessage);
     842                                MessageBay.displayMessageOnce(displayMessage);
    843843                                return;
    844844                        }
     
    892892                Collection<Item> enclosed = FrameUtils.getCurrentItems(on);
    893893                if (on == null && (enclosed == null || enclosed.size() == 0))
    894                         FrameGraphics.DisplayMessage(displayMessage);
     894                        MessageBay.displayMessage(displayMessage);
    895895        }
    896896
     
    932932                        // if no item was found, return
    933933                        if (toDropFrom == null) {
    934                                 FrameGraphics
    935                                                 .ErrorMessage("No item could be found to drop from");
     934                                MessageBay.errorMessage("No item could be found to drop from");
    936935                                return;
    937936                        }
    938937
    939938                        if (!(toDropFrom instanceof Text)) {
    940                                 FrameGraphics
    941                                                 .DisplayMessage("Only text items can be dropped from");
     939                                MessageBay
     940                                                .displayMessage("Only text items can be dropped from");
    942941                                return;
    943942                        }
     
    948947
    949948                        if (column == null) {
    950                                 FrameGraphics.ErrorMessage("No column found to align items to");
     949                                MessageBay.errorMessage("No column found to align items to");
    951950                                return;
    952951                        }
     
    10251024                                                                FrameMouseActions.getY());
    10261025                                        } else {
    1027                                                 FrameGraphics
    1028                                                                 .WarningMessage("Can not create items outside the frame area");
     1026                                                MessageBay
     1027                                                                .warningMessage("Can not create items outside the frame area");
    10291028                                                // ensures correct repainting when items don't move
    10301029                                                DisplayIO.setCursorPosition(DisplayIO.getMouseX(),
     
    10451044                                        int deltaY = firstItem.getY() - dummyItem.getY();
    10461045
    1047                                         for (Item i : Frame.FreeItems) {
     1046                                        for (Item i : FreeItems.getInstance()) {
    10481047                                                i.setPosition(i.getX() - deltaX, i.getY() - deltaY);
    10491048                                        }
     
    10571056                        FrameGraphics.Repaint();
    10581057                } catch (RuntimeException e) {
    1059                         // FrameGraphics.ErrorMessage(e.getMessage());
     1058                        // MessageBay.errorMessage(e.getMessage());
    10601059                        e.printStackTrace();
    10611060                }
     
    12371236                if (item == null) {
    12381237                        if (Frame.itemAttachedToCursor())
    1239                                 toSize.addAll(Frame.FreeItems);
     1238                                toSize.addAll(FreeItems.getInstance());
    12401239                        else {
    1241                                 FrameGraphics
    1242                                                 .DisplayMessage("There are no Items selected on the Frame or on the Cursor");
     1240                                MessageBay
     1241                                                .displayMessage("There are no Items selected on the Frame or on the Cursor");
    12431242                                return;
    12441243                        }
    12451244                } else {
    12461245                        if (item.isFrameName()) {
    1247                                 FrameGraphics.DisplayMessage("Can not resize the frame name");
     1246                                MessageBay.displayMessage("Can not resize the frame name");
    12481247                                return;
    12491248                        }
    12501249                        // check permissions
    12511250                        if (!item.hasPermission(Permission.full)) {
    1252                                 FrameGraphics
    1253                                                 .DisplayMessage("Insufficient permission to change the size of that item");
     1251                                MessageBay
     1252                                                .displayMessage("Insufficient permission to change the size of that item");
    12541253                                return;
    12551254                        }
     
    13621361
    13631362                // if (color == null) {
    1364                 // FrameGraphics.DisplayMessage("FillColor is now transparent");
     1363                // MessageBay.displayMessage("FillColor is now transparent");
    13651364                // }
    13661365
     
    13851384                if (item == null) {
    13861385                        if (Frame.itemAttachedToCursor()) {
    1387                                 color = Frame.FreeItems.get(0).getColor();
     1386                                color = FreeItems.getInstance().get(0).getColor();
    13881387                        } else {
    13891388                                return;
     
    13941393                        // check permissions
    13951394                        if (!item.hasPermission(Permission.full)) {
    1396                                 FrameGraphics
    1397                                                 .DisplayMessage("Insufficient permission to the frame's background color");
     1395                                MessageBay
     1396                                                .displayMessage("Insufficient permission to the frame's background color");
    13981397                                return;
    13991398                        }
     
    14051404                        // if (currentFrame.getBackgroundColor() == null)
    14061405                        // FrameGraphics
    1407                         // .DisplayMessage("Background color is now transparent");
     1406                        // .displayMessage("Background color is now transparent");
    14081407                        FrameGraphics.Repaint();
    14091408                        return;
     
    14111410                        // check permissions
    14121411                        if (!item.hasPermission(Permission.full)) {
    1413                                 FrameGraphics
    1414                                                 .DisplayMessage("Insufficient permission to change that item's color");
     1412                                MessageBay
     1413                                                .displayMessage("Insufficient permission to change that item's color");
    14151414                                return;
    14161415                        }
     
    14391438                // if color is being set to default display a message to indicate that
    14401439                // if (color == null) {
    1441                 // FrameGraphics.DisplayMessage("Color is set to default");
     1440                // MessageBay.displayMessage("Color is set to default");
    14421441                // }
    14431442
    14441443                if (setBackgroundColor) {
    14451444                        if (item == null && Frame.itemAttachedToCursor()) {
    1446                                 for (Item i : Frame.FreeItems)
     1445                                for (Item i : FreeItems.getInstance())
    14471446                                        i.setBackgroundColor(color);
    14481447                        } else {
     
    14521451                } else {
    14531452                        if (item == null && Frame.itemAttachedToCursor()) {
    1454                                 for (Item i : Frame.FreeItems)
     1453                                for (Item i : FreeItems.getInstance())
    14551454                                        i.setColor(color);
    14561455                        } else {
     
    14701469        private static void ToggleAnnotation(Item toToggle) {
    14711470                if (toToggle == null) {
    1472                         FrameGraphics.DisplayMessage("There is no Item selected to toggle");
     1471                        MessageBay.displayMessage("There is no Item selected to toggle");
    14731472                        return;
    14741473                }
     
    14761475                // check permissions
    14771476                if (!toToggle.hasPermission(Permission.full)) {
    1478                         FrameGraphics
    1479                                         .DisplayMessage("Insufficient permission to toggle that item's annotation");
     1477                        MessageBay
     1478                                        .displayMessage("Insufficient permission to toggle that item's annotation");
    14801479                        return;
    14811480                }
     
    14941493        private static void ToggleFontStyle(Item toToggle) {
    14951494                if (toToggle == null) {
    1496                         FrameGraphics.DisplayMessage("There is no Item selected to toggle");
     1495                        MessageBay.displayMessage("There is no Item selected to toggle");
    14971496                        return;
    14981497                }
     
    15001499                // check permissions
    15011500                if (!toToggle.hasPermission(Permission.full)) {
    1502                         FrameGraphics
    1503                                         .DisplayMessage("Insufficient permission to toggle that item's annotation");
     1501                        MessageBay
     1502                                        .displayMessage("Insufficient permission to toggle that item's annotation");
    15041503                        return;
    15051504                }
     
    15221521        private static void ToggleFontFamily(Item toToggle) {
    15231522                if (toToggle == null) {
    1524                         FrameGraphics.DisplayMessage("There is no Item selected to toggle");
     1523                        MessageBay.displayMessage("There is no Item selected to toggle");
    15251524                        return;
    15261525                }
     
    15281527                // check permissions
    15291528                if (!toToggle.hasPermission(Permission.full)) {
    1530                         FrameGraphics
    1531                                         .DisplayMessage("Insufficient permission to toggle that item's annotation");
     1529                        MessageBay.displayMessage("Insufficient permission to toggle that item's annotation");
    15321530                        return;
    15331531                }
     
    15651563                                // permission check
    15661564                                if (!toAdd.hasPermission(Permission.full)) {
    1567                                         FrameGraphics
    1568                                                         .DisplayMessage("Insufficicent permission to add the date to that item");
     1565                                        MessageBay
     1566                                                        .displayMessage("Insufficicent permission to add the date to that item");
    15691567                                        return;
    15701568                                }
     
    16171615                                FrameGraphics.Repaint();
    16181616                        } else {
    1619                                 FrameGraphics
    1620                                                 .DisplayMessage("Only text items can have the date prepended to them");
     1617                                MessageBay
     1618                                                .displayMessage("Only text items can have the date prepended to them");
    16211619                        }
    16221620                        // otherwise, create a new text item
     
    16401638        private static void CreateFrameset(Item item) {
    16411639                if (item == null) {
    1642                         FrameGraphics
    1643                                         .DisplayMessage("There is no selected item to use for the frameset name");
     1640                        MessageBay
     1641                                        .displayMessage("There is no selected item to use for the frameset name");
    16441642                        return;
    16451643                }
    16461644
    16471645                if (!(item instanceof Text)) {
    1648                         FrameGraphics
    1649                                         .DisplayMessage("Framesets can only be created from text items");
     1646                        MessageBay
     1647                                        .displayMessage("Framesets can only be created from text items");
    16501648                        return;
    16511649                }
     
    16531651                // dont create frameset if the item is linked
    16541652                if (item.getLink() != null) {
    1655                         FrameGraphics
    1656                                         .DisplayMessage("A frameset can not be created from a linked item");
     1653                        MessageBay
     1654                                        .displayMessage("A frameset can not be created from a linked item");
    16571655                        return;
    16581656                }
     
    16601658                // check permissions
    16611659                if (!item.hasPermission(Permission.full)) {
    1662                         FrameGraphics
    1663                                         .DisplayMessage("Insufficient permission to create a frameset from this item");
     1660                        MessageBay
     1661                                        .displayMessage("Insufficient permission to create a frameset from this item");
    16641662                        return;
    16651663                }
     
    16781676                        DisplayIO.setCursor(Item.DEFAULT_CURSOR);
    16791677                } catch (Exception e) {
    1680                         FrameGraphics.ErrorMessage(e.getMessage());
     1678                        MessageBay.errorMessage(e.getMessage());
    16811679                }
    16821680        }
     
    16951693                                        + "1");
    16961694                        assert (profile != null);
     1695                        FrameUtils.Parse(currentFrame);
    16971696                        FrameUtils.ParseProfile(profile);
    16981697                } else {
Note: See TracChangeset for help on using the changeset viewer.