rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
tc.shaleTime(0, 1); | tc.fireTimeEvent(); | public ParticleMotion(final DataSetSeismogram hseis, DataSetSeismogram vseis, TimeConfig tc, Color color, String key, boolean horizPlane) { DataSetSeismogram[] seis = { hseis, vseis}; this.tc = tc; ac = new RMeanAmpConfig(seis); tc.addListener(ac); tc.add(seis); tc.addListener(this); ac.addListener(this); this.hseis = hseis; hseis.addSeisDataChangeListener(this); hseis.retrieveData(this); this.vseis = vseis; vseis.addSeisDataChangeListener(this); vseis.retrieveData(this); this.key = key; this.horizPlane = horizPlane; setColor(color); tc.shaleTime(0, 1); } |
public void updateAmp(AmpEvent ampEvent){ this.ampEvent = ampEvent; | public void updateAmp(AmpEvent event) { this.ampEvent = event; | public void updateAmp(AmpEvent ampEvent){ this.ampEvent = ampEvent; } |
this.particleMotionDisplay = particleMotionDisplay; addListeners(); | this.pmd = particleMotionDisplay; this.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { resize(); } public void componentShown(ComponentEvent e) { resize(); } }); | public ParticleMotionView(ParticleMotionDisplay particleMotionDisplay) { this.particleMotionDisplay = particleMotionDisplay; addListeners(); } |
public void addAzimuthLine(double degrees) { azimuths.add(new Double(degrees)); | public void addAzimuthLine(double degrees, Color color) { azimuths.put(new Double(degrees), color); | public void addAzimuthLine(double degrees) { azimuths.add(new Double(degrees)); } |
ParticleMotion particleMotion = new ParticleMotion(hseis, vseis, tc, color, key, horizPlane); displays.add(particleMotion); hunitRangeImpl = new UnitRangeImpl(getMinHorizontalAmplitude(), getMaxHorizontalAmplitude(), UnitImpl.COUNT); vunitRangeImpl = new UnitRangeImpl(getMinVerticalAmplitude(), getMaxVerticalAmplitude(), UnitImpl.COUNT); particleMotionDisplay.updateHorizontalAmpScale(hunitRangeImpl); particleMotionDisplay.updateVerticalAmpScale(vunitRangeImpl); | parMos.add(new ParticleMotion(hseis, vseis, tc, color, key,horizPlane)); updateAmps(); | public synchronized void addParticleMotionDisplay(DataSetSeismogram hseis, DataSetSeismogram vseis, TimeConfig tc, Color color, String key, boolean horizPlane) { ParticleMotion particleMotion = new ParticleMotion(hseis, vseis, tc, color, key, horizPlane); displays.add(particleMotion); hunitRangeImpl = new UnitRangeImpl(getMinHorizontalAmplitude(), getMaxHorizontalAmplitude(), UnitImpl.COUNT); vunitRangeImpl = new UnitRangeImpl(getMinVerticalAmplitude(), getMaxVerticalAmplitude(), UnitImpl.COUNT); particleMotionDisplay.updateHorizontalAmpScale(hunitRangeImpl); particleMotionDisplay.updateVerticalAmpScale(vunitRangeImpl); } |
graphics2D.setColor(new Color(100, 160, 140)); | graphics2D.setPaint(Color.gray); | public synchronized void drawAzimuth(ParticleMotion particleMotion, Graphics2D graphics2D) { if(!particleMotion.isHorizontalPlane()) return; Shape sector = getSectorShape(); graphics2D.setColor(new Color(100, 160, 140)); graphics2D.fill(sector); graphics2D.draw(sector); graphics2D.setStroke(DisplayUtils.TWO_PIXEL_STROKE); graphics2D.setColor(Color.green); Shape azimuth = getAzimuthPath(); graphics2D.draw(azimuth); graphics2D.setStroke(DisplayUtils.ONE_PIXEL_STROKE); } |
graphics2D.setStroke(DisplayUtils.TWO_PIXEL_STROKE); graphics2D.setColor(Color.green); Shape azimuth = getAzimuthPath(); graphics2D.draw(azimuth); | drawAzimuths(graphics2D); | public synchronized void drawAzimuth(ParticleMotion particleMotion, Graphics2D graphics2D) { if(!particleMotion.isHorizontalPlane()) return; Shape sector = getSectorShape(); graphics2D.setColor(new Color(100, 160, 140)); graphics2D.fill(sector); graphics2D.draw(sector); graphics2D.setStroke(DisplayUtils.TWO_PIXEL_STROKE); graphics2D.setColor(Color.green); Shape azimuth = getAzimuthPath(); graphics2D.draw(azimuth); graphics2D.setStroke(DisplayUtils.ONE_PIXEL_STROKE); } |
Graphics2D graphics2D = (Graphics2D) g; if(!recalculateValues) { recalculateValues = false; graphics2D.draw(particleMotion.getShape()); return; } Dimension dimension = super.getSize(); | Graphics2D g2D = (Graphics2D) g; Dimension size = getSize(); | public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { Graphics2D graphics2D = (Graphics2D) g; if(!recalculateValues) { recalculateValues = false; graphics2D.draw(particleMotion.getShape()); return; } Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.getLocalHSeis(); LocalSeismogramImpl vseis = particleMotion.getLocalVSeis(); if(hseis == null || vseis == null){ return; } Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } graphics2D.setColor(color); try { MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.tc == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); } else { microSecondTimeRange = particleMotion.getTimeRange(); } int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); particleMotion.setShape(shape); if(shape == null) logger.debug("The shape is null"); graphics2D.draw(shape); } catch(Exception e) { e.printStackTrace(); } } |
Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } graphics2D.setColor(color); | g2D.setColor(particleMotion.getColor()); | public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { Graphics2D graphics2D = (Graphics2D) g; if(!recalculateValues) { recalculateValues = false; graphics2D.draw(particleMotion.getShape()); return; } Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.getLocalHSeis(); LocalSeismogramImpl vseis = particleMotion.getLocalVSeis(); if(hseis == null || vseis == null){ return; } Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } graphics2D.setColor(color); try { MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.tc == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); } else { microSecondTimeRange = particleMotion.getTimeRange(); } int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); particleMotion.setShape(shape); if(shape == null) logger.debug("The shape is null"); graphics2D.draw(shape); } catch(Exception e) { e.printStackTrace(); } } |
MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.tc == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); } else { | MicroSecondTimeRange tr = particleMotion.getTimeRange(); AmpEvent ae = particleMotion.getAmpEvent(); | public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { Graphics2D graphics2D = (Graphics2D) g; if(!recalculateValues) { recalculateValues = false; graphics2D.draw(particleMotion.getShape()); return; } Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.getLocalHSeis(); LocalSeismogramImpl vseis = particleMotion.getLocalVSeis(); if(hseis == null || vseis == null){ return; } Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } graphics2D.setColor(color); try { MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.tc == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); } else { microSecondTimeRange = particleMotion.getTimeRange(); } int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); particleMotion.setShape(shape); if(shape == null) logger.debug("The shape is null"); graphics2D.draw(shape); } catch(Exception e) { e.printStackTrace(); } } |
microSecondTimeRange = particleMotion.getTimeRange(); } | public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { Graphics2D graphics2D = (Graphics2D) g; if(!recalculateValues) { recalculateValues = false; graphics2D.draw(particleMotion.getShape()); return; } Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.getLocalHSeis(); LocalSeismogramImpl vseis = particleMotion.getLocalVSeis(); if(hseis == null || vseis == null){ return; } Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } graphics2D.setColor(color); try { MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.tc == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); } else { microSecondTimeRange = particleMotion.getTimeRange(); } int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); particleMotion.setShape(shape); if(shape == null) logger.debug("The shape is null"); graphics2D.draw(shape); } catch(Exception e) { e.printStackTrace(); } } |
|
hunitRangeImpl, microSecondTimeRange, dimension); | ae.getAmp(particleMotion.hseis), tr, size); | public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { Graphics2D graphics2D = (Graphics2D) g; if(!recalculateValues) { recalculateValues = false; graphics2D.draw(particleMotion.getShape()); return; } Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.getLocalHSeis(); LocalSeismogramImpl vseis = particleMotion.getLocalVSeis(); if(hseis == null || vseis == null){ return; } Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } graphics2D.setColor(color); try { MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.tc == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); } else { microSecondTimeRange = particleMotion.getTimeRange(); } int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); particleMotion.setShape(shape); if(shape == null) logger.debug("The shape is null"); graphics2D.draw(shape); } catch(Exception e) { e.printStackTrace(); } } |
vunitRangeImpl, microSecondTimeRange, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); particleMotion.setShape(shape); if(shape == null) logger.debug("The shape is null"); graphics2D.draw(shape); } catch(Exception e) { | ae.getAmp(particleMotion.vseis), tr, size); SimplePlotUtil.flipArray(hPixels[1], size.width); g2D.draw(getParticleMotionPath(hPixels[1], vPixels[1])); } catch(CodecException e) { | public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { Graphics2D graphics2D = (Graphics2D) g; if(!recalculateValues) { recalculateValues = false; graphics2D.draw(particleMotion.getShape()); return; } Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.getLocalHSeis(); LocalSeismogramImpl vseis = particleMotion.getLocalVSeis(); if(hseis == null || vseis == null){ return; } Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } graphics2D.setColor(color); try { MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.tc == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); } else { microSecondTimeRange = particleMotion.getTimeRange(); } int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); particleMotion.setShape(shape); if(shape == null) logger.debug("The shape is null"); graphics2D.draw(shape); } catch(Exception e) { e.printStackTrace(); } } |
particleMotionDisplay.setHorizontalTitle(hseis.getName()); particleMotionDisplay.setVerticalTitle(vseis.getName()); | pmd.setHorizontalTitle(hseis.getName()); pmd.setVerticalTitle(vseis.getName()); | public void drawTitles(LocalSeismogramImpl hseis, LocalSeismogramImpl vseis) { particleMotionDisplay.setHorizontalTitle(hseis.getName()); particleMotionDisplay.setVerticalTitle(vseis.getName()); } |
for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); if(displayKeys.contains(particleMotion.key)) { | for(int counter = 0; counter < parMos.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)parMos.get(counter); if(displayKey.equals(particleMotion.key)) { | public ParticleMotion[] getSelectedParticleMotion() { ArrayList arrayList = new ArrayList(); for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); if(displayKeys.contains(particleMotion.key)) { arrayList.add(particleMotion); } }//end of for ParticleMotion[] rtnValues = new ParticleMotion[arrayList.size()]; rtnValues = (ParticleMotion[])arrayList.toArray(rtnValues); return rtnValues; } |
if(displayKeys.size() == 0) return; | if(displayKey == null) return; | public synchronized void paintComponent(Graphics g) { if(displayKeys.size() == 0) return; Graphics2D graphics2D = (Graphics2D)g; vunitRangeImpl = new UnitRangeImpl(getMinVerticalAmplitude(), getMaxVerticalAmplitude(), UnitImpl.COUNT); hunitRangeImpl = new UnitRangeImpl(getMinHorizontalAmplitude(), getMaxHorizontalAmplitude(), UnitImpl.COUNT); //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; if(particleMotion.isHorizontalPlane()){ drawAzimuth(particleMotion, graphics2D); break; } } for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); if(!displayKeys.contains(particleMotion.key)) continue; if(particleMotion.isSelected()) continue; drawParticleMotion(particleMotion, graphics2D); }//end of for for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); if(!displayKeys.contains(particleMotion.key)) continue; if(particleMotion.isSelected()) { particleMotion.setSelected(false); drawParticleMotion(particleMotion, g); } } } |
vunitRangeImpl = new UnitRangeImpl(getMinVerticalAmplitude(), getMaxVerticalAmplitude(), UnitImpl.COUNT); hunitRangeImpl = new UnitRangeImpl(getMinHorizontalAmplitude(), getMaxHorizontalAmplitude(), UnitImpl.COUNT); | public synchronized void paintComponent(Graphics g) { if(displayKeys.size() == 0) return; Graphics2D graphics2D = (Graphics2D)g; vunitRangeImpl = new UnitRangeImpl(getMinVerticalAmplitude(), getMaxVerticalAmplitude(), UnitImpl.COUNT); hunitRangeImpl = new UnitRangeImpl(getMinHorizontalAmplitude(), getMaxHorizontalAmplitude(), UnitImpl.COUNT); //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; if(particleMotion.isHorizontalPlane()){ drawAzimuth(particleMotion, graphics2D); break; } } for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); if(!displayKeys.contains(particleMotion.key)) continue; if(particleMotion.isSelected()) continue; drawParticleMotion(particleMotion, graphics2D); }//end of for for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); if(!displayKeys.contains(particleMotion.key)) continue; if(particleMotion.isSelected()) { particleMotion.setSelected(false); drawParticleMotion(particleMotion, g); } } } |
|
for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); if(!displayKeys.contains(particleMotion.key)) continue; | for(int counter = 0; counter < parMos.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)parMos.get(counter); if(!displayKey.equals(particleMotion.key)) continue; | public synchronized void paintComponent(Graphics g) { if(displayKeys.size() == 0) return; Graphics2D graphics2D = (Graphics2D)g; vunitRangeImpl = new UnitRangeImpl(getMinVerticalAmplitude(), getMaxVerticalAmplitude(), UnitImpl.COUNT); hunitRangeImpl = new UnitRangeImpl(getMinHorizontalAmplitude(), getMaxHorizontalAmplitude(), UnitImpl.COUNT); //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; if(particleMotion.isHorizontalPlane()){ drawAzimuth(particleMotion, graphics2D); break; } } for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); if(!displayKeys.contains(particleMotion.key)) continue; if(particleMotion.isSelected()) continue; drawParticleMotion(particleMotion, graphics2D); }//end of for for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); if(!displayKeys.contains(particleMotion.key)) continue; if(particleMotion.isSelected()) { particleMotion.setSelected(false); drawParticleMotion(particleMotion, g); } } } |
recalculateValues = true; | public synchronized void resize() { setSize(super.getSize()); recalculateValues = true; repaint(); } |
|
this.displayKey = key; | displayKey = key; | public void setDisplayKey(String key) { this.displayKey = key; } |
public synchronized void updateTime() { hunitRangeImpl = new UnitRangeImpl(getMinHorizontalAmplitude(), getMaxHorizontalAmplitude(), UnitImpl.COUNT); vunitRangeImpl = new UnitRangeImpl(getMinVerticalAmplitude(), getMaxVerticalAmplitude(), UnitImpl.COUNT); particleMotionDisplay.updateHorizontalAmpScale(hunitRangeImpl); particleMotionDisplay.updateVerticalAmpScale(vunitRangeImpl); | public synchronized void updateTime(TimeEvent e) { updateAmps(); repaint(); | public synchronized void updateTime() { hunitRangeImpl = new UnitRangeImpl(getMinHorizontalAmplitude(), getMaxHorizontalAmplitude(), UnitImpl.COUNT); vunitRangeImpl = new UnitRangeImpl(getMinVerticalAmplitude(), getMaxVerticalAmplitude(), UnitImpl.COUNT); particleMotionDisplay.updateHorizontalAmpScale(hunitRangeImpl); particleMotionDisplay.updateVerticalAmpScale(vunitRangeImpl); } |
dssDataListeners.add(dataListener); | synchronized(dssDataListeners){ dssDataListeners.add(dataListener); } | public void addSeisDataChangeListener(SeisDataChangeListener dataListener) { dssDataListeners.add(dataListener); } |
if (currentPopup != null){ currentPopup.setVisible(false); currentPopup = null; } | maybeKillCurrentPopup(); | public boolean mouseClicked(MouseEvent e){ if (currentPopup != null){ currentPopup.setVisible(false); currentPopup = null; } synchronized(circles){ Iterator it = circles.iterator(); List eventsUnderMouse = new ArrayList(); while(it.hasNext()){ OMEvent current = (OMEvent)it.next(); if(current.getBigCircle().contains(e.getX(), e.getY())){ eventsUnderMouse.add(current.getEvent()); } } if (eventsUnderMouse.size() > 0){ if (eventsUnderMouse.size() == 1){ selectEvent((EventAccessOperations)eventsUnderMouse.get(0)); } else{ final JPopupMenu popup = new JPopupMenu(); it = eventsUnderMouse.iterator(); while (it.hasNext()){ final EventAccessOperations current = (EventAccessOperations)it.next(); final JMenuItem menuItem = new JMenuItem(CacheEvent.getEventInfo(current)); menuItem.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { selectEvent(current); popup.setVisible(false); } }); menuItem.addMouseListener(new MouseAdapter(){ public void mouseEntered(MouseEvent e) { menuItem.setArmed(true); } public void mouseExited(MouseEvent e) { menuItem.setArmed(false); } }); popup.add(menuItem); } Point compLocation = e.getComponent().getLocationOnScreen(); double[] popupLoc = {compLocation.getX(), compLocation.getY()}; popup.setLocation((int)popupLoc[0] + e.getX(), (int)popupLoc[1] + e.getY()); popup.setVisible(true); currentPopup = popup; } return true; } } return false; } |
popup.setInvoker(this); | public boolean mouseClicked(MouseEvent e){ if (currentPopup != null){ currentPopup.setVisible(false); currentPopup = null; } synchronized(circles){ Iterator it = circles.iterator(); List eventsUnderMouse = new ArrayList(); while(it.hasNext()){ OMEvent current = (OMEvent)it.next(); if(current.getBigCircle().contains(e.getX(), e.getY())){ eventsUnderMouse.add(current.getEvent()); } } if (eventsUnderMouse.size() > 0){ if (eventsUnderMouse.size() == 1){ selectEvent((EventAccessOperations)eventsUnderMouse.get(0)); } else{ final JPopupMenu popup = new JPopupMenu(); it = eventsUnderMouse.iterator(); while (it.hasNext()){ final EventAccessOperations current = (EventAccessOperations)it.next(); final JMenuItem menuItem = new JMenuItem(CacheEvent.getEventInfo(current)); menuItem.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { selectEvent(current); popup.setVisible(false); } }); menuItem.addMouseListener(new MouseAdapter(){ public void mouseEntered(MouseEvent e) { menuItem.setArmed(true); } public void mouseExited(MouseEvent e) { menuItem.setArmed(false); } }); popup.add(menuItem); } Point compLocation = e.getComponent().getLocationOnScreen(); double[] popupLoc = {compLocation.getX(), compLocation.getY()}; popup.setLocation((int)popupLoc[0] + e.getX(), (int)popupLoc[1] + e.getY()); popup.setVisible(true); currentPopup = popup; } return true; } } return false; } |
|
maybeKillCurrentPopup(); | public boolean mouseMoved(MouseEvent e){ synchronized(circles){ Iterator it = circles.iterator(); while(it.hasNext()){ OMEvent current = (OMEvent)it.next(); try{ if(current.getBigCircle().contains(e.getX(), e.getY())){ EventAccessOperations event = current.getEvent(); fireRequestInfoLine(CacheEvent.getEventInfo(event)); return true; } } catch(Exception ex){} } } return false; } |
|
String station_code = XMLUtil.evalString(base, "network_code"); | String station_code = XMLUtil.evalString(base, "station_code"); | public static StationId getStationId(Element base) { //get the network_id NodeList network_id_node = XMLUtil.evalNodeList(base, "network_id"); NetworkId network_id = null; if(network_id_node != null && network_id_node.getLength() != 0) { network_id = XMLNetworkId.getNetworkId((Element)network_id_node.item(0)); } //get the station_code String station_code = XMLUtil.evalString(base, "network_code"); //get the begin_time NodeList begin_time_node = XMLUtil.evalNodeList(base, "begin_time"); edu.iris.Fissures.Time begin_time = new edu.iris.Fissures.Time(); if(begin_time_node != null && begin_time_node.getLength() != 0) { begin_time = XMLTime.getFissuresTime((Element)begin_time_node.item(0)); } return new StationId(network_id, station_code, begin_time); } |
public abstract void fireAmpRangeEvent(AmpSyncEvent event); | public void fireAmpRangeEvent(AmpSyncEvent event){ double begin = event.getBegin(); double end = event.getEnd(); if(this.ampRange == null) { this.ampRange = new UnitRangeImpl(begin, end, UnitImpl.COUNT); } else { this.ampRange = new UnitRangeImpl(begin, end, UnitImpl.COUNT); } this.updateAmpSyncListeners(); } | public abstract void fireAmpRangeEvent(AmpSyncEvent event); |
table.put(component, panel); | public void addTab(IPanel panel) { int index = getTabCount(); String title = panel.getTitle(); Icon icon = panel.getIcon(); Component component = panel.getPanelInstance(); table.put(component, panel); if (title == null || title.length() == 0) { title = Messages.getString("TabBar.UNTITLED"); //$NON-NLS-1$ } super.insertTab(title, icon, component, title, index); setSelectedComponent(component); forwardFocusInWindow(); } |
|
table.put(component, panel); | public void addTab(IPanel panel) { int index = getTabCount(); String title = panel.getTitle(); Icon icon = panel.getIcon(); Component component = panel.getPanelInstance(); table.put(component, panel); if (title == null || title.length() == 0) { title = Messages.getString("TabBar.UNTITLED"); //$NON-NLS-1$ } super.insertTab(title, icon, component, title, index); setSelectedComponent(component); forwardFocusInWindow(); } |
|
System.out.println("Simple brutal removeTabAt owner="+owner); | public void removeTabAt(int index) { if (index < 0 || index >= getTabCount()) { return; } Component c = getComponentAt(index); Object owner = table.remove(c); if (owner != null && owner instanceof IModule) { ModuleFactory.disposeInstance((IModule)owner); // real removing done by listener (disposed()) } else if (owner != null && owner instanceof IPanel) { ((IPanel)owner).dispose(); super.removeTabAt(index); } else { super.removeTabAt(index); } } |
|
private String executeQueries(SQLQuery query, int numberOfRows, QueryToSQLBridge bridge, List executedSQLStatements, IWResourceBundle resourceBundle, IWContext iwc) throws RemoteException { QueryResult queryResult = bridge.executeQueries(query, numberOfRows, executedSQLStatements); | private String executeQueries(SQLQuery sqlQuery, int numberOfRows, QueryToSQLBridge sqlBridge, List executedSQLStatements, IWResourceBundle resourceBundle, IWContext iwc) throws RemoteException { QueryResult queryResult = sqlBridge.executeQueries(sqlQuery, numberOfRows, executedSQLStatements); | private String executeQueries(SQLQuery query, int numberOfRows, QueryToSQLBridge bridge, List executedSQLStatements, IWResourceBundle resourceBundle, IWContext iwc) throws RemoteException { QueryResult queryResult = bridge.executeQueries(query, numberOfRows, executedSQLStatements); // check if everything is fine if (queryResult == null || queryResult.isEmpty()) { // nothing to do return resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } resultNumberOfRows = queryResult.getNumberOfRows(); // that means: if the user has set number of rows to 12 000 and the result contains 11 000 rows // nothing happens even if MAX_NUMBER_OF_ROWS_IN_RESULT is only set to 500 if (resultNumberOfRows > numberOfRows && resultNumberOfRows > QueryConstants.MAX_NUMBER_OF_ROWS_IN_RESULT) { String error = resourceBundle.getLocalizedString("ro_number_of_rows_in result _might_be_too_large", "Number of rows might be too large"); String rows = resourceBundle.getLocalizedString("ro_rows","rows"); StringBuffer buffer = new StringBuffer(error); buffer.append(": ").append(resultNumberOfRows).append(" ").append(rows); return buffer.toString(); } else { resultNumberOfRows = -1; } // get design JasperReportBusiness reportBusiness = getReportBusiness(); DesignBox designBox = getDesignBox(query, reportBusiness, resourceBundle, iwc); // synchronize design and result Map designParameters = new HashMap(); designParameters.put(REPORT_HEADLINE_KEY, query.getName()); JasperPrint print = reportBusiness.printSynchronizedReport(queryResult, designParameters, designBox); if (print == null) { return resourceBundle.getLocalizedString("ro_could_not_use_layout", "Layout can't be used"); } // create html report String uri; if (PDF_KEY.equals(outputFormat)) { uri = reportBusiness.getPdfReport(print, "report"); } else if (EXCEL_KEY.equals(outputFormat)) { uri = reportBusiness.getExcelReport(print, "report"); } else { uri = reportBusiness.getHtmlReport(print, "report"); } Page parentPage = getParentPage(); if("true".equals(getBundle(iwc).getProperty(ADD_QUERY_SQL_FOR_DEBUG,"false"))){ addExecutedSQLQueries(executedSQLStatements); add(new Text("ADD_QUERY_SQL_FOR_DEBUG is true, result is shown in pop up window!")); parentPage.setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); } else { parentPage.setToRedirect(uri); } // open an extra window with scrollbars //getParentPage().setOnLoad("window.open('" + uri + "' , 'newWin', 'width=600,height=400,scrollbars=yes')"); //openwindow(Address,Name,ToolBar,Location,Directories,Status,Menubar,Titlebar,Scrollbars,Resizable,Width,Height) //getParentPage().setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); return null; } |
else { resultNumberOfRows = -1; } | resultNumberOfRows = -1; | private String executeQueries(SQLQuery query, int numberOfRows, QueryToSQLBridge bridge, List executedSQLStatements, IWResourceBundle resourceBundle, IWContext iwc) throws RemoteException { QueryResult queryResult = bridge.executeQueries(query, numberOfRows, executedSQLStatements); // check if everything is fine if (queryResult == null || queryResult.isEmpty()) { // nothing to do return resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } resultNumberOfRows = queryResult.getNumberOfRows(); // that means: if the user has set number of rows to 12 000 and the result contains 11 000 rows // nothing happens even if MAX_NUMBER_OF_ROWS_IN_RESULT is only set to 500 if (resultNumberOfRows > numberOfRows && resultNumberOfRows > QueryConstants.MAX_NUMBER_OF_ROWS_IN_RESULT) { String error = resourceBundle.getLocalizedString("ro_number_of_rows_in result _might_be_too_large", "Number of rows might be too large"); String rows = resourceBundle.getLocalizedString("ro_rows","rows"); StringBuffer buffer = new StringBuffer(error); buffer.append(": ").append(resultNumberOfRows).append(" ").append(rows); return buffer.toString(); } else { resultNumberOfRows = -1; } // get design JasperReportBusiness reportBusiness = getReportBusiness(); DesignBox designBox = getDesignBox(query, reportBusiness, resourceBundle, iwc); // synchronize design and result Map designParameters = new HashMap(); designParameters.put(REPORT_HEADLINE_KEY, query.getName()); JasperPrint print = reportBusiness.printSynchronizedReport(queryResult, designParameters, designBox); if (print == null) { return resourceBundle.getLocalizedString("ro_could_not_use_layout", "Layout can't be used"); } // create html report String uri; if (PDF_KEY.equals(outputFormat)) { uri = reportBusiness.getPdfReport(print, "report"); } else if (EXCEL_KEY.equals(outputFormat)) { uri = reportBusiness.getExcelReport(print, "report"); } else { uri = reportBusiness.getHtmlReport(print, "report"); } Page parentPage = getParentPage(); if("true".equals(getBundle(iwc).getProperty(ADD_QUERY_SQL_FOR_DEBUG,"false"))){ addExecutedSQLQueries(executedSQLStatements); add(new Text("ADD_QUERY_SQL_FOR_DEBUG is true, result is shown in pop up window!")); parentPage.setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); } else { parentPage.setToRedirect(uri); } // open an extra window with scrollbars //getParentPage().setOnLoad("window.open('" + uri + "' , 'newWin', 'width=600,height=400,scrollbars=yes')"); //openwindow(Address,Name,ToolBar,Location,Directories,Status,Menubar,Titlebar,Scrollbars,Resizable,Width,Height) //getParentPage().setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); return null; } |
DesignBox designBox = getDesignBox(query, reportBusiness, resourceBundle, iwc); Map designParameters = new HashMap(); designParameters.put(REPORT_HEADLINE_KEY, query.getName()); JasperPrint print = reportBusiness.printSynchronizedReport(queryResult, designParameters, designBox); if (print == null) { return resourceBundle.getLocalizedString("ro_could_not_use_layout", "Layout can't be used"); } String uri; if (PDF_KEY.equals(outputFormat)) { uri = reportBusiness.getPdfReport(print, "report"); } else if (EXCEL_KEY.equals(outputFormat)) { uri = reportBusiness.getExcelReport(print, "report"); } else { uri = reportBusiness.getHtmlReport(print, "report"); } Page parentPage = getParentPage(); if("true".equals(getBundle(iwc).getProperty(ADD_QUERY_SQL_FOR_DEBUG,"false"))){ addExecutedSQLQueries(executedSQLStatements); add(new Text("ADD_QUERY_SQL_FOR_DEBUG is true, result is shown in pop up window!")); parentPage.setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); } else { parentPage.setToRedirect(uri); } return null; | DesignBox designBox = getDesignBox(sqlQuery, reportBusiness, resourceBundle, iwc); Map designParameters = new HashMap(); designParameters.put(REPORT_HEADLINE_KEY, sqlQuery.getName()); JasperPrint print = reportBusiness.printSynchronizedReport(queryResult, designParameters, designBox); if (print == null) { return resourceBundle.getLocalizedString("ro_could_not_use_layout", "Layout can't be used"); } String uri; if (PDF_KEY.equals(outputFormat)) { uri = reportBusiness.getPdfReport(print, "report"); } else if (EXCEL_KEY.equals(outputFormat)) { uri = reportBusiness.getExcelReport(print, "report"); } else { uri = reportBusiness.getHtmlReport(print, "report"); } Page parentPage = getParentPage(); if("true".equals(getBundle(iwc).getProperty(ADD_QUERY_SQL_FOR_DEBUG,"false"))){ addExecutedSQLQueries(executedSQLStatements); add(new Text("ADD_QUERY_SQL_FOR_DEBUG is true, result is shown in pop up window!")); parentPage.setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); } else { parentPage.setToRedirect(uri); } return null; | private String executeQueries(SQLQuery query, int numberOfRows, QueryToSQLBridge bridge, List executedSQLStatements, IWResourceBundle resourceBundle, IWContext iwc) throws RemoteException { QueryResult queryResult = bridge.executeQueries(query, numberOfRows, executedSQLStatements); // check if everything is fine if (queryResult == null || queryResult.isEmpty()) { // nothing to do return resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } resultNumberOfRows = queryResult.getNumberOfRows(); // that means: if the user has set number of rows to 12 000 and the result contains 11 000 rows // nothing happens even if MAX_NUMBER_OF_ROWS_IN_RESULT is only set to 500 if (resultNumberOfRows > numberOfRows && resultNumberOfRows > QueryConstants.MAX_NUMBER_OF_ROWS_IN_RESULT) { String error = resourceBundle.getLocalizedString("ro_number_of_rows_in result _might_be_too_large", "Number of rows might be too large"); String rows = resourceBundle.getLocalizedString("ro_rows","rows"); StringBuffer buffer = new StringBuffer(error); buffer.append(": ").append(resultNumberOfRows).append(" ").append(rows); return buffer.toString(); } else { resultNumberOfRows = -1; } // get design JasperReportBusiness reportBusiness = getReportBusiness(); DesignBox designBox = getDesignBox(query, reportBusiness, resourceBundle, iwc); // synchronize design and result Map designParameters = new HashMap(); designParameters.put(REPORT_HEADLINE_KEY, query.getName()); JasperPrint print = reportBusiness.printSynchronizedReport(queryResult, designParameters, designBox); if (print == null) { return resourceBundle.getLocalizedString("ro_could_not_use_layout", "Layout can't be used"); } // create html report String uri; if (PDF_KEY.equals(outputFormat)) { uri = reportBusiness.getPdfReport(print, "report"); } else if (EXCEL_KEY.equals(outputFormat)) { uri = reportBusiness.getExcelReport(print, "report"); } else { uri = reportBusiness.getHtmlReport(print, "report"); } Page parentPage = getParentPage(); if("true".equals(getBundle(iwc).getProperty(ADD_QUERY_SQL_FOR_DEBUG,"false"))){ addExecutedSQLQueries(executedSQLStatements); add(new Text("ADD_QUERY_SQL_FOR_DEBUG is true, result is shown in pop up window!")); parentPage.setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); } else { parentPage.setToRedirect(uri); } // open an extra window with scrollbars //getParentPage().setOnLoad("window.open('" + uri + "' , 'newWin', 'width=600,height=400,scrollbars=yes')"); //openwindow(Address,Name,ToolBar,Location,Directories,Status,Menubar,Titlebar,Scrollbars,Resizable,Width,Height) //getParentPage().setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); return null; } |
private DesignBox getDesignBox(SQLQuery query, JasperReportBusiness reportBusiness, IWResourceBundle resourceBundle, IWContext iwc) { | private DesignBox getDesignBox(SQLQuery sqlQuery, JasperReportBusiness reportBusiness, IWResourceBundle resourceBundle, IWContext iwc) { | private DesignBox getDesignBox(SQLQuery query, JasperReportBusiness reportBusiness, IWResourceBundle resourceBundle, IWContext iwc) { DesignBox design = null; try { if (designId > 0) { design = reportBusiness.getDesignBox(designId); } else { design = reportBusiness.getDynamicDesignBox(query, resourceBundle, iwc); } } catch (IOException ioEx) { logError("[ReportQueryOverview] Couldn't retrieve design."); log(ioEx); } catch (JRException jrEx) { logError("[ReportQueryOverview] Couldn't retrieve design."); log(jrEx); } return design; } |
design = reportBusiness.getDynamicDesignBox(query, resourceBundle, iwc); | design = reportBusiness.getDynamicDesignBox(sqlQuery, resourceBundle, iwc); | private DesignBox getDesignBox(SQLQuery query, JasperReportBusiness reportBusiness, IWResourceBundle resourceBundle, IWContext iwc) { DesignBox design = null; try { if (designId > 0) { design = reportBusiness.getDesignBox(designId); } else { design = reportBusiness.getDynamicDesignBox(query, resourceBundle, iwc); } } catch (IOException ioEx) { logError("[ReportQueryOverview] Couldn't retrieve design."); log(ioEx); } catch (JRException jrEx) { logError("[ReportQueryOverview] Couldn't retrieve design."); log(jrEx); } return design; } |
String[] value = iwc.getParameterValues(key); result.put(key, Arrays.asList(value)); | String[] values = iwc.getParameterValues(key); if (values.length > 1) { result.put(key, Arrays.asList(values)); } else { result.put(key, values[0]); } | private Map getModifiedIdentiferValueMapByParsingRequest(Map identifierValueMap, IWContext iwc) { Map result = new HashMap(); Iterator iterator = identifierValueMap.keySet().iterator(); while (iterator.hasNext()) { String key = (String) iterator.next(); if (iwc.isParameterSet(key)) { String[] value = iwc.getParameterValues(key); // change to collection-based API result.put(key, Arrays.asList(value)); } else { result.put(key, ""); } } return result; } |
private void showInputFields(SQLQuery query, Map identifierValueMap, Map identifierInputDescriptionMap, IWResourceBundle resourceBundle, IWContext iwc) { String name = query.getName(); String description = query.getQueryDescription(); | private void showInputFields(SQLQuery sqlQuery, Map identifierValueMap, Map identifierInputDescriptionMap, IWResourceBundle resourceBundle, IWContext iwc) { String name = sqlQuery.getName(); String description = sqlQuery.getQueryDescription(); | private void showInputFields(SQLQuery query, Map identifierValueMap, Map identifierInputDescriptionMap, IWResourceBundle resourceBundle, IWContext iwc) { String name = query.getName(); String description = query.getQueryDescription(); PresentationObject presentationObject = getInputFields(name, description, identifierValueMap, identifierInputDescriptionMap, resourceBundle, iwc); Form form = new Form(); form.addParameter(QUERY_ID_KEY, Integer.toString(queryId)); form.addParameter(DESIGN_ID_KEY, Integer.toString(designId)); form.addParameter(OUTPUT_FORMAT_KEY, outputFormat); form.add(presentationObject); add(form); } |
JTextArea textArea = new JTextArea(); | JTextArea textArea = new JTextArea("LKJDLKJFDJFLKDJFLKDJFKLDJFLKDJFKLDJLKJDFL", 80,40); textArea.setVisible(true); | public ParticleMotionDisplay(DataSetSeismogram hseis, TimeConfigRegistrar timeConfigRegistrar, AmpConfigRegistrar hAmpConfigRegistrar, AmpConfigRegistrar vAmpConfigRegistrar, Color color, boolean advancedOption) { JFrame displayFrame = new JFrame(); JPanel informationPanel = new JPanel(); String message = " Please Wait ....For the Particle Motion Window"; JLabel jLabel = new JLabel(message); JTextArea textArea = new JTextArea(); informationPanel.setLayout(new BorderLayout()); informationPanel.add(textArea, BorderLayout.CENTER); informationPanel.setSize(new java.awt.Dimension(500, 300)); displayFrame.getContentPane().add(informationPanel); displayFrame.setSize(new java.awt.Dimension(500, 300)); displayFrame.pack(); displayFrame.show(); try { Thread.sleep(5000); }catch(Exception e) {} createGUI(timeConfigRegistrar, hAmpConfigRegistrar, vAmpConfigRegistrar); ParticleMotionDisplayThread t = new ParticleMotionDisplayThread(hseis, timeConfigRegistrar, hAmpConfigRegistrar, vAmpConfigRegistrar, advancedOption, true, this); t.execute(); displayFrame.dispose(); } |
displayFrame.getContentPane().add(informationPanel); | displayFrame.getContentPane().setLayout(new BorderLayout()); displayFrame.getContentPane().add(jLabel, BorderLayout.CENTER); | public ParticleMotionDisplay(DataSetSeismogram hseis, TimeConfigRegistrar timeConfigRegistrar, AmpConfigRegistrar hAmpConfigRegistrar, AmpConfigRegistrar vAmpConfigRegistrar, Color color, boolean advancedOption) { JFrame displayFrame = new JFrame(); JPanel informationPanel = new JPanel(); String message = " Please Wait ....For the Particle Motion Window"; JLabel jLabel = new JLabel(message); JTextArea textArea = new JTextArea(); informationPanel.setLayout(new BorderLayout()); informationPanel.add(textArea, BorderLayout.CENTER); informationPanel.setSize(new java.awt.Dimension(500, 300)); displayFrame.getContentPane().add(informationPanel); displayFrame.setSize(new java.awt.Dimension(500, 300)); displayFrame.pack(); displayFrame.show(); try { Thread.sleep(5000); }catch(Exception e) {} createGUI(timeConfigRegistrar, hAmpConfigRegistrar, vAmpConfigRegistrar); ParticleMotionDisplayThread t = new ParticleMotionDisplayThread(hseis, timeConfigRegistrar, hAmpConfigRegistrar, vAmpConfigRegistrar, advancedOption, true, this); t.execute(); displayFrame.dispose(); } |
displayFrame.show(); try { Thread.sleep(5000); }catch(Exception e) {} | displayFrame.setVisible(true); | public ParticleMotionDisplay(DataSetSeismogram hseis, TimeConfigRegistrar timeConfigRegistrar, AmpConfigRegistrar hAmpConfigRegistrar, AmpConfigRegistrar vAmpConfigRegistrar, Color color, boolean advancedOption) { JFrame displayFrame = new JFrame(); JPanel informationPanel = new JPanel(); String message = " Please Wait ....For the Particle Motion Window"; JLabel jLabel = new JLabel(message); JTextArea textArea = new JTextArea(); informationPanel.setLayout(new BorderLayout()); informationPanel.add(textArea, BorderLayout.CENTER); informationPanel.setSize(new java.awt.Dimension(500, 300)); displayFrame.getContentPane().add(informationPanel); displayFrame.setSize(new java.awt.Dimension(500, 300)); displayFrame.pack(); displayFrame.show(); try { Thread.sleep(5000); }catch(Exception e) {} createGUI(timeConfigRegistrar, hAmpConfigRegistrar, vAmpConfigRegistrar); ParticleMotionDisplayThread t = new ParticleMotionDisplayThread(hseis, timeConfigRegistrar, hAmpConfigRegistrar, vAmpConfigRegistrar, advancedOption, true, this); t.execute(); displayFrame.dispose(); } |
if(getSize().width == 0 || getSize().height == 0) return; | public synchronized void resize() { Dimension dim = view.getSize(); logger.debug("view coordinates before width = "+view.getSize().width+" height = "+view.getSize().height); Insets insets = view.getInsets(); int width = particleDisplayPanel.getSize().width; int height = particleDisplayPanel.getSize().height; width = width - particleDisplayPanel.getInsets().left - particleDisplayPanel.getInsets().right; height = height - particleDisplayPanel.getInsets().top - particleDisplayPanel.getInsets().bottom; if(width < height) { logger.debug("Before particleDisplayPanel.setSize() "); //particleDisplayPanel = null; //particleDisplayPanel.getSize(); particleDisplayPanel.setSize(new Dimension(particleDisplayPanel.getSize().width, width + particleDisplayPanel.getInsets().top + particleDisplayPanel.getInsets().bottom)); logger.debug("After particleDisplayPanel. setSize()"); } else { logger.debug("Before particleDisplayPanel.setSize() "); particleDisplayPanel.setSize(new Dimension(height + particleDisplayPanel.getInsets().left + particleDisplayPanel.getInsets().right, particleDisplayPanel.getSize().height)); logger.debug("After particleDiplayPanel. setSize()"); } logger.debug("Before view .resize()##############################"); view.resize(); logger.debug("view coordinates are width = "+view.getSize().width+" height = "+view.getSize().height); logger.debug("view insets left = "+insets.left+" right = "+insets.right); logger.debug("view insets top = "+insets.top+" bottom = "+insets.bottom); logger.debug("display after width = "+getSize().width+" height = "+getSize().height); if(hAmpScaleMap != null) { hAmpScaleMap.setTotalPixels(dim.width - insets.left - insets.right); vAmpScaleMap.setTotalPixels(dim.height - insets.top - insets.bottom); } repaint(); }// |
|
logger.debug("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IN RESIZE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); | public synchronized void resize() { Dimension dim = view.getSize(); logger.debug("view coordinates before width = "+view.getSize().width+" height = "+view.getSize().height); Insets insets = view.getInsets(); int width = particleDisplayPanel.getSize().width; int height = particleDisplayPanel.getSize().height; width = width - particleDisplayPanel.getInsets().left - particleDisplayPanel.getInsets().right; height = height - particleDisplayPanel.getInsets().top - particleDisplayPanel.getInsets().bottom; if(width < height) { logger.debug("Before particleDisplayPanel.setSize() "); //particleDisplayPanel = null; //particleDisplayPanel.getSize(); particleDisplayPanel.setSize(new Dimension(particleDisplayPanel.getSize().width, width + particleDisplayPanel.getInsets().top + particleDisplayPanel.getInsets().bottom)); logger.debug("After particleDisplayPanel. setSize()"); } else { logger.debug("Before particleDisplayPanel.setSize() "); particleDisplayPanel.setSize(new Dimension(height + particleDisplayPanel.getInsets().left + particleDisplayPanel.getInsets().right, particleDisplayPanel.getSize().height)); logger.debug("After particleDiplayPanel. setSize()"); } logger.debug("Before view .resize()##############################"); view.resize(); logger.debug("view coordinates are width = "+view.getSize().width+" height = "+view.getSize().height); logger.debug("view insets left = "+insets.left+" right = "+insets.right); logger.debug("view insets top = "+insets.top+" bottom = "+insets.bottom); logger.debug("display after width = "+getSize().width+" height = "+getSize().height); if(hAmpScaleMap != null) { hAmpScaleMap.setTotalPixels(dim.width - insets.left - insets.right); vAmpScaleMap.setTotalPixels(dim.height - insets.top - insets.bottom); } repaint(); }// |
|
addAttribute(getEntryDateColumnName(), "", true, true, java.lang.String.class, 6); | addAttribute(getEntryDateColumnName(), "", true, true, java.lang.String.class, 8); | public void initializeAttributes() { addAttribute(getIDColumnName()); addAttribute(getAuthorisationAmountColumnName(), "", true, true, java.lang.String.class, 20); addAttribute(getAuthorisationCurrencyColumnName(), "", true, true, java.lang.String.class, 6); addAttribute(getAuthorisationCodeColumnName(), "", true, true, java.lang.String.class, 3); addAttribute(getAuthorisationIdRspColumnName(), "", true, true, java.lang.String.class, 10); addAttribute(getAuthorisationPathReasonCodeColumnName(), "", true, true, java.lang.String.class, 5); addAttribute(getBatchNumberColumnName(), "", true, true, java.lang.String.class, 5); addAttribute(getBrandIdColumnName(), "", true, true, java.lang.String.class, 20); addAttribute(getBrandNameColumnName(), "", true, true, java.lang.String.class, 20); addAttribute(getCardCharacteristicsColumnName(), "", true, true, java.lang.String.class, 5); addAttribute(getCardTypeColumnName(), "", true, true, java.lang.String.class, 10); addAttribute(getCardNameColumnName(), "", true, true, java.lang.String.class, 20); addAttribute(getEntryDateColumnName(), "", true, true, java.lang.String.class, 6); addAttribute(getDetailExpectedColumnName(), "", true, true, java.lang.String.class); addAttribute(getErrorNoColumnName(), "", true, true, java.lang.String.class, 10); addAttribute(getErrorTextColumnName(), "", true, true, java.lang.String.class); addAttribute(getCardExpiresColumnName(), "", true, true, java.lang.String.class, 4); addAttribute(getLocationNrColumnName(), "", true, true, java.lang.String.class, 10); addAttribute(getMerchantNrAuthorisationColumnName(), "", true, true, java.lang.String.class, 10); addAttribute(getMerchantNrOtherServicesColumnName(), "", true, true, java.lang.String.class, 10); addAttribute(getMerchantNrSubmissionColumnName(), "", true, true, java.lang.String.class, 20); addAttribute(getAttachmentCountColumnName(), "", true, true, java.lang.String.class); addAttribute(getPanColumnName(), "", true, true, java.lang.String.class); addAttribute(getPosNrColumnName(), "", true, true, java.lang.String.class, 20); addAttribute(getPosSerialNrColumnName(), "", true, true, java.lang.String.class, 20); addAttribute(getPrintDataColumnName(), "", true, true, java.lang.String.class); addAttribute(getSubmissionAmountColumnName(), "", true, true, java.lang.String.class, 10); addAttribute(getSubmissionCurrencyColumnName(), "", true, true, java.lang.String.class, 5); addAttribute(getEntryTimeColumnName(), "", true, true, java.lang.String.class, 6); addAttribute(getTotalResponseCodeColumnName(), "", true, true, java.lang.String.class, 6); addAttribute(getTransactionNrColumnName(), "", true, true, java.lang.String.class, 6); addAttribute(getVoidedAuthorisationIdResponseColumnName(), "", true, true, java.lang.String.class); addAttribute(getVoidedTransactionNrColumnName(), "", true, true, java.lang.String.class); addAttribute(getXMLAttachmentColumnName(), "", true, true, java.lang.String.class); addAttribute(CARD_NUMBER, "card_number", true, true, String.class, 50); this.addOneToOneRelationship(PARENT_ID, TPosAuthorisationEntriesBean.class); } |
logger.debug("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IN RESIZE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); logger.debug("view coordinates before width = "+view.getSize().width+" height = "+view.getSize().height); | public synchronized void resize() { if(getSize().width == 0 || getSize().height == 0) return; Dimension dim = view.getSize(); logger.debug("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IN RESIZE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); logger.debug("view coordinates before width = "+view.getSize().width+" height = "+view.getSize().height); Insets insets = view.getInsets(); int width = particleDisplayPanel.getSize().width; int height = particleDisplayPanel.getSize().height; width = width - particleDisplayPanel.getInsets().left - particleDisplayPanel.getInsets().right; height = height - particleDisplayPanel.getInsets().top - particleDisplayPanel.getInsets().bottom; if(width < height) { logger.debug("Before particleDisplayPanel.setSize() "); //particleDisplayPanel = null; //particleDisplayPanel.getSize(); particleDisplayPanel.setSize(new Dimension(particleDisplayPanel.getSize().width, width + particleDisplayPanel.getInsets().top + particleDisplayPanel.getInsets().bottom)); logger.debug("After particleDisplayPanel. setSize()"); } else { logger.debug("Before particleDisplayPanel.setSize() "); particleDisplayPanel.setSize(new Dimension(height + particleDisplayPanel.getInsets().left + particleDisplayPanel.getInsets().right, particleDisplayPanel.getSize().height)); logger.debug("After particleDiplayPanel. setSize()"); } logger.debug("Before view .resize()##############################"); view.resize(); logger.debug("view coordinates are width = "+view.getSize().width+" height = "+view.getSize().height); logger.debug("view insets left = "+insets.left+" right = "+insets.right); logger.debug("view insets top = "+insets.top+" bottom = "+insets.bottom); logger.debug("display after width = "+getSize().width+" height = "+getSize().height); if(hAmpScaleMap != null) { hAmpScaleMap.setTotalPixels(dim.width - insets.left - insets.right); vAmpScaleMap.setTotalPixels(dim.height - insets.top - insets.bottom); } repaint(); }// |
|
BwWebUtil.deleteEvent(form, svci.getEvent(eventid).getEvent()); | BwEvent event = form.getEditEvent(); BwWebUtil.deleteEvent(form, event); | public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { CalSvcI svci = form.fetchSvci(); boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } int eventid = form.getEventId(); if (debug) { log.debug("About to delete event " + eventid); } BwWebUtil.deleteEvent(form, svci.getEvent(eventid).getEvent()); form.getMsg().emit("org.bedework.client.message.event.deleted"); return "continue"; } |
Channel[] channel = chanTable.getAllChannels(); for(int i = 0; i < channel.length; i++) { Location locationFromDatabase = channel[i].my_site.my_location; DistAz da = new DistAz(locationFromDatabase, newChannel.my_site.my_location); QuantityImpl siteDistance = new QuantityImpl(DistAz.degreesToKilometers(da.getDelta()), UnitImpl.KILOMETER); if(ChannelIdUtil.areEqualExceptForBeginTime(newChannel.get_id(), channel[i].get_id()) && siteDistance.lessThan(distance)) { return channel[i]; | ChannelId[] channelId; try { channelId = chanTable.getIdsByCode(newChannel.get_id().network_id, newChannel.get_id().station_code, newChannel.get_id().site_code, newChannel.get_code()); } catch(NotFound e) { return null; } ChannelId newChannelId = newChannel.get_id(); for(int i = 0; i < channelId.length; i++) { Channel closeChannel = chanTable.get(channelId[i]); if(ChannelIdUtil.areEqualExceptForBeginTime(newChannelId, channelId[i])) { Location locationFromDatabase = closeChannel.my_site.my_location; DistAz da = new DistAz(locationFromDatabase, newChannel.my_site.my_location); QuantityImpl siteDistance = new QuantityImpl(DistAz.degreesToKilometers(da.getDelta()), UnitImpl.KILOMETER); if(siteDistance.lessThan(distance)) { return closeChannel; } | public Channel findCloseChannel(Channel newChannel, QuantityImpl distance) throws SQLException, NotFound { Channel[] channel = chanTable.getAllChannels(); for(int i = 0; i < channel.length; i++) { Location locationFromDatabase = channel[i].my_site.my_location; DistAz da = new DistAz(locationFromDatabase, newChannel.my_site.my_location); QuantityImpl siteDistance = new QuantityImpl(DistAz.degreesToKilometers(da.getDelta()), UnitImpl.KILOMETER); if(ChannelIdUtil.areEqualExceptForBeginTime(newChannel.get_id(), channel[i].get_id()) && siteDistance.lessThan(distance)) { return channel[i]; } } return null; } |
if(newChannelBeginTime.before(channelFromDatabaseBeginTime)){ updateChannelBeginTime.setInt(1, timeTable.put(newChannel.get_id().begin_time)); updateChannelBeginTime.setInt(2, chanTable.getDBId(channelFromDatabase.get_id())); | MicroSecondDate channelFromDatabaseEndTime = new MicroSecondDate(channelFromDatabase.effective_time.end_time); if(newChannelBeginTime.before(channelFromDatabaseBeginTime) && newChannelEndTime.equals(channelFromDatabaseEndTime)) { updateChannelBeginTime.setInt(1, timeTable.put(newChannel.get_id().begin_time)); updateChannelBeginTime.setInt(2, chanTable.getDBId(channelFromDatabase.get_id())); | public void setChannelBeginTimeToEarliest(Channel channelFromDatabase, Channel newChannel) throws SQLException, NotFound{ MicroSecondDate newChannelBeginTime = new MicroSecondDate(newChannel.get_id().begin_time); MicroSecondDate channelFromDatabaseBeginTime = new MicroSecondDate(channelFromDatabase.get_id().begin_time); if(newChannelBeginTime.before(channelFromDatabaseBeginTime)){ updateChannelBeginTime.setInt(1, timeTable.put(newChannel.get_id().begin_time)); updateChannelBeginTime.setInt(2, chanTable.getDBId(channelFromDatabase.get_id())); updateChannelBeginTime.executeUpdate(); // Set the begin time of the channel ID from the database // to the earlier begin time, so when the channel is put // into the database, it matches the updated channel, and // does not create a new channel. channelFromDatabase.get_id().begin_time = newChannel.get_id().begin_time; } } |
Environment.set(Environment.BackgroundColor,"36B3DD"); | public OpenMap(ChannelChooser chooser, EventTableModel etm, ListSelectionModel lsm){ try{ Environment.set(Environment.BackgroundColor,"36B3DD"); MapHandler mapHandler = new MapHandler(); mapHandler.add(this); // Create a MapBean MapBean mapBean = new MapBean(); // Set the map's scale 1:120 million mapBean.setScale(120000000f); mapHandler.add(mapBean); // Create and add a LayerHandler to the MapHandler. The // LayerHandler manages Layers, whether they are part of the // map or not. layer.setVisible(true) will add it to the map. // The LayerHandler has methods to do this, too. The // LayerHandler will find the MapBean in the MapHandler. LayerHandler lh = new LayerHandler(); mapHandler.add(lh); if(etm != null){ EventLayer el = new EventLayer(etm, lsm, mapBean); mapHandler.add(el); lh.addLayer(el, 1); } if(chooser != null){ StationLayer sl = new StationLayer(chooser); mapHandler.add(sl); lh.addLayer(sl,0); } // Create a ShapeLayer to show world political boundaries. ShapeLayer shapeLayer = new ShapeLayer(); //Create shape layer properties Properties shapeLayerProps = new Properties(); shapeLayerProps.put("prettyName", "Political Solid"); shapeLayerProps.put("lineColor", "000000"); shapeLayerProps.put("fillColor", "39DA87"); shapeLayerProps.put("shapeFile", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.shp"); shapeLayerProps.put("spatialIndex", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.ssx"); shapeLayer.setProperties(shapeLayerProps); shapeLayer.setVisible(true); mapHandler.add(shapeLayer); // Create the directional and zoom control tool OMToolSet omts = new OMToolSet(); // Create an OpenMap toolbar ToolPanel toolBar = new ToolPanel(); // Add the ToolPanel and the OMToolSet to the MapHandler. The // OpenMapFrame will find the ToolPanel and attach it to the // top part of its content pane, and the ToolPanel will find // the OMToolSet and add it to itself. mapHandler.add(omts); mapHandler.add(toolBar); mapHandler.add(new MouseDelegator()); mapHandler.add(new SelectMouseMode()); } catch (MultipleSoloMapComponentException msmce) { // The MapHandler is only allowed to have one of certain // items. These items implement the SoloMapComponent // interface. The MapHandler can have a policy that // determines what to do when duplicate instances of the // same type of object are added - replace or ignore. // In this class, this will never happen, since we are // controlling that one MapBean, LayerHandler, // MouseDelegator, etc is being added to the MapHandler. } } |
|
mapBean.setScale(120000000f); | Proj proj = (Proj)mapBean.getProjection(); proj.setBackgroundColor(WATER); proj.setCenter(20, 180); | public OpenMap(ChannelChooser chooser, EventTableModel etm, ListSelectionModel lsm){ try{ Environment.set(Environment.BackgroundColor,"36B3DD"); MapHandler mapHandler = new MapHandler(); mapHandler.add(this); // Create a MapBean MapBean mapBean = new MapBean(); // Set the map's scale 1:120 million mapBean.setScale(120000000f); mapHandler.add(mapBean); // Create and add a LayerHandler to the MapHandler. The // LayerHandler manages Layers, whether they are part of the // map or not. layer.setVisible(true) will add it to the map. // The LayerHandler has methods to do this, too. The // LayerHandler will find the MapBean in the MapHandler. LayerHandler lh = new LayerHandler(); mapHandler.add(lh); if(etm != null){ EventLayer el = new EventLayer(etm, lsm, mapBean); mapHandler.add(el); lh.addLayer(el, 1); } if(chooser != null){ StationLayer sl = new StationLayer(chooser); mapHandler.add(sl); lh.addLayer(sl,0); } // Create a ShapeLayer to show world political boundaries. ShapeLayer shapeLayer = new ShapeLayer(); //Create shape layer properties Properties shapeLayerProps = new Properties(); shapeLayerProps.put("prettyName", "Political Solid"); shapeLayerProps.put("lineColor", "000000"); shapeLayerProps.put("fillColor", "39DA87"); shapeLayerProps.put("shapeFile", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.shp"); shapeLayerProps.put("spatialIndex", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.ssx"); shapeLayer.setProperties(shapeLayerProps); shapeLayer.setVisible(true); mapHandler.add(shapeLayer); // Create the directional and zoom control tool OMToolSet omts = new OMToolSet(); // Create an OpenMap toolbar ToolPanel toolBar = new ToolPanel(); // Add the ToolPanel and the OMToolSet to the MapHandler. The // OpenMapFrame will find the ToolPanel and attach it to the // top part of its content pane, and the ToolPanel will find // the OMToolSet and add it to itself. mapHandler.add(omts); mapHandler.add(toolBar); mapHandler.add(new MouseDelegator()); mapHandler.add(new SelectMouseMode()); } catch (MultipleSoloMapComponentException msmce) { // The MapHandler is only allowed to have one of certain // items. These items implement the SoloMapComponent // interface. The MapHandler can have a policy that // determines what to do when duplicate instances of the // same type of object are added - replace or ignore. // In this class, this will never happen, since we are // controlling that one MapBean, LayerHandler, // MouseDelegator, etc is being added to the MapHandler. } } |
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) { // Assume no access form.getErr().emit("org.bedework.client.missingfield", "name"); return "error"; } BwSubscription sub = svc.findSubscription(name); if (sub == null) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } svc.removeSubscription(sub); return "success"; } |
form.getErr().emit("org.bedework.client.notfound", name); | form.getErr().emit("org.bedework.client.error.nosuchsubscription", 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) { // Assume no access form.getErr().emit("org.bedework.client.missingfield", "name"); return "error"; } BwSubscription sub = svc.findSubscription(name); if (sub == null) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } svc.removeSubscription(sub); return "success"; } |
parentPage.setToRedirect(uri); | if("true".equals(getBundle(iwc).getProperty(ADD_QUERY_SQL_FOR_DEBUG,"false"))){ addExecutedSQLQueries(executedSQLStatements); add(new Text("ADD_QUERY_SQL_FOR_DEBUG is true, result is shown in pop up window!")); parentPage.setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); } else { parentPage.setToRedirect(uri); } | private String executeQueries(SQLQuery query, QueryToSQLBridge bridge, List executedSQLStatements, IWResourceBundle resourceBundle, IWContext iwc) throws RemoteException { QueryResult queryResult = bridge.executeQueries(query, executedSQLStatements); // check if everything is fine if (queryResult == null || queryResult.isEmpty()) { // nothing to do return resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } // get design JasperReportBusiness reportBusiness = getReportBusiness(); DesignBox designBox = getDesignBox(query, reportBusiness, resourceBundle, iwc); // synchronize design and result Map designParameters = new HashMap(); designParameters.put(REPORT_HEADLINE_KEY, query.getName()); JasperPrint print = reportBusiness.printSynchronizedReport(queryResult, designParameters, designBox); if (print == null) { return resourceBundle.getLocalizedString("ro_could_not_use_layout", "Layout can't be used"); } // create html report String uri; if (PDF_KEY.equals(outputFormat)) { uri = reportBusiness.getPdfReport(print, "report"); } else if (EXCEL_KEY.equals(outputFormat)) { uri = reportBusiness.getExcelReport(print, "report"); } else { uri = reportBusiness.getHtmlReport(print, "report"); } Page parentPage = getParentPage(); parentPage.setToRedirect(uri); // open an extra window with scrollbars //getParentPage().setOnLoad("window.open('" + uri + "' , 'newWin', 'width=600,height=400,scrollbars=yes')"); //openwindow(Address,Name,ToolBar,Location,Directories,Status,Menubar,Titlebar,Scrollbars,Resizable,Width,Height) //getParentPage().setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); return null; } |
if("true".equals(getBundle(iwc).getProperty(ADD_QUERY_SQL_FOR_DEBUG,"false"))){ addExecutedSQLQueries(executedSQLStatements); } | private void showInputFieldsOrExecuteQuery(List executedSQLStatements, IWResourceBundle resourceBundle, IWContext iwc) throws RemoteException { Map identifierValueMap = query.getIdentifierValueMap(); boolean calculateAccess = false; boolean containsOnlyAccessVariable = ( (calculateAccess = identifierValueMap.containsKey(DirectSQLStatement.USER_ACCESS_VARIABLE)) || (calculateAccess = identifierValueMap.containsKey(DirectSQLStatement.GROUP_ACCESS_VARIABLE))) && (identifierValueMap.size() == 1); if (! (containsOnlyAccessVariable || iwc.isParameterSet(EXECUTE_QUERY_KEY))) { Map identifierInputDescriptionMap = query.getIdentifierInputDescriptionMap(); showInputFields(query, identifierValueMap, identifierInputDescriptionMap, resourceBundle, iwc); } else { // get the values of the input fields Map modifiedValues = getModifiedIdentiferValueMapByParsingRequest(identifierValueMap, iwc); if (calculateAccess) { setAccessCondition(modifiedValues, iwc); } query.setIdentifierValueMap(modifiedValues); String errorMessage = executeQueries(query, bridge, executedSQLStatements, resourceBundle, iwc); if (errorMessage != null) { addErrorMessage(errorMessage); if (! containsOnlyAccessVariable) { Map identifierInputDescriptionMap = query.getIdentifierInputDescriptionMap(); showInputFields(query, identifierValueMap, identifierInputDescriptionMap, resourceBundle, iwc); } } } } |
|
} else if (tag.equals(CaldavTags.calendarData)) { if (!(pr instanceof CalendarData)) { } else { CalendarData caldata = (CalendarData)pr; String content = null; openPropstat(); int status = HttpServletResponse.SC_OK; try { content = caldata.process(node); } catch (WebdavException wde) { status = wde.getStatusCode();; if (debug && (status != HttpServletResponse.SC_NOT_FOUND)) { error(wde); } } if (status != HttpServletResponse.SC_OK) { xml.emptyTag(tag); } else { xml.property(CaldavTags.calendarData, content); } closePropstat(status); } | public void generatePropValue(WebdavNsNode node, WebdavProperty pr) throws WebdavIntfException { QName tag = pr.getTag(); String ns = tag.getNamespaceURI(); boolean isCalendar = node instanceof CaldavCalNode; CaldavCalNode calNode = null; BwCalendar cal = null; if (isCalendar) { calNode = (CaldavCalNode)node; cal = calNode.getCDURI().getCal(); } try { /* Deal with webdav properties */ if ((!ns.equals(CaldavDefs.caldavNamespace) && !ns.equals(CaldavDefs.icalNamespace))) { // Not ours super.generatePropValue(node, pr); return; } // XXX Change this to have node class generate??? if (tag.equals(ICalTags.summary)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.dtstart)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.dtend)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.duration)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.transp)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.due)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.status)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.uid)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.sequence)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.hasRecurrence)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.hasAlarm)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.hasAttachment)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(CaldavTags.calendarDescription)) { if ((cal != null) && (cal.getDescription() != null)) { // XXX lang openPropstat(); xml.property(tag, cal.getDescription()); closePropstat(); } } else if (tag.equals(CaldavTags.calendarTimezone)) { TimeZone tz = getSvci().getTimezones().getDefaultTimeZone(); openPropstat(); xml.property(tag, trans.toStringTzCalendar(tz.getID())); closePropstat(); } else if (tag.equals(CaldavTags.supportedCalendarComponentSet)) { /* e.g. * <C:supported-calendar-component-set * xmlns:C="urn:ietf:params:xml:ns:caldav"> * <C:comp name="VEVENT"/> * <C:comp name="VTODO"/> * </C:supported-calendar-component-set> */ openPropstat(); xml.openTag(tag); xml.startTag(CaldavTags.comp); xml.atribute("name", "VEVENT"); xml.closeTag(tag); closePropstat(); } else if (tag.equals(CaldavTags.supportedCalendarData)) { /* e.g. * <C:supported-calendar-data * xmlns:C="urn:ietf:params:xml:ns:caldav"> * <C:calendar-data content-type="text/calendar" version="2.0"/> * </C:supported-calendar-data> */ openPropstat(); xml.openTag(tag); xml.startTag(CaldavTags.calendarData); xml.atribute("content-type", "text/calendar"); xml.atribute("version", "2.0"); xml.closeTag(tag); closePropstat(); } else if (tag.equals(CaldavTags.maxAttendeesPerInstance)) { } else if (tag.equals(CaldavTags.maxDateTime)) { } else if (tag.equals(CaldavTags.maxInstances)) { } else if (tag.equals(CaldavTags.maxResourceSize)) { /* e.g. * <C:max-resource-size * xmlns:C="urn:ietf:params:xml:ns:caldav">102400</C:max-resource-size> */ openPropstat(); xml.property(tag, String.valueOf(getSvci().getSyspars().getMaxUserEntitySize())); closePropstat(); } else if (tag.equals(CaldavTags.minDateTime)) { } else { // Not known openPropstat(); xml.emptyTag(tag); closePropstat(HttpServletResponse.SC_NOT_FOUND); } } catch (WebdavIntfException wie) { throw wie; } catch (Throwable t) { throw new WebdavIntfException(t); } } |
|
boolean publicMode = (account == null); | public CalSvcI getSvci() throws WebdavIntfException { boolean publicMode = (account == null); if (svci != null) { if (!svci.isOpen()) { try { svci.open(); svci.beginTransaction(); } catch (Throwable t) { throw new WebdavIntfException(t); } } return svci; } try { svci = new CalSvc(); /* account is what we authenticated with. * user, if non-null, is the user calendar we want to access. */ CalSvcIPars pars = new CalSvcIPars(account, account, envPrefix, publicMode, true, // caldav null, // synchId debug); svci.init(pars); svci.open(); svci.beginTransaction(); trans = new IcalTranslator(svci.getIcalCallback(), debug); } catch (Throwable t) { throw new WebdavIntfException(t); } return svci; } |
|
publicMode, | false, | public CalSvcI getSvci() throws WebdavIntfException { boolean publicMode = (account == null); if (svci != null) { if (!svci.isOpen()) { try { svci.open(); svci.beginTransaction(); } catch (Throwable t) { throw new WebdavIntfException(t); } } return svci; } try { svci = new CalSvc(); /* account is what we authenticated with. * user, if non-null, is the user calendar we want to access. */ CalSvcIPars pars = new CalSvcIPars(account, account, envPrefix, publicMode, true, // caldav null, // synchId debug); svci.init(pars); svci.open(); svci.beginTransaction(); trans = new IcalTranslator(svci.getIcalCallback(), debug); } catch (Throwable t) { throw new WebdavIntfException(t); } return svci; } |
public boolean init(String url, | public boolean init(String systemName, String url, | public boolean init(String url, String authenticatedUser, String user, boolean publicAdmin, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.url = url; this.debug = debug; boolean userCreated = false; try { objTimestamp = new Timestamp(System.currentTimeMillis()); this.synchId = synchId; if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } return userCreated; } |
this.systemName = systemName; | public boolean init(String url, String authenticatedUser, String user, boolean publicAdmin, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.url = url; this.debug = debug; boolean userCreated = false; try { objTimestamp = new Timestamp(System.currentTimeMillis()); this.synchId = synchId; if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } return userCreated; } |
|
public void setAmpConfig(AmpConfig ac){ if(ampConfig != null) ampConfig.removeListener(this); | public void setAmpConfig(AmpConfig ac) { if(ampConfig != null) { ampConfig.removeListener(this); } | public void setAmpConfig(AmpConfig ac){ if(ampConfig != null) ampConfig.removeListener(this); ampConfig = ac; ac.addListener(this); } |
return isoDateFormat.parse(val); | synchronized (isoDateFormat) { return isoDateFormat.parse(val); } | public static Date fromISODate(String val) throws CalFacadeException { try { return isoDateFormat.parse(val); } catch (Throwable t) { throw new CalFacadeBadDateException(); } } |
return isoDateTimeFormat.parse(val); | synchronized (isoDateTimeFormat) { return isoDateTimeFormat.parse(val); } | public static Date fromISODateTime(String val) throws CalFacadeException { try { return isoDateTimeFormat.parse(val); } catch (Throwable t) { throw new CalFacadeBadDateException(); } } |
return isoDateFormat.parse(dtval); | return fromISODate(dtval); | public static Date getDate(BwDateTime val) throws CalFacadeException { String dtval = val.getDtval(); try { if (val.getDateType()) { return isoDateFormat.parse(dtval); } if (dtval.endsWith("Z")) { return isoDateTimeUTCFormat.parse(dtval); } return isoDateTimeFormat.parse(dtval); } catch (Throwable t) { throw new CalFacadeBadDateException(); } } |
return isoDateTimeUTCFormat.parse(dtval); | return fromISODateTimeUTC(dtval); | public static Date getDate(BwDateTime val) throws CalFacadeException { String dtval = val.getDtval(); try { if (val.getDateType()) { return isoDateFormat.parse(dtval); } if (dtval.endsWith("Z")) { return isoDateTimeUTCFormat.parse(dtval); } return isoDateTimeFormat.parse(dtval); } catch (Throwable t) { throw new CalFacadeBadDateException(); } } |
return isoDateTimeFormat.parse(dtval); | return fromISODateTime(dtval); | public static Date getDate(BwDateTime val) throws CalFacadeException { String dtval = val.getDtval(); try { if (val.getDateType()) { return isoDateFormat.parse(dtval); } if (dtval.endsWith("Z")) { return isoDateTimeUTCFormat.parse(dtval); } return isoDateTimeFormat.parse(dtval); } catch (Throwable t) { throw new CalFacadeBadDateException(); } } |
isoDateFormat.parse(val); | fromISODate(val); | public static boolean isISODate(String val) throws CalFacadeException { try { isoDateFormat.parse(val); return true; } catch (Throwable t) { return false; } } |
isoDateTimeFormat.parse(val); | fromISODateTime(val); | public static boolean isISODateTime(String val) throws CalFacadeException { try { isoDateTimeFormat.parse(val); return true; } catch (Throwable t) { return false; } } |
isoDateTimeUTCFormat.parse(val); | fromISODateTimeUTC(val); | public static boolean isISODateTimeUTC(String val) throws CalFacadeException { try { isoDateTimeUTCFormat.parse(val); return true; } catch (Throwable t) { return false; } } |
return isoDateFormat.format(val); | synchronized (isoDateFormat) { return isoDateFormat.format(val); } | public static String isoDate(Date val) { return isoDateFormat.format(val); } |
return isoDateTimeFormat.format(val); | synchronized (isoDateTimeFormat) { return isoDateTimeFormat.format(val); } | public static String isoDateTime(Date val) { return isoDateTimeFormat.format(val); } |
return isoDateTimeUTCFormat.format(val); | synchronized (isoDateTimeUTCFormat) { return isoDateTimeUTCFormat.format(val); } | public static String isoDateTimeUTC(Date val) { return isoDateTimeUTCFormat.format(val); } |
String vsdate = viewStart.getDateTime().getDtval().substring(0, 8); if (debug) { action.logIt("vsdate=" + vsdate); } if (!(vsdate.equals(form.getCurTimeView().getFirstDay().getDateDigits()))) { newView = true; newViewTypeI = form.getCurViewPeriod(); Date jdt = CalFacadeUtil.fromISODate(vsdate); dt = new MyCalendarVO(jdt, loc); | int year = viewStart.getCalYear(); if (checkDateInRange(form, year)) { String vsdate = viewStart.getDateTime().getDtval().substring(0, 8); if (debug) { action.logIt("vsdate=" + vsdate); } if (!(vsdate.equals(form.getCurTimeView().getFirstDay().getDateDigits()))) { newView = true; newViewTypeI = form.getCurViewPeriod(); Date jdt = CalFacadeUtil.fromISODate(vsdate); dt = new MyCalendarVO(jdt, loc); } | public static void gotoDateView(BwCalAbstractAction action, BwActionForm form, String date, int newViewTypeI, boolean debug) throws Throwable { /* We get a new view if either the date changed or the view changed. */ boolean newView = false; if (debug) { action.logIt("ViewTypeI=" + newViewTypeI); } MyCalendarVO dt; TimeView tv = form.getCurTimeView(); Locale loc = Locale.getDefault(); // XXX Locale if (newViewTypeI == BedeworkDefs.todayView) { // dt = new MyCalendarVO(new Date(System.currentTimeMillis())); Date jdt = new Date(System.currentTimeMillis()); dt = new MyCalendarVO(jdt, loc); newView = true; newViewTypeI = BedeworkDefs.dayView; } else if (date == null) { if (newViewTypeI == BedeworkDefs.dayView) { // selected specific day to display from personal event entry screen. Date jdt = CalFacadeUtil.getDate(form.getViewStartDate().getDateTime()); dt = new MyCalendarVO(jdt, loc); newView = true; } else { if (debug) { action.logIt("No date supplied: go with current date"); } // Just stay here dt = tv.getCurDay(); } } else { if (debug) { action.logIt("Date=" + date + ": go with that"); } Date jdt = CalFacadeUtil.fromISODate(date); dt = new MyCalendarVO(jdt, loc); newView = true; } if ((newViewTypeI >= 0) && (newViewTypeI != form.getCurViewPeriod())) { // Change of view newView = true; } if (newView && (newViewTypeI < 0)) { newViewTypeI = form.getCurViewPeriod(); if (newViewTypeI < 0) { newViewTypeI = BedeworkDefs.defaultView; } } TimeDateComponents viewStart = form.getViewStartDate(); if (!newView) { /* See if we were given an explicit date as view start date components. If so we'll set a new view of the same period as the current. */ String vsdate = viewStart.getDateTime().getDtval().substring(0, 8); if (debug) { action.logIt("vsdate=" + vsdate); } if (!(vsdate.equals(form.getCurTimeView().getFirstDay().getDateDigits()))) { newView = true; newViewTypeI = form.getCurViewPeriod(); Date jdt = CalFacadeUtil.fromISODate(vsdate); dt = new MyCalendarVO(jdt, loc); } } if (newView) { form.setCurViewPeriod(newViewTypeI); form.setViewMcDate(dt); form.refreshIsNeeded(); } tv = form.getCurTimeView(); // dt = tv.getCurDay(); /** Set first day, month and year */ MyCalendarVO firstDay = tv.getFirstDay(); viewStart.setDay(firstDay.getTwoDigitDay()); viewStart.setMonth(firstDay.getTwoDigitMonth()); viewStart.setYear(firstDay.getFourDigitYear()); form.getEventStartDate().setDateTime(tv.getCurDay().getTime()); form.getEventEndDate().setDateTime(tv.getCurDay().getTime()); } |
assertTrue(map_.put(AGSymbol.alloc("x"))); map_.put(AGSymbol.alloc("y")); map_.put(AGSymbol.alloc("z")); map_.put(AGSymbol.alloc("u")); assertTrue(map_.put(AGSymbol.alloc("v"))); map_.put(AGSymbol.alloc("w")); map_.put(AGSymbol.alloc("a")); map_.put(AGSymbol.alloc("b")); assertFalse(map_.put(AGSymbol.alloc("x"))); | assertTrue(map_.put(AGSymbol.jAlloc("x"))); map_.put(AGSymbol.jAlloc("y")); map_.put(AGSymbol.jAlloc("z")); map_.put(AGSymbol.jAlloc("u")); assertTrue(map_.put(AGSymbol.jAlloc("v"))); map_.put(AGSymbol.jAlloc("w")); map_.put(AGSymbol.jAlloc("a")); map_.put(AGSymbol.jAlloc("b")); assertFalse(map_.put(AGSymbol.jAlloc("x"))); | protected void setUp() throws Exception { map_ = new FieldMap(); assertTrue(map_.put(AGSymbol.alloc("x"))); map_.put(AGSymbol.alloc("y")); map_.put(AGSymbol.alloc("z")); map_.put(AGSymbol.alloc("u")); assertTrue(map_.put(AGSymbol.alloc("v"))); map_.put(AGSymbol.alloc("w")); map_.put(AGSymbol.alloc("a")); map_.put(AGSymbol.alloc("b")); assertFalse(map_.put(AGSymbol.alloc("x"))); } |
assertEquals(0, map_.get(AGSymbol.alloc("x"))); assertEquals(1, map_.get(AGSymbol.alloc("y"))); assertEquals(2, map_.get(AGSymbol.alloc("z"))); assertEquals(3, map_.get(AGSymbol.alloc("u"))); assertEquals(4, map_.get(AGSymbol.alloc("v"))); assertEquals(5, map_.get(AGSymbol.alloc("w"))); assertEquals(6, map_.get(AGSymbol.alloc("a"))); assertEquals(7, map_.get(AGSymbol.alloc("b"))); assertEquals(-1, map_.get(AGSymbol.alloc("c"))); | assertEquals(0, map_.get(AGSymbol.jAlloc("x"))); assertEquals(1, map_.get(AGSymbol.jAlloc("y"))); assertEquals(2, map_.get(AGSymbol.jAlloc("z"))); assertEquals(3, map_.get(AGSymbol.jAlloc("u"))); assertEquals(4, map_.get(AGSymbol.jAlloc("v"))); assertEquals(5, map_.get(AGSymbol.jAlloc("w"))); assertEquals(6, map_.get(AGSymbol.jAlloc("a"))); assertEquals(7, map_.get(AGSymbol.jAlloc("b"))); assertEquals(-1, map_.get(AGSymbol.jAlloc("c"))); | public void testMap() { assertEquals(0, map_.get(AGSymbol.alloc("x"))); assertEquals(1, map_.get(AGSymbol.alloc("y"))); assertEquals(2, map_.get(AGSymbol.alloc("z"))); assertEquals(3, map_.get(AGSymbol.alloc("u"))); assertEquals(4, map_.get(AGSymbol.alloc("v"))); assertEquals(5, map_.get(AGSymbol.alloc("w"))); assertEquals(6, map_.get(AGSymbol.alloc("a"))); assertEquals(7, map_.get(AGSymbol.alloc("b"))); assertEquals(-1, map_.get(AGSymbol.alloc("c"))); } |
self.meta_defineField(AGSymbol.alloc("unittest:"), unittest_); | self.meta_defineField(AGSymbol.jAlloc("unittest:"), unittest_); | protected void setUp() throws Exception { ATObject root = new NATObject(NATNil._INSTANCE_); // object with no dyn or lex parent ATObject supr = new NATObject(root); // supr has root as lex parent ATObject self = new NATObject(supr, root, NATObject._SHARES_A_); // self has root as lex parent and supr as dyn parent ATObject scope = new NATObject(self); // scope has no dyn parent and is nested within self self.meta_defineField(AGSymbol.alloc("unittest:"), unittest_); self.meta_defineField(AGSymbol.alloc("unit"), OBJUnit._INSTANCE_); ctx_ = new NATContext(scope, self, supr); } |
self.meta_defineField(AGSymbol.alloc("unit"), OBJUnit._INSTANCE_); | self.meta_defineField(AGSymbol.jAlloc("unit"), OBJUnit._INSTANCE_); | protected void setUp() throws Exception { ATObject root = new NATObject(NATNil._INSTANCE_); // object with no dyn or lex parent ATObject supr = new NATObject(root); // supr has root as lex parent ATObject self = new NATObject(supr, root, NATObject._SHARES_A_); // self has root as lex parent and supr as dyn parent ATObject scope = new NATObject(self); // scope has no dyn parent and is nested within self self.meta_defineField(AGSymbol.alloc("unittest:"), unittest_); self.meta_defineField(AGSymbol.alloc("unit"), OBJUnit._INSTANCE_); ctx_ = new NATContext(scope, self, supr); } |
NATIntrospectiveMirror(ATObject representation) { | private NATIntrospectiveMirror(ATObject representation) { | NATIntrospectiveMirror(ATObject representation) { principal_ = representation; } |
return NATMirrorFactory._INSTANCE_.createMirror( | return atValue( | public ATObject meta_invoke(ATObject receiver, ATSymbol atSelector, ATTable arguments) throws InterpreterException { String jSelector = Reflection.upMetaLevelSelector(atSelector); try { return NATMirrorFactory._INSTANCE_.createMirror( Reflection.downObject( Reflection.upInvocation( principal_, // implementor and self jSelector, arguments))); } catch (XSelectorNotFound e) { // Principal does not have a corresponding meta_level method // try for a base_level method of the mirror itself. return super.meta_invoke(receiver, atSelector, arguments); } } |
return NATMirrorFactory._INSTANCE_.base_createMirror(reflectee); | return atValue(reflectee); | public ATObject meta_newInstance(ATTable init) throws XArityMismatch, XTypeMismatch { ATObject[] initargs = init.asNativeTable().elements_; if(initargs.length != 1) { ATObject reflectee = initargs[0]; return NATMirrorFactory._INSTANCE_.base_createMirror(reflectee); } else { throw new XArityMismatch("init", 1, initargs.length); } } |
return NATMirrorFactory._INSTANCE_.base_createMirror(principal_); } | if(principal_ instanceof NATMirage) return ((NATMirage)principal_).getMirror(); else return this; } | public ATObject meta_resolve() throws InterpreterException { return NATMirrorFactory._INSTANCE_.base_createMirror(principal_); } |
return NATMirrorFactory._INSTANCE_.createMirror( | return atValue( | public ATObject meta_select(ATObject receiver, ATSymbol atSelector) throws InterpreterException { String jSelector = null; try { jSelector = Reflection.upMetaFieldAccessSelector(atSelector); return NATMirrorFactory._INSTANCE_.createMirror( Reflection.downObject(Reflection.upFieldSelection(principal_, jSelector))); } catch (XSelectorNotFound e) { try { jSelector = Reflection.upMetaLevelSelector(atSelector); return NATMirrorFactory._INSTANCE_.createMirror( Reflection.downObject( Reflection.upMethodSelection( principal_, jSelector, atSelector))); } catch (XSelectorNotFound e2) { // Principal does not have a corresponding meta_level field nor // method try for a base_level field or method of the mirror itself. return super.meta_select(receiver, atSelector); } } } |
return NATNil._INSTANCE_; | return NATMirror._PROTOTYPE_; | public ATObject meta_clone() throws NATException { return NATNil._INSTANCE_; } |
} catch (Exception e) { | } catch (NATException nate) { throw nate; } catch (InvocationTargetException ite) { if(ite.getCause() instanceof AssertionFailedError) { throw (AssertionFailedError)ite.getCause(); } else { throw new XTypeMismatch( "Could not invoke method with selector " + jSelector.toString() + " on the given object.", ite, (ATObject)jReceiver); } } catch (Exception e) { | public static Object invokeJavaMethod ( Class jClass, Object jReceiver, String jSelector, Object[] jArguments) throws NATException { try { Method[] applicable = getMethodsForSelector(jClass, jSelector); switch(applicable.length) { case 0: throw new XSelectorNotFound(AGSymbol.alloc(jSelector), (ATObject)jReceiver); case 1: // TODO: will have to convert some NATObjects to proper ATXXX argument interfaces using mirages! return applicable[0].invoke(jReceiver, jArguments); default: throw new XIllegalOperation("Dynamic dispatching on overloaded methods not yet implemented"); } } catch (Exception e) { //TODO: you're catching your own XIllegalOperation here... // Exceptions during method invocation imply that the requested method was // not found in the interface. Hence a XTypeMismatch is thrown to signal // that the object could not respond to the request. // e.printStackTrace(); throw new XTypeMismatch( "Could not invoke method with selector " + jSelector.toString() + " on the given object.", e, (ATObject)jReceiver); } } |
methods.put("MKCALENDAR", new CDMkcolMethod()); | methods.put("MKCALENDAR", new MkcalendarMethod()); | public void addMethods(WebdavNsIntf nsIntf) throws WebdavException{ HashMap methods = nsIntf.getMethods(); super.addMethods(nsIntf); // Replace methods methods.put("MKCALENDAR", new CDMkcolMethod()); methods.put("REPORT", new ReportMethod()); } |
form.getErr().emit("org.bedework.pubevents.error.nosuchcategory", id); | form.getErr().emit("org.bedework.client.error.nosuchcategory", id); | public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access */ if (!form.getAuthorisedUser()) { return "noAccess"; } CalSvcI svci = form.getCalSvcI(); /** User requested a category from the list. Retrieve it, embed it in * the form so we can display the page */ int id = form.getCategoryId(); BwCategory category = svci.getCategory(id); if (debug) { if (category == null) { logIt("No category with id " + id); } else { logIt("Retrieved category " + category.getId()); } } form.setCategory(category); if (category == null) { form.getErr().emit("org.bedework.pubevents.error.nosuchcategory", id); return "notFound"; } return "continue"; } |
flipArray(comp[1], 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(); for( int i =0 ; i < comp[1].length; i++) { comp[1][i] = Math.round((float)(linearInterp(yMin, 0, yMax, size.height, comp[1][i]))); } flipArray(comp[1], size.height); } |
|
return getDataCenter(net.get_attributes().get_id()); | return getDataCenter(net.get_attributes().get_code()); | public List getDataCenter(NetworkAccess net) { return getDataCenter(net.get_attributes().get_id()); } |
if (datacenterMap.keySet().size() == 0) { String s = "No datacenters found for request: "; for (int i = 0; i < filters.length; i++) { s+= " "+ChannelIdUtil.toStringNoDates(filters[i].channel_id)+ filters[i].start_time.date_time+ " to "+filters[i].end_time.date_time+", "; } logger.warn(s); } | public RequestFilter[] available_data(RequestFilter[] filters) { HashMap datacenterMap = makeMap(filters); LinkedList out = new LinkedList(); Iterator it = datacenterMap.keySet().iterator(); while ( it.hasNext()) { List dcList = (List)it.next(); Iterator dcIt = dcList.iterator(); List dcFilters = (List)datacenterMap.get(dcList); while ( dcIt.hasNext()) { DataCenterOperations dc = (DataCenterOperations)dcIt.next(); RequestFilter[] tempRF = dc.available_data((RequestFilter[])dcFilters.toArray(new RequestFilter[0])); for ( int i=0; i<tempRF.length; i++) { out.add(tempRF[i]); } // end of for () } // end of while () } // end of while () return (RequestFilter[])out.toArray(new RequestFilter[0]); } |
|
int id = form.getEventId(); | int id = this.getIntReqPar(request, "eventId", -1); | public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { CalSvcI svci = form.fetchSvci(); boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } form.assignAddingEvent(false); /** User requested an event from the list. Retrieve it, embed it in * the form so we can display the page */ int id = form.getEventId(); if (id <= 0) { return "notFound"; } EventInfo einf = svci.getEvent(id); if (debug) { if (einf == null) { log.debug("No event with id " + id); } else { log.debug("Retrieved event " + einf.getEvent().getId()); log.debug(" start=" + einf.getEvent().getDtstart()); } } /** ************************************ We should ensure the alert status is correct ********************************* */ form.setEventInfo(einf); if (einf == null) { form.getErr().emit("org.bedework.client.error.nosuchevent", id); return "notFound"; } return "continue"; } |
resetEvent(form); | public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { CalSvcI svci = form.fetchSvci(); boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } form.assignAddingEvent(false); /** User requested an event from the list. Retrieve it, embed it in * the form so we can display the page */ int id = form.getEventId(); if (id <= 0) { return "notFound"; } EventInfo einf = svci.getEvent(id); if (debug) { if (einf == null) { log.debug("No event with id " + id); } else { log.debug("Retrieved event " + einf.getEvent().getId()); log.debug(" start=" + einf.getEvent().getDtstart()); } } /** ************************************ We should ensure the alert status is correct ********************************* */ form.setEventInfo(einf); if (einf == null) { form.getErr().emit("org.bedework.client.error.nosuchevent", id); return "notFound"; } return "continue"; } |
|
return getParentViewHandler().calculateLocale(arg0); | IWContext iwc = IWContext.getIWContext(arg0); return iwc.getCurrentLocale(); | public Locale calculateLocale(FacesContext arg0) { return getParentViewHandler().calculateLocale(arg0); } |
throw new SmileException("Descriptor Class for '" + viewId + "' must implement net.sourceforge.smile.context.Page !"); | throw new RuntimeException("CbpViewHandler: Descriptor Class for '" + viewId + "' must implement net.sourceforge.smile.context.Page !"); | public UIViewRoot createView(FacesContext ctx, String viewId) { UIViewRoot ret = new UIViewRoot(); ret.setViewId(viewId); // TODO : Hack to allow unit tests to select empty views if(viewId.startsWith("unittesttree.")) { return ret; } try { Class descriptorClazz = getDescriptorClassNameForViewId(viewId); if(descriptorClazz == null) { // JSP page.... } else { if(Page.class.isAssignableFrom(descriptorClazz)) { Page page = (Page) descriptorClazz.newInstance(); page.init(ctx,ret); } else { throw new SmileException("Descriptor Class for '" + viewId + "' must implement net.sourceforge.smile.context.Page !"); } } } catch(IllegalAccessException e) { throw new SmileException("Please make sure that the default constructor for descriptor class of <" + viewId + "> is public.",e); } catch(InstantiationException e) { throw new SmileException("An exception was generated by the default constructor of the descriptor class of <" + viewId + ">.",e); } catch(Throwable t) { throw new SmileException("Descriptor Class for '" + viewId + "' threw an exception during initialize() !",t); } //set the locale ret.setLocale(calculateLocale(ctx)); //set the view on the session ctx.getExternalContext().getSessionMap().put(net.sourceforge.smile.application.CbpStateManagerImpl.SESSION_KEY_CURRENT_VIEW,ret); return ret; } |
throw new SmileException("Please make sure that the default constructor for descriptor class of <" + viewId + "> is public.",e); | throw new RuntimeException("CbpViewHandler: Please make sure that the default constructor for descriptor class of <" + viewId + "> is public.",e); | public UIViewRoot createView(FacesContext ctx, String viewId) { UIViewRoot ret = new UIViewRoot(); ret.setViewId(viewId); // TODO : Hack to allow unit tests to select empty views if(viewId.startsWith("unittesttree.")) { return ret; } try { Class descriptorClazz = getDescriptorClassNameForViewId(viewId); if(descriptorClazz == null) { // JSP page.... } else { if(Page.class.isAssignableFrom(descriptorClazz)) { Page page = (Page) descriptorClazz.newInstance(); page.init(ctx,ret); } else { throw new SmileException("Descriptor Class for '" + viewId + "' must implement net.sourceforge.smile.context.Page !"); } } } catch(IllegalAccessException e) { throw new SmileException("Please make sure that the default constructor for descriptor class of <" + viewId + "> is public.",e); } catch(InstantiationException e) { throw new SmileException("An exception was generated by the default constructor of the descriptor class of <" + viewId + ">.",e); } catch(Throwable t) { throw new SmileException("Descriptor Class for '" + viewId + "' threw an exception during initialize() !",t); } //set the locale ret.setLocale(calculateLocale(ctx)); //set the view on the session ctx.getExternalContext().getSessionMap().put(net.sourceforge.smile.application.CbpStateManagerImpl.SESSION_KEY_CURRENT_VIEW,ret); return ret; } |
throw new SmileException("An exception was generated by the default constructor of the descriptor class of <" + viewId + ">.",e); | throw new RuntimeException("CbpViewHandler: An exception was generated by the default constructor of the descriptor class of <" + viewId + ">.",e); | public UIViewRoot createView(FacesContext ctx, String viewId) { UIViewRoot ret = new UIViewRoot(); ret.setViewId(viewId); // TODO : Hack to allow unit tests to select empty views if(viewId.startsWith("unittesttree.")) { return ret; } try { Class descriptorClazz = getDescriptorClassNameForViewId(viewId); if(descriptorClazz == null) { // JSP page.... } else { if(Page.class.isAssignableFrom(descriptorClazz)) { Page page = (Page) descriptorClazz.newInstance(); page.init(ctx,ret); } else { throw new SmileException("Descriptor Class for '" + viewId + "' must implement net.sourceforge.smile.context.Page !"); } } } catch(IllegalAccessException e) { throw new SmileException("Please make sure that the default constructor for descriptor class of <" + viewId + "> is public.",e); } catch(InstantiationException e) { throw new SmileException("An exception was generated by the default constructor of the descriptor class of <" + viewId + ">.",e); } catch(Throwable t) { throw new SmileException("Descriptor Class for '" + viewId + "' threw an exception during initialize() !",t); } //set the locale ret.setLocale(calculateLocale(ctx)); //set the view on the session ctx.getExternalContext().getSessionMap().put(net.sourceforge.smile.application.CbpStateManagerImpl.SESSION_KEY_CURRENT_VIEW,ret); return ret; } |
throw new SmileException("Descriptor Class for '" + viewId + "' threw an exception during initialize() !",t); | throw new RuntimeException("CbpViewHandler: Descriptor Class for '" + viewId + "' threw an exception during initialize() !",t); | public UIViewRoot createView(FacesContext ctx, String viewId) { UIViewRoot ret = new UIViewRoot(); ret.setViewId(viewId); // TODO : Hack to allow unit tests to select empty views if(viewId.startsWith("unittesttree.")) { return ret; } try { Class descriptorClazz = getDescriptorClassNameForViewId(viewId); if(descriptorClazz == null) { // JSP page.... } else { if(Page.class.isAssignableFrom(descriptorClazz)) { Page page = (Page) descriptorClazz.newInstance(); page.init(ctx,ret); } else { throw new SmileException("Descriptor Class for '" + viewId + "' must implement net.sourceforge.smile.context.Page !"); } } } catch(IllegalAccessException e) { throw new SmileException("Please make sure that the default constructor for descriptor class of <" + viewId + "> is public.",e); } catch(InstantiationException e) { throw new SmileException("An exception was generated by the default constructor of the descriptor class of <" + viewId + ">.",e); } catch(Throwable t) { throw new SmileException("Descriptor Class for '" + viewId + "' threw an exception during initialize() !",t); } //set the locale ret.setLocale(calculateLocale(ctx)); //set the view on the session ctx.getExternalContext().getSessionMap().put(net.sourceforge.smile.application.CbpStateManagerImpl.SESSION_KEY_CURRENT_VIEW,ret); return ret; } |
throw new SmileRuntimeException("No component tree is available !"); | throw new RuntimeException("CbpViewHandler: No component tree is available !"); | public void renderView(FacesContext ctx, UIViewRoot viewRoot) throws IOException, FacesException { // Apparently not all versions of tomcat have the same // default content-type. // So we'll set it explicitly. HttpServletResponse response = (HttpServletResponse) ctx.getExternalContext().getResponse(); response.setContentType("text/html"); // make sure to set the responsewriter initializeResponseWriter(ctx); if(viewRoot == null) { throw new SmileRuntimeException("No component tree is available !"); } String renderkitId = viewRoot.getRenderKitId(); if (renderkitId == null) { renderkitId = calculateRenderKitId(ctx); } viewRoot.setRenderKitId(renderkitId); ResponseWriter out = ctx.getResponseWriter(); try { out.startDocument(); renderComponent(ctx.getViewRoot(),ctx); out.endDocument(); ctx.getResponseWriter().flush(); } catch (RuntimeException e) { throw new SmileRuntimeException(e.getMessage(),e); } } |
try { | public void renderView(FacesContext ctx, UIViewRoot viewRoot) throws IOException, FacesException { // Apparently not all versions of tomcat have the same // default content-type. // So we'll set it explicitly. HttpServletResponse response = (HttpServletResponse) ctx.getExternalContext().getResponse(); response.setContentType("text/html"); // make sure to set the responsewriter initializeResponseWriter(ctx); if(viewRoot == null) { throw new SmileRuntimeException("No component tree is available !"); } String renderkitId = viewRoot.getRenderKitId(); if (renderkitId == null) { renderkitId = calculateRenderKitId(ctx); } viewRoot.setRenderKitId(renderkitId); ResponseWriter out = ctx.getResponseWriter(); try { out.startDocument(); renderComponent(ctx.getViewRoot(),ctx); out.endDocument(); ctx.getResponseWriter().flush(); } catch (RuntimeException e) { throw new SmileRuntimeException(e.getMessage(),e); } } |
|
} catch (RuntimeException e) { throw new SmileRuntimeException(e.getMessage(),e); } | public void renderView(FacesContext ctx, UIViewRoot viewRoot) throws IOException, FacesException { // Apparently not all versions of tomcat have the same // default content-type. // So we'll set it explicitly. HttpServletResponse response = (HttpServletResponse) ctx.getExternalContext().getResponse(); response.setContentType("text/html"); // make sure to set the responsewriter initializeResponseWriter(ctx); if(viewRoot == null) { throw new SmileRuntimeException("No component tree is available !"); } String renderkitId = viewRoot.getRenderKitId(); if (renderkitId == null) { renderkitId = calculateRenderKitId(ctx); } viewRoot.setRenderKitId(renderkitId); ResponseWriter out = ctx.getResponseWriter(); try { out.startDocument(); renderComponent(ctx.getViewRoot(),ctx); out.endDocument(); ctx.getResponseWriter().flush(); } catch (RuntimeException e) { throw new SmileRuntimeException(e.getMessage(),e); } } |
|
if (tx == null) { throw new CalFacadeException("Transaction not started"); } | public void beginTransaction() throws CalFacadeException { if (exc != null) { // Didn't hear me last time? throw new CalFacadeException(exc); } try { if (tx != null) { throw new CalFacadeException("Transaction already started"); } tx = sess.beginTransaction(); } catch (Throwable t) { exc = t; throw new CalFacadeException(t); } } |
|
if (tx != null && !tx.wasCommitted() && !tx.wasRolledBack()) { | if (getLogger().isDebugEnabled()) { getLogger().debug("About to comnmit"); } | public void commit() throws CalFacadeException { if (exc != null) { // Didn't hear me last time? throw new CalFacadeException(exc); } try { if (tx != null && !tx.wasCommitted() && !tx.wasRolledBack()) { tx.commit(); } tx = null; } catch (Throwable t) { exc = t; throw new CalFacadeException(t); } } |
} | public void commit() throws CalFacadeException { if (exc != null) { // Didn't hear me last time? throw new CalFacadeException(exc); } try { if (tx != null && !tx.wasCommitted() && !tx.wasRolledBack()) { tx.commit(); } tx = null; } catch (Throwable t) { exc = t; throw new CalFacadeException(t); } } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.