rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
if (authors==null) authors = consortium;
if (authors==null) authors = consortium + " (consortium)";
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener, Namespace ns) throws IllegalSymbolException, IOException, ParseException { boolean hasAnotherSequence = true; //boolean hasInternalWhite...
Agregator dotAgre = new Agregator(
MultiTagger dotMultiTag = new MultiTagger(
public ParserListener getParserListener(TagValueListener listener) { ChangeTable.Changer trailingDotStripper = new ChangeTable.Changer() { public Object change(Object value) { String val = (String) value; if(val.endsWith(".")) { return val.substring(0, val.length() - 1); } else {...
new Agregator.Observer() {
new BoundaryFinder() {
public ParserListener getParserListener(TagValueListener listener) { ChangeTable.Changer trailingDotStripper = new ChangeTable.Changer() { public Object change(Object value) { String val = (String) value; if(val.endsWith(".")) { return val.substring(0, val.length() - 1); } else {...
Agregator commentAgre = new Agregator(
MultiTagger commentMultiTag = new MultiTagger(
public ParserListener getParserListener(TagValueListener listener) { ChangeTable.Changer trailingDotStripper = new ChangeTable.Changer() { public Object change(Object value) { String val = (String) value; if(val.endsWith(".")) { return val.substring(0, val.length() - 1); } else {...
tagDelegator.setListener("AN", dotAgre); tagDelegator.setListener("CA", dotAgre); tagDelegator.setListener("CC", commentAgre);
tagDelegator.setListener("AN", dotMultiTag); tagDelegator.setListener("CA", dotMultiTag); tagDelegator.setListener("CC", commentMultiTag);
public ParserListener getParserListener(TagValueListener listener) { ChangeTable.Changer trailingDotStripper = new ChangeTable.Changer() { public Object change(Object value) { String val = (String) value; if(val.endsWith(".")) { return val.substring(0, val.length() - 1); } else {...
public static LastPostInfo getLastPostInfo(Forum forum) throws Exception
public static LastPostInfo getLastPostInfo(Forum forum)
public static LastPostInfo getLastPostInfo(Forum forum) throws Exception { LastPostInfo lpi = forum.getLastPostInfo(); if (lpi == null || !forum.getLastPostInfo().hasInfo()) { lpi = DataAccessDriver.getInstance().newForumDAO().getLastPostInfo(forum.getId()); forum.setLastPostInfo(lpi); } return lpi; }
public static String getListAllowedForums() throws Exception
public static String getListAllowedForums()
public static String getListAllowedForums() throws Exception { int n = 0; StringBuffer buf = new StringBuffer(); List allCategories = ForumRepository.getAllCategories(); for (Iterator iter = allCategories.iterator(); iter.hasNext(); ) { Collection forums = ((Category)iter.next()).getForums(); for (Itera...
public static int getTotalMessages() throws Exception
public static int getTotalMessages()
public static int getTotalMessages() throws Exception { return getTotalMessages(false); }
private void loadCategories(CategoryDAO cm) throws Exception
private void loadCategories(CategoryDAO cm)
private void loadCategories(CategoryDAO cm) throws Exception { List categories = cm.selectAll(); Set categoriesSet = new TreeSet(new CategoryOrderComparator()); for (Iterator iter = categories.iterator(); iter.hasNext(); ) { Category c = (Category)iter.next(); cache.add(FQN, Integer.toString(c.getId()), c)...
private void loadForums(ForumDAO fm) throws Exception
private void loadForums(ForumDAO fm)
private void loadForums(ForumDAO fm) throws Exception { List l = fm.selectAll(); Map m = (Map)cache.get(FQN, RELATION); if (m == null) { m = new HashMap(); } int lastId = 0; Category c = null; String catId = null; for (Iterator iter = l.iterator(); iter.hasNext(); ) { Forum f = (Forum)iter.next(); ...
private void loadMostUsersEverOnline(ConfigDAO cm) throws Exception
private void loadMostUsersEverOnline(ConfigDAO cm)
private void loadMostUsersEverOnline(ConfigDAO cm) throws Exception { Config config = cm.selectByName(ConfigKeys.MOST_USERS_EVER_ONLINE); MostUsersEverOnline mostUsersEverOnline = new MostUsersEverOnline(); if (config != null) { mostUsersEverOnline.setTotal(Integer.parseInt(config.getValue())); // We're as...
private void loadUsersInfo() throws Exception
private void loadUsersInfo()
private void loadUsersInfo() throws Exception { UserDAO udao = DataAccessDriver.getInstance().newUserDAO(); cache.add(FQN, LAST_USER, udao.getLastUserInfo()); cache.add(FQN, TOTAL_USERS, new Integer(udao.getTotalUsers())); }
public static synchronized void reloadForum(int forumId) throws Exception
public static synchronized void reloadForum(int forumId)
public static synchronized void reloadForum(int forumId) throws Exception { Forum f = DataAccessDriver.getInstance().newForumDAO().selectById(forumId); if (((Map)cache.get(FQN, RELATION)).containsKey(Integer.toString(forumId))) { String id = Integer.toString(f.getCategoryId()); Category c = (Category)cache.get...
public synchronized static void start(ForumDAO fm, CategoryDAO cm, ConfigDAO configModel) throws Exception
public synchronized static void start(ForumDAO fm, CategoryDAO cm, ConfigDAO configModel)
public synchronized static void start(ForumDAO fm, CategoryDAO cm, ConfigDAO configModel) throws Exception { instance = new ForumRepository(); if (cache.get(FQN, LOADED) == null) { instance.loadCategories(cm); instance.loadForums(fm); instance.loadMostUsersEverOnline(configModel); instance.loadUsersIn...
public static void updateMostUsersEverOnline(MostUsersEverOnline m) throws Exception
public static void updateMostUsersEverOnline(MostUsersEverOnline m)
public static void updateMostUsersEverOnline(MostUsersEverOnline m) throws Exception { ConfigDAO cm = DataAccessDriver.getInstance().newConfigDAO(); Config config = cm.selectByName(ConfigKeys.MOST_USERS_EVER_ONLINE); if (config == null) { // Total config = new Config(); config.setName(ConfigKeys.MOST_USERS_EV...
double bearing = Utils.normalRelativeAngle(angle - heading);
double bearing = normalRelativeAngle(angle - heading);
public void checkRobotCollision() { synchronized (this) { inCollision = false; } for (int i = 0; i < battle.getRobots().size(); i++) { RobotPeer r = (RobotPeer) battle.getRobots().elementAt(i); if (!(r == null || r == this || r.isDead) && boundingBox.intersects(r.boundingBox)) { // Bounce back double an...
eventManager.add( new HitRobotEvent(r.getName(), Utils.normalRelativeAngle(angle - heading), r.energy, atFault));
eventManager.add(new HitRobotEvent(r.getName(), normalRelativeAngle(angle - heading), r.energy, atFault));
public void checkRobotCollision() { synchronized (this) { inCollision = false; } for (int i = 0; i < battle.getRobots().size(); i++) { RobotPeer r = (RobotPeer) battle.getRobots().elementAt(i); if (!(r == null || r == this || r.isDead) && boundingBox.intersects(r.boundingBox)) { // Bounce back double an...
new HitRobotEvent(getName(), Utils.normalRelativeAngle(PI + angle - r.heading), energy, false));
new HitRobotEvent(getName(), normalRelativeAngle(PI + angle - r.heading), energy, false));
public void checkRobotCollision() { synchronized (this) { inCollision = false; } for (int i = 0; i < battle.getRobots().size(); i++) { RobotPeer r = (RobotPeer) battle.getRobots().elementAt(i); if (!(r == null || r == this || r.isDead) && boundingBox.intersects(r.boundingBox)) { // Bounce back double an...
angle = Utils.normalRelativeAngle(PI / 2 - heading);
angle = normalRelativeAngle(PI / 2 - heading);
public void checkWallCollision() { boolean hitWall = false; double fixx = 0; double fixy = 0; double angle = 0; if (boundingBox.x + boundingBox.width > battleField.getBoundingBox().x + battleField.getBoundingBox().width) { hitWall = true; fixx = battleField.getBoundingBox().x + battleField.getBoundingBox().wi...
angle = Utils.normalRelativeAngle(3 * PI / 2 - heading);
angle = normalRelativeAngle(3 * PI / 2 - heading);
public void checkWallCollision() { boolean hitWall = false; double fixx = 0; double fixy = 0; double angle = 0; if (boundingBox.x + boundingBox.width > battleField.getBoundingBox().x + battleField.getBoundingBox().width) { hitWall = true; fixx = battleField.getBoundingBox().x + battleField.getBoundingBox().wi...
angle = Utils.normalRelativeAngle(-heading);
angle = normalRelativeAngle(-heading);
public void checkWallCollision() { boolean hitWall = false; double fixx = 0; double fixy = 0; double angle = 0; if (boundingBox.x + boundingBox.width > battleField.getBoundingBox().x + battleField.getBoundingBox().width) { hitWall = true; fixx = battleField.getBoundingBox().x + battleField.getBoundingBox().wi...
angle = Utils.normalRelativeAngle(PI - heading);
angle = normalRelativeAngle(PI - heading);
public void checkWallCollision() { boolean hitWall = false; double fixx = 0; double fixy = 0; double angle = 0; if (boundingBox.x + boundingBox.width > battleField.getBoundingBox().x + battleField.getBoundingBox().width) { hitWall = true; fixx = battleField.getBoundingBox().x + battleField.getBoundingBox().wi...
Utils.log("testing: " + x1 + "," + y1);
log("testing: " + x1 + "," + y1);
public boolean intersectsLine(Rectangle2D.Float r, double x1, double y1, double x2, double y2) { int out1, out2; if ((out2 = r.outcode(x2, y2)) == 0) { return true; } while ((out1 = r.outcode(x1, y1)) != 0) { Utils.log("testing: " + x1 + "," + y1); if ((out1 & out2) != 0) { return false; } if ((out1 &...
Utils.log("adding r.getWidth");
log("adding r.getWidth");
public boolean intersectsLine(Rectangle2D.Float r, double x1, double y1, double x2, double y2) { int out1, out2; if ((out2 = r.outcode(x2, y2)) == 0) { return true; } while ((out1 = r.outcode(x1, y1)) != 0) { Utils.log("testing: " + x1 + "," + y1); if ((out1 & out2) != 0) { return false; } if ((out1 &...
Utils.log("x is now: " + x);
log("x is now: " + x);
public boolean intersectsLine(Rectangle2D.Float r, double x1, double y1, double x2, double y2) { int out1, out2; if ((out2 = r.outcode(x2, y2)) == 0) { return true; } while ((out1 = r.outcode(x1, y1)) != 0) { Utils.log("testing: " + x1 + "," + y1); if ((out1 & out2) != 0) { return false; } if ((out1 &...
Utils.log("x1 is now: " + x1);
log("x1 is now: " + x1);
public boolean intersectsLine(Rectangle2D.Float r, double x1, double y1, double x2, double y2) { int out1, out2; if ((out2 = r.outcode(x2, y2)) == 0) { return true; } while ((out1 = r.outcode(x1, y1)) != 0) { Utils.log("testing: " + x1 + "," + y1); if ((out1 & out2) != 0) { return false; } if ((out1 &...
Utils.log("adding r.getHeight");
log("adding r.getHeight");
public boolean intersectsLine(Rectangle2D.Float r, double x1, double y1, double x2, double y2) { int out1, out2; if ((out2 = r.outcode(x2, y2)) == 0) { return true; } while ((out1 = r.outcode(x1, y1)) != 0) { Utils.log("testing: " + x1 + "," + y1); if ((out1 & out2) != 0) { return false; } if ((out1 &...
Utils.log(getName() + " stopped successfully.");
log(getName() + " stopped successfully.");
public void run() { setRunning(true); try { if (robot != null) { robot.run(); } for (;;) { tick(); } } catch (DeathException e) { out.println("SYSTEM: " + getName() + " has died"); } catch (WinException e) { ; // Do nothing } catch (DisabledException e) { setEnergy(0); String msg = e.getMess...
if (getTestingCondition()) {
if (testingCondition) {
public final void tick() { if (newBullet != null) { battle.addBullet(newBullet); newBullet = null; } // Entering tick if (Thread.currentThread() != robotThreadManager.getRunThread()) { throw new RobotException("You cannot take action in this thread!"); } if (getTestingCondition()) { throw new RobotExcept...
this.wait(10000);
this.wait();
public final void tick() { if (newBullet != null) { battle.addBullet(newBullet); newBullet = null; } // Entering tick if (Thread.currentThread() != robotThreadManager.getRunThread()) { throw new RobotException("You cannot take action in this thread!"); } if (getTestingCondition()) { throw new RobotExcept...
Utils.log("Wait interrupted");
log("Wait interrupted");
public final void tick() { if (newBullet != null) { battle.addBullet(newBullet); newBullet = null; } // Entering tick if (Thread.currentThread() != robotThreadManager.getRunThread()) { throw new RobotException("You cannot take action in this thread!"); } if (getTestingCondition()) { throw new RobotExcept...
gunHeading = Utils.normalAbsoluteAngle(gunHeading);
gunHeading = normalAbsoluteAngle(gunHeading);
private void updateGunHeading() { if (gunTurnRemaining > 0) { if (gunTurnRemaining < Rules.GUN_TURN_RATE_RADIANS) { gunHeading += gunTurnRemaining; radarHeading += gunTurnRemaining; if (isAdjustRadarForGunTurn) { radarTurnRemaining -= gunTurnRemaining; } gunTurnRemaining = 0; } else { gunHea...
heading = Utils.normalNearAbsoluteAngle(heading);
heading = normalNearAbsoluteAngle(heading);
private void updateHeading() { boolean normalizeHeading = true; double turnRate = min(maxTurnRate, (0.4 + 0.6 * (1 - (abs(velocity) / Rules.MAX_VELOCITY))) * Rules.MAX_TURN_RATE_RADIANS); if (turnRemaining > 0) { if (turnRemaining < turnRate) { heading += turnRemaining; gunHeading += turnRemaining; r...
heading = Utils.normalAbsoluteAngle(heading);
heading = normalAbsoluteAngle(heading);
private void updateHeading() { boolean normalizeHeading = true; double turnRate = min(maxTurnRate, (0.4 + 0.6 * (1 - (abs(velocity) / Rules.MAX_VELOCITY))) * Rules.MAX_TURN_RATE_RADIANS); if (turnRemaining > 0) { if (turnRemaining < turnRate) { heading += turnRemaining; gunHeading += turnRemaining; r...
radarHeading = Utils.normalAbsoluteAngle(radarHeading);
radarHeading = normalAbsoluteAngle(radarHeading);
private void updateRadarHeading() { if (radarTurnRemaining > 0) { if (radarTurnRemaining < Rules.RADAR_TURN_RATE_RADIANS) { radarHeading += radarTurnRemaining; radarTurnRemaining = 0; } else { radarHeading += Rules.RADAR_TURN_RATE_RADIANS; radarTurnRemaining -= Rules.RADAR_TURN_RATE_RADIANS; } } el...
public void bbReload() throws Exception
public void bbReload()
public void bbReload() throws Exception { BBCodeRepository.setBBCollection(new BBCodeHandler().parse()); this.list(); }
public void list() throws Exception
public void list()
public void list() throws Exception { this.setTemplateName(TemplateKeys.CACHE_LIST); this.context.put("bb", new BBCodeRepository()); this.context.put("modules", new ModulesRepository()); this.context.put("ranking", new RankingRepository()); this.context.put("smilies", new SmiliesRepository()); this.context.put...
public void modulesReload() throws Exception
public void modulesReload()
public void modulesReload() throws Exception { ModulesRepository.init(SystemGlobals.getValue(ConfigKeys.CONFIG_DIR)); this.list(); }
public void postsClear() throws Exception
public void postsClear()
public void postsClear() throws Exception { int topicId = this.request.getIntParameter("topic_id"); PostRepository.clearCache(topicId); this.postsMoreInfo(); }
public void postsMoreInfo() throws Exception
public void postsMoreInfo()
public void postsMoreInfo() throws Exception { if (!SystemGlobals.getBoolValue(ConfigKeys.POSTS_CACHE_ENABLED)) { this.list(); return; } Collection topics = PostRepository.cachedTopics(); this.context.put("topics", DataAccessDriver.getInstance().newTopicDAO().selectTopicTitlesByIds(topics)); this.context....
public void rankingReload() throws Exception
public void rankingReload()
public void rankingReload() throws Exception { RankingRepository.loadRanks(); this.list(); }
public void sessionClear() throws Exception
public void sessionClear()
public void sessionClear() throws Exception { SessionFacade.clear(); this.list(); }
public void smiliesReload() throws Exception
public void smiliesReload()
public void smiliesReload() throws Exception { SmiliesRepository.loadSmilies(); this.list(); }
public void topicsClear() throws Exception
public void topicsClear()
public void topicsClear() throws Exception { int forumId = this.request.getIntParameter("forum_id"); TopicRepository.clearCache(forumId); this.topicsMoreInfo(); }
public void topicsMoreInfo() throws Exception
public void topicsMoreInfo()
public void topicsMoreInfo() throws Exception { if (!SystemGlobals.getBoolValue(ConfigKeys.TOPIC_CACHE_ENABLED)) { this.list(); return; } this.setTemplateName(TemplateKeys.CACHE_TOPICS_MOREINFO); this.context.put("categories", ForumRepository.getAllCategories()); }
public static void init(String baseDir) throws IOException
public static void init(String baseDir)
public static void init(String baseDir) throws IOException { cache.put(ENTRIES, ConfigLoader.loadModulesMapping(baseDir)); }
this.context.put("smilies", SmiliesRepository.getSmilies());
private void sendFormCommon(User user) { this.setTemplateName(TemplateKeys.PM_SENDFORM); this.context.put("user", user); this.context.put("moduleName", "pm"); this.context.put("action", "sendSave"); this.context.put("htmlAllowed", true); this.context.put("attachmentsEnabled", false); this.context.put("maxAtta...
if ( out != null ) { IoUtils.close( out ); }
IoUtils.close( out );
public void get( String resourceName, File destination ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = new Resource( resourceName ); fireGetInitiated( resource, destination ); ChannelExec channel = null; //I/O stream...
throws TransferFailedException
throws TransferFailedException, ResourceDoesNotExistException
protected void handleGetException( Resource resource, Exception e, File destination ) throws TransferFailedException { fireTransferError( resource, e, TransferEvent.REQUEST_GET ); if ( destination.exists() ) { boolean deleted = destination.delete(); if ( !deleted...
throw new TransferFailedException( msg, e );
if( e.toString().equals("No such file")) { throw new ResourceDoesNotExistException( msg, e ); } else { throw new TransferFailedException( msg, e ); }
protected void handleGetException( Resource resource, Exception e, File destination ) throws TransferFailedException { fireTransferError( resource, e, TransferEvent.REQUEST_GET ); if ( destination.exists() ) { boolean deleted = destination.delete(); if ( !deleted...
setFault(e);
recordFault(e);
public void execute() { assertNotCompleted(); try { getProvider().registerDestination(getName()); } catch (RuntimeException e) { setFault(e); } completed(); }
public String getDate(int dateType) {
public String getDate( final int dateType ) {
public String getDate(int dateType) { String dateTime; if (dateType == DIGITIZED_DATE) { dateTime = getString(ExifConstants.DIGITIZED_DATE); } else if (dateType == MODIFIED_DATE) { dateTime = getString(ExifConstants.MODIFIED_DATE); } else { dateTime = get...
if (dateParts.size() != 6)
if (dateParts.size() != 6) {
public String getDate(int dateType) { String dateTime; if (dateType == DIGITIZED_DATE) { dateTime = getString(ExifConstants.DIGITIZED_DATE); } else if (dateType == MODIFIED_DATE) { dateTime = getString(ExifConstants.MODIFIED_DATE); } else { dateTime = get...
}
public String getDate(int dateType) { String dateTime; if (dateType == DIGITIZED_DATE) { dateTime = getString(ExifConstants.DIGITIZED_DATE); } else if (dateType == MODIFIED_DATE) { dateTime = getString(ExifConstants.MODIFIED_DATE); } else { dateTime = get...
int programNumber = getInt(ExifConstants.EXPOSURE_PROGRAM);
final int programNumber = getInt(ExifConstants.EXPOSURE_PROGRAM);
public String getExposureProgram() { int programNumber = getInt(ExifConstants.EXPOSURE_PROGRAM); switch (programNumber) { case 1: return "Manual Mode"; case 2: return "Automatic Mode"; case 3: return "Aperture Priority"; ...
Rational rat = (Rational) getObject(ExifConstants.F_NUMBER); if (rat == null)
final Rational rat = (Rational) getObject(ExifConstants.F_NUMBER); if (rat == null) {
public String getFStop() { Rational rat = (Rational) getObject(ExifConstants.F_NUMBER); if (rat == null) return ""; return "" + rat.getDoubleValue(); }
}
public String getFStop() { Rational rat = (Rational) getObject(ExifConstants.F_NUMBER); if (rat == null) return ""; return "" + rat.getDoubleValue(); }
int flash = getInt(ExifConstants.FLASH);
final int flash = getInt(ExifConstants.FLASH);
public String getFlash() { int flash = getInt(ExifConstants.FLASH); switch (flash) { case 0: return "No Flash"; case 5: return "Camera Flash"; case 6: return "Camera Flash, no Strobe Bounce Detected"; case 7: ...
Rational rat = (Rational) getObject(ExifConstants.SHUTTER_SPEED); if (rat == null)
final Rational rat = (Rational) getObject(ExifConstants.SHUTTER_SPEED); if (rat == null) {
public String getShutterSpeed() { Rational rat = (Rational) getObject(ExifConstants.SHUTTER_SPEED); if (rat == null) return ""; return rat.getFraction(); }
}
public String getShutterSpeed() { Rational rat = (Rational) getObject(ExifConstants.SHUTTER_SPEED); if (rat == null) return ""; return rat.getFraction(); }
public ABibtex( List _stringEntry_, List _entry_)
public ABibtex()
public ABibtex( List _stringEntry_, List _entry_) { { this._stringEntry_.clear(); this._stringEntry_.addAll(_stringEntry_); } { this._entry_.clear(); this._entry_.addAll(_entry_); } }
{ this._stringEntry_.clear(); this._stringEntry_.addAll(_stringEntry_); } { this._entry_.clear(); this._entry_.addAll(_entry_); }
public ABibtex( List _stringEntry_, List _entry_) { { this._stringEntry_.clear(); this._stringEntry_.addAll(_stringEntry_); } { this._entry_.clear(); this._entry_.addAll(_entry_); } }
System.out.println("Copyright (C) 2003-2005 A. Vontobel");
System.out.println("Copyright (C) 2003-2006 A. Vontobel");
public static void main(String[] args) { String sprache; String land; String dateiname = ""; String lookAndFeel = "Steel"; Locale lc = Locale.getDefault(); treillis fw; boolean help = false; String titel = "" + PROGNAME + " version " + HAUPTVER + "."; ...
else searchStatus = NODATA;
public void parseSearch(final BufferedReader reader, final SearchContentHandler handler) throws IOException, BioException, ParserException { lineNumber = 0; boolean parsedQueryId = false; this.handler = handler; LINE: while ((line = reader.readLine()) != null) { lin...
searchParsed = true; handler.setMoreSearches(true); return;
searchParsed = true; searchStatus = NODATA; continue LINE;
public void parseSearch(final BufferedReader reader, final SearchContentHandler handler) throws IOException, BioException, ParserException { lineNumber = 0; boolean parsedQueryId = false; this.handler = handler; LINE: while ((line = reader.readLine()) != null) { lin...
break STATUS; } else
else break STATUS; } else
public void parseSearch(final BufferedReader reader, final SearchContentHandler handler) throws IOException, BioException, ParserException { lineNumber = 0; boolean parsedQueryId = false; this.handler = handler; LINE: while ((line = reader.readLine()) != null) { lin...
parsedQueryId = true; }
public void parseSearch(final BufferedReader reader, final SearchContentHandler handler) throws IOException, BioException, ParserException { lineNumber = 0; boolean parsedQueryId = false; this.handler = handler; LINE: while ((line = reader.readLine()) != null) { lin...
public void show(ImagePlus imp, String[] labels, int[] axes, int countZ, int countT, int countC, int indexZ, int indexT, int indexC) { names = labels; lengths = axes; numZ = countZ; numT = countT; numC = countC; hasZ = numZ > 1; hasT = numT > 1; hasC = numC > 1; zIndex = indexZ; tIndex = indexT; cIndex = indexC; show(i...
public void show(ImagePlus imp) { int stackSize = imp == null ? 0 : imp.getStackSize(); if (stackSize == 0) { msg("Cannot show invalid image."); return; } if (stackSize == 1) { imp.show(); return; } new CustomWindow(this, imp, new ImageCanvas(imp));
public void show(ImagePlus imp, String[] labels, int[] axes, int countZ, int countT, int countC, int indexZ, int indexT, int indexC) { names = labels; lengths = axes; numZ = countZ; numT = countT; numC = countC; hasZ = numZ > 1; hasT = numT > 1; hasC = numC > 1; zIndex = indexZ; tInd...
return new FeatureFilter.OverlapsLocation(transformLocation(((FeatureFilter.OverlapsLocation) ff).getLocation()));
return new FeatureFilter.OverlapsLocation(untransformLocation(((FeatureFilter.OverlapsLocation) ff).getLocation()));
private FeatureFilter _transformFilter(FeatureFilter ff) { if (ff instanceof FeatureFilter.And) { FeatureFilter ff1 = ((FeatureFilter.And) ff).getChild1(); FeatureFilter ff2 = ((FeatureFilter.And) ff).getChild2(); return new FeatureFilter.And(transformFilter(ff1), transformFi...
return new FeatureFilter.ContainedByLocation(transformLocation(((FeatureFilter.ContainedByLocation) ff).getLocation()));
return new FeatureFilter.ContainedByLocation(untransformLocation(((FeatureFilter.ContainedByLocation) ff).getLocation()));
private FeatureFilter _transformFilter(FeatureFilter ff) { if (ff instanceof FeatureFilter.And) { FeatureFilter ff1 = ((FeatureFilter.And) ff).getChild1(); FeatureFilter ff2 = ((FeatureFilter.And) ff).getChild2(); return new FeatureFilter.And(transformFilter(ff1), transformFi...
this.addMouseListener(mouseListener); this.addMouseMotionListener(mouseMotionListener);
public SequencePanel() { super(); if(getFont() == null) { setFont(new Font("Times New Roman", Font.PLAIN, 12)); } this.addPropertyChangeListener(theMonitor); }
System.out.println("minPos: " + minPos);
public void paintComponent(Graphics g) { if( (sequence == null) || (renderer == null) ) { return; } Graphics2D g2 = (Graphics2D) g; Rectangle2D currentClip = g2.getClip().getBounds2D(); double minPos; double maxPos; if(direction == HORIZONTAL) { minPos = currentClip.getMinY(); ...
System.out.println("minOffset: " + minOffset);
public void paintComponent(Graphics g) { if( (sequence == null) || (renderer == null) ) { return; } Graphics2D g2 = (Graphics2D) g; Rectangle2D currentClip = g2.getClip().getBounds2D(); double minPos; double maxPos; if(direction == HORIZONTAL) { minPos = currentClip.getMinY(); ...
System.out.println("minCoord: " + minCoord);
public void paintComponent(Graphics g) { if( (sequence == null) || (renderer == null) ) { return; } Graphics2D g2 = (Graphics2D) g; Rectangle2D currentClip = g2.getClip().getBounds2D(); double minPos; double maxPos; if(direction == HORIZONTAL) { minPos = currentClip.getMinY(); ...
System.out.println("minP: " + minP);
public void paintComponent(Graphics g) { if( (sequence == null) || (renderer == null) ) { return; } Graphics2D g2 = (Graphics2D) g; Rectangle2D currentClip = g2.getClip().getBounds2D(); double minPos; double maxPos; if(direction == HORIZONTAL) { minPos = currentClip.getMinY(); ...
System.out.println("resizeAndValidate starting");
public void resizeAndValidate() { System.out.println("resizeAndValidate starting"); Dimension d = null; double acrossDim; if( (sequence == null) || (renderer == null) ) { System.out.println("No sequence"); // no sequence - collapse down to no size at all alongDim = 0.0; acrossDim =...
System.out.println("insetBefore: " + insetBefore); System.out.println("insetAfter: " + insetAfter);
public void resizeAndValidate() { System.out.println("resizeAndValidate starting"); Dimension d = null; double acrossDim; if( (sequence == null) || (renderer == null) ) { System.out.println("No sequence"); // no sequence - collapse down to no size at all alongDim = 0.0; acrossDim =...
System.out.println("resizeAndValidate ending");
public void resizeAndValidate() { System.out.println("resizeAndValidate starting"); Dimension d = null; double acrossDim; if( (sequence == null) || (renderer == null) ) { System.out.println("No sequence"); // no sequence - collapse down to no size at all alongDim = 0.0; acrossDim =...
if( (this.renderer != null) && (this.renderer instanceof Changeable) ) { Changeable c = (Changeable) this.renderer; c.removeChangeListener(layoutListener, SequenceRenderContext.LAYOUT); c.removeChangeListener(repaintListener, SequenceRenderContext.REPAINT); } this.renderer = r; if( (r != null) && (r instanceof Changeab...
cs.firePreChangeEvent(ce); _setRenderer(r); cs.firePostChangeEvent(ce);
public void setRenderer(SequenceRenderer r) throws ChangeVetoException { if(hasChangeListeners()) { ChangeEvent ce = new ChangeEvent( this, RENDERER, r, this.renderer ); ChangeSupport cs = getChangeSupport(RENDERER); synchronized(cs) { if( (this.renderer != n...
this.renderer = r;
_setRenderer(r);
public void setRenderer(SequenceRenderer r) throws ChangeVetoException { if(hasChangeListeners()) { ChangeEvent ce = new ChangeEvent( this, RENDERER, r, this.renderer ); ChangeSupport cs = getChangeSupport(RENDERER); synchronized(cs) { if( (this.renderer != n...
String rel = dm.group(2); String type = dm.group(3);
String rel = dm.group(4); String type = dm.group(5);
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener, Namespace ns) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; //bool...
} else if (e.getSource() == RobocodeFrame.this.getNextTurnButton()) { nextTurnButtonActionPerformed();
public void actionPerformed(ActionEvent e) { if (e.getSource() == RobocodeFrame.this.getPauseResumeButton()) { pauseResumeButtonActionPerformed(); } else if (e.getSource() == RobocodeFrame.this.getStopButton()) { stopButtonActionPerformed(); } else if (e.getSource() == RobocodeFrame.this.getRestartButton(...
pauseResumeButton = new JButton("Pause");
pauseResumeButton = new JButton("Pause/Debug");
public JButton getPauseResumeButton() { if (pauseResumeButton == null) { pauseResumeButton = new JButton("Pause"); pauseResumeButton.setMnemonic('P'); pauseResumeButton.setDisplayedMnemonicIndex(0); pauseResumeButton.setHorizontalTextPosition(SwingConstants.CENTER); pauseResumeButton.setVerticalTextPosition...
toolBar.add(getNextTurnButton());
private JToolBar getToolBar() { if (toolBar == null) { toolBar = new JToolBar(); toolBar.add(getPauseResumeButton()); toolBar.add(getStopButton()); toolBar.add(getRestartButton()); toolBar.add(new JLabel(" ")); toolBar.add(getStatusLabel()); Utils.setDefaultStatusLabel(getStatusLabel()); } return tool...
if (getPauseResumeButton().getText().equals("Pause")) {
if (getPauseResumeButton().getText().equals("Pause/Debug")) {
public void pauseResumeButtonActionPerformed() { if (getPauseResumeButton().getText().equals("Pause")) { getPauseResumeButton().setText("Resume"); getPauseResumeButton().setMnemonic('e'); getPauseResumeButton().setDisplayedMnemonicIndex(1); manager.getBattleManager().pauseBattle(); } else if (getPauseResumeB...
getPauseResumeButton().setText("Pause");
getPauseResumeButton().setText("Pause/Debug");
public void pauseResumeButtonActionPerformed() { if (getPauseResumeButton().getText().equals("Pause")) { getPauseResumeButton().setText("Resume"); getPauseResumeButton().setMnemonic('e'); getPauseResumeButton().setDisplayedMnemonicIndex(1); manager.getBattleManager().pauseBattle(); } else if (getPauseResumeB...
getNextTurnButton().setVisible(false);
public void pauseResumeButtonActionPerformed() { if (getPauseResumeButton().getText().equals("Pause")) { getPauseResumeButton().setText("Resume"); getPauseResumeButton().setMnemonic('e'); getPauseResumeButton().setDisplayedMnemonicIndex(1); manager.getBattleManager().pauseBattle(); } else if (getPauseResumeB...
public void restartButtonActionPerformed() {
private void restartButtonActionPerformed() {
public void restartButtonActionPerformed() { windowManager.getManager().getBattleManager().restart(); }
public void stopButtonActionPerformed() {
private void stopButtonActionPerformed() {
public void stopButtonActionPerformed() { windowManager.getManager().getBattleManager().stop(true); }
public void addNew(Group group) throws Exception
public void addNew(Group group)
public void addNew(Group group) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GroupModel.addNew")); p.setString(1, group.getName()); p.setString(2, group.getDescription()); p.setInt(3, group.getParentId()); p.executeUpdate(); p.close(); ...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GroupModel.addNew")); p.setString(1, group.getName()); p.setString(2, group.getDescription()); p.setInt(3, group.getParentId()); p.executeUpdate(); p.close();
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GroupModel.addNew")); p.setString(1, group.getName()); p.setString(2, group.getDescription()); p.setInt(3, group.getParentId()); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr selectActiv...
public void addNew(Group group) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GroupModel.addNew")); p.setString(1, group.getName()); p.setString(2, group.getDescription()); p.setInt(3, group.getParentId()); p.executeUpdate(); p.close(); ...
public boolean canDelete(int groupId) throws Exception
public boolean canDelete(int groupId)
public boolean canDelete(int groupId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GroupModel.canDelete")); p.setInt(1, groupId); boolean status = false; ResultSet rs = p.executeQuery(); if (!rs.next() || rs.getInt("total") < 1) { sta...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GroupModel.canDelete")); p.setInt(1, groupId); boolean status = false; ResultSet rs = p.executeQuery(); if (!rs.next() || rs.getInt("total") < 1) { status = true; } rs.close(); p.close(); return status; }
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GroupModel.canDelete")); p.setInt(1, groupId); boolean status = false; rs = p.executeQuery(); if (!rs.next() || rs.getInt("total") < 1) { status = true; } return status; } catch (SQLEx...
public boolean canDelete(int groupId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GroupModel.canDelete")); p.setInt(1, groupId); boolean status = false; ResultSet rs = p.executeQuery(); if (!rs.next() || rs.getInt("total") < 1) { sta...
public void delete(int groupId) throws Exception
public void delete(int groupId)
public void delete(int groupId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GroupModel.delete")); p.setInt(1, groupId); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GroupModel.delete")); p.setInt(1, groupId); p.executeUpdate(); p.close();
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GroupModel.delete")); p.setInt(1, groupId); 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 groupId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GroupModel.delete")); p.setInt(1, groupId); p.executeUpdate(); p.close(); }
protected List fillGroups(ResultSet rs) throws Exception
protected List fillGroups(ResultSet rs) throws SQLException
protected List fillGroups(ResultSet rs) throws Exception { List l = new ArrayList(); while (rs.next()) { l.add(this.getGroup(rs)); } return l; }
protected Group getGroup(ResultSet rs) throws Exception
protected Group getGroup(ResultSet rs) throws SQLException
protected Group getGroup(ResultSet rs) throws Exception { Group g = new Group(); g.setId(rs.getInt("group_id")); g.setDescription(rs.getString("group_description")); g.setName(rs.getString("group_name")); g.setParentId(rs.getInt("parent_id")); return g; }
public List selectAll() throws Exception
public List selectAll()
public List selectAll() throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GroupModel.selectAll")); ResultSet rs = p.executeQuery(); List l = this.fillGroups(rs); rs.close(); p.close(); return l; }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GroupModel.selectAll")); ResultSet rs = p.executeQuery(); List l = this.fillGroups(rs); rs.close(); p.close(); return l; }
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GroupModel.selectAll")); rs = p.executeQuery(); return this.fillGroups(rs); } catch (SQLException e) { String es = "Erorr selectAll()"; log.error(es, e); throw new RuntimeException(es, e...
public List selectAll() throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GroupModel.selectAll")); ResultSet rs = p.executeQuery(); List l = this.fillGroups(rs); rs.close(); p.close(); return l; }
public Group selectById(int groupId) throws Exception
public Group selectById(int groupId)
public Group selectById(int groupId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GroupModel.selectById")); p.setInt(1, groupId); ResultSet rs = p.executeQuery(); Group g = new Group(); if (rs.next()) { g = this.getGroup(rs); } ...