public void toggleShowMeasurements() { if (showMeasurements.isSelected()) { measurements.setStructures(currentNucId, currentStructureIdx); measurements.setObjects(list.getSelectedValues()); this.container.add(measurements); } else this.container.remove(measurements); core.refreshDisplay(); }
protected HashMap<Integer, ArrayList<Object3DGui>> getSplitSelection() { System.out.println( "get split selection: currenChannels==null?" + (this.currentChannels == null)); if (this.currentChannels == null) return new HashMap<Integer, ArrayList<Object3DGui>>(0); HashMap<Integer, ArrayList<Object3DGui>> res = new HashMap<Integer, ArrayList<Object3DGui>>(this.currentChannels.length); for (ObjectStructure ass : currentChannels) res.put(ass.getIdx(), new ArrayList<Object3DGui>()); for (Object o : list.getSelectedValues()) { Object3DGui o3D = (Object3DGui) (o); int idx = o3D.getChannel().getIdx(); res.get(idx).add(o3D); } return res; }
public void setStructures(ObjectId id, Object[] selectedChannels) { // System.out.println("Set Structures: cell"+id+ " sel channels // length"+selectedChannels.length); this.currentNucId = id; this.currentChannels = new ObjectStructure[selectedChannels.length]; currentStructureIdx = new int[selectedChannels.length]; for (int i = 0; i < selectedChannels.length; i++) { currentChannels[i] = (ObjectStructure) selectedChannels[i]; currentStructureIdx[i] = currentChannels[i].getIdx(); } setSortKeys(); populateObjects(); if (showMeasurements.isSelected()) { measurements.setStructures(id, currentStructureIdx); measurements.setObjects(list.getSelectedValues()); } }
@Override public void valueChanged(ListSelectionEvent lse) { if (lse.getValueIsAdjusting()) { return; } if (populatingObjects || selectingObject || !showObjects.isSelected()) { return; } selectingObject = true; if (measurements != null && showMeasurements.isSelected()) measurements.setObjects(list.getSelectedValues()); try { showRois3D(); } catch (Exception e) { exceptionPrinter.print(e, "", Core.GUIMode); } selectingObject = false; }