rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
setText("Jump to the symbol definition");
setText("Find definition");
public JumpToDefinitionAction(SchemeEditor editor) { setText("Jump to the symbol definition"); setToolTipText("Jump to the symbol definition"); mEditor = editor; }
try { js.setArguments(TypeUtil.toList(value));
if (value instanceof List) { js.setArguments((List) value);
public void submitTask(VariableStack stack) throws ExecutionException { try { JobSpecificationImpl js = new JobSpecificationImpl(); Task task = new TaskImpl(); NamedArguments named = ArgUtil.getNamedArguments(stack); Iterator i = named.getNames(); Object host = null; String provider = null; while (i.has...
catch (Exception e) {
else if (value instanceof VariableArguments) { js.setArguments(((VariableArguments) value).getAll()); } else {
public void submitTask(VariableStack stack) throws ExecutionException { try { JobSpecificationImpl js = new JobSpecificationImpl(); Task task = new TaskImpl(); NamedArguments named = ArgUtil.getNamedArguments(stack); Iterator i = named.getNames(); Object host = null; String provider = null; while (i.has...
this.readingFrame = FramedFeature.Template.readingFrame;
this.readingFrame = template.readingFrame;
public SimpleFramedFeature(Sequence sourceSeq, FeatureHolder parent, FramedFeature.Template template) throws IllegalAlphabetException { super(sourceSeq,parent,template); this.readingFrame = FramedFeature.Template.readingFrame; if (sourceSeq.getAlphabet() == RNATools.getRNA() && template.strand == NEGATIVE...
FramedFeature.Template.readingFrame = getReadingFrame();
ft.readingFrame = getReadingFrame();
protected void fillTemplate(FramedFeature.Template ft){ super.fillTemplate(ft); FramedFeature.Template.readingFrame = getReadingFrame(); }
if ( ftpFiles == null )
if ( ftpFiles == null || ftpFiles.length <= 0 )
public void fillInputData( InputData inputData ) throws TransferFailedException, ResourceDoesNotExistException { InputStream is; Resource resource = inputData.getResource(); try { String[] dirs = PathUtils.dirnames( resource.getName() ); for ( int i = 0; i...
ftp.changeWorkingDirectory( ".." );
if ( !ftp.changeWorkingDirectory( ".." ) ) { throw new TransferFailedException( "Error changing directory to .." ); }
public void fillInputData( InputData inputData ) throws TransferFailedException, ResourceDoesNotExistException { InputStream is; Resource resource = inputData.getResource(); try { String[] dirs = PathUtils.dirnames( resource.getName() ); for ( int i = 0; i...
inputData.setInputStream( urlConnection.getInputStream() );
InputStream is = urlConnection.getInputStream(); String contentEncoding = urlConnection.getHeaderField( "Content-Encoding" ); boolean isGZipped = contentEncoding == null ? false : "gzip".equalsIgnoreCase(contentEncoding); if (isGZipped) { is = new GZIPInputStream( is ); } inputData.setInputStream( is );
public void fillInputData( InputData inputData ) throws TransferFailedException, ResourceDoesNotExistException { Resource resource = inputData.getResource(); try { URL url = resolveResourceURL( resource ); URLConnection urlConnection = url.openConnection(); ...
fos.close(); fis.close();
if (fos != null) { fos.close(); } fis.close();
private void fixDAODriver(String daoClassName) throws Exception { String driverConfigPath = SystemGlobals.getValue(ConfigKeys.DATABASE_DRIVER_CONFIG); File f = new File(driverConfigPath); if (f.canWrite()) { // Fix the DAO class Properties p = new Properties(); FileInputStream fis = new FileInputStream...
fis.close();
private void fixEncoding() throws Exception { FileInputStream fis = null; OutputStream os = null; try { Properties p = new Properties(); File f = new File(SystemGlobals.getValue(ConfigKeys.DATABASE_DRIVER_CONFIG)); if (f.canWrite()) { fis = new FileInputStream(f); p.load(fis); p.setPr...
if (mSelectExpression) { int end = explorer.getSexpEnd(); if (selection.getLength() > 0) { end = selection.getOffset() + selection.getLength(); } mEditor.setSelection(start, end);
if (mSelectExpression) { mEditor.setSelection(start, selectionEnd);
public void run() { Region selection = mEditor.getSelection(); SexpExplorer explorer = mEditor.getExplorer(); if (explorer.backwardSexpression(selection.getOffset())) { int start = explorer.getSexpStart(); if (mSelectExpression) { int e...
setFault(e);
recordFault(e);
public void execute() { assertNotCompleted(); try { getRoot().deleteProvider(getName()); } catch (RuntimeException e) { setFault(e); } completed(); }
Map dbConfig = null;
public SequenceDBLite getDatabase(String dbName) throws RegistryException, BioException { Map dbConfig = null; String providerName = ""; dbConfig = (Map) getRegistryConfiguration().getConfiguration().get(dbName); if (dbConfig == null) { throw new RegistryExce...
dbConfig = (Map) getRegistryConfiguration().getConfiguration().get(dbName);
List dbConfigs = (List) getRegistryConfiguration().getConfiguration().get(dbName);
public SequenceDBLite getDatabase(String dbName) throws RegistryException, BioException { Map dbConfig = null; String providerName = ""; dbConfig = (Map) getRegistryConfiguration().getConfiguration().get(dbName); if (dbConfig == null) { throw new RegistryExce...
if (dbConfig == null) { throw new RegistryException("Couldn't find a configuration"
if (dbConfigs == null) { throw new RegistryException("Failed to find a configuration"
public SequenceDBLite getDatabase(String dbName) throws RegistryException, BioException { Map dbConfig = null; String providerName = ""; dbConfig = (Map) getRegistryConfiguration().getConfiguration().get(dbName); if (dbConfig == null) { throw new RegistryExce...
try {
for (Iterator ci = dbConfigs.iterator(); ci.hasNext();) { Map dbConfig = (Map) ci.next();
public SequenceDBLite getDatabase(String dbName) throws RegistryException, BioException { Map dbConfig = null; String providerName = ""; dbConfig = (Map) getRegistryConfiguration().getConfiguration().get(dbName); if (dbConfig == null) { throw new RegistryExce...
} catch (Exception e) { throw new RegistryException("File for configuration " + " cannot be found: " + e.toString());
SequenceDBLite db = null; try { db = getProvider(providerName).getSequenceDB(dbConfig); } catch (RegistryException re) { continue; } catch (Exception e) { throw new RegistryException("Failed to configure database " + dbName); } if (db != null) return db;
public SequenceDBLite getDatabase(String dbName) throws RegistryException, BioException { Map dbConfig = null; String providerName = ""; dbConfig = (Map) getRegistryConfiguration().getConfiguration().get(dbName); if (dbConfig == null) { throw new RegistryExce...
return getProvider(providerName).getSequenceDB(dbConfig);
throw new RegistryException("Failed to find a configuration" + " for database: " + dbName);
public SequenceDBLite getDatabase(String dbName) throws RegistryException, BioException { Map dbConfig = null; String providerName = ""; dbConfig = (Map) getRegistryConfiguration().getConfiguration().get(dbName); if (dbConfig == null) { throw new RegistryExce...
public static void build(JCompilationUnit unit, IHierarchy hierarchy) { new CaesarAsmBuilder().internalBuild(unit, hierarchy);
public static void build(JCompilationUnit unit, CaesarJAsmManager asmManager) { new CaesarAsmBuilder().internalBuild(unit, asmManager);
public static void build(JCompilationUnit unit, IHierarchy hierarchy) { new CaesarAsmBuilder().internalBuild(unit, hierarchy); }
private void internalBuild(JCompilationUnit unit, IHierarchy hierarchy) {
private void internalBuild(JCompilationUnit unit, CaesarJAsmManager asmManager) {
private void internalBuild(JCompilationUnit unit, IHierarchy hierarchy) { if (unit == null) return; setHierarchy(hierarchy); this.asmStack.push(hierarchy.getRoot()); VisitorSupport visitor = new VisitorSupport(this); unit.accept(visitor); this.asmStack.pop(); setHierarchy(null); }
setHierarchy(hierarchy); this.asmStack.push(hierarchy.getRoot());
this.asmManager = asmManager; this.asmStack.push(asmManager.getHierarchy().getRoot());
private void internalBuild(JCompilationUnit unit, IHierarchy hierarchy) { if (unit == null) return; setHierarchy(hierarchy); this.asmStack.push(hierarchy.getRoot()); VisitorSupport visitor = new VisitorSupport(this); unit.accept(visitor); this.asmStack.pop(); setHierarchy(null); }
setHierarchy(null);
private void internalBuild(JCompilationUnit unit, IHierarchy hierarchy) { if (unit == null) return; setHierarchy(hierarchy); this.asmStack.push(hierarchy.getRoot()); VisitorSupport visitor = new VisitorSupport(this); unit.accept(visitor); this.asmStack.pop(); setHierarchy(null); }
public static void postBuild(IHierarchy hierarchy) {
public static void postBuild(CaesarJAsmManager asmManager) { asmManager.deattach();
public static void postBuild(IHierarchy hierarchy) { }
public static void preBuild(IHierarchy hierarchy) {
public static void preBuild(CaesarJAsmManager asmManager) {
public static void preBuild(IHierarchy hierarchy) { String rootLabel = "<root>"; //$NON-NLS-1$ hierarchy.setRoot( new ProgramElement( rootLabel, IProgramElement.Kind.FILE_JAVA, new ArrayList())); hierarchy.setFileMap(new HashMap()); // TODO...
rootLabel,
rootLabel.replaceAll("/", "."),
public static void preBuild(IHierarchy hierarchy) { String rootLabel = "<root>"; //$NON-NLS-1$ hierarchy.setRoot( new ProgramElement( rootLabel, IProgramElement.Kind.FILE_JAVA, new ArrayList())); hierarchy.setFileMap(new HashMap()); // TODO...
asmManager.getRelationshipMap().clear();
public static void preBuild(IHierarchy hierarchy) { String rootLabel = "<root>"; //$NON-NLS-1$ hierarchy.setRoot( new ProgramElement( rootLabel, IProgramElement.Kind.FILE_JAVA, new ArrayList())); hierarchy.setFileMap(new HashMap()); // TODO...
public static void preWeave(IHierarchy hierarchy) {
public static void preWeave(CaesarJAsmManager asmManager) {
public static void preWeave(IHierarchy hierarchy) { }
file.getName(),
file.getName().replaceAll("/", "."),
public boolean visit(JCompilationUnit self) { TokenReference ref = self.getTokenReference(); File file = new File(new String(ref.getFile())); // create node for file CaesarProgramElement node = new CaesarProgramElement( file.getName(), CaesarProgramElement.Kind.FILE_JAVA, 0, makeLocation(re...
fileListNode = findChildByName(getHierarchy().getRoot().getChildren(), packageName);
fileListNode = findChildByName(asmManager.getHierarchy().getRoot().getChildren(), packageName);
public boolean visit(JCompilationUnit self) { TokenReference ref = self.getTokenReference(); File file = new File(new String(ref.getFile())); // create node for file CaesarProgramElement node = new CaesarProgramElement( file.getName(), CaesarProgramElement.Kind.FILE_JAVA, 0, makeLocation(re...
packageName,
packageName.replaceAll("/", "."),
public boolean visit(JCompilationUnit self) { TokenReference ref = self.getTokenReference(); File file = new File(new String(ref.getFile())); // create node for file CaesarProgramElement node = new CaesarProgramElement( file.getName(), CaesarProgramElement.Kind.FILE_JAVA, 0, makeLocation(re...
getHierarchy().getRoot().addChild(fileListNode);
asmManager.getHierarchy().getRoot().addChild(fileListNode);
public boolean visit(JCompilationUnit self) { TokenReference ref = self.getTokenReference(); File file = new File(new String(ref.getFile())); // create node for file CaesarProgramElement node = new CaesarProgramElement( file.getName(), CaesarProgramElement.Kind.FILE_JAVA, 0, makeLocation(re...
Iterator it = getHierarchy().getRoot().getChildren().iterator();
Iterator it = asmManager.getHierarchy().getRoot().getChildren().iterator();
public boolean visit(JCompilationUnit self) { TokenReference ref = self.getTokenReference(); File file = new File(new String(ref.getFile())); // create node for file CaesarProgramElement node = new CaesarProgramElement( file.getName(), CaesarProgramElement.Kind.FILE_JAVA, 0, makeLocation(re...
((ProgramElement) getHierarchy().getRoot()).removeChild(child);
((ProgramElement) asmManager.getHierarchy().getRoot()).removeChild(child);
public boolean visit(JCompilationUnit self) { TokenReference ref = self.getTokenReference(); File file = new File(new String(ref.getFile())); // create node for file CaesarProgramElement node = new CaesarProgramElement( file.getName(), CaesarProgramElement.Kind.FILE_JAVA, 0, makeLocation(re...
pkgName,
pkgName.replaceAll("/", "."),
public boolean visit(JCompilationUnit self) { TokenReference ref = self.getTokenReference(); File file = new File(new String(ref.getFile())); // create node for file CaesarProgramElement node = new CaesarProgramElement( file.getName(), CaesarProgramElement.Kind.FILE_JAVA, 0, makeLocation(re...
currentPi.getName(),
currentPi.getName().replaceAll("/", "."),
public boolean visit(JCompilationUnit self) { TokenReference ref = self.getTokenReference(); File file = new File(new String(ref.getFile())); // create node for file CaesarProgramElement node = new CaesarProgramElement( file.getName(), CaesarProgramElement.Kind.FILE_JAVA, 0, makeLocation(re...
currentCi.getQualifiedName(),
currentCi.getQualifiedName().replaceAll("/", "."),
public boolean visit(JCompilationUnit self) { TokenReference ref = self.getTokenReference(); File file = new File(new String(ref.getFile())); // create node for file CaesarProgramElement node = new CaesarProgramElement( file.getName(), CaesarProgramElement.Kind.FILE_JAVA, 0, makeLocation(re...
getHierarchy().addToFileMap(file.getCanonicalPath(), node);
asmManager.getHierarchy().addToFileMap(file.getCanonicalPath(), node);
public boolean visit(JCompilationUnit self) { TokenReference ref = self.getTokenReference(); File file = new File(new String(ref.getFile())); // create node for file CaesarProgramElement node = new CaesarProgramElement( file.getName(), CaesarProgramElement.Kind.FILE_JAVA, 0, makeLocation(re...
return this.dateCreated.compareTo(other.getDateCreated());
int result = this.dateCreated.compareTo(other.getDateCreated()); if (result == 0) return this.id.compareTo(other.id); else return result;
public int compareTo(Object arg0) { Mail other = (Mail)arg0; return this.dateCreated.compareTo(other.getDateCreated()); }
for (int i = 1; i < section.size(); i++) { sectionKey = ((String[])section.get(i))[0]; if (sectionKey.equals(ORGANELLE_TAG)) { rlistener.addSequenceProperty(Terms.getOrganelleTerm(), ((String[])section.get(i))[1].trim()); break; } }
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener, Namespace ns) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; //bool...
int realSymsPerGap = src.graphicsToSequence(40.0);
double ten = Math.log(10); double minGap = Math.log(max) / ten * 7.0; int realSymsPerGap = src.graphicsToSequence(minGap + 5.0);
public void paint( Graphics2D g, SequenceRenderContext src, RangeLocation pos ) { int min = pos.getMin(); int max = pos.getMax(); double minX = src.sequenceToGraphics(min); double maxX = src.sequenceToGraphics(max); double scale = src.getScale(); double halfScale = scale * 0.5; Line2D line...
double ten = Math.log(10);
public void paint( Graphics2D g, SequenceRenderContext src, RangeLocation pos ) { int min = pos.getMin(); int max = pos.getMax(); double minX = src.sequenceToGraphics(min); double maxX = src.sequenceToGraphics(max); double scale = src.getScale(); double halfScale = scale * 0.5; Line2D line...
public List selectAllByTopicByLimit(int topicId, int startFrom, int count) throws Exception
public List selectAllByTopicByLimit(int topicId, int startFrom, int count)
public List selectAllByTopicByLimit(int topicId, int startFrom, int count) throws Exception { List l = new ArrayList(); String top = SystemGlobals.getSql("GenericModel.selectByLimit"); String sql = top + " " + count + " " + SystemGlobals.getSql("PostModel.selectAllByTopicByLimit1") + " " + top + " " + startF...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); Logger.getLogger(this.getClass()).debug(sql); p.setInt(1, topicId); p.setInt(2, topicId);
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); Logger.getLogger(this.getClass()).debug(sql); p.setInt(1, topicId); p.setInt(2, topicId);
public List selectAllByTopicByLimit(int topicId, int startFrom, int count) throws Exception { List l = new ArrayList(); String top = SystemGlobals.getSql("GenericModel.selectByLimit"); String sql = top + " " + count + " " + SystemGlobals.getSql("PostModel.selectAllByTopicByLimit1") + " " + top + " " + startF...
ResultSet rs = p.executeQuery();
rs = p.executeQuery();
public List selectAllByTopicByLimit(int topicId, int startFrom, int count) throws Exception { List l = new ArrayList(); String top = SystemGlobals.getSql("GenericModel.selectByLimit"); String sql = top + " " + count + " " + SystemGlobals.getSql("PostModel.selectAllByTopicByLimit1") + " " + top + " " + startF...
while (rs.next()) { l.add(this.makePost(rs)); } rs.close(); p.close(); return l; }
while (rs.next()) { l.add(this.makePost(rs)); } return l; } catch (SQLException e) { String es = "Erorr selectAllByTopicByLimit()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } }
public List selectAllByTopicByLimit(int topicId, int startFrom, int count) throws Exception { List l = new ArrayList(); String top = SystemGlobals.getSql("GenericModel.selectByLimit"); String sql = top + " " + count + " " + SystemGlobals.getSql("PostModel.selectAllByTopicByLimit1") + " " + top + " " + startF...
public Post selectById(int postId) throws Exception
public Post selectById(int postId)
public Post selectById(int postId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PostModel.selectById"), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); p.setInt(1, postId); ResultSet rs = p.executeQuery(); Post post = ne...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PostModel.selectById"), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); p.setInt(1, postId); ResultSet rs = p.executeQuery(); Post post = new Post(); if (rs.next()) { post = this.makePost(rs); } rs.cl...
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PostModel.selectById"), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); p.setInt(1, postId); rs = p.executeQuery(); Post post = new Post(); if (rs.next()) { post = this...
public Post selectById(int postId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PostModel.selectById"), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); p.setInt(1, postId); ResultSet rs = p.executeQuery(); Post post = ne...
code.closeScope();
public void genCode(GenerationContext context) { CodeSequence code = context.getCodeSequence(); setLineNumber(code); CodeLabel startLabel = new CodeLabel(); CodeLabel condLabel = new CodeLabel(); code.pushContext(this); if (init != null) { init.genCode(context); // INIT } code.plantJ...
for (int i = 0; accessors != null && i < accessors.size(); i++) { changeTarget(((AccessorContainer)accessors.elementAt(i)), next);
if(accessors != null){ Vector localCopy = new Vector(accessors); Enumeration e = localCopy.elements(); while(e.hasMoreElements()){ changeTarget(((AccessorContainer)e.nextElement()), next); }
public void destroy() { if (accessors != null && getNext() == null) { insn = new NoArgInstruction(opc_nop); } else { if (prev != null) { prev.next = next; } if (next != null) { next.prev = prev; } for (int i = 0; accessors != null && i < accessors.size(); i++) { changeTarget(((Acce...
setPreferenceStore(SchemeScriptPlugin.getDefault().getPreferenceStore());
IPropertyChangeListener listener = new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { handlePreferenceStoreChanged(event); } }; SchemeScriptPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(listener);
public SchemeEditor() { super(); SchemeTextTools textTools = SchemeScriptPlugin.getDefault().getTextTools(); setSourceViewerConfiguration(new SchemeConfiguration(textTools, this)); setPreferenceStore(SchemeScriptPlugin.getDefault().getPreferenceStore()); }
IPreferenceStore store = getPreferenceStore(); Color color = new Color(null, PreferenceConverter.getColor(store, ColorPreferences.BACKGROUND_COLOR)); getSourceViewer().getTextWidget().setBackground(color);
public final void createPartControl(final Composite parent) { super.createPartControl(parent); mPaintManager = new PaintManager(getSourceViewer()); IPreferenceStore store = getPreferenceStore(); Color color = new Color(null, PreferenceConverter.getColor(store, ColorPreferences.BACKGROUND...
setupBackgroundColor();
public final void createPartControl(final Composite parent) { super.createPartControl(parent); mPaintManager = new PaintManager(getSourceViewer()); IPreferenceStore store = getPreferenceStore(); Color color = new Color(null, PreferenceConverter.getColor(store, ColorPreferences.BACKGROUND...
if (property.equals(ColorPreferences.BACKGROUND_COLOR)) { getSourceViewer().getTextWidget().setBackground(new Color(null, (RGB) event.getNewValue())); } else if (property.equals(SchemePreferences.TAB_WIDTH)) {
if (property.equals(SchemePreferences.TAB_WIDTH)) {
protected void handlePreferenceStoreChanged(PropertyChangeEvent event) { String property = event.getProperty(); if (property.equals(ColorPreferences.BACKGROUND_COLOR)) { getSourceViewer().getTextWidget().setBackground(new Color(null, (RGB) event.getNewValue())); } else if (pro...
IPreferenceStore store = getPreferenceStore();
IPreferenceStore store = SchemeScriptPlugin.getDefault().getPreferenceStore();
protected void handlePreferenceStoreChanged(PropertyChangeEvent event) { String property = event.getProperty(); if (property.equals(ColorPreferences.BACKGROUND_COLOR)) { getSourceViewer().getTextWidget().setBackground(new Color(null, (RGB) event.getNewValue())); } else if (pro...
setupBackgroundColor();
protected void handlePreferenceStoreChanged(PropertyChangeEvent event) { String property = event.getProperty(); if (property.equals(ColorPreferences.BACKGROUND_COLOR)) { getSourceViewer().getTextWidget().setBackground(new Color(null, (RGB) event.getNewValue())); } else if (pro...
IPreferenceStore store = getPreferenceStore();
IPreferenceStore store = SchemeScriptPlugin.getDefault().getPreferenceStore();
private void startParenthesisHighlighting() { if (mParenPainter == null) { ISourceViewer sourceViewer = getSourceViewer(); IPreferenceStore store = getPreferenceStore(); mParenPainter = new SchemeParenthesisPainter(sourceViewer, this); mParenPainter.setHighlightSty...
testConnection = new HJBConnection(aConnection);
testConnection = new HJBConnection(aConnection, 0);
protected void updateConnectionMock(Session aSession) { mockConnection = connectionBuilder.createMockConnection(aSession); mockConnection.expects(atLeastOnce()).method("setExceptionListener"); Connection aConnection = (Connection) mockConnection.proxy(); testConnection = new HJBConnectio...
if (!(b == null || b == this) && b.active && intersect(b.boundingLine)) { synchronized (this) { bulletState = BULLET_STATE_HIT_BULLET; active = false; b.active = false; hitBullet = true; hitBulletTime = 0; frame = 0; x = lastX; y = lastY; }
if (!(b == null || b == this) && b.isActive && intersect(b.boundingLine)) { bulletState = BULLET_STATE_HIT_BULLET; isActive = false; b.isActive = false; hasHitBullet = true; hitBulletTime = 0; frame = 0; x = lastX; y = lastY;
public void checkBulletCollision() { for (BulletPeer b : battle.getBullets()) { if (!(b == null || b == this) && b.active && intersect(b.boundingLine)) { synchronized (this) { bulletState = BULLET_STATE_HIT_BULLET; active = false; b.active = false; hitBullet = true; hitBulletTime = 0; fra...
new HitByBulletEvent(robocode.util.Utils.normalRelativeAngle(heading + PI - r.getHeading()),
new HitByBulletEvent(robocode.util.Utils.normalRelativeAngle(heading + Math.PI - r.getHeading()),
public void checkRobotCollision() { RobotPeer r; Vector<RobotPeer> robots = battle.getRobots(); for (int i = 0; i < robots.size(); i++) { r = robots.elementAt(i); if (!(r == null || r == owner || r.isDead()) && r.getBoundingBox().intersectsLine(boundingLine)) { double damage = Rules.getBulletDamage(power); ...
owner.getEventManager().add(new BulletHitEvent(r.getName(), r.getEnergy(), bullet));
if (dist > 0) { double mult = 10 / dist;
public void checkRobotCollision() { RobotPeer r; Vector<RobotPeer> robots = battle.getRobots(); for (int i = 0; i < robots.size(); i++) { r = robots.elementAt(i); if (!(r == null || r == owner || r.isDead()) && r.getBoundingBox().intersectsLine(boundingLine)) { double damage = Rules.getBulletDamage(power); ...
synchronized (this) { bulletState = BULLET_STATE_HIT_VICTIM; active = false; hitVictim = true; hitVictimTime = 0; frame = 0; victim = r; deltaX = lastX - r.getX(); deltaY = lastY - r.getY(); double dist = hypot(deltaX, deltaY); if (dist > 0) { double mult = 10 / dist; deltaX *= mult; deltaY *= mult; } setX(r.getX() +...
deltaX *= mult; deltaY *= mult;
public void checkRobotCollision() { RobotPeer r; Vector<RobotPeer> robots = battle.getRobots(); for (int i = 0; i < robots.size(); i++) { r = robots.elementAt(i); if (!(r == null || r == owner || r.isDead()) && r.getBoundingBox().intersectsLine(boundingLine)) { double damage = Rules.getBulletDamage(power); ...
setX(r.getX() + deltaX); setY(r.getY() + deltaY);
public void checkRobotCollision() { RobotPeer r; Vector<RobotPeer> robots = battle.getRobots(); for (int i = 0; i < robots.size(); i++) { r = robots.elementAt(i); if (!(r == null || r == owner || r.isDead()) && r.getBoundingBox().intersectsLine(boundingLine)) { double damage = Rules.getBulletDamage(power); ...
synchronized (this) { bulletState = BULLET_STATE_HIT_WALL; active = false; }
bulletState = BULLET_STATE_HIT_WALL;
public void checkWallCollision() { if ((x - RADIUS <= 0) || (y - RADIUS <= 0) || (x + RADIUS >= battleField.getWidth()) || (y + RADIUS >= battleField.getHeight())) { synchronized (this) { bulletState = BULLET_STATE_HIT_WALL; active = false; } owner.getEventManager().add(new BulletMissedEvent(bullet)); ...
isActive = false;
public void checkWallCollision() { if ((x - RADIUS <= 0) || (y - RADIUS <= 0) || (x + RADIUS >= battleField.getWidth()) || (y + RADIUS >= battleField.getHeight())) { synchronized (this) { bulletState = BULLET_STATE_HIT_WALL; active = false; } owner.getEventManager().add(new BulletMissedEvent(bullet)); ...
return oldBulletState;
return lastBulletState;
public int getBulletState() { return oldBulletState; }
oldBulletState = bulletState;
lastBulletState = bulletState;
protected synchronized void updateBulletState() { oldBulletState = bulletState; if (bulletState == BULLET_STATE_SHOT) { bulletState = BULLET_STATE_MOVING; } else if (bulletState == BULLET_STATE_EXPLODED || bulletState == BULLET_STATE_HIT_BULLET || bulletState == BULLET_STATE_HIT_VICTIM || bulletState == BULLET...
public List getMostRatedUserByPeriod(int start, Date firstPeriod, Date lastPeriod, String orderField) throws Exception;
public List getMostRatedUserByPeriod(int start, Date firstPeriod, Date lastPeriod, String orderField) ;
public List getMostRatedUserByPeriod(int start, Date firstPeriod, Date lastPeriod, String orderField) throws Exception;
public KarmaStatus getUserKarma(int userId) throws Exception;
public KarmaStatus getUserKarma(int userId) ;
public KarmaStatus getUserKarma(int userId) throws Exception;
public void update(Karma karma) throws Exception;
public void update(Karma karma) ;
public void update(Karma karma) throws Exception;
try
int ret = -1; if ( permissions != null )
private int getDirectoryMode( RepositoryPermissions permissions ) { try { return Integer.valueOf( permissions.getDirectoryMode(), 8 ).intValue(); } catch ( NumberFormatException e ) { // TODO: warning level fireTransferDebug( "the file mode must...
return Integer.valueOf( permissions.getDirectoryMode(), 8 ).intValue();
try { ret = Integer.valueOf( permissions.getDirectoryMode(), 8 ).intValue(); } catch ( NumberFormatException e ) { fireTransferDebug( "the file mode must be a numerical mode for SFTP" ); ret = -1; }
private int getDirectoryMode( RepositoryPermissions permissions ) { try { return Integer.valueOf( permissions.getDirectoryMode(), 8 ).intValue(); } catch ( NumberFormatException e ) { // TODO: warning level fireTransferDebug( "the file mode must...
catch ( NumberFormatException e ) { fireTransferDebug( "the file mode must be a numerical mode for SFTP" ); return -1; }
return ret;
private int getDirectoryMode( RepositoryPermissions permissions ) { try { return Integer.valueOf( permissions.getDirectoryMode(), 8 ).intValue(); } catch ( NumberFormatException e ) { // TODO: warning level fireTransferDebug( "the file mode must...
public int addNew(Banner banner) throws Exception
public int addNew(Banner banner)
public int addNew(Banner banner) throws Exception { PreparedStatement p = this.getStatementForAutoKeys("BannerDAO.addNew"); setBannerParam(p, banner); int id = this.executeAutoKeysQuery(p); p.close(); banner.setId(id); return id; }
PreparedStatement p = this.getStatementForAutoKeys("BannerDAO.addNew"); setBannerParam(p, banner); int id = this.executeAutoKeysQuery(p); p.close();
PreparedStatement p=null; try { p = this.getStatementForAutoKeys("BannerDAO.addNew"); setBannerParam(p, banner); int id = this.executeAutoKeysQuery(p);
public int addNew(Banner banner) throws Exception { PreparedStatement p = this.getStatementForAutoKeys("BannerDAO.addNew"); setBannerParam(p, banner); int id = this.executeAutoKeysQuery(p); p.close(); banner.setId(id); return id; }
banner.setId(id); return id; }
banner.setId(id); return id; } catch (SQLException e) { String es = "Erorr addNew()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(p); } }
public int addNew(Banner banner) throws Exception { PreparedStatement p = this.getStatementForAutoKeys("BannerDAO.addNew"); setBannerParam(p, banner); int id = this.executeAutoKeysQuery(p); p.close(); banner.setId(id); return id; }
public boolean canDelete(int bannerId) throws Exception
public boolean canDelete(int bannerId)
public boolean canDelete(int bannerId) throws Exception { boolean result = true; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.canDelete")); p.setInt(1, bannerId); ResultSet rs = p.executeQuery(); if (!rs.next() || rs.getInt("total") < 1) { result ...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.canDelete")); p.setInt(1, bannerId);
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.canDelete")); p.setInt(1, bannerId);
public boolean canDelete(int bannerId) throws Exception { boolean result = true; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.canDelete")); p.setInt(1, bannerId); ResultSet rs = p.executeQuery(); if (!rs.next() || rs.getInt("total") < 1) { result ...
ResultSet rs = p.executeQuery(); if (!rs.next() || rs.getInt("total") < 1) { result = false; }
rs = p.executeQuery(); if (!rs.next() || rs.getInt("total") < 1) { result = false; }
public boolean canDelete(int bannerId) throws Exception { boolean result = true; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.canDelete")); p.setInt(1, bannerId); ResultSet rs = p.executeQuery(); if (!rs.next() || rs.getInt("total") < 1) { result ...
rs.close(); p.close(); return result; }
return result; } catch (SQLException e) { String es = "Erorr addAttachment()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } }
public boolean canDelete(int bannerId) throws Exception { boolean result = true; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.canDelete")); p.setInt(1, bannerId); ResultSet rs = p.executeQuery(); if (!rs.next() || rs.getInt("total") < 1) { result ...
public void delete(int bannerId) throws Exception
public void delete(int bannerId)
public void delete(int bannerId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.delete")); p.setInt(1, bannerId); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.delete")); p.setInt(1, bannerId); p.executeUpdate(); p.close();
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.delete")); p.setInt(1, bannerId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr delete()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(p); }
public void delete(int bannerId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.delete")); p.setInt(1, bannerId); p.executeUpdate(); p.close(); }
protected Banner getBanner(ResultSet rs) throws Exception
protected Banner getBanner(ResultSet rs) throws SQLException
protected Banner getBanner(ResultSet rs) throws Exception { Banner b = new Banner(); b.setId(rs.getInt("banner_id")); b.setName(rs.getString("banner_name")); b.setPlacement(rs.getInt("banner_placement")); b.setDescription(rs.getString("banner_description")); b.setClicks(rs.getInt("banner_clicks")); b.setViews(r...
public List selectActiveBannerByPlacement(int placement) throws Exception
public List selectActiveBannerByPlacement(int placement)
public List selectActiveBannerByPlacement(int placement) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("BannerDAO.selectActiveBannerByPlacement")); p.setInt(1, placement); List l = new ArrayList(); ResultSet rs = p.executeQuery(); while (...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("BannerDAO.selectActiveBannerByPlacement")); p.setInt(1, placement);
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("BannerDAO.selectActiveBannerByPlacement")); p.setInt(1, placement);
public List selectActiveBannerByPlacement(int placement) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("BannerDAO.selectActiveBannerByPlacement")); p.setInt(1, placement); List l = new ArrayList(); ResultSet rs = p.executeQuery(); while (...
ResultSet rs = p.executeQuery(); while (rs.next()) { l.add(this.getBanner(rs)); }
rs = p.executeQuery(); while (rs.next()) { l.add(this.getBanner(rs)); }
public List selectActiveBannerByPlacement(int placement) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("BannerDAO.selectActiveBannerByPlacement")); p.setInt(1, placement); List l = new ArrayList(); ResultSet rs = p.executeQuery(); while (...
rs.close(); p.close(); return l; }
return l; } catch (SQLException e) { String es = "Erorr selectActiveBannerByPlacement()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } }
public List selectActiveBannerByPlacement(int placement) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("BannerDAO.selectActiveBannerByPlacement")); p.setInt(1, placement); List l = new ArrayList(); ResultSet rs = p.executeQuery(); while (...
public List selectAll() throws Exception
public List selectAll()
public List selectAll() throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.selectAll")); List l = new ArrayList(); ResultSet rs = p.executeQuery(); while (rs.next()) { l.add(this.getBanner(rs)); } rs.close(); p.close(); return l; }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.selectAll")); List l = new ArrayList();
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.selectAll")); List l = new ArrayList();
public List selectAll() throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.selectAll")); List l = new ArrayList(); ResultSet rs = p.executeQuery(); while (rs.next()) { l.add(this.getBanner(rs)); } rs.close(); p.close(); return l; }
ResultSet rs = p.executeQuery(); while (rs.next()) { l.add(this.getBanner(rs)); }
rs = p.executeQuery(); while (rs.next()) { l.add(this.getBanner(rs)); }
public List selectAll() throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.selectAll")); List l = new ArrayList(); ResultSet rs = p.executeQuery(); while (rs.next()) { l.add(this.getBanner(rs)); } rs.close(); p.close(); return l; }
rs.close(); p.close(); return l; }
return l; } catch (SQLException e) { String es = "Erorr selectAll()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } }
public List selectAll() throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.selectAll")); List l = new ArrayList(); ResultSet rs = p.executeQuery(); while (rs.next()) { l.add(this.getBanner(rs)); } rs.close(); p.close(); return l; }
public Banner selectById(int bannerId) throws Exception
public Banner selectById(int bannerId)
public Banner selectById(int bannerId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.selectById")); p.setInt(1, bannerId); ResultSet rs = p.executeQuery(); Banner b = new Banner(); if (rs.next()) { b = this.getBanner(rs); } rs....
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.selectById")); p.setInt(1, bannerId);
PreparedStatement p=null; ResultSet rs=null; Banner b = null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.selectById")); p.setInt(1, bannerId);
public Banner selectById(int bannerId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.selectById")); p.setInt(1, bannerId); ResultSet rs = p.executeQuery(); Banner b = new Banner(); if (rs.next()) { b = this.getBanner(rs); } rs....
ResultSet rs = p.executeQuery();
rs = p.executeQuery();
public Banner selectById(int bannerId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.selectById")); p.setInt(1, bannerId); ResultSet rs = p.executeQuery(); Banner b = new Banner(); if (rs.next()) { b = this.getBanner(rs); } rs....
Banner b = new Banner(); if (rs.next()) { b = this.getBanner(rs); }
b = new Banner(); if (rs.next()) { b = this.getBanner(rs); } } catch (SQLException e) { String es = "Erorr selectById()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); }
public Banner selectById(int bannerId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.selectById")); p.setInt(1, bannerId); ResultSet rs = p.executeQuery(); Banner b = new Banner(); if (rs.next()) { b = this.getBanner(rs); } rs....
rs.close(); p.close(); return b;
return b;
public Banner selectById(int bannerId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.selectById")); p.setInt(1, bannerId); ResultSet rs = p.executeQuery(); Banner b = new Banner(); if (rs.next()) { b = this.getBanner(rs); } rs....
protected void setBannerParam(PreparedStatement p, Banner b) throws Exception
protected void setBannerParam(PreparedStatement p, Banner b) throws SQLException
protected void setBannerParam(PreparedStatement p, Banner b) throws Exception { p.setString(1, b.getName()); p.setInt(2, b.getPlacement()); p.setString(3, b.getDescription()); p.setInt(4, b.getClicks()); p.setInt(5, b.getViews()); p.setString(6, b.getUrl()); p.setInt(7, b.getWeight()); p.setInt(8, b.isActive()...
public void update(Banner banner) throws Exception
public void update(Banner banner)
public void update(Banner banner) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.update")); setBannerParam(p, banner); p.setInt(13, banner.getId()); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.update")); setBannerParam(p, banner); p.setInt(13, banner.getId()); p.executeUpdate(); p.close();
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.update")); setBannerParam(p, banner); p.setInt(13, banner.getId()); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr update()"; log.error(es, e); throw new RuntimeException(es, e);...
public void update(Banner banner) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("BannerDAO.update")); setBannerParam(p, banner); p.setInt(13, banner.getId()); p.executeUpdate(); p.close(); }
if (value != null) { PreparedStatement insert_new; if (seqDB.isSPASupported()) { insert_new = conn.prepareStatement("insert into seqfeature_qualifier_value " + " (seqfeature_id, term_id, rank, value) " + "values (?, intern_ontology_term( ? ), ?, ?)"); if (value instanceof Collection) { int cnt = 0; for (Iterator ...
if (value != null) { PreparedStatement insert_new; if (seqDB.isSPASupported()) { insert_new = conn.prepareStatement("insert into seqfeature_qualifier_value " + " (seqfeature_id, term_id, rank, value) " + "values (?, intern_ontology_term( ? ), ?, ?)"); if (value instanceof Collection) { int cnt = 0; for (Iterator ...
void persistProperty(Connection conn, int feature_id, Object key, Object value, boolean removeFirst) throws SQLException { String keyString = key.toString(); if (removeFirst) { int id = seqDB.intern_ontology_term(conn, keyString); PreparedStatement remove_old_value = conn.prepareStatem...
insert_new.setInt(3, ++cnt); insert_new.setString(4, i.next().toString());
insert_new.setInt(3, 1); insert_new.setString(4, value.toString());
void persistProperty(Connection conn, int feature_id, Object key, Object value, boolean removeFirst) throws SQLException { String keyString = key.toString(); if (removeFirst) { int id = seqDB.intern_ontology_term(conn, keyString); PreparedStatement remove_old_value = conn.prepareStatem...