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

Method sort

ij/src/main/java/ij/plugin/frame/RoiManager.java:1867–1883  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1865 }
1866
1867 void sort() {
1868 int n = listModel.size();
1869 if (n==0)
1870 return;
1871 String[] labels = new String[n];
1872 for (int i=0; i<n; i++)
1873 labels[i] = (String)listModel.get(i);
1874 int[] indices = Tools.rank(labels);
1875 Roi[] rois2 = getRoisAsArray();
1876 listModel.removeAllElements();
1877 rois.clear();
1878 for (int i=0; i<labels.length; i++) {
1879 listModel.addElement(labels[indices[i]]);
1880 rois.add(rois2[indices[i]]);
1881 }
1882 if (record()) Recorder.record("roiManager", "Sort");
1883 }
1884
1885 void specify() {
1886 try {IJ.run("Specify...");}

Callers 12

actionPerformedMethod · 0.95
runCommandMethod · 0.95
runMethod · 0.45
getImagePropertiesMethod · 0.45
restoreVisiblePanelsMethod · 0.45
showListMethod · 0.45
getNextMethod · 0.45
getAllCommandsMethod · 0.45
getShortcutsMethod · 0.45
medianMethod · 0.45
getSortedMaxPointsMethod · 0.45
getMedianMethod · 0.45

Calls 9

rankMethod · 0.95
getRoisAsArrayMethod · 0.95
recordMethod · 0.95
recordMethod · 0.95
addMethod · 0.65
sizeMethod · 0.45
getMethod · 0.45
clearMethod · 0.45
addElementMethod · 0.45

Tested by

no test coverage detected