rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
Object pk = ((KortathjonustanAuthorisationEntriesBMPBean)entity).ejbFindByAuthorizationCode(p0); | Object pk = ((KortathjonustanAuthorisationEntriesBMPBean)entity).ejbFindByAuthorizationCode(p0, stamp); | public KortathjonustanAuthorisationEntries findByAuthorizationCode(java.lang.String p0)throws javax.ejb.FinderException{ com.idega.data.IDOEntity entity = this.idoCheckOutPooledEntity(); Object pk = ((KortathjonustanAuthorisationEntriesBMPBean)entity).ejbFindByAuthorizationCode(p0); this.idoCheckInPooledEntity(entity); return this.findByPrimaryKey(pk);} |
String modelName, | public SimplePhaseStoN(String phase, TimeInterval shortOffsetBegin, TimeInterval shortOffsetEnd, TimeInterval longOffsetBegin, TimeInterval longOffsetEnd, String modelName, TauPUtil taup) throws TauModelException { this.phase = phase; this.shortOffsetBegin = shortOffsetBegin; this.shortOffsetEnd = shortOffsetEnd; this.longOffsetBegin = longOffsetBegin; this.longOffsetEnd = longOffsetEnd; if (shortOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (shortOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } this.taup = taup; shortCut = new PhaseCut(taup, phase, shortOffsetBegin, phase, shortOffsetEnd); longCut = new PhaseCut(taup, phase, longOffsetBegin, phase, longOffsetEnd); } |
|
throw new NullPointerException("shortOffsetBegin cannot be null"); | throw new NullPointerException("shortOffsetEnd cannot be null"); | public SimplePhaseStoN(String phase, TimeInterval shortOffsetBegin, TimeInterval shortOffsetEnd, TimeInterval longOffsetBegin, TimeInterval longOffsetEnd, String modelName, TauPUtil taup) throws TauModelException { this.phase = phase; this.shortOffsetBegin = shortOffsetBegin; this.shortOffsetEnd = shortOffsetEnd; this.longOffsetBegin = longOffsetBegin; this.longOffsetEnd = longOffsetEnd; if (shortOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (shortOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } this.taup = taup; shortCut = new PhaseCut(taup, phase, shortOffsetBegin, phase, shortOffsetEnd); longCut = new PhaseCut(taup, phase, longOffsetBegin, phase, longOffsetEnd); } |
throw new NullPointerException("shortOffsetBegin cannot be null"); | throw new NullPointerException("longOffsetBegin cannot be null"); | public SimplePhaseStoN(String phase, TimeInterval shortOffsetBegin, TimeInterval shortOffsetEnd, TimeInterval longOffsetBegin, TimeInterval longOffsetEnd, String modelName, TauPUtil taup) throws TauModelException { this.phase = phase; this.shortOffsetBegin = shortOffsetBegin; this.shortOffsetEnd = shortOffsetEnd; this.longOffsetBegin = longOffsetBegin; this.longOffsetEnd = longOffsetEnd; if (shortOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (shortOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } this.taup = taup; shortCut = new PhaseCut(taup, phase, shortOffsetBegin, phase, shortOffsetEnd); longCut = new PhaseCut(taup, phase, longOffsetBegin, phase, longOffsetEnd); } |
throw new NullPointerException("shortOffsetBegin cannot be null"); | throw new NullPointerException("longOffsetEnd cannot be null"); | public SimplePhaseStoN(String phase, TimeInterval shortOffsetBegin, TimeInterval shortOffsetEnd, TimeInterval longOffsetBegin, TimeInterval longOffsetEnd, String modelName, TauPUtil taup) throws TauModelException { this.phase = phase; this.shortOffsetBegin = shortOffsetBegin; this.shortOffsetEnd = shortOffsetEnd; this.longOffsetBegin = longOffsetBegin; this.longOffsetEnd = longOffsetEnd; if (shortOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (shortOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } this.taup = taup; shortCut = new PhaseCut(taup, phase, shortOffsetBegin, phase, shortOffsetEnd); longCut = new PhaseCut(taup, phase, longOffsetBegin, phase, longOffsetEnd); } |
if ( ! varianceCalculated) { variance = binarySumDevSqr(0, getLength(), mean()) / (getLength()-1); | if ( ! varianceCalculated) { variance = binarySumDevSqr(0, getLength(), mean()) / (getLength()-1); } return variance; | public double var() { if ( ! varianceCalculated) { variance = binarySumDevSqr(0, getLength(), mean()) / (getLength()-1); } return variance; } |
return variance; } | public double var() { if ( ! varianceCalculated) { variance = binarySumDevSqr(0, getLength(), mean()) / (getLength()-1); } return variance; } |
|
return NATMirrorFactory._INSTANCE_.createMirror(extension); | return extension; | protected ATObject createChild(ATClosure code, boolean parentPointerType) throws InterpreterException { NATIntercessiveMirror extension = new NATIntercessiveMirror( /* dynamic parent */ this, /* lexical parent */ code.base_getContext().base_getLexicalScope(), /* parent porinter type */ parentPointerType); code.base_applyInScope(NATTable.EMPTY, extension); // TODO: is this still necessary? can't we simply return the extension which is already a mirror? return NATMirrorFactory._INSTANCE_.createMirror(extension); } |
AGSymbol.alloc("print"), | AGSymbol.jAlloc("print"), | public NATText meta_print() throws InterpreterException { return Reflection.downObject(mirror_.meta_invoke( mirror_, AGSymbol.alloc("print"), NATTable.EMPTY )).asNativeText(); } |
int index = networks.indexOf(net); networkList.getSelectionModel().addSelectionInterval(index, index); | public void appendNetwork(NetworkAccess net) { netIdToNetMap.put(NetworkIdUtil.toString(net.get_attributes().get_id()), net); networks.addElement(net); fireNetworkDataChangedEvent(net); } |
|
public AvailableDataStationRenderer(boolean useNames, boolean useCodes, boolean codeIsFirst, DataCenterRouter dc, ChannelChooser channelChooser){ super(useNames, useCodes, codeIsFirst); this.dc = dc; this.channelChooser = channelChooser; startThread(); | public AvailableDataStationRenderer(boolean useNames){ super(useNames); | public AvailableDataStationRenderer(boolean useNames, boolean useCodes, boolean codeIsFirst, DataCenterRouter dc, ChannelChooser channelChooser){ super(useNames, useCodes, codeIsFirst); this.dc = dc; this.channelChooser = channelChooser; startThread(); } |
} else if (name.equals("calendarid")) { | } else if (name.equals("subscriptions")) { } else if (name.equals("calendarid")) { | public void field(String name) throws java.lang.Exception{ BwUser u = (BwUser)top(); if (principalTags(u, name)) { return; } if (name.equals("instanceOwner")) { u.setInstanceOwner(booleanFld()); } else if (name.equals("quota")) { u.setQuota(longFld()); } else if (name.equals("calendarid")) { // 2.3.2 // Fix it later globals.subscriptionsTbl.put(u, intFld()); } else { unknownTag(name); } } |
System.out.println("calculation points for seismogram shape: " + points[0] + ", " + points[1]); | private void getEdgeValues(MicroSecondTimeRange time, Dimension size){ if(seis.getEndTime().before(time.getBeginTime()) || seis.getBeginTime().after(time.getEndTime())) { startPixel = 0; endPixel = 0; return; } int[] points = DisplayUtils.getSeisPoints(seis, time); System.out.println("calculation points for seismogram shape: " + points[0] + ", " + points[1]); seisStart = points[0]; seisEnd = points[1]; MicroSecondDate temp = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisStart); if(temp.getMicroSecondTime() < time.getBeginTime().getMicroSecondTime()){ temp = time.getBeginTime(); } startPixel = getPixel(size.width, time.getBeginTime(), time.getEndTime(), temp); temp = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisEnd); if(temp.getMicroSecondTime() > time.getEndTime().getMicroSecondTime()){ temp = time.getEndTime(); } endPixel = getPixel(size.width, time.getBeginTime(), time.getEndTime(), temp); System.out.println("pixels to be drawn by seismogram shape: " + startPixel + ", " + endPixel); samplesPerPixel = (seisEnd - seisStart)/(double)(endPixel - startPixel); } |
|
System.out.println("pixels to be drawn by seismogram shape: " + startPixel + ", " + endPixel); | private void getEdgeValues(MicroSecondTimeRange time, Dimension size){ if(seis.getEndTime().before(time.getBeginTime()) || seis.getBeginTime().after(time.getEndTime())) { startPixel = 0; endPixel = 0; return; } int[] points = DisplayUtils.getSeisPoints(seis, time); System.out.println("calculation points for seismogram shape: " + points[0] + ", " + points[1]); seisStart = points[0]; seisEnd = points[1]; MicroSecondDate temp = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisStart); if(temp.getMicroSecondTime() < time.getBeginTime().getMicroSecondTime()){ temp = time.getBeginTime(); } startPixel = getPixel(size.width, time.getBeginTime(), time.getEndTime(), temp); temp = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisEnd); if(temp.getMicroSecondTime() > time.getEndTime().getMicroSecondTime()){ temp = time.getEndTime(); } endPixel = getPixel(size.width, time.getBeginTime(), time.getEndTime(), temp); System.out.println("pixels to be drawn by seismogram shape: " + startPixel + ", " + endPixel); samplesPerPixel = (seisEnd - seisStart)/(double)(endPixel - startPixel); } |
|
return jdbcCatalog.getAllContributors(); | return jdbcContributor.getAll(); | public String[] known_contributors() { try { return jdbcCatalog.getAllContributors(); } catch(SQLException sqle) { logger.error("sql problem", sqle); throw new org.omg.CORBA.UNKNOWN(sqle.toString()); // send exception back to client } } |
Integer[] eventIds; | int[] eventIds; | public EventAccess[] query_events(edu.iris.Fissures.Area the_area, edu.iris.Fissures.Quantity min_depth, edu.iris.Fissures.Quantity max_depth, edu.iris.Fissures.TimeRange time_range, String[] search_types, float min_magnitude, float max_magnitude, String[] catalogs, String[] contributors, int seq_max, EventSeqIterHolder iter) { EventAccess[] eventAccess; logger.debug("In the method query_events of EventFinder"); float minLat; float minLon; float maxLat; float maxLon; if(the_area instanceof BoxArea) { BoxArea box = (BoxArea)the_area; minLat = box.min_latitude; maxLat = box.max_latitude; minLon = box.min_longitude; maxLon = box.max_longitude; } else if(the_area instanceof GlobalArea) { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } else { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } Integer[] eventIds; int counter; try { logger.debug("The minimum depth is " + min_depth.value); logger.debug("The maximum depth is " + max_depth.value); logger.debug("The min_magnitude is " + min_magnitude); logger.debug("The max_magnitude is " + max_magnitude); eventIds = jdbcEventAccess.getOnConstraint(min_depth.value, max_depth.value, minLat, maxLat, minLon, maxLon, time_range.start_time, time_range.end_time, min_magnitude, max_magnitude, search_types, catalogs, contributors); eventAccess = new EventAccess[eventIds.length]; for(counter = 0; counter < eventIds.length; counter++) { EventAccessImpl eventImpl = new EventAccessImpl(jdbcEventAccess, eventIds[counter].intValue()); org.omg.CORBA.Object obj = poa.create_reference_with_id(eventIds[counter].toString() .getBytes(), EventAccessHelper.id()); eventAccess[counter] = EventAccessHelper.narrow(obj); if(eventAccess[counter] == null) logger.debug("The returned reference is null"); } return eventAccess; } catch(SQLException sqle) { logger.error("SQL problem", sqle); throw new org.omg.CORBA.UNKNOWN(sqle.toString()); //send exception // back to client. } catch(NotFound nfe) { logger.error("Not found", nfe); throw new org.omg.CORBA.UNKNOWN(nfe.toString()); //send exceptino // back to client. } catch(Throwable e) { logger.error("Generic Exception ", e); throw new org.omg.CORBA.UNKNOWN(e.toString(), 1, CompletionStatus.COMPLETED_NO); // send // exceptin // back // to // client. } } |
eventIds = jdbcEventAccess.getOnConstraint(min_depth.value, | eventIds = jdbcEventAccess.query(min_depth.value, | public EventAccess[] query_events(edu.iris.Fissures.Area the_area, edu.iris.Fissures.Quantity min_depth, edu.iris.Fissures.Quantity max_depth, edu.iris.Fissures.TimeRange time_range, String[] search_types, float min_magnitude, float max_magnitude, String[] catalogs, String[] contributors, int seq_max, EventSeqIterHolder iter) { EventAccess[] eventAccess; logger.debug("In the method query_events of EventFinder"); float minLat; float minLon; float maxLat; float maxLon; if(the_area instanceof BoxArea) { BoxArea box = (BoxArea)the_area; minLat = box.min_latitude; maxLat = box.max_latitude; minLon = box.min_longitude; maxLon = box.max_longitude; } else if(the_area instanceof GlobalArea) { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } else { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } Integer[] eventIds; int counter; try { logger.debug("The minimum depth is " + min_depth.value); logger.debug("The maximum depth is " + max_depth.value); logger.debug("The min_magnitude is " + min_magnitude); logger.debug("The max_magnitude is " + max_magnitude); eventIds = jdbcEventAccess.getOnConstraint(min_depth.value, max_depth.value, minLat, maxLat, minLon, maxLon, time_range.start_time, time_range.end_time, min_magnitude, max_magnitude, search_types, catalogs, contributors); eventAccess = new EventAccess[eventIds.length]; for(counter = 0; counter < eventIds.length; counter++) { EventAccessImpl eventImpl = new EventAccessImpl(jdbcEventAccess, eventIds[counter].intValue()); org.omg.CORBA.Object obj = poa.create_reference_with_id(eventIds[counter].toString() .getBytes(), EventAccessHelper.id()); eventAccess[counter] = EventAccessHelper.narrow(obj); if(eventAccess[counter] == null) logger.debug("The returned reference is null"); } return eventAccess; } catch(SQLException sqle) { logger.error("SQL problem", sqle); throw new org.omg.CORBA.UNKNOWN(sqle.toString()); //send exception // back to client. } catch(NotFound nfe) { logger.error("Not found", nfe); throw new org.omg.CORBA.UNKNOWN(nfe.toString()); //send exceptino // back to client. } catch(Throwable e) { logger.error("Generic Exception ", e); throw new org.omg.CORBA.UNKNOWN(e.toString(), 1, CompletionStatus.COMPLETED_NO); // send // exceptin // back // to // client. } } |
eventIds[counter].intValue()); org.omg.CORBA.Object obj = poa.create_reference_with_id(eventIds[counter].toString() .getBytes(), | eventIds[counter]); org.omg.CORBA.Object obj = poa.create_reference_with_id((""+eventIds[counter]).getBytes(), | public EventAccess[] query_events(edu.iris.Fissures.Area the_area, edu.iris.Fissures.Quantity min_depth, edu.iris.Fissures.Quantity max_depth, edu.iris.Fissures.TimeRange time_range, String[] search_types, float min_magnitude, float max_magnitude, String[] catalogs, String[] contributors, int seq_max, EventSeqIterHolder iter) { EventAccess[] eventAccess; logger.debug("In the method query_events of EventFinder"); float minLat; float minLon; float maxLat; float maxLon; if(the_area instanceof BoxArea) { BoxArea box = (BoxArea)the_area; minLat = box.min_latitude; maxLat = box.max_latitude; minLon = box.min_longitude; maxLon = box.max_longitude; } else if(the_area instanceof GlobalArea) { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } else { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } Integer[] eventIds; int counter; try { logger.debug("The minimum depth is " + min_depth.value); logger.debug("The maximum depth is " + max_depth.value); logger.debug("The min_magnitude is " + min_magnitude); logger.debug("The max_magnitude is " + max_magnitude); eventIds = jdbcEventAccess.getOnConstraint(min_depth.value, max_depth.value, minLat, maxLat, minLon, maxLon, time_range.start_time, time_range.end_time, min_magnitude, max_magnitude, search_types, catalogs, contributors); eventAccess = new EventAccess[eventIds.length]; for(counter = 0; counter < eventIds.length; counter++) { EventAccessImpl eventImpl = new EventAccessImpl(jdbcEventAccess, eventIds[counter].intValue()); org.omg.CORBA.Object obj = poa.create_reference_with_id(eventIds[counter].toString() .getBytes(), EventAccessHelper.id()); eventAccess[counter] = EventAccessHelper.narrow(obj); if(eventAccess[counter] == null) logger.debug("The returned reference is null"); } return eventAccess; } catch(SQLException sqle) { logger.error("SQL problem", sqle); throw new org.omg.CORBA.UNKNOWN(sqle.toString()); //send exception // back to client. } catch(NotFound nfe) { logger.error("Not found", nfe); throw new org.omg.CORBA.UNKNOWN(nfe.toString()); //send exceptino // back to client. } catch(Throwable e) { logger.error("Generic Exception ", e); throw new org.omg.CORBA.UNKNOWN(e.toString(), 1, CompletionStatus.COMPLETED_NO); // send // exceptin // back // to // client. } } |
} catch(NotFound nfe) { logger.error("Not found", nfe); throw new org.omg.CORBA.UNKNOWN(nfe.toString()); | public EventAccess[] query_events(edu.iris.Fissures.Area the_area, edu.iris.Fissures.Quantity min_depth, edu.iris.Fissures.Quantity max_depth, edu.iris.Fissures.TimeRange time_range, String[] search_types, float min_magnitude, float max_magnitude, String[] catalogs, String[] contributors, int seq_max, EventSeqIterHolder iter) { EventAccess[] eventAccess; logger.debug("In the method query_events of EventFinder"); float minLat; float minLon; float maxLat; float maxLon; if(the_area instanceof BoxArea) { BoxArea box = (BoxArea)the_area; minLat = box.min_latitude; maxLat = box.max_latitude; minLon = box.min_longitude; maxLon = box.max_longitude; } else if(the_area instanceof GlobalArea) { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } else { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } Integer[] eventIds; int counter; try { logger.debug("The minimum depth is " + min_depth.value); logger.debug("The maximum depth is " + max_depth.value); logger.debug("The min_magnitude is " + min_magnitude); logger.debug("The max_magnitude is " + max_magnitude); eventIds = jdbcEventAccess.getOnConstraint(min_depth.value, max_depth.value, minLat, maxLat, minLon, maxLon, time_range.start_time, time_range.end_time, min_magnitude, max_magnitude, search_types, catalogs, contributors); eventAccess = new EventAccess[eventIds.length]; for(counter = 0; counter < eventIds.length; counter++) { EventAccessImpl eventImpl = new EventAccessImpl(jdbcEventAccess, eventIds[counter].intValue()); org.omg.CORBA.Object obj = poa.create_reference_with_id(eventIds[counter].toString() .getBytes(), EventAccessHelper.id()); eventAccess[counter] = EventAccessHelper.narrow(obj); if(eventAccess[counter] == null) logger.debug("The returned reference is null"); } return eventAccess; } catch(SQLException sqle) { logger.error("SQL problem", sqle); throw new org.omg.CORBA.UNKNOWN(sqle.toString()); //send exception // back to client. } catch(NotFound nfe) { logger.error("Not found", nfe); throw new org.omg.CORBA.UNKNOWN(nfe.toString()); //send exceptino // back to client. } catch(Throwable e) { logger.error("Generic Exception ", e); throw new org.omg.CORBA.UNKNOWN(e.toString(), 1, CompletionStatus.COMPLETED_NO); // send // exceptin // back // to // client. } } |
|
break; | repaint(); return; | public void selectRegion(MouseEvent one, MouseEvent two){ Insets insets = this.getInsets(); Dimension dim = getSize(); double x1percent, x2percent; if(one.getX() < two.getX()){ x1percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x2percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); }else{ x2percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x1percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); } MicroSecondDate current = timeConfig.getTimeRange().getBeginTime(); MicroSecondDate selectionBegin = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x1percent + current.getMicroSecondTime())); MicroSecondDate selectionEnd = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x2percent + current.getMicroSecondTime())); if(currentSelection == null){ Iterator e = selections.iterator(); while(e.hasNext()){ Selection curr = ((Selection)e.next()); if(curr.borders(selectionBegin, selectionEnd)){ currentSelection = curr; break; } } if(currentSelection == null){ selections.add(new Selection(selectionBegin, selectionEnd, timeConfig, plotters)); currentSelection = ((Selection)selections.getFirst()); repaint(); return; } } currentSelection.adjustRange(selectionBegin, selectionEnd); repaint(); } |
if(currentSelection == null){ selections.add(new Selection(selectionBegin, selectionEnd, timeConfig, plotters)); currentSelection = ((Selection)selections.getFirst()); repaint(); return; } | currentSelection = new Selection(selectionBegin, selectionEnd, timeConfig, plotters); selections.add(currentSelection); repaint(); return; | public void selectRegion(MouseEvent one, MouseEvent two){ Insets insets = this.getInsets(); Dimension dim = getSize(); double x1percent, x2percent; if(one.getX() < two.getX()){ x1percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x2percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); }else{ x2percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x1percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); } MicroSecondDate current = timeConfig.getTimeRange().getBeginTime(); MicroSecondDate selectionBegin = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x1percent + current.getMicroSecondTime())); MicroSecondDate selectionEnd = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x2percent + current.getMicroSecondTime())); if(currentSelection == null){ Iterator e = selections.iterator(); while(e.hasNext()){ Selection curr = ((Selection)e.next()); if(curr.borders(selectionBegin, selectionEnd)){ currentSelection = curr; break; } } if(currentSelection == null){ selections.add(new Selection(selectionBegin, selectionEnd, timeConfig, plotters)); currentSelection = ((Selection)selections.getFirst()); repaint(); return; } } currentSelection.adjustRange(selectionBegin, selectionEnd); repaint(); } |
SeismogramShapeIterator iterator){ iterator.setTotalShift(currentIterator.getTotalShift() + dragAmount); double pointsPerPixel = iterator.getPointsPerPixel(); int[] seisPoints = currentIterator.getSeisPoints(); seisPoints[0] =(int)-(iterator.getTotalShift() * pointsPerPixel) + iterator.getBaseSeisPoint(); seisPoints[1] = seisPoints[0] + (int)(iterator.getSize().width * pointsPerPixel); iterator.setSeisPoints(seisPoints); int[][] points = currentIterator.getPoints(); int length = points[0].length - Math.abs(dragAmount); System.arraycopy(points[0], dragFrom, points[0], dragFrom + dragAmount, length); System.arraycopy(points[1], dragFrom, points[1], dragFrom + dragAmount, length); int[] drawnPixels = getPixels(iterator); iterator.setDrawnPixels(drawnPixels); if(drawnPixels[0] < 0|| drawnPixels[1] < 0){ return; } int drawStart, drawEnd; if(dragAmount < 0){ drawStart = drawnPixels[1] + dragAmount; drawEnd = drawnPixels[1]; }else{ drawStart = drawnPixels[0]; drawEnd = dragAmount--; ++dragAmount; } plotPixels(drawStart, drawEnd, iterator); | SeismogramShapeIterator iterator){ iterator.setTotalShift(currentIterator.getTotalShift() + dragAmount); double pointsPerPixel = iterator.getPointsPerPixel(); int[] seisPoints = currentIterator.getSeisPoints(); seisPoints[0] =(int)-(iterator.getTotalShift() * pointsPerPixel) + iterator.getBaseSeisPoint(); seisPoints[1] = seisPoints[0] + (int)(iterator.getSize().width * pointsPerPixel); iterator.setSeisPoints(seisPoints); int[][] points = currentIterator.getPoints(); int length = points[0].length - Math.abs(dragAmount); System.arraycopy(points[0], dragFrom, points[0], dragFrom + dragAmount, length); System.arraycopy(points[1], dragFrom, points[1], dragFrom + dragAmount, length); int[] drawnPixels = getPixels(iterator); if(drawnPixels[0] < 0|| drawnPixels[1] < 0){ return; } int drawStart, drawEnd; if(dragAmount < 0){ drawStart = drawnPixels[1] + dragAmount; drawEnd = drawnPixels[1]; }else{ drawStart = drawnPixels[0]; drawEnd = dragAmount--; ++dragAmount; } plotPixels(drawStart, drawEnd, iterator); | private void drag(int dragAmount, int dragFrom, SeismogramShapeIterator iterator){ iterator.setTotalShift(currentIterator.getTotalShift() + dragAmount); double pointsPerPixel = iterator.getPointsPerPixel(); int[] seisPoints = currentIterator.getSeisPoints(); seisPoints[0] =(int)-(iterator.getTotalShift() * pointsPerPixel) + iterator.getBaseSeisPoint(); seisPoints[1] = seisPoints[0] + (int)(iterator.getSize().width * pointsPerPixel); //System.out.println("SeisPoints: " + seisPoints[0] + ", " + seisPoints[1] + " PointsPixel: " + pointsPerPixel); iterator.setSeisPoints(seisPoints); int[][] points = currentIterator.getPoints(); int length = points[0].length - Math.abs(dragAmount); System.arraycopy(points[0], dragFrom, points[0], dragFrom + dragAmount, length); System.arraycopy(points[1], dragFrom, points[1], dragFrom + dragAmount, length); int[] drawnPixels = getPixels(iterator); iterator.setDrawnPixels(drawnPixels); if(drawnPixels[0] < 0|| drawnPixels[1] < 0){ return; } int drawStart, drawEnd; if(dragAmount < 0){ drawStart = drawnPixels[1] + dragAmount; drawEnd = drawnPixels[1]; }else{ drawStart = drawnPixels[0]; drawEnd = dragAmount--; ++dragAmount; } /*System.out.println("DragAmount: " + dragAmount + " reDrawStart: " + drawStart + " reDrawEnd: " + drawEnd + " DragFrom: " + dragFrom + " DrawStart: " + drawnPixels[0] + " DrawEnd: " + drawnPixels[1]+ " totalShift: " + iterator.getTotalShift() + " SeismogramPoints: " + seisPoints[0] + ", " + seisPoints[1]);*/ plotPixels(drawStart, drawEnd, iterator); } |
public void dragPlot(SeismogramShapeIterator iterator){ iterator.copyBasicInfo(currentIterator); double shiftPercentage = getShiftPercentage(currentIterator.getTime(), iterator.getTime()); double pixels = currentIterator.getSize().width * shiftPercentage + currentIterator.getLeftoverPixels(); pixels *= 1000; pixels = Math.round(pixels); pixels /= 1000; int shift = 0; if(pixels >= 1){ shift = (int)Math.floor(pixels); drag(shift, 0, iterator); }else if(pixels <= -1){ shift = (int)Math.ceil(pixels); drag(shift, -shift, iterator); }else{ iterator.setSeisPoints(currentIterator.getSeisPoints()); iterator.setDrawnPixels(currentIterator.getDrawnPixels()); iterator.setTotalShift(currentIterator.getTotalShift() + shift); } iterator.setLeftoverPixels(pixels - shift); currentIterator = iterator; } | private void dragPlot(SeismogramShapeIterator iterator){ iterator.copyBasicInfo(currentIterator); double shiftPercentage = getShiftPercentage(currentIterator.getTime(), iterator.getTime()); double pixels = currentIterator.getSize().width * shiftPercentage + currentIterator.getLeftoverPixels(); pixels *= 1000; pixels = Math.round(pixels); pixels /= 1000; int shift = 0; if(pixels >= 1){ shift = (int)Math.floor(pixels); drag(shift, 0, iterator); }else if(pixels <= -1){ shift = (int)Math.ceil(pixels); drag(shift, -shift, iterator); }else{ iterator.setSeisPoints(currentIterator.getSeisPoints()); iterator.setDrawnPixels(currentIterator.getDrawnPixels()); iterator.setTotalShift(currentIterator.getTotalShift() + shift); } iterator.setLeftoverPixels(pixels - shift); currentIterator = iterator; } | public void dragPlot(SeismogramShapeIterator iterator){ iterator.copyBasicInfo(currentIterator); double shiftPercentage = getShiftPercentage(currentIterator.getTime(), iterator.getTime()); double pixels = currentIterator.getSize().width * shiftPercentage + currentIterator.getLeftoverPixels(); //checks if the pixel shift is within 1/1000 of being an even pixel pixels *= 1000; pixels = Math.round(pixels); pixels /= 1000; int shift = 0; if(pixels >= 1){ shift = (int)Math.floor(pixels); drag(shift, 0, iterator); }else if(pixels <= -1){ shift = (int)Math.ceil(pixels); drag(shift, -shift, iterator); }else{ iterator.setSeisPoints(currentIterator.getSeisPoints()); iterator.setDrawnPixels(currentIterator.getDrawnPixels()); iterator.setTotalShift(currentIterator.getTotalShift() + shift); } iterator.setLeftoverPixels(pixels - shift); currentIterator = iterator; } |
int[] displayPixels = new int[2]; int[] seisPoints = iterator.getSeisPoints(); double pointsPerPixel = iterator.getPointsPerPixel(); int displayWidth = iterator.getSize().width; double seisPointRange = seisPoints[1] - seisPoints[0]; if(seisPoints[1] < 0 || seisPoints[0] > dss.getSeismogram().getNumPoints()){ displayPixels[0] = -1; displayPixels[1] = -1; iterator.setDrawnPixels(displayPixels); return displayPixels; } if(seisPoints[0] >= 0){ displayPixels[0] = 0; }else{ displayPixels[0] =(int)Math.round(-seisPoints[0]/pointsPerPixel); } if(seisPoints[1] < dss.getSeismogram().getNumPoints()){ displayPixels[1] = displayWidth - 1; }else{ displayPixels[1] = (int)Math.round((dss.getSeismogram().getNumPoints() - seisPoints[0])/ seisPointRange * displayWidth); } iterator.setDrawnPixels(displayPixels); return displayPixels; | int[] displayPixels = new int[2]; iterator.setDrawnPixels(displayPixels); int[] seisPoints = iterator.getSeisPoints(); double pointsPerPixel = iterator.getPointsPerPixel(); int displayWidth = iterator.getSize().width; double seisPointRange = seisPoints[1] - seisPoints[0]; if(seisPoints[1] < 0 || seisPoints[0] >= dss.getSeismogram().getNumPoints()){ return SeismogramShape.setArrayToNegativeOne(displayPixels); } if(seisPoints[0] >= 0){ displayPixels[0] = 0; }else{ displayPixels[0] =(int)Math.round(-seisPoints[0]/pointsPerPixel); if(displayPixels[0] == displayWidth){ return SeismogramShape.setArrayToNegativeOne(displayPixels); } } if(seisPoints[1] < dss.getSeismogram().getNumPoints()){ displayPixels[1] = displayWidth - 1; }else{ displayPixels[1] = (int)Math.round((dss.getSeismogram().getNumPoints() - seisPoints[0])/ seisPointRange * displayWidth); } iterator.setDrawnPixels(displayPixels); return displayPixels; | public int[] getPixels(SeismogramShapeIterator iterator){ int[] displayPixels = new int[2]; int[] seisPoints = iterator.getSeisPoints(); double pointsPerPixel = iterator.getPointsPerPixel(); int displayWidth = iterator.getSize().width; double seisPointRange = seisPoints[1] - seisPoints[0]; if(seisPoints[1] < 0 || seisPoints[0] > dss.getSeismogram().getNumPoints()){ displayPixels[0] = -1; displayPixels[1] = -1; iterator.setDrawnPixels(displayPixels); return displayPixels; } if(seisPoints[0] >= 0){ displayPixels[0] = 0; }else{ displayPixels[0] =(int)Math.round(-seisPoints[0]/pointsPerPixel); } if(seisPoints[1] < dss.getSeismogram().getNumPoints()){ displayPixels[1] = displayWidth - 1; }else{ displayPixels[1] = (int)Math.round((dss.getSeismogram().getNumPoints() - seisPoints[0])/ seisPointRange * displayWidth); } iterator.setDrawnPixels(displayPixels); return displayPixels; } |
iterator.setSeisPoints(DisplayUtils.getSeisPoints(dss.getSeismogram(), iterator.getTime())); iterator.setBaseSeisPoint(); iterator.setPointsPerPixel(); iterator.setPoints(new int[2][iterator.getSize().width]); plotPixels(iterator); currentIterator = iterator; | iterator.setSeisPoints(DisplayUtils.getSeisPoints(dss.getSeismogram(), iterator.getTime())); iterator.setBaseSeisPoint(); iterator.setPointsPerPixel(); if(iterator.getPointsPerPixel() <= 1){ compressPlot(iterator); }else{ iterator.setPoints(new int[2][iterator.getSize().width]); plotPixels(iterator); } currentIterator = iterator; | public void plot(SeismogramShapeIterator iterator){ // System.out.println("Plotting all points"); iterator.setSeisPoints(DisplayUtils.getSeisPoints(dss.getSeismogram(), iterator.getTime())); iterator.setBaseSeisPoint(); iterator.setPointsPerPixel(); iterator.setPoints(new int[2][iterator.getSize().width]); plotPixels(iterator); currentIterator = iterator; } |
UnitRangeImpl amp, Dimension size){ SeismogramShapeIterator newIterator = new SeismogramShapeIterator(time, amp, size); if(lessThanOnePointPerPixel(newIterator)){ }else if(newIterator.isDraggedFrom(currentIterator) && newIterator.hasSimilarAmp(currentIterator)){ dragPlot(newIterator); }else{ plot(newIterator); } | UnitRangeImpl amp, Dimension size){ SeismogramShapeIterator newIterator = new SeismogramShapeIterator(time, amp, size); if(newIterator.isDraggedFrom(currentIterator) && newIterator.hasSimilarAmp(currentIterator)){ dragPlot(newIterator); return; }else{ plot(newIterator); } | public void update(MicroSecondTimeRange time, UnitRangeImpl amp, Dimension size){ SeismogramShapeIterator newIterator = new SeismogramShapeIterator(time, amp, size); if(lessThanOnePointPerPixel(newIterator)){ //compressPlot(newIterator); }else if(newIterator.isDraggedFrom(currentIterator) && newIterator.hasSimilarAmp(currentIterator)){ dragPlot(newIterator); }else{ plot(newIterator); } } |
return 2; } BwPreferences prefs = getUserPrefs(val.getOwner()); if (val.equals(prefs.getDefaultCalendar())) { | public int deleteCalendar(BwCalendar val) throws CalFacadeException { /** Only allow delete if not in use */ if (getCal().checkCalendarRefs(val)) { return 2; } if (pars.getPublicAdmin()) { /* Remove from preferences */ getUserAuth().removeCalendar(null, val); } /* Attempt to delete */ if (getCal().deleteCalendar(val)) { return 0; } return 1; //doesn't exist } |
|
public BwCalSuiteWrapper getCalSuite(String name) throws CalFacadeException { return dbi.getCalSuite(name); | public BwCalSuiteWrapper getCalSuite() throws CalFacadeException { return currentCalSuite; | public BwCalSuiteWrapper getCalSuite(String name) throws CalFacadeException { return dbi.getCalSuite(name); } |
if (pars.isGuest() && (pars.getUser() == null)) { pars.setUser(env.getAppProperty("run.as.user")); } | public void init(CalSvcIPars parsParam) throws CalFacadeException { pars = (CalSvcIPars)parsParam.clone(); debug = pars.getDebug(); //if (userAuth != null) { // userAuth.reinitialise(getUserAuthCallBack()); //} if (userGroups != null) { userGroups.init(getGroupsCallBack()); } if (adminGroups != null) { adminGroups.init(getGroupsCallBack()); } try { env = new CalEnv(pars.getEnvPrefix(), debug); if (pars.isGuest() && (pars.getUser() == null)) { pars.setUser(env.getAppProperty("run.as.user")); } if (pars.getPublicAdmin()) { //adminAutoDeleteSponsors = env.getAppBoolProperty("app.autodeletesponsors"); //adminAutoDeleteLocations = env.getAppBoolProperty("app.autodeletelocations"); adminCanEditAllPublicCategories = env.getAppBoolProperty("allowEditAllCategories"); adminCanEditAllPublicLocations = env.getAppBoolProperty("allowEditAllLocations"); adminCanEditAllPublicSponsors = env.getAppBoolProperty("allowEditAllSponsors"); } timezones = getCal().getTimezones(); /* Nominate our timezone registry */ System.setProperty("net.fortuna.ical4j.timezone.registry", "org.bedework.icalendar.TimeZoneRegistryFactoryImpl"); } catch (CalFacadeException cfe) { throw cfe; } catch (Throwable t) { throw new CalFacadeException(t); } } |
|
" def Factory := jlobby.edu.vub.at.objects.mirrors.NATMirrorFactory.INSTANCE; \n" + | " def Factory := object: {" + " def createMirror(o) { reflect: o }" + " }" + | protected void setUp() throws Exception { super.setUp(); evalAndReturn( "def at := object: { \n" + " def mirrors := object: { \n" + " def Factory := jlobby.edu.vub.at.objects.mirrors.NATMirrorFactory.INSTANCE; \n" + " }; \n" + " def unit := object: { \n" + " def XUnitFailed := object: { \n" + " def message := \"Unittest Failed\"; \n" + " def init(@args) { \n" + " if: (args.length > 0) then: { \n" + " message := args[1]; \n" + " } \n" + " } \n" + " }; \n" + " def fail( message ) { raise: XUnitFailed.new( message ) }; \n" + " }; \n" + "}; \n" + "\n" + "def symbol( text ) { jlobby.edu.vub.at.objects.natives.grammar.AGSymbol.alloc( text ) }; \n"); } |
NATTable.EMPTY, new NATIntrospectiveMirror(NATNil._INSTANCE_), | NATTable.EMPTY, NATIntrospectiveMirror.atValue(NATNil._INSTANCE_), | public void testJavaMirrorBaseRelation() { try { ATObject[] objects = new ATObject[] { NATNil._INSTANCE_, NATBoolean._TRUE_, NATNumber.ZERO, new NATObject(), new NATSuperObject(new NATObject(), Evaluator.getGlobalLexicalScope()), NATTable.EMPTY, new NATIntrospectiveMirror(NATNil._INSTANCE_), new NATIntercessiveMirror(Evaluator.getGlobalLexicalScope(), true) }; ATMirror[] mirrors = new ATMirror[objects.length]; for (int i = 0; i < objects.length; i++) { mirrors[i] = NATMirrorFactory._INSTANCE_.createMirror(objects[i]); } for (int i = 0; i < objects.length; i++) { assertEquals(objects[i], mirrors[i].base_getBase()); }// TODO(discuss) should NATIntrospectiveMirrors be unique? // (requires a map or every object has a lazily initialised pointer)// for (int i = 0; i < objects.length; i++) {// assertEquals(mirrors[i], NATMirrorFactory._INSTANCE_.createMirror(objects[i]));// } } catch (InterpreterException e) { fail(e.getMessage()); } } |
mirrors[i] = NATMirrorFactory._INSTANCE_.createMirror(objects[i]); | mirrors[i] = NATIntrospectiveMirror.atValue(objects[i]); | public void testJavaMirrorBaseRelation() { try { ATObject[] objects = new ATObject[] { NATNil._INSTANCE_, NATBoolean._TRUE_, NATNumber.ZERO, new NATObject(), new NATSuperObject(new NATObject(), Evaluator.getGlobalLexicalScope()), NATTable.EMPTY, new NATIntrospectiveMirror(NATNil._INSTANCE_), new NATIntercessiveMirror(Evaluator.getGlobalLexicalScope(), true) }; ATMirror[] mirrors = new ATMirror[objects.length]; for (int i = 0; i < objects.length; i++) { mirrors[i] = NATMirrorFactory._INSTANCE_.createMirror(objects[i]); } for (int i = 0; i < objects.length; i++) { assertEquals(objects[i], mirrors[i].base_getBase()); }// TODO(discuss) should NATIntrospectiveMirrors be unique? // (requires a map or every object has a lazily initialised pointer)// for (int i = 0; i < objects.length; i++) {// assertEquals(mirrors[i], NATMirrorFactory._INSTANCE_.createMirror(objects[i]));// } } catch (InterpreterException e) { fail(e.getMessage()); } } |
ATMirror trueMirror = NATMirrorFactory._INSTANCE_.createMirror(NATBoolean._TRUE_); | ATMirror trueMirror = NATIntrospectiveMirror.atValue(NATBoolean._TRUE_); | public void testJavaMirrorInvocation() { try { ATMirror trueMirror = NATMirrorFactory._INSTANCE_.createMirror(NATBoolean._TRUE_); ATMirror responds = (ATMirror)trueMirror.meta_invoke( trueMirror, AGSymbol.jAlloc("respondsTo"), NATTable.atValue(new ATObject[] { AGSymbol.jAlloc("ifTrue:") })); responds.base_getBase().base_asBoolean().base_ifFalse_(new NativeClosure(NATNil._INSTANCE_) { public ATObject base_apply(ATTable arguments) throws InterpreterException { throw new XUserDefined(NATNil._INSTANCE_); } }); } catch (InterpreterException e) { e.printStackTrace(); fail("exception: "+ e); } } |
err.emit("org.bedework.pubevents.error.missingfield", "Category"); | err.emit("org.bedework.client.error.missingfield", "Category"); | public boolean validateCategory() throws Throwable { boolean ok = true; BwCategory k = getCategory(); k.setWord(Util.checkNull(k.getWord())); k.setDescription(Util.checkNull(k.getDescription())); if (k.getWord() == null) { err.emit("org.bedework.pubevents.error.missingfield", "Category"); ok = false; } return ok; } |
err.emit("org.bedework.pubevents.error.missingfield", "Calendar"); | err.emit("org.bedework.client.error.missingfield", "Calendar"); | public boolean validateEventCalendar() { boolean ok = true; if (!calendarId.getChanged()) { if (event.getCalendar() == null) { err.emit("org.bedework.pubevents.error.missingfield", "Calendar"); return false; } return ok; } // The user selected one from the list try { int id = calendarId.getVal(); BwCalendar c = getCalSvcI().getCalendar(id); if ((c == null) || !c.getPublick() || !c.getCalendarCollection()) { // Somebody's faking setCalendar(null); err.emit("org.bedework.pubevents.error.missingfield", "Calendar"); return false; } getEvent().setCalendar(c); setCalendar(c); return true; } catch (Throwable t) { err.emit(t); return false; } } |
err.emit("org.bedework.pubevents.error.missingfield", "Category"); | err.emit("org.bedework.client.error.missingfield", "Category"); | public boolean validateEventCategory() throws Throwable { int id = keyId.getVal(); if (id <= 0) { if (getEnv().getAppBoolProperty("app.categoryOptional")) { return true; } err.emit("org.bedework.pubevents.error.missingfield", "Category"); return false; } try { BwCategory k = getCalSvcI().getCategory(id); if (k == null) { err.emit("org.bedework.pubevents.error.missingcategory", id); return false; } if (!keyId.getChanged()) { return true; }// oldCategory = getEvent().getCategory(0); /* Currently we replace the only category if it exists */ BwEvent ev = getEvent(); ev.clearCategories(); ev.addCategory(k); setCategory(k); return true; } catch (Throwable t) { err.emit(t); return false; } } |
err.emit("org.bedework.pubevents.error.missingcategory", id); | err.emit("org.bedework.client.error.missingcategory", id); | public boolean validateEventCategory() throws Throwable { int id = keyId.getVal(); if (id <= 0) { if (getEnv().getAppBoolProperty("app.categoryOptional")) { return true; } err.emit("org.bedework.pubevents.error.missingfield", "Category"); return false; } try { BwCategory k = getCalSvcI().getCategory(id); if (k == null) { err.emit("org.bedework.pubevents.error.missingcategory", id); return false; } if (!keyId.getChanged()) { return true; }// oldCategory = getEvent().getCategory(0); /* Currently we replace the only category if it exists */ BwEvent ev = getEvent(); ev.clearCategories(); ev.addCategory(k); setCategory(k); return true; } catch (Throwable t) { err.emit(t); return false; } } |
err.emit("org.bedework.pubevents.error.missingfield", "Location"); | err.emit("org.bedework.client.error.missingfield", "Location"); | public boolean validateEventLocation() throws Throwable { boolean ok = true; if (!locId.getChanged()) { if (getAutoCreateLocations()) { BwLocation l = getLocation(); if (!BwWebUtil.validateLocation(l, err)) { return false; } getCalSvcI().ensureLocationExists(l); setLocation(l); getEvent().setLocation(l); } if (event.getLocation() == null) { err.emit("org.bedework.pubevents.error.missingfield", "Location"); return false; } return ok; } // The user selected one from the list try { int id = locId.getVal(); BwLocation l = getCalSvcI().getLocation(id); if ((l == null) || !l.getPublick()) { // Somebody's faking setLocation(null); err.emit("org.bedework.pubevents.error.missingfield", "Location"); return false; } getEvent().setLocation(l); setLocation(l); return true; } catch (Throwable t) { err.emit(t); return false; } } |
err.emit("org.bedework.pubevents.error.missingfield", "Sponsor"); | err.emit("org.bedework.client.error.missingfield", "Sponsor"); | public boolean validateEventSponsor() throws Throwable { boolean ok = true; if (!spId.getChanged()) { if (getAutoCreateSponsors()) { BwSponsor s = getSponsor(); if (!BwWebUtil.validateSponsor(s, err)) { return false; } getCalSvcI().ensureSponsorExists(s); setSponsor(s); getEvent().setSponsor(s); } if (event.getSponsor() == null) { err.emit("org.bedework.pubevents.error.missingfield", "Sponsor"); return false; } return ok; } // The user selected one from the list int id = spId.getVal(); try { BwSponsor s = getCalSvcI().getSponsor(id); if (s == null) { // Somebody's faking setSponsor(null); err.emit("org.bedework.pubevents.error.missingfield", "Sponsor"); return false; } getEvent().setSponsor(s); setSponsor(s); return true; } catch (Throwable t) { err.emit(t); return false; } } |
public IntSelectId(int originalValue, int preferred) { reset(originalValue, preferred); | public IntSelectId(int originalValue) { this.originalValue = originalValue; this.newValue = originalValue; | public IntSelectId(int originalValue, int preferred) { reset(originalValue, preferred); } |
appendHeader(doc, seis.getName()); | appendHeader(doc, dss.getName()); | public void addSeismogram(DataSetSeismogram dss){ HashMap values = new HashMap(); Document doc = getDocument(); try{ appendLine(doc, ""); LocalSeismogramImpl seis = dss.getSeismogram(); appendHeader(doc, seis.getName()); values.put("Number of Points", twoDecimal.format(seis.getNumPoints())); values.put("ID", seis.get_id()); values.put("Sampling", "" + seis.getSampling()); values.put("Channel ID", ChannelIdUtil.toString(seis.getChannelID())); values.put("Begin Time", "" + seis.getBeginTime()); values.put("End Time" , "" + seis.getEndTime()); values.put("Minimum Value", "" + seis.getMinValue()); values.put("Maximum Value", "" + seis.getMaxValue()); values.put("Mean Value", "" + seis.getMeanValue()); Iterator e = format.iterator(); while(e.hasNext()){ String current = (String)e.next(); appendLabelValue(doc, current, (String)values.get(current)); } } catch(Exception e){ e.printStackTrace(); } } |
if (totalWidth > DynamicReportDesign.PAGE_WIDTH_WITHOUT_MARGINS_PORTRAIT_A4) { design.setOrientationLandscape(); int landscapeWidth = (totalWidth > DynamicReportDesign.PAGE_WIDTH_WITHOUT_MARGINS_LANDSCAPE_A4) ? totalWidth + DynamicReportDesign.PAGE_LEFT_MARGIN + DynamicReportDesign.PAGE_RIGHT_MARGIN : DynamicReportDesign.PAGE_WIDTH_LANDSCAPE_A4; design.setPageWidth(landscapeWidth); design.setPageHeight(DynamicReportDesign.PAGE_HEIGHT_LANDSCAPE_A4); } | public DesignBox getDynamicDesignBox(SQLQuery query, IWResourceBundle resourceBundle, IWContext iwc) throws IOException, JRException { final int columnSpacing = 15; final int columnWidth = 120; final int labelWidth = 95; final int valueWidth = 55; Map parameterMap = new HashMap(); DynamicReportDesign design = DynamicReportDesign.getInstanceThatShowsDateAndUser("GeneratedDesign"); // add date Date date = new Date(); String pattern = "dd.MM.yyyy, HH:mm"; SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); String formatedDate = dateFormat.format(date); parameterMap.put(DynamicReportDesign.PRM_DATE, formatedDate); // add user User user = iwc.getCurrentUser(); String userName = user.getName(); parameterMap.put(DynamicReportDesign.PRM_USER, userName); //set title String queryName = query.getName(); parameterMap.put(DynamicReportDesign.PRM_REPORT_NAME, queryName); // set total width List fields = query.getFields(); int totalWidth = 0; if (! fields.isEmpty()) { totalWidth = ((columnSpacing + columnWidth) * fields.size()) - columnSpacing; } design.setColumnWidth(totalWidth); // set fields Iterator fieldIterator = fields.iterator(); while (fieldIterator.hasNext()) { QueryFieldPart fieldPart = (QueryFieldPart) fieldIterator.next(); String fieldName = fieldPart.getName(); String type = fieldPart.getTypeClass(); parameterMap.put(fieldName, resourceBundle.getLocalizedString(fieldName, fieldName)); design.addField(fieldName, type, columnWidth); } // add fields for values and descriptions of the dynamic fields to header Map identifierInputDescriptionMap = query.getIdentifierInputDescriptionMap(); Map identifierValueMap = query.getIdentifierValueMap(); Iterator iterator = identifierInputDescriptionMap.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); String identifier = entry.getKey().toString(); if ( ! (DirectSQLStatement.USER_ACCESS_VARIABLE.equals(identifier) || DirectSQLStatement.GROUP_ACCESS_VARIABLE.equals(identifier))) { InputDescription inputDescription = (InputDescription) entry.getValue(); List inputValues = (List) identifierValueMap.get(identifier); // get handler String inputHandlerClassName = inputDescription.getHandlerDescription(); String inputValueDisplay = null; if (inputHandlerClassName != null) { try { Class inputHandlerClass = Class.forName(inputHandlerClassName); InputHandler inputHandler = (InputHandler) inputHandlerClass.newInstance(); String[] inputValuesAsArray = (String[]) inputValues.toArray(new String[0]); // method below throws Exception Object resultingObject = inputHandler.getResultingObject(inputValuesAsArray, iwc); inputValueDisplay = inputHandler.getDisplayNameOfValue(resultingObject, iwc); } catch (ClassNotFoundException classEx) { logError("[JasperReportBusiness] Inputhandler class could not be found"); log(classEx); inputValueDisplay = inputValues.toString(); } catch (InstantiationException insEx) { logError("[JasperReportBusiness] Inputhandler class could not be instanciated"); log(insEx); inputValueDisplay = inputValues.toString(); } catch (IllegalAccessException accEx) { logError("[JasperReportBusiness] Inputhandler class could not be instanciated"); log(accEx); inputValueDisplay = inputValues.toString(); } catch (Exception ex) { logError("[JasperReportBusiness] Resulting object could not be fetched"); log(ex); inputValueDisplay = inputValues.toString(); } } else { StringBuffer buffer = new StringBuffer(); Iterator inputIterator = inputValues.iterator(); boolean firstTime = true; while (inputIterator.hasNext()) { if (! firstTime) { buffer.append(", "); } else { firstTime = false; } buffer.append(inputIterator.next().toString()); } inputValueDisplay = buffer.toString(); } String description = inputDescription.getDescription(); int descriptionWidth = (description == null) ? labelWidth : calculateTextFieldWidthForString(description); int inputValueDisplayWidth = (inputValueDisplay == null) ? valueWidth : calculateTextFieldWidthForString(inputValueDisplay); String descriptionWithPrefix = StringHandler.concat(SQLQuery.DYNAMIC_FIELD_DESCRIPTION_PREFIX, identifier); String inputValueDisplayWithPrefix = StringHandler.concat(SQLQuery.DYNAMIC_FIELD_VALUE_PREFIX, identifier); parameterMap.put(descriptionWithPrefix, description); parameterMap.put(inputValueDisplayWithPrefix, inputValueDisplay); design.addHeaderParameter(descriptionWithPrefix, descriptionWidth, inputValueDisplayWithPrefix, String.class, inputValueDisplayWidth); } } design.close(); JasperDesign jasperDesign = design.getJasperDesign(iwc); DesignBox designBox = new DesignBox(); designBox.setDesign(jasperDesign); designBox.setParameterMap(parameterMap); return designBox; } |
|
seis.setName(seisName); URLDataSetSeismogram urlDSS = new URLDataSetSeismogram(seisURL, SeismogramFileTypes.SAC, dataset); urlDSS.addToCache(seisURL, SeismogramFileTypes.SAC, seis); | System.out.println("seis name="+seisName+" url="+seisURL); MemoryDataSetSeismogram memDSS = new MemoryDataSetSeismogram(seis, dataset, seisName); | void loadSacFile(Element dsElement, File sacFile) throws IOException, FissuresException { if (excludes.contains(sacFile.getName())) { return; } // end of if (excludes.contains(sacFile.getName())) if (paramRefs.containsValue(sacFile.getName())) { return; } // end of if (excludes.contains(sacFile.getName())) SacTimeSeries sac = new SacTimeSeries(); sac.read(sacFile.getCanonicalPath()); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName+" via SacDirToDataSet", "seismogram loaded from "+sacFile.getCanonicalPath()); URL seisURL = new URL(dirURL, sacFile.getName()); // System.out.println(" the seisURL is "+seisURL.toString()); // DataInputStream dis = new DataInputStream(new BufferedInputStream(seisURL.openStream())); // SacTimeSeries sac = new SacTimeSeries(); //sac.read(dis); edu.iris.Fissures.seismogramDC.LocalSeismogramImpl seis = SacToFissures.getSeismogram(sac); System.out.println("The PATH is "+sacFile.getParent()); edu.sc.seis.fissuresUtil.cache.CacheEvent event = SacToFissures.getEvent(sac); if (event != null && dataset.getParameter(EVENT) == null) { String eventName = event.get_attributes().name; String eName = eventName.replace(' ', '_'); Element paramElement = dsElement.getOwnerDocument().createElement("parameter"); dsElement.appendChild(paramElement); dataSetToXML.insert(paramElement, StdDataSetParamNames.EVENT, event); AuditInfo[] eventAudit = new AuditInfo[1]; eventAudit[0] = new AuditInfo(System.getProperty("user.name"), "event loaded from sac file."); dataset.addParameter(StdDataSetParamNames.EVENT, event, eventAudit); } // end of if (event != null) Channel channel = SacToFissures.getChannel(sac); String channelParamName = StdDataSetParamNames.CHANNEL+ChannelIdUtil.toString(seis.channel_id); if (channel != null && dataset.getParameter(channelParamName) == null) { // add channel AuditInfo[] chanAudit = new AuditInfo[1]; chanAudit[0] = new AuditInfo(System.getProperty("user.name"), "channel loaded from sac file."); dataset.addParameter(channelParamName, channel, chanAudit); Element paramElement = dsElement.getOwnerDocument().createElement("parameter"); dsElement.appendChild(paramElement); dataSetToXML.insert(paramElement, channelParamName, channel); } String seisName = sacFile.getName(); if (seisName.endsWith(".SAC")) { seisName = seisName.substring(0,seisName.length()-4); } // end of if (seisName.endsWith(".SAC")) seis.setName(seisName); URLDataSetSeismogram urlDSS = new URLDataSetSeismogram(seisURL, SeismogramFileTypes.SAC, dataset); urlDSS.addToCache(seisURL, SeismogramFileTypes.SAC, seis); AuditInfo[] seisAudit = new AuditInfo[1]; seisAudit[0] = new AuditInfo(System.getProperty("user.name"), "seismogram loaded from sac file."); dataset.addDataSetSeismogram(urlDSS, seisAudit); } |
dataset.addDataSetSeismogram(urlDSS, seisAudit); | dataset.addDataSetSeismogram(memDSS, seisAudit); System.out.println("Done with "+seisName); | void loadSacFile(Element dsElement, File sacFile) throws IOException, FissuresException { if (excludes.contains(sacFile.getName())) { return; } // end of if (excludes.contains(sacFile.getName())) if (paramRefs.containsValue(sacFile.getName())) { return; } // end of if (excludes.contains(sacFile.getName())) SacTimeSeries sac = new SacTimeSeries(); sac.read(sacFile.getCanonicalPath()); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName+" via SacDirToDataSet", "seismogram loaded from "+sacFile.getCanonicalPath()); URL seisURL = new URL(dirURL, sacFile.getName()); // System.out.println(" the seisURL is "+seisURL.toString()); // DataInputStream dis = new DataInputStream(new BufferedInputStream(seisURL.openStream())); // SacTimeSeries sac = new SacTimeSeries(); //sac.read(dis); edu.iris.Fissures.seismogramDC.LocalSeismogramImpl seis = SacToFissures.getSeismogram(sac); System.out.println("The PATH is "+sacFile.getParent()); edu.sc.seis.fissuresUtil.cache.CacheEvent event = SacToFissures.getEvent(sac); if (event != null && dataset.getParameter(EVENT) == null) { String eventName = event.get_attributes().name; String eName = eventName.replace(' ', '_'); Element paramElement = dsElement.getOwnerDocument().createElement("parameter"); dsElement.appendChild(paramElement); dataSetToXML.insert(paramElement, StdDataSetParamNames.EVENT, event); AuditInfo[] eventAudit = new AuditInfo[1]; eventAudit[0] = new AuditInfo(System.getProperty("user.name"), "event loaded from sac file."); dataset.addParameter(StdDataSetParamNames.EVENT, event, eventAudit); } // end of if (event != null) Channel channel = SacToFissures.getChannel(sac); String channelParamName = StdDataSetParamNames.CHANNEL+ChannelIdUtil.toString(seis.channel_id); if (channel != null && dataset.getParameter(channelParamName) == null) { // add channel AuditInfo[] chanAudit = new AuditInfo[1]; chanAudit[0] = new AuditInfo(System.getProperty("user.name"), "channel loaded from sac file."); dataset.addParameter(channelParamName, channel, chanAudit); Element paramElement = dsElement.getOwnerDocument().createElement("parameter"); dsElement.appendChild(paramElement); dataSetToXML.insert(paramElement, channelParamName, channel); } String seisName = sacFile.getName(); if (seisName.endsWith(".SAC")) { seisName = seisName.substring(0,seisName.length()-4); } // end of if (seisName.endsWith(".SAC")) seis.setName(seisName); URLDataSetSeismogram urlDSS = new URLDataSetSeismogram(seisURL, SeismogramFileTypes.SAC, dataset); urlDSS.addToCache(seisURL, SeismogramFileTypes.SAC, seis); AuditInfo[] seisAudit = new AuditInfo[1]; seisAudit[0] = new AuditInfo(System.getProperty("user.name"), "seismogram loaded from sac file."); dataset.addDataSetSeismogram(urlDSS, seisAudit); } |
if (dirName != null && f.isDirectory()) { SacDirToDataSet sdir = new SacDirToDataSet(base, f, dsName, excludes, params); sdir.process(); } else { System.err.println("Not a directory: "+args[1]); } | if (dirName != null) { if ( ! f.exists()) { f.mkdirs(); } if ( f.isDirectory()) { SacDirToDataSet sdir = new SacDirToDataSet(base, f, dsName, excludes, params); sdir.process(); } else { System.err.println("Not a directory: "+args[1]); } } | public static void main (String[] args) { if (args.length < 4) { System.err.println("Usage: java edu.sc.seis.fissuresUtil.sac.SacDirToDataSet -base url -dir directoryPath -name datasetname [-exclude file] [-paramRef name file]"); return; } // end of if (args.length != 2) String dirName = null; URL base = null; String baseStr = ""; String dsName = "default dataset name"; LinkedList excludes = new LinkedList(); HashMap params = new HashMap(); int i=0; while (i<args.length) { System.out.println(i+" "+args[i]); if (args[i].equals("-dir")) { dirName = args[i+1]; i+=2; } else if (args[i].equals("-name")) { String tmp = args[i+1]; if (tmp.endsWith("/") || tmp.endsWith("\\") || tmp.endsWith(":") || tmp.endsWith(".") ) { tmp = tmp.substring(0, tmp.length()-1); } // end of if (dsName.endsWith('/')) tmp = tmp.replace(' ','_'); if (tmp.length() > 0) { dsName = tmp; } // end of if (tmp.length() > 0) i+=2; } else if (args[i].equals("-base")) { baseStr = args[i+1]; System.out.println("The baseStr is "+baseStr); i+=2; } else if (args[i].equals("-exclude")) { excludes.add(args[i+1]); i+=2; } else if (args[i].equals("-paramRef")) { params.put(args[i+1], args[i+2]); i+=3; } else { System.out.println("Don't understand "+args[i++]); } } // end of for (int i=0; i<args.length; i++) try { base = new URL(baseStr); System.out.println("base is "+base.toString()); File f = new File(dirName); if (dirName != null && f.isDirectory()) { SacDirToDataSet sdir = new SacDirToDataSet(base, f, dsName, excludes, params); sdir.process(); } else { System.err.println("Not a directory: "+args[1]); } // end of else } catch (Exception e) { e.printStackTrace(); } // end of try-catch } // end of main () |
System.out.println("Process "+filename); | void process() throws ParserConfigurationException, MalformedURLException, IOException { dirURL = base; System.out.println(" dirURL is "+dirURL.toString()); System.out.println(" directory name is "+directory.getName()); dirURL = new URL(dirURL.toString()+"/"+directory.getName()+"/"); System.out.println("updated dirURL is "+dirURL.toString()); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName, "Dataset created from SAC files in "+directory.getPath()); dataset = new MemoryDataSet("genid"+Math.round(Math.random()*Integer.MAX_VALUE), dsName, userName, audit); Element dsElement = dataSetToXML.createDocument(dataset, directory, SeismogramFileTypes.SAC); Iterator it = paramRefs.keySet().iterator(); while (it.hasNext()) { String key = (String)it.next(); //loadParameterRef(key, (String)paramRefs.get(key)); } // end of while (it.hasNext()) File[] files = directory.listFiles(); for (int i=0; i<files.length; i++) { try { String filename = files[i].getName(); // maybe an image? if (filename.endsWith(".gif") || filename.endsWith(".GIF") || filename.endsWith(".png") || filename.endsWith(".PNG") || filename.endsWith(".jpeg") || filename.endsWith(".JPEG") || filename.endsWith(".jpg") || filename.endsWith(".JPG") ) { String name = filename.substring(0, filename.lastIndexOf('.')); loadParameterRef(dsElement, filename, filename); } else { // try as a sac file loadSacFile(dsElement, files[i]); } // end of else } catch (Exception e) { e.printStackTrace(); System.err.println("Caught exception on " +files[i].getName()+", continuing..."); } // end of try-catch } // end of for (int i=0; i<sacFiles.length; i++) dataSetToXML.save(dataset, directory, SeismogramFileTypes.SAC); } |
|
while(i < seismos.size() && ((String)seismos.get(i)).compareToIgnoreCase(name) < 0){ | while(i < names.size() && ((String)names.get(i)).compareToIgnoreCase(name) < 0){ | public int sort(DataSetSeismogram seismo, String name){ int i = 0; while(i < seismos.size() && ((String)seismos.get(i)).compareToIgnoreCase(name) < 0){ i++; } seismos.add(i, name); return i; } |
seismos.add(i, name); | names.add(i, name); | public int sort(DataSetSeismogram seismo, String name){ int i = 0; while(i < seismos.size() && ((String)seismos.get(i)).compareToIgnoreCase(name) < 0){ i++; } seismos.add(i, name); return i; } |
customClosure_.meta_defineField(AGSymbol.alloc("apply"), new NativeClosure(customClosure_) { | customClosure_.meta_defineField(AGSymbol.jAlloc("apply"), new NativeClosure(customClosure_) { | public void setUp() { try { customClosure_ = new NATObject(); customClosure_.meta_defineField(AGSymbol.alloc("apply"), new NativeClosure(customClosure_) { public ATObject base_apply(ATTable args) throws InterpreterException { ATTable apply_args = get(args, 1).base_asTable(); assertEquals(42, getNbr(apply_args, 1)); return NATNil._INSTANCE_; } }); customClosure_.meta_defineField(AGSymbol.alloc("method"), new NATMethod(AGSymbol.alloc("foo"), NATTable.EMPTY, new AGBegin(NATTable.EMPTY))); customContext_ = new NATObject(); customContext_.meta_defineField(AGSymbol.alloc("self"), NATNumber.atValue(24)); customClosure_.meta_defineField(AGSymbol.alloc("context"), customContext_); } catch (InterpreterException e) { fail(e.getMessage()); } } |
customClosure_.meta_defineField(AGSymbol.alloc("method"), new NATMethod(AGSymbol.alloc("foo"), NATTable.EMPTY, new AGBegin(NATTable.EMPTY))); | customClosure_.meta_defineField(AGSymbol.jAlloc("method"), new NATMethod(AGSymbol.jAlloc("foo"), NATTable.EMPTY, new AGBegin(NATTable.EMPTY))); | public void setUp() { try { customClosure_ = new NATObject(); customClosure_.meta_defineField(AGSymbol.alloc("apply"), new NativeClosure(customClosure_) { public ATObject base_apply(ATTable args) throws InterpreterException { ATTable apply_args = get(args, 1).base_asTable(); assertEquals(42, getNbr(apply_args, 1)); return NATNil._INSTANCE_; } }); customClosure_.meta_defineField(AGSymbol.alloc("method"), new NATMethod(AGSymbol.alloc("foo"), NATTable.EMPTY, new AGBegin(NATTable.EMPTY))); customContext_ = new NATObject(); customContext_.meta_defineField(AGSymbol.alloc("self"), NATNumber.atValue(24)); customClosure_.meta_defineField(AGSymbol.alloc("context"), customContext_); } catch (InterpreterException e) { fail(e.getMessage()); } } |
customContext_.meta_defineField(AGSymbol.alloc("self"), NATNumber.atValue(24)); customClosure_.meta_defineField(AGSymbol.alloc("context"), customContext_); | customContext_.meta_defineField(AGSymbol.jAlloc("self"), NATNumber.atValue(24)); customClosure_.meta_defineField(AGSymbol.jAlloc("context"), customContext_); | public void setUp() { try { customClosure_ = new NATObject(); customClosure_.meta_defineField(AGSymbol.alloc("apply"), new NativeClosure(customClosure_) { public ATObject base_apply(ATTable args) throws InterpreterException { ATTable apply_args = get(args, 1).base_asTable(); assertEquals(42, getNbr(apply_args, 1)); return NATNil._INSTANCE_; } }); customClosure_.meta_defineField(AGSymbol.alloc("method"), new NATMethod(AGSymbol.alloc("foo"), NATTable.EMPTY, new AGBegin(NATTable.EMPTY))); customContext_ = new NATObject(); customContext_.meta_defineField(AGSymbol.alloc("self"), NATNumber.atValue(24)); customClosure_.meta_defineField(AGSymbol.alloc("context"), customContext_); } catch (InterpreterException e) { fail(e.getMessage()); } } |
assertTrue(coercedObject.meta_respondsTo(AGSymbol.alloc("apply")).asNativeBoolean().javaValue); | assertTrue(coercedObject.meta_respondsTo(AGSymbol.jAlloc("apply")).asNativeBoolean().javaValue); | public void testCoercedMetalevelInvocation() { try { ATClosure coercedObject = customClosure_.base_asClosure(); assertTrue(coercedObject.meta_respondsTo(AGSymbol.alloc("apply")).asNativeBoolean().javaValue); } catch (InterpreterException e) { fail(e.getMessage()); } } |
out.close(); | protected void appendToIndexFile(File errorFile, Throwable t) throws IOException { File index = new File(directory, "index.html"); BufferedWriter out = new BufferedWriter(new FileWriter(index, true)); writeln(out, new MicroSecondDate()+" <a href="+'"'+errorFile.getName()+'"'+">"+t.getClass().getName()+"</a><br/>"); } |
|
initialBit += "<br/>\n" + constructString((Section)it.next()); | initialBit += "<hr/><br/>\n" + constructString((Section)it.next()); | private String constructString(String initialBit, List sections){ Iterator it = sections.iterator(); while(it.hasNext()){ initialBit += "<br/>\n" + constructString((Section)it.next()); } return initialBit; } |
return "<hline/>"; | return "<hr/>"; | private String makeDivider(int len){ return "<hline/>"; } |
str += stackTrace + "<pre>"+makeDivider(stackTrace.length()) + ExceptionReporterUtils.getTrace(e)+"</pre>"; | str += stackTrace +makeDivider(stackTrace.length()) + "<pre>"+ ExceptionReporterUtils.getTrace(e)+"</pre>"; | public void report(String message, Throwable e, List sections) throws IOException{ File outFile = new File(directory, "Exception_"+lastFileNum+".html"); appendToIndexFile(outFile, e); BufferedWriter bw = new BufferedWriter(new FileWriter(outFile)); String str = getHeader(e, lastFileNum); str += message; str += "\n<br/>\n<br/>\n"; String stackTrace = "<h2>Stack Trace</h2><br/>"; str += stackTrace + "<pre>"+makeDivider(stackTrace.length()) + ExceptionReporterUtils.getTrace(e)+"</pre>"; bw.write(constructString(str, sections)); bw.close(); lastFileNum++; } |
public abstract BwCalSuiteWrapper getCalSuite(String name) throws CalFacadeException; | public abstract BwCalSuiteWrapper getCalSuite() throws CalFacadeException; | public abstract BwCalSuiteWrapper getCalSuite(String name) throws CalFacadeException; |
EventInfo ei = form.fetchSvci().getEvent(event.getId()); | EventInfo ei = fetchEvent(event, form); | public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } BwEvent event = form.getEditEvent(); reqpar = request.getParameter("copy"); if (reqpar != null) { /* Refetch the event and switch it for a cloned copy. * guid must be set to null to avoid dup guid. */ EventInfo ei = form.fetchSvci().getEvent(event.getId()); BwEvent evcopy = new BwEventObj(); ei.getEvent().shallowCopyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); evcopy.setGuid(null); if (debug) { BwLocation l = evcopy.getLocation(); if (l == null) { debugMsg("Copied event has null location"); } else { debugMsg("Copied event has location with id " + l.getId()); } } ei.setEvent(evcopy); form.setEventInfo(ei); resetEvent(form); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form, svci, event, form.getErr())) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ event.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(event.getCalendar(), event, null); } else { svci.updateEvent(event); } if (!alerts) { updateAuthPrefs(form, event.getCategories(), event.getSponsor(), event.getLocation(), event.getCalendar()); } resetEvent(form); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } form.assignAddingEvent(false); return "continue"; } |
if (currentPopup != null){ currentPopup.setVisible(false); currentPopup = null; } | maybeKillCurrentPopup(); | public boolean mouseClicked(MouseEvent e){ if (currentPopup != null){ currentPopup.setVisible(false); currentPopup = null; } List stationsUnderMouse = new ArrayList(); synchronized(omgraphics){ Iterator it = omgraphics.iterator(); while(it.hasNext()){ OMStation current = (OMStation)it.next(); if(current.contains(e.getX(), e.getY())){ stationsUnderMouse.add(current.getStation()); } } } if (stationsUnderMouse.size() > 0){ if (stationsUnderMouse.size() > 1){ final JPopupMenu popup = new JPopupMenu(); Iterator it = stationsUnderMouse.iterator(); while (it.hasNext()){ final Station current = (Station)it.next(); final JMenuItem menuItem = new JMenuItem(getStationInfo(current, currentEvent)); menuItem.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { toggleStationSelection(current); popup.setVisible(false); } }); menuItem.addMouseListener(new MouseAdapter(){ public void mouseEntered(MouseEvent e) { menuItem.setArmed(true); } public void mouseExited(MouseEvent e) { menuItem.setArmed(false); } }); popup.add(menuItem); } Point compLocation = e.getComponent().getLocationOnScreen(); double[] popupLoc = {compLocation.getX(), compLocation.getY()}; popup.setLocation((int)popupLoc[0] + e.getX(), (int)popupLoc[1] + e.getY()); popup.setVisible(true); currentPopup = popup; } else{ toggleStationSelection((Station)stationsUnderMouse.get(0)); } return true; } return false; } |
popup.setInvoker(this); | public boolean mouseClicked(MouseEvent e){ if (currentPopup != null){ currentPopup.setVisible(false); currentPopup = null; } List stationsUnderMouse = new ArrayList(); synchronized(omgraphics){ Iterator it = omgraphics.iterator(); while(it.hasNext()){ OMStation current = (OMStation)it.next(); if(current.contains(e.getX(), e.getY())){ stationsUnderMouse.add(current.getStation()); } } } if (stationsUnderMouse.size() > 0){ if (stationsUnderMouse.size() > 1){ final JPopupMenu popup = new JPopupMenu(); Iterator it = stationsUnderMouse.iterator(); while (it.hasNext()){ final Station current = (Station)it.next(); final JMenuItem menuItem = new JMenuItem(getStationInfo(current, currentEvent)); menuItem.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { toggleStationSelection(current); popup.setVisible(false); } }); menuItem.addMouseListener(new MouseAdapter(){ public void mouseEntered(MouseEvent e) { menuItem.setArmed(true); } public void mouseExited(MouseEvent e) { menuItem.setArmed(false); } }); popup.add(menuItem); } Point compLocation = e.getComponent().getLocationOnScreen(); double[] popupLoc = {compLocation.getX(), compLocation.getY()}; popup.setLocation((int)popupLoc[0] + e.getX(), (int)popupLoc[1] + e.getY()); popup.setVisible(true); currentPopup = popup; } else{ toggleStationSelection((Station)stationsUnderMouse.get(0)); } return true; } return false; } |
|
maybeKillCurrentPopup(); | public boolean mouseMoved(MouseEvent e){ synchronized(omgraphics){ Iterator it = omgraphics.iterator(); while(it.hasNext()){ OMStation current = (OMStation)it.next(); if(current.contains(e.getX(), e.getY())){ Station station = current.getStation(); fireRequestInfoLine(getStationInfo(station, currentEvent)); return true; } } //fireRequestInfoLine(" "); return false; } } |
|
form.initFields(); | initFields(form); | public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access */ if (!form.getAuthorisedUser()) { return "noAccess"; } /** Set the objects to null so we get new ones. */ form.initFields(); form.assignAddingCategory(false); return "continue"; } |
public BwUser getUser() throws CalFacadeException { return user; | public BwUser getUser(int id) throws CalFacadeException { checkOpen(); throw new CalFacadeUnimplementedException(); | public BwUser getUser() throws CalFacadeException { return user; } |
public boolean init(String authenticatedUser, | public boolean init(String url, String authenticatedUser, | public boolean init(String authenticatedUser, String user, boolean publicAdmin, Groups groups, String synchId, boolean debug) throws CalFacadeException { boolean userAdded = super.init(authenticatedUser, user, publicAdmin, groups, synchId, debug); if (httpManager == null) { synchronized (this) { if (httpManager == null) { httpManager = new HttpManager("org.bedework.http.client.caldav.CaldavClient"); } } } return userAdded; } |
boolean userAdded = super.init(authenticatedUser, user, publicAdmin, | boolean userAdded = super.init(url, authenticatedUser, user, publicAdmin, | public boolean init(String authenticatedUser, String user, boolean publicAdmin, Groups groups, String synchId, boolean debug) throws CalFacadeException { boolean userAdded = super.init(authenticatedUser, user, publicAdmin, groups, synchId, debug); if (httpManager == null) { synchronized (this) { if (httpManager == null) { httpManager = new HttpManager("org.bedework.http.client.caldav.CaldavClient"); } } } return userAdded; } |
private void logon(BwUser val) throws CalFacadeException { | public void logon(BwUser val) throws CalFacadeException { | private void logon(BwUser val) throws CalFacadeException { checkOpen(); throw new CalFacadeUnimplementedException(); } |
public void updateUser() throws CalFacadeException { updateUser(getUser()); | public void updateUser(BwUser user) throws CalFacadeException { checkOpen(); throw new CalFacadeUnimplementedException(); | public void updateUser() throws CalFacadeException { updateUser(getUser()); } |
return; | public void generatePropValue(WebdavNsNode node, WebdavProperty pr) throws WebdavIntfException { QName tag = pr.getTag(); String ns = tag.getNamespaceURI(); try { /* Deal with webdav properties */ if (!ns.equals(WebdavTags.namespace)) { // Not ours openPropstat(); xml.emptyTag(tag); closePropstat(HttpServletResponse.SC_NOT_FOUND); } if (tag.equals(WebdavTags.creationdate)) { // dav 13.1 if (node.getCreDate() != null) { openPropstat(); xml.property(tag, node.getCreDate()); closePropstat(); } } else if (tag.equals(WebdavTags.displayname)) { // dav 13.2 openPropstat(); xml.property(tag, node.getName()); closePropstat(); } else if (tag.equals(WebdavTags.getcontentlanguage)) { // dav 13.3 } else if (tag.equals(WebdavTags.getcontentlength)) { // dav 13.4 } else if (tag.equals(WebdavTags.getcontenttype)) { // dav 13.5 openPropstat(); generatePropContenttype(node); closePropstat(); } else if (tag.equals(WebdavTags.getetag)) { // dav 13.6 openPropstat(); xml.property(tag, getEntityTag(node, true)); closePropstat(); } else if (tag.equals(WebdavTags.getlastmodified)) { // dav 13.7 if (node.getLastmodDate() != null) { openPropstat(); xml.property(tag, node.getLastmodDate()); closePropstat(); } } else if (tag.equals(WebdavTags.lockdiscovery)) { // dav 13.8 } else if (tag.equals(WebdavTags.resourcetype)) { // dav 13.9 openPropstat(); generatePropResourcetype(node); closePropstat(); } else if (tag.equals(WebdavTags.source)) { // dav 13.10 } else if (tag.equals(WebdavTags.supportedlock)) { // dav 13.11 } else if (tag.equals(WebdavTags.owner)) { // access 5.1 openPropstat(); xml.openTag(tag); xml.property(WebdavTags.href, makeUserHref(node.getOwner())); xml.closeTag(tag); closePropstat(); } else if (tag.equals(WebdavTags.supportedPrivilegeSet)) { // access 5.2 openPropstat(); emitSupportedPrivSet(node); closePropstat(); } else if (tag.equals(WebdavTags.currentUserPrivilegeSet)) { // access 5.3 } else if (tag.equals(WebdavTags.acl)) { // access 5.4 openPropstat(); emitAcl(node); closePropstat(); } else if (tag.equals(WebdavTags.aclRestrictions)) { // access 5.5 } else if (tag.equals(WebdavTags.inheritedAclSet)) { // access 5.6 } else if (tag.equals(WebdavTags.principalCollectionSet)) { // access 5.7 } else { // Not known openPropstat(); xml.emptyTag(tag); closePropstat(HttpServletResponse.SC_NOT_FOUND); } } catch (WebdavIntfException wie) { throw wie; } catch (Throwable t) { throw new WebdavIntfException(t); } } |
|
} else { try { log("Cannot find creditCardInformation for supplier = "+ supplier.getName()+", looking up authEntry in TPOS..."); TPosAuthorisationEntriesBeanHome authEntHome = (TPosAuthorisationEntriesBeanHome) IDOLookup.getHome(TPosAuthorisationEntriesBean.class); TPosAuthorisationEntriesBean entry = authEntHome.findByAuthorisationIdRsp(authorizationCode); if (entry != null) { return entry; } } catch (Exception e) { e.printStackTrace(System.err); } | public CreditCardAuthorizationEntry getAuthorizationEntry(Supplier supplier, String authorizationCode, IWTimestamp stamp) { CreditCardInformation info = getCreditCardInformation(supplier, stamp); if (info != null) { try { if ( CreditCardMerchant.MERCHANT_TYPE_TPOS.equals(info.getType()) ){ TPosAuthorisationEntriesBeanHome authEntHome = (TPosAuthorisationEntriesBeanHome) IDOLookup.getHome(TPosAuthorisationEntriesBean.class); TPosAuthorisationEntriesBean entry = authEntHome.findByAuthorisationIdRsp(authorizationCode); if (entry != null) { return entry; } } else if ( CreditCardMerchant.MERCHANT_TYPE_KORTHATHJONUSTAN.equals(info.getType()) ) { KortathjonustanAuthorisationEntriesHome authEntHome = (KortathjonustanAuthorisationEntriesHome) IDOLookup.getHome(KortathjonustanAuthorisationEntries.class); KortathjonustanAuthorisationEntries entry = authEntHome.findByAuthorizationCode(authorizationCode); if (entry != null) { return entry; } } } catch (IDOFinderException ignore) { } catch (Exception e) { e.printStackTrace(System.err); } } return null; } |
|
public TPosAuthorisationEntriesBean findByAuthorisationIdRsp(java.lang.String p0)throws javax.ejb.FinderException; | public TPosAuthorisationEntriesBean findByAuthorisationIdRsp(java.lang.String p0, IWTimestamp stamp)throws javax.ejb.FinderException; | public TPosAuthorisationEntriesBean findByAuthorisationIdRsp(java.lang.String p0)throws javax.ejb.FinderException; |
public KortathjonustanAuthorisationEntries findByAuthorizationCode(java.lang.String p0)throws javax.ejb.FinderException; | public KortathjonustanAuthorisationEntries findByAuthorizationCode(java.lang.String p0, IWTimestamp stamp)throws javax.ejb.FinderException; | public KortathjonustanAuthorisationEntries findByAuthorizationCode(java.lang.String p0)throws javax.ejb.FinderException; |
return lookupFrame_.meta_invoke(receiver_, selector, arguments); | if(selector == AGSymbol.jAlloc("==")) return super.meta_invoke(this, selector, arguments); return lookupFrame_.meta_invoke(receiver_, selector, arguments); | public ATObject meta_invoke(ATObject receiver, ATSymbol selector, ATTable arguments) throws InterpreterException { return lookupFrame_.meta_invoke(receiver_, selector, arguments); } |
semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.profile.edit.parts.EnumerationLiteralsEditPart.VISUAL_ID); | semanticHint = UMLVisualIDRegistry.getType(EnumerationLiteralsEditPart.VISUAL_ID); | protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) { if (semanticHint == null) { semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.profile.edit.parts.EnumerationLiteralsEditPart.VISUAL_ID); view.setType(semanticHint); } super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted); setupCompartmentTitle(view); setupCompartmentCollapsed(view); if (!ProfileEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) { EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation(); shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ shortcutAnnotation.getDetails().put("modelID", ProfileEditPart.MODEL_ID); //$NON-NLS-1$ view.getEAnnotations().add(shortcutAnnotation); } } |
public ATFraction base_abs(); | public ATNumeric base_abs(); | public ATFraction base_abs(); |
public ATFraction base_dec(); | public ATNumeric base_dec(); | public ATFraction base_dec(); |
public ATFraction base_inc(); | public ATNumeric base_inc(); | public ATFraction base_inc(); |
ideaMap.requestFocusInWindow(); IdeaView current = ideaMap.getSelectedView(); if (current != null) { unEditIdeaView(current); } | unEditCurrent(); } }); this.ideaMap.getTextField().addFocusListener(new FocusListener() { public void focusLost(FocusEvent fe) { unEditCurrent(); } public void focusGained(FocusEvent fe) { | public IdeaMapController(IdeaMap newIdeaMap) { this.ideaMap = newIdeaMap; this.ideaMap.setFocusTraversalKeysEnabled(false); this.ideaMap.setFocusable(true); this.ideaMap.addFocusListener(this); this.ideaMap.addKeyListener(this); this.ideaMap.addMouseListener(this); this.ideaMap.addMouseMotionListener(this); this.ideaMap.getTextField().addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ideaMap.requestFocusInWindow(); IdeaView current = ideaMap.getSelectedView(); if (current != null) { unEditIdeaView(current); } } }); this.ideaMap.requestFocusInWindow(); } |
ideaMap.requestFocusInWindow(); IdeaView current = ideaMap.getSelectedView(); if (current != null) { unEditIdeaView(current); } | unEditCurrent(); | public void actionPerformed(ActionEvent e) { ideaMap.requestFocusInWindow(); IdeaView current = ideaMap.getSelectedView(); if (current != null) { unEditIdeaView(current); } } |
events = new Events(this, access, this.user, currentMode, | events = new Events(this, access, currentMode, | public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, this.user, currentMode, ignoreCreator, debug); calendars = new Calendars(this, access, this.user, currentMode, ignoreCreator, debug); categories = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); if (userCreated) { calendars.addNewCalendars(authUser); } return userCreated; } |
calendars = new Calendars(this, access, this.user, currentMode, | calendars = new Calendars(this, access, currentMode, | public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, this.user, currentMode, ignoreCreator, debug); calendars = new Calendars(this, access, this.user, currentMode, ignoreCreator, debug); categories = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); if (userCreated) { calendars.addNewCalendars(authUser); } return userCreated; } |
categories = new EventProperties(this, access, this.user, currentMode, | categories = new EventProperties(this, access, currentMode, | public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, this.user, currentMode, ignoreCreator, debug); calendars = new Calendars(this, access, this.user, currentMode, ignoreCreator, debug); categories = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); if (userCreated) { calendars.addNewCalendars(authUser); } return userCreated; } |
locations = new EventProperties(this, access, this.user, currentMode, | locations = new EventProperties(this, access, currentMode, | public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, this.user, currentMode, ignoreCreator, debug); calendars = new Calendars(this, access, this.user, currentMode, ignoreCreator, debug); categories = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); if (userCreated) { calendars.addNewCalendars(authUser); } return userCreated; } |
sponsors = new EventProperties(this, access, this.user, currentMode, | sponsors = new EventProperties(this, access, currentMode, | public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, this.user, currentMode, ignoreCreator, debug); calendars = new Calendars(this, access, this.user, currentMode, ignoreCreator, debug); categories = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); if (userCreated) { calendars.addNewCalendars(authUser); } return userCreated; } |
tzinfo = (TimezoneInfo)timezones.get(id); | if (systemHasPrecedence) { tzinfo = (TimezoneInfo)systemTimezones.get(id); } else { tzinfo = (TimezoneInfo)timezones.get(id); } if (tzinfo == null) { if (systemHasPrecedence) { tzinfo = (TimezoneInfo)timezones.get(id); } else { tzinfo = (TimezoneInfo)systemTimezones.get(id); } } | protected TimezoneInfo lookup(String id) throws CalFacadeException { TimezoneInfo tzinfo; tzinfo = (TimezoneInfo)timezones.get(id); return tzinfo; } |
impl.getUserAttributes(Collections.singletonMap("dummy", "seed")); | impl.getUserAttributes(Collections.singletonMap("username", "seed")); | public void testNullContext() { LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); impl.setContextSource(this.contextSource); try { impl.getUserAttributes(Collections.singletonMap("dummy", "seed")); fail("IllegalStateException should have been thrown with no query configured"); } catch (IllegalStateException ise) { //expected } } |
impl.getUserAttributes(Collections.singletonMap("dummy", "seed")); | impl.getUserAttributes(Collections.singletonMap("username", "seed")); | public void testNullQuery() { LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); try { impl.getUserAttributes(Collections.singletonMap("dummy", "seed")); fail("IllegalStateException should have been thrown with no context configured"); } catch (IllegalStateException ise) { //expected } } |
assertEquals(Collections.EMPTY_LIST, impl.getQueryAttributes()); | assertNull(impl.getQueryAttributes()); | public void testProperties() { LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); assertEquals("", impl.getBaseDN()); impl.setBaseDN("BaseDN"); assertEquals("BaseDN", impl.getBaseDN()); impl.setBaseDN(null); assertEquals("", impl.getBaseDN()); assertEquals(Collections.EMPTY_MAP, impl.getLdapAttributesToPortalAttributes()); Map attrMap = new HashMap(); attrMap.put("mail", "email"); impl.setLdapAttributesToPortalAttributes(attrMap); Map expectedAttrMap = new HashMap(attrMap); expectedAttrMap.put("mail", Collections.singleton("email")); assertEquals(expectedAttrMap, impl.getLdapAttributesToPortalAttributes()); assertNull(impl.getContextSource()); impl.setContextSource(this.contextSource); assertEquals(contextSource, impl.getContextSource()); impl.setLdapAttributesToPortalAttributes(null); assertEquals(Collections.EMPTY_SET, impl.getPossibleUserAttributeNames()); impl.setLdapAttributesToPortalAttributes(attrMap); assertEquals(Collections.singleton("email"), impl.getPossibleUserAttributeNames()); assertNull(impl.getQuery()); impl.setQuery("QueryString"); assertEquals("QueryString", impl.getQuery()); assertEquals(Collections.EMPTY_LIST, impl.getQueryAttributes()); impl.setQueryAttributes(Collections.singletonList("QAttr")); assertEquals(Collections.singletonList("QAttr"), impl.getQueryAttributes()); assertEquals(0, impl.getTimeLimit()); impl.setTimeLimit(1337); assertEquals(1337, impl.getTimeLimit()); } |
int numRowsInScoreSheet = Main.getMain().getNumberOfPlayers() + 4; | public void setComponentsBounds() { int width = panel.getWidth(); int height = panel.getHeight(); int gameBoardWidth = width / 2 - (borderWidth + borderWidth / 2); int gameBoardHeight = gameBoardWidth * 3 / 4; setComponentBounds(gameBoard, borderWidth, borderWidth, gameBoardWidth, gameBoardHeight); int tileRackBackgroundY = borderWidth + gameBoardHeight + borderWidth; int tileRackBackgroundHeight = gameBoardHeight * 2 / 13; setComponentBounds(tileRackBackground, borderWidth, tileRackBackgroundY, gameBoardWidth, tileRackBackgroundHeight); int tileRackHeight = tileRackBackgroundHeight * 8 / 10; int tileRackWidth = tileRackHeight * 6 + TileRack.spacing * 5; int tileRackX = (width / 2 + borderWidth / 2 - tileRackWidth) / 2; int tileRackY = tileRackBackgroundY + (tileRackBackgroundHeight - tileRackHeight) / 2; setComponentBounds(tileRack, tileRackX, tileRackY, tileRackWidth, tileRackHeight); int lobbyY = tileRackBackgroundY + tileRackBackgroundHeight + borderWidth; int lobbyPostHeight = (int)lobbyPost.getPreferredSize().getHeight(); int lobbyHeight = height - borderWidth - lobbyY; if (lobbyPost.isVisible()) { lobbyHeight -= lobbyPostHeight; } setComponentBounds(lobby, borderWidth, lobbyY, gameBoardWidth, lobbyHeight); int lobbyPostY = lobbyY + lobbyHeight; setComponentBounds(lobbyPost, borderWidth, lobbyPostY, gameBoardWidth, lobbyPostHeight); int scoreSheetY = width / 2 + borderWidth / 2; int scoreSheetRowHeight = gameBoardWidth * 10 / 18 / 10; int numRowsInScoreSheet = Main.getMain().getNumberOfPlayers() + 4; int scoreSheetHeight = scoreSheetRowHeight * numRowsInScoreSheet; scoreSheet.setRowHeight(scoreSheetRowHeight); setComponentBounds(scoreSheet, scoreSheetY, borderWidth, gameBoardWidth, scoreSheetHeight); int gameRoomY = borderWidth + scoreSheetHeight + borderWidth; int gameRoomPostHeight = (int)gameRoomPost.getPreferredSize().getHeight(); int gameRoomHeight = height - borderWidth - gameRoomY; if (gameRoomPost.isVisible()) { gameRoomHeight -= gameRoomPostHeight; } setComponentBounds(gameRoom, scoreSheetY, gameRoomY, gameBoardWidth, gameRoomHeight); int gameRoomPostY = gameRoomY + gameRoomHeight; setComponentBounds(gameRoomPost, scoreSheetY, gameRoomPostY, gameBoardWidth, gameRoomPostHeight); } |
|
info.informationResource = attr.getValue(ATTR_MODULE_INFORMATION); | info.infoURL = getInfoURL(jarURL, attr); | private ModuleLoader.ModuleInfoContainer getModuleInfo() throws ModuleLoaderException { try { URL jarURL = new URL("jar", "", url +"!/"); JarURLConnection conn = (JarURLConnection)jarURL.openConnection(); Attributes attr = conn.getMainAttributes(); if (attr == null) { throw new ModuleLoaderException("No Module-Class defined"); } String moduleClassName = attr.getValue(ATTR_MODULE_CLASS); if (moduleClassName == null) { throw new ModuleLoaderException("No Module-Class defined"); } else { ModuleInfoContainer info = new ModuleInfoContainer(); info.moduleClassName = moduleClassName; info.version = parseFloat(attr.getValue(ATTR_MODULE_VERSION)); info.name = attr.getValue(ATTR_MODULE_NAME); info.configClassName = attr.getValue(ATTR_MODULE_CONFIG_CLASS); info.protocols = getProtocols(attr); info.requirements = getRequirements(attr); info.informationResource = attr.getValue(ATTR_MODULE_INFORMATION); return info; } } catch (Exception exc) { throw new ModuleLoaderException(exc); } } |
height); | height - 5); | public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); Rectangle currentClip = copy.getClip().getBounds(); copy.setClip(currentClip.x,currentClip.y, width, height); try { copy.setFont(DisplayUtils.BORDER_FONT); copy.setStroke(DisplayUtils.TWO_PIXEL_STROKE); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); // top int numTicks; int pixelLoc; ScaleMapper map = topScaleMap; if (map != null) { numTicks = map.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + map.getPixelLocation(i); if(map.isMajorTick(i)){ copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); String label = map.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength - 3); } }else{ copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); } } copy.drawString(map.getAxisLabel(), width/2, fontHeight); } // left map = leftScaleMap; if (map != null) { numTicks = map.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); }else{ // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - map.getPixelLocation(i) - bottom; if (map.isMajorTick(i)) { copy.draw(new Line2D.Float(left, pixelLoc, left - majorTickLength, pixelLoc)); String label = map.getLabel(i); if (label != null && label.length() != 0) { Rectangle2D stringBounds = fm.getStringBounds(label, copy); copy.drawString(label, (int)(left - majorTickLength - stringBounds.getWidth()) - 2, pixelLoc + fm.getAscent()/2 - 2); } } else { copy.draw(new Line2D.Float(left - minorTickLength, pixelLoc, left, pixelLoc)); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(map.getAxisLabel(), copy); } double yTranslate = insets.top + (height - insets.top - insets.bottom + leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(map.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } } // bottom map = bottomScaleMap; if (map != null) { numTicks = map.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + map.getPixelLocation(i); if (map.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); String label = map.getLabel(i); Rectangle2D labelBounds = fm.getStringBounds(label, copy); int labelWidth = (int)labelBounds.getWidth(); int labelHeight = (int)labelBounds.getHeight(); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc - labelWidth/2, height- bottom + majorTickLength + labelHeight); } } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } } String label = map.getAxisLabel(); Rectangle2D labelBounds = fm.getStringBounds(label, copy); copy.drawString(label, (int)(insets.left + (width - insets.left - insets.right - labelBounds.getWidth())/2), height); } // right map = rightScaleMap; if (map != null) { numTicks = map.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - map.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); String label = map.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } } |
bottom = 20 + getFontHeight(scaleMap.getAxisLabel()); | bottom = majorTickLength + 2 * getFontHeight(scaleMap.getAxisLabel()) + 5; | public void setBottomScaleMapper(ScaleMapper scaleMap) { this.bottomScaleMap = scaleMap; if(scaleMap.getAxisLabel() != null && !scaleMap.getAxisLabel().equals("")){ bottom = 20 + getFontHeight(scaleMap.getAxisLabel()); }else{ bottom = 20; } } |
String ns = prop.getNamespaceURI(); String nm = prop.getLocalName(); | private void processPlist(Collection plist, Element node, boolean remove) throws WebdavException { Element[] props = getChildren(node); for (int i = 0; i < props.length; i++) { Element prop = props[i]; String ns = prop.getNamespaceURI(); String nm = prop.getLocalName(); String value = getElementContent(prop); if (remove && (value != null)) { throw new WebdavBadRequest(); } plist.add(new Property(ns, nm, value)); if (debug) { trace("reqtype: " + nm + " ns: " + ns + " value: " + value); } } } |
|
plist.add(new Property(ns, nm, value)); | plist.add(prop); | private void processPlist(Collection plist, Element node, boolean remove) throws WebdavException { Element[] props = getChildren(node); for (int i = 0; i < props.length; i++) { Element prop = props[i]; String ns = prop.getNamespaceURI(); String nm = prop.getLocalName(); String value = getElementContent(prop); if (remove && (value != null)) { throw new WebdavBadRequest(); } plist.add(new Property(ns, nm, value)); if (debug) { trace("reqtype: " + nm + " ns: " + ns + " value: " + value); } } } |
trace("reqtype: " + nm + " ns: " + ns + " value: " + value); | trace("reqtype: " + prop.getLocalName() + " ns: " + prop.getNamespaceURI() + " value: " + value); | private void processPlist(Collection plist, Element node, boolean remove) throws WebdavException { Element[] props = getChildren(node); for (int i = 0; i < props.length; i++) { Element prop = props[i]; String ns = prop.getNamespaceURI(); String nm = prop.getLocalName(); String value = getElementContent(prop); if (remove && (value != null)) { throw new WebdavBadRequest(); } plist.add(new Property(ns, nm, value)); if (debug) { trace("reqtype: " + nm + " ns: " + ns + " value: " + value); } } } |
this.setLayoutManager(new org.eclipse.gmf.internal.codegen.draw2d.GridLayout()); | org.eclipse.gmf.internal.codegen.draw2d.GridLayout layoutThis = new org.eclipse.gmf.internal.codegen.draw2d.GridLayout(); layoutThis.numColumns = 1; layoutThis.makeColumnsEqualWidth = true; layoutThis.horizontalSpacing = 0; layoutThis.verticalSpacing = 0; layoutThis.marginWidth = 0; layoutThis.marginHeight = 0; this.setLayoutManager(layoutThis); | public ClassFigure() { this.setLayoutManager(new org.eclipse.gmf.internal.codegen.draw2d.GridLayout()); this.setFill(false); this.setFillXOR(false); this.setOutline(false); this.setOutlineXOR(false); this.setLineWidth(1); this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_SOLID); createContents(); } |
String t = seedDate.format(date); int millis =(int) (date.getMicroSeconds() % 1000000) / 100; setStartTime( t + millis); | Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC")); cal.setTime(date); | public void setStartTime(MicroSecondDate date) { String t = seedDate.format(date); int millis =(int) (date.getMicroSeconds() % 1000000) / 100; setStartTime( t + millis); } |
Btime btime = new Btime(); btime.tenthMilli = (int)Math.round(((date.getTime()*1000+date.getMicroSeconds()) % 1000000) / 100.0); btime.year = cal.get(cal.YEAR); btime.jday = cal.get(cal.DAY_OF_YEAR); btime.hour = cal.get(cal.HOUR); System.out.println("Hour "+cal.get(cal.HOUR)+" btime="+btime.hour+" date="+date.getFissuresTime().date_time); btime.min = cal.get(cal.MINUTE); btime.sec = cal.get(cal.SECOND); this.startTime = btime.getAsBytes(); | public void setStartTime(MicroSecondDate date) { String t = seedDate.format(date); int millis =(int) (date.getMicroSeconds() % 1000000) / 100; setStartTime( t + millis); } |
|
ampScaleMap = new AmpScaleMapper(50, 4, (AmpRangeConfig)ampRegistrar); | ampScaleMap = new AmpScaleMapper(50, 4, ampRegistrar); | public void initializeDisplay(DataSetSeismogram seis, String name, VerticalSeismogramDisplay parent){ this.name = name; this.parent = parent; plotPainter = new PlotPainter(); add(plotPainter); ampRegistrar.visibleAmpCalc(timeRegistrar); addSeismogram(seis); setLayout(new OverlayLayout(this)); addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { resize(); } public void componentShown(ComponentEvent e) { resize(); } }); timeScaleMap = new TimeScaleCalc(200, timeRegistrar); ampScaleMap = new AmpScaleMapper(50, 4, (AmpRangeConfig)ampRegistrar); setMinimumSize(new Dimension(100, 50)); scaleBorder = new ScaleBorder(); scaleBorder.setLeftScaleMapper(ampScaleMap); setBorder(BorderFactory.createCompoundBorder(BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(), new LeftTitleBorder("")), BorderFactory.createCompoundBorder(scaleBorder, BorderFactory.createLoweredBevelBorder()))); Dimension d = getSize(); Insets insets = this.getInsets(); Insets current = this.getInsets(); setPreferredSize(new Dimension(200 + current.left, 100 + current.top + current.bottom)); } |
nts.add((BwCalendar)((BwCalendar)it.next()).clone()); | nts.add((BwCalendar)((BwCalendar)it.next()).shallowClone()); | public Object clone() { BwAuthUserPrefs aup = new BwAuthUserPrefs(); aup.setId(getId()); // Don't clone the authuser - sets up a loop aup.setAutoAddCategories(getAutoAddCategories()); TreeSet nts = new TreeSet(); Set ts = getPreferredCategories(); if (ts != null) { Iterator it = ts.iterator(); while (it.hasNext()) { nts.add((BwCategory)((BwCategory)it.next()).clone()); } } aup.setPreferredCategories(nts); aup.setAutoAddLocations(getAutoAddLocations()); nts = new TreeSet(); ts = getPreferredLocations(); if (ts != null) { Iterator it = ts.iterator(); while (it.hasNext()) { nts.add((BwLocation)((BwLocation)it.next()).clone()); } } aup.setPreferredLocations(nts); aup.setAutoAddSponsors(getAutoAddSponsors()); nts = new TreeSet(); ts = getPreferredSponsors(); if (ts != null) { Iterator it = ts.iterator(); while (it.hasNext()) { nts.add((BwSponsor)((BwSponsor)it.next()).clone()); } } aup.setPreferredSponsors(nts); aup.setAutoAddCalendars(getAutoAddCalendars()); nts = new TreeSet(); ts = getPreferredCalendars(); if (ts != null) { Iterator it = ts.iterator(); while (it.hasNext()) { nts.add((BwCalendar)((BwCalendar)it.next()).clone()); } } aup.setPreferredCalendars(nts); return aup; } |
while(i < seismos.size() && seismo.isFurtherThan((DataSetSeismogram)seismos.get(i))){ | while(i < seismos.size() && seismo.isFurtherThan((DataSetSeismogram)seismos.get(names.get(i)))){ | public int sort(DataSetSeismogram seismo, String name){ int i = 0; while(i < seismos.size() && seismo.isFurtherThan((DataSetSeismogram)seismos.get(i))){ i++; } seismos.add(i, seismo); return i; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.