bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
public void addGroups(Experimenter user, ExperimenterGroup[] groups) { if (user == null) return; // Handled by annotations if (groups == null) return; Experimenter foundUser = iQuery.get(Experimenter.class,user.getId()); for (ExperimenterGroup group : groups) { ExperimenterGroup foundGroup = iQuery.get(ExperimenterGroup.class, group.getId()); foundUser.linkExperimenterGroup(foundGroup); } iUpdate.flush(); }
|
public void addGroups(Experimenter user, ExperimenterGroup[] groups) { if (user == null) return; // Handled by annotations if (groups == null) return; Experimenter foundUser = iQuery.get(Experimenter.class,user.getId()); for (ExperimenterGroup group : groups) { ExperimenterGroup foundGroup = internalGetGroup(group.getId()); foundUser.linkExperimenterGroup(foundGroup); } iUpdate.flush(); }
| 3,230,750
|
public void changeGroup(IObject iObject, String groupName) { // TODO Auto-generated method stub }
|
final LocalUpdate update = iUpdate; final IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); ExperimenterGroup group = internalLookupGroup(groupName); copy.getDetails().setGroup(group); securitySystem.doAction(copy, new SecureAction(){ public IObject updateObject(IObject obj) { update.flush(); return null; } }); final LocalUpdate update = iUpdate; final IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); ExperimenterGroup group = internalLookupGroup(groupName); copy.getDetails().setGroup(group); securitySystem.doAction(copy, new SecureAction(){ public IObject updateObject(IObject obj) { update.flush(); return null; } }); public void changeGroup(IObject iObject, String groupName)final LocalUpdate update = iUpdate; final IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); ExperimenterGroup group = internalLookupGroup(groupName); copy.getDetails().setGroup(group); securitySystem.doAction(copy, new SecureAction(){ public IObject updateObject(IObject obj) { update.flush(); return null; } }); final LocalUpdate update = iUpdate; final IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); ExperimenterGroup group = internalLookupGroup(groupName); copy.getDetails().setGroup(group); securitySystem.doAction(copy, new SecureAction(){ public IObject updateObject(IObject obj) { update.flush(); return null; } }); {final LocalUpdate update = iUpdate; final IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); ExperimenterGroup group = internalLookupGroup(groupName); copy.getDetails().setGroup(group); securitySystem.doAction(copy, new SecureAction(){ public IObject updateObject(IObject obj) { update.flush(); return null; } }); final LocalUpdate update = iUpdate; final IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); ExperimenterGroup group = internalLookupGroup(groupName); copy.getDetails().setGroup(group); securitySystem.doAction(copy, new SecureAction(){ public IObject updateObject(IObject obj) { update.flush(); return null; } }); final LocalUpdate update = iUpdate; final IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); ExperimenterGroup group = internalLookupGroup(groupName); copy.getDetails().setGroup(group); securitySystem.doAction(copy, new SecureAction(){ public IObject updateObject(IObject obj) { update.flush(); return null; } }); final LocalUpdate update = iUpdate; final IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); ExperimenterGroup group = internalLookupGroup(groupName); copy.getDetails().setGroup(group); securitySystem.doAction(copy, new SecureAction(){ public IObject updateObject(IObject obj) { update.flush(); return null; } }); // TODO Auto-generated method stubfinal LocalUpdate update = iUpdate; final IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); ExperimenterGroup group = internalLookupGroup(groupName); copy.getDetails().setGroup(group); securitySystem.doAction(copy, new SecureAction(){ public IObject updateObject(IObject obj) { update.flush(); return null; } }); final LocalUpdate update = iUpdate; final IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); ExperimenterGroup group = internalLookupGroup(groupName); copy.getDetails().setGroup(group); securitySystem.doAction(copy, new SecureAction(){ public IObject updateObject(IObject obj) { update.flush(); return null; } }); final LocalUpdate update = iUpdate; final IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); ExperimenterGroup group = internalLookupGroup(groupName); copy.getDetails().setGroup(group); securitySystem.doAction(copy, new SecureAction(){ public IObject updateObject(IObject obj) { update.flush(); return null; } }); final LocalUpdate update = iUpdate; final IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); ExperimenterGroup group = internalLookupGroup(groupName); copy.getDetails().setGroup(group); securitySystem.doAction(copy, new SecureAction(){ public IObject updateObject(IObject obj) { update.flush(); return null; } }); final LocalUpdate update = iUpdate; final IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); ExperimenterGroup group = internalLookupGroup(groupName); copy.getDetails().setGroup(group); securitySystem.doAction(copy, new SecureAction(){ public IObject updateObject(IObject obj) { update.flush(); return null; } }); final LocalUpdate update = iUpdate; final IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); ExperimenterGroup group = internalLookupGroup(groupName); copy.getDetails().setGroup(group); securitySystem.doAction(copy, new SecureAction(){ public IObject updateObject(IObject obj) { update.flush(); return null; } }); }
| 3,230,751
|
public void changeOwner(IObject iObject, String omeName) { // TODO Auto-generated method stub }
|
IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Experimenter owner = internalLookupExperimenter(omeName); copy.getDetails().setOwner(owner); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Experimenter owner = internalLookupExperimenter(omeName); copy.getDetails().setOwner(owner); iUpdate.saveObject(copy); public void changeOwner(IObject iObject, String omeName) IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Experimenter owner = internalLookupExperimenter(omeName); copy.getDetails().setOwner(owner); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Experimenter owner = internalLookupExperimenter(omeName); copy.getDetails().setOwner(owner); iUpdate.saveObject(copy); { IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Experimenter owner = internalLookupExperimenter(omeName); copy.getDetails().setOwner(owner); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Experimenter owner = internalLookupExperimenter(omeName); copy.getDetails().setOwner(owner); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Experimenter owner = internalLookupExperimenter(omeName); copy.getDetails().setOwner(owner); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Experimenter owner = internalLookupExperimenter(omeName); copy.getDetails().setOwner(owner); iUpdate.saveObject(copy); // TODO Auto-generated method stub IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Experimenter owner = internalLookupExperimenter(omeName); copy.getDetails().setOwner(owner); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Experimenter owner = internalLookupExperimenter(omeName); copy.getDetails().setOwner(owner); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Experimenter owner = internalLookupExperimenter(omeName); copy.getDetails().setOwner(owner); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Experimenter owner = internalLookupExperimenter(omeName); copy.getDetails().setOwner(owner); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Experimenter owner = internalLookupExperimenter(omeName); copy.getDetails().setOwner(owner); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Experimenter owner = internalLookupExperimenter(omeName); copy.getDetails().setOwner(owner); iUpdate.saveObject(copy); }
| 3,230,752
|
public void changePermissions(IObject iObject, Permissions perms) { // TODO Auto-generated method stub }
|
IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Permissions p = new Permissions().applyMask(perms); copy.getDetails().setPermissions(p); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Permissions p = new Permissions().applyMask(perms); copy.getDetails().setPermissions(p); iUpdate.saveObject(copy); public void changePermissions(IObject iObject, Permissions perms) IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Permissions p = new Permissions().applyMask(perms); copy.getDetails().setPermissions(p); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Permissions p = new Permissions().applyMask(perms); copy.getDetails().setPermissions(p); iUpdate.saveObject(copy); { IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Permissions p = new Permissions().applyMask(perms); copy.getDetails().setPermissions(p); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Permissions p = new Permissions().applyMask(perms); copy.getDetails().setPermissions(p); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Permissions p = new Permissions().applyMask(perms); copy.getDetails().setPermissions(p); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Permissions p = new Permissions().applyMask(perms); copy.getDetails().setPermissions(p); iUpdate.saveObject(copy); // TODO Auto-generated method stub IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Permissions p = new Permissions().applyMask(perms); copy.getDetails().setPermissions(p); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Permissions p = new Permissions().applyMask(perms); copy.getDetails().setPermissions(p); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Permissions p = new Permissions().applyMask(perms); copy.getDetails().setPermissions(p); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Permissions p = new Permissions().applyMask(perms); copy.getDetails().setPermissions(p); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Permissions p = new Permissions().applyMask(perms); copy.getDetails().setPermissions(p); iUpdate.saveObject(copy); IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Permissions p = new Permissions().applyMask(perms); copy.getDetails().setPermissions(p); iUpdate.saveObject(copy); }
| 3,230,753
|
public Experimenter createExperimenter(Experimenter experimenter, ExperimenterGroup defaultGroup, ExperimenterGroup[] otherGroups) {// TODO check that no other group is default Experimenter e = copyUser( experimenter ); if ( defaultGroup == null || defaultGroup.getId() == null ) { throw new ApiUsageException("Default group may not be null."); } GroupExperimenterMap defaultGroupMap = new GroupExperimenterMap(); defaultGroupMap.link( getGroup(defaultGroup.getId()), e); defaultGroupMap.setDefaultGroupLink(Boolean.TRUE); e.addGroupExperimenterMap(defaultGroupMap, false); if ( null != otherGroups ) { for (ExperimenterGroup group : otherGroups) { if ( group == null ) continue; if ( group.getId() == null) { throw new ApiUsageException( "Groups must be previously saved during " + "Experimenter creation."); } GroupExperimenterMap groupMap = new GroupExperimenterMap(); groupMap.link( getGroup(group.getId()), e); e.addGroupExperimenterMap(groupMap, false); } } e = iUpdate.saveAndReturnObject( e ); changeUserPassword(e.getOmeName()," "); return lookupExperimenter(e.getOmeName()); }
|
public Experimenter createExperimenter( Experimenter experimenter, ExperimenterGroup defaultGroup, ExperimenterGroup[] otherGroups) {// TODO check that no other group is default Experimenter e = copyUser( experimenter ); if ( defaultGroup == null || defaultGroup.getId() == null ) { throw new ApiUsageException("Default group may not be null."); } GroupExperimenterMap defaultGroupMap = new GroupExperimenterMap(); defaultGroupMap.link( getGroup(defaultGroup.getId()), e); defaultGroupMap.setDefaultGroupLink(Boolean.TRUE); e.addGroupExperimenterMap(defaultGroupMap, false); if ( null != otherGroups ) { for (ExperimenterGroup group : otherGroups) { if ( group == null ) continue; if ( group.getId() == null) { throw new ApiUsageException( "Groups must be previously saved during " + "Experimenter creation."); } GroupExperimenterMap groupMap = new GroupExperimenterMap(); groupMap.link( getGroup(group.getId()), e); e.addGroupExperimenterMap(groupMap, false); } } e = iUpdate.saveAndReturnObject( e ); changeUserPassword(e.getOmeName()," "); return lookupExperimenter(e.getOmeName()); }
| 3,230,754
|
public Experimenter createExperimenter(Experimenter experimenter, ExperimenterGroup defaultGroup, ExperimenterGroup[] otherGroups) {// TODO check that no other group is default Experimenter e = copyUser( experimenter ); if ( defaultGroup == null || defaultGroup.getId() == null ) { throw new ApiUsageException("Default group may not be null."); } GroupExperimenterMap defaultGroupMap = new GroupExperimenterMap(); defaultGroupMap.link( getGroup(defaultGroup.getId()), e); defaultGroupMap.setDefaultGroupLink(Boolean.TRUE); e.addGroupExperimenterMap(defaultGroupMap, false); if ( null != otherGroups ) { for (ExperimenterGroup group : otherGroups) { if ( group == null ) continue; if ( group.getId() == null) { throw new ApiUsageException( "Groups must be previously saved during " + "Experimenter creation."); } GroupExperimenterMap groupMap = new GroupExperimenterMap(); groupMap.link( getGroup(group.getId()), e); e.addGroupExperimenterMap(groupMap, false); } } e = iUpdate.saveAndReturnObject( e ); changeUserPassword(e.getOmeName()," "); return lookupExperimenter(e.getOmeName()); }
|
public Experimenter createExperimenter(Experimenter experimenter, ExperimenterGroup defaultGroup, ExperimenterGroup[] otherGroups) {// TODO check that no other group is default Experimenter e = copyUser( experimenter ); if ( defaultGroup == null || defaultGroup.getId() == null ) { throw new ApiUsageException("Default group may not be null."); } GroupExperimenterMap defaultGroupMap = new GroupExperimenterMap(); defaultGroupMap.link( getGroup(defaultGroup.getId()), e); defaultGroupMap.setDefaultGroupLink(Boolean.TRUE); e.addGroupExperimenterMap(defaultGroupMap, false); if ( null != otherGroups ) { for (ExperimenterGroup group : otherGroups) { if ( group == null ) continue; if ( group.getId() == null) { throw new ApiUsageException( "Groups must be previously saved during " + "Experimenter creation."); } GroupExperimenterMap groupMap = new GroupExperimenterMap(); groupMap.link( getGroup(group.getId()), e); e.addGroupExperimenterMap(groupMap, false); } } e = iUpdate.saveAndReturnObject( e ); changeUserPassword(e.getOmeName()," "); return lookupExperimenter(e.getOmeName()); }
| 3,230,755
|
public Experimenter createExperimenter(Experimenter experimenter, ExperimenterGroup defaultGroup, ExperimenterGroup[] otherGroups) {// TODO check that no other group is default Experimenter e = copyUser( experimenter ); if ( defaultGroup == null || defaultGroup.getId() == null ) { throw new ApiUsageException("Default group may not be null."); } GroupExperimenterMap defaultGroupMap = new GroupExperimenterMap(); defaultGroupMap.link( getGroup(defaultGroup.getId()), e); defaultGroupMap.setDefaultGroupLink(Boolean.TRUE); e.addGroupExperimenterMap(defaultGroupMap, false); if ( null != otherGroups ) { for (ExperimenterGroup group : otherGroups) { if ( group == null ) continue; if ( group.getId() == null) { throw new ApiUsageException( "Groups must be previously saved during " + "Experimenter creation."); } GroupExperimenterMap groupMap = new GroupExperimenterMap(); groupMap.link( getGroup(group.getId()), e); e.addGroupExperimenterMap(groupMap, false); } } e = iUpdate.saveAndReturnObject( e ); changeUserPassword(e.getOmeName()," "); return lookupExperimenter(e.getOmeName()); }
|
public Experimenter createExperimenter(Experimenter experimenter, ExperimenterGroup defaultGroup, ExperimenterGroup[] otherGroups) {// TODO check that no other group is default Experimenter e = copyUser( experimenter ); if ( defaultGroup == null || defaultGroup.getId() == null ) { throw new ApiUsageException("Default group may not be null."); } GroupExperimenterMap defaultGroupMap = new GroupExperimenterMap(); defaultGroupMap.link( getGroup(defaultGroup.getId()), e); defaultGroupMap.setDefaultGroupLink(Boolean.TRUE); e.addGroupExperimenterMap(defaultGroupMap, false); if ( null != otherGroups ) { for (ExperimenterGroup group : otherGroups) { if ( group == null ) continue; if ( group.getId() == null) { throw new ApiUsageException( "Groups must be previously saved during " + "Experimenter creation."); } GroupExperimenterMap groupMap = new GroupExperimenterMap(); groupMap.link( internalGetGroup(group.getId()), e); e.addGroupExperimenterMap(groupMap, false); } } e = iUpdate.saveAndReturnObject( e ); changeUserPassword(e.getOmeName()," "); return lookupExperimenter(e.getOmeName()); }
| 3,230,756
|
public ExperimenterGroup createGroup(ExperimenterGroup group) { group = copyGroup( group ); ExperimenterGroup g = iUpdate.saveAndReturnObject( group ); return g; }
|
public ExperimenterGroup createGroup(ExperimenterGroup group) { group = copyGroup( group ); ExperimenterGroup g = iUpdate.saveAndReturnObject( group ); return lookupGroup(g.getName()); }
| 3,230,757
|
public Experimenter createSystemUser(Experimenter newSystemUser) { Experimenter e = createExperimenter( newSystemUser, lookupGroup("system"), new ExperimenterGroup[]{ lookupGroup("user") } ); return e; }
|
public Experimenter createSystemUser(Experimenter newSystemUser) { Experimenter e = createExperimenter( newSystemUser, internalLookupGroup("system"), new ExperimenterGroup[]{ lookupGroup("user") } ); return e; }
| 3,230,758
|
public Experimenter createUser(Experimenter newUser) { Experimenter e = createExperimenter(newUser, lookupGroup("user"),null); return e; }
|
public Experimenter createUser(Experimenter newUser) { Experimenter e = createExperimenter( newUser, internalLookupGroup("user"),null); return e; }
| 3,230,759
|
public void deleteExperimenter( Experimenter user ) { Experimenter e = getExperimenter(user.getId()); int count = jdbc.update("delete from password where experimenter_id = ?", e.getId()); if ( count == 0 ) { log.info("No password found for user " +e.getOmeName() +". Cannot delete."); } iUpdate.deleteObject(e); }
|
public void deleteExperimenter( Experimenter user ) { Experimenter e = internalGetExperimenter(user.getId()); int count = jdbc.update("delete from password where experimenter_id = ?", e.getId()); if ( count == 0 ) { log.info("No password found for user " +e.getOmeName() +". Cannot delete."); } iUpdate.deleteObject(e); }
| 3,230,760
|
public MetaClass newSingletonClass() { MetaClass newClass = new MetaClass(getRuntime(), this); newClass.infectBy(this); return newClass; }
|
public MetaClass newSingletonClass() { MetaClass newClass = new MetaClass(getRuntime(), this); newClass.infectBy(this); return newClass; }
| 3,230,761
|
public RubyClass newSubClass(String name, RubyModule parentModule) { Ruby runtime = getRuntime(); RubyClass newClass = new RubyClass(runtime, runtime.getClasses().getClassClass(), this, parentModule, name); newClass.makeMetaClass(getMetaClass()); newClass.inheritedBy(this); runtime.getClasses().putClass(name, newClass, parentModule); return newClass; }
|
public RubyClass newSubClass(String name, RubyModule parentModule) { Ruby runtime = getRuntime(); RubyClass newClass = new RubyClass(runtime, runtime.getClasses().getClassClass(), this, parentModule, name); newClass.makeMetaClass(getMetaClass(), newClass); newClass.inheritedBy(this); runtime.getClasses().putClass(name, newClass, parentModule); return newClass; }
| 3,230,762
|
public void propertyChange(PropertyChangeEvent pce) { Browser browser = model.getBrowser(); ImageDisplay d = browser.getSelectedDisplay(); String propName = pce.getPropertyName(); if (Browser.POPUP_POINT_PROPERTY.equals(propName)) { Point p = browser.getPopupPoint(); if (d != null && p != null) view.showPopup(d, p); } else if (Browser.THUMB_SELECTED_PROPERTY.equals(propName)) { ThumbWinManager.display((ImageNode) d, model); } else if (TreeView.TREE_POPUP_POINT_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null Point p = treeView.getPopupPoint(); if (p != null) view.showPopup(((JComponent) pce.getNewValue()), p); } else if (TreeView.CLOSE_PROPERTY.equals(propName)) { model.showTreeView(false); } else if (TreeView.SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null browser.setSelectedDisplay((ImageDisplay) pce.getNewValue()); } else if (Browser.SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; treeView.accept(new SelectedNodeVisitor(treeView, d)); } }
|
public void propertyChange(PropertyChangeEvent pce) { Browser browser = model.getBrowser(); ImageDisplay d = browser.getSelectedDisplay(); String propName = pce.getPropertyName(); if (Browser.POPUP_POINT_PROPERTY.equals(propName)) { Point p = browser.getPopupPoint(); if (d != null && p != null) view.showPopup(d, p); } else if (Browser.THUMB_SELECTED_PROPERTY.equals(propName)) { ThumbWinManager.display((ImageNode) d, model); } else if (TreeView.TREE_POPUP_POINT_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null Point p = treeView.getPopupPoint(); if (p != null) view.showPopup(((JComponent) pce.getNewValue()), p); } else if (TreeView.CLOSE_PROPERTY.equals(propName)) { model.showTreeView(false); } else if (TreeView.SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null browser.setSelectedDisplay((ImageDisplay) pce.getNewValue()); } else if (Browser.SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; treeView.accept(new SelectedNodeVisitor(treeView, d)); } }
| 3,230,763
|
public void propertyChange(PropertyChangeEvent pce) { Browser browser = model.getBrowser(); ImageDisplay d = browser.getSelectedDisplay(); String propName = pce.getPropertyName(); if (Browser.POPUP_POINT_PROPERTY.equals(propName)) { Point p = browser.getPopupPoint(); if (d != null && p != null) view.showPopup(d, p); } else if (Browser.THUMB_SELECTED_PROPERTY.equals(propName)) { ThumbWinManager.display((ImageNode) d, model); } else if (TreeView.TREE_POPUP_POINT_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null Point p = treeView.getPopupPoint(); if (p != null) view.showPopup(((JComponent) pce.getNewValue()), p); } else if (TreeView.CLOSE_PROPERTY.equals(propName)) { model.showTreeView(false); } else if (TreeView.SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null browser.setSelectedDisplay((ImageDisplay) pce.getNewValue()); } else if (Browser.SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; treeView.accept(new SelectedNodeVisitor(treeView, d)); } }
|
public void propertyChange(PropertyChangeEvent pce) { Browser browser = model.getBrowser(); ImageDisplay d = browser.getSelectedDisplay(); String propName = pce.getPropertyName(); if (Browser.POPUP_POINT_PROPERTY.equals(propName)) { Point p = browser.getPopupPoint(); if (d != null && p != null) view.showPopup(d, p); } else if (Browser.THUMB_SELECTED_PROPERTY.equals(propName)) { ThumbWinManager.display((ImageNode) d, model); } else if (TreeView.TREE_POPUP_POINT_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null Point p = treeView.getPopupPoint(); if (p != null) view.showPopup(((JComponent) pce.getNewValue()), p); } else if (TreeView.CLOSE_PROPERTY.equals(propName)) { model.showTreeView(false); } else if (TreeView.SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null model.getBrowser().setSelectedDisplay( (ImageDisplay) pce.getNewValue()); } else if (Browser.SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; treeView.accept(new SelectedNodeVisitor(treeView, d)); } }
| 3,230,764
|
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = testHeadlines.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = start.intValue() + nrOfRows; if (maxRow > availableRows) { maxRow = availableRows; } for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), testHeadlines[i], testPublished[i], testAuthors[i], testStatus[i]); if (i == 5) { // set test style red a.setTestStyle("color:red"); } _dataModel.set(a, i); } _dataModel.setRowCount(availableRows); }
|
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = testHeadlines.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = start.intValue() + nrOfRows; if (maxRow > availableRows) { maxRow = availableRows; } for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), testHeadlines[i], testPublished[i], testAuthors[i], testStatus[i]); if (i == 5) { // set test style red a.setTestStyle("color:red"); } _dataModel.set(a, i); } _dataModel.setRowCount(availableRows); }
| 3,230,766
|
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = testHeadlines.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = start.intValue() + nrOfRows; if (maxRow > availableRows) { maxRow = availableRows; } for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), testHeadlines[i], testPublished[i], testAuthors[i], testStatus[i]); if (i == 5) { // set test style red a.setTestStyle("color:red"); } _dataModel.set(a, i); } _dataModel.setRowCount(availableRows); }
|
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = testHeadlines.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = start.intValue() + nrOfRows; if (maxRow > availableRows) { maxRow = availableRows; } for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), testHeadlines[i], testPublished[i], testAuthors[i], testStatus[i]); if (i == 5) { // set test style red a.setTestStyle("color:red"); } _dataModel.set(a, i); } _dataModel.setRowCount(availableRows); }
| 3,230,767
|
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = testHeadlines.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = start.intValue() + nrOfRows; if (maxRow > availableRows) { maxRow = availableRows; } for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), testHeadlines[i], testPublished[i], testAuthors[i], testStatus[i]); if (i == 5) { // set test style red a.setTestStyle("color:red"); } _dataModel.set(a, i); } _dataModel.setRowCount(availableRows); }
|
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = testHeadlines.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = start.intValue() + nrOfRows; if (maxRow > availableRows) { maxRow = availableRows; } for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), testHeadlines[i], testPublished[i], testAuthors[i], testStatus[i]); if (i == 5) { // set test style red a.setTestStyle("color:red"); } _dataModel.set(a, i); } _dataModel.setRowCount(availableRows); }
| 3,230,768
|
public static void errorOnViolation(Class implClass, Method mthd, Object[] args) throws ValidationException { /* find concrete method */ Method implMethod; try { implMethod = implClass.getMethod(mthd.getName(), (Class[]) mthd .getParameterTypes()); } catch (SecurityException e) { throw new InternalException( "Not allowed to perform reflection for testing API.\n" + String.format("Class:%s Method:%s",implClass.getName(),mthd)); } catch (NoSuchMethodException e) { return; // TODO No method == no violation. } log.info("Checking: " + implMethod); /* get arrays of arguments with parameters */ if ( args == null ) args = new Object[]{}; Annotation[][] anns = implMethod.getParameterAnnotations(); for (int i = 0; i < args.length; i++) { Object arg = args[i]; Annotation[] annotations = anns[i]; boolean validated = false; for (Annotation annotation : annotations) { if (NotNull.class.equals(annotation.annotationType())) { if (null == arg) { String msg = "Argument " + i + " to " + implMethod + " may not be null."; log.warn(msg); throw new IllegalArgumentException(msg); } } else if (Validate.class.equals(annotation.annotationType())) { validated = true; Validate validator = (Validate) annotation; Class[] validClasses = validator.value(); ValidSet validSet = new ValidSet( validClasses ); String msg = "Argument " + i + " must be of a type in:" + validSet; if (null == arg) { // handled by NotNull } else if (arg instanceof Collection) { Collection coll = (Collection) arg; for (Object object : coll) { if ( ! validSet.isValid( object.getClass() )) throw new IllegalArgumentException(msg); } } else { if ( ! validSet.isValid( arg.getClass() )) { throw new IllegalArgumentException(msg); } } } } /* warn if someone's forgotten to annotate a method */ if (arg instanceof Collection && !validated) throw new ValidationException(implMethod + " is missing a required @" + Validate.class.getName() + " annotation. Refusing to proceed..."); } }
|
public static void errorOnViolation(Class implClass, Method mthd, Object[] args) throws ValidationException { /* find concrete method */ Method implMethod; try { implMethod = implClass.getMethod(mthd.getName(), (Class[]) mthd .getParameterTypes()); } catch (SecurityException e) { throw new InternalException( "Not allowed to perform reflection for testing API.\n" + String.format("Class:%s Method:%s",implClass.getName(),mthd)); } catch (NoSuchMethodException e) { return; // TODO No method == no violation. } log.info("Checking: " + implMethod); /* get arrays of arguments with parameters */ if ( args == null ) args = new Object[]{}; Annotation[][] anns = implMethod.getParameterAnnotations(); for (int i = 0; i < args.length; i++) { Object arg = args[i]; Annotation[] annotations = anns[i]; boolean validated = false; for (Annotation annotation : annotations) { if (NotNull.class.equals(annotation.annotationType())) { if (null == arg) { String msg = "Argument " + i + " to " + implMethod + " may not be null."; log.warn(msg); throw new ApiUsageException(msg); } } else if (Validate.class.equals(annotation.annotationType())) { validated = true; Validate validator = (Validate) annotation; Class[] validClasses = validator.value(); ValidSet validSet = new ValidSet( validClasses ); String msg = "Argument " + i + " must be of a type in:" + validSet; if (null == arg) { // handled by NotNull } else if (arg instanceof Collection) { Collection coll = (Collection) arg; for (Object object : coll) { if ( ! validSet.isValid( object.getClass() )) throw new ApiUsageException(msg); } } else { if ( ! validSet.isValid( arg.getClass() )) { throw new ApiUsageException(msg); } } } } /* warn if someone's forgotten to annotate a method */ if (arg instanceof Collection && !validated) throw new ValidationException(implMethod + " is missing a required @" + Validate.class.getName() + " annotation. Refusing to proceed..."); } }
| 3,230,769
|
public static void errorOnViolation(Class implClass, Method mthd, Object[] args) throws ValidationException { /* find concrete method */ Method implMethod; try { implMethod = implClass.getMethod(mthd.getName(), (Class[]) mthd .getParameterTypes()); } catch (SecurityException e) { throw new InternalException( "Not allowed to perform reflection for testing API.\n" + String.format("Class:%s Method:%s",implClass.getName(),mthd)); } catch (NoSuchMethodException e) { return; // TODO No method == no violation. } log.info("Checking: " + implMethod); /* get arrays of arguments with parameters */ if ( args == null ) args = new Object[]{}; Annotation[][] anns = implMethod.getParameterAnnotations(); for (int i = 0; i < args.length; i++) { Object arg = args[i]; Annotation[] annotations = anns[i]; boolean validated = false; for (Annotation annotation : annotations) { if (NotNull.class.equals(annotation.annotationType())) { if (null == arg) { String msg = "Argument " + i + " to " + implMethod + " may not be null."; log.warn(msg); throw new IllegalArgumentException(msg); } } else if (Validate.class.equals(annotation.annotationType())) { validated = true; Validate validator = (Validate) annotation; Class[] validClasses = validator.value(); ValidSet validSet = new ValidSet( validClasses ); String msg = "Argument " + i + " must be of a type in:" + validSet; if (null == arg) { // handled by NotNull } else if (arg instanceof Collection) { Collection coll = (Collection) arg; for (Object object : coll) { if ( ! validSet.isValid( object.getClass() )) throw new IllegalArgumentException(msg); } } else { if ( ! validSet.isValid( arg.getClass() )) { throw new IllegalArgumentException(msg); } } } } /* warn if someone's forgotten to annotate a method */ if (arg instanceof Collection && !validated) throw new ValidationException(implMethod + " is missing a required @" + Validate.class.getName() + " annotation. Refusing to proceed..."); } }
|
public static void errorOnViolation(Class implClass, Method mthd, Object[] args) throws ValidationException { /* find concrete method */ Method implMethod; try { implMethod = implClass.getMethod(mthd.getName(), (Class[]) mthd .getParameterTypes()); } catch (SecurityException e) { throw new InternalException( "Not allowed to perform reflection for testing API.\n" + String.format("Class:%s Method:%s",implClass.getName(),mthd)); } catch (NoSuchMethodException e) { return; // TODO No method == no violation. } log.info("Checking: " + implMethod); /* get arrays of arguments with parameters */ if ( args == null ) args = new Object[]{}; Annotation[][] anns = implMethod.getParameterAnnotations(); for (int i = 0; i < args.length; i++) { Object arg = args[i]; Annotation[] annotations = anns[i]; boolean validated = false; for (Annotation annotation : annotations) { if (NotNull.class.equals(annotation.annotationType())) { if (null == arg) { String msg = "Argument " + i + " to " + implMethod + " may not be null."; log.warn(msg); throw new ApiUsageException(msg); } } else if (Validate.class.equals(annotation.annotationType())) { validated = true; Validate validator = (Validate) annotation; Class[] validClasses = validator.value(); ValidSet validSet = new ValidSet( validClasses ); String msg = "Argument " + i + " must be of a type in:" + validSet; if (null == arg) { // handled by NotNull } else if (arg instanceof Collection) { Collection coll = (Collection) arg; for (Object object : coll) { if ( ! validSet.isValid( object.getClass() )) throw new ApiUsageException(msg); } } else { if ( ! validSet.isValid( arg.getClass() )) { throw new ApiUsageException(msg); } } } } /* warn if someone's forgotten to annotate a method */ if (arg instanceof Collection && !validated) throw new ValidationException(implMethod + " is missing a required @" + Validate.class.getName() + " annotation. Refusing to proceed..."); } }
| 3,230,770
|
public static void errorOnViolation(Class implClass, Method mthd, Object[] args) throws ValidationException { /* find concrete method */ Method implMethod; try { implMethod = implClass.getMethod(mthd.getName(), (Class[]) mthd .getParameterTypes()); } catch (SecurityException e) { throw new InternalException( "Not allowed to perform reflection for testing API.\n" + String.format("Class:%s Method:%s",implClass.getName(),mthd)); } catch (NoSuchMethodException e) { return; // TODO No method == no violation. } log.info("Checking: " + implMethod); /* get arrays of arguments with parameters */ if ( args == null ) args = new Object[]{}; Annotation[][] anns = implMethod.getParameterAnnotations(); for (int i = 0; i < args.length; i++) { Object arg = args[i]; Annotation[] annotations = anns[i]; boolean validated = false; for (Annotation annotation : annotations) { if (NotNull.class.equals(annotation.annotationType())) { if (null == arg) { String msg = "Argument " + i + " to " + implMethod + " may not be null."; log.warn(msg); throw new IllegalArgumentException(msg); } } else if (Validate.class.equals(annotation.annotationType())) { validated = true; Validate validator = (Validate) annotation; Class[] validClasses = validator.value(); ValidSet validSet = new ValidSet( validClasses ); String msg = "Argument " + i + " must be of a type in:" + validSet; if (null == arg) { // handled by NotNull } else if (arg instanceof Collection) { Collection coll = (Collection) arg; for (Object object : coll) { if ( ! validSet.isValid( object.getClass() )) throw new IllegalArgumentException(msg); } } else { if ( ! validSet.isValid( arg.getClass() )) { throw new IllegalArgumentException(msg); } } } } /* warn if someone's forgotten to annotate a method */ if (arg instanceof Collection && !validated) throw new ValidationException(implMethod + " is missing a required @" + Validate.class.getName() + " annotation. Refusing to proceed..."); } }
|
public static void errorOnViolation(Class implClass, Method mthd, Object[] args) throws ValidationException { /* find concrete method */ Method implMethod; try { implMethod = implClass.getMethod(mthd.getName(), (Class[]) mthd .getParameterTypes()); } catch (SecurityException e) { throw new InternalException( "Not allowed to perform reflection for testing API.\n" + String.format("Class:%s Method:%s",implClass.getName(),mthd)); } catch (NoSuchMethodException e) { return; // TODO No method == no violation. } log.info("Checking: " + implMethod); /* get arrays of arguments with parameters */ if ( args == null ) args = new Object[]{}; Annotation[][] anns = implMethod.getParameterAnnotations(); for (int i = 0; i < args.length; i++) { Object arg = args[i]; Annotation[] annotations = anns[i]; boolean validated = false; for (Annotation annotation : annotations) { if (NotNull.class.equals(annotation.annotationType())) { if (null == arg) { String msg = "Argument " + i + " to " + implMethod + " may not be null."; log.warn(msg); throw new ApiUsageException(msg); } } else if (Validate.class.equals(annotation.annotationType())) { validated = true; Validate validator = (Validate) annotation; Class[] validClasses = validator.value(); ValidSet validSet = new ValidSet( validClasses ); String msg = "Argument " + i + " must be of a type in:" + validSet; if (null == arg) { // handled by NotNull } else if (arg instanceof Collection) { Collection coll = (Collection) arg; for (Object object : coll) { if ( ! validSet.isValid( object.getClass() )) throw new ApiUsageException(msg); } } else { if ( ! validSet.isValid( arg.getClass() )) { throw new ApiUsageException(msg); } } } } /* warn if someone's forgotten to annotate a method */ if (arg instanceof Collection && !validated) throw new ValidationException(implMethod + " is missing a required @" + Validate.class.getName() + " annotation. Refusing to proceed..."); } }
| 3,230,771
|
public void addArticleViews(IWBundle bundle){ ContentViewManager cViewManager = ContentViewManager.getInstance(bundle.getApplication()); ViewNode contentNode = cViewManager.getContentNode(); DefaultViewNode articleNode = new DefaultViewNode("article",contentNode); articleNode.setJspUri(bundle.getJSPURI("createarticle.jsp")); articleNode.setKeyboardShortcut(new KeyboardShortcut("a")); articleNode.setName("#{localizedStrings['com.idega.block.article']['article']}"); DefaultViewNode createNewArticleNode = new DefaultViewNode("create",articleNode); String jspUri = bundle.getJSPURI("createarticle.jsp"); createNewArticleNode.setJspUri(jspUri); createNewArticleNode.setName("#{localizedStrings['com.idega.block.article']['create_article']}"); DefaultViewNode editNewArticleNode = new DefaultViewNode("edit",articleNode);// editNewArticleNode.setJspUri(bundle.getJSPURI("createarticle.jsp")); editNewArticleNode.setJspUri(bundle.getJSPURI("editarticle.jsp")); editNewArticleNode.setVisibleInMenus(false); editNewArticleNode.setName("#{localizedStrings['com.idega.block.article']['edit']}"); DefaultViewNode listArticlesNode = new DefaultViewNode("list",articleNode); listArticlesNode.setJspUri(bundle.getJSPURI("listarticles.jsp")); listArticlesNode.setName("#{localizedStrings['com.idega.block.article']['list_articles']}"); DefaultViewNode previewArticlesNode = new DefaultViewNode("preview",articleNode); previewArticlesNode.setJspUri(bundle.getJSPURI("previewarticle.jsp")); previewArticlesNode.setVisibleInMenus(false); previewArticlesNode.setName("#{localizedStrings['com.idega.block.article']['preview']}"); DefaultViewNode searchArticlesNode = new DefaultViewNode("search",articleNode); searchArticlesNode.setJspUri(bundle.getJSPURI("searcharticle.jsp")); searchArticlesNode.setName("#{localizedStrings['com.idega.block.article']['search_articles']}"); searchArticlesNode.setVisibleInMenus(false); }
|
public void addArticleViews(IWBundle bundle){ ContentViewManager cViewManager = ContentViewManager.getInstance(bundle.getApplication()); ViewNode contentNode = cViewManager.getContentNode(); DefaultViewNode articleNode = new DefaultViewNode("article",contentNode); articleNode.setJspUri(bundle.getJSPURI("createarticle.jsp")); articleNode.setKeyboardShortcut(new KeyboardShortcut("a")); articleNode.setName("#{localizedStrings['com.idega.block.article']['article']}"); DefaultViewNode createNewArticleNode = new DefaultViewNode("create",articleNode); String jspUri = bundle.getJSPURI("createarticle.jsp"); createNewArticleNode.setJspUri(jspUri); createNewArticleNode.setName("#{localizedStrings['com.idega.block.article']['create_article']}"); DefaultViewNode editNewArticleNode = new DefaultViewNode("edit",articleNode);// editNewArticleNode.setJspUri(bundle.getJSPURI("createarticle.jsp")); editNewArticleNode.setJspUri(bundle.getJSPURI("editarticle.jsp")); editNewArticleNode.setVisibleInMenus(false); editNewArticleNode.setName("#{localizedStrings['com.idega.block.article']['edit']}"); DefaultViewNode listArticlesNode = new DefaultViewNode("list",articleNode); listArticlesNode.setJspUri(bundle.getJSPURI("listarticles.jsp")); listArticlesNode.setName("#{localizedStrings['com.idega.block.article']['list_articles']}"); DefaultViewNode previewArticlesNode = new DefaultViewNode("preview",articleNode); previewArticlesNode.setJspUri(bundle.getJSPURI("previewarticle.jsp")); previewArticlesNode.setVisibleInMenus(false); previewArticlesNode.setName("#{localizedStrings['com.idega.block.article']['preview']}"); DefaultViewNode searchArticlesNode = new DefaultViewNode("search",articleNode); searchArticlesNode.setJspUri(bundle.getJSPURI("searcharticle.jsp")); searchArticlesNode.setName("#{localizedStrings['com.idega.block.article']['search_articles']}"); searchArticlesNode.setVisibleInMenus(false); }
| 3,230,773
|
public void testInspect() { assertEquals("nil", RubyNil.inspect(rubyNil).getValue()); }
|
public void testInspect() { assertEquals("nil", RubyNil.inspect(rubyNil).toString()); }
| 3,230,774
|
public void testToS() { assertEquals("", RubyNil.to_s(rubyNil).getValue()); }
|
public void testToS() { assertEquals("", RubyNil.to_s(rubyNil).toString()); }
| 3,230,775
|
public static RubyFixnum to_i(IRubyObject recv) { return RubyFixnum.zero(recv.getRuntime()); }
|
public static RubyFixnum to_i(IRubyObject recv) { return RubyFixnum.zero(recv.getRuntime()); }
| 3,230,776
|
public String toString(){ return "SemanticType"+(semanticTypeId==null ? ":Hash"+this.hashCode() : ":"+semanticTypeId); }
|
public String toString(){ return "SemanticType"+(semanticTypeId==null ? ":Hash_"+this.hashCode() : ":Id_"+semanticTypeId); }
| 3,230,778
|
void attachListeners() { //TexField startTField = view.getMovieStartT(); endTField = view.getMovieEndT(); startZField = view.getMovieStartZ(); endZField = view.getMovieEndZ(); startTField.setActionCommand(""+START_T); startTField.addActionListener(this); startTField.addFocusListener(this); endTField.setActionCommand(""+END_T); endTField.addActionListener(this); endTField.addFocusListener(this); startZField.setActionCommand(""+START_Z); startZField.addActionListener(this); startZField.addFocusListener(this); endZField.setActionCommand(""+END_Z); endZField.addActionListener(this); endZField.addFocusListener(this); //RadioButton JRadioButton movieZ = view.getMovieZ(), movieT = view.getMovieT(); movieZ.addActionListener(this); movieZ.setActionCommand(""+Player.MOVIE_Z); movieT.addActionListener(this); movieT.setActionCommand(""+Player.MOVIE_T); view.getSliderT().addChangeListener(this); view.getSliderZ().addChangeListener(this); }
|
void attachListeners() { //TexField startTField = view.getMovieStartT(); endTField = view.getMovieEndT(); startZField = view.getMovieStartZ(); endZField = view.getMovieEndZ(); startTField.setActionCommand(""+START_T); startTField.addActionListener(this); startTField.addFocusListener(this); endTField.setActionCommand(""+END_T); endTField.addActionListener(this); endTField.addFocusListener(this); startZField.setActionCommand(""+START_Z); startZField.addActionListener(this); startZField.addFocusListener(this); endZField.setActionCommand(""+END_Z); endZField.addActionListener(this); endZField.addFocusListener(this); //RadioButton JRadioButton movieZ = view.getMovieZ(), movieT = view.getMovieT(); movieZ.addActionListener(this); movieZ.setActionCommand(""+Player.MOVIE_Z); movieT.addActionListener(this); movieT.setActionCommand(""+Player.MOVIE_T); view.getSliderT().addChangeListener(this); view.getSliderZ().addChangeListener(this); }
| 3,230,780
|
public void paintComponent(Graphics g) { super.paintComponent(g); BufferedImage img = model.getDisplayedImage(); if (img == null) return; Graphics2D g2D = (Graphics2D) g; ImagePaintingFactory.setGraphicRenderingSettings(g2D); g2D.drawImage(img, null, 0, 0); if (model.isUnitBar()) { String value = model.getUnitBarValue(); if (value != null) { int size = (int) (model.getUnitBarSize()); int width, height; width = img.getWidth(); height = img.getHeight(); Rectangle imgRect = new Rectangle(0, 0, width, height); Rectangle viewRect = view.getViewport().getBounds(); JViewport port = view.getViewport(); int x = (int) port.getViewPosition().getX(); int y = (int) port.getViewPosition().getY(); if (imgRect.contains(viewRect)) { width = x+port.getWidth(); height = y+port.getHeight(); } else { width = img.getWidth(); height = img.getHeight(); if (x+viewRect.width < imgRect.width) width = x+viewRect.width; if (y+viewRect.height < imgRect.height) height = y+viewRect.height; } ImagePaintingFactory.paintScaleBar(g2D, width-size-10, height-10, size, value); } } }
|
public void paintComponent(Graphics g) { super.paintComponent(g); BufferedImage img = model.getDisplayedImage(); if (img == null) return; Graphics2D g2D = (Graphics2D) g; ImagePaintingFactory.setGraphicRenderingSettings(g2D); g2D.drawImage(img, null, 0, 0); if (model.isUnitBar()) { String value = model.getUnitBarValue(); if (value != null) { int size = (int) (model.getUnitBarSize()); int width, height; width = img.getWidth(); height = img.getHeight(); Rectangle imgRect = new Rectangle(0, 0, width, height); Rectangle viewRect = view.getViewport().getBounds(); JViewport port = view.getViewport(); int x = (int) port.getViewPosition().getX(); int y = (int) port.getViewPosition().getY(); if (imgRect.contains(viewRect)) { width = x+port.getWidth(); height = y+port.getHeight(); } else { width = img.getWidth(); height = img.getHeight(); if (x+viewRect.width < imgRect.width) width = x+viewRect.width; if (y+viewRect.height < imgRect.height) height = y+viewRect.height; } ImagePaintingFactory.paintScaleBar(g2D, width-size-10, height-10, size, value); } } }
| 3,230,781
|
public void paintComponent(Graphics g) { super.paintComponent(g); BufferedImage img = model.getDisplayedImage(); if (img == null) return; Graphics2D g2D = (Graphics2D) g; ImagePaintingFactory.setGraphicRenderingSettings(g2D); g2D.drawImage(img, null, 0, 0); if (model.isUnitBar()) { String value = model.getUnitBarValue(); if (value != null) { int size = (int) (model.getUnitBarSize()); int width, height; width = img.getWidth(); height = img.getHeight(); Rectangle imgRect = new Rectangle(0, 0, width, height); Rectangle viewRect = view.getViewport().getBounds(); JViewport port = view.getViewport(); int x = (int) port.getViewPosition().getX(); int y = (int) port.getViewPosition().getY(); if (imgRect.contains(viewRect)) { width = x+port.getWidth(); height = y+port.getHeight(); } else { width = img.getWidth(); height = img.getHeight(); if (x+viewRect.width < imgRect.width) width = x+viewRect.width; if (y+viewRect.height < imgRect.height) height = y+viewRect.height; } ImagePaintingFactory.paintScaleBar(g2D, width-size-10, height-10, size, value); } } }
|
public void paintComponent(Graphics g) { super.paintComponent(g); BufferedImage img = model.getDisplayedImage(); if (img == null) return; Graphics2D g2D = (Graphics2D) g; ImagePaintingFactory.setGraphicRenderingSettings(g2D); g2D.drawImage(img, null, 0, 0); if (model.isUnitBar()) { String value = model.getUnitBarValue(); if (value != null) { int size = (int) (model.getUnitBarSize()); int width, height; width = img.getWidth(); height = img.getHeight(); Rectangle imgRect = new Rectangle(0, 0, img.getWidth(), img.getHeight()); Rectangle viewRect = view.getViewport().getBounds(); JViewport port = view.getViewport(); int x = (int) port.getViewPosition().getX(); int y = (int) port.getViewPosition().getY(); if (imgRect.contains(viewRect)) { width = x+port.getWidth(); height = y+port.getHeight(); } else { width = img.getWidth(); height = img.getHeight(); if (x+viewRect.width < imgRect.width) width = x+viewRect.width; if (y+viewRect.height < imgRect.height) height = y+viewRect.height; } ImagePaintingFactory.paintScaleBar(g2D, width-size-10, height-10, size, value); } } }
| 3,230,782
|
public void paintComponent(Graphics g) { super.paintComponent(g); BufferedImage img = model.getDisplayedImage(); if (img == null) return; Graphics2D g2D = (Graphics2D) g; ImagePaintingFactory.setGraphicRenderingSettings(g2D); g2D.drawImage(img, null, 0, 0); if (model.isUnitBar()) { String value = model.getUnitBarValue(); if (value != null) { int size = (int) (model.getUnitBarSize()); int width, height; width = img.getWidth(); height = img.getHeight(); Rectangle imgRect = new Rectangle(0, 0, width, height); Rectangle viewRect = view.getViewport().getBounds(); JViewport port = view.getViewport(); int x = (int) port.getViewPosition().getX(); int y = (int) port.getViewPosition().getY(); if (imgRect.contains(viewRect)) { width = x+port.getWidth(); height = y+port.getHeight(); } else { width = img.getWidth(); height = img.getHeight(); if (x+viewRect.width < imgRect.width) width = x+viewRect.width; if (y+viewRect.height < imgRect.height) height = y+viewRect.height; } ImagePaintingFactory.paintScaleBar(g2D, width-size-10, height-10, size, value); } } }
|
public void paintComponent(Graphics g) { super.paintComponent(g); BufferedImage img = model.getDisplayedImage(); if (img == null) return; Graphics2D g2D = (Graphics2D) g; ImagePaintingFactory.setGraphicRenderingSettings(g2D); g2D.drawImage(img, null, 0, 0); if (model.isUnitBar()) { String value = model.getUnitBarValue(); if (value != null) { int size = (int) (model.getUnitBarSize()); int width, height; width = img.getWidth(); height = img.getHeight(); Rectangle imgRect = new Rectangle(0, 0, width, height); Rectangle viewRect = view.getViewport().getBounds(); JViewport port = view.getViewport(); int x = (int) port.getViewPosition().getX(); int y = (int) port.getViewPosition().getY(); if (imgRect.contains(viewRect)) { width = x+port.getWidth(); height = y+port.getHeight(); } else { width = img.getWidth(); height = img.getHeight(); if (x+viewRect.width < imgRect.width) width = x+viewRect.width; if (y+viewRect.height < imgRect.height) height = y+viewRect.height; } ImagePaintingFactory.paintScaleBar(g2D, width-size-10, height-10, size, value); } } }
| 3,230,783
|
public SortedSet getClasses() { SortedSet classes = new TreeSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { SourceFileData sourceFileData = (SourceFileData)iter.next(); classes.addAll(sourceFileData.getChildren()); } return classes; }
|
public SortedSet getClasses() { SortedSet classes = new TreeSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { SourceFileData sourceFileData = (SourceFileData)iter.next(); classes.addAll(sourceFileData.getChildren()); } return classes; }
| 3,230,785
|
public void visitSuperNode(SuperNode iVisited) { if (threadContext.getCurrentFrame().getLastClass() == null) { throw new NameError(runtime, "Superclass method '" + threadContext.getCurrentFrame().getLastFunc() + "' disabled."); } Block tmpBlock = ArgsUtil.beginCallArgs(threadContext); IRubyObject[] args = null; try { args = ArgsUtil.setupArgs(threadContext, this, iVisited.getArgsNode()); } finally { ArgsUtil.endCallArgs(threadContext, tmpBlock); } threadContext.callSuper(args); }
|
public void visitSuperNode(SuperNode iVisited) { if (threadContext.getCurrentFrame().getLastClass() == null) { throw new NameError(runtime, "Superclass method '" + threadContext.getCurrentFrame().getLastFunc() + "' disabled."); } Block tmpBlock = ArgsUtil.beginCallArgs(threadContext); IRubyObject[] args = null; try { args = ArgsUtil.setupArgs(threadContext, this, iVisited.getArgsNode()); } finally { ArgsUtil.endCallArgs(threadContext, tmpBlock); } result = threadContext.callSuper(args); }
| 3,230,786
|
public void visitZSuperNode(ZSuperNode iVisited) { if (threadContext.getCurrentFrame().getLastClass() == null) { throw new NameError(runtime, "superclass method '" + runtime.getCurrentFrame().getLastFunc() + "' disabled"); } IRubyObject[] args = threadContext.getCurrentFrame().getArgs(); threadContext.callSuper(args); }
|
public void visitZSuperNode(ZSuperNode iVisited) { if (threadContext.getCurrentFrame().getLastClass() == null) { throw new NameError(runtime, "superclass method '" + runtime.getCurrentFrame().getLastFunc() + "' disabled"); } IRubyObject[] args = threadContext.getCurrentFrame().getArgs(); result = threadContext.callSuper(args); }
| 3,230,787
|
public IRubyObject begin(Node node) { clearResult(); if (node != null) { try { // for each call to internalEval, push down new stacks (to isolate eval runs that still want to be logically separate pushCurrentInstructionStack(); addNodeInstruction(node); // TODO: once we're ready to have an external entity run this loop (i.e. thread scheduler) move this out masterLoop: while (hasNext()) { // invoke the next instruction try { executeNext(); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.NextJump) { handleNext(je); } else if (je.getJumpType() == JumpException.JumpType.RedoJump) { handleRedo(je); } else if (je.getJumpType() == JumpException.JumpType.BreakJump) { handleBreak(je); } else if (je.getJumpType() == JumpException.JumpType.RaiseJump) { handleRaise(je); } else if (je.getJumpType() == JumpException.JumpType.RetryJump) { handleRetry(je); } else if (je.getJumpType() == JumpException.JumpType.ReturnJump) { handleReturn(je); } else if (je.getJumpType() == JumpException.JumpType.ThrowJump) { handleThrow(je); } } } } catch (StackOverflowError soe) { // TODO: perhaps a better place to catch this (although it will go away) throw runtime.newSystemStackError("stack level too deep"); } finally { popCurrentInstructionStack(); } } return getResult(); }
|
public IRubyObject begin(Node node) { clearResult(); if (node != null) { try { // for each call to internalEval, push down new stacks (to isolate eval runs that still want to be logically separate pushCurrentInstructionStack(); addNodeInstruction(node); // TODO: once we're ready to have an external entity run this loop (i.e. thread scheduler) move this out masterLoop: while (hasNext()) { // invoke the next instruction try { executeNext(); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.NextJump) { handleNext(je); } else if (je.getJumpType() == JumpException.JumpType.RedoJump) { handleRedo(je); } else if (je.getJumpType() == JumpException.JumpType.BreakJump) { handleBreak(je); } else if (je.getJumpType() == JumpException.JumpType.RaiseJump) { handleRaise(je); } else if (je.getJumpType() == JumpException.JumpType.RetryJump) { handleRetry(je); } else if (je.getJumpType() == JumpException.JumpType.ReturnJump) { handleReturn(je); } else if (je.getJumpType() == JumpException.JumpType.ThrowJump) { handleThrow(je); } } } } catch (StackOverflowError soe) { // TODO: perhaps a better place to catch this (although it will go away) throw runtime.newSystemStackError("stack level too deep"); } finally { popCurrentInstructionStack(); } } return getResult(); }
| 3,230,788
|
private void handleNext(JumpException je) { NextNode iVisited = (NextNode)je.getSecondaryData(); while (!(getCurrentInstructionStack().isEmpty() || peekCurrentInstructionBundle().redoable)) { InstructionBundle ib = peekCurrentInstructionBundle(); if (ib.ensured) { // exec ensured node, return to "nexting" afterwards popCurrentInstruction(); addInstruction(iVisited, exceptionRethrower); addInstructionBundle(ib); return; } popCurrentInstruction(); } if (getCurrentInstructionStack().isEmpty()) { // rethrow next to previous level throw je; } else { // pop the redoable and continue popCurrentInstruction(); setCurrentException(null); } }
|
private void handleNext(JumpException je) { NextNode iVisited = (NextNode)je.getSecondaryData(); while (!(getCurrentInstructionStack().isEmpty() || peekCurrentInstructionBundle().redoable)) { InstructionBundle ib = peekCurrentInstructionBundle(); if (ib.ensured) { // exec ensured node, return to "nexting" afterwards popCurrentInstruction(); handlingException = true; addInstruction(iVisited, exceptionContinuer); addInstructionBundle(ib); return; } popCurrentInstruction(); } if (getCurrentInstructionStack().isEmpty()) { // rethrow next to previous level throw je; } else { // pop the redoable and continue popCurrentInstruction(); setCurrentException(null); } }
| 3,230,790
|
public void DISABLEDtestReal() throws Exception { File currentDir = new File(System.getProperty("user.dir"));// TODO Util File mappings = new File(currentDir.getParent() + File.separator + "common" + File.separator + "resources" + File.separator + "Mappings.ome.xml"); // FIXME circular deps. log.error(mappings); SaxReader nsr = new SaxReader(mappings); for (Iterator it = nsr.parse().iterator(); it.hasNext();) { SemanticType st = (SemanticType) it.next(); VelocityHelper vh = new VelocityHelper(); vh.put("type", st); // FileWriter fw = new // FileWriter("/tmp/"+st.getId().replaceAll("[.]","_")+".hbm.xml"); StringWriter sw = new StringWriter(); vh.invoke("ome/dsl/mapping.vm", sw); sw.flush(); sw.close(); // fw.flush(); // fw.close(); } }
|
public void DISABLEDtestReal() throws Exception { File currentDir = new File(System.getProperty("user.dir"));// TODO Util File mappings = new File(currentDir.getParent() + File.separator + "common" + File.separator + "resources" + File.separator + "Mappings.ome.xml"); // FIXME circular deps. log.error(mappings); SaxReader nsr = new SaxReader(mappings); nsr.parse(); for (Iterator it = nsr.process().iterator(); it.hasNext();) { SemanticType st = (SemanticType) it.next(); VelocityHelper vh = new VelocityHelper(); vh.put("type", st); // FileWriter fw = new // FileWriter("/tmp/"+st.getId().replaceAll("[.]","_")+".hbm.xml"); StringWriter sw = new StringWriter(); vh.invoke("ome/dsl/mapping.vm", sw); sw.flush(); sw.close(); // fw.flush(); // fw.close(); } }
| 3,230,794
|
protected void setUp() throws Exception { sr = new SaxReader("type.xml"); }
|
protected void setUp() throws Exception { File f = new File(ExampleUsageTest.class.getResource("type.xml").getFile()); sr = new SaxReader(f); }
| 3,230,795
|
public void testONE() { Set set = sr.parse(); log.info("Results of parse:" + set); for (Iterator it = set.iterator(); it.hasNext();) { SemanticType st = (SemanticType) it.next(); VelocityHelper vh = new VelocityHelper(); vh.put("type", st); Map h = new HashMap(); h.put("test", "this was a dynamic key test"); vh.put("test", h); String s = vh.invoke("ome/dsl/mapping.vm"); log.info("Results of invoke:" + s); } }
|
public void testONE() { sr.parse(); Set set = sr.process(); log.info("Results of parse:" + set); for (Iterator it = set.iterator(); it.hasNext();) { SemanticType st = (SemanticType) it.next(); VelocityHelper vh = new VelocityHelper(); vh.put("type", st); Map h = new HashMap(); h.put("test", "this was a dynamic key test"); vh.put("test", h); String s = vh.invoke("ome/dsl/mapping.vm"); log.info("Results of invoke:" + s); } }
| 3,230,796
|
public void testWithWriting() throws Exception { Set set = sr.parse(); for (Iterator it = set.iterator(); it.hasNext();) { SemanticType st = (SemanticType) it.next(); VelocityHelper vh = new VelocityHelper(); vh.put("type", st); // FileWriter fw = new // FileWriter("/tmp/"+st.getId().replaceAll("[.]","_")+".hbm.xml"); StringWriter sw = new StringWriter(); vh.invoke("ome/dsl/mapping.vm", sw); sw.flush(); sw.close(); // fw.flush(); // fw.close(); } }
|
public void testWithWriting() throws Exception { sr.parse(); Set set = sr.process(); for (Iterator it = set.iterator(); it.hasNext();) { SemanticType st = (SemanticType) it.next(); VelocityHelper vh = new VelocityHelper(); vh.put("type", st); // FileWriter fw = new // FileWriter("/tmp/"+st.getId().replaceAll("[.]","_")+".hbm.xml"); StringWriter sw = new StringWriter(); vh.invoke("ome/dsl/mapping.vm", sw); sw.flush(); sw.close(); // fw.flush(); // fw.close(); } }
| 3,230,797
|
private static String useGoogleTranslator(String text, TranslationType type) { String response = null; String urlString = "http://translate.google.com/translate_t?text=" + text + "&langpair=" + type.getID(); // disable scripting to avoid requiring js.jar HttpUnitOptions.setScriptingEnabled(false); // create the conversation object which will maintain state for us WebConversation wc = new WebConversation(); // Obtain the google translation page WebRequest webRequest = new GetMethodWebRequest(urlString); // required to prevent a 403 forbidden error from google webRequest.setHeaderField("User-agent", "Mozilla/4.0"); try { WebResponse webResponse = wc.getResponse(webRequest); Element body = (Element)webResponse.getDOM().getDocumentElement().getElementsByTagName("body").item(0); NodeList elems = body.getElementsByTagName("textarea"); response = elems.item(0).getChildNodes().item(0).getNodeValue(); } catch (MalformedURLException e) { Log.error("Could not for url: " + e); } catch (IOException e) { Log.error("Could not get response: " + e); } catch (SAXException e) { Log.error("Could not parse response content: " + e); } return response; }
|
private static String useGoogleTranslator(String text, TranslationType type) { String response = null; String urlString = "http://translate.google.com/translate_t?text=" + text + "&langpair=" + type.getID(); // disable scripting to avoid requiring js.jar HttpUnitOptions.setScriptingEnabled(false); // create the conversation object which will maintain state for us WebConversation wc = new WebConversation(); // Obtain the google translation page WebRequest webRequest = new GetMethodWebRequest(urlString); // required to prevent a 403 forbidden error from google webRequest.setHeaderField("User-agent", "Mozilla/4.0"); try { WebResponse webResponse = wc.getResponse(webRequest); Element body = (Element)webResponse.getDOM().getDocumentElement().getElementsByTagName("body").item(0); NodeList elems = body.getElementsByTagName("textarea"); response = elems.item(0).getChildNodes().item(0).getNodeValue(); } catch (MalformedURLException e) { Log.error("Could not for url: " + e); } catch (IOException e) { Log.error("Could not get response: " + e); } catch (SAXException e) { Log.error("Could not parse response content: " + e); } return response; }
| 3,230,798
|
HistogramPanel(HistogramDialogManager manager, int mini, int maxi, int startReal, int endReal, int yStart, int yEnd, PixelsStatsEntry[] histogramData) { this.histogramData = histogramData; this.manager = manager; initSizeBin(); setWindowLimits(mini, maxi); setInputWindow(startReal, endReal); //control output window controlOutputStart = yStart; heightStart = tS-yStart; heightEnd = yEnd-topBorder; //output knob setKnobOutputStart(lS+10, yStart); setKnobOutputEnd(leftBorder-10, yEnd); setSize(widthWin, HEIGHT); repaint(); }
|
HistogramPanel(HistogramDialogManager manager, int mini, int maxi, int startReal, int endReal, int yStart, int yEnd, PixelsStatsEntry[] histogramData) { this.histogramData = histogramData; this.manager = manager; initSizeBin(); setWindowLimits(mini, maxi); setInputWindow(startReal, endReal); //control output window controlOutputStart = yStart; heightStart = tS-yStart; heightEnd = yEnd-topBorder; //output knob setKnobOutputStart(lS+10, yStart); setKnobOutputEnd(leftBorder-10, yEnd); setSize(widthWin, HEIGHT); repaint(); }
| 3,230,799
|
void initSizeBin() { sizeBin = (widthStatDefault/histogramData.length); if (sizeBin < sizeBinDefault) { sizeBin = sizeBinDefault; widthStat = sizeBin*histogramData.length; } else widthStat = widthStatDefault; widthWin = BASIC_WIDTH+widthStat; lS = leftBorder+widthStat; }
|
void initSizeBin() { sizeBin = (widthStatDefault/histogramData.length); if (sizeBin < sizeBinDefault) { sizeBin = sizeBinDefault; widthStat = sizeBin*histogramData.length; } else widthStat = widthStatDefault; widthWin = BASIC_WIDTH+widthStat; lS = leftBorder+widthStat; }
| 3,230,800
|
public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2D = (Graphics2D) g; g2D.setColor(bgColor); g2D.fillRect(0, 0, widthWin, HEIGHT); Font font = g2D.getFont(); FontMetrics fontMetrics = g2D.getFontMetrics(); int hFont = fontMetrics.getHeight(); Rectangle2D rStart = font.getStringBounds(min, g2D.getFontRenderContext()); int hStart = (int) rStart.getHeight(); Rectangle2D rEnd = font.getStringBounds(max, g2D.getFontRenderContext()); int hEnd = (int) rEnd.getHeight(); Rectangle2D rInput = font.getStringBounds("timepoint", g2D.getFontRenderContext()); int wInput = (int) rInput.getWidth(); g2D.setColor(axeColor); //y-axis g2D.drawLine(leftBorder, topBorder-8, leftBorder, tS+5); g2D.drawLine(leftBorder, topBorder-8, leftBorder-3, topBorder-5); g2D.drawLine(leftBorder, topBorder-8, leftBorder+3, topBorder-5); // x-axis g2D.drawLine(leftBorder-5, tS, lS+8, tS); g2D.drawLine(lS+5, tS-3, lS+8, tS); g2D.drawLine(lS+5, tS+3, lS+8, tS); // draw output interval g2D.drawString(min, 5, tS-window); g2D.drawLine(leftBorder-5, tS-window, leftBorder, tS-window); g2D.drawString(max, 5, topBorder+window); g2D.drawLine(leftBorder-5, topBorder+window, leftBorder, topBorder+window); g2D.drawString("timepoint", leftBorder+widthStat/2-wInput/2, tS+hFont+5); //knob start output int xStartOutputPoints[] = {xStartOutput1, xStartOutput2, xStartOutput3}; int yStartOutputPoints[] = {yStartOutput1, yStartOutput2, yStartOutput3}; GeneralPath filledPolygonStartOutput = new GeneralPath(); filledPolygonStartOutput.moveTo(xStartOutputPoints[0], yStartOutputPoints[0]); for (int index = 1; index < xStartOutputPoints.length; index++) filledPolygonStartOutput.lineTo(xStartOutputPoints[index], yStartOutputPoints[index]); filledPolygonStartOutput.closePath(); // paint with selected color g2D.setColor(startColor); g2D.drawString(curMin, 10, tS-hStart-hFont-window); g2D.fill(filledPolygonStartOutput); //knob end output int xEndOutputPoints[] = {xEndOutput1, xEndOutput2, xEndOutput3}; int yEndOutputPoints[] = {yEndOutput1, yEndOutput2, yEndOutput3}; GeneralPath filledPolygonEndOutput = new GeneralPath(); filledPolygonEndOutput.moveTo(xEndOutputPoints[0], yEndOutputPoints[0]); for (int index = 1; index < xEndOutputPoints.length; index++) filledPolygonEndOutput.lineTo(xEndOutputPoints[index], yEndOutputPoints[index]); filledPolygonEndOutput.closePath(); g2D.setColor(endColor); g2D.drawString(curMax, 10, topBorder+hEnd+hFont+window); g2D.fill(filledPolygonEndOutput); //paint histogram g2D.setColor(binColor); g2D.drawString("Pixels", 5, topBorder+heightStat/2); g2D.drawString("intensity", 5, topBorder+heightStat/2+hEnd+5); PixelsStatsEntry entry; int min, max; int[] bin = new int[histogramData.length]; for (int i = 0; i < histogramData.length; i++) { entry = histogramData[i]; min = manager.convertRealIntoGraphics((int) entry.min); max = manager.convertRealIntoGraphics((int) entry.max); bin[i] = max; g2D.fillRect(leftBorder+i*sizeBin, max, sizeBin, min-max); } g2D.setColor(axeColor); int y, x; for (int i = 0; i < histogramData.length; i++) { y = bin[i]; x = leftBorder+(i+1)*sizeBin; g2D.drawLine(x, y, x, topBorder+heightStat+5); } // paint layered rectangles g2D.setColor(layerColor); //end rectangle Rectangle2D endOutput = new Rectangle2D.Double(leftBorder, topBorder, widthStat, heightEnd); g2D.fill(endOutput); //start rectangle Rectangle2D startOutput = new Rectangle2D.Double(leftBorder, controlOutputStart, widthStat, heightStart); g2D.fill(startOutput); g2D.setColor(endColor); g2D.draw(endOutput); g2D.setColor(startColor); g2D.draw(startOutput); }
|
public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2D = (Graphics2D) g; g2D.setColor(bgColor); g2D.fillRect(0, 0, widthWin, HEIGHT); Font font = g2D.getFont(); FontMetrics fontMetrics = g2D.getFontMetrics(); int hFont = fontMetrics.getHeight(); Rectangle2D rStart = font.getStringBounds(min, g2D.getFontRenderContext()); int hStart = (int) rStart.getHeight(); Rectangle2D rEnd = font.getStringBounds(max, g2D.getFontRenderContext()); int hEnd = (int) rEnd.getHeight(); Rectangle2D rInput = font.getStringBounds("timepoint", g2D.getFontRenderContext()); int wInput = (int) rInput.getWidth(); g2D.setColor(axeColor); //y-axis g2D.drawLine(leftBorder, topBorder-8, leftBorder, tS+5); g2D.drawLine(leftBorder, topBorder-8, leftBorder-3, topBorder-5); g2D.drawLine(leftBorder, topBorder-8, leftBorder+3, topBorder-5); // x-axis g2D.drawLine(leftBorder-5, tS, lS+8, tS); g2D.drawLine(lS+5, tS-3, lS+8, tS); g2D.drawLine(lS+5, tS+3, lS+8, tS); // draw output interval g2D.drawString(min, 5, tS-window); g2D.drawLine(leftBorder-5, tS-window, leftBorder, tS-window); g2D.drawString(max, 5, topBorder+window); g2D.drawLine(leftBorder-5, topBorder+window, leftBorder, topBorder+window); g2D.drawString("timepoint", leftBorder+widthStat/2-wInput/2, tS+hFont+5); //knob start output int xStartOutputPoints[] = {xStartOutput1, xStartOutput2, xStartOutput3}; int yStartOutputPoints[] = {yStartOutput1, yStartOutput2, yStartOutput3}; GeneralPath filledPolygonStartOutput = new GeneralPath(); filledPolygonStartOutput.moveTo(xStartOutputPoints[0], yStartOutputPoints[0]); for (int index = 1; index < xStartOutputPoints.length; index++) filledPolygonStartOutput.lineTo(xStartOutputPoints[index], yStartOutputPoints[index]); filledPolygonStartOutput.closePath(); // paint with selected color g2D.setColor(startColor); g2D.drawString(curMin, 10, tS-hStart-hFont-window); g2D.fill(filledPolygonStartOutput); //knob end output int xEndOutputPoints[] = {xEndOutput1, xEndOutput2, xEndOutput3}; int yEndOutputPoints[] = {yEndOutput1, yEndOutput2, yEndOutput3}; GeneralPath filledPolygonEndOutput = new GeneralPath(); filledPolygonEndOutput.moveTo(xEndOutputPoints[0], yEndOutputPoints[0]); for (int index = 1; index < xEndOutputPoints.length; index++) filledPolygonEndOutput.lineTo(xEndOutputPoints[index], yEndOutputPoints[index]); filledPolygonEndOutput.closePath(); g2D.setColor(endColor); g2D.drawString(curMax, 10, topBorder+hEnd+hFont+window); g2D.fill(filledPolygonEndOutput); //paint histogram g2D.setColor(binColor); g2D.drawString("Pixels", 5, topBorder+heightStat/2); g2D.drawString("intensity", 5, topBorder+heightStat/2+hEnd+5); PixelsStatsEntry entry; int min, max; int[] bin = new int[histogramData.length]; for (int i = 0; i < histogramData.length; i++) { entry = histogramData[i]; min = manager.convertRealIntoGraphics((int) entry.min); max = manager.convertRealIntoGraphics((int) entry.max); bin[i] = max; g2D.fillRect(leftBorder+i*sizeBin, max, sizeBin, min-max); } g2D.setColor(axeColor); int y, x; for (int i = 0; i < histogramData.length; i++) { y = bin[i]; x = leftBorder+(i+1)*sizeBin; g2D.drawLine(x, y, x, topBorder+heightStat+5); } // paint layered rectangles g2D.setColor(layerColor); //end rectangle Rectangle2D endOutput = new Rectangle2D.Double(leftBorder, topBorder, widthStat, heightEnd); g2D.fill(endOutput); //start rectangle Rectangle2D startOutput = new Rectangle2D.Double(leftBorder, controlOutputStart, widthStat, heightStart); g2D.fill(startOutput); g2D.setColor(endColor); g2D.draw(endOutput); g2D.setColor(startColor); g2D.draw(startOutput); }
| 3,230,801
|
void setCurMax(int v) { curMax = "end: "+v; repaint(0, 0, leftBorder, HEIGHT); }
|
void setCurMax(int v) { curMax = "end: "+v; repaint(0, 0, leftBorder, HEIGHT); }
| 3,230,802
|
void setCurMin(int v) { curMin = "start: "+v; repaint(0, 0, leftBorder, HEIGHT); }
|
void setCurMin(int v) { curMin = "start: "+v; repaint(0, 0, leftBorder, HEIGHT); }
| 3,230,803
|
private void setInputWindow(int s, int e) { curMin = "start: "+s; curMax = "end: "+e; }
|
private void setInputWindow(int s, int e) { curMin = "start: "+s; curMax = "end: "+e; }
| 3,230,804
|
void setKnobOutputEnd(int x, int y) { xEndOutput1 = x; xEndOutput2 = x-triangleH; xEndOutput3 = x-triangleH; yEndOutput1 = y; yEndOutput2 = y-triangleW; yEndOutput3 = y+triangleW; }
|
void setKnobOutputEnd(int x, int y) { xEndOutput1 = x; xEndOutput2 = x-triangleH; xEndOutput3 = x-triangleH; yEndOutput1 = y; yEndOutput2 = y-triangleW; yEndOutput3 = y+triangleW; }
| 3,230,805
|
void setKnobOutputStart(int x, int y) { xStartOutput1 = x; xStartOutput2 = x+triangleH; xStartOutput3 = x+triangleH; yStartOutput1 = y; yStartOutput2 = y-triangleW; yStartOutput3 = y+triangleW; }
|
void setKnobOutputStart(int x, int y) { xStartOutput1 = x; xStartOutput2 = x+triangleH; xStartOutput3 = x+triangleH; yStartOutput1 = y; yStartOutput2 = y-triangleW; yStartOutput3 = y+triangleW; }
| 3,230,806
|
private void setWindowLimits(int m, int M) { min = "Min: "+m; max = "Max: "+M; }
|
private void setWindowLimits(int m, int M) { min = "Min: "+m; max = "Max: "+M; }
| 3,230,807
|
void updateEndOutputKnob(int y) { yEndOutput1 = y; yEndOutput2 = y-triangleW; yEndOutput3 = y+triangleW; }
|
void updateEndOutputKnob(int y) { yEndOutput1 = y; yEndOutput2 = y-triangleW; yEndOutput3 = y+triangleW; }
| 3,230,808
|
void updateInputEnd(int y, int yReal) { heightEnd = y-topBorder; curMax = "end: "+yReal; updateEndOutputKnob(y); repaint(); }
|
void updateInputEnd(int y, int yReal) { heightEnd = y-topBorder; curMax = "end: "+yReal; updateEndOutputKnob(y); repaint(); }
| 3,230,809
|
void updateInputStart(int y, int yReal) { controlOutputStart = y; heightStart = tS-y; curMin = "start: "+yReal; updateStartOutputKnob(y); repaint(); }
|
void updateInputStart(int y, int yReal) { controlOutputStart = y; heightStart = tS-y; curMin = "start: "+yReal; updateStartOutputKnob(y); repaint(); }
| 3,230,810
|
void updateStartOutputKnob(int y) { yStartOutput1 = y; yStartOutput2 = y-triangleW; yStartOutput3 = y+triangleW; }
|
void updateStartOutputKnob(int y) { yStartOutput1 = y; yStartOutput2 = y-triangleW; yStartOutput3 = y+triangleW; }
| 3,230,811
|
public boolean isDisplayed() { return model.isDisplayed(); }
|
public boolean isDisplayed() { return model.isDisplayed(); }
| 3,230,812
|
public void refreshClassification(ImageData[] images, Set categories, int m) { switch (model.getState()) { case NEW: case READY: break; default: new IllegalStateException("This method can only be invoked " + "in the NEW or READY state."); } if (categories == null) throw new IllegalArgumentException("Categories shouln't be null."); if (images == null) throw new IllegalArgumentException("No image."); if (images.length == 0) throw new IllegalArgumentException("No image."); if (m != Classifier.CLASSIFY_MODE && m != Classifier.DECLASSIFY_MODE) throw new IllegalArgumentException("Classification mode not " + "supported."); ImageData img; ClassificationVisitor visitor; List nodes; //long userID = model.getUserID(); //long groupID = model.getRootGroupID(); int editorType = model.getBrowserType(); if (editorType == CATEGORY_EXPLORER) { refreshTree(); return; } for (int i = 0; i < images.length; i++) { img = images[i]; visitor = new ClassificationVisitor(this, img, categories); accept(visitor, TreeImageDisplayVisitor.TREEIMAGE_NODE_ONLY); nodes = visitor.getFoundNodes(); /* d = TreeViewerTranslator.transformDataObject(img, userID, groupID); if (editorType == CATEGORY_EXPLORER) { if (m == Classifier.CLASSIFY_MODE) { last = getLastSelectedDisplay(); if (last == null) createNodes(nodes, d, null); else createNodes(nodes, d, last.getParentDisplay()); } else removeNodes(nodes); } else if (editorType == PROJECT_EXPLORER || editorType == IMAGES_EXPLORER) */ view.updateNodes(nodes, img); } }
|
public void refreshClassification(ImageData[] images, Set categories, int m) { switch (model.getState()) { case NEW: case READY: break; default: new IllegalStateException("This method can only be invoked " + "in the NEW or READY state."); } if (categories == null) throw new IllegalArgumentException("Categories shouln't be null."); if (images == null) throw new IllegalArgumentException("No image."); if (images.length == 0) throw new IllegalArgumentException("No image."); if (m != Classifier.CLASSIFY_MODE && m != Classifier.DECLASSIFY_MODE) throw new IllegalArgumentException("Classification mode not " + "supported."); ImageData img; ClassificationVisitor visitor; List nodes; //long userID = model.getUserID(); //long groupID = model.getRootGroupID(); int editorType = model.getBrowserType(); if (editorType == CATEGORY_EXPLORER) { refreshTree(); return; } for (int i = 0; i < images.length; i++) { img = images[i]; visitor = new ClassificationVisitor(this, img, categories); accept(visitor, TreeImageDisplayVisitor.TREEIMAGE_NODE_ONLY); nodes = visitor.getFoundNodes(); /* d = TreeViewerTranslator.transformDataObject(img, userID, groupID); if (editorType == CATEGORY_EXPLORER) { if (m == Classifier.CLASSIFY_MODE) { last = getLastSelectedDisplay(); if (last == null) createNodes(nodes, d, null); else createNodes(nodes, d, last.getParentDisplay()); } else removeNodes(nodes); } else if (editorType == PROJECT_EXPLORER || editorType == IMAGES_EXPLORER) */ view.updateNodes(nodes, img); } }
| 3,230,813
|
public void sortTreeNodes(int sortType) { switch (model.getState()) { case COUNTING_ITEMS: case LOADING_DATA: case LOADING_LEAVES: case DISCARDED: throw new IllegalStateException( "This method cannot be invoked in the LOADING_DATA, "+ " LOADING_LEAVES or DISCARDED state."); } switch (sortType) { case SORT_NODES_BY_DATE: case SORT_NODES_BY_NAME: break; default: throw new IllegalArgumentException("SortType not supported."); } view.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); /* SortCmd cmd; TreeImageDisplay node; if (model.getBrowserType() == Browser.IMAGES_EXPLORER) node = view.getTreeRoot(); else node = getLastSelectedDisplay(); cmd = new SortCmd(this, sortType, node); cmd.execute(); //view.setSortedNodes(cmd.getSortedNodes(), node); */ view.sortNodes(sortType); view.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }
|
public void sortTreeNodes(int sortType) { switch (model.getState()) { case COUNTING_ITEMS: case LOADING_DATA: case LOADING_LEAVES: case DISCARDED: throw new IllegalStateException( "This method cannot be invoked in the LOADING_DATA, "+ " LOADING_LEAVES or DISCARDED state."); } switch (sortType) { case SORT_NODES_BY_DATE: case SORT_NODES_BY_NAME: break; default: throw new IllegalArgumentException("SortType not supported."); } view.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); /* SortCmd cmd; TreeImageDisplay node; if (model.getBrowserType() == Browser.IMAGES_EXPLORER) node = view.getTreeRoot(); else node = getLastSelectedDisplay(); cmd = new SortCmd(this, sortType, node); cmd.execute(); //view.setSortedNodes(cmd.getSortedNodes(), node); */ view.sortNodes(sortType); view.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }
| 3,230,815
|
public void sortTreeNodes(int sortType) { switch (model.getState()) { case COUNTING_ITEMS: case LOADING_DATA: case LOADING_LEAVES: case DISCARDED: throw new IllegalStateException( "This method cannot be invoked in the LOADING_DATA, "+ " LOADING_LEAVES or DISCARDED state."); } switch (sortType) { case SORT_NODES_BY_DATE: case SORT_NODES_BY_NAME: break; default: throw new IllegalArgumentException("SortType not supported."); } view.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); /* SortCmd cmd; TreeImageDisplay node; if (model.getBrowserType() == Browser.IMAGES_EXPLORER) node = view.getTreeRoot(); else node = getLastSelectedDisplay(); cmd = new SortCmd(this, sortType, node); cmd.execute(); //view.setSortedNodes(cmd.getSortedNodes(), node); */ view.sortNodes(sortType); view.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }
|
publicvoidsortTreeNodes(intsortType){switch(model.getState()){ caseCOUNTING_ITEMS:caseLOADING_DATA:caseLOADING_LEAVES:caseDISCARDED:thrownewIllegalStateException("ThismethodcannotbeinvokedintheLOADING_DATA,"+"LOADING_LEAVESorDISCARDEDstate.");}switch(sortType){caseSORT_NODES_BY_DATE:caseSORT_NODES_BY_NAME:break;default:thrownewIllegalArgumentException("SortTypenotsupported.");}view.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));/*SortCmdcmd;TreeImageDisplaynode;if(model.getBrowserType()==Browser.IMAGES_EXPLORER)node=view.getTreeRoot();elsenode=getLastSelectedDisplay();cmd=newSortCmd(this,sortType,node);cmd.execute();//view.setSortedNodes(cmd.getSortedNodes(),node);*/view.sortNodes(sortType);view.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));}
| 3,230,816
|
private static Criteria buildBasicImagesCriteria() { Criteria criteria = new Criteria(); //Specify which fields we want for the image. criteria.addWantedField("name"); criteria.addWantedField("created"); //Specify which fields we want for the pixels. criteria.addWantedField("default_pixels"); return criteria; }
|
private static Criteria buildBasicImagesCriteria() { Criteria c = new Criteria(); //Specify which fields we want for the image. criteria.addWantedField("name"); criteria.addWantedField("created"); //Specify which fields we want for the pixels. criteria.addWantedField("default_pixels"); return criteria; }
| 3,230,817
|
private static Criteria buildBasicImagesCriteria() { Criteria criteria = new Criteria(); //Specify which fields we want for the image. criteria.addWantedField("name"); criteria.addWantedField("created"); //Specify which fields we want for the pixels. criteria.addWantedField("default_pixels"); return criteria; }
|
private static Criteria buildBasicImagesCriteria() { Criteria criteria = new Criteria(); //Specify which fields we want for the image. criteria.addWantedField("name"); criteria.addWantedField("created"); //Specify which fields we want for the pixels. criteria.addWantedField("default_pixels"); return criteria; }
| 3,230,818
|
private static Criteria buildBasicImagesCriteria() { Criteria criteria = new Criteria(); //Specify which fields we want for the image. criteria.addWantedField("name"); criteria.addWantedField("created"); //Specify which fields we want for the pixels. criteria.addWantedField("default_pixels"); return criteria; }
|
private static Criteria buildBasicImagesCriteria() { Criteria criteria = new Criteria(); //Specify which fields we want for the image. criteria.addWantedField("name"); criteria.addWantedField("created"); //Specify which fields we want for the pixels. criteria.addWantedField("default_pixels"); return criteria; }
| 3,230,819
|
public static Criteria buildImageCriteria(int id) { Criteria criteria = PixelsMapper.buildPixelsCriteria(id); //Specify which fields we want for the image. criteria.addWantedField("name"); criteria.addWantedField("description"); criteria.addWantedField("inserted"); criteria.addWantedField("created"); criteria.addWantedField("owner"); criteria.addWantedField("datasets"); //Specify which fields we want for the datasets. criteria.addWantedField("datasets", "name"); //Fields for the owner. UserMapper.objectOwnerCriteria(criteria); return criteria; }
|
public static Criteria buildImageCriteria(int id) { Criteria criteria = PixelsMapper.buildPixelsCriteria(id); //Specify which fields we want for the image. criteria.addWantedField("name"); criteria.addWantedField("description"); criteria.addWantedField("inserted"); criteria.addWantedField("created"); criteria.addWantedField("owner"); criteria.addWantedField("datasets"); //Specify which fields we want for the datasets. criteria.addWantedField("datasets", "name"); //Fields for the owner. UserMapper.objectOwnerCriteria(criteria); return criteria; }
| 3,230,820
|
public static Criteria buildImageCriteria(int id) { Criteria criteria = PixelsMapper.buildPixelsCriteria(id); //Specify which fields we want for the image. criteria.addWantedField("name"); criteria.addWantedField("description"); criteria.addWantedField("inserted"); criteria.addWantedField("created"); criteria.addWantedField("owner"); criteria.addWantedField("datasets"); //Specify which fields we want for the datasets. criteria.addWantedField("datasets", "name"); //Fields for the owner. UserMapper.objectOwnerCriteria(criteria); return criteria; }
|
public static Criteria buildImageCriteria(int id) { Criteria criteria = PixelsMapper.buildPixelsCriteria(id); //Specify which fields we want for the image. criteria.addWantedField("name"); criteria.addWantedField("description"); criteria.addWantedField("inserted"); criteria.addWantedField("created"); criteria.addWantedField("owner"); criteria.addWantedField("datasets"); //Specify which fields we want for the datasets. criteria.addWantedField("datasets", "name"); //Fields for the owner. UserMapper.objectOwnerCriteria(criteria); return criteria; }
| 3,230,821
|
public static Criteria buildImageCriteria(int id) { Criteria criteria = PixelsMapper.buildPixelsCriteria(id); //Specify which fields we want for the image. criteria.addWantedField("name"); criteria.addWantedField("description"); criteria.addWantedField("inserted"); criteria.addWantedField("created"); criteria.addWantedField("owner"); criteria.addWantedField("datasets"); //Specify which fields we want for the datasets. criteria.addWantedField("datasets", "name"); //Fields for the owner. UserMapper.objectOwnerCriteria(criteria); return criteria; }
|
public static Criteria buildImageCriteria(int id) { Criteria criteria = PixelsMapper.buildPixelsCriteria(id); //Specify which fields we want for the image. criteria.addWantedField("name"); criteria.addWantedField("description"); criteria.addWantedField("inserted"); criteria.addWantedField("created"); criteria.addWantedField("owner"); criteria.addWantedField("datasets"); //Specify which fields we want for the datasets. criteria.addWantedField("datasets", "name"); //Fields for the owner. UserMapper.objectOwnerCriteria(criteria); return criteria; }
| 3,230,822
|
public static Criteria buildImageCriteria(int id) { Criteria criteria = PixelsMapper.buildPixelsCriteria(id); //Specify which fields we want for the image. criteria.addWantedField("name"); criteria.addWantedField("description"); criteria.addWantedField("inserted"); criteria.addWantedField("created"); criteria.addWantedField("owner"); criteria.addWantedField("datasets"); //Specify which fields we want for the datasets. criteria.addWantedField("datasets", "name"); //Fields for the owner. UserMapper.objectOwnerCriteria(criteria); return criteria; }
|
public static Criteria buildImageCriteria(int id) { Criteria criteria = PixelsMapper.buildPixelsCriteria(id); //Specify which fields we want for the image. criteria.addWantedField("name"); criteria.addWantedField("description"); criteria.addWantedField("inserted"); criteria.addWantedField("created"); criteria.addWantedField("owner"); criteria.addWantedField("datasets"); //Specify which fields we want for the datasets. criteria.addWantedField("datasets", "name"); //Fields for the owner. UserMapper.objectOwnerCriteria(c); return criteria; }
| 3,230,823
|
public static Criteria buildImageCriteria(int id) { Criteria criteria = PixelsMapper.buildPixelsCriteria(id); //Specify which fields we want for the image. criteria.addWantedField("name"); criteria.addWantedField("description"); criteria.addWantedField("inserted"); criteria.addWantedField("created"); criteria.addWantedField("owner"); criteria.addWantedField("datasets"); //Specify which fields we want for the datasets. criteria.addWantedField("datasets", "name"); //Fields for the owner. UserMapper.objectOwnerCriteria(criteria); return criteria; }
|
public static Criteria buildImageCriteria(int id) { Criteria criteria = PixelsMapper.buildPixelsCriteria(id); //Specify which fields we want for the image. criteria.addWantedField("name"); criteria.addWantedField("description"); criteria.addWantedField("inserted"); criteria.addWantedField("created"); criteria.addWantedField("owner"); criteria.addWantedField("datasets"); //Specify which fields we want for the datasets. criteria.addWantedField("datasets", "name"); //Fields for the owner. UserMapper.objectOwnerCriteria(criteria); return criteria; }
| 3,230,824
|
static void buildImageSummary(Image img, ImageSummary is) { is.setID(img.getID()); is.setName(img.getName()); is.setPixelsIDs(fillListPixelsID(img.getDefaultPixels())); is.setDate(PrimitiveTypesMapper.getTimestamp(img.getCreated())); //is.setImageServerPixelsID(fillListPixelsID(px)); }
|
static ImageSummary buildImageSummary(Image img, ImageSummary is) { is.setID(img.getID()); is.setName(img.getName()); is.setPixelsIDs(fillListPixelsID(img.getDefaultPixels())); is.setDate(PrimitiveTypesMapper.getTimestamp(img.getCreated())); //is.setImageServerPixelsID(fillListPixelsID(px)); }
| 3,230,825
|
static void buildImageSummary(Image img, ImageSummary is) { is.setID(img.getID()); is.setName(img.getName()); is.setPixelsIDs(fillListPixelsID(img.getDefaultPixels())); is.setDate(PrimitiveTypesMapper.getTimestamp(img.getCreated())); //is.setImageServerPixelsID(fillListPixelsID(px)); }
|
static void buildImageSummary(Image img, ImageSummary is) { is.setID(img.getID()); is.setName(img.getName()); is.setPixelsIDs(fillListPixelsID(img.getDefaultPixels())); List pixels = fillPixels(img.getDefaultPixels()); if (pixels.size() > 0) is.setDefaultPixels((PixelsDescription) pixels.get(0)); return is; //is.setImageServerPixelsID(fillListPixelsID(px)); }
| 3,230,826
|
public static void fillImage(Image image, ImageData empty) { //Fill in the data coming from OMEDS object. empty.setID(image.getID()); empty.setName(image.getName()); empty.setDescription(image.getDescription()); empty.setCreated(PrimitiveTypesMapper.getTimestamp(image.getCreated())); empty.setInserted( PrimitiveTypesMapper.getTimestamp(image.getInserted())); //Fill in the data coming from Experimenter. Experimenter owner = image.getOwner(); empty.setOwnerID(owner.getID()); empty.setOwnerFirstName(owner.getFirstName()); empty.setOwnerLastName(owner.getLastName()); empty.setOwnerEmail(owner.getEmail()); empty.setOwnerInstitution(owner.getInstitution()); //Fill in the data coming from Group. Group group = owner.getGroup(); empty.setOwnerGroupID(group.getID()); empty.setOwnerGroupName(group.getName()); //dataset summary list. List datasets = new ArrayList(); Iterator i = image.getDatasets().iterator(); Dataset d; while (i.hasNext()) { d = (Dataset) i.next(); datasets.add(new DatasetSummary(d.getID(), d.getName())); } empty.setDatasets(datasets); // pixelsDescription list. Pixels defaultPix = image.getDefaultPixels(); if (defaultPix != null) { empty.setPixelsIDs(fillListPixelsID(defaultPix)); empty.setPixels(fillPixels(defaultPix)); } }
|
public static void fillImage(Image image, ImageData empty) { //Fill in the data coming from OMEDS object. empty.setID(image.getID()); empty.setName(image.getName()); empty.setDescription(image.getDescription()); empty.setCreated(PrimitiveTypesMapper.getTimestamp(image.getCreated())); empty.setInserted( PrimitiveTypesMapper.getTimestamp(image.getInserted())); //Fill in the data coming from Experimenter. Experimenter owner = image.getOwner(); empty.setOwnerID(owner.getID()); empty.setOwnerFirstName(owner.getFirstName()); empty.setOwnerLastName(owner.getLastName()); empty.setOwnerEmail(owner.getEmail()); empty.setOwnerInstitution(owner.getInstitution()); //Fill in the data coming from Group. Group group = owner.getGroup(); empty.setOwnerGroupID(group.getID()); empty.setOwnerGroupName(group.getName()); //dataset summary list. List datasets = new ArrayList(); Iterator i = image.getDatasets().iterator(); Dataset d; while (i.hasNext()) { d = (Dataset) i.next(); datasets.add(new DatasetSummary(d.getID(), d.getName())); } empty.setDatasets(datasets); // pixelsDescription list. Pixels defaultPix = image.getDefaultPixels(); if (defaultPix != null) { empty.setPixelsIDs(fillListPixelsID(defaultPix)); empty.setPixels(fillPixels(defaultPix)); } }
| 3,230,827
|
private static int[] fillListPixelsID(Pixels px) { int[] ids = new int[1]; ids[0] = px.getID(); return ids; }
|
private static int[] fillListPixelsID(Pixels px) { int[] ids = new int[1]; ids[0] = px.getID(); return ids; }
| 3,230,828
|
private static List fillPixels(Pixels px) { List pixels = new ArrayList(); PixelsDescription pxd = new PixelsDescription(); pxd.setID(px.getID()); if (px.getSizeX() != null) pxd.setSizeX((px.getSizeX()).intValue()); if (px.getSizeY() != null) pxd.setSizeY((px.getSizeY()).intValue()); if (px.getSizeZ() != null) pxd.setSizeZ((px.getSizeZ()).intValue()); if (px.getSizeC() != null) pxd.setSizeC((px.getSizeC()).intValue()); if (px.getSizeT() != null) pxd.setSizeT((px.getSizeT()).intValue()); pxd.setPixelType(px.getPixelType()); pxd.setImageServerUrl(px.getRepository().getImageServerURL()); if (px.getImageServerID() != null) pxd.setImageServerID((px.getImageServerID()).longValue()); pxd.setPixels(px); pixels.add(pxd); return pixels; }
|
private static List fillPixels(Pixels px) { List pixels = new ArrayList(); PixelsDescription pxd = new PixelsDescription(); pxd.setID(px.getID()); if (px.getSizeX() != null) pxd.setSizeX((px.getSizeX()).intValue()); if (px.getSizeY() != null) pxd.setSizeY((px.getSizeY()).intValue()); if (px.getSizeZ() != null) pxd.setSizeZ((px.getSizeZ()).intValue()); if (px.getSizeC() != null) pxd.setSizeC((px.getSizeC()).intValue()); if (px.getSizeT() != null) pxd.setSizeT((px.getSizeT()).intValue()); pxd.setPixelType(px.getPixelType()); pxd.setImageServerUrl(px.getRepository().getImageServerURL()); if (px.getImageServerID() != null) pxd.setImageServerID((px.getImageServerID()).longValue()); pxd.setPixels(px); pixels.add(pxd); return pixels; }
| 3,230,829
|
private static List fillPixels(Pixels px) { List pixels = new ArrayList(); PixelsDescription pxd = new PixelsDescription(); pxd.setID(px.getID()); if (px.getSizeX() != null) pxd.setSizeX((px.getSizeX()).intValue()); if (px.getSizeY() != null) pxd.setSizeY((px.getSizeY()).intValue()); if (px.getSizeZ() != null) pxd.setSizeZ((px.getSizeZ()).intValue()); if (px.getSizeC() != null) pxd.setSizeC((px.getSizeC()).intValue()); if (px.getSizeT() != null) pxd.setSizeT((px.getSizeT()).intValue()); pxd.setPixelType(px.getPixelType()); pxd.setImageServerUrl(px.getRepository().getImageServerURL()); if (px.getImageServerID() != null) pxd.setImageServerID((px.getImageServerID()).longValue()); pxd.setPixels(px); pixels.add(pxd); return pixels; }
|
private static List fillPixels(Pixels px) { List pixels = new ArrayList(); PixelsDescription pxd = new PixelsDescription(); pxd.setID(px.getID()); if (px.getSizeX() != null) pxd.setSizeX((px.getSizeX()).intValue()); if (px.getSizeY() != null) pxd.setSizeY((px.getSizeY()).intValue()); if (px.getSizeZ() != null) pxd.setSizeZ((px.getSizeZ()).intValue()); if (px.getSizeC() != null) pxd.setSizeC((px.getSizeC()).intValue()); if (px.getSizeT() != null) pxd.setSizeT((px.getSizeT()).intValue()); pxd.setPixelType(px.getPixelType()); pxd.setImageServerUrl(px.getRepository().getImageServerURL()); if (px.getImageServerID() != null) pxd.setImageServerID((px.getImageServerID()).longValue()); pxd.setPixels(px); pixels.add(pxd); return pixels; }
| 3,230,830
|
LensUI(LensComponent lensComponent, int w, int h) { this.lensComponent = lensComponent; setSize(new Dimension(w,h)); setOpaque(false); setShowCrossHair(true); mouseListener = new LensMouseListener(this); addMouseListener(mouseListener); addMouseMotionListener(mouseListener); addMouseWheelListener(mouseListener); lensMenu = LensMenu.getMenu(lensComponent); menu = lensMenu.getPopupMenu(); }
|
LensUI(LensComponent lensComponent, int w, int h) { this.lensComponent = lensComponent; setSize(new Dimension(w,h)); setOpaque(false); setShowCrossHair(true); mouseListener = new LensMouseListener(this); addMouseListener(mouseListener); addMouseMotionListener(mouseListener); addMouseWheelListener(mouseListener); lensMenu = LensMenu.getMenu(lensComponent); menu = lensMenu.getPopupMenu(); }
| 3,230,831
|
void setLensLocation(int x, int y) { lensModel.setLensLocation(x,y); lens.setLocation(lensModel.getScaledX(),lensModel.getScaledY()); zoomWindow.setZoomImage(lensModel.getZoomedImage()); zoomWindow.setLensXY(lensModel.getX(), lensModel.getY()); zoomWindow.setLensWidthHeight(lensModel.getWidth(), lensModel.getHeight()); }
|
void setLensLocation(int x, int y) { lensModel.setLensLocation(x,y); lens.setLocation(lensModel.getScaledX(),lensModel.getScaledY()); zoomWindow.setZoomImage(lensModel.getZoomedImage()); zoomWindow.setLensXY(lensModel.getX(), lensModel.getY()); zoomWindow.setLensWidthHeight(lensModel.getWidth(), lensModel.getHeight()); }
| 3,230,832
|
void setLensSize(int w, int h) { int scaledW, scaledH; scaledW = (int)(w*lensModel.getImageZoomFactor()); scaledH = (int)(h*lensModel.getImageZoomFactor()); if (lens.getX()+scaledW > lensModel.getImageScaledWidth()) { scaledW = lensModel.getImageScaledWidth()-lens.getX(); w = (int)(scaledW/lensModel.getImageZoomFactor()); } if (lens.getY()+scaledH > lensModel.getImageScaledHeight()) { scaledH = lensModel.getImageScaledHeight()-lens.getY(); h = (int)(scaledH/lensModel.getImageZoomFactor()); } lensModel.setWidth(w); lensModel.setHeight(h); lens.setSize(scaledW, scaledH); zoomWindow.setZoomImage(lensModel.getZoomedImage()); zoomWindow.setLensWidthHeight(lensModel.getWidth(), lensModel.getHeight()); setZoomUISize(); }
|
void setLensSize(int w, int h) { int scaledW, scaledH; scaledW = (int)(w*lensModel.getImageZoomFactor()); scaledH = (int)(h*lensModel.getImageZoomFactor()); if (lens.getX()+scaledW > lensModel.getImageScaledWidth()) { scaledW = lensModel.getImageScaledWidth()-lens.getX(); w = (int)(scaledW/lensModel.getImageZoomFactor()); } if (lens.getY()+scaledH > lensModel.getImageScaledHeight()) { scaledH = lensModel.getImageScaledHeight()-lens.getY(); h = (int)(scaledH/lensModel.getImageZoomFactor()); } lensModel.setWidth(w); lensModel.setHeight(h); lens.setSize(scaledW, scaledH); zoomWindow.setZoomImage(lensModel.getZoomedImage()); zoomWindow.setLensWidthHeight(lensModel.getWidth(), lensModel.getHeight()); setZoomUISize(); }
| 3,230,833
|
void setLensSize(int w, int h) { int scaledW, scaledH; scaledW = (int)(w*lensModel.getImageZoomFactor()); scaledH = (int)(h*lensModel.getImageZoomFactor()); if (lens.getX()+scaledW > lensModel.getImageScaledWidth()) { scaledW = lensModel.getImageScaledWidth()-lens.getX(); w = (int)(scaledW/lensModel.getImageZoomFactor()); } if (lens.getY()+scaledH > lensModel.getImageScaledHeight()) { scaledH = lensModel.getImageScaledHeight()-lens.getY(); h = (int)(scaledH/lensModel.getImageZoomFactor()); } lensModel.setWidth(w); lensModel.setHeight(h); lens.setSize(scaledW, scaledH); zoomWindow.setZoomImage(lensModel.getZoomedImage()); zoomWindow.setLensWidthHeight(lensModel.getWidth(), lensModel.getHeight()); setZoomUISize(); }
|
void setLensSize(int w, int h) { int scaledW, scaledH; scaledW = (int)(w*lensModel.getImageZoomFactor()); scaledH = (int)(h*lensModel.getImageZoomFactor()); if (lens.getX()+scaledW > lensModel.getImageScaledWidth()) { scaledW = lensModel.getImageScaledWidth()-lens.getX(); w = (int)(scaledW/lensModel.getImageZoomFactor()); } if (lens.getY()+scaledH > lensModel.getImageScaledHeight()) { scaledH = lensModel.getImageScaledHeight()-lens.getY(); h = (int)(scaledH/lensModel.getImageZoomFactor()); } lensModel.setWidth(w); lensModel.setHeight(h); lens.setSize(scaledW, scaledH); zoomWindow.setZoomImage(lensModel.getZoomedImage()); zoomWindow.setLensWidthHeight(lensModel.getWidth(), lensModel.getHeight()); setZoomUISize(); }
| 3,230,834
|
void setLensSize(int w, int h) { int scaledW, scaledH; scaledW = (int)(w*lensModel.getImageZoomFactor()); scaledH = (int)(h*lensModel.getImageZoomFactor()); if (lens.getX()+scaledW > lensModel.getImageScaledWidth()) { scaledW = lensModel.getImageScaledWidth()-lens.getX(); w = (int)(scaledW/lensModel.getImageZoomFactor()); } if (lens.getY()+scaledH > lensModel.getImageScaledHeight()) { scaledH = lensModel.getImageScaledHeight()-lens.getY(); h = (int)(scaledH/lensModel.getImageZoomFactor()); } lensModel.setWidth(w); lensModel.setHeight(h); lens.setSize(scaledW, scaledH); zoomWindow.setZoomImage(lensModel.getZoomedImage()); zoomWindow.setLensWidthHeight(lensModel.getWidth(), lensModel.getHeight()); setZoomUISize(); }
|
void setLensSize(int w, int h) { int scaledW, scaledH; scaledW = (int)(w*lensModel.getImageZoomFactor()); scaledH = (int)(h*lensModel.getImageZoomFactor()); if (lens.getX()+scaledW > lensModel.getImageScaledWidth()) { scaledW = lensModel.getImageScaledWidth()-lens.getX(); w = (int)(scaledW/lensModel.getImageZoomFactor()); } if (lens.getY()+scaledH > lensModel.getImageScaledHeight()) { scaledH = lensModel.getImageScaledHeight()-lens.getY(); h = (int)(scaledH/lensModel.getImageZoomFactor()); } lensModel.setWidth(w); lensModel.setHeight(h); lens.setSize(scaledW, scaledH); zoomWindow.setZoomImage(lensModel.getZoomedImage()); zoomWindow.setLensWidthHeight(lensModel.getWidth(), lensModel.getHeight()); setZoomUISize(); }
| 3,230,835
|
void setLensSize(int w, int h) { int scaledW, scaledH; scaledW = (int)(w*lensModel.getImageZoomFactor()); scaledH = (int)(h*lensModel.getImageZoomFactor()); if (lens.getX()+scaledW > lensModel.getImageScaledWidth()) { scaledW = lensModel.getImageScaledWidth()-lens.getX(); w = (int)(scaledW/lensModel.getImageZoomFactor()); } if (lens.getY()+scaledH > lensModel.getImageScaledHeight()) { scaledH = lensModel.getImageScaledHeight()-lens.getY(); h = (int)(scaledH/lensModel.getImageZoomFactor()); } lensModel.setWidth(w); lensModel.setHeight(h); lens.setSize(scaledW, scaledH); zoomWindow.setZoomImage(lensModel.getZoomedImage()); zoomWindow.setLensWidthHeight(lensModel.getWidth(), lensModel.getHeight()); setZoomUISize(); }
|
void setLensSize(int w, int h) { int scaledW, scaledH; scaledW = (int)(w*lensModel.getImageZoomFactor()); scaledH = (int)(h*lensModel.getImageZoomFactor()); if (lens.getX()+scaledW > lensModel.getImageScaledWidth()) { scaledW = lensModel.getImageScaledWidth()-lens.getX(); w = (int)(scaledW/lensModel.getImageZoomFactor()); } if (lens.getY()+scaledH > lensModel.getImageScaledHeight()) { scaledH = lensModel.getImageScaledHeight()-lens.getY(); h = (int)(scaledH/lensModel.getImageZoomFactor()); } lensModel.setWidth(w); lensModel.setHeight(h); lens.setSize(scaledW, scaledH); zoomWindow.setZoomImage(lensModel.getZoomedImage()); zoomWindow.setLensWidthHeight(lensModel.getWidth(), lensModel.getHeight()); setZoomUISize(); }
| 3,230,836
|
private String getCorrectedPath(String path) { return path.replace('/', '\\'); }
|
private String getCorrectedPath(String path) { return path.replace('\\', '/'); }
| 3,230,837
|
public void execute() { if (model != null && hierarchyObject == null) { ImageDisplay selectedDisplay = model.getBrowser(). getLastSelectedDisplay(); hierarchyObject = (DataObject) selectedDisplay.getHierarchyObject(); } if (hierarchyObject == null) return; if (hierarchyObject instanceof DatasetData) HiViewerAgent.browse(Browse.DATASET, ((DatasetData) hierarchyObject).getId(), model.getRootLevel(), model.getRootID()); else if (hierarchyObject instanceof ProjectData) HiViewerAgent.browse(Browse.PROJECT, ((ProjectData) hierarchyObject).getId(), model.getRootLevel(), model.getRootID()); else if (hierarchyObject instanceof CategoryGroupData) HiViewerAgent.browse(Browse.CATEGORY_GROUP, ((CategoryGroupData) hierarchyObject).getId(), model.getRootLevel(), model.getRootID()); else if (hierarchyObject instanceof CategoryData) HiViewerAgent.browse(Browse.CATEGORY, ((CategoryData) hierarchyObject).getId(), model.getRootLevel(), model.getRootID()); else if (hierarchyObject instanceof ImageData) { EventBus eventBus = HiViewerAgent.getRegistry().getEventBus(); ImageData is = (ImageData) hierarchyObject; Set images = model.getBrowser().getSelectedDisplays(); Iterator i = images.iterator(); while (i.hasNext()) { is = (ImageData) ((ImageDisplay) i.next()).getHierarchyObject(); eventBus.post(new ViewImage(is.getId(), is.getDefaultPixels().getId(), is.getName())); } } }
|
public void execute() { if (model != null && hierarchyObject == null) { ImageDisplay selectedDisplay = model.getBrowser(). getLastSelectedDisplay(); hierarchyObject = (DataObject) selectedDisplay.getHierarchyObject(); } if (hierarchyObject == null) return; if (hierarchyObject instanceof DatasetData) HiViewerAgent.browse(Browse.DATASET, ((DatasetData) hierarchyObject).getId(), model.getRootLevel(), model.getRootID()); else if (hierarchyObject instanceof ProjectData) HiViewerAgent.browse(Browse.PROJECT, ((ProjectData) hierarchyObject).getId(), model.getRootLevel(), model.getRootID()); else if (hierarchyObject instanceof CategoryGroupData) HiViewerAgent.browse(Browse.CATEGORY_GROUP, ((CategoryGroupData) hierarchyObject).getId(), model.getRootLevel(), model.getRootID()); else if (hierarchyObject instanceof CategoryData) HiViewerAgent.browse(Browse.CATEGORY, ((CategoryData) hierarchyObject).getId(), model.getRootLevel(), model.getRootID()); else if (hierarchyObject instanceof ImageData) { EventBus eventBus = HiViewerAgent.getRegistry().getEventBus(); ImageData is = (ImageData) hierarchyObject; Set images = model.getBrowser().getSelectedDisplays(); Iterator i = images.iterator(); while (i.hasNext()) { is = (ImageData) ((ImageDisplay) i.next()).getHierarchyObject(); eventBus.post(new ViewImage(is.getId(), is.getDefaultPixels().getId(), is.getName())); } } }
| 3,230,838
|
private void addTransport(final Transport transport) { final StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); final JPanel commandPanel = statusBar.getCommandPanel(); final boolean isRegistered = TransportManager.isRegistered(SparkManager.getConnection(), transport); final RolloverButton button = new RolloverButton(); if (!isRegistered) { button.setIcon(transport.getInactiveIcon()); } else { button.setIcon(transport.getIcon()); } button.setToolTipText(transport.getInstructions()); commandPanel.add(button); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (!isRegistered) { TransportManager.registerWithService(SparkManager.getConnection(), transport.getServiceName()); // Send Presence Presence presence = statusBar.getPresence(); statusBar.changeAvailability(presence); } else { int confirm = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), "Would you like to disable this active transport?", "Disable Transport", JOptionPane.YES_NO_OPTION); if (confirm == JOptionPane.YES_OPTION) { try { TransportManager.unregister(SparkManager.getConnection(), transport.getServiceName()); } catch (XMPPException e1) { e1.printStackTrace(); } } } } }); uiMap.put(transport, button); statusBar.invalidate(); statusBar.validate(); statusBar.repaint(); }
|
private void addTransport(final Transport transport) { final StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); final JPanel commandPanel = statusBar.getCommandPanel(); final boolean isRegistered = TransportManager.isRegistered(SparkManager.getConnection(), transport); final RolloverButton button = new RolloverButton(); boolean reg = TransportManager.isRegistered(SparkManager.getConnection(), transport); if (!reg) { button.setIcon(transport.getInactiveIcon()); } else { button.setIcon(transport.getIcon()); } button.setToolTipText(transport.getInstructions()); commandPanel.add(button); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { boolean reg = TransportManager.isRegistered(SparkManager.getConnection(), transport); if (!reg) { TransportManager.registerWithService(SparkManager.getConnection(), transport.getServiceName()); // Send Presence Presence presence = statusBar.getPresence(); statusBar.changeAvailability(presence); } else { int confirm = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), "Would you like to disable this active transport?", "Disable Transport", JOptionPane.YES_NO_OPTION); if (confirm == JOptionPane.YES_OPTION) { try { TransportManager.unregister(SparkManager.getConnection(), transport.getServiceName()); } catch (XMPPException e1) { e1.printStackTrace(); } } } } }); uiMap.put(transport, button); statusBar.invalidate(); statusBar.validate(); statusBar.repaint(); }
| 3,230,839
|
public void initialize() { try { populateTransports(SparkManager.getConnection()); } catch (Exception e) { return; } for (final Transport transport : TransportManager.getTransports()) { addTransport(transport); } SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; Transport transport = TransportManager.getTransport(packet.getFrom()); if (transport != null) { boolean registered = presence != null && presence.getMode() != null; RolloverButton button = uiMap.get(transport); if (!registered) { button.setIcon(transport.getInactiveIcon()); } else { button.setIcon(transport.getIcon()); } } } }, new PacketTypeFilter(Presence.class)); }
|
public void initialize() { try { populateTransports(SparkManager.getConnection()); } catch (Exception e) { return; } for (final Transport transport : TransportManager.getTransports()) { addTransport(transport); } SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; Transport transport = TransportManager.getTransport(packet.getFrom()); if (transport != null) { boolean registered = presence != null && presence.getMode() != null; RolloverButton button = uiMap.get(transport); if (!registered) { button.setIcon(transport.getInactiveIcon()); } else { button.setIcon(transport.getIcon()); } } } }, new PacketTypeFilter(Presence.class)); }
| 3,230,840
|
public void initialize() { try { populateTransports(SparkManager.getConnection()); } catch (Exception e) { return; } for (final Transport transport : TransportManager.getTransports()) { addTransport(transport); } SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; Transport transport = TransportManager.getTransport(packet.getFrom()); if (transport != null) { boolean registered = presence != null && presence.getMode() != null; RolloverButton button = uiMap.get(transport); if (!registered) { button.setIcon(transport.getInactiveIcon()); } else { button.setIcon(transport.getIcon()); } } } }, new PacketTypeFilter(Presence.class)); }
|
public void initialize() { try { populateTransports(SparkManager.getConnection()); } catch (Exception e) { return; } for (final Transport transport : TransportManager.getTransports()) { addTransport(transport); } SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; Transport transport = TransportManager.getTransport(packet.getFrom()); if (transport != null) { boolean registered = presence != null && presence.getMode() != null; RolloverButton button = uiMap.get(transport); if (!registered) { button.setIcon(transport.getInactiveIcon()); } else { button.setIcon(transport.getIcon()); } } } }
| 3,230,841
|
public static void registerWithService(final XMPPConnection con, final String serviceName) { final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); final TransportRegistrationPanel regPanel = new TransportRegistrationPanel(serviceName); mainPanel.add(regPanel, BorderLayout.CENTER); final JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); final RolloverButton registerButton = new RolloverButton("Register", null); final RolloverButton cancelButton = new RolloverButton("Cancel", null); buttonPanel.add(registerButton); buttonPanel.add(cancelButton); mainPanel.add(buttonPanel, BorderLayout.SOUTH); // Create Dialog Transport transport = TransportManager.getTransport(serviceName); final JDialog dialog = new JDialog(SparkManager.getMainWindow(), transport.getTitle(), true); dialog.add(mainPanel); dialog.pack(); dialog.setLocationRelativeTo(SparkManager.getMainWindow()); dialog.setSize(400, 200); registerButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String username = regPanel.getScreenName(); String password = regPanel.getPassword(); if (!ModelUtil.hasLength(username) || !ModelUtil.hasLength(password)) { JOptionPane.showMessageDialog(mainPanel, "Username and/or Password need to be supplied.", "Registration Error", JOptionPane.ERROR_MESSAGE); return; } try { registerUser(con, serviceName, username, password); // Send updated presence. } catch (XMPPException e1) { JOptionPane.showMessageDialog(mainPanel, "Unable to register with Transport.", "Registration Error", JOptionPane.ERROR_MESSAGE); } dialog.dispose(); } }); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.dispose(); } }); dialog.setVisible(true); }
|
public static void registerWithService(final XMPPConnection con, final String serviceName) { final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); final TransportRegistrationPanel regPanel = new TransportRegistrationPanel(serviceName); mainPanel.add(regPanel, BorderLayout.CENTER); final JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); final RolloverButton registerButton = new RolloverButton("Register", null); final RolloverButton cancelButton = new RolloverButton("Cancel", null); buttonPanel.add(registerButton); buttonPanel.add(cancelButton); mainPanel.add(buttonPanel, BorderLayout.SOUTH); // Create Dialog Transport transport = TransportManager.getTransport(serviceName); final JDialog dialog = new JDialog(SparkManager.getMainWindow(), transport.getTitle(), true); dialog.add(mainPanel); dialog.pack(); dialog.setSize(400, 200); registerButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String username = regPanel.getScreenName(); String password = regPanel.getPassword(); if (!ModelUtil.hasLength(username) || !ModelUtil.hasLength(password)) { JOptionPane.showMessageDialog(mainPanel, "Username and/or Password need to be supplied.", "Registration Error", JOptionPane.ERROR_MESSAGE); return; } try { registerUser(con, serviceName, username, password); // Send updated presence. } catch (XMPPException e1) { JOptionPane.showMessageDialog(mainPanel, "Unable to register with Transport.", "Registration Error", JOptionPane.ERROR_MESSAGE); } dialog.dispose(); } }); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.dispose(); } }); dialog.setVisible(true); }
| 3,230,844
|
public static void registerWithService(final XMPPConnection con, final String serviceName) { final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); final TransportRegistrationPanel regPanel = new TransportRegistrationPanel(serviceName); mainPanel.add(regPanel, BorderLayout.CENTER); final JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); final RolloverButton registerButton = new RolloverButton("Register", null); final RolloverButton cancelButton = new RolloverButton("Cancel", null); buttonPanel.add(registerButton); buttonPanel.add(cancelButton); mainPanel.add(buttonPanel, BorderLayout.SOUTH); // Create Dialog Transport transport = TransportManager.getTransport(serviceName); final JDialog dialog = new JDialog(SparkManager.getMainWindow(), transport.getTitle(), true); dialog.add(mainPanel); dialog.pack(); dialog.setLocationRelativeTo(SparkManager.getMainWindow()); dialog.setSize(400, 200); registerButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String username = regPanel.getScreenName(); String password = regPanel.getPassword(); if (!ModelUtil.hasLength(username) || !ModelUtil.hasLength(password)) { JOptionPane.showMessageDialog(mainPanel, "Username and/or Password need to be supplied.", "Registration Error", JOptionPane.ERROR_MESSAGE); return; } try { registerUser(con, serviceName, username, password); // Send updated presence. } catch (XMPPException e1) { JOptionPane.showMessageDialog(mainPanel, "Unable to register with Transport.", "Registration Error", JOptionPane.ERROR_MESSAGE); } dialog.dispose(); } }); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.dispose(); } }); dialog.setVisible(true); }
|
public static void registerWithService(final XMPPConnection con, final String serviceName) { final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); final TransportRegistrationPanel regPanel = new TransportRegistrationPanel(serviceName); mainPanel.add(regPanel, BorderLayout.CENTER); final JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); final RolloverButton registerButton = new RolloverButton("Register", null); final RolloverButton cancelButton = new RolloverButton("Cancel", null); buttonPanel.add(registerButton); buttonPanel.add(cancelButton); mainPanel.add(buttonPanel, BorderLayout.SOUTH); // Create Dialog Transport transport = TransportManager.getTransport(serviceName); final JDialog dialog = new JDialog(SparkManager.getMainWindow(), transport.getTitle(), true); dialog.add(mainPanel); dialog.pack(); dialog.setLocationRelativeTo(SparkManager.getMainWindow()); dialog.setSize(400, 200); registerButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String username = regPanel.getScreenName(); String password = regPanel.getPassword(); if (!ModelUtil.hasLength(username) || !ModelUtil.hasLength(password)) { JOptionPane.showMessageDialog(mainPanel, "Username and/or Password need to be supplied.", "Registration Error", JOptionPane.ERROR_MESSAGE); return; } try { registerUser(con, serviceName, username, password); // Send updated presence. } catch (XMPPException e1) { JOptionPane.showMessageDialog(mainPanel, "Unable to register with Transport.", "Registration Error", JOptionPane.ERROR_MESSAGE); } dialog.dispose(); } }); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.dispose(); } }); dialog.setVisible(true); }
| 3,230,845
|
private void createFilesetForDirectory(File dir) { getFileSet(dir); }
|
private void createFilesetForDirectory(File dir) { getFileSet(dir); }
| 3,230,846
|
private void processInstrumentationClasspath() { if (includeClassesRegexs.size() == 0) { throw new BuildException("'includeClasses' is required when 'fromClasspath' is used"); } String[] sources = instrumentationClasspath.list(); for (int i = 0; i < sources.length; i++) { File fileOrDir = new File(sources[i]); if (fileOrDir.exists()) { if (fileOrDir.isDirectory()) { createFilesetForDirectory(fileOrDir); } else { addFileToFilesets(fileOrDir); } } } }
|
private void processInstrumentationClasspath() { if (includeClassesRegexs.size() == 0) { throw new BuildException("'includeClasses' is required when 'fromClasspath' is used"); } String[] sources = instrumentationClasspath.list(); for (int i = 0; i < sources.length; i++) { File fileOrDir = new File(sources[i]); if (fileOrDir.exists()) { if (fileOrDir.isDirectory()) { createFilesetForDirectory(fileOrDir); } else { addFileToFilesets(fileOrDir); } } } }
| 3,230,847
|
ViewerUIF(ViewerCtrl control, Registry registry, PixelsDimensions pxsDims, int defaultT, int defaultZ) { super(""); this.control = control; im = IconManager.getInstance(registry); windowWidth = DEFAULT_WINDOW_SIZE; windowHeight = DEFAULT_WINDOW_SIZE; active = false; int maxT = pxsDims.sizeT-1, maxZ = pxsDims.sizeZ-1; setJMenuBar(createMenuBar(maxZ, maxT)); initBars(registry, maxT, defaultT, maxZ, defaultZ); initSliders(maxT, defaultT, maxZ, defaultZ); initContainers(); buildGUI(); }
|
ViewerUIF(ViewerCtrl control, Registry registry, PixelsDimensions pxsDims, int defaultT, int defaultZ) { super(""); this.control = control; im = IconManager.getInstance(registry); windowWidth = DEFAULT_WINDOW_SIZE; windowHeight = DEFAULT_WINDOW_SIZE; imageDisplay = false; int maxT = pxsDims.sizeT-1, maxZ = pxsDims.sizeZ-1; setJMenuBar(createMenuBar(maxZ, maxT)); initBars(registry, maxT, defaultT, maxZ, defaultZ); initSliders(maxT, defaultT, maxZ, defaultZ); initContainers(); buildGUI(); }
| 3,230,848
|
private void buildGUI() { Container container = getContentPane(); container.add(toolBar, BorderLayout.NORTH); container.add(buildMain(), BorderLayout.WEST); container.add(scrollPane, BorderLayout.CENTER); container.add(bottomBar, BorderLayout.SOUTH); //Configure the display buttons in the TaskBar. //configureDisplayButtons(); }
|
private void buildGUI(){Container container = getContentPane();container.add(toolBar, BorderLayout.NORTH);container.add(buildMain(), BorderLayout.WEST);container.add(scrollPane, BorderLayout.CENTER);container.add(bottomBar, BorderLayout.SOUTH);//Configure the display buttons in the TaskBar.//configureDisplayButtons();}
| 3,230,849
|
void setImage(BufferedImage img) { if (!active) { int w = img.getWidth()+2*START, h = img.getHeight()+2*START; setSizePaintedComponents(new Dimension(w, h)); w += 2*START; h += 2*START; setWindowSize(w, h); } canvas.paintImage(img); active = true; }
|
void setImage(BufferedImage img) { if (!imageDisplay) { int w = img.getWidth()+2*START, h = img.getHeight()+2*START; setSizePaintedComponents(new Dimension(w, h)); w += 2*START; h += 2*START; setWindowSize(w, h); } canvas.paintImage(img); active = true; }
| 3,230,850
|
void setImage(BufferedImage img) { if (!active) { int w = img.getWidth()+2*START, h = img.getHeight()+2*START; setSizePaintedComponents(new Dimension(w, h)); w += 2*START; h += 2*START; setWindowSize(w, h); } canvas.paintImage(img); active = true; }
|
void setImage(BufferedImage img) { if (!active) { int w = img.getWidth()+2*START, h = img.getHeight()+2*START; setSizePaintedComponents(new Dimension(w, h)); w += 2*START; h += 2*START; setWindowSize(w, h); } canvas.paintImage(img); setImageDisplay(true); }
| 3,230,851
|
public ZoomPanel(ImageInspectorManager manager) { this.manager = manager; setDoubleBuffered(true); setBackground(Viewer.BACKGROUND_COLOR); magFactor = ImageInspectorManager.ZOOM_DEFAULT; isInit = true; }
|
public ZoomPanel(ImageInspectorManager manager) { this.manager = manager; setDoubleBuffered(true); setBackground(Viewer.BACKGROUND_COLOR); magFactor = ImageInspectorManager.ZOOM_DEFAULT; isInit = true; }
| 3,230,853
|
public void paint(Graphics g) { super.paintComponent(g); BufferedImage image = manager.getBufferedImage(); Graphics2D g2D = (Graphics2D) g; if (isInit) setLocation(); g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2D.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g2D.setColor(Color.black); AffineTransform at = new AffineTransform(); at.scale(magFactor, magFactor); BufferedImage bimg = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB); RescaleOp rop = new RescaleOp((float) magFactor, 0.0f, null); rop.filter(image, bimg); BufferedImageOp biop = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR); g2D.drawImage(bimg, biop, x, y); }
|
public void paint(Graphics g) { super.paintComponent(g); BufferedImage image = manager.getBufferedImage(); Graphics2D g2D = (Graphics2D) g; if (isInit) setLocation(); g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2D.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g2D.setColor(Color.black); AffineTransform at = new AffineTransform(); at.scale(magFactor, magFactor); BufferedImage bimg = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB); RescaleOp rop = new RescaleOp((float) magFactor, 0.0f, null); rop.filter(image, bimg); BufferedImageOp biop = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR); g2D.drawImage(bimg, biop, x, y); }
| 3,230,854
|
public void paint(Graphics g) { super.paintComponent(g); BufferedImage image = manager.getBufferedImage(); Graphics2D g2D = (Graphics2D) g; if (isInit) setLocation(); g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2D.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g2D.setColor(Color.black); AffineTransform at = new AffineTransform(); at.scale(magFactor, magFactor); BufferedImage bimg = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB); RescaleOp rop = new RescaleOp((float) magFactor, 0.0f, null); rop.filter(image, bimg); BufferedImageOp biop = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR); g2D.drawImage(bimg, biop, x, y); }
|
public void paint(Graphics g) { super.paintComponent(g); BufferedImage image = manager.getBufferedImage(); Graphics2D g2D = (Graphics2D) g; if (isInit) setLocation(); g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2D.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g2D.setColor(Color.black); AffineTransform at = new AffineTransform(); at.scale(magFactor, magFactor); BufferedImage bimg = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB); RescaleOp rop = new RescaleOp((float) magFactor, 0.0f, null); rop.filter(image, bimg); BufferedImageOp biop = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR); g2D.drawImage(bimg, biop, x, y); }
| 3,230,855
|
public void paint(Graphics g) { super.paintComponent(g); BufferedImage image = manager.getBufferedImage(); Graphics2D g2D = (Graphics2D) g; if (isInit) setLocation(); g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2D.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g2D.setColor(Color.black); AffineTransform at = new AffineTransform(); at.scale(magFactor, magFactor); BufferedImage bimg = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB); RescaleOp rop = new RescaleOp((float) magFactor, 0.0f, null); rop.filter(image, bimg); BufferedImageOp biop = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR); g2D.drawImage(bimg, biop, x, y); }
|
public void paint(Graphics g) { super.paintComponent(g); BufferedImage image = manager.getBufferedImage(); Graphics2D g2D = (Graphics2D) g; if (isInit) setLocation(); g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2D.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g2D.setColor(Color.black); AffineTransform at = new AffineTransform(); at.scale(magFactor, magFactor); BufferedImage bimg = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB); RescaleOp rop = new RescaleOp((float) magFactor, 0.0f, null); rop.filter(image, bimg); BufferedImageOp biop = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR); g2D.drawImage(bimg, biop, x, y); }
| 3,230,856
|
public void paintImage(double level, int x, int y) { magFactor = level; isInit = false; this.x = x; this.y = y; repaint(); }
|
public void paintImage(double level, int x, int y) { magFactor = level; isInit = false; this.x = x; this.y = y; repaint(); }
| 3,230,857
|
public void paintImage(double level, int x, int y) { magFactor = level; isInit = false; this.x = x; this.y = y; repaint(); }
|
public void paintImage(double level, int x, int y) { magFactor = level; isInit = false; this.x = x; this.y = y; repaint(); }
| 3,230,858
|
private void setLocation() { Rectangle d = getBounds(); x = (int) (d.width-manager.getImageWidth())/2; y = (int) (d.height-manager.getImageHeight())/2; if (x < 0) x = 0; if (y < 0) y = 0; }
|
private void setLocation() { Rectangle d = getBounds(); x = (int) (d.width-manager.getImageWidth())/2; y = (int) (d.height-manager.getImageHeight())/2; if (x < 0) x = 0; if (y < 0) y = 0; }
| 3,230,859
|
public IRubyObject backtrace() { IRubyObject rubyTrace = super.backtrace(); if (rubyTrace.isNil()) return rubyTrace; RubyArray array = (RubyArray) rubyTrace; StackTraceElement[] stackTrace = cause.getStackTrace(); for (int i=stackTrace.length-1; i>=0; i--) { StackTraceElement element = stackTrace[i]; String line = element.toString(); RubyString string = new RubyString(runtime, line); array.unshift(string); } return rubyTrace; }
|
public IRubyObject backtrace() { IRubyObject rubyTrace = super.backtrace(); if (rubyTrace.isNil()) return rubyTrace; RubyArray array = (RubyArray) rubyTrace; StackTraceElement[] stackTrace = cause.getStackTrace(); for (int i=stackTrace.length-1; i>=0; i--) { StackTraceElement element = stackTrace[i]; String line = element.toString(); RubyString string = runtime.newString(line); array.unshift(string); } return rubyTrace; }
| 3,230,860
|
private void notifyShutdownHooks() { while (!shutdownHooks.isEmpty()) { Runnable hook; synchronized (shutdownHooks) { hook = (Runnable) shutdownHooks.removeFirst(); } try { hook.run(); } catch (Throwable e) { log.warn("Error from kernel shutdown hook", e); } } }
|
private void notifyShutdownHooks() { while (!shutdownHooks.isEmpty()) { Runnable hook; synchronized (shutdownHooks) { hook = (Runnable) shutdownHooks.removeLast(); } try { hook.run(); } catch (Throwable e) { log.warn("Error from kernel shutdown hook", e); } } }
| 3,230,861
|
public Object build(BuildContext bc) throws BuildException { if (directive == null) throw new BuildException("Error instantiating Directive object for #" + desc.name); return directive.build(this, bc); }
|
public Object build(BuildContext bc) throws BuildException { Directive d; try { d = (Directive) desc.dirClass.newInstance(); } catch (Exception e) { throw new BuildException("Error instantiating Directive object for #" + desc.name); return directive.build(this, bc); }
| 3,230,862
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.