Changeset 697
- Timestamp:
- 01/15/14 17:31:30 (10 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/FreeItems.java
r427 r697 8 8 import java.util.LinkedHashSet; 9 9 import java.util.LinkedList; 10 import java.util.List; 10 11 import java.util.Map; 11 12 13 import org.expeditee.items.Dot; 12 14 import org.expeditee.items.Item; 15 import org.expeditee.items.Line; 13 16 import org.expeditee.items.Text; 14 17 … … 167 170 _cursor.addAll(cursor); 168 171 } 172 173 public static boolean hasMultipleVisibleItems() { 174 List<Item> toCount = new LinkedList<Item>(getInstance()); 175 int c = 0; 176 while(!toCount.isEmpty()) { 177 Item i = toCount.remove(0); 178 if(i.isVisible()) { 179 toCount.removeAll(i.getAllConnected()); // treat polygons as a single item 180 if(c++ > 0) return true; 181 } 182 } 183 return false; 184 } 185 186 public static boolean isDrawingPolyLine() { 187 List<Item> tmp = getInstance(); 188 return tmp.size() == 2 && tmp.get(0) instanceof Dot && tmp.get(1) instanceof Line; 189 } 169 190 } -
trunk/src/org/expeditee/gui/Help.java
r687 r697 3 3 import java.util.Collection; 4 4 5 import org.expeditee.items.Dot; 5 6 import org.expeditee.items.Item; 6 7 import org.expeditee.items.Line; 8 import org.expeditee.items.Picture; 7 9 import org.expeditee.items.Text; 8 10 import org.expeditee.items.widgets.InteractiveWidget; … … 18 20 background, 19 21 item, 22 polygon, 20 23 line, 24 dot, 21 25 text, 26 image, 22 27 widget 23 28 }; … … 32 37 33 38 // other 34 private static final int panning = 1, action = 2, cursor = 4;39 private static final int panning = 1, action = 2, link = 4, cursor = 8; 35 40 36 41 // separator between command and description … … 40 45 41 46 private static final String commandPadding = " "; 42 private static final String padding = " ";47 private static final String padding = " "; 43 48 44 49 private static final String command(int mod, int button, boolean drag) { … … 57 62 if((mod & (control | shift)) != 0) return "Go forward"; 58 63 return "Go back"; 64 59 65 default: 60 66 if((other & action) != 0 && (mod & control) == 0) return "Run action"; 61 return "Follow link"; 67 if((other & link) != 0) return "Follow link"; 68 return "Create link"; 62 69 } 63 70 } … … 67 74 case widget: return "Middle click widget"; 68 75 case background: 69 if((other & cursor) != 0) return "Place item(s)";76 if((other & cursor) != 0) return FreeItems.hasMultipleVisibleItems() ? "Place items" : "Place item"; 70 77 return "Create arrow"; 71 78 case line: 72 79 if((mod & shift) != 0) return "Extend shape"; 73 case text: 74 if((other & cursor) != 0 && FrameUtils.getCurrentItem() instanceof Text) return "Merge text"; 75 default: 76 if((other & cursor) != 0) return "Place item(s)"; 80 case dot: 81 if((mod & shift) != 0) return "Pickup unconstrained"; 82 case text: 83 if((other & cursor) != 0 && FreeItems.getInstance().size() == 1 && FreeItems.textOnlyAttachedToCursor()) return "Merge text"; 84 default: 85 if((other & cursor) != 0) return FreeItems.hasMultipleVisibleItems() ? "Place items" : "Place item"; 77 86 if((mod & shift) != 0) return "Create arrow"; 78 return "Pickup ";87 return "Pickup item"; 79 88 } 80 89 } … … 84 93 case widget: return "Right click widget"; 85 94 case background: 86 if((other & cursor) != 0) return "Stamp item(s)"; 95 if((other & cursor) != 0) { 96 if(FreeItems.isDrawingPolyLine()) return "Continue poly-line"; 97 return FreeItems.hasMultipleVisibleItems() ? "Stamp items" : "Stamp item"; 98 } 87 99 return "Create rectangle"; 88 100 case line: 89 101 if((mod & shift) != 0) return "Add line"; 90 102 default: 91 if((other & cursor) != 0) return "Stamp item(s)";103 if((other & cursor) != 0) return FreeItems.hasMultipleVisibleItems() ? "Stamp items" : "Stamp item"; 92 104 if((mod & shift) != 0) return "Create rectangle"; 93 return "Copy"; 105 if(context == Context.polygon) return "Copy enclosed items"; 106 return "Copy item"; 94 107 } 95 108 } … … 103 116 case widget: return null; 104 117 default: 105 if((other & cursor) == 0 ) return "Extract attributes";118 if((other & cursor) == 0 && (context != Context.polygon)) return "Extract attributes"; 106 119 case background: 107 120 return "Auto format"; … … 113 126 case widget: return null; 114 127 case text: 115 if((other & cursor) != 0 && Fr ameUtils.getCurrentItem() instanceof Text) return "Swap text";116 break; 117 case background: 118 if((other & cursor) == 0) return "Undo ";128 if((other & cursor) != 0 && FreeItems.getInstance().size() == 1 && FreeItems.textOnlyAttachedToCursor()) return "Swap text"; 129 break; 130 case background: 131 if((other & cursor) == 0) return "Undo last delete"; 119 132 break; 120 133 } … … 126 139 case widget: return null; 127 140 case background: 128 if((mod & shift) != 0 && (other & cursor) == 0 ) return "Drag to pan";129 break; 130 case text: 131 if((other & cursor) == 0) return "Select region";141 if((mod & shift) != 0 && (other & cursor) == 0 && (other & panning) != 0) return "Drag to pan"; 142 break; 143 case text: 144 if((other & cursor) == 0) return "Select text region"; 132 145 break; 133 146 } … … 139 152 case widget: return null; 140 153 case text: 141 if((other & cursor) == 0) return "Cut region";154 if((other & cursor) == 0) return "Cut text region"; 142 155 } 143 156 return null; … … 147 160 switch(context) { 148 161 case widget: return null; 162 case image: 163 return "Crop image"; 149 164 case line: 150 165 return "Extrude shape"; 151 166 case text: 152 if((other & cursor) == 0) return "Copy region";167 if((other & cursor) == 0) return "Copy text region"; 153 168 } 154 169 return null; … … 166 181 } else if(current instanceof Text) { 167 182 context = Context.text; 168 } else { 183 } else if(current instanceof Picture) { 184 context = Context.image; 185 } else if(current instanceof Dot ) { 186 context = Context.dot; 187 }else { 169 188 context = Context.item; 170 189 } … … 186 205 context = Context.widget; 187 206 } else { 188 context = Context. item;207 context = Context.polygon; 189 208 } 190 209 } else { … … 193 212 } 194 213 int mod = (FrameMouseActions.isControlDown() ? control : 0) | (FrameMouseActions.isShiftDown() ? shift : 0); 195 int other = (ExperimentalFeatures.MousePan.get() ? panning : 0) | (current != null && current.hasAction() ? action : 0) | (FreeItems.itemsAttachedToCursor() ? cursor : 0); 214 int other = (ExperimentalFeatures.MousePan.get() ? panning : 0) | 215 (current != null && current.hasAction() ? action : 0)| 216 (current != null && current.hasLink() ? link : 0) | 217 (FreeItems.itemsAttachedToCursor() ? cursor : 0); 196 218 String status = ""; 197 219 -
trunk/src/org/expeditee/items/XRayable.java
r665 r697 169 169 public String getFillPattern() { 170 170 return _source.getFillPattern(); 171 } 172 173 @Override 174 public boolean hasLink() { 175 return getLink() != null; 171 176 } 172 177
Note:
See TracChangeset
for help on using the changeset viewer.