MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / showMessage

Method showMessage

ij/src/main/java/ij/gui/Toolbar.java:644–727  ·  view source on GitHub ↗
(int tool)

Source from the content-addressed store, hash-verified

642 }
643
644 private void showMessage(int tool) {
645 if (IJ.statusBarProtected())
646 return;
647 if (tool>=UNUSED && tool<getNumTools() && names[tool]!=null) {
648 String name = names[tool];
649 int index = name.indexOf("Action Tool");
650 if (index!=-1)
651 name = name.replace("Action Tool", "Tool");
652 else {
653 index = name.indexOf("Menu Tool");
654 if (index!=-1)
655 name = name.substring(0, index+4);
656 }
657 IJ.showStatus(name);
658 return;
659 }
660 String hint = " (alt or long click to switch)";
661 String hint2 = " (alt or long click to switch; double click to configure)";
662 switch (tool) {
663 case RECTANGLE:
664 if (rectType==ROUNDED_RECT_ROI)
665 IJ.showStatus("Rectangle, *rounded rect* or rotated rect"+hint);
666 else if (rectType==ROTATED_RECT_ROI)
667 IJ.showStatus("Rectangle, rounded rect or *rotated rect*"+hint);
668 else
669 IJ.showStatus("*Rectangle*, rounded rect or rotated rect"+hint);
670 return;
671 case OVAL:
672 if (ovalType==BRUSH_ROI)
673 IJ.showStatus("Oval, elliptical or *brush* selections"+hint);
674 else if (ovalType==ELLIPSE_ROI)
675 IJ.showStatus("Oval, *elliptical* or brush selections"+hint);
676 else
677 IJ.showStatus("*Oval*, elliptical or brush selections"+hint);
678 return;
679 case POLYGON:
680 IJ.showStatus("Polygon selections");
681 return;
682 case FREEROI:
683 IJ.showStatus("Freehand selections");
684 return;
685 case LINE:
686 if (arrowMode)
687 IJ.showStatus("Straight, segmented or freehand lines, or *arrows*"+hint);
688 else
689 IJ.showStatus("*Straight*, segmented or freehand lines, or arrows"+hint);
690 return;
691 case POLYLINE:
692 IJ.showStatus("Straight, *segmented* or freehand lines, or arrows"+hint);
693 return;
694 case FREELINE:
695 IJ.showStatus("Straight, segmented or *freehand* lines, or arrows"+hint);
696 return;
697 case POINT:
698 if (multiPointMode)
699 IJ.showStatus("*Multi-point* or point"+hint2);
700 else
701 IJ.showStatus("*Point* or multi-point"+hint2);

Callers 5

setTool2Method · 0.95
itemStateChangedMethod · 0.95
mouseMovedMethod · 0.95
createImageIconMethod · 0.45
createImageMethod · 0.45

Calls 12

statusBarProtectedMethod · 0.95
getNumToolsMethod · 0.95
showStatusMethod · 0.95
getVersionMethod · 0.95
is64BitMethod · 0.95
substringMethod · 0.80
getRedMethod · 0.80
getGreenMethod · 0.80
getBlueMethod · 0.80
indexOfMethod · 0.45
replaceMethod · 0.45
getPropertyMethod · 0.45

Tested by

no test coverage detected