Ignore:
Timestamp:
05/21/08 09:40:52 (16 years ago)
Author:
ra33
Message:

Made LOTS of changes...
Added DisplayComet
A whole bunch more stats for items and events
Changed lots of stuff for drawing better especially using text as line endpoints

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/items/Item.java

    r67 r70  
    162162
    163163                dest.setParent(source.getParent());
    164                 // Add the copied item to the frame
    165                 if (source.getParent() != null) {
    166                         dest.setID(source.getParent().getNextItemID());
    167                 } else {
    168                         dest.setID(source.getID());
    169                 }
     164                dest.setID(source.getParentOrCurrentFrame().getNextItemID());
    170165        }
    171166
     
    906901         * @param merger
    907902         *            The Item to merge with
    908          * @param mouseX
    909          *            The X coordinate of the mouse when performing this merge
    910          *            operation
    911          * @param mouseY
    912          *            The Y coordinate of the mouse when performing this merge
    913          *            operation
    914903         * @return any Item that should remain on the cursor
    915904         */
     
    12851274                        // frame
    12861275                        if (!other.isFloating()) {
    1287                                 if (c.getType() == Constraint.HORIZONTAL
    1288                                                 && other.getY() != getY())
    1289                                         other.setY(getY());
    1290 
    1291                                 if (c.getType() == Constraint.VERTICAL
    1292                                                 && other.getX() != getX())
    1293                                         other.setX(getX());
     1276                                if (c.getType() == Constraint.HORIZONTAL) {
     1277                                        if (other.getY() != y)
     1278                                                other.setY(y);
     1279                                }
     1280                                if (c.getType() == Constraint.VERTICAL) {
     1281                                        if (other.getX() != x)
     1282                                                other.setX(x);
     1283                                }
    12941284                        }
    12951285                }
     
    14291419                return _visible;
    14301420        }
    1431        
    1432         /**
    1433          * Raised whenever the item is removed, added, no longer in view (That is, when it is
    1434          * not on any of the current frames, of overlays of the current frames) or
    1435          * has become visible. That is, when it is either on a current frames, or an overlay of a current frame.
    1436          * @param e The event
    1437          */
    1438         public void onParentStateChanged(ItemParentStateChangedEvent e) {}
    1439        
     1421
     1422        /**
     1423         * Raised whenever the item is removed, added, no longer in view (That is,
     1424         * when it is not on any of the current frames, of overlays of the current
     1425         * frames) or has become visible. That is, when it is either on a current
     1426         * frames, or an overlay of a current frame.
     1427         *
     1428         * @param e
     1429         *            The event
     1430         */
     1431        public void onParentStateChanged(ItemParentStateChangedEvent e) {
     1432        }
     1433
    14401434        public void setSelectedMode(SelectedMode mode, Color color) {
    14411435                setSelectionColor(color);
     
    15521546                }
    15531547        }
    1554        
     1548
    15551549        /**
    15561550         * Checks if this item is off the left or top of the screen
     1551         *
    15571552         * @return
    15581553         */
    15591554        public boolean offScreen() {
    15601555                Rectangle itemRect = getArea().getBounds();
    1561                 //Check that the bottom right corner of this item is on the screen
    1562                 if (itemRect.x + itemRect.width >= 0 && itemRect.y + itemRect.height >= 0)
     1556                // Check that the bottom right corner of this item is on the screen
     1557                if (itemRect.x + itemRect.width >= 0
     1558                                && itemRect.y + itemRect.height >= 0)
    15631559                        return false;
    1564                 //Check if all the items it is connected to are offscreen
    1565                 for(Item i: getAllConnected()){
     1560                // Check if all the items it is connected to are offscreen
     1561                for (Item i : getAllConnected()) {
    15661562                        Rectangle iRect = i.getArea().getBounds();
    1567                         //Check that the bottom right corner of this item is on the screen
     1563                        // Check that the bottom right corner of this item is on the screen
    15681564                        if (iRect.x + iRect.width >= 0 && iRect.y + iRect.height >= 0) {
    15691565                                return false;
Note: See TracChangeset for help on using the changeset viewer.