Changeset 944
- Timestamp:
- 01/13/15 13:55:36 (9 years ago)
- Location:
- trunk/src/org/expeditee/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/FrameKeyboardActions.java
r943 r944 63 63 64 64 protected FrameKeyboardActions() { 65 IndirectKeyboardActions.getInstance().setDropDownAction(new KeyboardAction() { 66 @Override 67 public void exec(KeyboardInfo info) { 68 // Get the last text item and drop from in 69 Item lastText = null; 70 for (Item i : info.enclosed) { 71 if (i instanceof Text) { 72 lastText = i; 65 IndirectKeyboardActions.getInstance().setDropDownAction( 66 new KeyboardAction() { 67 @Override 68 public Text exec(final KeyboardInfo info, final char c) { 69 // Get the last text item and drop from in 70 Item lastText = null; 71 for (Item i : info.enclosed) { 72 if (i instanceof Text) { 73 lastText = i; 74 } 75 } 76 // Drop from the item if there was a text item in the 77 // box 78 if (lastText != null) { 79 Drop(lastText, false); 80 } else { 81 // Move to the top of the box 82 Rectangle rect = info.firstConnected 83 .getEnclosedShape().getBounds(); 84 int newX = rect.x + Text.MARGIN_LEFT; 85 int newY = Text.MARGIN_LEFT 86 + rect.y 87 + DisplayIO.getCurrentFrame() 88 .getItemTemplate() 89 .getBoundsHeight(); 90 moveCursorAndFreeItems(newX, newY); 91 // TODO can resetOffset be put inside 92 // moveCursorAndFreeItems 93 FrameMouseActions.resetOffset(); 94 } 95 return null; 73 96 } 74 } 75 // Drop from the item if there was a text item in the box 76 if (lastText != null) { 77 Drop(lastText, false); 78 } else { 79 // Move to the top of the box 80 Rectangle rect = info.firstConnected.getEnclosedShape() 81 .getBounds(); 82 int newX = rect.x + Text.MARGIN_LEFT; 83 int newY = Text.MARGIN_LEFT 84 + rect.y 85 + DisplayIO.getCurrentFrame().getItemTemplate() 86 .getBoundsHeight(); 87 moveCursorAndFreeItems(newX, newY); 88 // TODO can resetOffset be put inside 89 // moveCursorAndFreeItems 90 FrameMouseActions.resetOffset(); 91 } 92 } 93 }); 94 IndirectKeyboardActions.getInstance().setSizeUpAction(new KeyboardAction() { 95 @Override 96 public void exec(final KeyboardInfo info) { 97 SetSize(info.firstConnected, info.repeat, false, true, info.isControlDown); 98 } 99 }); 100 IndirectKeyboardActions.getInstance().setSizeDownAction(new KeyboardAction() { 101 @Override 102 public void exec(final KeyboardInfo info) { 103 SetSize(info.firstConnected, -info.repeat, false, true, info.isControlDown); 104 } 105 }); 106 IndirectKeyboardActions.getInstance().setChangeColorAction(new KeyboardAction() { 107 @Override 108 public void exec(final KeyboardInfo info) { 109 if (info.connected.size() > 0) { 110 for (Item d : info.lineEnds) { 111 if (info.isControlDown) 112 SetGradientColor(d, info.isShiftDown); 113 else 114 SetFillColor(d, info.isShiftDown); 115 break; 97 }); 98 IndirectKeyboardActions.getInstance().setSizeUpAction( 99 new KeyboardAction() { 100 @Override 101 public Text exec(final KeyboardInfo info, final char c) { 102 SetSize(info.firstConnected, info.repeat, false, true, 103 info.isControlDown); 104 return null; 116 105 } 117 } 118 } 119 }); 106 }); 107 IndirectKeyboardActions.getInstance().setSizeDownAction( 108 new KeyboardAction() { 109 @Override 110 public Text exec(final KeyboardInfo info, final char c) { 111 SetSize(info.firstConnected, -info.repeat, false, true, 112 info.isControlDown); 113 return null; 114 } 115 }); 116 IndirectKeyboardActions.getInstance().setChangeColorAction( 117 new KeyboardAction() { 118 @Override 119 public Text exec(final KeyboardInfo info, final char c) { 120 if (info.connected.size() > 0) { 121 for (Item d : info.lineEnds) { 122 if (info.isControlDown) 123 SetGradientColor(d, info.isShiftDown); 124 else 125 SetFillColor(d, info.isShiftDown); 126 break; 127 } 128 } 129 return null; 130 } 131 }); 132 IndirectKeyboardActions.getInstance().setToggleAnnotationAction( 133 new KeyboardAction() { 134 @Override 135 public Text exec(final KeyboardInfo info, final char c) { 136 ToggleAnnotation(info.firstConnected); 137 return null; 138 } 139 }); 140 IndirectKeyboardActions.getInstance().setChangeFontStyleAction( 141 new KeyboardAction() { 142 @Override 143 public Text exec(final KeyboardInfo info, final char c) { 144 ToggleFontStyle(info.firstConnected); 145 return null; 146 } 147 }); 148 IndirectKeyboardActions.getInstance().setChangeFontFamilyAction( 149 new KeyboardAction() { 150 @Override 151 public Text exec(final KeyboardInfo info, final char c) { 152 ToggleFontFamily(info.firstConnected); 153 return null; 154 } 155 }); 156 IndirectKeyboardActions.getInstance().setInsertDateAction( 157 new KeyboardAction() { 158 @Override 159 public Text exec(final KeyboardInfo info, final char c) { 160 AddDate(info.firstConnected); 161 return null; 162 } 163 }); 164 IndirectKeyboardActions.getInstance().setSaveAction( 165 new KeyboardAction() { 166 @Override 167 public Text exec(final KeyboardInfo info, final char c) { 168 Save(); 169 return null; 170 } 171 }); 172 IndirectKeyboardActions.getInstance().setCreateNewTextAction( 173 new KeyboardAction() { 174 @Override 175 public Text exec(KeyboardInfo info, char c) { 176 Text t = DisplayIO.getCurrentFrame().createBlankText( 177 "" + c); 178 179 Point2D.Float newMouse = t.insertChar(c, 180 DisplayIO.getMouseX(), FrameMouseActions.getY()); 181 DisplayIO.setCursorPosition(newMouse.x, newMouse.y, 182 false); 183 184 return t; 185 } 186 }); 187 IndirectKeyboardActions.getInstance().setInsertCharacterAction( 188 new KeyboardAction() { 189 @Override 190 public Text exec(final KeyboardInfo info, final char c) { 191 float oldY = FrameMouseActions.MouseY; 192 Point2D.Float newMouse = null; 193 if (c == '\t') { 194 if (info.isShiftDown) { 195 newMouse = ((Text)info.firstConnected).removeTab(c, DisplayIO.getFloatMouseX(), 196 FrameMouseActions.MouseY); 197 } else { 198 newMouse = ((Text)info.firstConnected).insertTab(c, DisplayIO.getFloatMouseX(), 199 FrameMouseActions.MouseY); 200 } 201 } else { 202 newMouse = ((Text)info.firstConnected).insertChar(c, DisplayIO.getFloatMouseX(), 203 FrameMouseActions.MouseY); 204 } 205 /* 206 * check if the user hit enter and the cursor is now on another text 207 * item 208 */ 209 if (oldY < newMouse.y) { 210 // float diff = newMouse.y - oldY; 211 // System.out.print("c"); 212 Rectangle rect = info.firstConnected.getPolygon().getBounds(); 213 214 // Text lastEdited = FrameUtils.getLastEdited(); 215 // FrameUtils.setLastEdited(null); 216 217 Item justBelow = FrameUtils.onItem(DisplayIO.getCurrentFrame(), 218 info.firstConnected.getX() + 10, rect.y + rect.height + 1, false); 219 220 // FrameUtils.setLastEdited(lastEdited); 221 222 // Dont drop unless 223 if (justBelow != null && justBelow instanceof Text 224 && justBelow != info.firstConnected) { 225 // Drop all the items below it down! 226 // Get the list of items that must be dropped 227 List<Text> column = DisplayIO.getCurrentFrame().getColumn(info.firstConnected); 228 FrameUtils.Align(column, false, 0); 229 } 230 } 231 232 DisplayIO.setCursorPosition(newMouse.x, newMouse.y, false); 233 return (Text) info.firstConnected; 234 } 235 }); 120 236 } 121 237 … … 185 301 return; 186 302 } 187 188 if(isShiftDown && MagneticConstraints.getInstance().keyHit(-ch, on)) return; 189 else if(MagneticConstraints.getInstance().keyHit(ch, on)) return; 303 304 if (isShiftDown && MagneticConstraints.getInstance().keyHit(-ch, on)) 305 return; 306 else if (MagneticConstraints.getInstance().keyHit(ch, on)) 307 return; 190 308 191 309 if (_toRemove != null && on != _toRemove) { … … 251 369 } 252 370 253 float oldY = FrameMouseActions.MouseY;254 255 371 DisplayIO.setTextCursor(text, Text.NONE); 256 Point2D.Float newMouse = null; 257 if (ch == '\t') { 258 if (isShiftDown) { 259 newMouse = text.removeTab(ch, DisplayIO.getFloatMouseX(), 260 FrameMouseActions.MouseY); 261 } else { 262 newMouse = text.insertTab(ch, DisplayIO.getFloatMouseX(), 263 FrameMouseActions.MouseY); 264 } 265 } else { 266 newMouse = text.insertChar(ch, DisplayIO.getFloatMouseX(), 267 FrameMouseActions.MouseY); 268 } 269 /* 270 * check if the user hit enter and the cursor is now on another text 271 * item 272 */ 273 if (oldY < newMouse.y) { 274 // float diff = newMouse.y - oldY; 275 // System.out.print("c"); 276 Rectangle rect = text.getPolygon().getBounds(); 277 278 // Text lastEdited = FrameUtils.getLastEdited(); 279 // FrameUtils.setLastEdited(null); 280 281 Item justBelow = FrameUtils.onItem(DisplayIO.getCurrentFrame(), 282 text.getX() + 10, rect.y + rect.height + 1, false); 283 284 // FrameUtils.setLastEdited(lastEdited); 285 286 // Dont drop unless 287 if (justBelow != null && justBelow instanceof Text 288 && justBelow != on) { 289 // Drop all the items below it down! 290 // Get the list of items that must be dropped 291 List<Text> column = DisplayIO.getCurrentFrame().getColumn(on); 292 FrameUtils.Align(column, false, 0); 293 } 294 } 295 296 DisplayIO.setCursorPosition(newMouse.x, newMouse.y, false); 372 IndirectKeyboardActions.getInstance().getInsertCharacterAction() 373 .exec(new KeyboardInfo(null, ch, isShiftDown, isShiftDown, 374 _enclosedItems, text, _enclosedItems, _enclosedItems), ch); 297 375 298 376 // This repaint is needed for WINDOWS only?!?!? Mike is not sure why! … … 368 446 */ 369 447 private static Text createText(char start) { 370 Text t = DisplayIO.getCurrentFrame().createBlankText("" + start); 371 372 Point2D.Float newMouse = t.insertChar(start, DisplayIO.getMouseX(), 373 FrameMouseActions.getY()); 374 DisplayIO.setCursorPosition(newMouse.x, newMouse.y, false); 375 376 return t; 448 return IndirectKeyboardActions.getInstance().getCreateNewTextAction() 449 .exec(new KeyboardInfo(null, start, false, false, _enclosedItems, _toRemove, _enclosedItems, _enclosedItems), start); 377 450 } 378 451 … … 461 534 462 535 if (keyCode >= KeyEvent.VK_F1 && keyCode <= KeyEvent.VK_F12) { 463 functionKey(FunctionKey.values()[keyCode - KeyEvent.VK_F1 + 1], e464 .isShiftDown(), e.isControlDown());536 functionKey(FunctionKey.values()[keyCode - KeyEvent.VK_F1 + 1], 537 e.isShiftDown(), e.isControlDown()); 465 538 return; 466 539 } else if (e.isAltDown()) { … … 511 584 case KeyEvent.VK_ESCAPE: 512 585 // Do escape after control so Ctl+Escape does not perform DropDown 513 functionKey(FunctionKey.DropDown, e.isShiftDown(), e514 .isControlDown());586 functionKey(FunctionKey.DropDown, e.isShiftDown(), 587 e.isControlDown()); 515 588 SessionStats.Escape(); 516 589 break; … … 626 699 // then scroll backup to the title 627 700 if (textItems.size() > 0) { 628 DisplayIO .MoveCursorToEndOfItem(textItems629 . get(textItems.size() - 1));701 DisplayIO 702 .MoveCursorToEndOfItem(textItems.get(textItems.size() - 1)); 630 703 } 631 704 return; … … 677 750 // add the text of the item to the clipboard 678 751 StringSelection selection = new StringSelection(string); 679 Toolkit.getDefaultToolkit().getSystemClipboard() .setContents(selection,680 null);752 Toolkit.getDefaultToolkit().getSystemClipboard() 753 .setContents(selection, null); 681 754 } 682 755 … … 848 921 return; 849 922 case KeyEvent.VK_C: 850 if (FreeItems.itemsAttachedToCursor()) {923 if (FreeItems.itemsAttachedToCursor()) { 851 924 ItemSelection.copyClone(); 852 925 return; 853 926 } 854 if (current instanceof Text) {927 if (current instanceof Text) { 855 928 copyItemToClipboard(current); 856 929 } … … 881 954 if (current == null) 882 955 return; 883 if (current != null && !current.hasPermission(UserAppliedPermission.full)) { 956 if (current != null 957 && !current.hasPermission(UserAppliedPermission.full)) { 884 958 MessageBay 885 959 .displayMessage("Insufficient permission toggle the items mark"); … … 892 966 break; 893 967 case KeyEvent.VK_Z: 894 if (isShiftDown) {968 if (isShiftDown) { 895 969 DisplayIO.getCurrentFrame().redo(); 896 970 } else { … … 956 1030 * shortcut for saving a document in most word processors and text 957 1031 * editors! 958 *959 1032 */ 960 1033 if (!isShiftDown) { … … 1045 1118 switch (key) { 1046 1119 case DropDown: 1047 IndirectKeyboardActions.getInstance().getDropDownAction().exec( 1048 new KeyboardInfo(key, repeat, isShiftDown, isControlDown, enclosed, firstConnected, connected, lineEnds)); 1120 IndirectKeyboardActions 1121 .getInstance() 1122 .getDropDownAction() 1123 .exec(new KeyboardInfo(key, repeat, isShiftDown, 1124 isControlDown, enclosed, firstConnected, 1125 connected, lineEnds), (char) 0); 1049 1126 break; 1050 1127 case SizeUp: 1051 IndirectKeyboardActions.getInstance().getSizeUpAction().exec( 1052 new KeyboardInfo(key, repeat, isShiftDown, isControlDown, enclosed, firstConnected, connected, lineEnds)); 1128 IndirectKeyboardActions 1129 .getInstance() 1130 .getSizeUpAction() 1131 .exec(new KeyboardInfo(key, repeat, isShiftDown, 1132 isControlDown, enclosed, firstConnected, 1133 connected, lineEnds), (char) 0); 1053 1134 break; 1054 1135 case SizeDown: 1055 IndirectKeyboardActions.getInstance().getSizeDownAction().exec( 1056 new KeyboardInfo(key, repeat, isShiftDown, isControlDown, enclosed, firstConnected, connected, lineEnds)); 1136 IndirectKeyboardActions 1137 .getInstance() 1138 .getSizeDownAction() 1139 .exec(new KeyboardInfo(key, repeat, isShiftDown, 1140 isControlDown, enclosed, firstConnected, 1141 connected, lineEnds), (char) 0); 1057 1142 break; 1058 1143 case ChangeColor: 1059 IndirectKeyboardActions.getInstance().getChangeColorAction().exec( 1060 new KeyboardInfo(key, repeat, isShiftDown, isControlDown, enclosed, firstConnected, connected, lineEnds)); 1144 IndirectKeyboardActions 1145 .getInstance() 1146 .getChangeColorAction() 1147 .exec(new KeyboardInfo(key, repeat, isShiftDown, 1148 isControlDown, enclosed, firstConnected, 1149 connected, lineEnds), (char) 0); 1061 1150 break; 1062 1151 case ToggleAnnotation: 1063 ToggleAnnotation(firstConnected); 1152 IndirectKeyboardActions 1153 .getInstance() 1154 .getToggleAnnotationAction() 1155 .exec(new KeyboardInfo(key, repeat, isShiftDown, 1156 isControlDown, enclosed, firstConnected, 1157 connected, lineEnds), (char) 0); 1064 1158 break; 1065 1159 case ChangeFontStyle: 1066 ToggleFontStyle(firstConnected); 1160 IndirectKeyboardActions 1161 .getInstance() 1162 .getChangeFontStyleAction() 1163 .exec(new KeyboardInfo(key, repeat, isShiftDown, 1164 isControlDown, enclosed, firstConnected, 1165 connected, lineEnds), (char) 0); 1067 1166 break; 1068 1167 case ChangeFontFamily: 1069 ToggleFontFamily(firstConnected); 1168 IndirectKeyboardActions 1169 .getInstance() 1170 .getChangeFontFamilyAction() 1171 .exec(new KeyboardInfo(key, repeat, isShiftDown, 1172 isControlDown, enclosed, firstConnected, 1173 connected, lineEnds), (char) 0); 1070 1174 break; 1071 1175 case InsertDate: 1072 AddDate(firstConnected); 1176 IndirectKeyboardActions 1177 .getInstance() 1178 .getInsertDateAction() 1179 .exec(new KeyboardInfo(key, repeat, isShiftDown, 1180 isControlDown, enclosed, firstConnected, 1181 connected, lineEnds), (char) 0); 1073 1182 break; 1074 1183 case Save: 1075 Save(); 1184 IndirectKeyboardActions 1185 .getInstance() 1186 .getSaveAction() 1187 .exec(new KeyboardInfo(key, repeat, isShiftDown, 1188 isControlDown, enclosed, firstConnected, 1189 connected, lineEnds), (char) 0); 1076 1190 MessageBay.displayMessage(displayMessage); 1077 1191 break; … … 1097 1211 FrameKeyboardActions.Refresh(); 1098 1212 return; 1099 // if (isControlDown) { 1100 // UserSettings.ScaleFactor.set(UserSettings.ScaleFactor.get() - 0.05f); 1101 // Misc.repaint(); 1102 // return; 1103 // } 1213 // if (isControlDown) { 1214 // UserSettings.ScaleFactor.set(UserSettings.ScaleFactor.get() - 1215 // 0.05f); 1216 // Misc.repaint(); 1217 // return; 1218 // } 1104 1219 case SizeUp: 1105 1220 zoomFrame(DisplayIO.getCurrentFrame(), 1.1f); … … 1107 1222 FrameKeyboardActions.Refresh(); 1108 1223 return; 1109 // if (isControlDown) { 1110 // UserSettings.ScaleFactor.set(UserSettings.ScaleFactor.get() + 0.05f); 1111 // Misc.repaint(); 1112 // return; 1113 // } 1224 // if (isControlDown) { 1225 // UserSettings.ScaleFactor.set(UserSettings.ScaleFactor.get() + 1226 // 0.05f); 1227 // Misc.repaint(); 1228 // return; 1229 // } 1114 1230 default: 1115 1231 MessageBay.displayMessageOnce(displayMessage); … … 1339 1455 1340 1456 // Add previous button to the new frame 1341 frameCreator.addPreviousButton(moreFrame, firstFrame1342 .getName());1457 frameCreator.addPreviousButton(moreFrame, 1458 firstFrame.getName()); 1343 1459 Item first = current.getAnnotation("first"); 1344 1460 if (first != null) { 1345 frameCreator.addFirstButton(moreFrame, first1346 .getLink());1461 frameCreator.addFirstButton(moreFrame, 1462 first.getLink()); 1347 1463 } else { 1348 frameCreator.addFirstButton(moreFrame, firstFrame1349 .getName());1464 frameCreator.addFirstButton(moreFrame, 1465 firstFrame.getName()); 1350 1466 } 1351 1467 // Add the @next if we are pasting … … 1361 1477 if (!mouseMoved) { 1362 1478 Item moreTitle = moreFrame.getTitleItem(); 1363 moreTitle.setOverlayPermission(UserAppliedPermission.full); 1479 moreTitle 1480 .setOverlayPermission(UserAppliedPermission.full); 1364 1481 Drop(moreTitle, bPasting); 1365 1482 } … … 1592 1709 return newItemText; 1593 1710 } 1594 1711 1595 1712 private static boolean refreshAnchors(Collection<Item> items) { 1596 1713 boolean bReparse = false; 1597 1598 for (Item i : items) {1599 Float anchorLeft 1600 Float anchorRight 1601 Float anchorTop 1714 1715 for (Item i : items) { 1716 Float anchorLeft = i.getAnchorLeft(); 1717 Float anchorRight = i.getAnchorRight(); 1718 Float anchorTop = i.getAnchorTop(); 1602 1719 Float anchorBottom = i.getAnchorBottom(); 1603 1604 1720 1605 1721 if (anchorLeft != null) { 1606 1722 i.setAnchorLeft(anchorLeft); … … 1609 1725 } 1610 1726 } 1611 1727 1612 1728 if (anchorRight != null) { 1613 1729 i.setAnchorRight(anchorRight); … … 1616 1732 } 1617 1733 } 1618 1734 1619 1735 if (anchorTop != null) { 1620 1736 i.setAnchorTop(anchorTop); … … 1623 1739 } 1624 1740 } 1625 1741 1626 1742 if (anchorBottom != null) { 1627 1743 i.setAnchorBottom(anchorBottom); … … 1633 1749 return bReparse; 1634 1750 } 1635 1751 1636 1752 public static void zoomFrame(Frame frame, double scaleFactor) { 1637 1753 1638 1754 int x = FrameMouseActions.getX(), y = FrameMouseActions.getY(); 1639 1755 1640 1756 if (frame == null) { 1641 1757 return; 1642 1758 } 1643 1759 1644 1760 Collection<Item> items = frame.getVisibleItems(); 1645 1646 for(Item item : items) { 1647 if(item instanceof Text && item.getSize() <= Text.MINIMUM_FONT_SIZE && scaleFactor < 1) { 1761 1762 for (Item item : items) { 1763 if (item instanceof Text 1764 && item.getSize() <= Text.MINIMUM_FONT_SIZE 1765 && scaleFactor < 1) { 1648 1766 return; 1649 1767 } 1650 1768 } 1651 1769 1652 1770 for (Vector v : frame.getVectors()) { 1653 1771 v.Source.scale((float) scaleFactor, x, y); 1654 1772 } 1655 1773 1656 1774 for (Item item : items) { 1657 1775 // This line is only needed for circles!! … … 1713 1831 if (item.isFrameName()) { 1714 1832 // scale the entire frame 1715 if(diff != 0) { 1716 zoomFrame(DisplayIO.getCurrentFrame(), diff > 0 ? 1.1 : 0.909090909); 1833 if (diff != 0) { 1834 zoomFrame(DisplayIO.getCurrentFrame(), diff > 0 ? 1.1 1835 : 0.909090909); 1717 1836 DisplayIO.getCurrentFrame().refreshSize(); 1718 1837 FrameKeyboardActions.Refresh(); … … 1751 1870 1752 1871 }// Enclosed circle centers are resized with the center as origin 1753 // Just add the circle center to the list of items to size1872 // Just add the circle center to the list of items to size 1754 1873 else if (!toSet.hasEnclosures() && !(toSet instanceof Text) 1755 1874 && toSet.isLineEnd()) { … … 1775 1894 } 1776 1895 } 1777 1896 1778 1897 // add widgets to notify 1779 for (Item i : toSize) {1780 if (i instanceof WidgetEdge) {1898 for (Item i : toSize) { 1899 if (i instanceof WidgetEdge) { 1781 1900 widgets.add(((WidgetEdge) i).getWidgetSource()); 1782 } else if (i instanceof WidgetCorner) {1901 } else if (i instanceof WidgetCorner) { 1783 1902 widgets.add(((WidgetCorner) i).getWidgetSource()); 1784 1903 } … … 1828 1947 assert (i instanceof Text); 1829 1948 Text text = (Text) i; 1830 AttributeValuePair avp = new AttributeValuePair( text1831 .getText());1949 AttributeValuePair avp = new AttributeValuePair( 1950 text.getText()); 1832 1951 double scale = 1F; 1833 1952 try { … … 1845 1964 } 1846 1965 // refresh anchored items 1847 if(refreshAnchors(toSize)) {1848 1849 1966 if (refreshAnchors(toSize)) { 1967 FrameUtils.Parse(DisplayIO.getCurrentFrame(), false); 1968 } 1850 1969 // notify widgets they were resized 1851 for (InteractiveWidget iw : widgets) {1970 for (InteractiveWidget iw : widgets) { 1852 1971 iw.onResized(); 1853 1972 } … … 1908 2027 if (toSet != null) 1909 2028 toSet.getParent().setChanged(true); 1910 2029 1911 2030 // refresh anchored items 1912 if (refreshAnchors(toSize)) {2031 if (refreshAnchors(toSize)) { 1913 2032 FrameUtils.Parse(DisplayIO.getCurrentFrame(), false); 1914 2033 } 1915 2034 1916 2035 // notify widgets they were resized 1917 for (InteractiveWidget iw : widgets) {2036 for (InteractiveWidget iw : widgets) { 1918 2037 iw.onResized(); 1919 2038 } … … 1951 2070 color = null; 1952 2071 else 1953 color = ColorUtils.getNextColor(color, TemplateSettings.FillColorWheel.get(), toSet 1954 .getGradientColor()); 2072 color = ColorUtils.getNextColor(color, 2073 TemplateSettings.FillColorWheel.get(), 2074 toSet.getGradientColor()); 1955 2075 1956 2076 // if (color == null) { … … 1979 2099 color = null; 1980 2100 else 1981 color = ColorUtils.getNextColor(color, TemplateSettings.ColorWheel.get(), toSet1982 .getFillColor());2101 color = ColorUtils.getNextColor(color, 2102 TemplateSettings.ColorWheel.get(), toSet.getFillColor()); 1983 2103 1984 2104 // if (color == null) { … … 2060 2180 color = null; 2061 2181 else if (setBackgroundColor) { 2062 color = ColorUtils.getNextColor(color, TemplateSettings.FillColorWheel.get(), item 2063 .getPaintColor()); 2182 color = ColorUtils 2183 .getNextColor(color, TemplateSettings.FillColorWheel.get(), 2184 item.getPaintColor()); 2064 2185 } else { 2065 color = ColorUtils.getNextColor(color, TemplateSettings.ColorWheel.get(), 2186 color = ColorUtils.getNextColor(color, 2187 TemplateSettings.ColorWheel.get(), 2066 2188 currentFrame.getPaintBackgroundColor()); 2067 2189 } … … 2319 2441 public static void Refresh() { 2320 2442 Frame currentFrame = DisplayIO.getCurrentFrame(); 2321 2322 if (FrameMouseActions.isShiftDown()) {2443 2444 if (FrameMouseActions.isShiftDown()) { 2323 2445 currentFrame.refreshSize(); 2324 2446 } -
trunk/src/org/expeditee/gui/indirect/keyboard/IndirectKeyboardActions.java
r943 r944 6 6 //Function Keys 7 7 DropDown, SizeUp, SizeDown, ChangeColor, ToggleAnnotation, InsertDate, NewFrameset, ChangeFontStyle, ChangeFontFamily, 8 AudienceMode, XRayMode, Save, Refresh 8 AudienceMode, XRayMode, Save, Refresh, 9 //Process character 10 NewText, InsertCharacter 9 11 } 10 12 … … 57 59 public KeyboardAction getRefreshAction() { return actions[Action.Refresh.ordinal()]; } 58 60 public KeyboardAction setRefreshAction(final KeyboardAction action) { actions[Action.Refresh.ordinal()] = action; return action; } 61 62 public KeyboardAction getCreateNewTextAction() { return actions[Action.NewText.ordinal()]; } 63 public KeyboardAction setCreateNewTextAction(final KeyboardAction action) { actions[Action.NewText.ordinal()] = action; return action; } 64 65 public KeyboardAction getInsertCharacterAction() { return actions[Action.InsertCharacter.ordinal()]; } 66 public KeyboardAction setInsertCharacterAction(final KeyboardAction action) { actions[Action.InsertCharacter.ordinal()] = action; return action; } 59 67 } -
trunk/src/org/expeditee/gui/indirect/keyboard/KeyboardAction.java
r943 r944 5 5 import org.expeditee.gui.FunctionKey; 6 6 import org.expeditee.items.Item; 7 import org.expeditee.items.Text; 7 8 8 9 public interface KeyboardAction { 9 public void exec(final KeyboardInfo info);10 public Text exec(final KeyboardInfo info, char c); 10 11 11 12 public class KeyboardInfo {
Note:
See TracChangeset
for help on using the changeset viewer.