424 xs[0] = blockSize;
425 xs[1] = 0;
426 xs[2] = blockSize << 1;
427 ys[0] = 0;
428 ys[1] = ys[2] = blockSize;
429 g.drawPolygon(xs, ys, 3); // Little trick to make the
430 // arrows of equal size
431 }
432 else {
433 blockSize = Math.min(getWidth(), oneTouchSize);
434 xs[0] = xs[2] = blockSize;
435 xs[1] = 0;
436 ys[0] = 0;
437 ys[1] = blockSize;
438 ys[2] = blockSize << 1;
439 }
440 g.fillPolygon(xs, ys, 3);
441 }
442 }
443 // Don't want the button to participate in focus traversable.
444 public boolean isFocusTraversable() {
445 return false;
446 }
447 };
448 b.setMinimumSize(new Dimension(oneTouchSize, oneTouchSize));
449 b.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
450 b.setFocusPainted(false);
451 b.setBorderPainted(false);
452 b.setRequestFocusEnabled(false);
453 return b;
454 }
455
456
457 /**
458 * Creates and return an instance of {@code JButton} that can be used to
459 * collapse the right component in the split pane.
460 *
461 * @return an instance of {@code JButton}
462 */
463 protected JButton createRightOneTouchButton() {
480 blockSize = Math.min(getHeight(), oneTouchSize);
481 xs[0] = blockSize;
482 xs[1] = blockSize << 1;
483 xs[2] = 0;
484 ys[0] = blockSize;
485 ys[1] = ys[2] = 0;
486 }
487 else {
488 blockSize = Math.min(getWidth(), oneTouchSize);
489 xs[0] = xs[2] = 0;
490 xs[1] = blockSize;
491 ys[0] = 0;
492 ys[1] = blockSize;
493 ys[2] = blockSize << 1;
494 }
495 g.setColor(Color.black);
496 g.fillPolygon(xs, ys, 3);
497 }
498 }
499 // Don't want the button to participate in focus traversable.
500 public boolean isFocusTraversable() {
501 return false;
502 }
503 };
504 b.setMinimumSize(new Dimension(oneTouchSize, oneTouchSize));
505 b.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
506 b.setFocusPainted(false);
507 b.setBorderPainted(false);
508 b.setRequestFocusEnabled(false);
509 return b;
510 }
511
512
513 /**
514 * Message to prepare for dragging. This messages the BasicSplitPaneUI
515 * with startDragging.
516 */
517 protected void prepareForDragging() {
518 splitPaneUI.startDragging();
519 }
|
424 xs[0] = blockSize;
425 xs[1] = 0;
426 xs[2] = blockSize << 1;
427 ys[0] = 0;
428 ys[1] = ys[2] = blockSize;
429 g.drawPolygon(xs, ys, 3); // Little trick to make the
430 // arrows of equal size
431 }
432 else {
433 blockSize = Math.min(getWidth(), oneTouchSize);
434 xs[0] = xs[2] = blockSize;
435 xs[1] = 0;
436 ys[0] = 0;
437 ys[1] = blockSize;
438 ys[2] = blockSize << 1;
439 }
440 g.fillPolygon(xs, ys, 3);
441 }
442 }
443 // Don't want the button to participate in focus traversable.
444 @SuppressWarnings("deprecation")
445 public boolean isFocusTraversable() {
446 return false;
447 }
448 };
449 b.setMinimumSize(new Dimension(oneTouchSize, oneTouchSize));
450 b.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
451 b.setFocusPainted(false);
452 b.setBorderPainted(false);
453 b.setRequestFocusEnabled(false);
454 return b;
455 }
456
457
458 /**
459 * Creates and return an instance of {@code JButton} that can be used to
460 * collapse the right component in the split pane.
461 *
462 * @return an instance of {@code JButton}
463 */
464 protected JButton createRightOneTouchButton() {
481 blockSize = Math.min(getHeight(), oneTouchSize);
482 xs[0] = blockSize;
483 xs[1] = blockSize << 1;
484 xs[2] = 0;
485 ys[0] = blockSize;
486 ys[1] = ys[2] = 0;
487 }
488 else {
489 blockSize = Math.min(getWidth(), oneTouchSize);
490 xs[0] = xs[2] = 0;
491 xs[1] = blockSize;
492 ys[0] = 0;
493 ys[1] = blockSize;
494 ys[2] = blockSize << 1;
495 }
496 g.setColor(Color.black);
497 g.fillPolygon(xs, ys, 3);
498 }
499 }
500 // Don't want the button to participate in focus traversable.
501 @SuppressWarnings("deprecation")
502 public boolean isFocusTraversable() {
503 return false;
504 }
505 };
506 b.setMinimumSize(new Dimension(oneTouchSize, oneTouchSize));
507 b.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
508 b.setFocusPainted(false);
509 b.setBorderPainted(false);
510 b.setRequestFocusEnabled(false);
511 return b;
512 }
513
514
515 /**
516 * Message to prepare for dragging. This messages the BasicSplitPaneUI
517 * with startDragging.
518 */
519 protected void prepareForDragging() {
520 splitPaneUI.startDragging();
521 }
|