Changeset 1174 for trunk


Ignore:
Timestamp:
09/28/18 10:22:03 (6 years ago)
Author:
bln4
Message:
 
File:
1 edited

Legend:

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

    r1102 r1174  
    5959        @Override
    6060        public void clear()
    61         {
     61        {               
    6262                for (Item i : this) {
    6363                        i.invalidateAll();
     
    105105        public static boolean textOnlyAttachedToCursor()
    106106        {
    107                 if (!hasItemsAttachedToCursor()) return false;
    108                
    109                 for (Item i : getInstance()) {
    110                         if (!(i instanceof Text)) return false;
     107                if (!hasItemsAttachedToCursor()) {
     108                        return false;
     109                }
     110               
     111                for (Item i : getInstance()) {
     112                        if (!(i instanceof Text)) {
     113                                return false;
     114                        }
    111115                }
    112116               
     
    116120        public static Item getItemAttachedToCursor()
    117121        {
    118                 if (hasItemsAttachedToCursor()) return getInstance().get(0);
     122                if (hasItemsAttachedToCursor()) {
     123                        return getInstance().get(0);
     124                }
    119125               
    120126                return null;
     
    123129        public static Text getTextAttachedToCursor()
    124130        {
    125                 if (textOnlyAttachedToCursor()) return (Text) getInstance().get(0);
     131                if (textOnlyAttachedToCursor()) {
     132                        return (Text) getInstance().get(0);
     133                }
    126134               
    127135                return null;
     
    137145               
    138146                for (Item i : getInstance()) {
    139                         if (i instanceof Text) textItems.add((Text) i);
     147                        if (i instanceof Text) {
     148                                textItems.add((Text) i);
     149                        }
    140150                }
    141151
     
    150160                Collection<Item> addedItems = new HashSet<Item>();
    151161                for (Item i : getInstance()) {
    152                         if (!(i instanceof Text) || !i.isLineEnd()) continue;
     162                        if (!(i instanceof Text) || !i.isLineEnd()) {
     163                                continue;
     164                        }
    153165                       
    154166                        // Check for text inside the box
     
    218230                        if(i.isVisible()) {
    219231                                toCount.removeAll(i.getAllConnected()); // treat polygons as a single item
    220                                 if(c++ > 0) return true;
     232                                if(c++ > 0) {
     233                                        return true;
     234                                }
    221235                        }
    222236                }
     
    239253        public static boolean rubberBanding()
    240254        {
    241                 if (getInstance().size() != 2) return false;
     255                if (getInstance().size() != 2) {
     256                        return false;
     257                }
    242258
    243259                // if rubber-banding, there will be 1 line end and the rest will be lines
     
    245261                for (Item i : getInstance()) {
    246262                        if (i.isLineEnd()) {
    247                                 if (foundLineEnd) return false;
     263                                if (foundLineEnd) {
     264                                        return false;
     265                                }
    248266                                foundLineEnd = true;
    249267                        } else if (!(i instanceof Line) || !i.isVisible()) {
Note: See TracChangeset for help on using the changeset viewer.