bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
private void initComponents(int sizeT, int t) { //Slider tSlider = new JSlider(JSlider.HORIZONTAL, 0, sizeT, t); tSlider.setToolTipText("Move the slider to navigate across time"); tSlider.setMinorTickSpacing(1); tSlider.setMajorTickSpacing(10); tSlider.setPaintTicks(true); Hashtable labelTable = new Hashtable(); labelTable.put(new Integer(0), new JLabel(""+0) ); labelTable.put(new Integer(sizeT), new JLabel(""+sizeT)); tSlider.setLabelTable(labelTable); tSlider.setPaintLabels(true); //textField tField = new JTextField("0", (""+sizeT).length()); tField.setForeground(NavigationPalette.STEELBLUE); tField.setToolTipText("Enter a timepoint"); //buttons play = new JButton(im.getIcon(IconManager.MOVIE)); play.setToolTipText("Play movie from current timepoint"); stop = new JButton(im.getIcon(IconManager.STOP)); stop.setToolTipText("Stop movie"); rewind = new JButton(im.getIcon(IconManager.REWIND)); rewind.setToolTipText("Go to first timepoint"); //Spinner timepoint granularity is 1, so must be stepSize //fps = new JSpinner(new SpinnerNumberModel(12, 0, sizeT, 1)); fps = new JSpinner(new SpinnerNumberModel(12, 12, 12, 1)); editor = new JTextField("12", (""+sizeT).length()); String s = "Select or enter the movie playback rate " + "(frames per second)"; editor.setToolTipText(s); fps.setEditor(editor); }
private void initComponents(int sizeT, int t) { //Slider tSlider = new JSlider(JSlider.HORIZONTAL, 0, sizeT, t); tSlider.setToolTipText("Move the slider to navigate across time"); tSlider.setMinorTickSpacing(1); tSlider.setMajorTickSpacing(10); tSlider.setPaintTicks(true); Hashtable labelTable = new Hashtable(); labelTable.put(new Integer(0), new JLabel(""+0) ); labelTable.put(new Integer(sizeT), new JLabel(""+sizeT)); tSlider.setLabelTable(labelTable); tSlider.setPaintLabels(true); //textField tField = new JTextField("0", (""+sizeT).length()); tField.setForeground(NavigationPalette.STEELBLUE); tField.setToolTipText("Enter a timepoint"); //buttons play = new JButton(im.getIcon(IconManager.MOVIE)); play.setToolTipText("Play movie from current timepoint"); stop = new JButton(im.getIcon(IconManager.STOP)); stop.setToolTipText("Stop movie"); rewind = new JButton(im.getIcon(IconManager.REWIND)); rewind.setToolTipText("Go to first timepoint"); //Spinner timepoint granularity is 1, so must be stepSize //fps = new JSpinner(new SpinnerNumberModel(12, 0, sizeT, 1)); fps = new JSpinner(new SpinnerNumberModel(12, 12, 12, 1)); editor = new JTextField("12", (""+sizeT).length()); String s = "Select or enter the movie playback rate " + "(frames per second)"; editor.setToolTipText(s); fps.setEditor(editor); }
3,238,539
private void initComponents(int sizeT, int t) { //Slider tSlider = new JSlider(JSlider.HORIZONTAL, 0, sizeT, t); tSlider.setToolTipText("Move the slider to navigate across time"); tSlider.setMinorTickSpacing(1); tSlider.setMajorTickSpacing(10); tSlider.setPaintTicks(true); Hashtable labelTable = new Hashtable(); labelTable.put(new Integer(0), new JLabel(""+0) ); labelTable.put(new Integer(sizeT), new JLabel(""+sizeT)); tSlider.setLabelTable(labelTable); tSlider.setPaintLabels(true); //textField tField = new JTextField("0", (""+sizeT).length()); tField.setForeground(NavigationPalette.STEELBLUE); tField.setToolTipText("Enter a timepoint"); //buttons play = new JButton(im.getIcon(IconManager.MOVIE)); play.setToolTipText("Play movie from current timepoint"); stop = new JButton(im.getIcon(IconManager.STOP)); stop.setToolTipText("Stop movie"); rewind = new JButton(im.getIcon(IconManager.REWIND)); rewind.setToolTipText("Go to first timepoint"); //Spinner timepoint granularity is 1, so must be stepSize //fps = new JSpinner(new SpinnerNumberModel(12, 0, sizeT, 1)); fps = new JSpinner(new SpinnerNumberModel(12, 12, 12, 1)); editor = new JTextField("12", (""+sizeT).length()); String s = "Select or enter the movie playback rate " + "(frames per second)"; editor.setToolTipText(s); fps.setEditor(editor); }
private void initComponents(int sizeT, int t) { //Slider tSlider = new JSlider(JSlider.HORIZONTAL, 0, sizeT, t); tSlider.setToolTipText("Move the slider to navigate across time"); tSlider.setMinorTickSpacing(1); tSlider.setMajorTickSpacing(10); tSlider.setPaintTicks(true); Hashtable labelTable = new Hashtable(); labelTable.put(new Integer(0), new JLabel(""+0) ); labelTable.put(new Integer(sizeT), new JLabel(""+sizeT)); tSlider.setLabelTable(labelTable); tSlider.setPaintLabels(true); //textField tField = new JTextField("0", (""+sizeT).length()); tField.setForeground(NavigationPalette.STEELBLUE); tField.setToolTipText("Enter a timepoint"); //buttons play = new JButton(im.getIcon(IconManager.MOVIE)); play.setToolTipText("Play movie from current timepoint"); stop = new JButton(im.getIcon(IconManager.STOP)); stop.setToolTipText("Stop movie"); rewind = new JButton(im.getIcon(IconManager.REWIND)); rewind.setToolTipText("Go to first timepoint"); //Spinner timepoint granularity is 1, so must be stepSize //fps = new JSpinner(new SpinnerNumberModel(12, 0, sizeT, 1)); fps = new JSpinner(new SpinnerNumberModel(12, 12, 12, 1)); editor = new JTextField("12", (""+sizeT).length()); String s = "Select or enter the movie playback rate " + "(frames per second)"; editor.setToolTipText(s); fps.setEditor(editor); }
3,238,540
private void initComponents(int sizeT, int t) { //Slider tSlider = new JSlider(JSlider.HORIZONTAL, 0, sizeT, t); tSlider.setToolTipText("Move the slider to navigate across time"); tSlider.setMinorTickSpacing(1); tSlider.setMajorTickSpacing(10); tSlider.setPaintTicks(true); Hashtable labelTable = new Hashtable(); labelTable.put(new Integer(0), new JLabel(""+0) ); labelTable.put(new Integer(sizeT), new JLabel(""+sizeT)); tSlider.setLabelTable(labelTable); tSlider.setPaintLabels(true); //textField tField = new JTextField("0", (""+sizeT).length()); tField.setForeground(NavigationPalette.STEELBLUE); tField.setToolTipText("Enter a timepoint"); //buttons play = new JButton(im.getIcon(IconManager.MOVIE)); play.setToolTipText("Play movie from current timepoint"); stop = new JButton(im.getIcon(IconManager.STOP)); stop.setToolTipText("Stop movie"); rewind = new JButton(im.getIcon(IconManager.REWIND)); rewind.setToolTipText("Go to first timepoint"); //Spinner timepoint granularity is 1, so must be stepSize //fps = new JSpinner(new SpinnerNumberModel(12, 0, sizeT, 1)); fps = new JSpinner(new SpinnerNumberModel(12, 12, 12, 1)); editor = new JTextField("12", (""+sizeT).length()); String s = "Select or enter the movie playback rate " + "(frames per second)"; editor.setToolTipText(s); fps.setEditor(editor); }
private void initComponents(int sizeT, int t) { //Slider tSlider = new JSlider(JSlider.HORIZONTAL, 0, sizeT, t); tSlider.setToolTipText("Move the slider to navigate across time"); tSlider.setMinorTickSpacing(1); tSlider.setMajorTickSpacing(10); tSlider.setPaintTicks(true); Hashtable labelTable = new Hashtable(); labelTable.put(new Integer(0), new JLabel(""+0) ); labelTable.put(new Integer(sizeT), new JLabel(""+sizeT)); tSlider.setLabelTable(labelTable); tSlider.setPaintLabels(true); //textField tField = new JTextField("0", (""+sizeT).length()); tField.setForeground(NavigationPalette.STEELBLUE); tField.setToolTipText("Enter a timepoint"); //buttons play = new JButton(im.getIcon(IconManager.MOVIE)); play.setToolTipText("Play movie from current timepoint"); stop = new JButton(im.getIcon(IconManager.STOP)); stop.setToolTipText("Stop movie"); rewind = new JButton(im.getIcon(IconManager.REWIND)); rewind.setToolTipText("Go to first timepoint"); //Spinner timepoint granularity is 1, so must be stepSize //fps = new JSpinner(new SpinnerNumberModel(12, 0, sizeT, 1)); fps = new JSpinner(new SpinnerNumberModel(12, 12, 12, 1)); editor = new JTextField("12", (""+sizeT).length()); String s = "Select or enter the movie playback rate " + "(frames per second)"; editor.setToolTipText(s); fps.setEditor(editor); }
3,238,541
private boolean isBrowserVisible(Browser browser) { Component[] comps = tabs.getComponents(); for (int i = 0; i < comps.length; i++) return (comps[i].equals(browser.getUI())); return false; }
private boolean isBrowserVisible(Browser browser) { Component[] comps = tabs.getComponents(); for (int i = 0; i < comps.length; i++) return (comps[i].equals(browser.getUI())); return false; }
3,238,542
public void erase() { erase = true; if (eraseAll) listROIErase.removeAll(listROIErase); eraseAll = false; listROIErase.add(currentROI); int index = currentROI.getIndex(); listROI.remove(currentROI); Iterator i = listROI.iterator(); ROIShape roi; int j; while (i.hasNext()) { roi = (ROIShape) i.next(); j = roi.getIndex(); if (j > index) { j--; roi.setIndex(j); roi.setText("#"+j); } } //Select the last ROI if any left. int n = listROI.size()-1; if (n >= 0) { currentROI = (ROIShape) listROI.get(n); currentShape = currentROI.getShape(); view.setIndexSelected(currentROI.getIndex()); } else { currentROI = null; currentShape = null; view.erase(); } }
public void erase() { erase = true; if (eraseAll) listROIErase.removeAll(listROIErase); eraseAll = false; listROIErase.add(currentROI); int index = currentROI.getIndex(); listROI.remove(currentROI); Iterator i = listROI.iterator(); ROIShape roi; int j; while (i.hasNext()) { roi = (ROIShape) i.next(); j = roi.getIndex(); if (j > index) { j--; roi.setIndex(j); roi.setLabel("#"+j); } } //Select the last ROI if any left. int n = listROI.size()-1; if (n >= 0) { currentROI = (ROIShape) listROI.get(n); currentShape = currentROI.getShape(); view.setIndexSelected(currentROI.getIndex()); } else { currentROI = null; currentShape = null; view.erase(); } }
3,238,543
public void erase() { erase = true; if (eraseAll) listROIErase.removeAll(listROIErase); eraseAll = false; listROIErase.add(currentROI); int index = currentROI.getIndex(); listROI.remove(currentROI); Iterator i = listROI.iterator(); ROIShape roi; int j; while (i.hasNext()) { roi = (ROIShape) i.next(); j = roi.getIndex(); if (j > index) { j--; roi.setIndex(j); roi.setText("#"+j); } } //Select the last ROI if any left. int n = listROI.size()-1; if (n >= 0) { currentROI = (ROIShape) listROI.get(n); currentShape = currentROI.getShape(); view.setIndexSelected(currentROI.getIndex()); } else { currentROI = null; currentShape = null; view.erase(); } }
publicvoiderase(){erase=true;if(eraseAll)listROIErase.removeAll(listROIErase);eraseAll=false;listROIErase.add(currentROI);intindex=currentROI.getIndex();listROI.remove(currentROI);Iteratori=listROI.iterator();ROIShaperoi;intj;while(i.hasNext()){roi=(ROIShape)i.next();j=roi.getIndex();if(j>index){j--;roi.setIndex(j);roi.setText("#"+j);}}//SelectthelastROIifanyleft.intn=listROI.size()-1;if(n>=0){currentROI=(ROIShape)listROI.get(n);currentShape=currentROI.getShape();view.setIndexSelected(currentROI.getIndex());}else{currentROI=null;currentShape=null;view.erase();}}
3,238,544
private void handleMousePressed(Point p) { Iterator i = listROI.iterator(); ROIShape roi; Shape s; while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); if (s.contains(p)) { currentROI = roi; currentShape = s; Rectangle r = s.getBounds(); xControl = r.x; yControl = r.y; view.setIndexSelected(roi.getIndex()); } } }
private void handleMousePressed(Point p, int clickCount) { Iterator i = listROI.iterator(); ROIShape roi; Shape s; while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); if (s.contains(p)) { currentROI = roi; currentShape = s; Rectangle r = s.getBounds(); xControl = r.x; yControl = r.y; view.setIndexSelected(roi.getIndex()); } } }
3,238,545
public void mouseMoved(MouseEvent e) {}
public void mouseMoved(MouseEvent e) {}
3,238,547
public void mousePressed(MouseEvent e) { Point p = new Point(e.getPoint()); if (!dragging && drawingArea.contains(p)) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; handleMousePressed(p); } }
public void mousePressed(MouseEvent e) { Point p = new Point(e.getPoint()); if (!dragging && drawingArea.contains(p)) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; handleMousePressed(p); } }
3,238,548
private void move(Point p) { int diffX = p.x-anchor.x, diffY = p.y-anchor.y; Rectangle r = currentShape.getBounds(); int x = xControl+diffX, y = yControl+diffY, w = r.width, h = r.height; if (areaValid(x, y, w, h)) { ROIFactory.setShapeBounds(currentShape, currentROI.getShapeType(), x , y, w, h); moving = true; view.draw(currentShape); } }
private void move(Point p) { int diffX = p.x-anchor.x, diffY = p.y-anchor.y; Rectangle r = currentShape.getBounds(); int x = xControl+diffX, y = yControl+diffY, w = r.width, h = r.height; if (areaValid(x, y, w, h)) { ROIFactory.setShapeBounds(currentShape, currentROI.getShapeType(), x , y, w, h); moving = true; view.moveAndDraw(currentShape); } }
3,238,549
private void undoEraseAll(ROIShape roi) { int n = listROIErase.size(); Iterator i = listROI.iterator(); ROIShape r; while (i.hasNext()) { r = (ROIShape) i.next(); r.setIndex(n); r.setText("#"+n); n++; } listROI.addAll(listROIErase); listROIErase.removeAll(listROIErase); currentROI = roi; currentShape = roi.getShape(); eraseAll = false; view.setIndexSelected(roi.getIndex()); }
private void undoEraseAll(ROIShape roi) { int n = listROIErase.size(); Iterator i = listROI.iterator(); ROIShape r; while (i.hasNext()) { r = (ROIShape) i.next(); r.setIndex(n); r.setLabel("#"+n); n++; } listROI.addAll(listROIErase); listROIErase.removeAll(listROIErase); currentROI = roi; currentShape = roi.getShape(); eraseAll = false; view.setIndexSelected(roi.getIndex()); }
3,238,550
private void undoEraseOne(ROIShape roi) { int index = roi.getIndex(); Iterator i = listROI.iterator(); ROIShape r; int j; while (i.hasNext()) { r = (ROIShape) i.next(); j = r.getIndex(); if (j >= index) { j++; r.setIndex(j); r.setText("#"+j); } } listROI.add(roi); listROIErase.remove(roi); currentROI = roi; currentShape = roi.getShape(); if (listROIErase.size() == 0) erase = false; view.setIndexSelected(index); }
private void undoEraseOne(ROIShape roi) { int index = roi.getIndex(); Iterator i = listROI.iterator(); ROIShape r; int j; while (i.hasNext()) { r = (ROIShape) i.next(); j = r.getIndex(); if (j >= index) { j++; r.setIndex(j); r.setLabel("#"+j); } } listROI.add(roi); listROIErase.remove(roi); currentROI = roi; currentShape = roi.getShape(); if (listROIErase.size() == 0) erase = false; view.setIndexSelected(index); }
3,238,551
public static boolean onlyLockChanged( SessionImplementor session, EntityPersister persister, IObject entity, Object[] state, String[] names ) { Object[] current = persister.getPropertyValues(entity, EntityMode.POJO); int[] dirty = persister.findDirty( state, current, entity, session); if ( dirty != null ) { if ( dirty.length > 1 ) return false; if ( ! DETAILS.equals( names[dirty[0]] )) return false; Details new_d = getDetails(current, names); Details old_d = getDetails(state, names); // have to handle nulls because of ticket:307 if (old_d == null || new_d == null) { if (new_d == null && old_d == null) { throw new InternalException( "Both details null. Can't have changed!"); } else if (new_d == null) { // don't worry about it. return true; } else { // then new_d != null. What's up? if (new_d.getPermissions() != null && new_d.getPermissions().isSet(Flag.SOFT)) return true; return false; } } else { if ( ! onlyPermissionsChanged(new_d, old_d)) return false; Permissions new_p = new Permissions( new_d.getPermissions() ); Permissions old_p = new Permissions( old_d.getPermissions() ); old_p.set( Flag.LOCKED ); return new_p.identical( old_p ); } } return false; }
public static boolean onlyLockChanged( SessionImplementor session, EntityPersister persister, IObject entity, Object[] state, String[] names ) { Object[] current = persister.getPropertyValues(entity, EntityMode.POJO); int[] dirty = persister.findDirty( state, current, entity, session); if ( dirty != null ) { if ( dirty.length > 1 ) return false; if ( ! DETAILS.equals( names[dirty[0]] )) return false; Details new_d = getDetails(current, names); Details old_d = getDetails(state, names); // have to handle nulls because of ticket:307 if (new_d == null) { if (new_d == null && old_d == null) { throw new InternalException( "Both details null. Can't have changed!"); } else if (new_d == null) { // don't worry about it. return true; } else { // then new_d != null. What's up? if (new_d.getPermissions() != null && new_d.getPermissions().isSet(Flag.SOFT)) return true; return false; } } else { if ( ! onlyPermissionsChanged(new_d, old_d)) return false; Permissions new_p = new Permissions( new_d.getPermissions() ); Permissions old_p = new Permissions( old_d.getPermissions() ); old_p.set( Flag.LOCKED ); return new_p.identical( old_p ); } } return false; }
3,238,552
public static boolean onlyLockChanged( SessionImplementor session, EntityPersister persister, IObject entity, Object[] state, String[] names ) { Object[] current = persister.getPropertyValues(entity, EntityMode.POJO); int[] dirty = persister.findDirty( state, current, entity, session); if ( dirty != null ) { if ( dirty.length > 1 ) return false; if ( ! DETAILS.equals( names[dirty[0]] )) return false; Details new_d = getDetails(current, names); Details old_d = getDetails(state, names); // have to handle nulls because of ticket:307 if (old_d == null || new_d == null) { if (new_d == null && old_d == null) { throw new InternalException( "Both details null. Can't have changed!"); } else if (new_d == null) { // don't worry about it. return true; } else { // then new_d != null. What's up? if (new_d.getPermissions() != null && new_d.getPermissions().isSet(Flag.SOFT)) return true; return false; } } else { if ( ! onlyPermissionsChanged(new_d, old_d)) return false; Permissions new_p = new Permissions( new_d.getPermissions() ); Permissions old_p = new Permissions( old_d.getPermissions() ); old_p.set( Flag.LOCKED ); return new_p.identical( old_p ); } } return false; }
public static boolean onlyLockChanged( SessionImplementor session, EntityPersister persister, IObject entity, Object[] state, String[] names ) { Object[] current = persister.getPropertyValues(entity, EntityMode.POJO); int[] dirty = persister.findDirty( state, current, entity, session); if ( dirty != null ) { if ( dirty.length > 1 ) return false; if ( ! DETAILS.equals( names[dirty[0]] )) return false; Details new_d = getDetails(current, names); Details old_d = getDetails(state, names); // have to handle nulls because of ticket:307 if (old_d == null || new_d == null) { throw new InternalException( "New details null. Not currently handled."); } else if (old_d == null) { if (new_d.getOwner()!=null||new_d.getGroup()!=null|| new_d.getCreationEvent()!=null|| new_d.getUpdateEvent()!=null) { throw new InternalException( "Both details null. Can't have changed!"); } else if (new_d == null) { // don't worry about it. return true; } else { // then new_d != null. What's up? if (new_d.getPermissions() != null && new_d.getPermissions().isSet(Flag.SOFT)) return true; return false; } } else { if ( ! onlyPermissionsChanged(new_d, old_d)) return false; Permissions new_p = new Permissions( new_d.getPermissions() ); Permissions old_p = new Permissions( old_d.getPermissions() ); old_p.set( Flag.LOCKED ); return new_p.identical( old_p ); } } return false; }
3,238,553
public static boolean onlyLockChanged( SessionImplementor session, EntityPersister persister, IObject entity, Object[] state, String[] names ) { Object[] current = persister.getPropertyValues(entity, EntityMode.POJO); int[] dirty = persister.findDirty( state, current, entity, session); if ( dirty != null ) { if ( dirty.length > 1 ) return false; if ( ! DETAILS.equals( names[dirty[0]] )) return false; Details new_d = getDetails(current, names); Details old_d = getDetails(state, names); // have to handle nulls because of ticket:307 if (old_d == null || new_d == null) { if (new_d == null && old_d == null) { throw new InternalException( "Both details null. Can't have changed!"); } else if (new_d == null) { // don't worry about it. return true; } else { // then new_d != null. What's up? if (new_d.getPermissions() != null && new_d.getPermissions().isSet(Flag.SOFT)) return true; return false; } } else { if ( ! onlyPermissionsChanged(new_d, old_d)) return false; Permissions new_p = new Permissions( new_d.getPermissions() ); Permissions old_p = new Permissions( old_d.getPermissions() ); old_p.set( Flag.LOCKED ); return new_p.identical( old_p ); } } return false; }
public static boolean onlyLockChanged( SessionImplementor session, EntityPersister persister, IObject entity, Object[] state, String[] names ) { Object[] current = persister.getPropertyValues(entity, EntityMode.POJO); int[] dirty = persister.findDirty( state, current, entity, session); if ( dirty != null ) { if ( dirty.length > 1 ) return false; if ( ! DETAILS.equals( names[dirty[0]] )) return false; Details new_d = getDetails(current, names); Details old_d = getDetails(state, names); // have to handle nulls because of ticket:307 if (old_d == null || new_d == null) { if (new_d == null && old_d == null) { throw new InternalException( "Both details null. Can't have changed!"); } else if (new_d == null) { // don't worry about it. return true; } else { // then new_d != null. What's up? if (new_d.getPermissions() != null && new_d.getPermissions().isSet(Flag.SOFT)) return true; return false; } } else { if ( ! onlyPermissionsChanged(new_d, old_d)) return false; Permissions new_p = new Permissions( new_d.getPermissions() ); Permissions old_p = new Permissions( old_d.getPermissions() ); old_p.set( Flag.LOCKED ); return new_p.identical( old_p ); } } return false; }
3,238,554
public static boolean onlyLockChanged( SessionImplementor session, EntityPersister persister, IObject entity, Object[] state, String[] names ) { Object[] current = persister.getPropertyValues(entity, EntityMode.POJO); int[] dirty = persister.findDirty( state, current, entity, session); if ( dirty != null ) { if ( dirty.length > 1 ) return false; if ( ! DETAILS.equals( names[dirty[0]] )) return false; Details new_d = getDetails(current, names); Details old_d = getDetails(state, names); // have to handle nulls because of ticket:307 if (old_d == null || new_d == null) { if (new_d == null && old_d == null) { throw new InternalException( "Both details null. Can't have changed!"); } else if (new_d == null) { // don't worry about it. return true; } else { // then new_d != null. What's up? if (new_d.getPermissions() != null && new_d.getPermissions().isSet(Flag.SOFT)) return true; return false; } } else { if ( ! onlyPermissionsChanged(new_d, old_d)) return false; Permissions new_p = new Permissions( new_d.getPermissions() ); Permissions old_p = new Permissions( old_d.getPermissions() ); old_p.set( Flag.LOCKED ); return new_p.identical( old_p ); } } return false; }
public static boolean onlyLockChanged( SessionImplementor session, EntityPersister persister, IObject entity, Object[] state, String[] names ) { Object[] current = persister.getPropertyValues(entity, EntityMode.POJO); int[] dirty = persister.findDirty( state, current, entity, session); if ( dirty != null ) { if ( dirty.length > 1 ) return false; if ( ! DETAILS.equals( names[dirty[0]] )) return false; Details new_d = getDetails(current, names); Details old_d = getDetails(state, names); // have to handle nulls because of ticket:307 if (old_d == null || new_d == null) { if (new_d == null && old_d == null) { throw new InternalException( "Both details null. Can't have changed!"); } else if (new_d == null) { // don't worry about it. return true; } else { // then new_d != null. What's up? if (new_d.getPermissions() != null && new_d.getPermissions().isSet(Flag.SOFT)) return true; return false; } } else { if ( ! onlyPermissionsChanged(new_d, old_d)) return false; Permissions new_p = new Permissions( new_d.getPermissions() ); Permissions old_p = new Permissions( old_d.getPermissions() ); old_p.set( Flag.LOCKED ); return new_p.identical( old_p ); } } return false; }
3,238,555
public static boolean onlyLockChanged( SessionImplementor session, EntityPersister persister, IObject entity, Object[] state, String[] names ) { Object[] current = persister.getPropertyValues(entity, EntityMode.POJO); int[] dirty = persister.findDirty( state, current, entity, session); if ( dirty != null ) { if ( dirty.length > 1 ) return false; if ( ! DETAILS.equals( names[dirty[0]] )) return false; Details new_d = getDetails(current, names); Details old_d = getDetails(state, names); // have to handle nulls because of ticket:307 if (old_d == null || new_d == null) { if (new_d == null && old_d == null) { throw new InternalException( "Both details null. Can't have changed!"); } else if (new_d == null) { // don't worry about it. return true; } else { // then new_d != null. What's up? if (new_d.getPermissions() != null && new_d.getPermissions().isSet(Flag.SOFT)) return true; return false; } } else { if ( ! onlyPermissionsChanged(new_d, old_d)) return false; Permissions new_p = new Permissions( new_d.getPermissions() ); Permissions old_p = new Permissions( old_d.getPermissions() ); old_p.set( Flag.LOCKED ); return new_p.identical( old_p ); } } return false; }
public static boolean onlyLockChanged( SessionImplementor session, EntityPersister persister, IObject entity, Object[] state, String[] names ) { Object[] current = persister.getPropertyValues(entity, EntityMode.POJO); int[] dirty = persister.findDirty( state, current, entity, session); if ( dirty != null ) { if ( dirty.length > 1 ) return false; if ( ! DETAILS.equals( names[dirty[0]] )) return false; Details new_d = getDetails(current, names); Details old_d = getDetails(state, names); // have to handle nulls because of ticket:307 if (old_d == null || new_d == null) { if (new_d == null && old_d == null) { throw new InternalException( "Both details null. Can't have changed!"); } else if (new_d == null) { // don't worry about it. return true; } else { // then new_d != null. What's up? if (new_d.getPermissions() != null && new_d.getPermissions().isSet(Flag.SOFT)) return true; return false; } } else { if ( ! onlyPermissionsChanged(new_d, old_d)) return false; Permissions new_p = new Permissions( new_d.getPermissions() ); Permissions old_p = new Permissions( old_d.getPermissions() ); old_p.set( Flag.LOCKED ); return new_p.identical( old_p ); } } return false; }
3,238,556
public void layoutContents() { // the current chain LayoutChainData chain; PaletteChainView view; Collection chains = dataManager.getChains(); ArrayList views = buildChainViews(chains); int num = views.size(); // The display should be roughly square, // in terms of the number of rows vs. # of columns rowSize = (int) Math.floor(Math.sqrt(num)); count=0; // draw each of them. Iterator iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); ChainBox box = buildChain(view); if (box != null) { placeChain(box); } } if (x > maxRowWidth) { maxRowWidth = x; } // fix up the last row. row.setHeight(rowHeight); rows.add(row); adjustSizes(); }
publicif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } voidif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } layoutContents()if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } { //if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } theif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } currentif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } chain LayoutChainDataif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } chain; PaletteChainViewif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } view; Collectionif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } chainsif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } =if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } dataManager.getChains(); ArrayListif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } viewsif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } =if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } buildChainViews(chains); intif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } numif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } =if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } views.size(); //if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } Theif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } displayif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } shouldif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } beif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } roughlyif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } square,if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } //if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } inif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } termsif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } ofif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } theif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } numberif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } ofif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } rowsif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } vs.if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } #if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } ofif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } columns rowSizeif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } =if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } (int)if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } Math.floor(Math.sqrt(num)); count=0; //if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } drawif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } eachif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } ofif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } them. Iteratorif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } iterif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } =if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } views.iterator(); whileif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } (iter.hasNext())if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } { viewif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } =if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } (PaletteChainView)if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } iter.next(); ChainBoxif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } boxif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } =if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } buildChain(view); ifif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } (boxif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } !=if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } null)if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } { placeChain(box); } } ifif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } (xif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } >if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } maxRowWidth)if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } { maxRowWidthif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } =if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } x; } //if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } fixif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } upif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } theif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } lastif (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } row. row.setHeight(rowHeight); rows.add(row); adjustSizes(); }
3,238,558
public void layoutContents() { // the current chain LayoutChainData chain; PaletteChainView view; Collection chains = dataManager.getChains(); ArrayList views = buildChainViews(chains); int num = views.size(); // The display should be roughly square, // in terms of the number of rows vs. # of columns rowSize = (int) Math.floor(Math.sqrt(num)); count=0; // draw each of them. Iterator iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); ChainBox box = buildChain(view); if (box != null) { placeChain(box); } } if (x > maxRowWidth) { maxRowWidth = x; } // fix up the last row. row.setHeight(rowHeight); rows.add(row); adjustSizes(); }
public void layoutContents() { // the current chain LayoutChainData chain; PaletteChainView view; Collection chains = dataManager.getChains(); ArrayList views = buildChainViews(chains); int num = views.size(); // The display should be roughly square, // in terms of the number of rows vs. # of columns rowSize = (int) Math.floor(Math.sqrt(num)); count=0; // draw each of them. Iterator iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); ChainBox box = buildChain(view); if (box != null) { placeChain(box); } } if (x > maxRowWidth) { maxRowWidth = x; } // fix up the last row. row.setHeight(rowHeight); rows.add(row); adjustSizes(); }
3,238,559
private void scaleAreas(ArrayList views) { PaletteChainView view; Collections.sort(views); /* // get smallest area PaletteChainView smallest= (PaletteChainView) views.get(0); double logSmallestArea = Math.log(smallest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = 3*logArea/logSmallestArea; newArea = smallest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); }*/ // get largest area PaletteChainView largest= (PaletteChainView) views.get(views.size()-1); System.err.println("largest chain is "+largest.getChain().getName()+ ", area is "+largest.getArea()); System.err.println("largest width is "+largest.getWidth()+","+largest.getHeight()); double logLargestArea = Math.log(largest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = logArea/logLargestArea; newArea = largest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("original area is "+view.getArea()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); System.err.println("new area is "+newArea); } }
private void scaleAreas(ArrayList views) { PaletteChainView view; Collections.sort(views); /* // get smallest area PaletteChainView smallest= (PaletteChainView) views.get(0); double logSmallestArea = Math.log(smallest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = 3*logArea/logSmallestArea; newArea = smallest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); }*/ // get largest area PaletteChainView largest= (PaletteChainView) views.get(views.size()-1); System.err.println("largest chain is "+largest.getChain().getName()+ ", area is "+largest.getArea()); System.err.println("largest width is "+largest.getWidth()+","+largest.getHeight()); double logLargestArea = Math.log(largest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = logArea/logLargestArea; newArea = largest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("original area is "+view.getArea()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); System.err.println("new area is "+newArea); } }
3,238,561
private void scaleAreas(ArrayList views) { PaletteChainView view; Collections.sort(views); /* // get smallest area PaletteChainView smallest= (PaletteChainView) views.get(0); double logSmallestArea = Math.log(smallest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = 3*logArea/logSmallestArea; newArea = smallest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); }*/ // get largest area PaletteChainView largest= (PaletteChainView) views.get(views.size()-1); System.err.println("largest chain is "+largest.getChain().getName()+ ", area is "+largest.getArea()); System.err.println("largest width is "+largest.getWidth()+","+largest.getHeight()); double logLargestArea = Math.log(largest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = logArea/logLargestArea; newArea = largest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("original area is "+view.getArea()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); System.err.println("new area is "+newArea); } }
private void scaleAreas(ArrayList views) { PaletteChainView view; Collections.sort(views); /* // get smallest area PaletteChainView smallest= (PaletteChainView) views.get(0); double logSmallestArea = Math.log(smallest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = 3*logArea/logSmallestArea; newArea = smallest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); }*/ // get largest area PaletteChainView largest= (PaletteChainView) views.get(views.size()-1); System.err.println("largest chain is "+largest.getChain().getName()+ ", area is "+largest.getArea()); System.err.println("largest width is "+largest.getWidth()+","+largest.getHeight()); double logLargestArea = Math.log(largest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = logArea/logLargestArea; newArea = largest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("original area is "+view.getArea()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); System.err.println("new area is "+newArea); } }
3,238,562
private void scaleAreas(ArrayList views) { PaletteChainView view; Collections.sort(views); /* // get smallest area PaletteChainView smallest= (PaletteChainView) views.get(0); double logSmallestArea = Math.log(smallest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = 3*logArea/logSmallestArea; newArea = smallest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); }*/ // get largest area PaletteChainView largest= (PaletteChainView) views.get(views.size()-1); System.err.println("largest chain is "+largest.getChain().getName()+ ", area is "+largest.getArea()); System.err.println("largest width is "+largest.getWidth()+","+largest.getHeight()); double logLargestArea = Math.log(largest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = logArea/logLargestArea; newArea = largest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("original area is "+view.getArea()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); System.err.println("new area is "+newArea); } }
private void scaleAreas(ArrayList views) { PaletteChainView view; Collections.sort(views); /* // get smallest area PaletteChainView smallest= (PaletteChainView) views.get(0); double logSmallestArea = Math.log(smallest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = 3*logArea/logSmallestArea; newArea = smallest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); }*/ // get largest area PaletteChainView largest= (PaletteChainView) views.get(views.size()-1); System.err.println("largest chain is "+largest.getChain().getName()+ ", area is "+largest.getArea()); System.err.println("largest width is "+largest.getWidth()+","+largest.getHeight()); double logLargestArea = Math.log(largest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = logArea/logLargestArea; newArea = largest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("original area is "+view.getArea()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); System.err.println("new area is "+newArea); } }
3,238,563
public static RubyString newInstance(IRubyObject recv, IRubyObject[] args) { RubyString newString = newString(recv.getRuntime(), ""); newString.setRubyClass((RubyClass) recv); newString.callInit(args); return newString; }
public static RubyString newInstance(IRubyObject recv, IRubyObject[] args) { RubyString newString = newString(recv.getRuntime(), ""); newString.setRubyClass((RubyClass) recv); newString.callInit(args); return newString; }
3,238,564
public static RubyString stringValue(IRubyObject anObject) { if (anObject instanceof RubyString) { return (RubyString) anObject; } else { return (RubyString) anObject.toRubyObject().convertType(RubyString.class, "String", "to_str"); } }
public static RubyString stringValue(IRubyObject anObject) { if (anObject instanceof RubyString) { return (RubyString) anObject; } else { return (RubyString) anObject.toRubyObject().convertType(RubyString.class, "String", "to_str"); } }
3,238,565
public static RubyString unmarshalFrom(UnmarshalStream input) throws java.io.IOException { return RubyString.newString(input.getRuby(), input.unmarshalString()); }
public static RubyString unmarshalFrom(UnmarshalStream input) throws java.io.IOException { return RubyString.newString(input.getRuby(), input.unmarshalString()); }
3,238,566
public void loadScript( RubyString scriptName, RubyString source, boolean wrap) { RubyObject self = ruby.getRubyTopSelf(); CRefNode savedCRef = ruby.getCRef(); // TMP_PROTECT; if (wrap && ruby.getSecurityLevel() >= 4) { // Check_Type(fname, T_STRING); } else { // Check_SafeStr(fname); } // volatile ID last_func; // ruby_errinfo = Qnil; /* ensure */ RubyVarmap.push(ruby); ruby.pushClass(); RubyModule wrapper = ruby.getWrapper(); ruby.setCRef(ruby.getTopCRef()); if (!wrap) { ruby.secure(4); /* should alter global state */ ruby.setRubyClass(ruby.getClasses().getObjectClass()); ruby.setWrapper(null); } else { /* load in anonymous module as toplevel */ ruby.setWrapper(RubyModule.m_newModule(ruby)); ruby.setRubyClass(ruby.getWrapper()); self = ruby.getRubyTopSelf().m_clone(); self.extendObject(ruby.getRubyClass()); ruby.getCRef().push(ruby.getWrapper()); } ruby.getRubyFrame().push(); ruby.getRubyFrame().setLastFunc(null); ruby.getRubyFrame().setLastClass(null); ruby.getRubyFrame().setSelf(self); ruby.getRubyFrame().setCbase(new CRefNode(ruby.getRubyClass(), null)); ruby.getRubyScope().push(); /* default visibility is private at loading toplevel */ ruby.setActMethodScope(Constants.SCOPE_PRIVATE); RubyId last_func = ruby.getRubyFrame().getLastFunc(); try { // RubyId last_func = ruby.getRubyFrame().getLastFunc(); // DEFER_INTS; ruby.setInEval(ruby.getInEval() + 1); ruby.getRubyParser().compileString(scriptName.getValue(), source, 0); // --- ruby.setInEval(ruby.getInEval() - 1); self.evalNode(ruby.getParserHelper().getEvalTree()); } catch (Exception excptn) { excptn.printStackTrace(getErrorStream()); } finally { ruby.getRubyFrame().setLastFunc(last_func); /*if (ruby.getRubyScope().getFlags() == SCOPE_ALLOCA && ruby.getRubyClass() == ruby.getClasses().getObjectClass()) { if (ruby_scope->local_tbl) free(ruby_scope->local_tbl); }*/ ruby.setCRef(savedCRef); ruby.getRubyScope().pop(); ruby.getRubyFrame().pop(); ruby.popClass(); RubyVarmap.pop(ruby); ruby.setWrapper(wrapper); } /*if (ruby_nerrs > 0) { ruby_nerrs = 0; rb_exc_raise(ruby_errinfo); }*/ }
public void loadScript( RubyString scriptName, RubyString source, boolean wrap) { RubyObject self = ruby.getRubyTopSelf(); CRefNode savedCRef = ruby.getCRef(); // TMP_PROTECT; if (wrap && ruby.getSecurityLevel() >= 4) { // Check_Type(fname, T_STRING); } else { // Check_SafeStr(fname); } // volatile ID last_func; // ruby_errinfo = Qnil; /* ensure */ RubyVarmap.push(ruby); ruby.pushClass(); RubyModule wrapper = ruby.getWrapper(); ruby.setCRef(ruby.getTopCRef()); if (!wrap) { ruby.secure(4); /* should alter global state */ ruby.setRubyClass(ruby.getClasses().getObjectClass()); ruby.setWrapper(null); } else { /* load in anonymous module as toplevel */ ruby.setWrapper(RubyModule.m_newModule(ruby)); ruby.setRubyClass(ruby.getWrapper()); self = ruby.getRubyTopSelf().m_clone(); self.extendObject(ruby.getRubyClass()); ruby.getCRef().push(ruby.getWrapper()); } ruby.getRubyFrame().push(); ruby.getRubyFrame().setLastFunc(null); ruby.getRubyFrame().setLastClass(null); ruby.getRubyFrame().setSelf(self); ruby.getRubyFrame().setCbase(new CRefNode(ruby.getRubyClass(), null)); ruby.getRubyScope().push(); /* default visibility is private at loading toplevel */ ruby.setActMethodScope(Constants.SCOPE_PRIVATE); RubyId last_func = ruby.getRubyFrame().getLastFunc(); try { // RubyId last_func = ruby.getRubyFrame().getLastFunc(); // DEFER_INTS; ruby.setInEval(ruby.getInEval() + 1); ruby.getRubyParser().compileString(scriptName.getValue(), source, 0); // --- ruby.setInEval(ruby.getInEval() - 1); self.evalNode(ruby.getParserHelper().getEvalTree()); } catch (Exception excptn) { excptn.printStackTrace(getErrorStream()); } finally { ruby.getRubyFrame().setLastFunc(last_func); /*if (ruby.getRubyScope().getFlags() == SCOPE_ALLOCA && ruby.getRubyClass() == ruby.getClasses().getObjectClass()) { if (ruby_scope->local_tbl) free(ruby_scope->local_tbl); }*/ ruby.setCRef(savedCRef); ruby.getRubyScope().pop(); ruby.getRubyFrame().pop(); ruby.popClass(); RubyVarmap.pop(ruby); ruby.setWrapper(wrapper); } /*if (ruby_nerrs > 0) { ruby_nerrs = 0; rb_exc_raise(ruby_errinfo); }*/ }
3,238,567
public static RubyModule createKernelModule(Ruby ruby) { RubyModule kernelModule = ruby.defineModule("Kernel"); kernelModule.defineMethod("open", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "open")); kernelModule.defineMethod("format", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "sprintf")); kernelModule.defineMethod("gets", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "gets")); kernelModule.defineMethod("p", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "p")); kernelModule.defineMethod("print", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "print")); kernelModule.defineMethod("printf", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "printf")); kernelModule.defineMethod("puts", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "puts")); kernelModule.defineMethod("readline", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "readline")); kernelModule.defineMethod("readlines", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "readlines")); kernelModule.defineMethod("sprintf", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "sprintf")); kernelModule.defineMethod("gsub!", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "gsub_bang")); kernelModule.defineMethod("gsub", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "gsub")); kernelModule.defineMethod("sub!", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "sub_bang")); kernelModule.defineMethod("sub", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "sub")); kernelModule.defineMethod("chop!", CallbackFactory.getSingletonMethod(RubyKernel.class, "chop_bang")); kernelModule.defineMethod("chop", CallbackFactory.getSingletonMethod(RubyKernel.class, "chop")); kernelModule.defineMethod("chomp!", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "chomp_bang")); kernelModule.defineMethod("chomp", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "chomp")); kernelModule.defineMethod("split", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "split")); kernelModule.defineMethod("scan", CallbackFactory.getSingletonMethod(RubyKernel.class, "scan", RubyObject.class)); kernelModule.defineMethod("load", CallbackFactory.getSingletonMethod(RubyKernel.class, "load", RubyString.class)); //kernelModule.defineMethod("autoload", CallbackFactory.getSingletonMethod(RubyKernel.class, "autoload", RubyString.class)); kernelModule.defineMethod("raise", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "raise")); kernelModule.defineMethod("require", CallbackFactory.getSingletonMethod(RubyKernel.class, "require", RubyString.class)); kernelModule.defineMethod("global_variables", CallbackFactory.getSingletonMethod(RubyKernel.class, "global_variables")); kernelModule.defineMethod("local_variables", CallbackFactory.getSingletonMethod(RubyKernel.class, "local_variables")); kernelModule.defineMethod("block_given?", CallbackFactory.getSingletonMethod(RubyKernel.class, "block_given")); kernelModule.defineMethod("iterator?", CallbackFactory.getSingletonMethod(RubyKernel.class, "block_given")); kernelModule.defineMethod("proc", CallbackFactory.getSingletonMethod(RubyKernel.class, "proc")); kernelModule.defineMethod("loop", CallbackFactory.getSingletonMethod(RubyKernel.class, "loop")); kernelModule.defineMethod("eval", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "eval", RubyString.class)); kernelModule.defineMethod("caller", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "caller")); kernelModule.defineMethod("catch", CallbackFactory.getSingletonMethod(RubyKernel.class, "rbCatch", RubyObject.class)); kernelModule.defineMethod("throw", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "rbThrow", RubyObject.class)); kernelModule.defineMethod("singleton_method_added", CallbackFactory.getNilMethod()); kernelModule.defineMethod("set_trace_func", CallbackFactory.getSingletonMethod(RubyKernel.class, "set_trace_func", RubyObject.class)); kernelModule.defineMethod("`", CallbackFactory.getSingletonMethod(RubyKernel.class, "backquote", RubyString.class)); kernelModule.defineMethod("exit", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "exit")); kernelModule.defineMethod("srand", CallbackFactory.getSingletonMethod(RubyKernel.class, "srand", RubyObject.class)); kernelModule.defineMethod("rand", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "rand")); kernelModule.defineAlias("lambda", "proc"); return kernelModule; }
public static RubyModule createKernelModule(Ruby ruby) { RubyModule kernelModule = ruby.defineModule("Kernel"); kernelModule.defineMethod("open", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "open")); kernelModule.defineMethod("format", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "sprintf")); kernelModule.defineMethod("gets", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "gets")); kernelModule.defineMethod("p", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "p")); kernelModule.defineMethod("print", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "print")); kernelModule.defineMethod("printf", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "printf")); kernelModule.defineMethod("puts", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "puts")); kernelModule.defineMethod("readline", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "readline")); kernelModule.defineMethod("readlines", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "readlines")); kernelModule.defineMethod("sprintf", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "sprintf")); kernelModule.defineMethod("gsub!", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "gsub_bang")); kernelModule.defineMethod("gsub", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "gsub")); kernelModule.defineMethod("sub!", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "sub_bang")); kernelModule.defineMethod("sub", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "sub")); kernelModule.defineMethod("chop!", CallbackFactory.getSingletonMethod(RubyKernel.class, "chop_bang")); kernelModule.defineMethod("chop", CallbackFactory.getSingletonMethod(RubyKernel.class, "chop")); kernelModule.defineMethod("chomp!", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "chomp_bang")); kernelModule.defineMethod("chomp", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "chomp")); kernelModule.defineMethod("split", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "split")); kernelModule.defineMethod("scan", CallbackFactory.getSingletonMethod(RubyKernel.class, "scan", RubyObject.class)); kernelModule.defineMethod("load", CallbackFactory.getSingletonMethod(RubyKernel.class, "load", RubyString.class)); //kernelModule.defineMethod("autoload", CallbackFactory.getSingletonMethod(RubyKernel.class, "autoload", RubyString.class)); kernelModule.defineMethod("raise", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "raise")); kernelModule.defineMethod("require", CallbackFactory.getSingletonMethod(RubyKernel.class, "require", RubyString.class)); kernelModule.defineMethod("global_variables", CallbackFactory.getSingletonMethod(RubyKernel.class, "global_variables")); kernelModule.defineMethod("local_variables", CallbackFactory.getSingletonMethod(RubyKernel.class, "local_variables")); kernelModule.defineMethod("block_given?", CallbackFactory.getSingletonMethod(RubyKernel.class, "block_given")); kernelModule.defineMethod("iterator?", CallbackFactory.getSingletonMethod(RubyKernel.class, "block_given")); kernelModule.defineMethod("proc", CallbackFactory.getSingletonMethod(RubyKernel.class, "proc")); kernelModule.defineMethod("loop", CallbackFactory.getSingletonMethod(RubyKernel.class, "loop")); kernelModule.defineMethod("eval", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "eval", RubyString.class)); kernelModule.defineMethod("caller", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "caller")); kernelModule.defineMethod("catch", CallbackFactory.getSingletonMethod(RubyKernel.class, "rbCatch", RubyObject.class)); kernelModule.defineMethod("throw", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "rbThrow", RubyObject.class)); kernelModule.defineMethod("singleton_method_added", CallbackFactory.getNilMethod(1)); kernelModule.defineMethod("set_trace_func", CallbackFactory.getSingletonMethod(RubyKernel.class, "set_trace_func", RubyObject.class)); kernelModule.defineMethod("`", CallbackFactory.getSingletonMethod(RubyKernel.class, "backquote", RubyString.class)); kernelModule.defineMethod("exit", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "exit")); kernelModule.defineMethod("srand", CallbackFactory.getSingletonMethod(RubyKernel.class, "srand", RubyObject.class)); kernelModule.defineMethod("rand", CallbackFactory.getOptSingletonMethod(RubyKernel.class, "rand")); kernelModule.defineAlias("lambda", "proc"); return kernelModule; }
3,238,568
private void createUI() { createToolbar(); createActionbar(); createPanels(); JPanel container = new JPanel(); container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS)); container.add(toolbar , BorderLayout.WEST); container.add(Box.createHorizontalBox()); container.add(userActionbar, BorderLayout.EAST); this.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.weightx = 40; gbc.weighty = 0; gbc.anchor = GridBagConstraints.NORTH; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 5); this.add(container, gbc); gbc.gridx = 0; gbc.gridy = 1; gbc.weightx = 100; gbc.weighty = 100; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(5, 5, 0, 5); this.add(paintPotPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 5; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(colourWheelPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 300; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(RGBSliderPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 1700; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(swatchPane, gbc); RGBSliderPane.setVisible(false); swatchPane.setVisible(false); colourWheelButton.setSelected(true); colourWheelPane.setActive(true); this.doLayout(); }
private void createUI() { createToolbar(); createActionbar(); createPanels(); JPanel container = new JPanel(); container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS)); container.add(toolbar , BorderLayout.WEST); container.add(Box.createHorizontalBox()); container.add(userActionbar, BorderLayout.EAST); this.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.weightx = 40; gbc.weighty = 0; gbc.anchor = GridBagConstraints.NORTH; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 5); this.add(container, gbc); gbc.gridx = 0; gbc.gridy = 1; gbc.weightx = 100; gbc.weighty = 100; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(5, 5, 0, 5); this.add(paintPotPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 5; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(colourWheelPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 300; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(RGBSliderPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 1700; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(swatchPane, gbc); RGBSliderPane.setVisible(false); swatchPane.setVisible(false); colourWheelButton.setSelected(true); colourWheelPane.setActive(true); this.doLayout(); }
3,238,569
private void createUI() { createToolbar(); createActionbar(); createPanels(); JPanel container = new JPanel(); container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS)); container.add(toolbar , BorderLayout.WEST); container.add(Box.createHorizontalBox()); container.add(userActionbar, BorderLayout.EAST); this.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.weightx = 40; gbc.weighty = 0; gbc.anchor = GridBagConstraints.NORTH; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 5); this.add(container, gbc); gbc.gridx = 0; gbc.gridy = 1; gbc.weightx = 100; gbc.weighty = 100; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(5, 5, 0, 5); this.add(paintPotPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 5; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(colourWheelPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 300; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(RGBSliderPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 1700; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(swatchPane, gbc); RGBSliderPane.setVisible(false); swatchPane.setVisible(false); colourWheelButton.setSelected(true); colourWheelPane.setActive(true); this.doLayout(); }
private void createUI() { createToolbar(); createActionbar(); createPanels(); JPanel container = new JPanel(); container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS)); container.add(toolbar , BorderLayout.WEST); container.add(Box.createHorizontalBox()); container.add(userActionbar, BorderLayout.EAST); this.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.weightx = 40; gbc.weighty = 0; gbc.anchor = GridBagConstraints.NORTH; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 5); this.add(container, gbc); gbc.gridx = 0; gbc.gridy = 1; gbc.weightx = 100; gbc.weighty = 100; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(5, 5, 0, 5); this.add(paintPotPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 5; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(colourWheelPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 300; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(RGBSliderPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 1700; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(swatchPane, gbc); RGBSliderPane.setVisible(false); swatchPane.setVisible(false); colourWheelButton.setSelected(true); colourWheelPane.setActive(true); this.doLayout(); }
3,238,570
private void createUI() { createToolbar(); createActionbar(); createPanels(); JPanel container = new JPanel(); container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS)); container.add(toolbar , BorderLayout.WEST); container.add(Box.createHorizontalBox()); container.add(userActionbar, BorderLayout.EAST); this.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.weightx = 40; gbc.weighty = 0; gbc.anchor = GridBagConstraints.NORTH; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 5); this.add(container, gbc); gbc.gridx = 0; gbc.gridy = 1; gbc.weightx = 100; gbc.weighty = 100; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(5, 5, 0, 5); this.add(paintPotPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 5; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(colourWheelPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 300; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(RGBSliderPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 1700; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(swatchPane, gbc); RGBSliderPane.setVisible(false); swatchPane.setVisible(false); colourWheelButton.setSelected(true); colourWheelPane.setActive(true); this.doLayout(); }
private void createUI() { createToolbar(); createActionbar(); createPanels(); JPanel container = new JPanel(); container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS)); container.add(toolbar , BorderLayout.WEST); container.add(Box.createHorizontalBox()); container.add(userActionbar, BorderLayout.EAST); this.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.weightx = 40; gbc.weighty = 0; gbc.anchor = GridBagConstraints.NORTH; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 5); this.add(container, gbc); gbc.gridx = 0; gbc.gridy = 1; gbc.weightx = 100; gbc.weighty = 100; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(5, 5, 0, 5); this.add(paintPotPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 5; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(colourWheelPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 300; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(RGBSliderPane, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.weightx = 100; gbc.weighty = 1700; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.insets = new Insets(0, 0, 0, 0); this.add(swatchPane, gbc); RGBSliderPane.setVisible(false); swatchPane.setVisible(false); colourWheelButton.setSelected(true); colourWheelPane.setActive(true); this.doLayout(); }
3,238,571
public void init() { tree.getTopItem().setExpanded(true); }
public void init() { tree.getTopItem().setExpanded(true); }
3,238,572
public Instruction visitOpAsgnOrNode(OpAsgnOrNode iVisited) { return orNodeVisitor; }
public Instruction visitOpAsgnOrNode(OpAsgnOrNode iVisited) { return opAsgnOrNodeVisitor; }
3,238,573
public void testContainedImages(){ // Something Set result = (Set) testFindPDIHierarchies(); assertTrue(nonNull, result != null && result.size() != 0); // Not to much Set test = new HashSet(); Iterator i = result.iterator(); while (i.hasNext()){ Object o = i.next(); if (o instanceof Image) { test.add(o); } else if (o instanceof Dataset) { Dataset dd = (Dataset) o; test.addAll(dd.getImages()); } else if (o instanceof Project) { Project pd = (Project) o; Iterator p = pd.getDatasets().iterator(); while (p.hasNext()){ Dataset dd = (Dataset) p.next(); test.addAll(dd.getImages()); } } } assertTrue("There should only be as many images as in the data.imagesPDI", test.size() == this.getData().imgsPDI.size());// TODO Make sure joins aren't leaving anything out because of empties! }
public void testContainedImages(){ // Something Set result = (Set) testFindPDIHierarchies(); assertTrue(nonNull, result != null && result.size() != 0); // Not to much Set test = new HashSet(); Iterator i = result.iterator(); while (i.hasNext()){ Object o = i.next(); if (o instanceof Image) { test.add(o); } else if (o instanceof Dataset) { Dataset dd = (Dataset) o; test.addAll(dd.getImages()); } else if (o instanceof Project) { Project pd = (Project) o; Iterator p = pd.getDatasets().iterator(); while (p.hasNext()){ Dataset dd = (Dataset) p.next(); test.addAll(dd.getImages()); } } } assertTrue("There should only be as many images as in the data.imagesPDI", test.size() == this.getData().imgsPDI.size());// TODO Make sure joins aren't leaving anything out because of empties! }
3,238,575
public void testContainedImages(){ // Something Set result = (Set) testFindPDIHierarchies(); assertTrue(nonNull, result != null && result.size() != 0); // Not to much Set test = new HashSet(); Iterator i = result.iterator(); while (i.hasNext()){ Object o = i.next(); if (o instanceof Image) { test.add(o); } else if (o instanceof Dataset) { Dataset dd = (Dataset) o; test.addAll(dd.getImages()); } else if (o instanceof Project) { Project pd = (Project) o; Iterator p = pd.getDatasets().iterator(); while (p.hasNext()){ Dataset dd = (Dataset) p.next(); test.addAll(dd.getImages()); } } } assertTrue("There should only be as many images as in the data.imagesPDI", test.size() == this.getData().imgsPDI.size());// TODO Make sure joins aren't leaving anything out because of empties! }
publicvoidtestContainedImages(){//SomethingSetresult=(Set)testFindPDIHierarchies();assertTrue(nonNull,result!=null&&result.size()!=0);//NottomuchSettest=newHashSet();Iteratori=result.iterator();while(i.hasNext()){Objecto=i.next();if(oinstanceofImage){test.add(o);}elseif(oinstanceofDataset){Datasetdd=(Dataset)o;test.addAll(dd.getImages());}elseif(oinstanceofProject){Projectpd=(Project)o;Iteratorp=pd.getDatasets().iterator();while(p.hasNext()){Datasetdd=(Dataset)p.next();test.addAll(dd.getImages());}}}assertTrue("Thereshouldonlybeasmanyimagesasinthedata.imagesPDI",test.size()==this.getData().imgsPDI.size());//TODOMakesurejoinsaren'tleavinganythingoutbecauseofempties!}
3,238,576
public void testFindCGCIHierarchiesNoReturn() { Object obj = testFindCGCIHierarchies(); }
public void testFindCGCIHierarchiesNoReturn() throws Exception { super.setUp(); Object obj = testFindCGCIHierarchies(); }
3,238,577
public void testFindDatasetAnnotationsSetForExperimenterNoReturn() { Object obj = testFindDatasetAnnotationsSetForExperimenter(); }
public void testFindDatasetAnnotationsSetForExperimenterNoReturn() throws Exception { super.setUp(); Object obj = testFindDatasetAnnotationsSetForExperimenter(); }
3,238,578
public void testFindDatasetAnnotationsSetNoReturn() { Object obj = testFindDatasetAnnotationsSet(); }
public void testFindDatasetAnnotationsSetNoReturn() throws Exception { super.setUp(); Object obj = testFindDatasetAnnotationsSet(); }
3,238,579
public void testFindImageAnnotationsSetForExperimenterNoReturn() { Object obj = testFindImageAnnotationsSetForExperimenter(); }
public void testFindImageAnnotationsSetForExperimenterNoReturn() throws Exception { super.setUp(); Object obj = testFindImageAnnotationsSetForExperimenter(); }
3,238,580
public void testFindImageAnnotationsSetNoReturn() { Object obj = testFindImageAnnotationsSet(); }
public void testFindImageAnnotationsSetNoReturn() throws Exception { super.setUp(); Object obj = testFindImageAnnotationsSet(); }
3,238,581
public void testFindPDIHierarchiesNoReturn() { Object obj = testFindPDIHierarchies(); }
public void testFindPDIHierarchiesNoReturn() throws Exception { super.setUp(); Object obj = testFindPDIHierarchies(); }
3,238,582
public void testLoadCGCIHierarchyCategoryGroupNoReturn() { Object obj = testLoadCGCIHierarchyCategoryGroup(); }
public void testLoadCGCIHierarchyCategoryGroupNoReturn() throws Exception { super.setUp(); Object obj = testLoadCGCIHierarchyCategoryGroup(); }
3,238,583
public void testLoadCGCIHierarchyCategoryNoReturn() { Object obj = testLoadCGCIHierarchyCategory(); }
public void testLoadCGCIHierarchyCategoryNoReturn() throws Exception { super.setUp(); Object obj = testLoadCGCIHierarchyCategory(); }
3,238,584
public void testLoadPDIHierarchyDatasetNoReturn() { Object obj = testLoadPDIHierarchyDataset(); }
public void testLoadPDIHierarchyDatasetNoReturn() throws Exception { super.setUp(); Object obj = testLoadPDIHierarchyDataset(); }
3,238,585
public void testLoadPDIHierarchyProjectNoReturn() { Object obj = testLoadPDIHierarchyProject(); }
public void testLoadPDIHierarchyProjectNoReturn() throws Exception { super.setUp(); Object obj = testLoadPDIHierarchyProject(); }
3,238,586
public void testNulls(){ // Each method should return a null or an empty set as appropriate //TODO getHb().findCGCIHierarchies( ); //TODO generate OMENullData(); and use it here. //TODO OMEData toString(); Set test = new HashSet(); test.add(new Integer(0)); // Non-existence set of ids int nonExp = 0; // Non-existence experimenter ID // assertTrue(emptyColl,getHb().findDatasetAnnotations(test).size()==0); assertTrue(emptyColl,getHb().findDatasetAnnotations(new HashSet()).size()==0); // assertTrue(emptyColl,getHb().findDatasetAnnotationsForExperimenter(test,nonExp).size()==0); assertTrue(emptyColl,getHb().findDatasetAnnotationsForExperimenter(new HashSet(),nonExp).size()==0); // assertTrue(emptyColl,getHb().findImageAnnotations(test).size()==0); assertTrue(emptyColl,getHb().findImageAnnotations(new HashSet()).size()==0); // assertTrue(emptyColl,getHb().findImageAnnotationsForExperimenter(test,nonExp).size()==0); assertTrue(emptyColl,getHb().findImageAnnotationsForExperimenter(new HashSet(),nonExp).size()==0); // assertTrue(emptyColl,getHb().findPDIHierarchies(test).size()==0); assertTrue(emptyColl,getHb().findPDIHierarchies(new HashSet()).size()==0); // assertNull(nullObj,getHb().loadCGCIHierarchy(CategoryGroup.class, 0)); assertNull(nullObj,getHb().loadCGCIHierarchy(Category.class, 0)); // assertNull(nullObj,getHb().loadPDIHierarchy(Project.class, 0)); assertNull(nullObj,getHb().loadPDIHierarchy(Dataset.class, 0)); }
public void testNulls(){ // Each method should return a null or an empty set as appropriate //TODO getHb().findCGCIHierarchies( ); //TODO generate OMENullData(); and use it here. //TODO OMEData toString(); Set test = new HashSet(); test.add(new Integer(0)); // Non-existence set of ids int nonExp = 0; // Non-existence experimenter ID // assertTrue(emptyColl,getHb().findDatasetAnnotations(test).size()==0); assertTrue(emptyColl,getHb().findDatasetAnnotations(new HashSet()).size()==0); // assertTrue(emptyColl,getHb().findDatasetAnnotationsForExperimenter(test,nonExp).size()==0); assertTrue(emptyColl,getHb().findDatasetAnnotationsForExperimenter(new HashSet(),nonExp).size()==0); // assertTrue(emptyColl,getHb().findImageAnnotations(test).size()==0); assertTrue(emptyColl,getHb().findImageAnnotations(new HashSet()).size()==0); // assertTrue(emptyColl,getHb().findImageAnnotationsForExperimenter(test,nonExp).size()==0); assertTrue(emptyColl,getHb().findImageAnnotationsForExperimenter(new HashSet(),nonExp).size()==0); // assertTrue(emptyColl,getHb().findPDIHierarchies(test).size()==0); assertTrue(emptyColl,getHb().findPDIHierarchies(new HashSet()).size()==0); // assertNull(nullObj,getHb().loadCGCIHierarchy(CategoryGroup.class, 0)); assertNull(nullObj,getHb().loadCGCIHierarchy(Category.class, 0)); // assertNull(nullObj,getHb().loadPDIHierarchy(Project.class, 0)); assertNull(nullObj,getHb().loadPDIHierarchy(Dataset.class, 0)); }
3,238,587
public void testNulls(){ // Each method should return a null or an empty set as appropriate //TODO getHb().findCGCIHierarchies( ); //TODO generate OMENullData(); and use it here. //TODO OMEData toString(); Set test = new HashSet(); test.add(new Integer(0)); // Non-existence set of ids int nonExp = 0; // Non-existence experimenter ID // assertTrue(emptyColl,getHb().findDatasetAnnotations(test).size()==0); assertTrue(emptyColl,getHb().findDatasetAnnotations(new HashSet()).size()==0); // assertTrue(emptyColl,getHb().findDatasetAnnotationsForExperimenter(test,nonExp).size()==0); assertTrue(emptyColl,getHb().findDatasetAnnotationsForExperimenter(new HashSet(),nonExp).size()==0); // assertTrue(emptyColl,getHb().findImageAnnotations(test).size()==0); assertTrue(emptyColl,getHb().findImageAnnotations(new HashSet()).size()==0); // assertTrue(emptyColl,getHb().findImageAnnotationsForExperimenter(test,nonExp).size()==0); assertTrue(emptyColl,getHb().findImageAnnotationsForExperimenter(new HashSet(),nonExp).size()==0); // assertTrue(emptyColl,getHb().findPDIHierarchies(test).size()==0); assertTrue(emptyColl,getHb().findPDIHierarchies(new HashSet()).size()==0); // assertNull(nullObj,getHb().loadCGCIHierarchy(CategoryGroup.class, 0)); assertNull(nullObj,getHb().loadCGCIHierarchy(Category.class, 0)); // assertNull(nullObj,getHb().loadPDIHierarchy(Project.class, 0)); assertNull(nullObj,getHb().loadPDIHierarchy(Dataset.class, 0)); }
public void testNulls(){ // Each method should return a null or an empty set as appropriate //TODO getHb().findCGCIHierarchies( ); //TODO generate OMENullData(); and use it here. //TODO OMEData toString(); Set test = new HashSet(); test.add(new Integer(0)); // Non-existence set of ids int nonExp = 0; // Non-existence experimenter ID // assertTrue(emptyColl,getHb().findDatasetAnnotations(test).size()==0); assertTrue(emptyColl,getHb().findDatasetAnnotations(new HashSet()).size()==0); // assertTrue(emptyColl,getHb().findDatasetAnnotationsForExperimenter(test,nonExp).size()==0); assertTrue(emptyColl,getHb().findDatasetAnnotationsForExperimenter(new HashSet(),nonExp).size()==0); // assertTrue(emptyColl,getHb().findImageAnnotations(test).size()==0); assertTrue(emptyColl,getHb().findImageAnnotations(new HashSet()).size()==0); // assertTrue(emptyColl,getHb().findImageAnnotationsForExperimenter(test,nonExp).size()==0); assertTrue(emptyColl,getHb().findImageAnnotationsForExperimenter(new HashSet(),nonExp).size()==0); // assertTrue(emptyColl,getHb().findPDIHierarchies(test).size()==0); assertTrue(emptyColl,getHb().findPDIHierarchies(new HashSet()).size()==0); // assertNull(nullObj,getHb().loadCGCIHierarchy(CategoryGroup.class, 0)); assertNull(nullObj,getHb().loadCGCIHierarchy(Category.class, 0)); // assertNull(nullObj,getHb().loadPDIHierarchy(Project.class, 0)); assertNull(nullObj,getHb().loadPDIHierarchy(Dataset.class, 0)); }
3,238,588
public void testIterating() throws Exception { assertEquals("[\"foo\", \"bar\"]", eval("$h.each {|pair| p pair}")); assertEquals("{\"foo\"=>\"bar\"}", eval("p $h.each {|pair| }")); assertEquals("[\"foo\", \"bar\"]", eval("$h.each_pair {|pair| p pair}")); assertEquals("{\"foo\"=>\"bar\"}", eval("p $h.each_pair {|pair| }")); assertEquals("\"foo\"", eval("$h.each_key {|k| p k}")); assertEquals("{\"foo\"=>\"bar\"}", eval("p $h.each_key {|k| }")); assertEquals("\"bar\"", eval("$h.each_value {|v| p v}")); assertEquals("{\"foo\"=>\"bar\"}", eval("p $h.each_value {|v| }")); }
public void testIterating() throws Exception { assertEquals("[\"foo\", \"bar\"]", eval("$h.each {|pair| p pair}")); assertEquals("{\"foo\"=>\"bar\"}", eval("p $h.each {|pair| }")); assertEquals("[\"foo\", \"bar\"]", eval("$h.each_pair {|pair| p pair}")); assertEquals("{\"foo\"=>\"bar\"}", eval("p $h.each_pair {|pair| }")); assertEquals("\"foo\"", eval("$h.each_key {|k| p k}")); assertEquals("{\"foo\"=>\"bar\"}", eval("p $h.each_key {|k| }")); assertEquals("\"bar\"", eval("$h.each_value {|v| p v}")); assertEquals("{\"foo\"=>\"bar\"}", eval("p $h.each_value {|v| }")); }
3,238,590
public void setValue (Context c, Object v) throws PropertyException { throw new PropertyException("Cannot set the value of a function: " + _vname); }
public void setValue (Context c, Object v) throws PropertyException { throw new PropertyException("Cannot set the value of a function: " + getVariableName()); }
3,238,591
public String toString () { return "function:" + _vname; }
public String toString () { return "function:" + getVariableName(); }
3,238,592
public DefaultMethod(ScopeNode body, ArgsNode argsNode, Visibility visibility, RubyModule module) { super(visibility); this.body = body; this.argsNode = argsNode; this.module = module; }
public DefaultMethod(ScopeNode body, ArgsNode argsNode, Visibility visibility, ArrayStack moduleStack) { super(visibility); this.body = body; this.argsNode = argsNode; this.module = module; }
3,238,593
public DefaultMethod(ScopeNode body, ArgsNode argsNode, Visibility visibility, RubyModule module) { super(visibility); this.body = body; this.argsNode = argsNode; this.module = module; }
public DefaultMethod(ScopeNode body, ArgsNode argsNode, Visibility visibility, RubyModule module) { super(visibility); this.body = body; this.argsNode = argsNode; this.moduleStack = moduleStack; }
3,238,594
public IRubyObject call(Ruby runtime, IRubyObject receiver, String name, IRubyObject[] args, boolean noSuper) { ThreadContext context = runtime.getCurrentContext(); RubyProc optionalBlockArg = null; if (argsNode.getBlockArgNode() != null && context.isBlockGiven()) { optionalBlockArg = RubyProc.newProc(runtime); } context.getScopeStack().push(); if (body.getLocalNames() != null) { context.getScopeStack().resetLocalVariables(body.getLocalNames()); } context.pushDynamicVars(); context.pushClass(module); try { if (argsNode != null) { prepareArguments(runtime, receiver, args); } if (optionalBlockArg != null) { context.getScopeStack().setValue(argsNode.getBlockArgNode().getCount(), optionalBlockArg); } traceCall(runtime, receiver, name); return receiver.eval(body.getBodyNode()); } catch (ReturnJump rj) { if (rj.getTarget() == this) { return rj.getReturnValue(); } throw rj; } finally { context.popClass(); context.popDynamicVars(); context.getScopeStack().pop(); traceReturn(runtime, receiver, name); } }
public IRubyObject call(Ruby runtime, IRubyObject receiver, String name, IRubyObject[] args, boolean noSuper) { ThreadContext context = runtime.getCurrentContext(); RubyProc optionalBlockArg = null; if (argsNode.getBlockArgNode() != null && context.isBlockGiven()) { optionalBlockArg = RubyProc.newProc(runtime); } context.getScopeStack().push(); if (body.getLocalNames() != null) { context.getScopeStack().resetLocalVariables(body.getLocalNames()); } context.pushDynamicVars(); ArrayStack oldStack = context.getClassStack(); context.setClassStack(moduleStack); try { if (argsNode != null) { prepareArguments(runtime, receiver, args); } if (optionalBlockArg != null) { context.getScopeStack().setValue(argsNode.getBlockArgNode().getCount(), optionalBlockArg); } traceCall(runtime, receiver, name); return receiver.eval(body.getBodyNode()); } catch (ReturnJump rj) { if (rj.getTarget() == this) { return rj.getReturnValue(); } throw rj; } finally { context.popClass(); context.popDynamicVars(); context.getScopeStack().pop(); traceReturn(runtime, receiver, name); } }
3,238,595
public IRubyObject call(Ruby runtime, IRubyObject receiver, String name, IRubyObject[] args, boolean noSuper) { ThreadContext context = runtime.getCurrentContext(); RubyProc optionalBlockArg = null; if (argsNode.getBlockArgNode() != null && context.isBlockGiven()) { optionalBlockArg = RubyProc.newProc(runtime); } context.getScopeStack().push(); if (body.getLocalNames() != null) { context.getScopeStack().resetLocalVariables(body.getLocalNames()); } context.pushDynamicVars(); context.pushClass(module); try { if (argsNode != null) { prepareArguments(runtime, receiver, args); } if (optionalBlockArg != null) { context.getScopeStack().setValue(argsNode.getBlockArgNode().getCount(), optionalBlockArg); } traceCall(runtime, receiver, name); return receiver.eval(body.getBodyNode()); } catch (ReturnJump rj) { if (rj.getTarget() == this) { return rj.getReturnValue(); } throw rj; } finally { context.popClass(); context.popDynamicVars(); context.getScopeStack().pop(); traceReturn(runtime, receiver, name); } }
public IRubyObject call(Ruby runtime, IRubyObject receiver, String name, IRubyObject[] args, boolean noSuper) { ThreadContext context = runtime.getCurrentContext(); RubyProc optionalBlockArg = null; if (argsNode.getBlockArgNode() != null && context.isBlockGiven()) { optionalBlockArg = RubyProc.newProc(runtime); } context.getScopeStack().push(); if (body.getLocalNames() != null) { context.getScopeStack().resetLocalVariables(body.getLocalNames()); } context.pushDynamicVars(); context.pushClass(module); try { if (argsNode != null) { prepareArguments(runtime, receiver, args); } if (optionalBlockArg != null) { context.getScopeStack().setValue(argsNode.getBlockArgNode().getCount(), optionalBlockArg); } traceCall(runtime, receiver, name); return receiver.eval(body.getBodyNode()); } catch (ReturnJump rj) { if (rj.getTarget() == this) { return rj.getReturnValue(); } throw rj; } finally { context.setClassStack(oldStack); context.popDynamicVars(); context.getScopeStack().pop(); traceReturn(runtime, receiver, name); } }
3,238,596
public ICallable dup() { return new DefaultMethod(body, argsNode, getVisibility(), module); }
public ICallable dup() { return new DefaultMethod(body, argsNode, getVisibility(), moduleStack); }
3,238,597
public void setQuantumStrategy(int family, double coefficient, int bitResolution) { RenderingDef rd = renderer.getRenderingDef(); QuantumDef qd = rd.getQuantumDef(), newQd; newQd = new QuantumDef(family, qd.pixelType, coefficient, qd.cdStart, qd.cdEnd, bitResolution); rd.setQuantumDef(newQd); renderer.makeQuantumManager(); }
public void setQuantumStrategy(int family, double coefficient, int bitResolution) { RenderingDef rd = renderer.getRenderingDef(); QuantumDef qd = rd.getQuantumDef(), newQd; newQd = new QuantumDef(family, qd.pixelType, coefficient, qd.cdStart, qd.cdEnd, bitResolution); rd.setQuantumDef(newQd); renderer.makeQuantumManager(); }
3,238,598
public String[] getNames() { File[] files = getFiles(); String[] names = new String[files.length]; for (int i = 0, size = files.length; i < size; i++) { names[i] = files[i].getPath(); } return names; }
public String[] getNames() { File[] files = getFiles(); String[] names = new String[files.length]; for (int i = 0, size = files.length; i < size; i++) { names[i] = files[i].getPath() + (patternEndsWithPathDelimeter ? "/" : ""); } return names; }
3,238,600
public Feature(Integer featureId, String name, String tag, org.openmicroscopy.omero.model.Image image, org.openmicroscopy.omero.model.Feature feature, Set features) { this.featureId = featureId; this.name = name; this.tag = tag; this.image = image; this.feature = feature; this.features = features; }
public Feature(Integer featureId, String name, String tag, org.openmicroscopy.omero.model.Image image, org.openmicroscopy.omero.model.Feature feature, Set features) { this.featureId = featureId; this.name = name; this.tag = tag; this.image = image; this.feature = feature; this.features = features; }
3,238,601
public org.openmicroscopy.omero.model.Feature getFeature() { return this.feature; }
public Feature getFeature() { return this.feature; }
3,238,602
public org.openmicroscopy.omero.model.Image getImage() { return this.image; }
public Image getImage() { return this.image; }
3,238,603
public void setFeature(org.openmicroscopy.omero.model.Feature feature) { this.feature = feature; }
public void setFeature(Feature feature) { this.feature = feature; }
3,238,604
public void setImage(org.openmicroscopy.omero.model.Image image) { this.image = image; }
public void setImage(Image image) { this.image = image; }
3,238,605
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; Rectangle r; Segment vLeft, vRight, hTop, hBottom; PlanePoint topLeftCorner, topRightCorner, bottomLeftCorner, bottomRightCorner; PlanePoint cPoint; while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); r = s.getBounds(); topLeftCorner = new PlanePoint(r.x, r.y); topRightCorner = new PlanePoint(r.x+r.width-2, r.y); bottomLeftCorner = new PlanePoint(r.x, r.y+r.height-2); bottomRightCorner = new PlanePoint(r.x+r.width-2, r.y+r.height-2); vLeft = new Segment(topLeftCorner, bottomLeftCorner); vRight = new Segment(topRightCorner, bottomRightCorner); hTop = new Segment(topLeftCorner, topRightCorner); hBottom = new Segment(bottomLeftCorner, bottomRightCorner); cPoint = new PlanePoint(p.x, p.y); if (s.contains(p)) { setHandlePressedValues(roi, s, r.x, r.y); cPoint = new PlanePoint(p.x, p.y); if (vLeft.lies(cPoint)) resizeZone = LEFT; else if (vRight.lies(cPoint)) resizeZone = RIGHT; else if (hTop.lies(cPoint)) resizeZone = TOP; else if (hBottom.lies(cPoint)) resizeZone = BOTTOM; else handlePressedIn(roi, clickCount); } } if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); }
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s, vLeft, vRight, hTop, hBottom; Rectangle r; Segment vLeft, vRight, hTop, hBottom; PlanePoint topLeftCorner, topRightCorner, bottomLeftCorner, bottomRightCorner; PlanePoint cPoint; while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); r = s.getBounds(); topLeftCorner = new PlanePoint(r.x, r.y); topRightCorner = new PlanePoint(r.x+r.width-2, r.y); bottomLeftCorner = new PlanePoint(r.x, r.y+r.height-2); bottomRightCorner = new PlanePoint(r.x+r.width-2, r.y+r.height-2); vLeft = new Segment(topLeftCorner, bottomLeftCorner); vRight = new Segment(topRightCorner, bottomRightCorner); hTop = new Segment(topLeftCorner, topRightCorner); hBottom = new Segment(bottomLeftCorner, bottomRightCorner); cPoint = new PlanePoint(p.x, p.y); if (s.contains(p)) { setHandlePressedValues(roi, s, r.x, r.y); cPoint = new PlanePoint(p.x, p.y); if (vLeft.lies(cPoint)) resizeZone = LEFT; else if (vRight.lies(cPoint)) resizeZone = RIGHT; else if (hTop.lies(cPoint)) resizeZone = TOP; else if (hBottom.lies(cPoint)) resizeZone = BOTTOM; else handlePressedIn(roi, clickCount); } } if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); }
3,238,606
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; Rectangle r; Segment vLeft, vRight, hTop, hBottom; PlanePoint topLeftCorner, topRightCorner, bottomLeftCorner, bottomRightCorner; PlanePoint cPoint; while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); r = s.getBounds(); topLeftCorner = new PlanePoint(r.x, r.y); topRightCorner = new PlanePoint(r.x+r.width-2, r.y); bottomLeftCorner = new PlanePoint(r.x, r.y+r.height-2); bottomRightCorner = new PlanePoint(r.x+r.width-2, r.y+r.height-2); vLeft = new Segment(topLeftCorner, bottomLeftCorner); vRight = new Segment(topRightCorner, bottomRightCorner); hTop = new Segment(topLeftCorner, topRightCorner); hBottom = new Segment(bottomLeftCorner, bottomRightCorner); cPoint = new PlanePoint(p.x, p.y); if (s.contains(p)) { setHandlePressedValues(roi, s, r.x, r.y); cPoint = new PlanePoint(p.x, p.y); if (vLeft.lies(cPoint)) resizeZone = LEFT; else if (vRight.lies(cPoint)) resizeZone = RIGHT; else if (hTop.lies(cPoint)) resizeZone = TOP; else if (hBottom.lies(cPoint)) resizeZone = BOTTOM; else handlePressedIn(roi, clickCount); } } if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); }
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; Rectangle r; Segment vLeft, vRight, hTop, hBottom; PlanePoint topLeftCorner, topRightCorner, bottomLeftCorner, bottomRightCorner; PlanePoint cPoint; while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); r = s.getBounds(); topLeftCorner = new PlanePoint(r.x, r.y); topRightCorner = new PlanePoint(r.x+r.width-2, r.y); bottomLeftCorner = new PlanePoint(r.x, r.y+r.height-2); bottomRightCorner = new PlanePoint(r.x+r.width-2, r.y+r.height-2); vLeft = new Segment(topLeftCorner, bottomLeftCorner); vRight = new Segment(topRightCorner, bottomRightCorner); hTop = new Segment(topLeftCorner, topRightCorner); hBottom = new Segment(bottomLeftCorner, bottomRightCorner); cPoint = new PlanePoint(p.x, p.y); if (s.contains(p)) { setHandlePressedValues(roi, s, r.x, r.y); cPoint = new PlanePoint(p.x, p.y); if (vLeft.lies(cPoint)) resizeZone = LEFT; else if (vRight.lies(cPoint)) resizeZone = RIGHT; else if (hTop.lies(cPoint)) resizeZone = TOP; else if (hBottom.lies(cPoint)) resizeZone = BOTTOM; else handlePressedIn(roi, clickCount); } } if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); }
3,238,607
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; Rectangle r; Segment vLeft, vRight, hTop, hBottom; PlanePoint topLeftCorner, topRightCorner, bottomLeftCorner, bottomRightCorner; PlanePoint cPoint; while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); r = s.getBounds(); topLeftCorner = new PlanePoint(r.x, r.y); topRightCorner = new PlanePoint(r.x+r.width-2, r.y); bottomLeftCorner = new PlanePoint(r.x, r.y+r.height-2); bottomRightCorner = new PlanePoint(r.x+r.width-2, r.y+r.height-2); vLeft = new Segment(topLeftCorner, bottomLeftCorner); vRight = new Segment(topRightCorner, bottomRightCorner); hTop = new Segment(topLeftCorner, topRightCorner); hBottom = new Segment(bottomLeftCorner, bottomRightCorner); cPoint = new PlanePoint(p.x, p.y); if (s.contains(p)) { setHandlePressedValues(roi, s, r.x, r.y); cPoint = new PlanePoint(p.x, p.y); if (vLeft.lies(cPoint)) resizeZone = LEFT; else if (vRight.lies(cPoint)) resizeZone = RIGHT; else if (hTop.lies(cPoint)) resizeZone = TOP; else if (hBottom.lies(cPoint)) resizeZone = BOTTOM; else handlePressedIn(roi, clickCount); } } if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); }
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; Rectangle r; Segment vLeft, vRight, hTop, hBottom; PlanePoint topLeftCorner, topRightCorner, bottomLeftCorner, bottomRightCorner; PlanePoint cPoint; while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); r = s.getBounds(); topLeftCorner = new PlanePoint(r.x, r.y); topRightCorner = new PlanePoint(r.x+r.width-2, r.y); bottomLeftCorner = new PlanePoint(r.x, r.y+r.height-2); bottomRightCorner = new PlanePoint(r.x+r.width-2, r.y+r.height-2); vLeft = new Segment(topLeftCorner, bottomLeftCorner); vRight = new Segment(topRightCorner, bottomRightCorner); hTop = new Segment(topLeftCorner, topRightCorner); hBottom = new Segment(bottomLeftCorner, bottomRightCorner); cPoint = new PlanePoint(p.x, p.y); if (s.contains(p)) { setHandlePressedValues(roi, s, r.x, r.y); cPoint = new PlanePoint(p.x, p.y); if (vLeft.lies(cPoint)) resizeZone = LEFT; else if (vRight.lies(cPoint)) resizeZone = RIGHT; else if (hTop.lies(cPoint)) resizeZone = TOP; else if (hBottom.lies(cPoint)) resizeZone = BOTTOM; else handlePressedIn(roi, clickCount); } } if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); }
3,238,608
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; Rectangle r; Segment vLeft, vRight, hTop, hBottom; PlanePoint topLeftCorner, topRightCorner, bottomLeftCorner, bottomRightCorner; PlanePoint cPoint; while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); r = s.getBounds(); topLeftCorner = new PlanePoint(r.x, r.y); topRightCorner = new PlanePoint(r.x+r.width-2, r.y); bottomLeftCorner = new PlanePoint(r.x, r.y+r.height-2); bottomRightCorner = new PlanePoint(r.x+r.width-2, r.y+r.height-2); vLeft = new Segment(topLeftCorner, bottomLeftCorner); vRight = new Segment(topRightCorner, bottomRightCorner); hTop = new Segment(topLeftCorner, topRightCorner); hBottom = new Segment(bottomLeftCorner, bottomRightCorner); cPoint = new PlanePoint(p.x, p.y); if (s.contains(p)) { setHandlePressedValues(roi, s, r.x, r.y); cPoint = new PlanePoint(p.x, p.y); if (vLeft.lies(cPoint)) resizeZone = LEFT; else if (vRight.lies(cPoint)) resizeZone = RIGHT; else if (hTop.lies(cPoint)) resizeZone = TOP; else if (hBottom.lies(cPoint)) resizeZone = BOTTOM; else handlePressedIn(roi, clickCount); } } if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); }
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; Rectangle r; Segment vLeft, vRight, hTop, hBottom; PlanePoint topLeftCorner, topRightCorner, bottomLeftCorner, bottomRightCorner; PlanePoint cPoint; while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); r = s.getBounds(); topLeftCorner = new PlanePoint(r.x, r.y); topRightCorner = new PlanePoint(r.x+r.width-2, r.y); bottomLeftCorner = new PlanePoint(r.x, r.y+r.height-2); bottomRightCorner = new PlanePoint(r.x+r.width-2, r.y+r.height-2); vLeft = new Segment(topLeftCorner, bottomLeftCorner); vRight = new Segment(topRightCorner, bottomRightCorner); hTop = new Segment(topLeftCorner, topRightCorner); hBottom = new Segment(bottomLeftCorner, bottomRightCorner); cPoint = new PlanePoint(p.x, p.y); if (s.contains(p)) { setHandlePressedValues(roi, s, r.x, r.y); cPoint = new PlanePoint(p.x, p.y); if (vLeft.lies(cPoint)) resizeZone = LEFT; else if (vRight.lies(cPoint)) resizeZone = RIGHT; else if (hTop.lies(cPoint)) resizeZone = TOP; else if (hBottom.lies(cPoint)) resizeZone = BOTTOM; else handlePressedIn(roi, clickCount); } } if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); }
3,238,609
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; Rectangle r; Segment vLeft, vRight, hTop, hBottom; PlanePoint topLeftCorner, topRightCorner, bottomLeftCorner, bottomRightCorner; PlanePoint cPoint; while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); r = s.getBounds(); topLeftCorner = new PlanePoint(r.x, r.y); topRightCorner = new PlanePoint(r.x+r.width-2, r.y); bottomLeftCorner = new PlanePoint(r.x, r.y+r.height-2); bottomRightCorner = new PlanePoint(r.x+r.width-2, r.y+r.height-2); vLeft = new Segment(topLeftCorner, bottomLeftCorner); vRight = new Segment(topRightCorner, bottomRightCorner); hTop = new Segment(topLeftCorner, topRightCorner); hBottom = new Segment(bottomLeftCorner, bottomRightCorner); cPoint = new PlanePoint(p.x, p.y); if (s.contains(p)) { setHandlePressedValues(roi, s, r.x, r.y); cPoint = new PlanePoint(p.x, p.y); if (vLeft.lies(cPoint)) resizeZone = LEFT; else if (vRight.lies(cPoint)) resizeZone = RIGHT; else if (hTop.lies(cPoint)) resizeZone = TOP; else if (hBottom.lies(cPoint)) resizeZone = BOTTOM; else handlePressedIn(roi, clickCount); } } if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); }
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; Rectangle r; Segment vLeft, vRight, hTop, hBottom; PlanePoint topLeftCorner, topRightCorner, bottomLeftCorner, bottomRightCorner; PlanePoint cPoint; while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); r = s.getBounds(); topLeftCorner = new PlanePoint(r.x, r.y); topRightCorner = new PlanePoint(r.x+r.width-2, r.y); bottomLeftCorner = new PlanePoint(r.x, r.y+r.height-2); bottomRightCorner = new PlanePoint(r.x+r.width-2, r.y+r.height-2); vLeft = new Segment(topLeftCorner, bottomLeftCorner); vRight = new Segment(topRightCorner, bottomRightCorner); hTop = new Segment(topLeftCorner, topRightCorner); hBottom = new Segment(bottomLeftCorner, bottomRightCorner); cPoint = new PlanePoint(p.x, p.y); if (s.contains(p)) { setHandlePressedValues(roi, s, r.x, r.y); cPoint = new PlanePoint(p.x, p.y); if (vLeft.lies(cPoint)) resizeZone = LEFT; else if (vRight.contains(p)) resizeZone = RIGHT; else if (hTop.lies(cPoint)) resizeZone = TOP; else if (hBottom.lies(cPoint)) resizeZone = BOTTOM; else handlePressedIn(roi, clickCount); } } if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); }
3,238,610
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; Rectangle r; Segment vLeft, vRight, hTop, hBottom; PlanePoint topLeftCorner, topRightCorner, bottomLeftCorner, bottomRightCorner; PlanePoint cPoint; while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); r = s.getBounds(); topLeftCorner = new PlanePoint(r.x, r.y); topRightCorner = new PlanePoint(r.x+r.width-2, r.y); bottomLeftCorner = new PlanePoint(r.x, r.y+r.height-2); bottomRightCorner = new PlanePoint(r.x+r.width-2, r.y+r.height-2); vLeft = new Segment(topLeftCorner, bottomLeftCorner); vRight = new Segment(topRightCorner, bottomRightCorner); hTop = new Segment(topLeftCorner, topRightCorner); hBottom = new Segment(bottomLeftCorner, bottomRightCorner); cPoint = new PlanePoint(p.x, p.y); if (s.contains(p)) { setHandlePressedValues(roi, s, r.x, r.y); cPoint = new PlanePoint(p.x, p.y); if (vLeft.lies(cPoint)) resizeZone = LEFT; else if (vRight.lies(cPoint)) resizeZone = RIGHT; else if (hTop.lies(cPoint)) resizeZone = TOP; else if (hBottom.lies(cPoint)) resizeZone = BOTTOM; else handlePressedIn(roi, clickCount); } } if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); }
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; Rectangle r; Segment vLeft, vRight, hTop, hBottom; PlanePoint topLeftCorner, topRightCorner, bottomLeftCorner, bottomRightCorner; PlanePoint cPoint; while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); r = s.getBounds(); topLeftCorner = new PlanePoint(r.x, r.y); topRightCorner = new PlanePoint(r.x+r.width-2, r.y); bottomLeftCorner = new PlanePoint(r.x, r.y+r.height-2); bottomRightCorner = new PlanePoint(r.x+r.width-2, r.y+r.height-2); vLeft = new Segment(topLeftCorner, bottomLeftCorner); vRight = new Segment(topRightCorner, bottomRightCorner); hTop = new Segment(topLeftCorner, topRightCorner); hBottom = new Segment(bottomLeftCorner, bottomRightCorner); cPoint = new PlanePoint(p.x, p.y); if (s.contains(p)) { setHandlePressedValues(roi, s, r.x, r.y); cPoint = new PlanePoint(p.x, p.y); if (vLeft.lies(cPoint)) resizeZone = LEFT; else if (vRight.lies(cPoint)) resizeZone = RIGHT; else if (hTop.contains(p)) resizeZone = TOP; else if (hBottom.lies(cPoint)) resizeZone = BOTTOM; else handlePressedIn(roi, clickCount); } } if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); }
3,238,611
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; Rectangle r; Segment vLeft, vRight, hTop, hBottom; PlanePoint topLeftCorner, topRightCorner, bottomLeftCorner, bottomRightCorner; PlanePoint cPoint; while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); r = s.getBounds(); topLeftCorner = new PlanePoint(r.x, r.y); topRightCorner = new PlanePoint(r.x+r.width-2, r.y); bottomLeftCorner = new PlanePoint(r.x, r.y+r.height-2); bottomRightCorner = new PlanePoint(r.x+r.width-2, r.y+r.height-2); vLeft = new Segment(topLeftCorner, bottomLeftCorner); vRight = new Segment(topRightCorner, bottomRightCorner); hTop = new Segment(topLeftCorner, topRightCorner); hBottom = new Segment(bottomLeftCorner, bottomRightCorner); cPoint = new PlanePoint(p.x, p.y); if (s.contains(p)) { setHandlePressedValues(roi, s, r.x, r.y); cPoint = new PlanePoint(p.x, p.y); if (vLeft.lies(cPoint)) resizeZone = LEFT; else if (vRight.lies(cPoint)) resizeZone = RIGHT; else if (hTop.lies(cPoint)) resizeZone = TOP; else if (hBottom.lies(cPoint)) resizeZone = BOTTOM; else handlePressedIn(roi, clickCount); } } if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); }
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; Rectangle r; Segment vLeft, vRight, hTop, hBottom; PlanePoint topLeftCorner, topRightCorner, bottomLeftCorner, bottomRightCorner; PlanePoint cPoint; while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); r = s.getBounds(); topLeftCorner = new PlanePoint(r.x, r.y); topRightCorner = new PlanePoint(r.x+r.width-2, r.y); bottomLeftCorner = new PlanePoint(r.x, r.y+r.height-2); bottomRightCorner = new PlanePoint(r.x+r.width-2, r.y+r.height-2); vLeft = new Segment(topLeftCorner, bottomLeftCorner); vRight = new Segment(topRightCorner, bottomRightCorner); hTop = new Segment(topLeftCorner, topRightCorner); hBottom = new Segment(bottomLeftCorner, bottomRightCorner); cPoint = new PlanePoint(p.x, p.y); if (s.contains(p)) { setHandlePressedValues(roi, s, r.x, r.y); cPoint = new PlanePoint(p.x, p.y); if (vLeft.lies(cPoint)) resizeZone = LEFT; else if (vRight.lies(cPoint)) resizeZone = RIGHT; else if (hTop.lies(cPoint)) resizeZone = TOP; else if (hBottom.contains(p)) resizeZone = BOTTOM; else handlePressedIn(roi, clickCount); } } if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); }
3,238,612
private void move(Point p) { int diffX = p.x-anchor.x, diffY = p.y-anchor.y; Rectangle r = currentShape.getBounds(); int x = xControl+diffX, y = yControl+diffY, w = r.width, h = r.height; if (areaValid(x, y, w, h)) { ROIFactory.setShapeBounds(currentShape, currentROI.getShapeType(), x , y, w, h); moving = true; view.moveAndDraw(currentShape); } }
private void move(Point p) { Rectangle r = currentShape.getBounds(); int x = xControl+diffX, y = yControl+diffY, w = r.width, h = r.height; if (areaValid(x, y, w, h)) { ROIFactory.setShapeBounds(currentShape, currentROI.getShapeType(), x , y, w, h); moving = true; view.moveAndDraw(currentShape); } }
3,238,613
private void move(Point p) { int diffX = p.x-anchor.x, diffY = p.y-anchor.y; Rectangle r = currentShape.getBounds(); int x = xControl+diffX, y = yControl+diffY, w = r.width, h = r.height; if (areaValid(x, y, w, h)) { ROIFactory.setShapeBounds(currentShape, currentROI.getShapeType(), x , y, w, h); moving = true; view.moveAndDraw(currentShape); } }
private void move(Point p) { int diffX = p.x-anchor.x, diffY = p.y-anchor.y; Rectangle r = currentShape.getBounds(); int x = xControl+p.x-anchor.x, y = yControl+p.y-anchor.y, w = r.width, h = r.height; if (areaValid(x, y, w, h)) { ROIFactory.setShapeBounds(currentShape, currentROI.getShapeType(), x , y, w, h); moving = true; view.moveAndDraw(currentShape); } }
3,238,614
private void resize(Point p) { Rectangle r = currentROI.getShape().getBounds(); int x = r.x, y = r.y, w = r.width, h = r.height; switch (resizeZone) { case LEFT: x = p.x; w += anchor.x-p.x; break; case RIGHT: w += p.x-anchor.x; break; case TOP: y = p.y; h += anchor.y-p.y; break; case BOTTOM: h += p.y-anchor.y; } if (areaValid(x, y, w, h)) { currentShape = ROIFactory.makeShape(currentROI.getShapeType(), x, y, w, h); view.draw(currentShape); moving = true; //view.moveAndDraw(currentShape); } }
privatevoidresize(Pointp){Rectangler=currentROI.getShape().getBounds();intx=r.x,y=r.y,w=r.width,h=r.height;switch(resizeZone){caseLEFT:x=p.x;w+=anchor.x-p.x;break;caseRIGHT:w+=p.x-anchor.x;break;caseTOP:y=p.y;h+=anchor.y-p.y;break;caseBOTTOM:h+=p.y-anchor.y;}if(areaValid(x,y,w,h)){currentShape=ROIFactory.makeShape(currentROI.getShapeType(),x,y,w,h);view.draw(currentShape);moving=true;//view.moveAndDraw(currentShape);}}
3,238,615
public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2D = (Graphics2D) g; g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2D.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); BufferedImage img = model.getDisplayedImage(); if (img == null) return; //paintXYFrame(g2D); g2D.drawImage(img, null, 0, 0); double v = model.getPixelsSizeX()/model.getZoomFactor(); v *= model.getUnitBarSize(); int size = (int) model.getUnitBarSize(); if (v > 0 && model.isUnitBar()) { paintScaleBar(g2D, img.getWidth()-size-5, img.getHeight()-10, size, ""+(int) v); } }
public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2D = (Graphics2D) g; g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2D.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); BufferedImage img = model.getDisplayedImage(); if (img == null) return; //paintXYFrame(g2D); g2D.drawImage(img, null, 0, 0); double v = model.getPixelsSizeX()/model.getZoomFactor(); v *= model.getUnitBarSize(); int size = (int) model.getUnitBarSize(); if (v > 0 && model.isUnitBar()) { paintScaleBar(g2D, img.getWidth()-size-5, img.getHeight()-10, size, ""+v); } }
3,238,616
private static Vector getListOfFiles(File file, boolean recursive) { Vector ret = new Vector(); if (file.isFile()) { ret.add(file.getAbsolutePath()); } else if (file.isDirectory()) { File[] files = file.listFiles(); for (int i = 0; i < files.length; i++) { if (recursive) { ret.addAll(getListOfFiles(files[i], true)); } else { if (files[i].isFile()) { ret.add(files[i].getAbsolutePath()); } } } } return ret; }
private static Vector getListOfFiles(File file, boolean recursive) { Vector ret = new Vector(); if (file.isFile()) { ret.add(file.getAbsolutePath()); } else if (file.isDirectory()) { File[] files = file.listFiles(); for (int i = 0; i < files.length; i++) { if (recursive) { ret.addAll(getListOfFiles(files[i], true)); } else { if (files[i].isFile()) { ret.add(files[i].getAbsolutePath()); } } } } return ret; }
3,238,617
public static void clearMethodCache(Ruby runtime) { Iterator iter = runtime.getClasses().getClassMap().values().iterator(); while (iter.hasNext()) { ((RubyModule) iter.next()).methodCache.clear(); } }
public static void clearMethodCache(Ruby runtime) { Iterator iter = runtime.getClasses().getTopLevelClassMap().values().iterator(); while (iter.hasNext()) { ((RubyModule) iter.next()).methodCache.clear(); } iter = runtime.getClasses().getNonTopLevelClassMap().values().iterator(); while (iter.hasNext()) { ((RubyModule) iter.next()).methodCache.clear(); } }
3,238,618
public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { LinkedList executeMethods = new LinkedList(Arrays.asList(methods)); int argsLength = args != null ? args.length : 0; // remove mehods with wrong parameter count. Iterator iter = executeMethods.iterator(); while (iter.hasNext()) { Method method = (Method)iter.next(); if (method.getParameterTypes().length != argsLength) { iter.remove(); } } // remove mehods with wrong parameter types. iter = executeMethods.iterator(); while (iter.hasNext()) { Method method = (Method)iter.next(); for (int i = 0; i < method.getParameterTypes().length; i++) { if (!JavaUtil.isCompatible(args[i], method.getParameterTypes()[i])) { iter.remove(); break; } } } if (executeMethods.isEmpty()) { if (callSuper) { ruby.getRuntime().callSuper(args); } else { throw new ArgumentError(ruby, "wrong argument count or types."); } } // take the first method. Method method = (Method)executeMethods.getFirst(); Object[] newArgs = new Object[argsLength]; for (int i = 0; i < argsLength; i++) { newArgs[i] = JavaUtil.convertRubyToJava(ruby, args[i], method.getParameterTypes()[i]); } try { Object receiver = !singleton ? ((RubyJavaObject)recv).getValue() : null; return JavaUtil.convertJavaToRuby(ruby, method.invoke(receiver, newArgs)); } catch (Exception excptn) { throw new RaiseException(ruby, "RuntimeError", excptn.getMessage()); } }
public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { LinkedList executeMethods = new LinkedList(Arrays.asList(methods)); int argsLength = args != null ? args.length : 0; // remove mehods with wrong parameter count. Iterator iter = executeMethods.iterator(); while (iter.hasNext()) { Method method = (Method)iter.next(); if (method.getParameterTypes().length != argsLength) { iter.remove(); } } // remove mehods with wrong parameter types. iter = executeMethods.iterator(); while (iter.hasNext()) { Method method = (Method)iter.next(); for (int i = 0; i < method.getParameterTypes().length; i++) { if (!JavaUtil.isCompatible(args[i], method.getParameterTypes()[i])) { iter.remove(); break; } } } if (executeMethods.isEmpty()) { if (callSuper) { return ruby.getRuntime().callSuper(args); } else { throw new ArgumentError(ruby, "wrong argument count or types."); } } // take the first method. Method method = (Method)executeMethods.getFirst(); Object[] newArgs = new Object[argsLength]; for (int i = 0; i < argsLength; i++) { newArgs[i] = JavaUtil.convertRubyToJava(ruby, args[i], method.getParameterTypes()[i]); } try { Object receiver = !singleton ? ((RubyJavaObject)recv).getValue() : null; return JavaUtil.convertJavaToRuby(ruby, method.invoke(receiver, newArgs)); } catch (Exception excptn) { throw new RaiseException(ruby, "RuntimeError", excptn.getMessage()); } }
3,238,619
private void handleSendMessage(MessengerDialog source, MessengerDetails details) { Registry reg = container.getRegistry(); String url = (String) reg.lookup(LookupNames.DEBUG_URL); String teamAddress = (String) reg.lookup(LookupNames.DEBUG_EMAIL); CommunicatorDescriptor desc = new CommunicatorDescriptor (HttpChannel.CONNECTION_PER_REQUEST, url, -1); try { Communicator c = SvcRegistry.getCommunicator(desc); String error = details.getError(); String reply = ""; if (error == null || error.length() == 0) c.submitComment(details.getEmail(), details.getComment(), details.getExtra(), reply); else c.submitError(details.getEmail(), details.getComment(), details.getExtra(), error, reply); JOptionPane.showMessageDialog(source, reply); } catch (Exception e) { e.printStackTrace(); JOptionPane.showMessageDialog(source, MESSAGE+teamAddress+"."); } source.setVisible(false); source.dispose(); }
private void handleSendMessage(MessengerDialog source, MessengerDetails details) { Registry reg = container.getRegistry(); String url = (String) reg.lookup(LookupNames.DEBUG_URL); String teamAddress = (String) reg.lookup(LookupNames.DEBUG_EMAIL); CommunicatorDescriptor desc = new CommunicatorDescriptor (HttpChannel.CONNECTION_PER_REQUEST, url, -1); try { Communicator c = SvcRegistry.getCommunicator(desc); String error = details.getError(); String reply = ""; if (error == null || error.length() == 0) c.submitComment(details.getEmail(), details.getComment(), details.getExtra(), reply); else c.submitError(details.getEmail(), details.getComment(), details.getExtra(), error, reply); JOptionPane.showMessageDialog(source, reply); } catch (Exception e) { e.printStackTrace(); JOptionPane.showMessageDialog(source, MESSAGE+teamAddress+"."); } source.setVisible(false); source.dispose(); }
3,238,620
public boolean equals(Object object) { if (object == this) { return true; } if (object instanceof SourcePosition) { return false; } SourcePosition other = (SourcePosition) object; return file.equals(other.file) && line == other.line; }
public boolean equals(Object object) { if (object == this) { return true; } if (!(object instanceof SourcePosition)) { return false; } SourcePosition other = (SourcePosition) object; return file.equals(other.file) && line == other.line; }
3,238,621
protected void setUp() { pixels = new Pixels(); pixels.setSizeX(1024); pixels.setSizeY(1024); pixels.setSizeZ(64); pixels.setSizeC(3); pixels.setSizeT(50); PixelsType type = new PixelsType(); pixels.setPixelsType(type); // FIXME pixelBuffer = new PixelBuffer(1, pixels); }
protected void setUp() { pixels = new Pixels(); pixels.setSizeX(1024); pixels.setSizeY(1024); pixels.setSizeZ(64); pixels.setSizeC(3); pixels.setSizeT(50); PixelsType type = new PixelsType(); pixels.setPixelsType(type); // FIXME PixelsService service = PixelsService.getInstance(); pixelBuffer = service.getPixelBuffer(pixels); }
3,238,622
public void testGetInitialPlaneOffset() { assertEquals(pixelBuffer.getPlaneOffset(0, 0, 0).longValue(), 0L); }
public void testGetInitialPlaneOffset() throws DimensionsOutOfBoundsException { assertEquals(pixelBuffer.getPlaneOffset(0, 0, 0).longValue(), 0L); }
3,238,623
public void testGetPlaneOffset1() { long offset = ((long)timepointSize * 25) + ((long)planeSize * 25); assertEquals(pixelBuffer.getPlaneOffset(25, 0, 25).longValue(), offset); }
public void testGetPlaneOffset1() throws DimensionsOutOfBoundsException { long offset = ((long)timepointSize * 25) + ((long)planeSize * 25); assertEquals(pixelBuffer.getPlaneOffset(25, 0, 25).longValue(), offset); }
3,238,624
public void testGetPlaneOffset2() { long offset = ((long)timepointSize * 25) + ((long)stackSize * 1) + ((long)planeSize * 25); assertEquals(pixelBuffer.getPlaneOffset(25, 1, 25).longValue(), offset); }
public void testGetPlaneOffset2() throws DimensionsOutOfBoundsException { long offset = ((long)timepointSize * 25) + ((long)stackSize * 1) + ((long)planeSize * 25); assertEquals(pixelBuffer.getPlaneOffset(25, 1, 25).longValue(), offset); }
3,238,625
public IRubyObject set(IRubyObject value) { bean.bean = JavaUtil.convertRubyToJava(ruby, value.toRubyObject(), bean.type); return value; }
public IRubyObject set(IRubyObject value) { bean.bean = JavaUtil.convertRubyToJava(ruby, value, bean.type); return value; }
3,238,626
protected static void runInterpreter(String iString2Eval, String iFileName, String[] args) { // Initialize Runtime Ruby ruby = Ruby.getDefaultInstance(sRegexpAdapter); // Parse and interpret file RubyString rs = RubyString.newString(ruby, iString2Eval); RubyObject lArgv = JavaUtil.convertJavaToRuby(ruby, args); ruby.setVerbose(warning); ruby.defineReadonlyVariable("$VERBOSE", warning ? ruby.getTrue() : ruby.getNil()); ruby.defineGlobalConstant("ARGV", lArgv); ruby.defineReadonlyVariable("$-p", (sDoPrint ? ruby.getTrue() : ruby.getNil())); ruby.defineReadonlyVariable("$-n", (sDoLoop ? ruby.getTrue() : ruby.getNil())); ruby.defineReadonlyVariable("$-a", (sDoSplit ? ruby.getTrue() : ruby.getNil())); ruby.defineReadonlyVariable("$-l", (sDoLine ? ruby.getTrue() : ruby.getNil())); ruby.defineReadonlyVariable("$*", lArgv); ruby.defineVariable(new RubyGlobal.StringGlobalVariable(ruby, "$0", RubyString.newString(ruby, iFileName))); ruby.initLoad(sLoadDirectories); //require additional libraries int lNbRequire = sRequireFirst.size(); try { for (int i = 0; i < lNbRequire; i++) RubyKernel.require(ruby, null, new RubyString(ruby, (String) sRequireFirst.get(i))); // +++ INode lScript = ruby.compile(iString2Eval, iFileName, 0); // DumpVisitor laVisitor = new DumpVisitor(); // lScript.accept(laVisitor); // ruby.getRuntime().getOutputStream().println(laVisitor.dump()); if (sDoPrint) { // FIXME lScript = new ParserSupport().appendPrintToBlock(lScript); // ruby.getParserHelper().rb_parser_append_print(); } if (sDoLoop) { // FIXME lScript = new ParserSupport().appendWhileLoopToBlock(lScript, sDoLine, sDoSplit); // ruby.getParserHelper().rb_parser_while_loop(sDoLine, sDoSplit); } if (sCheckOnly) { DumpVisitor lVisitor = new DumpVisitor(); lScript.accept(lVisitor); ruby.getRuntime().getOutputStream().println(lVisitor.dump()); } else { ruby.getRubyTopSelf().eval(lScript); } } catch (RaiseException rExcptn) { ruby.getRuntime().printError(rExcptn.getActException()); } catch (ThrowJump throwJump) { ruby.getRuntime().printError(throwJump.getNameError()); } catch (RubyBugException lBug) { ruby.getRuntime().getErrorStream().print(lBug.getMessage()); } // --- // to look nicer ruby.getRuntime().getOutputStream().println(""); }
protected static void runInterpreter(String iString2Eval, String iFileName, String[] args) { // Initialize Runtime Ruby ruby = Ruby.getDefaultInstance(sRegexpAdapter); // Parse and interpret file RubyString rs = RubyString.newString(ruby, iString2Eval); RubyObject lArgv = JavaUtil.convertJavaToRuby(ruby, args); ruby.setVerbose(warning); ruby.defineReadonlyVariable("$VERBOSE", warning ? ruby.getTrue() : ruby.getNil()); ruby.defineGlobalConstant("ARGV", lArgv); ruby.defineReadonlyVariable("$-p", (sDoPrint ? ruby.getTrue() : ruby.getNil())); ruby.defineReadonlyVariable("$-n", (sDoLoop ? ruby.getTrue() : ruby.getNil())); ruby.defineReadonlyVariable("$-a", (sDoSplit ? ruby.getTrue() : ruby.getNil())); ruby.defineReadonlyVariable("$-l", (sDoLine ? ruby.getTrue() : ruby.getNil())); ruby.defineReadonlyVariable("$*", lArgv); ruby.defineVariable(new RubyGlobal.StringGlobalVariable(ruby, "$0", RubyString.newString(ruby, iFileName))); ruby.initLoad(sLoadDirectories); //require additional libraries int lNbRequire = sRequireFirst.size(); try { for (int i = 0; i < lNbRequire; i++) RubyKernel.require(ruby, null, new RubyString(ruby, (String) sRequireFirst.get(i))); // +++ INode lScript = ruby.compile(iString2Eval, iFileName, 0); // DumpVisitor laVisitor = new DumpVisitor(); // lScript.accept(laVisitor); // ruby.getRuntime().getOutputStream().println(laVisitor.dump()); if (sDoPrint) { // FIXME lScript = new ParserSupport().appendPrintToBlock(lScript); // ruby.getParserHelper().rb_parser_append_print(); } if (sDoLoop) { // FIXME lScript = new ParserSupport().appendWhileLoopToBlock(lScript, sDoLine, sDoSplit); // ruby.getParserHelper().rb_parser_while_loop(sDoLine, sDoSplit); } if (sCheckOnly) { DumpVisitor lVisitor = new DumpVisitor(); lScript.accept(lVisitor); ruby.getRuntime().getOutputStream().println(lVisitor.dump()); } else { ruby.getRubyTopSelf().eval(lScript); } } catch (RaiseException rExcptn) { ruby.getRuntime().printError(rExcptn.getActException()); } catch (ThrowJump throwJump) { ruby.getRuntime().printError(throwJump.getNameError()); } catch (RubyBugException lBug) { ruby.getRuntime().getErrorStream().print(lBug.getMessage()); } // --- // to look nicer }
3,238,627
public boolean load(String file) { if (file.endsWith(".jar")) { // FIXME return false; } else { if (!file.endsWith(".rb")) { file += ".rb"; } runtime.getRuntime().loadFile(findFile(file), false); } return true; }
public boolean load(String file) { if (file.endsWith(".jar")) { // FIXME return false; } else { if (!file.endsWith(".rb")) { file += ".rb"; } runtime.getRuntime().loadFile(findFile(file), false); } return true; }
3,238,628
public void setUp() throws Exception { ruby = Ruby.getDefaultInstance(null); eval("$h = {'foo' => 'bar'}"); }
public void setUp() throws Exception { if (ruby == null) { ruby = Ruby.getDefaultInstance(null); } eval("$h = {'foo' => 'bar'}"); }
3,238,631
final public Object evaluate (Context context) throws PropertyException { try { Object val = getValue(context); if (val instanceof Macro) { val = ((Macro) val).evaluate(context); // recurse } return val; } catch (NullPointerException e) { // May throw context.getEvaluationExceptionHandler() .evaluate(this, context, new PropertyException.NullValueException(_vname)); return null; } catch (PropertyException e) { // May throw if (e instanceof PropertyException.UndefinedVariableException) { PropertyException.UndefinedVariableException uve = (PropertyException.UndefinedVariableException) e; if (_names.length > 1) uve.setMessage( "Attempted to reference a property or method of an undefined variable: $" + _names[0]); else uve.setMessage( "Attempted to evaluate an undefined variable: $" + _names[0]); } context.getEvaluationExceptionHandler() .evaluate(this, context, e); return null; } catch (Exception e) { // May throw context.getEvaluationExceptionHandler() .evaluate(this, context, new PropertyException("Variable: exception evaluating " + _vname, e)); return null; } }
final public Object evaluate (Context context) throws PropertyException { try { Object val = getValue(context); if (val instanceof Macro) { val = ((Macro) val).evaluate(context); // recurse } return val; } catch (NullPointerException e) { // May throw context.getEvaluationExceptionHandler() .evaluate(this, context, new PropertyException.NullValueException(getVariableName())); return null; } catch (PropertyException e) { // May throw if (e instanceof PropertyException.UndefinedVariableException) { PropertyException.UndefinedVariableException uve = (PropertyException.UndefinedVariableException) e; if (_names.length > 1) uve.setMessage( "Attempted to reference a property or method of an undefined variable: $" + _names[0]); else uve.setMessage( "Attempted to evaluate an undefined variable: $" + _names[0]); } context.getEvaluationExceptionHandler() .evaluate(this, context, e); return null; } catch (Exception e) { // May throw context.getEvaluationExceptionHandler() .evaluate(this, context, new PropertyException("Variable: exception evaluating " + _vname, e)); return null; } }
3,238,632
final public Object evaluate (Context context) throws PropertyException { try { Object val = getValue(context); if (val instanceof Macro) { val = ((Macro) val).evaluate(context); // recurse } return val; } catch (NullPointerException e) { // May throw context.getEvaluationExceptionHandler() .evaluate(this, context, new PropertyException.NullValueException(_vname)); return null; } catch (PropertyException e) { // May throw if (e instanceof PropertyException.UndefinedVariableException) { PropertyException.UndefinedVariableException uve = (PropertyException.UndefinedVariableException) e; if (_names.length > 1) uve.setMessage( "Attempted to reference a property or method of an undefined variable: $" + _names[0]); else uve.setMessage( "Attempted to evaluate an undefined variable: $" + _names[0]); } context.getEvaluationExceptionHandler() .evaluate(this, context, e); return null; } catch (Exception e) { // May throw context.getEvaluationExceptionHandler() .evaluate(this, context, new PropertyException("Variable: exception evaluating " + _vname, e)); return null; } }
final public Object evaluate (Context context) throws PropertyException { try { Object val = getValue(context); if (val instanceof Macro) { val = ((Macro) val).evaluate(context); // recurse } return val; } catch (NullPointerException e) { // May throw context.getEvaluationExceptionHandler() .evaluate(this, context, new PropertyException.NullValueException(_vname)); return null; } catch (PropertyException e) { // May throw if (e instanceof PropertyException.UndefinedVariableException) { PropertyException.UndefinedVariableException uve = (PropertyException.UndefinedVariableException) e; if (_names.length > 1) uve.setMessage( "Attempted to reference a property or method of an undefined variable: $" + _names[0]); else uve.setMessage( "Attempted to evaluate an undefined variable: $" + _names[0]); } context.getEvaluationExceptionHandler() .evaluate(this, context, e); return null; } catch (Exception e) { // May throw context.getEvaluationExceptionHandler() .evaluate(this, context, new PropertyException("Variable: exception evaluating " + getVariableName(), e)); return null; } }
3,238,633
final public void write (FastWriter out, Context context) throws PropertyException, IOException { try { Object val = getValue(context); if (val instanceof Macro) ((Macro) val).write(out, context); else { if (val != null) { String v = val.toString(); if (v != null) out.write(v); else { out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NullToStringException(_vname))); } } else { if (isSimpleName()) { // user accessed a variable that isn't in the context // $ObjectNotInContext out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NoSuchVariableException(_vname))); } else { // user accessed a valid property who's value is null out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NullValueException(_vname))); } } } } catch (PropertyException e) { if (e instanceof PropertyException.UndefinedVariableException) { PropertyException.UndefinedVariableException uve = (PropertyException.UndefinedVariableException) e; if (_names.length > 1) uve.setMessage( "Attempted to write a property or method value of an undefined variable: $" + _names[0]); else uve.setMessage( "Attempted to write an undefined variable: $" + _names[0]); } out.write(context.getEvaluationExceptionHandler() .expand(this, context, e)); } catch (Exception e) { // something we weren't expecting happened! // I wonder if we would ever get here? --eric out.write(context.getEvaluationExceptionHandler() .expand(this, context, e)); } }
final public void write (FastWriter out, Context context) throws PropertyException, IOException { try { Object val = getValue(context); if (val instanceof Macro) ((Macro) val).write(out, context); else { if (val != null) { String v = val.toString(); if (v != null) out.write(v); else { out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NullToStringException(getVariableName()))); } } else { if (isSimpleName()) { // user accessed a variable that isn't in the context // $ObjectNotInContext out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NoSuchVariableException(_vname))); } else { // user accessed a valid property who's value is null out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NullValueException(_vname))); } } } } catch (PropertyException e) { if (e instanceof PropertyException.UndefinedVariableException) { PropertyException.UndefinedVariableException uve = (PropertyException.UndefinedVariableException) e; if (_names.length > 1) uve.setMessage( "Attempted to write a property or method value of an undefined variable: $" + _names[0]); else uve.setMessage( "Attempted to write an undefined variable: $" + _names[0]); } out.write(context.getEvaluationExceptionHandler() .expand(this, context, e)); } catch (Exception e) { // something we weren't expecting happened! // I wonder if we would ever get here? --eric out.write(context.getEvaluationExceptionHandler() .expand(this, context, e)); } }
3,238,634
final public void write (FastWriter out, Context context) throws PropertyException, IOException { try { Object val = getValue(context); if (val instanceof Macro) ((Macro) val).write(out, context); else { if (val != null) { String v = val.toString(); if (v != null) out.write(v); else { out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NullToStringException(_vname))); } } else { if (isSimpleName()) { // user accessed a variable that isn't in the context // $ObjectNotInContext out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NoSuchVariableException(_vname))); } else { // user accessed a valid property who's value is null out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NullValueException(_vname))); } } } } catch (PropertyException e) { if (e instanceof PropertyException.UndefinedVariableException) { PropertyException.UndefinedVariableException uve = (PropertyException.UndefinedVariableException) e; if (_names.length > 1) uve.setMessage( "Attempted to write a property or method value of an undefined variable: $" + _names[0]); else uve.setMessage( "Attempted to write an undefined variable: $" + _names[0]); } out.write(context.getEvaluationExceptionHandler() .expand(this, context, e)); } catch (Exception e) { // something we weren't expecting happened! // I wonder if we would ever get here? --eric out.write(context.getEvaluationExceptionHandler() .expand(this, context, e)); } }
final public void write (FastWriter out, Context context) throws PropertyException, IOException { try { Object val = getValue(context); if (val instanceof Macro) ((Macro) val).write(out, context); else { if (val != null) { String v = val.toString(); if (v != null) out.write(v); else { out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NullToStringException(_vname))); } } else { if (isSimpleName()) { // user accessed a variable that isn't in the context // $ObjectNotInContext out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NoSuchVariableException(getVariableName()))); } else { // user accessed a valid property who's value is null out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NullValueException(_vname))); } } } } catch (PropertyException e) { if (e instanceof PropertyException.UndefinedVariableException) { PropertyException.UndefinedVariableException uve = (PropertyException.UndefinedVariableException) e; if (_names.length > 1) uve.setMessage( "Attempted to write a property or method value of an undefined variable: $" + _names[0]); else uve.setMessage( "Attempted to write an undefined variable: $" + _names[0]); } out.write(context.getEvaluationExceptionHandler() .expand(this, context, e)); } catch (Exception e) { // something we weren't expecting happened! // I wonder if we would ever get here? --eric out.write(context.getEvaluationExceptionHandler() .expand(this, context, e)); } }
3,238,635
final public void write (FastWriter out, Context context) throws PropertyException, IOException { try { Object val = getValue(context); if (val instanceof Macro) ((Macro) val).write(out, context); else { if (val != null) { String v = val.toString(); if (v != null) out.write(v); else { out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NullToStringException(_vname))); } } else { if (isSimpleName()) { // user accessed a variable that isn't in the context // $ObjectNotInContext out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NoSuchVariableException(_vname))); } else { // user accessed a valid property who's value is null out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NullValueException(_vname))); } } } } catch (PropertyException e) { if (e instanceof PropertyException.UndefinedVariableException) { PropertyException.UndefinedVariableException uve = (PropertyException.UndefinedVariableException) e; if (_names.length > 1) uve.setMessage( "Attempted to write a property or method value of an undefined variable: $" + _names[0]); else uve.setMessage( "Attempted to write an undefined variable: $" + _names[0]); } out.write(context.getEvaluationExceptionHandler() .expand(this, context, e)); } catch (Exception e) { // something we weren't expecting happened! // I wonder if we would ever get here? --eric out.write(context.getEvaluationExceptionHandler() .expand(this, context, e)); } }
final public void write (FastWriter out, Context context) throws PropertyException, IOException { try { Object val = getValue(context); if (val instanceof Macro) ((Macro) val).write(out, context); else { if (val != null) { String v = val.toString(); if (v != null) out.write(v); else { out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NullToStringException(_vname))); } } else { if (isSimpleName()) { // user accessed a variable that isn't in the context // $ObjectNotInContext out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NoSuchVariableException(_vname))); } else { // user accessed a valid property who's value is null out.write(context.getEvaluationExceptionHandler() .expand(this, context, new PropertyException.NullValueException(getVariableName()))); } } } } catch (PropertyException e) { if (e instanceof PropertyException.UndefinedVariableException) { PropertyException.UndefinedVariableException uve = (PropertyException.UndefinedVariableException) e; if (_names.length > 1) uve.setMessage( "Attempted to write a property or method value of an undefined variable: $" + _names[0]); else uve.setMessage( "Attempted to write an undefined variable: $" + _names[0]); } out.write(context.getEvaluationExceptionHandler() .expand(this, context, e)); } catch (Exception e) { // something we weren't expecting happened! // I wonder if we would ever get here? --eric out.write(context.getEvaluationExceptionHandler() .expand(this, context, e)); } }
3,238,636
public void renameNote(Event e) { String newName = dd.getTree().getTreeEditorText(); DisplayedNote dn = dd.getTree().getSelectedNode().getDisplayedNote(); dn.getNote().setName(newName); dn.getTreeNode().setName(newName); if (dn.getTab() != null) dn.getTab().setName(newName); }
public void renameNote(Event e) { String newName = dd.getTree().getTreeEditorText(); DisplayedNote dn = dd.getTree().getSelectedNode().getDisplayedNote(); dn.getNote().setName(newName); dn.getTreeNode().setName(newName); if (dn.getTab() != null) dn.getTab().setName(newName); }
3,238,637
public void renameNote(Event e) { String newName = dd.getTree().getTreeEditorText(); DisplayedNote dn = dd.getTree().getSelectedNode().getDisplayedNote(); dn.getNote().setName(newName); dn.getTreeNode().setName(newName); if (dn.getTab() != null) dn.getTab().setName(newName); }
public void renameNote(Event e) { String newName = dd.getTree().getTreeEditorText(); DisplayedNote dn = dd.getTree().getSelectedNode().getDisplayedNote(); dn.getNote().setName(newName); dn.getTreeNode().setName(newName); if (dn.getTab() != null) dn.getTab().setName(newName); }
3,238,638
public RubyClass getSingletonClassClone() { if (!isSingleton()) { return this; } MetaClass clone = new MetaClass(getRuntime(), getMetaClass(), getSuperClass()); clone.initCopy(this); clone.setInstanceVariables(new HashMap(getInstanceVariables())); return (RubyClass) cloneMethods(clone); }
public RubyClass getSingletonClassClone() { if (!isSingleton()) { return this; } MetaClass clone = new MetaClass(getRuntime(), getMetaClass(), getSuperClass().getCRef()); clone.initCopy(this); clone.setInstanceVariables(new HashMap(getInstanceVariables())); return (RubyClass) cloneMethods(clone); }
3,238,639
public static RubyClass newClass(IRuby runtime, RubyClass superClass, RubyModule parentClass, String name) { return new RubyClass(runtime, runtime.getClass("Class"), superClass, parentClass, name); }
public static RubyClass newClass(IRuby runtime, RubyClass superClass, RubyModule parentClass, String name) { return new RubyClass(runtime, runtime.getClass("Class"), superClass, parentClass, name); }
3,238,640
public MetaClass newSingletonClass(RubyModule parent) { MetaClass newClass = new MetaClass(getRuntime(), this, parent); newClass.infectBy(this); return newClass; }
public MetaClass newSingletonClass(RubyModule parent) { MetaClass newClass = new MetaClass(getRuntime(), this, parent); newClass.infectBy(this); return newClass; }
3,238,641
public RubyClass newSubClass(String name, RubyModule parent) { RubyClass newClass = new RubyClass(runtime, runtime.getClass("Class"), this, parent, name); newClass.makeMetaClass(getMetaClass(), newClass); newClass.inheritedBy(this); parent.setConstant(name, newClass); return newClass; }
public RubyClass newSubClass(String name, RubyModule parent) { RubyClass newClass = new RubyClass(runtime, runtime.getClass("Class"), this, parent, name); newClass.makeMetaClass(getMetaClass(), newClass); newClass.inheritedBy(this); parent.setConstant(name, newClass); return newClass; }
3,238,642
public RubyClass newSubClass(String name, RubyModule parent) { RubyClass newClass = new RubyClass(runtime, runtime.getClass("Class"), this, parent, name); newClass.makeMetaClass(getMetaClass(), newClass); newClass.inheritedBy(this); parent.setConstant(name, newClass); return newClass; }
public RubyClass newSubClass(String name, RubyModule parent) { RubyClass newClass = new RubyClass(runtime, runtime.getClass("Class"), this, parent, name); newClass.makeMetaClass(getMetaClass(), newClass.getCRef()); newClass.inheritedBy(this); parent.setConstant(name, newClass); return newClass; }
3,238,643
public RubyClass newSubClass(String name, RubyModule parent) { RubyClass newClass = new RubyClass(runtime, runtime.getClass("Class"), this, parent, name); newClass.makeMetaClass(getMetaClass(), newClass); newClass.inheritedBy(this); parent.setConstant(name, newClass); return newClass; }
public RubyClass newSubClass(String name, RubyModule parent) { RubyClass newClass = new RubyClass(runtime, runtime.getClass("Class"), this, parent, name); newClass.makeMetaClass(getMetaClass(), newClass); newClass.inheritedBy(this); ((RubyModule)parentCRef.getValue()).setConstant(name, newClass); return newClass; }
3,238,644
private Session acquireBindAndConfigureSession() throws HibernateException { debug("Opening and binding session."); Session session = factory.openSession(); session.setFlushMode( FlushMode.NEVER ); bindSession(session); return session; }
private Session acquireBindAndConfigureSession() throws HibernateException { debug("Opening and binding session."); Session session = factory.openSession(); session.setFlushMode( FlushMode.COMMIT ); bindSession(session); return session; }
3,238,645
HistogramPanel(HistogramDialogManager manager, int mini, int maxi, int startReal, int endReal, int yStart, int yEnd, PixelsStatsEntry[] histogramData) { this.histogramData = histogramData; this.manager = manager; sizeBin = (int) (widthStat/histogramData.length); setWindowLimits(mini, maxi); setInputWindow(startReal, endReal); //control output window controlOutputStart = yStart; heightStart = tS-yStart; heightEnd = yEnd-topBorder; controlOutputEnd = yEnd; //output knob setKnobOutputStart(lS+10, yStart); setKnobOutputEnd(lS+10, yEnd); super.repaint(); }
HistogramPanel(HistogramDialogManager manager, int mini, int maxi, int startReal, int endReal, int yStart, int yEnd, PixelsStatsEntry[] histogramData) { this.histogramData = histogramData; this.manager = manager; sizeBin = (int) (widthStat/histogramData.length); setWindowLimits(mini, maxi); setInputWindow(startReal, endReal); //control output window controlOutputStart = yStart; heightStart = tS-yStart; heightEnd = yEnd-topBorder; controlOutputEnd = yEnd; //output knob setKnobOutputStart(lS+10, yStart); setKnobOutputEnd(lS+10, yEnd); super.repaint(); }
3,238,646