rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
seismos.add(i, seismo); | seismos.put(name, seismo); names.add(i, seismo); | 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; } |
label(getLabel(value), nextLabelPoint, g2d); | label(getLabel(value), nextLabelPoint, g2d, translation[1]); | public void draw(UnitRangeImpl r, Graphics2D g2d){ double numDivisions = (r.max_value - r.min_value)/divSize; double pixelsPerLabelTick = getLimitingSize()/numDivisions; double pixelsPerMinorTick = pixelsPerLabelTick/ticksPerDiv; int numLabelTicks = (int)Math.ceil(numDivisions) + 1; //Create tick shapes GeneralPath labelTickShape = new GeneralPath(); GeneralPath minorTickShape = new GeneralPath(); float[] nextLabelPoint = getFirstPoint(); for (int i = 0; i < numLabelTicks; i++) { labelTickShape.moveTo(nextLabelPoint[0], nextLabelPoint[1]); labelTickShape.lineTo(nextLabelPoint[0] + labelTickWidth, nextLabelPoint[1] + labelTickHeight); float[] nextMinorPoint = getNextPoint((float)pixelsPerMinorTick, nextLabelPoint); for (int j = 0; j < ticksPerDiv - 1; j++) { minorTickShape.moveTo(nextMinorPoint[0], nextMinorPoint[1]); minorTickShape.lineTo(nextMinorPoint[0] + tickWidth, nextMinorPoint[1] + tickHeight); nextMinorPoint = getNextPoint((float)pixelsPerMinorTick, nextMinorPoint); } nextLabelPoint = getNextPoint((float)pixelsPerLabelTick, nextLabelPoint); } TitleProvider tp = (TitleProvider)titles.get(0); FontMetrics fm = g2d.getFontMetrics(); Rectangle2D titleBounds = fm.getStringBounds(tp.getTitle(), g2d); if(direction == VERTICAL){ double y = (int)(getSize().height/2 + titleBounds.getWidth()/2); double x; if(side == LEFT)x = titleBounds.getHeight(); else x = getWidth() - titleBounds.getHeight(); g2d.translate(x, y); g2d.rotate(-Math.PI/2); g2d.drawString(tp.getTitle(), 0, 0); g2d.rotate(Math.PI/2); g2d.translate(-x, -y); }else{ int x = (int)(getWidth()/2 - titleBounds.getWidth()/2); int y; if(side == TOP) y = (int)titleBounds.getHeight(); else y = (int)(getHeight() - titleBounds.getHeight()); g2d.drawString(tp.getTitle(), x, y); } //Figure out how much to translate this generic tick shape to match //the actual time double[] translation = getTranslation(r); //Casing the translation to an int removes tick jitter in borders //where the values have changed, but the range hasn't. Since they //move by an integral amount, they move in lockstep. This introduces //inaccuracy in translations that wouldn't naturally be an int. //Be forewarned! g2d.translate((int)translation[0], (int)translation[1]); g2d.setStroke(DisplayUtils.TWO_PIXEL_STROKE); g2d.draw(labelTickShape); g2d.setStroke(DisplayUtils.ONE_PIXEL_STROKE); g2d.draw(minorTickShape); double value = getFirstLabelValue(r); nextLabelPoint = getFirstPoint(); for (int i = 0; i < numLabelTicks; i++) { if(displayNegatives || value >= 0){ label(getLabel(value), nextLabelPoint, g2d); } value += divSize; nextLabelPoint = getNextPoint((float)pixelsPerLabelTick, nextLabelPoint); } g2d.translate(-(int)translation[0], -(int)translation[1]); } |
private void label(String label, float[] nextLabelPoint, Graphics2D g2d) { | private void label(String label, float[] nextLabelPoint, Graphics2D g2d, double trans) { | private void label(String label, float[] nextLabelPoint, Graphics2D g2d) { Rectangle2D bounds = g2d.getFontMetrics().getStringBounds(label, g2d); float x, y; if(direction == VERTICAL){ y = nextLabelPoint[1] + (float)(bounds.getHeight()/(double)4); int xMod = LABEL_TICK_LENGTH + 2; if(side == LEFT) x = nextLabelPoint[0] - xMod - (int)bounds.getWidth(); else x = nextLabelPoint[0] + xMod; }else{//Must be horizontal x = nextLabelPoint[0] - (int)(bounds.getWidth()/2); if(side == TOP) y = nextLabelPoint[1] - LABEL_TICK_LENGTH - 3; else y = LABEL_TICK_LENGTH + (float)bounds.getHeight() - 3; } g2d.drawString(label, x, y); } |
g2d.drawString(label, x, y); | if(y + trans <= getSize().height && y - bounds.getHeight() + trans >= 0)g2d.drawString(label, x, y); | private void label(String label, float[] nextLabelPoint, Graphics2D g2d) { Rectangle2D bounds = g2d.getFontMetrics().getStringBounds(label, g2d); float x, y; if(direction == VERTICAL){ y = nextLabelPoint[1] + (float)(bounds.getHeight()/(double)4); int xMod = LABEL_TICK_LENGTH + 2; if(side == LEFT) x = nextLabelPoint[0] - xMod - (int)bounds.getWidth(); else x = nextLabelPoint[0] + xMod; }else{//Must be horizontal x = nextLabelPoint[0] - (int)(bounds.getWidth()/2); if(side == TOP) y = nextLabelPoint[1] - LABEL_TICK_LENGTH - 3; else y = LABEL_TICK_LENGTH + (float)bounds.getHeight() - 3; } g2d.drawString(label, x, y); } |
g.setColor(getBackground()); g2d.fillRect(0, 0, getSize().width, getSize().height); | public void paint(Graphics g){ Graphics2D g2d = (Graphics2D)g; g.setColor(Color.BLACK); Iterator it = borderFormats.iterator(); while(it.hasNext()){ BorderFormat cur = (BorderFormat)it.next(); if(cur.willFit(getRange(), g2d)){ cur.draw(getRange(), g2d); break; } } } |
|
if(coordinates[0] % 100 == 0){ logger.debug("x: " + coordinates[0] + " y: " + coordinates[1]); } | public int currentSegment(float[] coordinates){ int i = 0; if(min){ i = 1; currentIndex--; } min = !min; coordinates[0] = currentIndex; coordinates[1] = points[i][currentIndex]; if(coordinates[0] % 100 == 0){ logger.debug("x: " + coordinates[0] + " y: " + coordinates[1]); } if(at != null){ at.transform(coordinates, 0, coordinates, 0, 1); } if(currentIndex == startIndex){ return SEG_MOVETO; }else{ return SEG_LINETO; } } |
|
logger.debug("calling getWindingRule"); | public int getWindingRule(){ logger.debug("calling getWindingRule"); return WIND_NON_ZERO; } |
|
if(currentIndex % 200 == 0){ logger.debug("calling isDone"); } | public boolean isDone(){ if(currentIndex % 200 == 0){ logger.debug("calling isDone"); } if(currentIndex == endIndex){ return true; } return false; } |
|
currentIndex = startIndex; min = false; | public boolean isDone(){ if(currentIndex % 200 == 0){ logger.debug("calling isDone"); } if(currentIndex == endIndex){ return true; } return false; } |
|
if(currentIndex % 200 == 0){ logger.debug("calling next()"); } | public void next(){ if(currentIndex % 200 == 0){ logger.debug("calling next()"); } currentIndex++; } |
|
logger.debug("Iterator drawing on " + startIndex + ", " + endIndex); | public void setDrawnPixels(int[] drawnPixels){ this.drawnPixels = drawnPixels; startIndex = drawnPixels[0]; endIndex = drawnPixels[1]; currentIndex = startIndex; logger.debug("Iterator drawing on " + startIndex + ", " + endIndex); } |
|
this.svci = svci; | public EventFormatter(CalSvcI svci, EventInfo eventInfo, TimeView view, CalendarInfo calInfo, CalTimezones ctz) { this.eventInfo = eventInfo; this.calInfo = calInfo; this.ctz= ctz; this.svci = svci; } |
|
public DateTimeFormatter(CalendarInfo calInfo, BwDateTime date, CalTimezones ctz) throws CalFacadeException { | public DateTimeFormatter(CalendarInfo calInfo) { | public DateTimeFormatter(CalendarInfo calInfo, BwDateTime date, CalTimezones ctz) throws CalFacadeException { this.calInfo = calInfo; setDate(date, ctz); } |
setDate(date, ctz); | public DateTimeFormatter(CalendarInfo calInfo, BwDateTime date, CalTimezones ctz) throws CalFacadeException { this.calInfo = calInfo; setDate(date, ctz); } |
|
semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.profile.edit.parts.EnumerationLiteralEditPart.VISUAL_ID); | semanticHint = UMLVisualIDRegistry.getType(EnumerationLiteralEditPart.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.EnumerationLiteralEditPart.VISUAL_ID); view.setType(semanticHint); } super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted); 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); } } |
logger.debug("Added the display to the ParticleMOTION VIEW"); | public synchronized void addParticleMotionDisplay(DataSetSeismogram hseis, DataSetSeismogram vseis, TimeConfigRegistrar timeRegistrar, AmpConfigRegistrar hAmpConfigRegistrar, AmpConfigRegistrar vAmpConfigRegistrar, Color color, String key, boolean horizPlane) { ParticleMotion particleMotion = new ParticleMotion(hseis, vseis, timeRegistrar, hAmpConfigRegistrar, vAmpConfigRegistrar, color, key, horizPlane); displays.add(particleMotion); hunitRangeImpl = new UnitRangeImpl(getMinHorizontalAmplitude(), getMaxHorizontalAmplitude(), UnitImpl.COUNT); System.out.println("THe e NEW AMPLITUDE is Min = "+getMinHorizontalAmplitude()+ " Max = "+getMaxHorizontalAmplitude()); vunitRangeImpl = new UnitRangeImpl(getMinVerticalAmplitude(), getMaxVerticalAmplitude(), UnitImpl.COUNT); particleMotionDisplay.updateHorizontalAmpScale(hunitRangeImpl); particleMotionDisplay.updateVerticalAmpScale(vunitRangeImpl); } |
|
public void drawAzimuth(ParticleMotion particleMotion, Graphics2D graphics2D) { | public synchronized void drawAzimuth(ParticleMotion particleMotion, Graphics2D graphics2D) { | public void drawAzimuth(ParticleMotion particleMotion, Graphics2D graphics2D) { logger.debug("IN DRAW AZIMUTH"); if(!particleMotion.isHorizontalPlane()) return; Shape sector = getSectorShape(); graphics2D.setColor(Color.blue); graphics2D.fill(sector); graphics2D.draw(sector); graphics2D.setStroke(new BasicStroke(2.0f)); graphics2D.setColor(Color.green); Shape azimuth = getAzimuthPath(); graphics2D.draw(azimuth); graphics2D.setStroke(new BasicStroke(1.0f)); } |
public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { | public synchronized void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { | public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { logger.debug("IN DRAW LABELS"); Color color = new Color(0, 0, 0, 128); graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 20; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); String labelStr = new String(); labelStr = particleMotion.hseis.getSeismogram().getName(); int x = (dimension.width - (int)(labelStr.length()*fontSize)) / 2 - getInsets().left - getInsets().right; int y = dimension.height - 4; graphics2D.drawString(labelStr, x, y); labelStr = particleMotion.vseis.getSeismogram().getName(); x = font.getSize(); y = (dimension.height - (int)(labelStr.length()*fontSize)) / 2 - getInsets().top - getInsets().bottom; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance(Math.PI/2)); graphics2D.drawString(labelStr, 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); } |
public void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { | public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { | public void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { if(!recalculateValues) { recalculateValues = false; System.out.println(" DRAWING THE PARTICLE MOTION WITHOUT RECALCULATING THE VALUES"); ((Graphics2D)g).draw(particleMotion.getShape()); return; } logger.debug("IN DRAW PARTICLE MOTION"); Graphics2D graphics2D = (Graphics2D) g; Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.hseis.getSeismogram(); LocalSeismogramImpl vseis = particleMotion.vseis.getSeismogram(); AmpConfigRegistrar vAmpConfigRegistrar = particleMotion.vAmpConfigRegistrar; AmpConfigRegistrar hAmpConfigRegistrar = particleMotion.hAmpConfigRegistrar; Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } drawLabels(particleMotion, graphics2D); graphics2D.setColor(color); Insets insets = getInsets(); Dimension flipDimension = new Dimension(dimension.height, dimension.width); try { System.out.println("In PaintSeismogram hmax = "+hunitRangeImpl.getMaxValue()+ " hmin = "+hunitRangeImpl.getMinValue()); System.out.println("In PaintSeismogram vmax = "+vunitRangeImpl.getMaxValue()+ " vmin = "+vunitRangeImpl.getMinValue()); MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.timeRegistrar == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); //System.out.println("beginTime = "+hseis.getBeginTime()); //System.out.println("endTime = "+hseis.getEndTime()); } else { microSecondTimeRange = particleMotion.getTimeRange(); } System.out.println("*************** Beofore getting PlottableSimple"); Date utilStartTime = Calendar.getInstance().getTime(); int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension);*/ /*SimplePlotUtil.compressYvalues(hseis, microSecondTimeRange, hunitRangeImpl, dimension); SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension); */ int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension);*/ SimplePlotUtil.flipArray(vPixels[1], dimension.height); Date utilEndTime = Calendar.getInstance().getTime(); System.out.println("The UTIL TIME is ******* "+ (utilEndTime.getTime() - utilStartTime.getTime())); /* SimplePlotUtil.compressYvalues(vseis, microSecondTimeRange, vunitRangeImpl, dimension); System.out.println("---------------------->Scaling THE Y VALUES "); SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); */ int len = vPixels[1].length; int[] x, y; x = new int[hPixels[1].length]; y = new int[vPixels[1].length]; x = hPixels[1]; y = vPixels[1]; if (hPixels[1].length < len) { len = hPixels.length; } Date drawStartTime = Calendar.getInstance().getTime(); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); Date drawEndTime = Calendar.getInstance().getTime(); System.out.println("The PATH TIME is *********** "+(drawEndTime.getTime() - drawStartTime.getTime())); particleMotion.setShape(shape); System.out.println("After setting the shape"); if(shape == null) System.out.println("The shape is null"); graphics2D.draw(shape); System.out.println("The shape is drawn"); } catch(Exception e) { e.printStackTrace(); } } |
public boolean findPoint(int count, int newx, int newy) { | public synchronized boolean findPoint(int count, int newx, int newy) { | public boolean findPoint(int count, int newx, int newy) { boolean rtn = false; int size = displays.size(); for(int counter = 0; counter < size; counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); Shape shape = particleMotion.getShape(); //for(int i = -4; i < 4; i++) { // for(int j = -4; j < 4; j++) { if(shape.contains(newx, newy)){ particleMotion.setSelected(true);rtn = true; // particleMotionDisplay.updateAmpScale(particleMotion.hAmpConfigRegistrar.getAmpRange(particleMotion.hseis)); } // } //} } //logger.debug("The return value is "+rtn); if(rtn == true) {repaint();} return rtn; } |
logger.debug("^^^^^^^^^^^^^^^ The size of the displays in MIn is "+displayKeys.size()); if(displayKeys.size() != 0) logger.debug("****** The display key i s"+displayKeys.get(0)); | public double getMinHorizontalAmplitude() { int size = displays.size(); double min = Double.POSITIVE_INFINITY; for(int counter = 0; counter < size; counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); if(!displayKeys.contains(particleMotion.key)) continue; AmpConfigRegistrar ampRangeConfig = particleMotion.hAmpConfigRegistrar; UnitRangeImpl unitRangeImpl = ampRangeConfig.getAmpRange(particleMotion.hseis); if(min > unitRangeImpl.getMinValue()) { min = unitRangeImpl.getMinValue();} } return min; } |
|
public Shape getParticleMotionPath(int[] x, int[] y) { | public synchronized Shape getParticleMotionPath(int[] x, int[] y) { | public Shape getParticleMotionPath(int[] x, int[] y) { int len = x.length; if(y.length < len) { len = y.length;} GeneralPath generalPath = new GeneralPath(GeneralPath.WIND_EVEN_ODD); if(len != 0) { generalPath.moveTo(x[0], y[0]); } for(int counter = 1; counter < len; counter++) { generalPath.lineTo(x[counter], y[counter]); } /*for(int counter = 0; counter < len; counter++) { generalPath.append(new Rectangle2D.Float(x[counter]-2, y[counter]-2, 4, 4), false); }*/ System.out.println("Before returning from the getParticleMotionPath"); return (Shape)generalPath; } |
public Shape getSectorShape() { | public synchronized Shape getSectorShape() { | public Shape getSectorShape() { ParticleMotion particleMotion = (ParticleMotion)displays.get(0); AmpConfigRegistrar ampRangeConfig = particleMotion.vAmpConfigRegistrar; UnitRangeImpl unitRangeImpl = vunitRangeImpl;//ampRangeConfig.getAmpRange(particleMotion.vseis); double vmin = unitRangeImpl.getMinValue(); double vmax = unitRangeImpl.getMaxValue(); unitRangeImpl = hunitRangeImpl;//particleMotion.hAmpConfigRegistrar.getAmpRange(particleMotion.hseis); double hmin = hunitRangeImpl.getMinValue(); double hmax = hunitRangeImpl.getMaxValue(); Insets insets = getInsets(); double fmin = super.getSize().getWidth() - insets.left - insets.right; double fmax = super.getSize().getHeight() - insets.top - insets.bottom; int originx = (int)(fmin/2);//(int)((hmax - hmin) /4); int originy = (int)(fmax/2);//((vmax - vmin) /4); int newx = originx; //(int)(((originx-hmin) * fmin)/ (hmax - hmin));//(int)((max * fmin)/ (max - min)); int newy = originy; //(int)(fmax - (int)(((originy-vmin)*fmax)/(vmax - vmin))); GeneralPath generalPath = new GeneralPath(); int size = sectors.size(); for(int counter = 0; counter < size; counter++) { Point2D.Double point = (Point2D.Double)sectors.get(counter); double degreeone = point.getX(); double degreetwo = point.getY(); int xone = (int)(fmin * Math.cos(Math.toRadians(degreeone))); int yone = (int)(fmax * Math.sin(Math.toRadians(degreeone))); generalPath.moveTo(newx+xone, newy-yone); generalPath.lineTo(newx-xone, newy+yone); int xtwo = (int)(fmin * Math.cos(Math.toRadians(degreetwo))); int ytwo = (int)(fmax * Math.sin(Math.toRadians(degreetwo))); generalPath.lineTo(newx-xtwo, newy+ytwo); generalPath.lineTo(newx+xtwo, newy-ytwo); generalPath.lineTo(newx+xone, newy-yone); } return (Shape)generalPath; }// |
public void paintComponent(Graphics g) { | public synchronized void paintComponent(Graphics g) { | public void paintComponent(Graphics g) { // if(setSelected == 1) g.setColor(Color.red); //else if(setSelected == 2) g.setColor(getBackground()); Graphics2D graphics2D = (Graphics2D)g; logger.debug("IN PAINT COMPONENT"); if(startPoint != null && endPoint != null) { graphics2D.setColor(Color.yellow); //logger.debug("Start Point "+startPoint.getX()+" "+startPoint.getY()); //logger.debug("End Point "+endPoint.getX()+" "+endPoint.getY()); java.awt.geom.Rectangle2D.Double rect = new java.awt.geom.Rectangle2D.Double(startPoint.getX(), startPoint.getY(), endPoint.getX() - startPoint.getX(), endPoint.getY() - startPoint.getY()); graphics2D.fill(rect); graphics2D.draw(rect); } int size = displays.size(); //first draw the azimuth if one of the display is horizontal plane for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); if(!displayKeys.contains(particleMotion.key)) continue; drawAzimuth(particleMotion, graphics2D); } Date startTime = Calendar.getInstance().getTime(); for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); //if(!getDisplayKey().equals(particleMotion.key)) continue; if(!displayKeys.contains(particleMotion.key)) continue; if(particleMotion.isSelected()) continue; drawParticleMotion(particleMotion, graphics2D); }//end of for System.out.println("ENd of the for"); for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); //if(!getDisplayKey().equals(particleMotion.key)) continue; if(!displayKeys.contains(particleMotion.key)) continue; //drawAzimuth(particleMotion, graphics2D); if(particleMotion.isSelected()) { particleMotion.setSelected(false); drawParticleMotion(particleMotion, g); } } Date endTime = Calendar.getInstance().getTime(); System.out.println("THE TIME TAKEN IS ********** "+ (endTime.getTime() - startTime.getTime())); } |
public void resize() { | public synchronized void resize() { | public void resize() { setSize(super.getSize()); //particleMotionDisplay.resize(); recalculateValues = true; repaint(); } |
public void updateTimeRange() { | public synchronized void updateTimeRange() { | public void updateTimeRange() { hunitRangeImpl = new UnitRangeImpl(getMinHorizontalAmplitude(), getMaxHorizontalAmplitude(), UnitImpl.COUNT); vunitRangeImpl = new UnitRangeImpl(getMinVerticalAmplitude(), getMaxVerticalAmplitude(), UnitImpl.COUNT); particleMotionDisplay.updateHorizontalAmpScale(hunitRangeImpl); particleMotionDisplay.updateVerticalAmpScale(vunitRangeImpl); } |
public void zoomInParticleMotionDisplay(int clickCount, int mx, int my) { | public synchronized void zoomInParticleMotionDisplay(int clickCount, int mx, int my) { | public void zoomInParticleMotionDisplay(int clickCount, int mx, int my) { double hmin = hunitRangeImpl.getMinValue(); double hmax = hunitRangeImpl.getMaxValue(); double vmin = vunitRangeImpl.getMinValue(); double vmax = vunitRangeImpl.getMaxValue(); if(hmin > hmax) { double temp = hmax; hmax = hmin; hmin = temp;} if(vmin > vmax) { double temp = vmax; vmax = vmin; vmin = temp;} Insets insets = getInsets(); double width = super.getSize().getWidth() - insets.left - insets.right; double height = super.getSize().getHeight() - insets.top - insets.bottom; int centerx, centery; if(clickCount == 1) { centerx = (int)((hmax - hmin) / 4); centery = (int)((vmax - vmin) / 4); } else { centerx = (int)((hmax - hmin) / 4); centery = (int)((hmax - hmin) / 4); } int xone = (int)(((hmax - hmin)/width * mx) + hmin); int yone = (int)(((vmin - vmax)/height * my) + vmax); logger.debug("----------------------------------------------------------"); logger.debug("clickCount = "+clickCount); logger.debug(" hmin = "+hmin+" hmax = "+hmax); logger.debug(" vmin = "+vmin+" vmax = "+vmax); logger.debug(" xone = "+xone+" yone = "+yone); logger.debug(" bcenterx = "+centerx+" bcentery = "+centery); if(clickCount == 1) { if(xone < 0) centerx = -centerx; if(yone < 0) centery = -centery; } else { //if(hmin < 0 ) centerx = -centerx; // if(vmin < 0) centery = -centery; } int xa, xs, ya, ys; if(clickCount == 1) { xa = xone - centerx; xs = xone + centerx; ya = yone - centery; ys = yone + centery; } else { if(centerx < 0) centerx = -centerx; if(centery < 0) centery = -centery; xa = (int)hmin - centerx; xs = (int)hmax + centerx; ya = (int)vmin - centery; ys = (int)vmax + centery; if((xs - xa) < 50){ xs = xs + 50; xa = xa - 50;} if((ys - ya) < 50) { ys = ys + 50; ya = ya - 50;} } if(xa > xs) { int temp = xs; xs = xa; xa = temp;} if(ya > ys) {int temp = ys; ys = ya; ya = temp;} logger.debug(" acenterx = "+centerx+" acentery = "+centery); logger.debug(" xa = "+xa+" xs = "+xs); logger.debug(" ya = "+ya+" ys = "+ys); //int xtwo = (int)(((hmax - hmin)/width * endPoint.getX()) - hmax); //int ytwo = (int)(((vmin - vmax)/height * endPoint.getY()) + vmax); startPoint = null; endPoint = null; if(xa < xs && ya < ys || clickCount != 1) { System.out.println("The Zooming takes place"); particleMotionDisplay.updateHorizontalAmpScale(new UnitRangeImpl(xa, xs, UnitImpl.COUNT)); particleMotionDisplay.updateVerticalAmpScale(new UnitRangeImpl(ya, ys, UnitImpl.COUNT)); vunitRangeImpl = new UnitRangeImpl(ya, ys, UnitImpl.COUNT); hunitRangeImpl = new UnitRangeImpl(xa, xs, UnitImpl.COUNT); particleMotionDisplay.fireAmpRangeEvent(new AmpSyncEvent(ya, ys, true)); } else System.out.println("NO ZOOMING"); } |
sb.append(", parent="); if (parent == null) { sb.append("null"); } else { sb.append(parent.getId()); } | public String toString() { StringBuffer sb = new StringBuffer(); sb.append("BwCategoryFilter{id="); sb.append(id); sb.append(", name="); sb.append(getName()); sb.append("}"); return sb.toString(); } |
|
String name = request.getParameter("name"); | String name = getReqPar(request, "name"); | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.fetchSvci(); String name = request.getParameter("name"); if (name == null) { form.getErr().emit("org.bedework.client.error.missingfield", "name"); return "error"; } boolean makeDefaultView = false; String str = request.getParameter("makedefaultview"); if (str != null) { makeDefaultView = str.equals("y"); } BwView view = new BwView(); view.setName(name); if (!svc.addView(view, makeDefaultView)) { form.getErr().emit("org.bedework.client.error.viewnotadded"); return "notAdded"; } form.setView(view); form.setSubscriptions(svc.getSubscriptions()); return "success"; } |
return "error"; | return "notAdded"; | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.fetchSvci(); String name = request.getParameter("name"); if (name == null) { form.getErr().emit("org.bedework.client.error.missingfield", "name"); return "error"; } boolean makeDefaultView = false; String str = request.getParameter("makedefaultview"); if (str != null) { makeDefaultView = str.equals("y"); } BwView view = new BwView(); view.setName(name); if (!svc.addView(view, makeDefaultView)) { form.getErr().emit("org.bedework.client.error.viewnotadded"); return "notAdded"; } form.setView(view); form.setSubscriptions(svc.getSubscriptions()); return "success"; } |
String str = request.getParameter("makedefaultview"); | String str = getReqPar(request, "makedefaultview"); | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.fetchSvci(); String name = request.getParameter("name"); if (name == null) { form.getErr().emit("org.bedework.client.error.missingfield", "name"); return "error"; } boolean makeDefaultView = false; String str = request.getParameter("makedefaultview"); if (str != null) { makeDefaultView = str.equals("y"); } BwView view = new BwView(); view.setName(name); if (!svc.addView(view, makeDefaultView)) { form.getErr().emit("org.bedework.client.error.viewnotadded"); return "notAdded"; } form.setView(view); form.setSubscriptions(svc.getSubscriptions()); return "success"; } |
timeRegistrar.addSeismogram(newSeismogram); ampRegistrar.addSeismogram(newSeismogram); | public void addSeismogram(DataSetSeismogram newSeismogram){ seismos.add(newSeismogram); SeismogramPlotter newPlotter; if (autoColor) { newPlotter = new SeismogramPlotter(newSeismogram, seisColors[seisCount%seisColors.length]); }else { newPlotter = new SeismogramPlotter(newSeismogram, Color.blue); } // end of else if(parent != null) newPlotter.setVisibility(parent.getOriginalVisibility()); plotters.add(seisCount, newPlotter); seisCount++; Iterator e = globalFilters.iterator(); while(e.hasNext()){ applyFilter((ColoredFilter)e.next()); } timeRegistrar.addSeismogram(newSeismogram); ampRegistrar.addSeismogram(newSeismogram); redo = true; } |
|
privateThread = new Thread(r); | privateThread = new Thread(seisLoaderThreadGroup, r, "Seismogram Loader"+getThreadNum()); | public SeismogramBackgroundLoader(SeismogramBackgroundLoaderPool pool) { this.pool = pool; Runnable r = new Runnable() { public void run() { try { runWork(); } catch (Exception e) { e.printStackTrace(); } } }; privateThread = new Thread(r); privateThread.start(); } |
System.out.println("yMin = "+yMin+ " yMax = "+yMax+" height = "+size.height); | protected static void scaleYvalues(int[][] comp, LocalSeismogram seismogram, MicroSecondTimeRange tr, UnitRangeImpl ampRange, Dimension size) { LocalSeismogramImpl seis = (LocalSeismogramImpl)seismogram; double yMin = ampRange.getMinValue(); double yMax = ampRange.getMaxValue(); System.out.println("yMin = "+yMin+ " yMax = "+yMax+" height = "+size.height); for( int i =0 ; i < comp[1].length; i++) { //System.out.println(" before "+comp[1][i]); comp[1][i] = Math.round((float)(linearInterp(yMin, 0, yMax, size.height, comp[1][i]))); // System.out.println(" after "+comp[1][i]); } // flipArray(comp[1], size.height); } |
|
return createSpike(new MicroSecondDate()); | return createSpike(ClockUtil.now()); | public static LocalSeismogramImpl createSpike() { return createSpike(new MicroSecondDate()); } |
ATObject result = getValue(); | ATObject result = getFieldValue(); | public ATObject setValue(ATObject newValue) throws NATException { ATObject result = getValue(); frame_.meta_assignField(name_, newValue); return result; } |
this.setBackground(Color.white); this.setForeground(Color.white); | public ParticleMotionView (final DataSetSeismogram hseis, DataSetSeismogram vseis, TimeConfigRegistrar timeRegistrar, final AmpConfigRegistrar hAmpConfigRegistrar, AmpConfigRegistrar vAmpConfigRegistrar, ParticleMotionDisplay particleMotionDisplay, Color color, String key, boolean horizPlane){ this.particleMotionDisplay = particleMotionDisplay; ParticleMotion particleMotion = new ParticleMotion(hseis, vseis, timeRegistrar, hAmpConfigRegistrar, vAmpConfigRegistrar, color, key, horizPlane); displays.add(particleMotion); vunitRangeImpl = vAmpConfigRegistrar.getAmpRange(vseis); hunitRangeImpl = hAmpConfigRegistrar.getAmpRange(vseis); this.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent me) { int clickCount = 0; if(zoomIn) { clickCount = 1; } if(zoomOut) { clickCount = 2; } zoomInParticleMotionDisplay(clickCount, me.getX(), me.getY()); startPoint = null; endPoint = null; } public void mousePressed(MouseEvent me) { startPoint = new java.awt.geom.Point2D.Float((float)me.getX(), (float)me.getY()); } }); this.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { resize(); } public void componentShown(ComponentEvent e) { resize(); } }); this.addMouseMotionListener(new MouseMotionAdapter() { public void mouseDragged(MouseEvent me) { endPoint = new java.awt.geom.Point2D.Float((float)me.getX(), (float)me.getY()); repaint(); } }); } |
|
Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; | Color color = new Color(0, 0, 0, 128); | public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 10; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); int x = (dimension.width - font.getSize() * 3) / 2; int y = dimension.height - 4; graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); x = font.getSize(); y = (dimension.height) / 2; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); } |
float fontSize = dimension.width / 10; | float fontSize = dimension.width / 20; | public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 10; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); int x = (dimension.width - font.getSize() * 3) / 2; int y = dimension.height - 4; graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); x = font.getSize(); y = (dimension.height) / 2; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); } |
int x = (dimension.width - font.getSize() * 3) / 2; | String labelStr = new String(); labelStr = particleMotion.hseis.getSeismogram().getName(); int x = (dimension.width - (int)(labelStr.length()*fontSize)) / 2 - getInsets().left - getInsets().right; | public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 10; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); int x = (dimension.width - font.getSize() * 3) / 2; int y = dimension.height - 4; graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); x = font.getSize(); y = (dimension.height) / 2; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); } |
graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); | graphics2D.drawString(labelStr, x, y); labelStr = particleMotion.vseis.getSeismogram().getName(); | public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 10; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); int x = (dimension.width - font.getSize() * 3) / 2; int y = dimension.height - 4; graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); x = font.getSize(); y = (dimension.height) / 2; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); } |
y = (dimension.height) / 2; | y = (dimension.height - (int)(labelStr.length()*fontSize)) / 2 - getInsets().top - getInsets().bottom; | public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 10; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); int x = (dimension.width - font.getSize() * 3) / 2; int y = dimension.height - 4; graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); x = font.getSize(); y = (dimension.height) / 2; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); } |
graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); | graphics2D.transform(AffineTransform.getRotateInstance(Math.PI/2)); graphics2D.drawString(labelStr, 0, 0); | public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 10; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); int x = (dimension.width - font.getSize() * 3) / 2; int y = dimension.height - 4; graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); x = font.getSize(); y = (dimension.height) / 2; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); } |
form.getErr().emit("org.bedework.client.missingfield", "name"); | form.getErr().emit("org.bedework.client.error.missingfield", "name"); | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String name = request.getParameter("name"); if (name == null) { form.getErr().emit("org.bedework.client.missingfield", "name"); return "error"; } BwView view = svc.findView(name); if (view == null) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } svc.removeView(view); return "success"; } |
form.getErr().emit("org.bedework.client.notfound", name); | form.getErr().emit("org.bedework.client.error.viewnotfound", name); | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String name = request.getParameter("name"); if (name == null) { form.getErr().emit("org.bedework.client.missingfield", "name"); return "error"; } BwView view = svc.findView(name); if (view == null) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } svc.removeView(view); return "success"; } |
setHorizontalTitle(view.getSelectedParticleMotion()[0].hseis.getSeismogram().getName()); setVerticalTitle(view.getSelectedParticleMotion()[0].vseis.getSeismogram().getName()); | setHorizontalTitle(view.getSelectedParticleMotion()[0].hseis.getName()); setVerticalTitle(view.getSelectedParticleMotion()[0].vseis.getName()); | public void itemStateChanged(ItemEvent ae) { if(ae.getStateChange() == ItemEvent.SELECTED) { view.addDisplayKey(((AbstractButton)ae.getItem()).getText()); setHorizontalTitle(view.getSelectedParticleMotion()[0].hseis.getSeismogram().getName()); setVerticalTitle(view.getSelectedParticleMotion()[0].vseis.getSeismogram().getName()); view.updateTime(); } else if(ae.getStateChange() == ItemEvent.DESELECTED){ System.out.println("The radiobutton UN SELECTED is "+ ((AbstractButton)ae.getItem()).getText()); view.removeDisplaykey(((AbstractButton)ae.getItem()).getText()); } //view.setDisplayKey(ae.getActionCommand()); repaint(); } |
if (form.getGuest()) { | if (!form.getUserAuth().isSuperUser()) { | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } str = request.getParameter("view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = request.getParameter("viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = request.getParameter("skin"); if (str != null) { prefs.setSkinName(str); } str = request.getParameter("skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; } |
BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); | String str = getReqPar(request, "user"); if (str == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } str = request.getParameter("view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = request.getParameter("viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = request.getParameter("skin"); if (str != null) { prefs.setSkinName(str); } str = request.getParameter("skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; } |
str = request.getParameter("view"); | BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } BwPreferences prefs = svc.getUserPrefs(user); str = getReqPar(request, "view"); | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } str = request.getParameter("view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = request.getParameter("viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = request.getParameter("skin"); if (str != null) { prefs.setSkinName(str); } str = request.getParameter("skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; } |
str = request.getParameter("viewPeriod"); | str = getReqPar(request, "viewPeriod"); | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } str = request.getParameter("view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = request.getParameter("viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = request.getParameter("skin"); if (str != null) { prefs.setSkinName(str); } str = request.getParameter("skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; } |
str = request.getParameter("skin"); | str = getReqPar(request, "skin"); | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } str = request.getParameter("view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = request.getParameter("viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = request.getParameter("skin"); if (str != null) { prefs.setSkinName(str); } str = request.getParameter("skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; } |
str = request.getParameter("skinStyle"); | str = getReqPar(request, "skinStyle"); | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } str = request.getParameter("view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = request.getParameter("viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = request.getParameter("skin"); if (str != null) { prefs.setSkinName(str); } str = request.getParameter("skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; } |
long overEndTime = overTimeRange.getEndTime().getMicroSecondTime(); long overBeginTime = overTimeRange.getBeginTime().getMicroSecondTime(); | public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); long overEndTime = overTimeRange.getEndTime().getMicroSecondTime(); long overBeginTime = overTimeRange.getBeginTime().getMicroSecondTime(); Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ if(endTime >= overEndTime || beginTime <= overBeginTime){ logger.debug("the image has been dragged past its edge and is being recreated"); this.createImage(); return; } double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * overSize.getWidth(); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); g2.drawImage(((Image)overSizedImage.get()), tx, null); } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); } } |
|
if(endTime >= overEndTime || beginTime <= overBeginTime){ logger.debug("the image has been dragged past its edge and is being recreated"); | double offset = (beginTime - overBeginTime)/ (double)(overTimeInterval) * overSize.getWidth(); g2.drawImage(((Image)overSizedImage.get()), AffineTransform.getTranslateInstance(-offset, 0.0), null); if(redo) | public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); long overEndTime = overTimeRange.getEndTime().getMicroSecondTime(); long overBeginTime = overTimeRange.getBeginTime().getMicroSecondTime(); Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ if(endTime >= overEndTime || beginTime <= overBeginTime){ logger.debug("the image has been dragged past its edge and is being recreated"); this.createImage(); return; } double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * overSize.getWidth(); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); g2.drawImage(((Image)overSizedImage.get()), tx, null); } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); } } |
return; } double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * overSize.getWidth(); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); g2.drawImage(((Image)overSizedImage.get()), tx, null); | redo = false; | public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); long overEndTime = overTimeRange.getEndTime().getMicroSecondTime(); long overBeginTime = overTimeRange.getBeginTime().getMicroSecondTime(); Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ if(endTime >= overEndTime || beginTime <= overBeginTime){ logger.debug("the image has been dragged past its edge and is being recreated"); this.createImage(); return; } double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * overSize.getWidth(); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); g2.drawImage(((Image)overSizedImage.get()), tx, null); } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); } } |
double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * (overSize.getWidth() * scale); | double offset = (beginTime - overBeginTime)/ (double)(overTimeInterval) * (overSize.getWidth() * scale); | public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); long overEndTime = overTimeRange.getEndTime().getMicroSecondTime(); long overBeginTime = overTimeRange.getBeginTime().getMicroSecondTime(); Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ if(endTime >= overEndTime || beginTime <= overBeginTime){ logger.debug("the image has been dragged past its edge and is being recreated"); this.createImage(); return; } double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * overSize.getWidth(); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); g2.drawImage(((Image)overSizedImage.get()), tx, null); } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); } } |
NetworkAccess[] storedNets = (NetworkAccess[])netDCToNetMap.get(netdc); if ( storedNets == null) { netDCToNetMap.put(netdc, nets); } else { NetworkAccess[] tmp = new NetworkAccess[storedNets.length+nets.length]; System.arraycopy(storedNets, 0, tmp, 0, storedNets.length); System.arraycopy(nets, 0, tmp, storedNets.length, nets.length); netDCToNetMap.put(netdc, tmp); } | public void run() { setProgressOwner(this); CacheNetworkAccess cache; logger.debug("Before networks"); if(configuredNetworks == null || configuredNetworks.length == 0) { NetworkAccess[] nets = netdc.a_finder().retrieve_all(); netDCToNetMap.put(netdc, nets); setProgressMax(this, nets.length+1); int progressVal = 1; setProgressValue(this, progressVal); progressVal++; logger.debug("Got all networks, num="+nets.length); for (int i=0; i<nets.length; i++) { // skip null networks...probably a bug on the server if (nets[i] != null) { // cache = new CacheNetworkAccess(nets[i]); cache = new DNDNetworkAccess(nets[i]); NetworkAttr attr = cache.get_attributes(); logger.debug("Got attributes "+attr.get_code()); // preload attributes networks.addElement(cache); } else { logger.warn("a networkaccess returned from NetworkFinder.retrieve_all() is null, skipping."); } // end of else setProgressValue(this, progressVal); progressVal++; } if (doSelect && nets.length == 1) { networkList.getSelectionModel().setSelectionInterval(0,0); } // end of if (nets.length = 1) } else { //when the channelChooser is configured with networkCodes.... int totalNetworks = 0; setProgressMax(this, configuredNetworks.length); for(int counter = 0; counter < configuredNetworks.length; counter++) { try { logger.debug("Getting network for "+configuredNetworks[counter]); NetworkAccess[] nets = netdc.a_finder().retrieve_by_code(configuredNetworks[counter]); logger.debug("Got "+nets.length+" networks for "+configuredNetworks[counter]); for(int subCounter = 0; subCounter < nets.length; subCounter++) { if (nets[subCounter] != null) { // cache = new CacheNetworkAccess(nets[subCounter]); cache = new DNDNetworkAccess(nets[subCounter]); NetworkAttr attr = cache.get_attributes(); logger.debug("Got attributes "+attr.get_code()); // preload attributes networks.addElement(cache); totalNetworks++; } else { logger.warn("a networkaccess returned from NetworkFinder.retrieve_by_code is null, skipping."); } // end of else }//end of inner for subCounter = 0; }catch(NetworkNotFound nnfe) { logger.warn("Network "+configuredNetworks[counter]+" not found while getting network access uding NetworkFinder.retrieve_by_code"); } setProgressValue(this, counter+1); }//end of outer for counter = 0; if (doSelect && totalNetworks == 1) { networkList.getSelectionModel().setSelectionInterval(0,0); } // end of if (totalNetworks == 1) }//end of if else checking for configuredNetworks == null setProgressValue(this, progressBar.getMaximum()); } |
|
logger.debug("after prune channels, length="+inChannels.length); | public Channel[] getSelectedChannels(MicroSecondDate when){ Channel[] inChannels = getChannels(); inChannels = BestChannelUtil.pruneChannels(inChannels, when); return getSelectedChannels(inChannels, when); } |
|
traceString += getStackTrace(((WrappedException)exception).getCausalException()); | WrappedException we = (WrappedException)exception; if (we.getCausalException() != null) { traceString += getStackTrace(we.getCausalException()); } | public static void handleException(Exception exception) { JTabbedPane tabbedPane = new JTabbedPane(); JFrame displayFrame = new JFrame("Exception Handler"); JPanel messagePanel = new JPanel(); JLabel exceptionMessageLabel = new JLabel(); JTextArea messageArea = new JTextArea(); messageArea.setLineWrap(true); messageArea.setFont(new Font("BookManOldSytle", Font.BOLD, 12)); messageArea.setWrapStyleWord(true); messageArea.setEditable(false); exceptionMessageLabel.setText(exception.toString()); messagePanel.setLayout(new BorderLayout()); messagePanel.add(exceptionMessageLabel); tabbedPane.addTab("information", messagePanel); JPanel stackTracePanel = new JPanel(); JScrollPane scrollPane = new JScrollPane(stackTracePanel); String traceString = ""; if (exception instanceof WrappedException) { traceString += getStackTrace(((WrappedException)exception).getCausalException()); } traceString += getStackTrace(exception); messageArea.setText(traceString); stackTracePanel.setLayout(new BorderLayout()); stackTracePanel.add(messageArea); tabbedPane.addTab("stackTrace", scrollPane); java.awt.Dimension dimension = new java.awt.Dimension(600, 400); tabbedPane.setPreferredSize(dimension); tabbedPane.setMinimumSize(dimension); displayFrame.getContentPane().add(tabbedPane); displayFrame.setSize(400,400); displayFrame.pack(); displayFrame.show(); } |
return cache.get_preferred_origin().origin_time.date_time; | edu.iris.Fissures.Time fisDate = cache.get_preferred_origin().origin_time; MicroSecondDate msd = new MicroSecondDate(fisDate); return msd.toString(); | public Object getValueAt(int row, int col) { if ( ! isRowCached(row)) { return "..."; } CacheEvent cache = getEventForRow(row); try { switch (col) { case NAME: if (cache.get_attributes() == null) { return ""; } return cache.get_attributes().name; case FEREGION: if (cache.get_attributes() == null) { return ""; } return new Integer(cache.get_attributes().region.number); case CATALOG: return cache.get_preferred_origin().catalog; case CONTRIBUTOR: return cache.get_preferred_origin().contributor; case LATITUDE: return new Float(cache.get_preferred_origin().my_location.latitude); case LONGITUDE: return new Float(cache.get_preferred_origin().my_location.longitude); case DEPTH: QuantityImpl q = (QuantityImpl)cache.get_preferred_origin().my_location.depth; q = q.convertTo(UnitImpl.KILOMETER); return depthFormat.format(q.getValue())+" km"; case ORIGINTIME: return cache.get_preferred_origin().origin_time.date_time; case MAGTYPE: return cache.get_preferred_origin().magnitudes[0].type; case MAGVALUE: return new Float(cache.get_preferred_origin().magnitudes[0].value); default: return "XXXX"; } } catch (NoPreferredOrigin e) { return "No Pref Origin"; } } |
return cache.get_preferred_origin().magnitudes[0].type; | String type = cache.get_preferred_origin().magnitudes[0].type; if (type.equals(edu.iris.Fissures.MB_MAG_TYPE.value)) { return "mb"; } if (type.equals(edu.iris.Fissures.ML_MAG_TYPE.value)) { return "ml"; } if (type.equals(edu.iris.Fissures.MBMLE_MAG_TYPE.value)) { return "mbmle"; } if (type.equals(edu.iris.Fissures.MO_MAG_TYPE.value)) { return "MO"; } if (type.equals(edu.iris.Fissures.MS_MAG_TYPE.value)) { return "Ms"; } if (type.equals(edu.iris.Fissures.MSMLE_MAG_TYPE.value)) { return "msmle"; } if (type.equals(edu.iris.Fissures.MW_MAG_TYPE.value)) { return "MW"; } return type; | public Object getValueAt(int row, int col) { if ( ! isRowCached(row)) { return "..."; } CacheEvent cache = getEventForRow(row); try { switch (col) { case NAME: if (cache.get_attributes() == null) { return ""; } return cache.get_attributes().name; case FEREGION: if (cache.get_attributes() == null) { return ""; } return new Integer(cache.get_attributes().region.number); case CATALOG: return cache.get_preferred_origin().catalog; case CONTRIBUTOR: return cache.get_preferred_origin().contributor; case LATITUDE: return new Float(cache.get_preferred_origin().my_location.latitude); case LONGITUDE: return new Float(cache.get_preferred_origin().my_location.longitude); case DEPTH: QuantityImpl q = (QuantityImpl)cache.get_preferred_origin().my_location.depth; q = q.convertTo(UnitImpl.KILOMETER); return depthFormat.format(q.getValue())+" km"; case ORIGINTIME: return cache.get_preferred_origin().origin_time.date_time; case MAGTYPE: return cache.get_preferred_origin().magnitudes[0].type; case MAGVALUE: return new Float(cache.get_preferred_origin().magnitudes[0].value); default: return "XXXX"; } } catch (NoPreferredOrigin e) { return "No Pref Origin"; } } |
public static JLabel getAmpLabel(){ return amp; } | public static JLabel getAmpLabel(){ return ampLabel; } | public static JLabel getAmpLabel(){ return amp; } |
return time.getText() + amp.getText(); | return timeLabel.getText() + ampLabel.getText(); | public static String getLabelText(){ return time.getText() + amp.getText(); } |
public static JLabel getTimeLabel(){ return time; } | public static JLabel getTimeLabel(){ return timeLabel; } | public static JLabel getTimeLabel(){ return time; } |
time.setText(" Time: "); amp.setText(" Amp: "); | timeLabel.setText(" Time: "); ampLabel.setText(" Amp: "); | public void removeAll(){ logger.debug("removing all displays"); super.removeAll(); basicDisplays.clear(); sorter = new SeismogramSorter(); globalRegistrar = null; time.setText(" Time: "); amp.setText(" Amp: "); repaint(); } |
public void setLabels(MicroSecondDate newTime, QuantityImpl newAmp){ calendar.setTime(newTime); if(output.format(calendar.getTime()).length() == 21) time.setText("Time: " + output.format(calendar.getTime()) + "00"); else if(output.format(calendar.getTime()).length() == 22) time.setText("Time: " + output.format(calendar.getTime()) + "0"); else time.setText("Time: " + output.format(calendar.getTime())); | public void setLabels(MicroSecondDate newTime, QuantityImpl newAmp, UnitRangeImpl ampRange){ if(curAmpRange != ampRange){ double absMax = Math.abs(ampRange.getMaxValue()); double absMin = Math.abs(ampRange.getMinValue()); double maxVal; if(absMax > absMin){ maxVal = absMax; }else{ maxVal = absMin; } if(maxVal < 1){ formatter = new DecimalFormat(" 0.###E0;-0.###E0"); }else{ StringBuffer formatPattern = new StringBuffer(" 0.00;-0.00"); while(maxVal > 10){ formatPattern.insert(1,"0"); formatPattern.insert(formatPattern.length() - 4, "0"); maxVal /= 10; } formatter = new DecimalFormat(formatPattern.toString()); } curAmpRange = ampRange; } | public void setLabels(MicroSecondDate newTime, QuantityImpl newAmp){ calendar.setTime(newTime); if(output.format(calendar.getTime()).length() == 21) time.setText("Time: " + output.format(calendar.getTime()) + "00"); else if(output.format(calendar.getTime()).length() == 22) time.setText("Time: " + output.format(calendar.getTime()) + "0"); else time.setText("Time: " + output.format(calendar.getTime())); double newAmpVal = newAmp.getValue(); String ampString = amplitude; if(Math.abs(newAmpVal) < .001) { ampString += ampFormatExp.format(newAmpVal); } else { ampString += ampFormat.format(newAmpVal); } amp.setText(ampString+" "+ unitDisplayUtil.getNameForUnit(newAmp.getUnit())); } |
if(Math.abs(newAmpVal) < .001) { ampString += ampFormatExp.format(newAmpVal); } else { ampString += ampFormat.format(newAmpVal); | ampString += formatter.format(newAmpVal); ampLabel.setText(ampString+" "+ unitDisplayUtil.getNameForUnit(newAmp.getUnit())); calendar.setTime(newTime); StringBuffer timeString = new StringBuffer(ampLabel.getText().length()); if(output.format(calendar.getTime()).length() == 21) timeString.append(output.format(calendar.getTime()) + "00"); else if(output.format(calendar.getTime()).length() == 22) timeString.append(output.format(calendar.getTime()) + "0"); else timeString.append(output.format(calendar.getTime())); int numSpaces = ampLabel.getText().length() - timeString.length() - 10; if(numSpaces < 0){ timeString.insert(0, "Time:"); timeLabel.setText(timeString.toString()); }else{ StringBuffer spaces = new StringBuffer(numSpaces); for (int i = 0; i < numSpaces; i++){ spaces.append(" "); } timeString.insert(0, spaces); timeString.insert(0, "Time:"); timeLabel.setText(timeString.toString()); | public void setLabels(MicroSecondDate newTime, QuantityImpl newAmp){ calendar.setTime(newTime); if(output.format(calendar.getTime()).length() == 21) time.setText("Time: " + output.format(calendar.getTime()) + "00"); else if(output.format(calendar.getTime()).length() == 22) time.setText("Time: " + output.format(calendar.getTime()) + "0"); else time.setText("Time: " + output.format(calendar.getTime())); double newAmpVal = newAmp.getValue(); String ampString = amplitude; if(Math.abs(newAmpVal) < .001) { ampString += ampFormatExp.format(newAmpVal); } else { ampString += ampFormat.format(newAmpVal); } amp.setText(ampString+" "+ unitDisplayUtil.getNameForUnit(newAmp.getUnit())); } |
amp.setText(ampString+" "+ unitDisplayUtil.getNameForUnit(newAmp.getUnit())); | public void setLabels(MicroSecondDate newTime, QuantityImpl newAmp){ calendar.setTime(newTime); if(output.format(calendar.getTime()).length() == 21) time.setText("Time: " + output.format(calendar.getTime()) + "00"); else if(output.format(calendar.getTime()).length() == 22) time.setText("Time: " + output.format(calendar.getTime()) + "0"); else time.setText("Time: " + output.format(calendar.getTime())); double newAmpVal = newAmp.getValue(); String ampString = amplitude; if(Math.abs(newAmpVal) < .001) { ampString += ampFormatExp.format(newAmpVal); } else { ampString += ampFormat.format(newAmpVal); } amp.setText(ampString+" "+ unitDisplayUtil.getNameForUnit(newAmp.getUnit())); } |
|
}else if(xPixels.length == 1){ GeneralPath currentShape = new GeneralPath(GeneralPath.WIND_EVEN_ODD, 2); currentShape.moveTo(0, yPixels[0]); currentShape.lineTo(size.width, yPixels[0]); return currentShape; | public Shape draw(Dimension size){ MicroSecondTimeRange overTimeRange = timeConfig.getTimeRange(seismogram).getOversizedTimeRange(3); try{ int[][] pixels = SimplePlotUtil.compressYvalues(seismogram, overTimeRange, ampConfig.getAmpRange(seismogram), size); SimplePlotUtil.scaleYvalues(pixels, seismogram, overTimeRange, ampConfig.getAmpRange(seismogram), size); int[] xPixels = pixels[0]; int[] yPixels = pixels[1]; if(xPixels.length >= 2){ GeneralPath currentShape = new GeneralPath(GeneralPath.WIND_EVEN_ODD, xPixels.length - 1); currentShape.moveTo(xPixels[0], yPixels[0]); for(int i = 1; i < xPixels.length; i++) currentShape.lineTo(xPixels[i], yPixels[i]); return currentShape; } } catch(Exception e){ e.printStackTrace(); } return new GeneralPath(); } |
|
GeneralPath currentShape = new GeneralPath(); int scale = 5; int w = size.width, h = size.height; Dimension mySize = new Dimension(w, h); int[] xPixels = null; int[] yPixels = null; int[][] pixels; MicroSecondTimeRange overTimeRange = timeConfig.getTimeRange(seismogram).getOversizedTimeRange((scale -1)/2); | MicroSecondTimeRange overTimeRange = timeConfig.getTimeRange(seismogram).getOversizedTimeRange(3); | public Shape draw(Dimension size){ GeneralPath currentShape = new GeneralPath(); int scale = 5; int w = size.width, h = size.height; Dimension mySize = new Dimension(w, h); int[] xPixels = null; int[] yPixels = null; int[][] pixels; MicroSecondTimeRange overTimeRange = timeConfig.getTimeRange(seismogram).getOversizedTimeRange((scale -1)/2); try{ pixels = SeisPlotUtil.calculatePlottable(seismogram, ampConfig.getAmpRange(seismogram), overTimeRange, mySize); xPixels = pixels[0]; yPixels = pixels[1]; SeisPlotUtil.flipArray(yPixels, mySize.height); if(xPixels.length >= 1) currentShape.moveTo(xPixels[0], yPixels[0]); for(int i = 1; i < xPixels.length; i++) currentShape.lineTo(xPixels[i], yPixels[i]); } catch(Exception e){ e.printStackTrace(); } return currentShape; } |
pixels = SeisPlotUtil.calculatePlottable(seismogram, ampConfig.getAmpRange(seismogram), overTimeRange, mySize); xPixels = pixels[0]; yPixels = pixels[1]; SeisPlotUtil.flipArray(yPixels, mySize.height); | int[][] pixels = SimplePlotUtil.compressYvalues(seismogram, overTimeRange, ampConfig.getAmpRange(seismogram), size); SimplePlotUtil.scaleYvalues(pixels, seismogram, overTimeRange, ampConfig.getAmpRange(seismogram), size); int[] xPixels = pixels[0]; int[] yPixels = pixels[1]; GeneralPath currentShape = new GeneralPath(GeneralPath.WIND_EVEN_ODD, xPixels.length - 1); | public Shape draw(Dimension size){ GeneralPath currentShape = new GeneralPath(); int scale = 5; int w = size.width, h = size.height; Dimension mySize = new Dimension(w, h); int[] xPixels = null; int[] yPixels = null; int[][] pixels; MicroSecondTimeRange overTimeRange = timeConfig.getTimeRange(seismogram).getOversizedTimeRange((scale -1)/2); try{ pixels = SeisPlotUtil.calculatePlottable(seismogram, ampConfig.getAmpRange(seismogram), overTimeRange, mySize); xPixels = pixels[0]; yPixels = pixels[1]; SeisPlotUtil.flipArray(yPixels, mySize.height); if(xPixels.length >= 1) currentShape.moveTo(xPixels[0], yPixels[0]); for(int i = 1; i < xPixels.length; i++) currentShape.lineTo(xPixels[i], yPixels[i]); } catch(Exception e){ e.printStackTrace(); } return currentShape; } |
currentShape.lineTo(xPixels[i], yPixels[i]); | currentShape.lineTo(xPixels[i], yPixels[i]); return currentShape; | public Shape draw(Dimension size){ GeneralPath currentShape = new GeneralPath(); int scale = 5; int w = size.width, h = size.height; Dimension mySize = new Dimension(w, h); int[] xPixels = null; int[] yPixels = null; int[][] pixels; MicroSecondTimeRange overTimeRange = timeConfig.getTimeRange(seismogram).getOversizedTimeRange((scale -1)/2); try{ pixels = SeisPlotUtil.calculatePlottable(seismogram, ampConfig.getAmpRange(seismogram), overTimeRange, mySize); xPixels = pixels[0]; yPixels = pixels[1]; SeisPlotUtil.flipArray(yPixels, mySize.height); if(xPixels.length >= 1) currentShape.moveTo(xPixels[0], yPixels[0]); for(int i = 1; i < xPixels.length; i++) currentShape.lineTo(xPixels[i], yPixels[i]); } catch(Exception e){ e.printStackTrace(); } return currentShape; } |
return currentShape; | return new GeneralPath(); | public Shape draw(Dimension size){ GeneralPath currentShape = new GeneralPath(); int scale = 5; int w = size.width, h = size.height; Dimension mySize = new Dimension(w, h); int[] xPixels = null; int[] yPixels = null; int[][] pixels; MicroSecondTimeRange overTimeRange = timeConfig.getTimeRange(seismogram).getOversizedTimeRange((scale -1)/2); try{ pixels = SeisPlotUtil.calculatePlottable(seismogram, ampConfig.getAmpRange(seismogram), overTimeRange, mySize); xPixels = pixels[0]; yPixels = pixels[1]; SeisPlotUtil.flipArray(yPixels, mySize.height); if(xPixels.length >= 1) currentShape.moveTo(xPixels[0], yPixels[0]); for(int i = 1; i < xPixels.length; i++) currentShape.lineTo(xPixels[i], yPixels[i]); } catch(Exception e){ e.printStackTrace(); } return currentShape; } |
form.getErr().emit("org.bedework.pubevents.error.nosuchlocation", id); | form.getErr().emit("org.bedework.client.error.nosuchlocation", id); | public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access */ if (!form.getAuthorisedUser()) { return "noAccess"; } /** User requested a location from the list. Retrieve it, embed it in * the form so we can display the page */ int id = getIntReqPar(request, "locid", -1); BwLocation location = null; if (id >= 0) { location = form.getCalSvcI().getLocation(id); } if (debug) { if (location == null) { logIt("No location with id " + id); } else { logIt("Retrieved location " + location.getId()); } } form.assignAddingLocation(false); form.setLocation(location); if (location == null) { form.getErr().emit("org.bedework.pubevents.error.nosuchlocation", id); return "notFound"; } return "continue"; } |
playlist.stop(); | playlist.setPlayAll(false); | public void dispose() { playlist.stop(); playlist.save(); } |
else if(timeIntv <= 100) | else if(timeIntv <= 1000) | public void calculateTicks(){ timeIntv = (endTime.getMicroSecondTime() - beginTime.getMicroSecondTime())/ 1000; if(timeIntv <= 100) this.divCalculateTicks(10); else if(timeIntv <= 500) this.divCalculateTicks(50); else if(timeIntv <= 100) this.divCalculateTicks(100); else if(timeIntv <= 5000) this.divCalculateTicks(500); else if(timeIntv <= 10000) this.divCalculateTicks(1000); else if(timeIntv <= 30000) this.divCalculateTicks(3000); else if(timeIntv <= 60000) this.divCalculateTicks(10000); else if(timeIntv <= 120000) this.divCalculateTicks(20000); else if(timeIntv <= 300000) this.divCalculateTicks(30000); else if(timeIntv <= 600000) this.divCalculateTicks(60000); else if(timeIntv <= 1200000) this.divCalculateTicks(120000); else if(timeIntv <= 3600000) this.divCalculateTicks(360000); else if(timeIntv <= 7300000) this.divCalculateTicks(720000); else this.divCalculateTicks(1440000); } |
String viewName = request.getParameter("view"); | String viewName = getReqPar(request, "view"); | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } BwSubscription sub = form.getSubscription(); CalSvcI svc = form.getCalSvcI(); String viewName = request.getParameter("view"); boolean addToDefaultView = false; if (viewName == null) { addToDefaultView = true; String str = request.getParameter("addtodefaultview"); if (str != null) { addToDefaultView = str.equals("y"); } } if (!validateSub(sub, form)) { return "retry"; } if (Util.checkNull(request.getParameter("addSubscription")) != null) { try { svc.addSubscription(sub); } catch (CalFacadeException cfe) { if (CalFacadeException.duplicateSubscription.equals(cfe.getMessage())) { form.getErr().emit(cfe.getMessage()); return "success"; // User will see message and we'll stay on page } throw cfe; } } else if (Util.checkNull(request.getParameter("updateSubscription")) != null) { svc.updateSubscription(sub); } else if (Util.checkNull(request.getParameter("delete")) != null) { svc.removeSubscription(sub); } else { } if ((viewName == null) && !addToDefaultView) { // We're done - not adding to a view return "success"; } if (sub != null) { svc.addViewSubscription(viewName, sub); } form.setSubscriptions(svc.getSubscriptions()); return "success"; } |
String str = request.getParameter("addtodefaultview"); | String str = getReqPar(request, "addtodefaultview"); | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } BwSubscription sub = form.getSubscription(); CalSvcI svc = form.getCalSvcI(); String viewName = request.getParameter("view"); boolean addToDefaultView = false; if (viewName == null) { addToDefaultView = true; String str = request.getParameter("addtodefaultview"); if (str != null) { addToDefaultView = str.equals("y"); } } if (!validateSub(sub, form)) { return "retry"; } if (Util.checkNull(request.getParameter("addSubscription")) != null) { try { svc.addSubscription(sub); } catch (CalFacadeException cfe) { if (CalFacadeException.duplicateSubscription.equals(cfe.getMessage())) { form.getErr().emit(cfe.getMessage()); return "success"; // User will see message and we'll stay on page } throw cfe; } } else if (Util.checkNull(request.getParameter("updateSubscription")) != null) { svc.updateSubscription(sub); } else if (Util.checkNull(request.getParameter("delete")) != null) { svc.removeSubscription(sub); } else { } if ((viewName == null) && !addToDefaultView) { // We're done - not adding to a view return "success"; } if (sub != null) { svc.addViewSubscription(viewName, sub); } form.setSubscriptions(svc.getSubscriptions()); return "success"; } |
if (Util.checkNull(request.getParameter("addSubscription")) != null) { | if (getReqPar(request, "addSubscription") != null) { | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } BwSubscription sub = form.getSubscription(); CalSvcI svc = form.getCalSvcI(); String viewName = request.getParameter("view"); boolean addToDefaultView = false; if (viewName == null) { addToDefaultView = true; String str = request.getParameter("addtodefaultview"); if (str != null) { addToDefaultView = str.equals("y"); } } if (!validateSub(sub, form)) { return "retry"; } if (Util.checkNull(request.getParameter("addSubscription")) != null) { try { svc.addSubscription(sub); } catch (CalFacadeException cfe) { if (CalFacadeException.duplicateSubscription.equals(cfe.getMessage())) { form.getErr().emit(cfe.getMessage()); return "success"; // User will see message and we'll stay on page } throw cfe; } } else if (Util.checkNull(request.getParameter("updateSubscription")) != null) { svc.updateSubscription(sub); } else if (Util.checkNull(request.getParameter("delete")) != null) { svc.removeSubscription(sub); } else { } if ((viewName == null) && !addToDefaultView) { // We're done - not adding to a view return "success"; } if (sub != null) { svc.addViewSubscription(viewName, sub); } form.setSubscriptions(svc.getSubscriptions()); return "success"; } |
} else if (Util.checkNull(request.getParameter("updateSubscription")) != null) { | } else if (getReqPar(request, "updateSubscription") != null) { | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } BwSubscription sub = form.getSubscription(); CalSvcI svc = form.getCalSvcI(); String viewName = request.getParameter("view"); boolean addToDefaultView = false; if (viewName == null) { addToDefaultView = true; String str = request.getParameter("addtodefaultview"); if (str != null) { addToDefaultView = str.equals("y"); } } if (!validateSub(sub, form)) { return "retry"; } if (Util.checkNull(request.getParameter("addSubscription")) != null) { try { svc.addSubscription(sub); } catch (CalFacadeException cfe) { if (CalFacadeException.duplicateSubscription.equals(cfe.getMessage())) { form.getErr().emit(cfe.getMessage()); return "success"; // User will see message and we'll stay on page } throw cfe; } } else if (Util.checkNull(request.getParameter("updateSubscription")) != null) { svc.updateSubscription(sub); } else if (Util.checkNull(request.getParameter("delete")) != null) { svc.removeSubscription(sub); } else { } if ((viewName == null) && !addToDefaultView) { // We're done - not adding to a view return "success"; } if (sub != null) { svc.addViewSubscription(viewName, sub); } form.setSubscriptions(svc.getSubscriptions()); return "success"; } |
} else if (Util.checkNull(request.getParameter("delete")) != null) { | } else if (getReqPar(request, "delete") != null) { | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } BwSubscription sub = form.getSubscription(); CalSvcI svc = form.getCalSvcI(); String viewName = request.getParameter("view"); boolean addToDefaultView = false; if (viewName == null) { addToDefaultView = true; String str = request.getParameter("addtodefaultview"); if (str != null) { addToDefaultView = str.equals("y"); } } if (!validateSub(sub, form)) { return "retry"; } if (Util.checkNull(request.getParameter("addSubscription")) != null) { try { svc.addSubscription(sub); } catch (CalFacadeException cfe) { if (CalFacadeException.duplicateSubscription.equals(cfe.getMessage())) { form.getErr().emit(cfe.getMessage()); return "success"; // User will see message and we'll stay on page } throw cfe; } } else if (Util.checkNull(request.getParameter("updateSubscription")) != null) { svc.updateSubscription(sub); } else if (Util.checkNull(request.getParameter("delete")) != null) { svc.removeSubscription(sub); } else { } if ((viewName == null) && !addToDefaultView) { // We're done - not adding to a view return "success"; } if (sub != null) { svc.addViewSubscription(viewName, sub); } form.setSubscriptions(svc.getSubscriptions()); return "success"; } |
sub.setName(Util.checkNull(sub.getName())); | private boolean validateSub(BwSubscription sub, BwActionFormBase form) { if (sub.getName() == null) { form.getErr().emit("org.bedework.validation.error.missingfield", "name"); return false; } sub.setUri(Util.checkNull(sub.getUri())); if (!sub.getInternalSubscription() && (sub.getUri() == null)) { form.getErr().emit("org.bedework.validation.error.missingfield", "uri"); return false; } return true; } |
|
AGSymbol rcvnam = AGSymbol.alloc("o2"); | AGSymbol rcvnam = AGSymbol.jAlloc("o2"); | public void testDefExternalField() throws InterpreterException { ATObject rcvr = new NATObject(); AGSymbol rcvnam = AGSymbol.alloc("o2"); ctx_.base_getLexicalScope().meta_defineField(rcvnam, rcvr); evalAndCompareTo("def o2.x := 3", NATNil._INSTANCE_); try { assertEquals(atThree_, rcvr.meta_select(rcvr, atX_)); } catch(XUndefinedField e) { fail("broken external field definition:"+e.getMessage()); } } |
AGSymbol rcvnam = AGSymbol.alloc("o"); | AGSymbol rcvnam = AGSymbol.jAlloc("o"); | public void testDefExternalMethod() throws InterpreterException { ATObject rcvr = new NATObject(); AGSymbol rcvnam = AGSymbol.alloc("o"); ctx_.base_getLexicalScope().meta_defineField(rcvnam, rcvr); evalAndCompareTo("def o.x() { self }", NATNil._INSTANCE_); try { ATClosure clo = rcvr.meta_lookup(atX_).base_asClosure(); assertEquals(atX_, clo.base_getMethod().base_getName()); assertEquals(rcvr, rcvr.meta_invoke(rcvr, atX_, NATTable.EMPTY)); } catch(XSelectorNotFound e) { fail("broken external method definition:"+e.getMessage()); } } |
TimezoneInfo tzinfo = (TimezoneInfo)timezones.get(tzid); TimeZone tz = new TimeZone(vtz); if (tzinfo == null) { tzinfo = new TimezoneInfo(tz); timezones.put(tzid, tzinfo); } else { tzinfo.init(tz); } | saveTimeZone(tzid, vtz, false); | public void saveTimeZone(String tzid, VTimeZone vtz) throws CalFacadeException { /* For a user update the map to avoid a refetch. For system timezones we will force a refresh when we're done. */ /* Don't use lookup - we might be called from lookup on init */ TimezoneInfo tzinfo = (TimezoneInfo)timezones.get(tzid); TimeZone tz = new TimeZone(vtz); if (tzinfo == null) { tzinfo = new TimezoneInfo(tz); timezones.put(tzid, tzinfo); } else { tzinfo.init(tz); } } |
if(majTickTime <= 30000000){ | if(majTickTime <= 100000){ timeFormat = new SimpleDateFormat("ss.S"); if(majTickTime <= 1000){ majTickTime = 1000; }else if(majTickTime <= 10000){ majTickTime = 10000; }else if(majTickTime <= 100000){ majTickTime = 100000; } }else if(majTickTime <= 30000000){ | public void calculateTicks(){ int majTickNum = totalPixels/50; majTickTime = timeIntv/majTickNum; majTickRatio = 10; if(majTickTime <= 30000000){ majTickRatio = 10; timeFormat = new SimpleDateFormat("mm:ss"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 100000){ timeFormat = new SimpleDateFormat("ss.S"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); majTickTime = 100000; }else if(majTickTime <= 1000000){ majTickTime = 1000000; }else if(majTickTime <= 5000000){ majTickTime = 5000000; }else if(majTickTime <= 1000000){ majTickTime = 10000000; }else majTickTime = 30000000; } else if(majTickTime <= 180000000){ majTickRatio = 6; timeFormat = new SimpleDateFormat("HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 60000000){ majTickTime = 60000000; }else if(majTickTime <= 120000000){ majTickTime = 120000000; }else majTickTime = 180000000; } else if(majTickTime <= 1800000000){ majTickRatio = 10; timeFormat = new SimpleDateFormat("HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 300000000) majTickTime = 300000000; else if(majTickTime <= 600000000) majTickTime = 600000000; else if(majTickTime <= 1200000000){ majTickTime = 1200000000; }else majTickTime = 1800000000; } else if(majTickTime <= 43200000000l){ majTickRatio = 6; timeFormat = new SimpleDateFormat("MM/dd HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 3600000000l){ majTickTime = 3600000000l; }else if(majTickTime <= 7200000000l){ majTickTime = 7200000000l; }else if(majTickTime <= 10800000000l){ majTickTime = 10800000000l; }else if(majTickTime <= 21600000000l){ majTickTime = 21600000000l; }else majTickTime = 43200000000l; } else{ majTickRatio = 6; timeFormat = new SimpleDateFormat("MM/dd"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); majTickTime = 86400000000l; } numTicks = (int)((timeIntv/(double)majTickTime) * majTickRatio); firstLabelTime = (beginTime/majTickTime + 1) * majTickTime; majTickOffset = (int)((firstLabelTime - beginTime)/(double)timeIntv * numTicks); tickOffset = (firstLabelTime - beginTime)/(double)timeIntv/majTickRatio * totalPixels; tickSpacing = totalPixels/(double)numTicks; } |
timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 100000){ timeFormat = new SimpleDateFormat("ss.S"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); majTickTime = 100000; }else if(majTickTime <= 1000000){ | if(majTickTime <= 1000000){ | public void calculateTicks(){ int majTickNum = totalPixels/50; majTickTime = timeIntv/majTickNum; majTickRatio = 10; if(majTickTime <= 30000000){ majTickRatio = 10; timeFormat = new SimpleDateFormat("mm:ss"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 100000){ timeFormat = new SimpleDateFormat("ss.S"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); majTickTime = 100000; }else if(majTickTime <= 1000000){ majTickTime = 1000000; }else if(majTickTime <= 5000000){ majTickTime = 5000000; }else if(majTickTime <= 1000000){ majTickTime = 10000000; }else majTickTime = 30000000; } else if(majTickTime <= 180000000){ majTickRatio = 6; timeFormat = new SimpleDateFormat("HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 60000000){ majTickTime = 60000000; }else if(majTickTime <= 120000000){ majTickTime = 120000000; }else majTickTime = 180000000; } else if(majTickTime <= 1800000000){ majTickRatio = 10; timeFormat = new SimpleDateFormat("HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 300000000) majTickTime = 300000000; else if(majTickTime <= 600000000) majTickTime = 600000000; else if(majTickTime <= 1200000000){ majTickTime = 1200000000; }else majTickTime = 1800000000; } else if(majTickTime <= 43200000000l){ majTickRatio = 6; timeFormat = new SimpleDateFormat("MM/dd HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 3600000000l){ majTickTime = 3600000000l; }else if(majTickTime <= 7200000000l){ majTickTime = 7200000000l; }else if(majTickTime <= 10800000000l){ majTickTime = 10800000000l; }else if(majTickTime <= 21600000000l){ majTickTime = 21600000000l; }else majTickTime = 43200000000l; } else{ majTickRatio = 6; timeFormat = new SimpleDateFormat("MM/dd"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); majTickTime = 86400000000l; } numTicks = (int)((timeIntv/(double)majTickTime) * majTickRatio); firstLabelTime = (beginTime/majTickTime + 1) * majTickTime; majTickOffset = (int)((firstLabelTime - beginTime)/(double)timeIntv * numTicks); tickOffset = (firstLabelTime - beginTime)/(double)timeIntv/majTickRatio * totalPixels; tickSpacing = totalPixels/(double)numTicks; } |
timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 60000000){ | if(majTickTime <= 60000000){ | public void calculateTicks(){ int majTickNum = totalPixels/50; majTickTime = timeIntv/majTickNum; majTickRatio = 10; if(majTickTime <= 30000000){ majTickRatio = 10; timeFormat = new SimpleDateFormat("mm:ss"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 100000){ timeFormat = new SimpleDateFormat("ss.S"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); majTickTime = 100000; }else if(majTickTime <= 1000000){ majTickTime = 1000000; }else if(majTickTime <= 5000000){ majTickTime = 5000000; }else if(majTickTime <= 1000000){ majTickTime = 10000000; }else majTickTime = 30000000; } else if(majTickTime <= 180000000){ majTickRatio = 6; timeFormat = new SimpleDateFormat("HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 60000000){ majTickTime = 60000000; }else if(majTickTime <= 120000000){ majTickTime = 120000000; }else majTickTime = 180000000; } else if(majTickTime <= 1800000000){ majTickRatio = 10; timeFormat = new SimpleDateFormat("HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 300000000) majTickTime = 300000000; else if(majTickTime <= 600000000) majTickTime = 600000000; else if(majTickTime <= 1200000000){ majTickTime = 1200000000; }else majTickTime = 1800000000; } else if(majTickTime <= 43200000000l){ majTickRatio = 6; timeFormat = new SimpleDateFormat("MM/dd HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 3600000000l){ majTickTime = 3600000000l; }else if(majTickTime <= 7200000000l){ majTickTime = 7200000000l; }else if(majTickTime <= 10800000000l){ majTickTime = 10800000000l; }else if(majTickTime <= 21600000000l){ majTickTime = 21600000000l; }else majTickTime = 43200000000l; } else{ majTickRatio = 6; timeFormat = new SimpleDateFormat("MM/dd"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); majTickTime = 86400000000l; } numTicks = (int)((timeIntv/(double)majTickTime) * majTickRatio); firstLabelTime = (beginTime/majTickTime + 1) * majTickTime; majTickOffset = (int)((firstLabelTime - beginTime)/(double)timeIntv * numTicks); tickOffset = (firstLabelTime - beginTime)/(double)timeIntv/majTickRatio * totalPixels; tickSpacing = totalPixels/(double)numTicks; } |
timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 300000000) | if(majTickTime <= 300000000) | public void calculateTicks(){ int majTickNum = totalPixels/50; majTickTime = timeIntv/majTickNum; majTickRatio = 10; if(majTickTime <= 30000000){ majTickRatio = 10; timeFormat = new SimpleDateFormat("mm:ss"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 100000){ timeFormat = new SimpleDateFormat("ss.S"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); majTickTime = 100000; }else if(majTickTime <= 1000000){ majTickTime = 1000000; }else if(majTickTime <= 5000000){ majTickTime = 5000000; }else if(majTickTime <= 1000000){ majTickTime = 10000000; }else majTickTime = 30000000; } else if(majTickTime <= 180000000){ majTickRatio = 6; timeFormat = new SimpleDateFormat("HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 60000000){ majTickTime = 60000000; }else if(majTickTime <= 120000000){ majTickTime = 120000000; }else majTickTime = 180000000; } else if(majTickTime <= 1800000000){ majTickRatio = 10; timeFormat = new SimpleDateFormat("HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 300000000) majTickTime = 300000000; else if(majTickTime <= 600000000) majTickTime = 600000000; else if(majTickTime <= 1200000000){ majTickTime = 1200000000; }else majTickTime = 1800000000; } else if(majTickTime <= 43200000000l){ majTickRatio = 6; timeFormat = new SimpleDateFormat("MM/dd HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 3600000000l){ majTickTime = 3600000000l; }else if(majTickTime <= 7200000000l){ majTickTime = 7200000000l; }else if(majTickTime <= 10800000000l){ majTickTime = 10800000000l; }else if(majTickTime <= 21600000000l){ majTickTime = 21600000000l; }else majTickTime = 43200000000l; } else{ majTickRatio = 6; timeFormat = new SimpleDateFormat("MM/dd"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); majTickTime = 86400000000l; } numTicks = (int)((timeIntv/(double)majTickTime) * majTickRatio); firstLabelTime = (beginTime/majTickTime + 1) * majTickTime; majTickOffset = (int)((firstLabelTime - beginTime)/(double)timeIntv * numTicks); tickOffset = (firstLabelTime - beginTime)/(double)timeIntv/majTickRatio * totalPixels; tickSpacing = totalPixels/(double)numTicks; } |
timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 3600000000l){ | if(majTickTime <= 3600000000l){ | public void calculateTicks(){ int majTickNum = totalPixels/50; majTickTime = timeIntv/majTickNum; majTickRatio = 10; if(majTickTime <= 30000000){ majTickRatio = 10; timeFormat = new SimpleDateFormat("mm:ss"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 100000){ timeFormat = new SimpleDateFormat("ss.S"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); majTickTime = 100000; }else if(majTickTime <= 1000000){ majTickTime = 1000000; }else if(majTickTime <= 5000000){ majTickTime = 5000000; }else if(majTickTime <= 1000000){ majTickTime = 10000000; }else majTickTime = 30000000; } else if(majTickTime <= 180000000){ majTickRatio = 6; timeFormat = new SimpleDateFormat("HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 60000000){ majTickTime = 60000000; }else if(majTickTime <= 120000000){ majTickTime = 120000000; }else majTickTime = 180000000; } else if(majTickTime <= 1800000000){ majTickRatio = 10; timeFormat = new SimpleDateFormat("HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 300000000) majTickTime = 300000000; else if(majTickTime <= 600000000) majTickTime = 600000000; else if(majTickTime <= 1200000000){ majTickTime = 1200000000; }else majTickTime = 1800000000; } else if(majTickTime <= 43200000000l){ majTickRatio = 6; timeFormat = new SimpleDateFormat("MM/dd HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 3600000000l){ majTickTime = 3600000000l; }else if(majTickTime <= 7200000000l){ majTickTime = 7200000000l; }else if(majTickTime <= 10800000000l){ majTickTime = 10800000000l; }else if(majTickTime <= 21600000000l){ majTickTime = 21600000000l; }else majTickTime = 43200000000l; } else{ majTickRatio = 6; timeFormat = new SimpleDateFormat("MM/dd"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); majTickTime = 86400000000l; } numTicks = (int)((timeIntv/(double)majTickTime) * majTickRatio); firstLabelTime = (beginTime/majTickTime + 1) * majTickTime; majTickOffset = (int)((firstLabelTime - beginTime)/(double)timeIntv * numTicks); tickOffset = (firstLabelTime - beginTime)/(double)timeIntv/majTickRatio * totalPixels; tickSpacing = totalPixels/(double)numTicks; } |
timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); majTickTime = 86400000000l; | majTickTime = 86400000000l; | public void calculateTicks(){ int majTickNum = totalPixels/50; majTickTime = timeIntv/majTickNum; majTickRatio = 10; if(majTickTime <= 30000000){ majTickRatio = 10; timeFormat = new SimpleDateFormat("mm:ss"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 100000){ timeFormat = new SimpleDateFormat("ss.S"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); majTickTime = 100000; }else if(majTickTime <= 1000000){ majTickTime = 1000000; }else if(majTickTime <= 5000000){ majTickTime = 5000000; }else if(majTickTime <= 1000000){ majTickTime = 10000000; }else majTickTime = 30000000; } else if(majTickTime <= 180000000){ majTickRatio = 6; timeFormat = new SimpleDateFormat("HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 60000000){ majTickTime = 60000000; }else if(majTickTime <= 120000000){ majTickTime = 120000000; }else majTickTime = 180000000; } else if(majTickTime <= 1800000000){ majTickRatio = 10; timeFormat = new SimpleDateFormat("HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 300000000) majTickTime = 300000000; else if(majTickTime <= 600000000) majTickTime = 600000000; else if(majTickTime <= 1200000000){ majTickTime = 1200000000; }else majTickTime = 1800000000; } else if(majTickTime <= 43200000000l){ majTickRatio = 6; timeFormat = new SimpleDateFormat("MM/dd HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 3600000000l){ majTickTime = 3600000000l; }else if(majTickTime <= 7200000000l){ majTickTime = 7200000000l; }else if(majTickTime <= 10800000000l){ majTickTime = 10800000000l; }else if(majTickTime <= 21600000000l){ majTickTime = 21600000000l; }else majTickTime = 43200000000l; } else{ majTickRatio = 6; timeFormat = new SimpleDateFormat("MM/dd"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); majTickTime = 86400000000l; } numTicks = (int)((timeIntv/(double)majTickTime) * majTickRatio); firstLabelTime = (beginTime/majTickTime + 1) * majTickTime; majTickOffset = (int)((firstLabelTime - beginTime)/(double)timeIntv * numTicks); tickOffset = (firstLabelTime - beginTime)/(double)timeIntv/majTickRatio * totalPixels; tickSpacing = totalPixels/(double)numTicks; } |
timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); | public void calculateTicks(){ int majTickNum = totalPixels/50; majTickTime = timeIntv/majTickNum; majTickRatio = 10; if(majTickTime <= 30000000){ majTickRatio = 10; timeFormat = new SimpleDateFormat("mm:ss"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 100000){ timeFormat = new SimpleDateFormat("ss.S"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); majTickTime = 100000; }else if(majTickTime <= 1000000){ majTickTime = 1000000; }else if(majTickTime <= 5000000){ majTickTime = 5000000; }else if(majTickTime <= 1000000){ majTickTime = 10000000; }else majTickTime = 30000000; } else if(majTickTime <= 180000000){ majTickRatio = 6; timeFormat = new SimpleDateFormat("HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 60000000){ majTickTime = 60000000; }else if(majTickTime <= 120000000){ majTickTime = 120000000; }else majTickTime = 180000000; } else if(majTickTime <= 1800000000){ majTickRatio = 10; timeFormat = new SimpleDateFormat("HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 300000000) majTickTime = 300000000; else if(majTickTime <= 600000000) majTickTime = 600000000; else if(majTickTime <= 1200000000){ majTickTime = 1200000000; }else majTickTime = 1800000000; } else if(majTickTime <= 43200000000l){ majTickRatio = 6; timeFormat = new SimpleDateFormat("MM/dd HH:mm"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); if(majTickTime <= 3600000000l){ majTickTime = 3600000000l; }else if(majTickTime <= 7200000000l){ majTickTime = 7200000000l; }else if(majTickTime <= 10800000000l){ majTickTime = 10800000000l; }else if(majTickTime <= 21600000000l){ majTickTime = 21600000000l; }else majTickTime = 43200000000l; } else{ majTickRatio = 6; timeFormat = new SimpleDateFormat("MM/dd"); timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); majTickTime = 86400000000l; } numTicks = (int)((timeIntv/(double)majTickTime) * majTickRatio); firstLabelTime = (beginTime/majTickTime + 1) * majTickTime; majTickOffset = (int)((firstLabelTime - beginTime)/(double)timeIntv * numTicks); tickOffset = (firstLabelTime - beginTime)/(double)timeIntv/majTickRatio * totalPixels; tickSpacing = totalPixels/(double)numTicks; } |
|
public Collection fromIcal(BwCalendar cal, Reader rdr) throws CalFacadeException { | public Collection fromIcal(BwCalendar cal, String val) throws CalFacadeException { | public Collection fromIcal(BwCalendar cal, Reader rdr) throws CalFacadeException { try { //System.setProperty("ical4j.unfolding.relaxed", "true"); CalendarBuilder bldr = new CalendarBuilder(new CalendarParserImpl()); //return fromIcal(cal, bldr.build(new UnfoldingReader(rdr))); return fromIcal(cal, bldr.build(rdr, true)); } catch (ParserException pe) { if (debug) { error(pe); } throw new IcalMalformedException(pe.getMessage()); } catch (CalFacadeException cfe) { throw cfe; } catch (Throwable t) { throw new CalFacadeException(t); } } |
return fromIcal(cal, bldr.build(rdr, true)); | UnfoldingReader ufrdr = new UnfoldingReader(new StringReader(val), true); return fromIcal(cal, bldr.build(ufrdr)); | public Collection fromIcal(BwCalendar cal, Reader rdr) throws CalFacadeException { try { //System.setProperty("ical4j.unfolding.relaxed", "true"); CalendarBuilder bldr = new CalendarBuilder(new CalendarParserImpl()); //return fromIcal(cal, bldr.build(new UnfoldingReader(rdr))); return fromIcal(cal, bldr.build(rdr, true)); } catch (ParserException pe) { if (debug) { error(pe); } throw new IcalMalformedException(pe.getMessage()); } catch (CalFacadeException cfe) { throw cfe; } catch (Throwable t) { throw new CalFacadeException(t); } } |
if (iHandler != null && !isHidden) { | if (iHandler != null) { | private void generateDataSource(IWContext iwc) throws XMLException, Exception { Locale currentLocale = iwc.getCurrentLocale(); if(_queryPK != null) { QueryService service = (QueryService)(IBOLookup.getServiceInstance(iwc,QueryService.class)); _dataSource = service.generateQueryResult(_queryPK, iwc); } else if (_methodInvokeDoc != null) { List mDescs = _methodInvokeDoc.getMethodDescriptions(); if (mDescs != null) { Iterator it = mDescs.iterator(); if (it.hasNext()) { MethodDescription mDesc = (MethodDescription) it.next(); ClassDescription mainClassDesc = mDesc.getClassDescription(); Class mainClass = mainClassDesc.getClassObject(); String type = mainClassDesc.getType(); String methodName = mDesc.getName(); MethodInput input = mDesc.getInput(); List parameters = null; if (input != null) { parameters = input.getClassDescriptions(); } Object[] prmVal = null; Class[] paramTypes = null; if (parameters != null) { prmVal = new Object[parameters.size()]; paramTypes = new Class[parameters.size()]; ListIterator iterator = parameters.listIterator(); while (iterator.hasNext()) { int index = iterator.nextIndex(); ClassDescription clDesc = (ClassDescription) iterator.next(); Class prmClassType = clDesc.getClassObject(); paramTypes[index] = prmClassType; String[] prmValues = iwc.getParameterValues(getParameterName(clDesc.getName())); String prm = null; Object obj = null; if (prmValues != null && prmValues.length > 0) { prm = prmValues[0]; } ClassHandler cHandler = clDesc.getClassHandler(); InputHandler iHandler = null; boolean isHidden = false; if (cHandler != null) { iHandler = cHandler.getHandler(); isHidden = iHandler instanceof HiddenInputHandler; } if (iHandler != null && !isHidden) { obj = iHandler.getResultingObject(prmValues, iwc); String displayNameOfValue = iHandler.getDisplayNameOfValue(obj, iwc); if (displayNameOfValue != null) { _parameterMap.put(clDesc.getName(), displayNameOfValue); } } else if (!isHidden){ //ONLY HANDLES ONE VALUE! obj = getParameterObject(iwc, prm, prmClassType); _parameterMap.put(clDesc.getName(), prm); } if (!isHidden) { _parameterMap.put(_prmLablePrefix + clDesc.getName(), clDesc.getLocalizedName(currentLocale) + ":"); } // switch (index) { // case 0: // obj = new IWTimestamp(23,12,1898).getDate(); // break; // case 1: // obj = new IWTimestamp(23,12,1920).getDate(); // break; // case 2: // obj = new // IWTimestamp(2002,7,10,15,17,39).getTimestamp(); // break; // case 3: // obj = new // IWTimestamp(2002,7,12,15,17,40).getTimestamp(); // break; // } prmVal[index] = obj; } } else { // prmVal = String[0]; } Object forInvocationOfMethod = null; if (ClassDescription.VALUE_TYPE_IDO_SESSION_BEAN.equals(type)) { forInvocationOfMethod = IBOLookup.getSessionInstance(iwc, mainClass); } else if (ClassDescription.VALUE_TYPE_IDO_SERVICE_BEAN.equals(type)) { forInvocationOfMethod = IBOLookup.getServiceInstance(iwc, mainClass); } else if (ClassDescription.VALUE_TYPE_IDO_ENTITY_HOME.equals(type)) { forInvocationOfMethod = IDOLookup.getHome(mainClass); //System.out.println("["+this.getClassName()+"]: // not implemented yet for this classType: // "+type); } else { //ClassDescription.VALUE_TYPE_CLASS.equals(type)) forInvocationOfMethod = mainClass.newInstance(); } MethodFinder mf = MethodFinder.getInstance(); Method method = mf.getMethodWithNameAndParameters(mainClass, methodName, paramTypes); try { _dataSource = (JRDataSource) method.invoke(forInvocationOfMethod, prmVal); } catch (InvocationTargetException e) { Throwable someException = e.getTargetException(); if (someException != null && someException instanceof Exception) { throw (Exception) someException; } else { throw e; } } if (_dataSource != null && _dataSource instanceof ReportableCollection) { _extraHeaderParameters = ((ReportableCollection) _dataSource).getExtraHeaderParameters(); if (_extraHeaderParameters != null) { _parameterMap.putAll(_extraHeaderParameters); } } } } } } |
if (displayNameOfValue != null) { | if (displayNameOfValue != null && !isHidden) { | private void generateDataSource(IWContext iwc) throws XMLException, Exception { Locale currentLocale = iwc.getCurrentLocale(); if(_queryPK != null) { QueryService service = (QueryService)(IBOLookup.getServiceInstance(iwc,QueryService.class)); _dataSource = service.generateQueryResult(_queryPK, iwc); } else if (_methodInvokeDoc != null) { List mDescs = _methodInvokeDoc.getMethodDescriptions(); if (mDescs != null) { Iterator it = mDescs.iterator(); if (it.hasNext()) { MethodDescription mDesc = (MethodDescription) it.next(); ClassDescription mainClassDesc = mDesc.getClassDescription(); Class mainClass = mainClassDesc.getClassObject(); String type = mainClassDesc.getType(); String methodName = mDesc.getName(); MethodInput input = mDesc.getInput(); List parameters = null; if (input != null) { parameters = input.getClassDescriptions(); } Object[] prmVal = null; Class[] paramTypes = null; if (parameters != null) { prmVal = new Object[parameters.size()]; paramTypes = new Class[parameters.size()]; ListIterator iterator = parameters.listIterator(); while (iterator.hasNext()) { int index = iterator.nextIndex(); ClassDescription clDesc = (ClassDescription) iterator.next(); Class prmClassType = clDesc.getClassObject(); paramTypes[index] = prmClassType; String[] prmValues = iwc.getParameterValues(getParameterName(clDesc.getName())); String prm = null; Object obj = null; if (prmValues != null && prmValues.length > 0) { prm = prmValues[0]; } ClassHandler cHandler = clDesc.getClassHandler(); InputHandler iHandler = null; boolean isHidden = false; if (cHandler != null) { iHandler = cHandler.getHandler(); isHidden = iHandler instanceof HiddenInputHandler; } if (iHandler != null && !isHidden) { obj = iHandler.getResultingObject(prmValues, iwc); String displayNameOfValue = iHandler.getDisplayNameOfValue(obj, iwc); if (displayNameOfValue != null) { _parameterMap.put(clDesc.getName(), displayNameOfValue); } } else if (!isHidden){ //ONLY HANDLES ONE VALUE! obj = getParameterObject(iwc, prm, prmClassType); _parameterMap.put(clDesc.getName(), prm); } if (!isHidden) { _parameterMap.put(_prmLablePrefix + clDesc.getName(), clDesc.getLocalizedName(currentLocale) + ":"); } // switch (index) { // case 0: // obj = new IWTimestamp(23,12,1898).getDate(); // break; // case 1: // obj = new IWTimestamp(23,12,1920).getDate(); // break; // case 2: // obj = new // IWTimestamp(2002,7,10,15,17,39).getTimestamp(); // break; // case 3: // obj = new // IWTimestamp(2002,7,12,15,17,40).getTimestamp(); // break; // } prmVal[index] = obj; } } else { // prmVal = String[0]; } Object forInvocationOfMethod = null; if (ClassDescription.VALUE_TYPE_IDO_SESSION_BEAN.equals(type)) { forInvocationOfMethod = IBOLookup.getSessionInstance(iwc, mainClass); } else if (ClassDescription.VALUE_TYPE_IDO_SERVICE_BEAN.equals(type)) { forInvocationOfMethod = IBOLookup.getServiceInstance(iwc, mainClass); } else if (ClassDescription.VALUE_TYPE_IDO_ENTITY_HOME.equals(type)) { forInvocationOfMethod = IDOLookup.getHome(mainClass); //System.out.println("["+this.getClassName()+"]: // not implemented yet for this classType: // "+type); } else { //ClassDescription.VALUE_TYPE_CLASS.equals(type)) forInvocationOfMethod = mainClass.newInstance(); } MethodFinder mf = MethodFinder.getInstance(); Method method = mf.getMethodWithNameAndParameters(mainClass, methodName, paramTypes); try { _dataSource = (JRDataSource) method.invoke(forInvocationOfMethod, prmVal); } catch (InvocationTargetException e) { Throwable someException = e.getTargetException(); if (someException != null && someException instanceof Exception) { throw (Exception) someException; } else { throw e; } } if (_dataSource != null && _dataSource instanceof ReportableCollection) { _extraHeaderParameters = ((ReportableCollection) _dataSource).getExtraHeaderParameters(); if (_extraHeaderParameters != null) { _parameterMap.putAll(_extraHeaderParameters); } } } } } } |
else if (!isHidden){ | else { | private void generateDataSource(IWContext iwc) throws XMLException, Exception { Locale currentLocale = iwc.getCurrentLocale(); if(_queryPK != null) { QueryService service = (QueryService)(IBOLookup.getServiceInstance(iwc,QueryService.class)); _dataSource = service.generateQueryResult(_queryPK, iwc); } else if (_methodInvokeDoc != null) { List mDescs = _methodInvokeDoc.getMethodDescriptions(); if (mDescs != null) { Iterator it = mDescs.iterator(); if (it.hasNext()) { MethodDescription mDesc = (MethodDescription) it.next(); ClassDescription mainClassDesc = mDesc.getClassDescription(); Class mainClass = mainClassDesc.getClassObject(); String type = mainClassDesc.getType(); String methodName = mDesc.getName(); MethodInput input = mDesc.getInput(); List parameters = null; if (input != null) { parameters = input.getClassDescriptions(); } Object[] prmVal = null; Class[] paramTypes = null; if (parameters != null) { prmVal = new Object[parameters.size()]; paramTypes = new Class[parameters.size()]; ListIterator iterator = parameters.listIterator(); while (iterator.hasNext()) { int index = iterator.nextIndex(); ClassDescription clDesc = (ClassDescription) iterator.next(); Class prmClassType = clDesc.getClassObject(); paramTypes[index] = prmClassType; String[] prmValues = iwc.getParameterValues(getParameterName(clDesc.getName())); String prm = null; Object obj = null; if (prmValues != null && prmValues.length > 0) { prm = prmValues[0]; } ClassHandler cHandler = clDesc.getClassHandler(); InputHandler iHandler = null; boolean isHidden = false; if (cHandler != null) { iHandler = cHandler.getHandler(); isHidden = iHandler instanceof HiddenInputHandler; } if (iHandler != null && !isHidden) { obj = iHandler.getResultingObject(prmValues, iwc); String displayNameOfValue = iHandler.getDisplayNameOfValue(obj, iwc); if (displayNameOfValue != null) { _parameterMap.put(clDesc.getName(), displayNameOfValue); } } else if (!isHidden){ //ONLY HANDLES ONE VALUE! obj = getParameterObject(iwc, prm, prmClassType); _parameterMap.put(clDesc.getName(), prm); } if (!isHidden) { _parameterMap.put(_prmLablePrefix + clDesc.getName(), clDesc.getLocalizedName(currentLocale) + ":"); } // switch (index) { // case 0: // obj = new IWTimestamp(23,12,1898).getDate(); // break; // case 1: // obj = new IWTimestamp(23,12,1920).getDate(); // break; // case 2: // obj = new // IWTimestamp(2002,7,10,15,17,39).getTimestamp(); // break; // case 3: // obj = new // IWTimestamp(2002,7,12,15,17,40).getTimestamp(); // break; // } prmVal[index] = obj; } } else { // prmVal = String[0]; } Object forInvocationOfMethod = null; if (ClassDescription.VALUE_TYPE_IDO_SESSION_BEAN.equals(type)) { forInvocationOfMethod = IBOLookup.getSessionInstance(iwc, mainClass); } else if (ClassDescription.VALUE_TYPE_IDO_SERVICE_BEAN.equals(type)) { forInvocationOfMethod = IBOLookup.getServiceInstance(iwc, mainClass); } else if (ClassDescription.VALUE_TYPE_IDO_ENTITY_HOME.equals(type)) { forInvocationOfMethod = IDOLookup.getHome(mainClass); //System.out.println("["+this.getClassName()+"]: // not implemented yet for this classType: // "+type); } else { //ClassDescription.VALUE_TYPE_CLASS.equals(type)) forInvocationOfMethod = mainClass.newInstance(); } MethodFinder mf = MethodFinder.getInstance(); Method method = mf.getMethodWithNameAndParameters(mainClass, methodName, paramTypes); try { _dataSource = (JRDataSource) method.invoke(forInvocationOfMethod, prmVal); } catch (InvocationTargetException e) { Throwable someException = e.getTargetException(); if (someException != null && someException instanceof Exception) { throw (Exception) someException; } else { throw e; } } if (_dataSource != null && _dataSource instanceof ReportableCollection) { _extraHeaderParameters = ((ReportableCollection) _dataSource).getExtraHeaderParameters(); if (_extraHeaderParameters != null) { _parameterMap.putAll(_extraHeaderParameters); } } } } } } |
_parameterMap.put(clDesc.getName(), prm); | if (!isHidden) { _parameterMap.put(clDesc.getName(), prm); } | private void generateDataSource(IWContext iwc) throws XMLException, Exception { Locale currentLocale = iwc.getCurrentLocale(); if(_queryPK != null) { QueryService service = (QueryService)(IBOLookup.getServiceInstance(iwc,QueryService.class)); _dataSource = service.generateQueryResult(_queryPK, iwc); } else if (_methodInvokeDoc != null) { List mDescs = _methodInvokeDoc.getMethodDescriptions(); if (mDescs != null) { Iterator it = mDescs.iterator(); if (it.hasNext()) { MethodDescription mDesc = (MethodDescription) it.next(); ClassDescription mainClassDesc = mDesc.getClassDescription(); Class mainClass = mainClassDesc.getClassObject(); String type = mainClassDesc.getType(); String methodName = mDesc.getName(); MethodInput input = mDesc.getInput(); List parameters = null; if (input != null) { parameters = input.getClassDescriptions(); } Object[] prmVal = null; Class[] paramTypes = null; if (parameters != null) { prmVal = new Object[parameters.size()]; paramTypes = new Class[parameters.size()]; ListIterator iterator = parameters.listIterator(); while (iterator.hasNext()) { int index = iterator.nextIndex(); ClassDescription clDesc = (ClassDescription) iterator.next(); Class prmClassType = clDesc.getClassObject(); paramTypes[index] = prmClassType; String[] prmValues = iwc.getParameterValues(getParameterName(clDesc.getName())); String prm = null; Object obj = null; if (prmValues != null && prmValues.length > 0) { prm = prmValues[0]; } ClassHandler cHandler = clDesc.getClassHandler(); InputHandler iHandler = null; boolean isHidden = false; if (cHandler != null) { iHandler = cHandler.getHandler(); isHidden = iHandler instanceof HiddenInputHandler; } if (iHandler != null && !isHidden) { obj = iHandler.getResultingObject(prmValues, iwc); String displayNameOfValue = iHandler.getDisplayNameOfValue(obj, iwc); if (displayNameOfValue != null) { _parameterMap.put(clDesc.getName(), displayNameOfValue); } } else if (!isHidden){ //ONLY HANDLES ONE VALUE! obj = getParameterObject(iwc, prm, prmClassType); _parameterMap.put(clDesc.getName(), prm); } if (!isHidden) { _parameterMap.put(_prmLablePrefix + clDesc.getName(), clDesc.getLocalizedName(currentLocale) + ":"); } // switch (index) { // case 0: // obj = new IWTimestamp(23,12,1898).getDate(); // break; // case 1: // obj = new IWTimestamp(23,12,1920).getDate(); // break; // case 2: // obj = new // IWTimestamp(2002,7,10,15,17,39).getTimestamp(); // break; // case 3: // obj = new // IWTimestamp(2002,7,12,15,17,40).getTimestamp(); // break; // } prmVal[index] = obj; } } else { // prmVal = String[0]; } Object forInvocationOfMethod = null; if (ClassDescription.VALUE_TYPE_IDO_SESSION_BEAN.equals(type)) { forInvocationOfMethod = IBOLookup.getSessionInstance(iwc, mainClass); } else if (ClassDescription.VALUE_TYPE_IDO_SERVICE_BEAN.equals(type)) { forInvocationOfMethod = IBOLookup.getServiceInstance(iwc, mainClass); } else if (ClassDescription.VALUE_TYPE_IDO_ENTITY_HOME.equals(type)) { forInvocationOfMethod = IDOLookup.getHome(mainClass); //System.out.println("["+this.getClassName()+"]: // not implemented yet for this classType: // "+type); } else { //ClassDescription.VALUE_TYPE_CLASS.equals(type)) forInvocationOfMethod = mainClass.newInstance(); } MethodFinder mf = MethodFinder.getInstance(); Method method = mf.getMethodWithNameAndParameters(mainClass, methodName, paramTypes); try { _dataSource = (JRDataSource) method.invoke(forInvocationOfMethod, prmVal); } catch (InvocationTargetException e) { Throwable someException = e.getTargetException(); if (someException != null && someException instanceof Exception) { throw (Exception) someException; } else { throw e; } } if (_dataSource != null && _dataSource instanceof ReportableCollection) { _extraHeaderParameters = ((ReportableCollection) _dataSource).getExtraHeaderParameters(); if (_extraHeaderParameters != null) { _parameterMap.putAll(_extraHeaderParameters); } } } } } } |
String pwd = System.getProperty("user.dir"); | String pwd = System.getProperty("launch4j.exedir"); if ((pwd == null) || (pwd.length() == 0)) { pwd = System.getProperty("user.dir"); } | public void helpManual() { if (Main.isMac()) { try { Class HelpBook = Class.forName("dg.hipster.HelpBook"); Method launchHelpViewer = HelpBook.getMethod( "launchHelpViewer"); launchHelpViewer.invoke(new Integer(10)); } catch(Exception cnfe) { cnfe.printStackTrace(); } } else { String pwd = System.getProperty("user.dir"); String manualIndex = pwd + File.separatorChar + "manual" + File.separatorChar + "English" + File.separatorChar + "index.html"; showUrlInWindows((new File(manualIndex)).toString()); } } |
if(endTime >= overEndTime || beginTime <= overBeginTime){ logger.debug("the image has been dragged past its edge and is being recreated"); this.createImage(); return; } | public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); long overEndTime = overTimeRange.getEndTime().getMicroSecondTime(); long overBeginTime = overTimeRange.getBeginTime().getMicroSecondTime(); if(endTime >= overEndTime || beginTime <= overBeginTime){ logger.debug("the image has been dragged past its edge and is being recreated"); this.createImage(); return; } Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * overSize.getWidth(); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); g2.drawImage(((Image)overSizedImage.get()), tx, null); } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); } } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.