Changeset 229
- Timestamp:
- 08/16/08 00:20:36 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/FrameKeyboardActions.java
r220 r229 31 31 import org.expeditee.items.Text; 32 32 import org.expeditee.items.XRayable; 33 import org.expeditee.items.widgets.WidgetCorner; 33 34 import org.expeditee.stats.SessionStats; 34 35 … … 107 108 108 109 // check for dot's being replaced with text 109 if (on != null && on instanceof Dot ) {110 if (on != null && on instanceof Dot && !(on instanceof WidgetCorner)) { 110 111 if (ch == KeyEvent.VK_BACK_SPACE || ch == KeyEvent.VK_DELETE) { 111 112 return; -
trunk/src/org/expeditee/items/Text.java
r226 r229 1317 1317 return new Point(start, end); 1318 1318 } 1319 1320 /** 1321 * @param mouseButton 1322 * Either MouseEvent.BUTTON1, MouseEvent.BUTTON2 or MouseEvent.BUTTON3. 1323 * 1324 * @return 1325 * The color for the text selection based on the given mouse click 1326 */ 1327 protected Color getSelectionColor(int mouseButton) { 1328 1329 /* 1330 * Color main = getPaintColor(); Color back = getPaintBackgroundColor(); 1331 * 1332 * if (Math.abs(main.getRed() - back.getRed()) < 10 && 1333 * Math.abs(main.getGreen() - back.getGreen()) < 10 && 1334 * Math.abs(main.getBlue() - back.getBlue()) < 10) { selection = new 1335 * Color(Math.abs(255 - main.getRed()), Math .abs(255 - 1336 * main.getGreen()), Math.abs(255 - main.getBlue())); } else { selection = 1337 * new Color((main.getRed() + (back.getRed() * 2)) / 3, (main.getGreen() + 1338 * (back.getGreen() * 2)) / 3, (main .getBlue() + (back.getBlue() * 2)) / 1339 * 3); } 1340 */ 1341 int green = 160; 1342 int red = 160; 1343 int blue = 160; 1344 1345 if (FrameMouseActions.wasDeleteClicked()) { 1346 green = 235; 1347 red = 235; 1348 blue = 140; 1349 } else if (mouseButton == MouseEvent.BUTTON1) { 1350 red = 255; 1351 } else if (mouseButton == MouseEvent.BUTTON2) { 1352 green = 255; 1353 } else if (mouseButton == MouseEvent.BUTTON3) { 1354 blue = 255; 1355 } 1356 1357 return new Color(red, green, blue); 1358 } 1319 1359 1320 1360 @Override … … 1377 1417 g.setColor(c); 1378 1418 1379 Color selection; 1380 1381 /* 1382 * Color main = getPaintColor(); Color back = getPaintBackgroundColor(); 1383 * 1384 * if (Math.abs(main.getRed() - back.getRed()) < 10 && 1385 * Math.abs(main.getGreen() - back.getGreen()) < 10 && 1386 * Math.abs(main.getBlue() - back.getBlue()) < 10) { selection = new 1387 * Color(Math.abs(255 - main.getRed()), Math .abs(255 - 1388 * main.getGreen()), Math.abs(255 - main.getBlue())); } else { selection = 1389 * new Color((main.getRed() + (back.getRed() * 2)) / 3, (main.getGreen() + 1390 * (back.getGreen() * 2)) / 3, (main .getBlue() + (back.getBlue() * 2)) / 1391 * 3); } 1392 */ 1393 int green = 160; 1394 int red = 160; 1395 int blue = 160; 1396 1397 if (FrameMouseActions.wasDeleteClicked()) { 1398 green = 235; 1399 red = 235; 1400 blue = 140; 1401 } else if (FrameMouseActions.getLastMouseButton() == MouseEvent.BUTTON1) { 1402 red = 255; 1403 } else if (FrameMouseActions.getLastMouseButton() == MouseEvent.BUTTON2) { 1404 green = 255; 1405 } else if (FrameMouseActions.getLastMouseButton() == MouseEvent.BUTTON3) { 1406 blue = 255; 1407 } 1408 selection = new Color(red, green, blue); 1419 Color selection = getSelectionColor(FrameMouseActions.getLastMouseButton()); 1409 1420 1410 1421 // width -= getX();
Note:
See TracChangeset
for help on using the changeset viewer.