bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
public void end(String ns, String name) throws Exception { try { BwAdminGroup entity = (BwAdminGroup)pop(); if (entity.getGroupOwner() == null) { error("Missing group owner for admin group " + entity); return; } if (entity.getOwner() == null) { error("Missing owner for admin group " + entity); return; } globals.adminGroups++; if (globals.rintf != null) { globals.rintf.restoreAdminGroup(entity); } if (globals.from2p3px) { globals.getSuperGroup().addGroupMember(entity); } } catch (Throwable t) { throw new Exception(t); } }
public void end(String ns, String name) throws Exception { try { if (entity.getGroupOwner() == null) { error("Missing group owner for admin group " + entity); return; } if (entity.getOwner() == null) { error("Missing owner for admin group " + entity); return; } globals.adminGroups++; if (globals.rintf != null) { globals.rintf.restoreAdminGroup(entity); } if (globals.from2p3px) { globals.getSuperGroup().addGroupMember(entity); } } catch (Throwable t) { throw new Exception(t); } }
1,118,110
public EventAccessOperations[] getAllEvents() { ProxyEventAccessOperations[] eaos = new ProxyEventAccessOperations[getRowCount()]; for (int i = 0; i < getRowCount(); i++) { eaos[i] = BulletproofVestFactory.vestEventAccess(getEventForRow(i)); } return eaos; }
public EventAccessOperations[] getAllEvents() { ProxyEventAccessOperations[] eaos = new ProxyEventAccessOperations[getRowCount()]; for (int i = 0; i < getRowCount(); i++) { eaos[i] = BulletproofVestFactory.vestEventAccess(getEventForRow(i)); } return eaos; }
1,118,113
public int getRowCount() { return events.length; }
public int getRowCount() { return getAllEvents().length; }
1,118,115
public int getRowForEvent(EventAccessOperations event) { for (int i = 0; i < getRowCount(); i++) { EventAccessOperations eao = getEventForRow(i); if (eao.equals(event)) { return i; } } return -1; }
public int getRowForEvent(EventAccessOperations event) { for (int i = 0; i < getRowCount(); i++) { EventAccessOperations eao = getEventForRow(i); if (eao.equals(event)) { return i; } } return -1; }
1,118,116
public void updateEvents(EventAccessOperations[] events) { this.events = events; cachedEvents.clear(); rowNumber.clear(); fireEventDataCleared(); fireTableDataChanged(); fireEventDataChanged(events); }
public void updateEvents(EventAccessOperations[] events) { this.events = events; cachedEvents.clear(); rowNumber.clear(); fireEventDataCleared(); fireTableDataChanged(); fireEventDataChanged(events); }
1,118,118
public EventAccessOperations getWrappedEventAccess(Class wrappedClass){ if(getClass().equals(wrappedClass)) { return this; } if(getWrappedEventAccess().getClass().equals(wrappedClass)){ return getWrappedEventAccess(); }else if(getWrappedEventAccess().getClass().equals(ProxyEventAccessOperations.class)){ return ((ProxyEventAccessOperations)getWrappedEventAccess()).getWrappedEventAccess(wrappedClass); } throw new IllegalArgumentException("This doesn't contain an Event of class " + wrappedClass); }
public EventAccessOperations getWrappedEventAccess(Class wrappedClass){ if(getClass().equals(wrappedClass)) { return this; } if(getWrappedEventAccess().getClass().equals(wrappedClass)){ return getWrappedEventAccess(); }else if(getWrappedEventAccess().getClass().equals(ProxyEventAccessOperations.class)){ return ((ProxyEventAccessOperations)getWrappedEventAccess()).getWrappedEventAccess(wrappedClass); } throw new IllegalArgumentException("This doesn't contain an Event of class " + wrappedClass); }
1,118,119
private void fireZoomChanged(ZoomEvent ze){ // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); System.out.println("length of listeners[]: " + listeners.length); // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { System.out.println("fireZoomChanged listener informed"); if (listeners[i]==ZoomListener.class) { // Lazily create the event: if (ze != null){ ((ZoomListener)listeners[i+1]).zoom(ze); } } } }
private void fireZoomChanged(ZoomEvent ze){ // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { System.out.println("fireZoomChanged listener informed"); if (listeners[i]==ZoomListener.class) { // Lazily create the event: if (ze != null){ ((ZoomListener)listeners[i+1]).zoom(ze); } } } }
1,118,122
private void fireZoomChanged(ZoomEvent ze){ // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); System.out.println("length of listeners[]: " + listeners.length); // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { System.out.println("fireZoomChanged listener informed"); if (listeners[i]==ZoomListener.class) { // Lazily create the event: if (ze != null){ ((ZoomListener)listeners[i+1]).zoom(ze); } } } }
private void fireZoomChanged(ZoomEvent ze){ // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); System.out.println("length of listeners[]: " + listeners.length); // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i]==ZoomListener.class) { // Lazily create the event: if (ze != null){ ((ZoomListener)listeners[i+1]).zoom(ze); } } } }
1,118,123
public void mouseClicked(MouseEvent e){ System.out.println("mouseClicked in ZoomEvent"); if (isActive()){ LatLonPoint llp = mapBean.getCoordinates(e); mapBean.center(new CenterEvent(this, llp.getLatitude(), llp.getLongitude())); zoom(); } }
public void mouseClicked(MouseEvent e){ if (isActive()){ LatLonPoint llp = mapBean.getCoordinates(e); mapBean.center(new CenterEvent(this, llp.getLatitude(), llp.getLongitude())); zoom(); } }
1,118,124
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } reqpar = request.getParameter("copy"); if (reqpar != null) { BwEvent evcopy = new BwEventObj(); form.getEvent().copyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); form.setEvent(evcopy); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form)) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ BwEvent ev = form.getEvent(); ev.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(ev, null); } else { svci.updateEvent(ev); } if (!alerts) { updateAuthPrefs(form, ev.getCategories(), ev.getSponsor(), ev.getLocation(), ev.getCalendar()); } form.resetEvent(); form.assignAddingEvent(false); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } return "continue"; }
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } reqpar = request.getParameter("copy"); if (reqpar != null) { BwEvent evcopy = new BwEventObj(); ei.getEvent().shallowCopyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); form.setEvent(evcopy); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form)) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ BwEvent ev = form.getEvent(); ev.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(ev, null); } else { svci.updateEvent(ev); } if (!alerts) { updateAuthPrefs(form, ev.getCategories(), ev.getSponsor(), ev.getLocation(), ev.getCalendar()); } form.resetEvent(); form.assignAddingEvent(false); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } return "continue"; }
1,118,125
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } reqpar = request.getParameter("copy"); if (reqpar != null) { BwEvent evcopy = new BwEventObj(); form.getEvent().copyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); form.setEvent(evcopy); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form)) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ BwEvent ev = form.getEvent(); ev.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(ev, null); } else { svci.updateEvent(ev); } if (!alerts) { updateAuthPrefs(form, ev.getCategories(), ev.getSponsor(), ev.getLocation(), ev.getCalendar()); } form.resetEvent(); form.assignAddingEvent(false); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } return "continue"; }
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } reqpar = request.getParameter("copy"); if (reqpar != null) { BwEvent evcopy = new BwEventObj(); form.getEvent().copyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); evcopy.setGuid(null); if (debug) { BwLocation l = evcopy.getLocation(); if (l == null) { debugMsg("Copied event has null location"); } else { debugMsg("Copied event has location with id " + l.getId()); } } ei.setEvent(evcopy); form.setEventInfo(ei); resetEvent(form); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form)) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ BwEvent ev = form.getEvent(); ev.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(ev, null); } else { svci.updateEvent(ev); } if (!alerts) { updateAuthPrefs(form, ev.getCategories(), ev.getSponsor(), ev.getLocation(), ev.getCalendar()); } form.resetEvent(); form.assignAddingEvent(false); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } return "continue"; }
1,118,126
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } reqpar = request.getParameter("copy"); if (reqpar != null) { BwEvent evcopy = new BwEventObj(); form.getEvent().copyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); form.setEvent(evcopy); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form)) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ BwEvent ev = form.getEvent(); ev.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(ev, null); } else { svci.updateEvent(ev); } if (!alerts) { updateAuthPrefs(form, ev.getCategories(), ev.getSponsor(), ev.getLocation(), ev.getCalendar()); } form.resetEvent(); form.assignAddingEvent(false); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } return "continue"; }
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } reqpar = request.getParameter("copy"); if (reqpar != null) { BwEvent evcopy = new BwEventObj(); form.getEvent().copyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); form.setEvent(evcopy); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form, svci, event, form.getErr())) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ BwEvent ev = form.getEvent(); ev.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(ev, null); } else { svci.updateEvent(ev); } if (!alerts) { updateAuthPrefs(form, ev.getCategories(), ev.getSponsor(), ev.getLocation(), ev.getCalendar()); } form.resetEvent(); form.assignAddingEvent(false); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } return "continue"; }
1,118,127
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } reqpar = request.getParameter("copy"); if (reqpar != null) { BwEvent evcopy = new BwEventObj(); form.getEvent().copyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); form.setEvent(evcopy); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form)) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ BwEvent ev = form.getEvent(); ev.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(ev, null); } else { svci.updateEvent(ev); } if (!alerts) { updateAuthPrefs(form, ev.getCategories(), ev.getSponsor(), ev.getLocation(), ev.getCalendar()); } form.resetEvent(); form.assignAddingEvent(false); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } return "continue"; }
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } reqpar = request.getParameter("copy"); if (reqpar != null) { BwEvent evcopy = new BwEventObj(); form.getEvent().copyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); form.setEvent(evcopy); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form)) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ BwEvent ev = form.getEvent(); ev.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(ev, null); } else { svci.updateEvent(ev); } if (!alerts) { updateAuthPrefs(form, ev.getCategories(), ev.getSponsor(), ev.getLocation(), ev.getCalendar()); } form.resetEvent(); form.assignAddingEvent(false); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } return "continue"; }
1,118,128
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } reqpar = request.getParameter("copy"); if (reqpar != null) { BwEvent evcopy = new BwEventObj(); form.getEvent().copyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); form.setEvent(evcopy); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form)) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ BwEvent ev = form.getEvent(); ev.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(ev, null); } else { svci.updateEvent(ev); } if (!alerts) { updateAuthPrefs(form, ev.getCategories(), ev.getSponsor(), ev.getLocation(), ev.getCalendar()); } form.resetEvent(); form.assignAddingEvent(false); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } return "continue"; }
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } reqpar = request.getParameter("copy"); if (reqpar != null) { BwEvent evcopy = new BwEventObj(); form.getEvent().copyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); form.setEvent(evcopy); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form)) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ BwEvent ev = form.getEvent(); ev.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(event, null); } else { svci.updateEvent(ev); } if (!alerts) { updateAuthPrefs(form, ev.getCategories(), ev.getSponsor(), ev.getLocation(), ev.getCalendar()); } form.resetEvent(); form.assignAddingEvent(false); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } return "continue"; }
1,118,129
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } reqpar = request.getParameter("copy"); if (reqpar != null) { BwEvent evcopy = new BwEventObj(); form.getEvent().copyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); form.setEvent(evcopy); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form)) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ BwEvent ev = form.getEvent(); ev.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(ev, null); } else { svci.updateEvent(ev); } if (!alerts) { updateAuthPrefs(form, ev.getCategories(), ev.getSponsor(), ev.getLocation(), ev.getCalendar()); } form.resetEvent(); form.assignAddingEvent(false); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } return "continue"; }
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } reqpar = request.getParameter("copy"); if (reqpar != null) { BwEvent evcopy = new BwEventObj(); form.getEvent().copyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); form.setEvent(evcopy); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form)) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ BwEvent ev = form.getEvent(); ev.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(ev, null); } else { svci.updateEvent(event); } if (!alerts) { updateAuthPrefs(form, ev.getCategories(), ev.getSponsor(), ev.getLocation(), ev.getCalendar()); } form.resetEvent(); form.assignAddingEvent(false); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } return "continue"; }
1,118,130
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } reqpar = request.getParameter("copy"); if (reqpar != null) { BwEvent evcopy = new BwEventObj(); form.getEvent().copyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); form.setEvent(evcopy); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form)) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ BwEvent ev = form.getEvent(); ev.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(ev, null); } else { svci.updateEvent(ev); } if (!alerts) { updateAuthPrefs(form, ev.getCategories(), ev.getSponsor(), ev.getLocation(), ev.getCalendar()); } form.resetEvent(); form.assignAddingEvent(false); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } return "continue"; }
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } reqpar = request.getParameter("copy"); if (reqpar != null) { BwEvent evcopy = new BwEventObj(); form.getEvent().copyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); form.setEvent(evcopy); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form)) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ BwEvent ev = form.getEvent(); ev.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(ev, null); } else { svci.updateEvent(ev); } if (!alerts) { updateAuthPrefs(form, ev.getCategories(), ev.getSponsor(), ev.getLocation(), ev.getCalendar()); } form.resetEvent(); form.assignAddingEvent(false); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } return "continue"; }
1,118,131
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } reqpar = request.getParameter("copy"); if (reqpar != null) { BwEvent evcopy = new BwEventObj(); form.getEvent().copyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); form.setEvent(evcopy); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form)) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ BwEvent ev = form.getEvent(); ev.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(ev, null); } else { svci.updateEvent(ev); } if (!alerts) { updateAuthPrefs(form, ev.getCategories(), ev.getSponsor(), ev.getLocation(), ev.getCalendar()); } form.resetEvent(); form.assignAddingEvent(false); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } return "continue"; }
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } reqpar = request.getParameter("copy"); if (reqpar != null) { BwEvent evcopy = new BwEventObj(); form.getEvent().copyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); form.setEvent(evcopy); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form)) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ BwEvent ev = form.getEvent(); ev.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(ev, null); } else { svci.updateEvent(ev); } if (!alerts) { updateAuthPrefs(form, ev.getCategories(), ev.getSponsor(), ev.getLocation(), ev.getCalendar()); } form.resetEvent(); form.assignAddingEvent(false); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } return "continue"; }
1,118,132
private boolean validateEvent(PEActionForm form) throws Throwable { boolean ok = form.validateEventCategory(); BwEvent ev = form.getEvent(); CalSvcI svci = form.fetchSvci(); if (!form.validateEventSponsor()) { ok = false; } if (!form.validateEventLocation()) { ok = false; } if (!form.validateEventCalendar()) { ok = false; } if (!form.getEventDates().updateEvent(ev, svci.getTimezones())) { ok = false; } else { ok = BwWebUtil.validateEvent(svci, ev, true, // descriptionRequired form.getErr()); } return ok; }
private boolean validateEvent(PEActionForm form) throws Throwable { boolean ok = form.validateEventCategory(); BwEvent ev = form.getEvent(); CalSvcI svci = form.fetchSvci(); if (!form.validateEventSponsor()) { ok = false; } if (!form.validateEventLocation()) { ok = false; } if (!form.validateEventCalendar()) { ok = false; } if (!form.getEventDates().updateEvent(ev, svci.getTimezones())) { ok = false; } else { ok = BwWebUtil.validateEvent(svci, ev, true, // descriptionRequired form.getErr()); } return ok; }
1,118,134
private boolean validateEvent(PEActionForm form) throws Throwable { boolean ok = form.validateEventCategory(); BwEvent ev = form.getEvent(); CalSvcI svci = form.fetchSvci(); if (!form.validateEventSponsor()) { ok = false; } if (!form.validateEventLocation()) { ok = false; } if (!form.validateEventCalendar()) { ok = false; } if (!form.getEventDates().updateEvent(ev, svci.getTimezones())) { ok = false; } else { ok = BwWebUtil.validateEvent(svci, ev, true, // descriptionRequired form.getErr()); } return ok; }
private boolean validateEvent(PEActionForm form) throws Throwable { boolean ok = form.validateEventCategory(); BwEvent ev = form.getEvent(); CalSvcI svci = form.fetchSvci(); if (!validateEventSponsor(form, svci, event, err)) { ok = false; } if (!form.validateEventLocation()) { ok = false; } if (!form.validateEventCalendar()) { ok = false; } if (!form.getEventDates().updateEvent(ev, svci.getTimezones())) { ok = false; } else { ok = BwWebUtil.validateEvent(svci, ev, true, // descriptionRequired form.getErr()); } return ok; }
1,118,135
private boolean validateEvent(PEActionForm form) throws Throwable { boolean ok = form.validateEventCategory(); BwEvent ev = form.getEvent(); CalSvcI svci = form.fetchSvci(); if (!form.validateEventSponsor()) { ok = false; } if (!form.validateEventLocation()) { ok = false; } if (!form.validateEventCalendar()) { ok = false; } if (!form.getEventDates().updateEvent(ev, svci.getTimezones())) { ok = false; } else { ok = BwWebUtil.validateEvent(svci, ev, true, // descriptionRequired form.getErr()); } return ok; }
private boolean validateEvent(PEActionForm form) throws Throwable { boolean ok = form.validateEventCategory(); BwEvent ev = form.getEvent(); CalSvcI svci = form.fetchSvci(); if (!form.validateEventSponsor()) { ok = false; } if (!validateEventLocation(form, svci, event, err)) { ok = false; } if (!form.validateEventCalendar()) { ok = false; } if (!form.getEventDates().updateEvent(ev, svci.getTimezones())) { ok = false; } else { ok = BwWebUtil.validateEvent(svci, ev, true, // descriptionRequired form.getErr()); } return ok; }
1,118,136
private boolean validateEvent(PEActionForm form) throws Throwable { boolean ok = form.validateEventCategory(); BwEvent ev = form.getEvent(); CalSvcI svci = form.fetchSvci(); if (!form.validateEventSponsor()) { ok = false; } if (!form.validateEventLocation()) { ok = false; } if (!form.validateEventCalendar()) { ok = false; } if (!form.getEventDates().updateEvent(ev, svci.getTimezones())) { ok = false; } else { ok = BwWebUtil.validateEvent(svci, ev, true, // descriptionRequired form.getErr()); } return ok; }
private boolean validateEvent(PEActionForm form) throws Throwable { boolean ok = form.validateEventCategory(); BwEvent ev = form.getEvent(); CalSvcI svci = form.fetchSvci(); if (!form.validateEventSponsor()) { ok = false; } if (!form.validateEventLocation()) { ok = false; } if (!validateEventCalendar(form, svci, event, err)) { ok = false; } if (!form.getEventDates().updateEvent(ev, svci.getTimezones())) { ok = false; } else { ok = BwWebUtil.validateEvent(svci, ev, true, // descriptionRequired form.getErr()); } return ok; }
1,118,137
private boolean validateEvent(PEActionForm form) throws Throwable { boolean ok = form.validateEventCategory(); BwEvent ev = form.getEvent(); CalSvcI svci = form.fetchSvci(); if (!form.validateEventSponsor()) { ok = false; } if (!form.validateEventLocation()) { ok = false; } if (!form.validateEventCalendar()) { ok = false; } if (!form.getEventDates().updateEvent(ev, svci.getTimezones())) { ok = false; } else { ok = BwWebUtil.validateEvent(svci, ev, true, // descriptionRequired form.getErr()); } return ok; }
private boolean validateEvent(PEActionForm form) throws Throwable { boolean ok = form.validateEventCategory(); BwEvent ev = form.getEvent(); CalSvcI svci = form.fetchSvci(); if (!form.validateEventSponsor()) { ok = false; } if (!form.validateEventLocation()) { ok = false; } if (!form.validateEventCalendar()) { ok = false; } if (!form.getEventDates().updateEvent(event, svci.getTimezones())) { ok = false; } else { ok = BwWebUtil.validateEvent(svci, ev, true, // descriptionRequired form.getErr()); } return ok; }
1,118,138
private boolean validateEvent(PEActionForm form) throws Throwable { boolean ok = form.validateEventCategory(); BwEvent ev = form.getEvent(); CalSvcI svci = form.fetchSvci(); if (!form.validateEventSponsor()) { ok = false; } if (!form.validateEventLocation()) { ok = false; } if (!form.validateEventCalendar()) { ok = false; } if (!form.getEventDates().updateEvent(ev, svci.getTimezones())) { ok = false; } else { ok = BwWebUtil.validateEvent(svci, ev, true, // descriptionRequired form.getErr()); } return ok; }
private boolean validateEvent(PEActionForm form) throws Throwable { boolean ok = form.validateEventCategory(); BwEvent ev = form.getEvent(); CalSvcI svci = form.fetchSvci(); if (!form.validateEventSponsor()) { ok = false; } if (!form.validateEventLocation()) { ok = false; } if (!form.validateEventCalendar()) { ok = false; } if (!form.getEventDates().updateEvent(ev, svci.getTimezones())) { ok = false; } else { ok = BwWebUtil.validateEvent(svci, ev, true, // descriptionRequired form.getErr()); } return ok; }
1,118,139
protected boolean checkSvci(HttpServletRequest request, BwActionFormBase form, BwSession sess, int access, String user, boolean publicAdmin, boolean canSwitch, boolean debug) throws CalFacadeException { /** Do some checks first */ String authUser = String.valueOf(form.getCurrentUser()); if (!publicAdmin) { /* We're never allowed to switch identity as a user client. */ if (!authUser.equals(String.valueOf(user))) { return false; } } else if (user == null) { throw new CalFacadeException("Null user parameter for public admin."); } CalSvcI svci = BwWebUtil.getCalSvcI(request); /** Make some checks to see if this is an old - restarted session. If so discard the svc interface */ if (svci != null) { if (!svci.isOpen()) { svci = null; info(".Svci interface discarded from old session"); } } if (svci != null) { /* Already there and already opened */ if (debug) { debugMsg("CalSvcI-- Obtained from session for user " + svci.getUser()); } } else { if (debug) { debugMsg(".CalSvcI-- get new object for user " + user); } /* create a call back object so the filter can open the service interface */ BwCallback cb = new Callback(form); HttpSession hsess = request.getSession(); hsess.setAttribute(BwCallback.cbAttrName, cb); String runAsUser = user; try { svci = new CalSvc(); if (publicAdmin || (user == null)) { runAsUser = form.getEnv().getAppProperty("run.as.user"); } CalSvcIPars pars = new CalSvcIPars(user, access, runAsUser, form.getEnv().getAppPrefix(), publicAdmin, false, // caldav null, // synchId debug); svci.init(pars); BwWebUtil.setCalSvcI(request, svci); form.setCalSvcI(svci); cb.in(true); } catch (CalFacadeException cfe) { throw cfe; } catch (Throwable t) { throw new CalFacadeException(t); } } form.assignUserVO((BwUser)svci.getUser().clone()); if (publicAdmin) { canSwitch = canSwitch || ((access & UserAuth.contentAdminUser) != 0) || ((access & UserAuth.superUser) != 0); BwUser u = svci.getUser(); if (u == null) { throw new CalFacadeException("Null user for public admin."); } String curUser = u.getAccount(); if (!canSwitch && !user.equals(curUser)) { /** Trying to switch but not allowed */ return false; } if (!user.equals(curUser)) { /** Switching user */ svci.setUser(user); curUser = user; } form.assignCurrentAdminUser(curUser); } return true; }
protected boolean checkSvci(HttpServletRequest request, BwActionFormBase form, BwSession sess, int access, String user, boolean publicAdmin, boolean canSwitch, boolean debug) throws CalFacadeException { /** Do some checks first */ String authUser = String.valueOf(form.getCurrentUser()); if (!publicAdmin) { /* We're never allowed to switch identity as a user client. */ if (!authUser.equals(String.valueOf(user))) { return false; } } else if (user == null) { throw new CalFacadeException("Null user parameter for public admin."); } CalSvcI svci = BwWebUtil.getCalSvcI(request); /** Make some checks to see if this is an old - restarted session. If so discard the svc interface */ if (svci != null) { if (!svci.isOpen()) { svci = null; info(".Svci interface discarded from old session"); } } if (svci != null) { /* Already there and already opened */ if (debug) { debugMsg("CalSvcI-- Obtained from session for user " + svci.getUser()); } } else { if (debug) { debugMsg(".CalSvcI-- get new object for user " + user); } /* create a call back object so the filter can open the service interface */ BwCallback cb = new Callback(form); HttpSession hsess = request.getSession(); hsess.setAttribute(BwCallback.cbAttrName, cb); String runAsUser = user; try { svci = new CalSvc(); if (publicAdmin || (user == null)) { runAsUser = form.getEnv().getAppProperty("run.as.user"); } CalSvcIPars pars = new CalSvcIPars(user, access, runAsUser, form.getEnv().getAppPrefix(), publicAdmin, false, // caldav null, // synchId debug); svci.init(pars); BwWebUtil.setCalSvcI(request, svci); form.setCalSvcI(svci); cb.in(true); } catch (CalFacadeException cfe) { throw cfe; } catch (Throwable t) { throw new CalFacadeException(t); } } form.assignUserVO((BwUser)svci.getUser().clone()); if (publicAdmin) { canSwitch = canSwitch || ((access & UserAuth.contentAdminUser) != 0) || ((access & UserAuth.superUser) != 0); BwUser u = svci.getUser(); if (u == null) { throw new CalFacadeException("Null user for public admin."); } String curUser = u.getAccount(); if (!canSwitch && !user.equals(curUser)) { /** Trying to switch but not allowed */ return false; } if (!user.equals(curUser)) { /** Switching user */ svci.setUser(user); curUser = user; } form.assignCurrentAdminUser(curUser); } return true; }
1,118,141
protected boolean checkSvci(HttpServletRequest request, BwActionFormBase form, BwSession sess, int access, String user, boolean publicAdmin, boolean canSwitch, boolean debug) throws CalFacadeException { /** Do some checks first */ String authUser = String.valueOf(form.getCurrentUser()); if (!publicAdmin) { /* We're never allowed to switch identity as a user client. */ if (!authUser.equals(String.valueOf(user))) { return false; } } else if (user == null) { throw new CalFacadeException("Null user parameter for public admin."); } CalSvcI svci = BwWebUtil.getCalSvcI(request); /** Make some checks to see if this is an old - restarted session. If so discard the svc interface */ if (svci != null) { if (!svci.isOpen()) { svci = null; info(".Svci interface discarded from old session"); } } if (svci != null) { /* Already there and already opened */ if (debug) { debugMsg("CalSvcI-- Obtained from session for user " + svci.getUser()); } } else { if (debug) { debugMsg(".CalSvcI-- get new object for user " + user); } /* create a call back object so the filter can open the service interface */ BwCallback cb = new Callback(form); HttpSession hsess = request.getSession(); hsess.setAttribute(BwCallback.cbAttrName, cb); String runAsUser = user; try { svci = new CalSvc(); if (publicAdmin || (user == null)) { runAsUser = form.getEnv().getAppProperty("run.as.user"); } CalSvcIPars pars = new CalSvcIPars(user, access, runAsUser, form.getEnv().getAppPrefix(), publicAdmin, false, // caldav null, // synchId debug); svci.init(pars); BwWebUtil.setCalSvcI(request, svci); form.setCalSvcI(svci); cb.in(true); } catch (CalFacadeException cfe) { throw cfe; } catch (Throwable t) { throw new CalFacadeException(t); } } form.assignUserVO((BwUser)svci.getUser().clone()); if (publicAdmin) { canSwitch = canSwitch || ((access & UserAuth.contentAdminUser) != 0) || ((access & UserAuth.superUser) != 0); BwUser u = svci.getUser(); if (u == null) { throw new CalFacadeException("Null user for public admin."); } String curUser = u.getAccount(); if (!canSwitch && !user.equals(curUser)) { /** Trying to switch but not allowed */ return false; } if (!user.equals(curUser)) { /** Switching user */ svci.setUser(user); curUser = user; } form.assignCurrentAdminUser(curUser); } return true; }
protected boolean checkSvci(HttpServletRequest request, BwActionFormBase form, BwSession sess, int access, String user, boolean publicAdmin, boolean canSwitch, boolean debug) throws CalFacadeException { /** Do some checks first */ String authUser = String.valueOf(form.getCurrentUser()); if (!publicAdmin) { /* We're never allowed to switch identity as a user client. */ if (!authUser.equals(String.valueOf(user))) { return false; } } else if (user == null) { throw new CalFacadeException("Null user parameter for public admin."); } CalSvcI svci = BwWebUtil.getCalSvcI(request); /** Make some checks to see if this is an old - restarted session. If so discard the svc interface */ if (svci != null) { if (!svci.isOpen()) { svci = null; info(".Svci interface discarded from old session"); } } if (svci != null) { /* Already there and already opened */ if (debug) { debugMsg("CalSvcI-- Obtained from session for user " + svci.getUser()); } } else { if (debug) { debugMsg(".CalSvcI-- get new object for user " + user); } /* create a call back object so the filter can open the service interface */ BwCallback cb = new Callback(form); HttpSession hsess = request.getSession(); hsess.setAttribute(BwCallback.cbAttrName, cb); String runAsUser = user; try { svci = new CalSvc(); if (publicAdmin || (user == null)) { runAsUser = form.getEnv().getAppProperty("run.as.user"); } CalSvcIPars pars = new CalSvcIPars(user, runAsUser, form.getEnv().getAppPrefix(), publicAdmin, false, // caldav null, // synchId debug); svci.init(pars); BwWebUtil.setCalSvcI(request, svci); form.setCalSvcI(svci); cb.in(true); } catch (CalFacadeException cfe) { throw cfe; } catch (Throwable t) { throw new CalFacadeException(t); } } form.assignUserVO((BwUser)svci.getUser().clone()); if (publicAdmin) { canSwitch = canSwitch || ((access & UserAuth.contentAdminUser) != 0) || ((access & UserAuth.superUser) != 0); BwUser u = svci.getUser(); if (u == null) { throw new CalFacadeException("Null user for public admin."); } String curUser = u.getAccount(); if (!canSwitch && !user.equals(curUser)) { /** Trying to switch but not allowed */ return false; } if (!user.equals(curUser)) { /** Switching user */ svci.setUser(user); curUser = user; } form.assignCurrentAdminUser(curUser); } return true; }
1,118,142
protected int getAccess(HttpServletRequest req, MessageResources messages) throws CalFacadeException { int access = 0; /** This form works with broken containers. */ if (req.isUserInRole( getMessages().getMessage("org.bedework.role.admin"))) { access += UserAuth.superUser; } if (req.isUserInRole( getMessages().getMessage("org.bedework.role.contentadmin"))) { access += UserAuth.contentAdminUser; } if (req.isUserInRole( getMessages().getMessage("org.bedework.role.alert"))) { access += UserAuth.alertUser; } if (req.isUserInRole( getMessages().getMessage("org.bedework.role.owner"))) { access += UserAuth.publicEventUser; } /** This is how it out to look if (req.isUserInRole("admin")) { access += UserAuth.superUser; } if (req.isUserInRole("contentadmin")) { access += UserAuth.contentAdminUser; } if (req.isUserInRole("alert")) { access += UserAuth.alertUser; } if (req.isUserInRole("owner")) { access += UserAuth.publicEventUser; } */ return access; }
protected int getAccess(HttpServletRequest req, MessageResources messages) throws CalFacadeException { int access = 0; /** This form works with broken containers. */ if (req.isUserInRole( getMessages().getMessage("org.bedework.role.admin"))) { access += UserAuth.superUser; } if (req.isUserInRole( getMessages().getMessage("org.bedework.role.contentadmin"))) { access += UserAuth.contentAdminUser; } if (req.isUserInRole( getMessages().getMessage("org.bedework.role.alert"))) { access += UserAuth.alertUser; } if (req.isUserInRole( getMessages().getMessage("org.bedework.role.owner"))) { access += UserAuth.publicEventUser; } /** This is how it out to look if (req.isUserInRole("admin")) { access += UserAuth.superUser; } if (req.isUserInRole("contentadmin")) { access += UserAuth.contentAdminUser; } if (req.isUserInRole("alert")) { access += UserAuth.alertUser; } if (req.isUserInRole("owner")) { access += UserAuth.publicEventUser; } */ return access; }
1,118,143
protected int getAccess(HttpServletRequest req, MessageResources messages) throws CalFacadeException { int access = 0; /** This form works with broken containers. */ if (req.isUserInRole( getMessages().getMessage("org.bedework.role.admin"))) { access += UserAuth.superUser; } if (req.isUserInRole( getMessages().getMessage("org.bedework.role.contentadmin"))) { access += UserAuth.contentAdminUser; } if (req.isUserInRole( getMessages().getMessage("org.bedework.role.alert"))) { access += UserAuth.alertUser; } if (req.isUserInRole( getMessages().getMessage("org.bedework.role.owner"))) { access += UserAuth.publicEventUser; } /** This is how it out to look if (req.isUserInRole("admin")) { access += UserAuth.superUser; } if (req.isUserInRole("contentadmin")) { access += UserAuth.contentAdminUser; } if (req.isUserInRole("alert")) { access += UserAuth.alertUser; } if (req.isUserInRole("owner")) { access += UserAuth.publicEventUser; } */ return access; }
protected int getAccess(HttpServletRequest req, MessageResources messages) throws CalFacadeException { int access = 0; /** This form works with broken containers. */ if (req.isUserInRole( getMessages().getMessage("org.bedework.role.admin"))) { access += UserAuth.superUser; } if (req.isUserInRole( getMessages().getMessage("org.bedework.role.contentadmin"))) { access += UserAuth.contentAdminUser; } if (req.isUserInRole( getMessages().getMessage("org.bedework.role.alert"))) { access += UserAuth.alertUser; } if (req.isUserInRole( getMessages().getMessage("org.bedework.role.owner"))) { access += UserAuth.publicEventUser; } /** This is how it ought to look if (req.isUserInRole("admin")) { access += UserAuth.superUser; } if (req.isUserInRole("contentadmin")) { access += UserAuth.contentAdminUser; } if (req.isUserInRole("alert")) { access += UserAuth.alertUser; } if (req.isUserInRole("owner")) { access += UserAuth.publicEventUser; } */ return access; }
1,118,144
public synchronized BwSession getState(HttpServletRequest request, BwActionFormBase form, MessageResources messages, String adminUserId, boolean admin) throws Throwable { BwSession s = BwWebUtil.getState(request); HttpSession sess = request.getSession(false); if (s != null) { if (debug) { debugMsg("getState-- obtainedfrom session"); debugMsg("getState-- timeout interval = " + sess.getMaxInactiveInterval()); } form.assignNewSession(false); } else { if (debug) { debugMsg("getState-- get new object"); } form.assignNewSession(true); CalEnv env = getEnv(request, form); String appName = env.getAppProperty("name"); String appRoot = env.getAppProperty("root"); /** The actual session class used is possibly site dependent */ s = new BwSessionImpl(form.getCurrentUser(), appRoot, appName, form.getPresentationState(), messages, form.getSchemeHostPort(), debug); BwWebUtil.setState(request, s); form.setHour24(env.getAppBoolProperty("hour24")); form.setMinIncrement(env.getAppIntProperty("minincrement")); if (!admin) { form.assignShowYearData(env.getAppBoolProperty("showyeardata")); } setSessionAttr(request, "cal.pubevents.client.uri", messages.getMessage("org.bedework.public.calendar.uri")); setSessionAttr(request, "cal.personal.client.uri", messages.getMessage("org.bedework.personal.calendar.uri")); setSessionAttr(request, "cal.admin.client.uri", messages.getMessage("org.bedework.public.admin.uri")); String temp = messages.getMessage("org.bedework.host"); if (temp == null) { temp = form.getSchemeHostPort(); } setSessionAttr(request, "cal.server.host", temp); String raddr = request.getRemoteAddr(); String rhost = request.getRemoteHost(); SessionListener.setId(appName); // First time will have no name info("===============" + appName + ": New session (" + s.getSessionNum() + ") from " + rhost + "(" + raddr + ")"); if (!admin) { /** Ensure the session timeout interval is longer than our refresh period */ // Should come from db -- int refInt = s.getRefreshInterval(); int refInt = 60; // 1 min refresh? if (refInt > 0) { int timeout = sess.getMaxInactiveInterval(); if (timeout <= refInt) { // An extra minute should do it. debugMsg("@+@+@+@+@+ set timeout to " + (refInt + 60)); sess.setMaxInactiveInterval(refInt + 60); } } } } int access = getAccess(request, messages); if (debug) { debugMsg("Container says that current user has the type: " + access); } /** Ensure we have a CalAdminSvcI object */ checkSvci(request, form, s, access, adminUserId, getPublicAdmin(form), false, debug); /** Somewhere up there we may have to do more for user auth in the session. This is where we can figure out this is a first call. */ UserAuth ua = null; UserAuthPar par = new UserAuthPar(); par.svlt = servlet; par.req = request; try { ua = form.fetchSvci().getUserAuth(s.getUser(), par); form.assignAuthorisedUser(ua.getUsertype() != UserAuth.noPrivileges); if (debug) { debugMsg("UserAuth says that current user has the type: " + ua.getUsertype()); } } catch (Throwable t) { form.getErr().emit("org.bedework.client.error.exc", t.getMessage()); form.getErr().emit(t); return null; } return s; }
public synchronized BwSession getState(HttpServletRequest request, BwActionFormBase form, MessageResources messages, String adminUserId, boolean admin) throws Throwable { BwSession s = BwWebUtil.getState(request); HttpSession sess = request.getSession(false); if (s != null) { if (debug) { debugMsg("getState-- obtainedfrom session"); debugMsg("getState-- timeout interval = " + sess.getMaxInactiveInterval()); } form.assignNewSession(false); } else { if (debug) { debugMsg("getState-- get new object"); } form.assignNewSession(true); CalEnv env = getEnv(request, form); String appName = env.getAppProperty("name"); String appRoot = env.getAppProperty("root"); /** The actual session class used is possibly site dependent */ s = new BwSessionImpl(form.getCurrentUser(), appRoot, appName, form.getPresentationState(), messages, form.getSchemeHostPort(), debug); BwWebUtil.setState(request, s); form.setHour24(env.getAppBoolProperty("hour24")); form.setMinIncrement(env.getAppIntProperty("minincrement")); if (!admin) { form.assignShowYearData(env.getAppBoolProperty("showyeardata")); } setSessionAttr(request, "cal.pubevents.client.uri", messages.getMessage("org.bedework.public.calendar.uri")); setSessionAttr(request, "cal.personal.client.uri", messages.getMessage("org.bedework.personal.calendar.uri")); setSessionAttr(request, "cal.admin.client.uri", messages.getMessage("org.bedework.public.admin.uri")); String temp = messages.getMessage("org.bedework.host"); if (temp == null) { temp = form.getSchemeHostPort(); } setSessionAttr(request, "cal.server.host", temp); String raddr = request.getRemoteAddr(); String rhost = request.getRemoteHost(); SessionListener.setId(appName); // First time will have no name info("===============" + appName + ": New session (" + s.getSessionNum() + ") from " + rhost + "(" + raddr + ")"); if (!admin) { /** Ensure the session timeout interval is longer than our refresh period */ // Should come from db -- int refInt = s.getRefreshInterval(); int refInt = 60; // 1 min refresh? if (refInt > 0) { int timeout = sess.getMaxInactiveInterval(); if (timeout <= refInt) { // An extra minute should do it. debugMsg("@+@+@+@+@+ set timeout to " + (refInt + 60)); sess.setMaxInactiveInterval(refInt + 60); } } } } int access = getAccess(request, messages); if (debug) { debugMsg("Container says that current user has the type: " + access); } /** Ensure we have a CalAdminSvcI object */ checkSvci(request, form, s, access, adminUserId, getPublicAdmin(form), false, debug); /** Somewhere up there we may have to do more for user auth in the session. This is where we can figure out this is a first call. */ UserAuth ua = null; UserAuthPar par = new UserAuthPar(); par.svlt = servlet; par.req = request; try { ua = form.fetchSvci().getUserAuth(s.getUser(), par); form.assignAuthorisedUser(ua.getUsertype() != UserAuth.noPrivileges); if (debug) { debugMsg("UserAuth says that current user has the type: " + ua.getUsertype()); } } catch (Throwable t) { form.getErr().emit("org.bedework.client.error.exc", t.getMessage()); form.getErr().emit(t); return null; } return s; }
1,118,145
public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ double offset = (beginTime - overBeginTime)/ (double)(overTimeInterval) * overSize.getWidth(); g2.drawImage(((Image)overSizedImage.get()), AffineTransform.getTranslateInstance(-offset, 0.0), null); if(redo) this.createImage(); redo = false; } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overTimeInterval) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); } }
public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ double offset = (beginTime - overBeginTime)/ (double)(overTimeInterval) * overSize.getWidth(); g2.drawImage(((Image)overSizedImage.get()), AffineTransform.getTranslateInstance(-offset, 0.0), null); if(redo) this.createImage(); redo = false; } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overTimeInterval) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); this.createImage(); } }
1,118,148
public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ double offset = (beginTime - overBeginTime)/ (double)(overTimeInterval) * overSize.getWidth(); g2.drawImage(((Image)overSizedImage.get()), AffineTransform.getTranslateInstance(-offset, 0.0), null); if(redo) this.createImage(); redo = false; } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overTimeInterval) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); } }
public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ double offset = (beginTime - overBeginTime)/ (double)(overTimeInterval) * overSize.getWidth(); g2.drawImage(((Image)overSizedImage.get()), AffineTransform.getTranslateInstance(-offset, 0.0), null); if(redo) this.createImage(); redo = false; } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overTimeInterval) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); } }
1,118,149
public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ double offset = (beginTime - overBeginTime)/ (double)(overTimeInterval) * overSize.getWidth(); g2.drawImage(((Image)overSizedImage.get()), AffineTransform.getTranslateInstance(-offset, 0.0), null); if(redo) this.createImage(); redo = false; } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overTimeInterval) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); } }
public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ double offset = (beginTime - overBeginTime)/ (double)(overTimeInterval) * overSize.getWidth(); g2.drawImage(((Image)overSizedImage.get()), AffineTransform.getTranslateInstance(-offset, 0.0), null); if(redo) this.createImage(); redo = false; } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overTimeInterval) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); } }
1,118,150
public synchronized void setImage(Image newImage){ overTimeRange = timeConfig.getTimeRange().getOversizedTimeRange(2); overEndTime = overTimeRange.getEndTime().getMicroSecondTime(); overBeginTime = overTimeRange.getBeginTime().getMicroSecondTime(); overTimeInterval = overEndTime - overBeginTime; displayTime = displayInterval.getValue(); overSizedImage = new SoftReference(newImage); repaint(); }
public synchronized void setImage(Image newImage){ overTimeRange = timeConfig.getTimeRange().getOversizedTimeRange(2); overEndTime = overTimeRange.getEndTime().getMicroSecondTime(); overBeginTime = overTimeRange.getBeginTime().getMicroSecondTime(); overTimeInterval = overEndTime - overBeginTime; displayTime = displayInterval.getValue(); overSizedImage = new SoftReference(newImage); repaint(); }
1,118,151
public synchronized void setImage(Image newImage){ overTimeRange = timeConfig.getTimeRange().getOversizedTimeRange(2); overEndTime = overTimeRange.getEndTime().getMicroSecondTime(); overBeginTime = overTimeRange.getBeginTime().getMicroSecondTime(); overTimeInterval = overEndTime - overBeginTime; displayTime = displayInterval.getValue(); overSizedImage = new SoftReference(newImage); repaint(); }
public synchronized void setImage(Image newImage){ overTimeRange = timeConfig.getTimeRange().getOversizedTimeRange(2); overEndTime = overTimeRange.getEndTime().getMicroSecondTime(); overBeginTime = overTimeRange.getBeginTime().getMicroSecondTime(); overTimeInterval = overEndTime - overBeginTime; displayTime = displayInterval.getValue(); overSizedImage = new SoftReference(newImage); repaint(); }
1,118,152
public AbstractDb (String directoryName, String databaseName){ this.directoryName = directoryName; this.databaseName = databaseName; }
public AbstractDb (String directoryName, String databaseName){ this.directoryName = directoryName; this.databaseName = databaseName; }
1,118,160
protected Command getCreateCommand(CreateElementRequest req) { if (UMLElementTypes.OutputPin_3006 == req.getElementType()) { if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getCallAction_Result()); } return getMSLWrapper(new CreateOutputPin_3006Command(req)); } if (UMLElementTypes.InputPin_3007 == req.getElementType()) { if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getInvocationAction_Argument()); } return getMSLWrapper(new CreateInputPin_3007Command(req)); } if (UMLElementTypes.InputPin_3008 == req.getElementType()) { CallOperationAction container = (CallOperationAction) (req.getContainer() instanceof View ? ((View) req.getContainer()).getElement() : req.getContainer()); if (container.getTarget() != null) { return super.getCreateCommand(req); } if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getCallOperationAction_Target()); } return getMSLWrapper(new CreateInputPin_3008Command(req)); } return super.getCreateCommand(req); }
protected Command getCreateCommand(CreateElementRequest req) { if (UMLElementTypes.OutputPin_3006 == req.getElementType()) { if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getCallAction_Result()); } return getMSLWrapper(new OutputPin3CreateCommand(req)); } if (UMLElementTypes.InputPin_3007 == req.getElementType()) { if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getInvocationAction_Argument()); } return getMSLWrapper(new CreateInputPin_3007Command(req)); } if (UMLElementTypes.InputPin_3008 == req.getElementType()) { CallOperationAction container = (CallOperationAction) (req.getContainer() instanceof View ? ((View) req.getContainer()).getElement() : req.getContainer()); if (container.getTarget() != null) { return super.getCreateCommand(req); } if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getCallOperationAction_Target()); } return getMSLWrapper(new CreateInputPin_3008Command(req)); } return super.getCreateCommand(req); }
1,118,161
protected Command getCreateCommand(CreateElementRequest req) { if (UMLElementTypes.OutputPin_3006 == req.getElementType()) { if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getCallAction_Result()); } return getMSLWrapper(new CreateOutputPin_3006Command(req)); } if (UMLElementTypes.InputPin_3007 == req.getElementType()) { if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getInvocationAction_Argument()); } return getMSLWrapper(new CreateInputPin_3007Command(req)); } if (UMLElementTypes.InputPin_3008 == req.getElementType()) { CallOperationAction container = (CallOperationAction) (req.getContainer() instanceof View ? ((View) req.getContainer()).getElement() : req.getContainer()); if (container.getTarget() != null) { return super.getCreateCommand(req); } if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getCallOperationAction_Target()); } return getMSLWrapper(new CreateInputPin_3008Command(req)); } return super.getCreateCommand(req); }
protected Command getCreateCommand(CreateElementRequest req) { if (UMLElementTypes.OutputPin_3006 == req.getElementType()) { if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getCallAction_Result()); } return getMSLWrapper(new CreateOutputPin_3006Command(req)); } if (UMLElementTypes.InputPin_3007 == req.getElementType()) { if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getInvocationAction_Argument()); } return getMSLWrapper(new InputPin4CreateCommand(req)); } if (UMLElementTypes.InputPin_3008 == req.getElementType()) { CallOperationAction container = (CallOperationAction) (req.getContainer() instanceof View ? ((View) req.getContainer()).getElement() : req.getContainer()); if (container.getTarget() != null) { return super.getCreateCommand(req); } if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getCallOperationAction_Target()); } return getMSLWrapper(new CreateInputPin_3008Command(req)); } return super.getCreateCommand(req); }
1,118,162
protected Command getCreateCommand(CreateElementRequest req) { if (UMLElementTypes.OutputPin_3006 == req.getElementType()) { if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getCallAction_Result()); } return getMSLWrapper(new CreateOutputPin_3006Command(req)); } if (UMLElementTypes.InputPin_3007 == req.getElementType()) { if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getInvocationAction_Argument()); } return getMSLWrapper(new CreateInputPin_3007Command(req)); } if (UMLElementTypes.InputPin_3008 == req.getElementType()) { CallOperationAction container = (CallOperationAction) (req.getContainer() instanceof View ? ((View) req.getContainer()).getElement() : req.getContainer()); if (container.getTarget() != null) { return super.getCreateCommand(req); } if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getCallOperationAction_Target()); } return getMSLWrapper(new CreateInputPin_3008Command(req)); } return super.getCreateCommand(req); }
protected Command getCreateCommand(CreateElementRequest req) { if (UMLElementTypes.OutputPin_3006 == req.getElementType()) { if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getCallAction_Result()); } return getMSLWrapper(new CreateOutputPin_3006Command(req)); } if (UMLElementTypes.InputPin_3007 == req.getElementType()) { if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getInvocationAction_Argument()); } return getMSLWrapper(new CreateInputPin_3007Command(req)); } if (UMLElementTypes.InputPin_3008 == req.getElementType()) { CallOperationAction container = (CallOperationAction) (req.getContainer() instanceof View ? ((View) req.getContainer()).getElement() : req.getContainer()); if (container.getTarget() != null) { return super.getCreateCommand(req); } if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getCallOperationAction_Target()); } return getMSLWrapper(new CreateInputPin_3008Command(req)); } return super.getCreateCommand(req); }
1,118,163
protected Command getCreateCommand(CreateElementRequest req) { if (UMLElementTypes.OutputPin_3006 == req.getElementType()) { if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getCallAction_Result()); } return getMSLWrapper(new CreateOutputPin_3006Command(req)); } if (UMLElementTypes.InputPin_3007 == req.getElementType()) { if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getInvocationAction_Argument()); } return getMSLWrapper(new CreateInputPin_3007Command(req)); } if (UMLElementTypes.InputPin_3008 == req.getElementType()) { CallOperationAction container = (CallOperationAction) (req.getContainer() instanceof View ? ((View) req.getContainer()).getElement() : req.getContainer()); if (container.getTarget() != null) { return super.getCreateCommand(req); } if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getCallOperationAction_Target()); } return getMSLWrapper(new CreateInputPin_3008Command(req)); } return super.getCreateCommand(req); }
protected Command getCreateCommand(CreateElementRequest req) { if (UMLElementTypes.OutputPin_3006 == req.getElementType()) { if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getCallAction_Result()); } return getMSLWrapper(new CreateOutputPin_3006Command(req)); } if (UMLElementTypes.InputPin_3007 == req.getElementType()) { if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getInvocationAction_Argument()); } return getMSLWrapper(new CreateInputPin_3007Command(req)); } if (UMLElementTypes.InputPin_3008 == req.getElementType()) { CallOperationAction container = (CallOperationAction) (req.getContainer() instanceof View ? ((View) req.getContainer()).getElement() : req.getContainer()); if (container.getTarget() != null) { return super.getCreateCommand(req); } if (req.getContainmentFeature() == null) { req.setContainmentFeature(UMLPackage.eINSTANCE.getCallOperationAction_Target()); } return getMSLWrapper(new InputPin5CreateCommand(req)); } return super.getCreateCommand(req); }
1,118,164
public int sendRequest(String method, String url, String user, String pw, Header[] hdrs, String depth, String contentType, int contentLen, byte[] content) throws Throwable { int sz = 0; if (content != null) { sz = content.length; } if (debug) { debugMsg("About to send request: method=" + method + " contentLen=" + contentLen + " content.length=" + sz); } client.setMethodName(method, url); HttpMethod meth = client.getMethod(); if (meth instanceof DepthHttpMethod) { ((DepthHttpMethod)meth).setDepth(depth); } if (user != null) { String upw = user + ":" + pw; meth.setRequestHeader("Authorization", "Basic " + new String(new BASE64Encoder().encode (upw.getBytes()))); } if (hdrs != null) { for (int i = 0; i < hdrs.length; i++) { meth.setRequestHeader(hdrs[i]); } } if (contentType == null) { contentType = "text/xml"; } if (content != null) { client.setContent(content, contentType); } status = client.execute(); return status; }
public int sendRequest(String method, String url, Header[] hdrs, String depth, String contentType, int contentLen, byte[] content) throws Throwable { int sz = 0; if (content != null) { sz = content.length; } if (debug) { debugMsg("About to send request: method=" + method + " contentLen=" + contentLen + " content.length=" + sz); } client.setMethodName(method, url); HttpMethod meth = client.getMethod(); if (meth instanceof DepthHttpMethod) { ((DepthHttpMethod)meth).setDepth(depth); } if (user != null) { String upw = user + ":" + pw; meth.setRequestHeader("Authorization", "Basic " + new String(new BASE64Encoder().encode (upw.getBytes()))); } if (hdrs != null) { for (int i = 0; i < hdrs.length; i++) { meth.setRequestHeader(hdrs[i]); } } if (contentType == null) { contentType = "text/xml"; } if (content != null) { client.setContent(content, contentType); } status = client.execute(); return status; }
1,118,165
public int sendRequest(String method, String url, String user, String pw, Header[] hdrs, String depth, String contentType, int contentLen, byte[] content) throws Throwable { int sz = 0; if (content != null) { sz = content.length; } if (debug) { debugMsg("About to send request: method=" + method + " contentLen=" + contentLen + " content.length=" + sz); } client.setMethodName(method, url); HttpMethod meth = client.getMethod(); if (meth instanceof DepthHttpMethod) { ((DepthHttpMethod)meth).setDepth(depth); } if (user != null) { String upw = user + ":" + pw; meth.setRequestHeader("Authorization", "Basic " + new String(new BASE64Encoder().encode (upw.getBytes()))); } if (hdrs != null) { for (int i = 0; i < hdrs.length; i++) { meth.setRequestHeader(hdrs[i]); } } if (contentType == null) { contentType = "text/xml"; } if (content != null) { client.setContent(content, contentType); } status = client.execute(); return status; }
public int sendRequest(String method, String url, String user, String pw, Header[] hdrs, String depth, String contentType, int contentLen, byte[] content) throws Throwable { int sz = 0; if (content != null) { sz = content.length; } if (debug) { debugMsg("About to send request: method=" + method + " contentLen=" + contentLen + " content.length=" + sz); } client.setMethodName(method, url); HttpMethod meth = client.getMethod(); if (meth instanceof DepthHttpMethod) { ((DepthHttpMethod)meth).setDepth(depth); } if (user != null) { String upw = user + ":" + pw; meth.setRequestHeader("Authorization", "Basic " + new String(new BASE64Encoder().encode (upw.getBytes()))); } if (hdrs != null) { for (int i = 0; i < hdrs.length; i++) { meth.setRequestHeader(hdrs[i]); } } if (contentType == null) { contentType = "text/xml"; } if (content != null) { client.setContent(content, contentType); } status = client.execute(); return status; }
1,118,166
public LocalSeismogramImpl getSeismogram(String name) { if (seismogramCache.containsKey(name)) { logger.debug("getting the seismogram fromt the cache"); Object obj = seismogramCache.get(name); if(obj instanceof SoftReference) { SoftReference softReference = (SoftReference)obj; LocalSeismogramImpl seis = (LocalSeismogramImpl)softReference.get(); if(seis != null) { logger.debug("**********NO NULL WHILE GETTING FROM RHT CACHE"); return seis; } else { logger.debug("********** GARBAGE COLLECTED SO SEISMOGRAM NOT IN MEWMOERY"); seismogramCache.remove(name); } } else return (LocalSeismogramImpl)obj; } // end of if (seismogramCache.containsKey(name)) //logger.debug("The name of the data set is "+getName()); //logger.debug("The name of the seismogram is "+name); String urlString = "NONE"; NodeList nList = evalNodeList(config, "localSeismogram/seismogramAttr/property[name="+dquote+"Name"+dquote+ "]"+"[value="+dquote+name+dquote+"]"+"/../../data"); if(nList == null || (nList != null && nList.getLength() == 0)) { nList = getNoNameSeismogram(name); } if (nList != null && nList.getLength() != 0) { try { Node n = nList.item(0); if (n instanceof Element) { Element e = (Element)n; //logger.debug("**********************The name of the element is "+e.getTagName()); urlString = e.getAttribute("xlink:href"); if (urlString == null || urlString == "") { throw new MalformedURLException(name+" does not have an xlink:href attribute"); } // end of if (urlString == null || urlString == "") //logger.debug("IN GET SEISMOGRAM The base str is "+base.toString()); //get the Seismogram Attributes from the xml .. only the data must // must be obtained fromt the SAC. NodeList seisAttrNode = XMLUtil.evalNodeList(e, "../seismogramAttr"); SeismogramAttr seisAttr = null; if(seisAttrNode != null && seisAttrNode.getLength() != 0) { seisAttr = XMLSeismogramAttr.getSeismogramAttr((Element)seisAttrNode.item(0)); } NodeList propList = evalNodeList(e, "property"); int numDSProps = 0; if (propList != null && propList.getLength() != 0) { numDSProps = nList.getLength(); } else { // no properties in dataset numDSProps = 0; } // end of else // Property[] props = seis.getProperties();// Property[] newProps = // new Property[1+props.length+numDSProps];// System.arraycopy(props, 0, newProps, 0, props.length);// for (int i=0; i<propList.getLength(); i++) {// Element propElement = (Element)propList.item(i);// newProps[props.length+i] = // new Property(xpath.eval(propElement, "name/text()").str(),// xpath.eval(propElement, "value/text()").str());// } // end of for// newProps[newProps.length-1] = new Property(seisNameKey,// name);// seis.setProperties(newProps); URL sacURL = new URL(base, urlString); //logger.debug("The sacUrl is "+sacURL.toString()); DataInputStream dis = new DataInputStream(new BufferedInputStream(sacURL.openStream())); SacTimeSeries sac = new SacTimeSeries(); sac.read(dis); LocalSeismogramImpl seis; if (seisAttr != null) { seis = SacToFissures.getSeismogram(sac, seisAttr); } else { seis = SacToFissures.getSeismogram(sac); } // end of else if (seis != null) { logger.debug("***************************************************CACHING SOFTREFERENCE AS THE SEISMOGRAM IS NOT NULL"); seismogramCache.put(name, new SoftReference(seis)); } // end of if (seis != null) else logger.debug("****************************************THE SEISMOGRAM RETURNED IS NULL"); return seis; } } catch (MalformedURLException e) { logger.error("Couldn't get seismogram "+name, e); logger.error(urlString); } catch (Exception e) { logger.error("Couldn't get seismogram "+name, e); logger.error(urlString); } // end of try-catch } return null; }
public LocalSeismogramImpl getSeismogram(String name) { if (seismogramCache.containsKey(name)) { logger.debug("getting the seismogram from the cache"); Object obj = seismogramCache.get(name); if(obj instanceof SoftReference) { SoftReference softReference = (SoftReference)obj; LocalSeismogramImpl seis = (LocalSeismogramImpl)softReference.get(); if(seis != null) { logger.debug("**********NO NULL WHILE GETTING FROM RHT CACHE"); return seis; } else { logger.debug("********** GARBAGE COLLECTED SO SEISMOGRAM NOT IN MEWMOERY"); seismogramCache.remove(name); } } else return (LocalSeismogramImpl)obj; } // end of if (seismogramCache.containsKey(name)) //logger.debug("The name of the data set is "+getName()); //logger.debug("The name of the seismogram is "+name); String urlString = "NONE"; NodeList nList = evalNodeList(config, "localSeismogram/seismogramAttr/property[name="+dquote+"Name"+dquote+ "]"+"[value="+dquote+name+dquote+"]"+"/../../data"); if(nList == null || (nList != null && nList.getLength() == 0)) { nList = getNoNameSeismogram(name); } if (nList != null && nList.getLength() != 0) { try { Node n = nList.item(0); if (n instanceof Element) { Element e = (Element)n; //logger.debug("**********************The name of the element is "+e.getTagName()); urlString = e.getAttribute("xlink:href"); if (urlString == null || urlString == "") { throw new MalformedURLException(name+" does not have an xlink:href attribute"); } // end of if (urlString == null || urlString == "") //logger.debug("IN GET SEISMOGRAM The base str is "+base.toString()); //get the Seismogram Attributes from the xml .. only the data must // must be obtained fromt the SAC. NodeList seisAttrNode = XMLUtil.evalNodeList(e, "../seismogramAttr"); SeismogramAttr seisAttr = null; if(seisAttrNode != null && seisAttrNode.getLength() != 0) { seisAttr = XMLSeismogramAttr.getSeismogramAttr((Element)seisAttrNode.item(0)); } NodeList propList = evalNodeList(e, "property"); int numDSProps = 0; if (propList != null && propList.getLength() != 0) { numDSProps = nList.getLength(); } else { // no properties in dataset numDSProps = 0; } // end of else // Property[] props = seis.getProperties();// Property[] newProps = // new Property[1+props.length+numDSProps];// System.arraycopy(props, 0, newProps, 0, props.length);// for (int i=0; i<propList.getLength(); i++) {// Element propElement = (Element)propList.item(i);// newProps[props.length+i] = // new Property(xpath.eval(propElement, "name/text()").str(),// xpath.eval(propElement, "value/text()").str());// } // end of for// newProps[newProps.length-1] = new Property(seisNameKey,// name);// seis.setProperties(newProps); URL sacURL = new URL(base, urlString); //logger.debug("The sacUrl is "+sacURL.toString()); DataInputStream dis = new DataInputStream(new BufferedInputStream(sacURL.openStream())); SacTimeSeries sac = new SacTimeSeries(); sac.read(dis); LocalSeismogramImpl seis; if (seisAttr != null) { seis = SacToFissures.getSeismogram(sac, seisAttr); } else { seis = SacToFissures.getSeismogram(sac); } // end of else if (seis != null) { logger.debug("***************************************************CACHING SOFTREFERENCE AS THE SEISMOGRAM IS NOT NULL"); seismogramCache.put(name, new SoftReference(seis)); } // end of if (seis != null) else logger.debug("****************************************THE SEISMOGRAM RETURNED IS NULL"); return seis; } } catch (MalformedURLException e) { logger.error("Couldn't get seismogram "+name, e); logger.error(urlString); } catch (Exception e) { logger.error("Couldn't get seismogram "+name, e); logger.error(urlString); } // end of try-catch } return null; }
1,118,167
public LocalSeismogramImpl getSeismogram(String name) { if (seismogramCache.containsKey(name)) { logger.debug("getting the seismogram fromt the cache"); Object obj = seismogramCache.get(name); if(obj instanceof SoftReference) { SoftReference softReference = (SoftReference)obj; LocalSeismogramImpl seis = (LocalSeismogramImpl)softReference.get(); if(seis != null) { logger.debug("**********NO NULL WHILE GETTING FROM RHT CACHE"); return seis; } else { logger.debug("********** GARBAGE COLLECTED SO SEISMOGRAM NOT IN MEWMOERY"); seismogramCache.remove(name); } } else return (LocalSeismogramImpl)obj; } // end of if (seismogramCache.containsKey(name)) //logger.debug("The name of the data set is "+getName()); //logger.debug("The name of the seismogram is "+name); String urlString = "NONE"; NodeList nList = evalNodeList(config, "localSeismogram/seismogramAttr/property[name="+dquote+"Name"+dquote+ "]"+"[value="+dquote+name+dquote+"]"+"/../../data"); if(nList == null || (nList != null && nList.getLength() == 0)) { nList = getNoNameSeismogram(name); } if (nList != null && nList.getLength() != 0) { try { Node n = nList.item(0); if (n instanceof Element) { Element e = (Element)n; //logger.debug("**********************The name of the element is "+e.getTagName()); urlString = e.getAttribute("xlink:href"); if (urlString == null || urlString == "") { throw new MalformedURLException(name+" does not have an xlink:href attribute"); } // end of if (urlString == null || urlString == "") //logger.debug("IN GET SEISMOGRAM The base str is "+base.toString()); //get the Seismogram Attributes from the xml .. only the data must // must be obtained fromt the SAC. NodeList seisAttrNode = XMLUtil.evalNodeList(e, "../seismogramAttr"); SeismogramAttr seisAttr = null; if(seisAttrNode != null && seisAttrNode.getLength() != 0) { seisAttr = XMLSeismogramAttr.getSeismogramAttr((Element)seisAttrNode.item(0)); } NodeList propList = evalNodeList(e, "property"); int numDSProps = 0; if (propList != null && propList.getLength() != 0) { numDSProps = nList.getLength(); } else { // no properties in dataset numDSProps = 0; } // end of else // Property[] props = seis.getProperties();// Property[] newProps = // new Property[1+props.length+numDSProps];// System.arraycopy(props, 0, newProps, 0, props.length);// for (int i=0; i<propList.getLength(); i++) {// Element propElement = (Element)propList.item(i);// newProps[props.length+i] = // new Property(xpath.eval(propElement, "name/text()").str(),// xpath.eval(propElement, "value/text()").str());// } // end of for// newProps[newProps.length-1] = new Property(seisNameKey,// name);// seis.setProperties(newProps); URL sacURL = new URL(base, urlString); //logger.debug("The sacUrl is "+sacURL.toString()); DataInputStream dis = new DataInputStream(new BufferedInputStream(sacURL.openStream())); SacTimeSeries sac = new SacTimeSeries(); sac.read(dis); LocalSeismogramImpl seis; if (seisAttr != null) { seis = SacToFissures.getSeismogram(sac, seisAttr); } else { seis = SacToFissures.getSeismogram(sac); } // end of else if (seis != null) { logger.debug("***************************************************CACHING SOFTREFERENCE AS THE SEISMOGRAM IS NOT NULL"); seismogramCache.put(name, new SoftReference(seis)); } // end of if (seis != null) else logger.debug("****************************************THE SEISMOGRAM RETURNED IS NULL"); return seis; } } catch (MalformedURLException e) { logger.error("Couldn't get seismogram "+name, e); logger.error(urlString); } catch (Exception e) { logger.error("Couldn't get seismogram "+name, e); logger.error(urlString); } // end of try-catch } return null; }
public LocalSeismogramImpl getSeismogram(String name) { if (seismogramCache.containsKey(name)) { logger.debug("getting the seismogram fromt the cache"); Object obj = seismogramCache.get(name); if(obj instanceof SoftReference) { SoftReference softReference = (SoftReference)obj; LocalSeismogramImpl seis = (LocalSeismogramImpl)softReference.get(); if(seis != null) { logger.debug("**********NO NULL WHILE GETTING FROM RHT CACHE"); return seis; } else { logger.debug("********** GARBAGE COLLECTED SO SEISMOGRAM NOT IN MEWMOERY"); seismogramCache.remove(name); } } else return (LocalSeismogramImpl)obj; } // end of if (seismogramCache.containsKey(name)) //logger.debug("The name of the data set is "+getName()); //logger.debug("The name of the seismogram is "+name); String urlString = "NONE"; NodeList nList = evalNodeList(config, "localSeismogram/seismogramAttr/property[name="+dquote+"Name"+dquote+ "]"+"[value="+dquote+name+dquote+"]"+"/../../data"); if(nList == null || (nList != null && nList.getLength() == 0)) { nList = getNoNameSeismogram(name); } if (nList != null && nList.getLength() != 0) { try { Node n = nList.item(0); if (n instanceof Element) { Element e = (Element)n; //logger.debug("**********************The name of the element is "+e.getTagName()); urlString = e.getAttribute("xlink:href"); if (urlString == null || urlString == "") { throw new MalformedURLException(name+" does not have an xlink:href attribute"); } // end of if (urlString == null || urlString == "") //logger.debug("IN GET SEISMOGRAM The base str is "+base.toString()); //get the Seismogram Attributes from the xml .. only the data must // must be obtained fromt the SAC. NodeList seisAttrNode = XMLUtil.evalNodeList(e, "../seismogramAttr"); SeismogramAttr seisAttr = null; if(seisAttrNode != null && seisAttrNode.getLength() != 0) { seisAttr = XMLSeismogramAttr.getSeismogramAttr((Element)seisAttrNode.item(0)); } NodeList propList = evalNodeList(e, "property"); int numDSProps = 0; if (propList != null && propList.getLength() != 0) { numDSProps = nList.getLength(); } else { // no properties in dataset numDSProps = 0; } // end of else // Property[] props = seis.getProperties();// Property[] newProps = // new Property[1+props.length+numDSProps];// System.arraycopy(props, 0, newProps, 0, props.length);// for (int i=0; i<propList.getLength(); i++) {// Element propElement = (Element)propList.item(i);// newProps[props.length+i] = // new Property(xpath.eval(propElement, "name/text()").str(),// xpath.eval(propElement, "value/text()").str());// } // end of for// newProps[newProps.length-1] = new Property(seisNameKey,// name);// seis.setProperties(newProps); URL sacURL = new URL(base, urlString); //logger.debug("The sacUrl is "+sacURL.toString()); DataInputStream dis = new DataInputStream(new BufferedInputStream(sacURL.openStream())); SacTimeSeries sac = new SacTimeSeries(); sac.read(dis); LocalSeismogramImpl seis; if (seisAttr != null) { seis = SacToFissures.getSeismogram(sac, seisAttr); } else { seis = SacToFissures.getSeismogram(sac); } // end of else if (seis != null) { seismogramCache.put(name, new SoftReference(seis)); } // end of if (seis != null) else logger.debug("****************************************THE SEISMOGRAM RETURNED IS NULL"); return seis; } } catch (MalformedURLException e) { logger.error("Couldn't get seismogram "+name, e); logger.error(urlString); } catch (Exception e) { logger.error("Couldn't get seismogram "+name, e); logger.error(urlString); } // end of try-catch } return null; }
1,118,168
public LocalSeismogramImpl getSeismogram(String name) { if (seismogramCache.containsKey(name)) { logger.debug("getting the seismogram fromt the cache"); Object obj = seismogramCache.get(name); if(obj instanceof SoftReference) { SoftReference softReference = (SoftReference)obj; LocalSeismogramImpl seis = (LocalSeismogramImpl)softReference.get(); if(seis != null) { logger.debug("**********NO NULL WHILE GETTING FROM RHT CACHE"); return seis; } else { logger.debug("********** GARBAGE COLLECTED SO SEISMOGRAM NOT IN MEWMOERY"); seismogramCache.remove(name); } } else return (LocalSeismogramImpl)obj; } // end of if (seismogramCache.containsKey(name)) //logger.debug("The name of the data set is "+getName()); //logger.debug("The name of the seismogram is "+name); String urlString = "NONE"; NodeList nList = evalNodeList(config, "localSeismogram/seismogramAttr/property[name="+dquote+"Name"+dquote+ "]"+"[value="+dquote+name+dquote+"]"+"/../../data"); if(nList == null || (nList != null && nList.getLength() == 0)) { nList = getNoNameSeismogram(name); } if (nList != null && nList.getLength() != 0) { try { Node n = nList.item(0); if (n instanceof Element) { Element e = (Element)n; //logger.debug("**********************The name of the element is "+e.getTagName()); urlString = e.getAttribute("xlink:href"); if (urlString == null || urlString == "") { throw new MalformedURLException(name+" does not have an xlink:href attribute"); } // end of if (urlString == null || urlString == "") //logger.debug("IN GET SEISMOGRAM The base str is "+base.toString()); //get the Seismogram Attributes from the xml .. only the data must // must be obtained fromt the SAC. NodeList seisAttrNode = XMLUtil.evalNodeList(e, "../seismogramAttr"); SeismogramAttr seisAttr = null; if(seisAttrNode != null && seisAttrNode.getLength() != 0) { seisAttr = XMLSeismogramAttr.getSeismogramAttr((Element)seisAttrNode.item(0)); } NodeList propList = evalNodeList(e, "property"); int numDSProps = 0; if (propList != null && propList.getLength() != 0) { numDSProps = nList.getLength(); } else { // no properties in dataset numDSProps = 0; } // end of else // Property[] props = seis.getProperties();// Property[] newProps = // new Property[1+props.length+numDSProps];// System.arraycopy(props, 0, newProps, 0, props.length);// for (int i=0; i<propList.getLength(); i++) {// Element propElement = (Element)propList.item(i);// newProps[props.length+i] = // new Property(xpath.eval(propElement, "name/text()").str(),// xpath.eval(propElement, "value/text()").str());// } // end of for// newProps[newProps.length-1] = new Property(seisNameKey,// name);// seis.setProperties(newProps); URL sacURL = new URL(base, urlString); //logger.debug("The sacUrl is "+sacURL.toString()); DataInputStream dis = new DataInputStream(new BufferedInputStream(sacURL.openStream())); SacTimeSeries sac = new SacTimeSeries(); sac.read(dis); LocalSeismogramImpl seis; if (seisAttr != null) { seis = SacToFissures.getSeismogram(sac, seisAttr); } else { seis = SacToFissures.getSeismogram(sac); } // end of else if (seis != null) { logger.debug("***************************************************CACHING SOFTREFERENCE AS THE SEISMOGRAM IS NOT NULL"); seismogramCache.put(name, new SoftReference(seis)); } // end of if (seis != null) else logger.debug("****************************************THE SEISMOGRAM RETURNED IS NULL"); return seis; } } catch (MalformedURLException e) { logger.error("Couldn't get seismogram "+name, e); logger.error(urlString); } catch (Exception e) { logger.error("Couldn't get seismogram "+name, e); logger.error(urlString); } // end of try-catch } return null; }
public LocalSeismogramImpl getSeismogram(String name) { if (seismogramCache.containsKey(name)) { logger.debug("getting the seismogram fromt the cache"); Object obj = seismogramCache.get(name); if(obj instanceof SoftReference) { SoftReference softReference = (SoftReference)obj; LocalSeismogramImpl seis = (LocalSeismogramImpl)softReference.get(); if(seis != null) { logger.debug("**********NO NULL WHILE GETTING FROM RHT CACHE"); return seis; } else { logger.debug("********** GARBAGE COLLECTED SO SEISMOGRAM NOT IN MEWMOERY"); seismogramCache.remove(name); } } else return (LocalSeismogramImpl)obj; } // end of if (seismogramCache.containsKey(name)) //logger.debug("The name of the data set is "+getName()); //logger.debug("The name of the seismogram is "+name); String urlString = "NONE"; NodeList nList = evalNodeList(config, "localSeismogram/seismogramAttr/property[name="+dquote+"Name"+dquote+ "]"+"[value="+dquote+name+dquote+"]"+"/../../data"); if(nList == null || (nList != null && nList.getLength() == 0)) { nList = getNoNameSeismogram(name); } if (nList != null && nList.getLength() != 0) { try { Node n = nList.item(0); if (n instanceof Element) { Element e = (Element)n; //logger.debug("**********************The name of the element is "+e.getTagName()); urlString = e.getAttribute("xlink:href"); if (urlString == null || urlString == "") { throw new MalformedURLException(name+" does not have an xlink:href attribute"); } // end of if (urlString == null || urlString == "") //logger.debug("IN GET SEISMOGRAM The base str is "+base.toString()); //get the Seismogram Attributes from the xml .. only the data must // must be obtained fromt the SAC. NodeList seisAttrNode = XMLUtil.evalNodeList(e, "../seismogramAttr"); SeismogramAttr seisAttr = null; if(seisAttrNode != null && seisAttrNode.getLength() != 0) { seisAttr = XMLSeismogramAttr.getSeismogramAttr((Element)seisAttrNode.item(0)); } NodeList propList = evalNodeList(e, "property"); int numDSProps = 0; if (propList != null && propList.getLength() != 0) { numDSProps = nList.getLength(); } else { // no properties in dataset numDSProps = 0; } // end of else // Property[] props = seis.getProperties();// Property[] newProps = // new Property[1+props.length+numDSProps];// System.arraycopy(props, 0, newProps, 0, props.length);// for (int i=0; i<propList.getLength(); i++) {// Element propElement = (Element)propList.item(i);// newProps[props.length+i] = // new Property(xpath.eval(propElement, "name/text()").str(),// xpath.eval(propElement, "value/text()").str());// } // end of for// newProps[newProps.length-1] = new Property(seisNameKey,// name);// seis.setProperties(newProps); URL sacURL = new URL(base, urlString); //logger.debug("The sacUrl is "+sacURL.toString()); DataInputStream dis = new DataInputStream(new BufferedInputStream(sacURL.openStream())); SacTimeSeries sac = new SacTimeSeries(); sac.read(dis); LocalSeismogramImpl seis; if (seisAttr != null) { seis = SacToFissures.getSeismogram(sac, seisAttr); } else { seis = SacToFissures.getSeismogram(sac); } // end of else if (seis != null) { logger.debug("***************************************************CACHING SOFTREFERENCE AS THE SEISMOGRAM IS NOT NULL"); seismogramCache.put(name, new SoftReference(seis)); } // end of if (seis != null) return seis; } } catch (MalformedURLException e) { logger.error("Couldn't get seismogram "+name, e); logger.error(urlString); } catch (Exception e) { logger.error("Couldn't get seismogram "+name, e); logger.error(urlString); } // end of try-catch } return null; }
1,118,169
public BasicSeismogramDisplay addDisplay(DataSetSeismogram[] dss){ return addDisplay(dss, DisplayUtils.getSeismogramNames(dss)); }
public BasicSeismogramDisplay addDisplay(DataSetSeismogram[] dss){ return addDisplay(dss, globalRegistrar, new RMeanAmpConfig(dss)); }
1,118,170
public VerticalSeismogramDisplay(MouseForwarder mouseForwarder, MouseMotionForwarder motionForwarder, VerticalSeismogramDisplay parent){ output.setTimeZone(TimeZone.getTimeZone("GMT")); this.mouseForwarder = mouseForwarder; this.motionForwarder = motionForwarder; super.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); sorter = new SeismogramSorter(); if(parent != null){ this.originalVisible = parent.getOriginalVisibility(); this.parent = parent; }else{ this.originalVisible = true; } }
public VerticalSeismogramDisplay(MouseForwarder mouseForwarder, MouseMotionForwarder motionForwarder, VerticalSeismogramDisplay parent){ output.setTimeZone(TimeZone.getTimeZone("GMT")); this.mouseForwarder = mouseForwarder; this.motionForwarder = motionForwarder; super.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); sorter = new SeismogramSorter(); if(parent != null){ this.originalVisible = parent.getOriginalVisibility(); this.parent = parent; }else{ this.originalVisible = true; } }
1,118,171
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
1,118,172
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
1,118,173
private void init() throws Throwable { /* addUser(new UserInfo("testuser01", "bedework", "douglm", "localhost", 8080, false, "/ucaldav/user/douglm")); addUser(new UserInfo("testuser01", "bedework", "johnsa", "localhost", 8080, false, "/ucaldav/user/johnsa")); */ addUser(new UserInfo("testuser02", "bedework", "testuser02", "www.bedework.org", 80, false, "/ucaldav/user/testuser02")); addUser(new UserInfo("testuser03", "bedework", "testuser03", "www.bedework.org", 80, false, "/ucaldav/user/testuser03")); getSvci(); // }
private void init() throws Throwable { /* addUser(new UserInfo("testuser01", "bedework", "douglm", "localhost", 8080, false, "/ucaldav/user/douglm")); addUser(new UserInfo("testuser01", "bedework", "johnsa", "localhost", 8080, false, "/ucaldav/user/johnsa")); */ addUser(new UserInfo("testuser02", "bedework", "testuser02", "www.bedework.org", 80, false, "/ucaldav/user/testuser02")); */ addUser(new UserInfo("douglm", "bedework", "douglm", "localhost", 8080, false, "/ucaldav/user/douglm")); /* addUser(new UserInfo("testuser02", "bedework", "testuser02", "www.bedework.org", 80, false, "/ucaldav/user/testuser03")); getSvci(); // }
1,118,175
private void init() throws Throwable { /* addUser(new UserInfo("testuser01", "bedework", "douglm", "localhost", 8080, false, "/ucaldav/user/douglm")); addUser(new UserInfo("testuser01", "bedework", "johnsa", "localhost", 8080, false, "/ucaldav/user/johnsa")); */ addUser(new UserInfo("testuser02", "bedework", "testuser02", "www.bedework.org", 80, false, "/ucaldav/user/testuser02")); addUser(new UserInfo("testuser03", "bedework", "testuser03", "www.bedework.org", 80, false, "/ucaldav/user/testuser03")); getSvci(); // }
private void init() throws Throwable { /* addUser(new UserInfo("testuser01", "bedework", "douglm", "localhost", 8080, false, "/ucaldav/user/douglm")); addUser(new UserInfo("testuser01", "bedework", "johnsa", "localhost", 8080, false, "/ucaldav/user/johnsa")); */ addUser(new UserInfo("testuser02", "bedework", "testuser02", "www.bedework.org", 80, false, "/ucaldav/user/testuser02")); addUser(new UserInfo("testuser03", "bedework", "testuser03", "www.bedework.org", 80, false, "/ucaldav/user/testuser02")); addUser(new UserInfo("testuser08", "bedework", "testuser08", "www.bedework.org", 80, false, "/ucaldav/user/testuser08")); */ getSvci(); // }
1,118,176
private Req makeFreeBusyRequest(Date start, Date end, UserInfo ui) throws Throwable { Req req; if (ui.authUser == null) { req = new Req(); } else { req = new Req(ui.authUser, ui.authPw); } req.setUrl(ui.url); req.setContentType("text/xml"); req.setMethod("REPORT"); req.addHeader("Depth", "0"); req.addContentLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>"); req.addContentLine("<C:free-busy-query xmlns:C=\"urn:ietf:params:xml:ns:caldav\">");// req.addContentLine(" <C:time-range start=\"" +// CalFacadeUtil.isoDateTimeUTC(start) + "\"");// req.addContentLine(" end=\"" +// CalFacadeUtil.isoDateTimeUTC(end) + "\"/>"); req.addContentLine(" <C:time-range start=\"20060521T131358Z\""); req.addContentLine(" end=\"20060528T131358Z\"/>"); req.addContentLine("</C:free-busy-query>"); return req; }
private Req makeFreeBusyRequest(Date start, Date end, UserInfo ui) throws Throwable { Req req; if (ui.authUser == null) { req = new Req(); } else { req = new Req(ui.authUser, ui.authPw); } req.setUrl(ui.url); req.setContentType("text/xml"); req.setMethod("REPORT"); req.addHeader("Depth", "0"); req.addContentLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>"); req.addContentLine("<C:free-busy-query xmlns:C=\"urn:ietf:params:xml:ns:caldav\">");// req.addContentLine(" <C:time-range start=\"" +// CalFacadeUtil.isoDateTimeUTC(start) + "\"");// req.addContentLine(" end=\"" +// CalFacadeUtil.isoDateTimeUTC(end) + "\"/>"); req.addContentLine(" <C:time-range start=\"20060521T131358Z\""); req.addContentLine(" end=\"20060528T131358Z\"/>"); req.addContentLine("</C:free-busy-query>"); return req; }
1,118,177
private static PlottableChunk[] breakIntoPieces(PlottableChunk original, int numPieces) { PlottableChunk[] pieces = new PlottableChunk[numPieces]; int pieceSize = SPD / numPieces; for(int i = 0; i < pieces.length; i++) { int startPoint = i * pieceSize; int stopPoint = (i + 1) * pieceSize; if(i == pieces.length - 1) { stopPoint = SPD; } pieces[i] = makeSubPlottable(original, startPoint, stopPoint - startPoint); } return pieces; }
private static PlottableChunk[] breakIntoPieces(PlottableChunk original, int numPieces) { PlottableChunk[] pieces = new PlottableChunk[numPieces]; double pieceSize = PIXELS / (double)numPieces; for(int i = 0; i < pieces.length; i++) { int startPoint = i * pieceSize; int stopPoint = (i + 1) * pieceSize; if(i == pieces.length - 1) { stopPoint = SPD; } pieces[i] = makeSubPlottable(original, startPoint, stopPoint - startPoint); } return pieces; }
1,118,178
private static PlottableChunk[] breakIntoPieces(PlottableChunk original, int numPieces) { PlottableChunk[] pieces = new PlottableChunk[numPieces]; int pieceSize = SPD / numPieces; for(int i = 0; i < pieces.length; i++) { int startPoint = i * pieceSize; int stopPoint = (i + 1) * pieceSize; if(i == pieces.length - 1) { stopPoint = SPD; } pieces[i] = makeSubPlottable(original, startPoint, stopPoint - startPoint); } return pieces; }
private static PlottableChunk[] breakIntoPieces(PlottableChunk original, int numPieces) { PlottableChunk[] pieces = new PlottableChunk[numPieces]; int pieceSize = SPD / numPieces; for(int i = 0; i < pieces.length; i++) { int startPoint = i * pieceSize; int stopPoint = (i + 1) * pieceSize; if(i == pieces.length - 1) { stopPoint = SPD; } pieces[i] = makeSubPlottable(original, startPoint, stopPoint - startPoint); } return pieces; }
1,118,179
private static PlottableChunk[] breakIntoPieces(PlottableChunk original, int numPieces) { PlottableChunk[] pieces = new PlottableChunk[numPieces]; int pieceSize = SPD / numPieces; for(int i = 0; i < pieces.length; i++) { int startPoint = i * pieceSize; int stopPoint = (i + 1) * pieceSize; if(i == pieces.length - 1) { stopPoint = SPD; } pieces[i] = makeSubPlottable(original, startPoint, stopPoint - startPoint); } return pieces; }
private static PlottableChunk[] breakIntoPieces(PlottableChunk original, int numPieces) { PlottableChunk[] pieces = new PlottableChunk[numPieces]; int pieceSize = SPD / numPieces; for(int i = 0; i < pieces.length; i++) { int startPoint = i * pieceSize; int stopPoint = (i + 1) * pieceSize; if(i == pieces.length - 1) { stopPixel = PIXELS; } pieces[i] = makeSubPlottable(original, startPoint, stopPoint - startPoint); } return pieces; }
1,118,180
private static PlottableChunk[] breakIntoPieces(PlottableChunk original, int numPieces) { PlottableChunk[] pieces = new PlottableChunk[numPieces]; int pieceSize = SPD / numPieces; for(int i = 0; i < pieces.length; i++) { int startPoint = i * pieceSize; int stopPoint = (i + 1) * pieceSize; if(i == pieces.length - 1) { stopPoint = SPD; } pieces[i] = makeSubPlottable(original, startPoint, stopPoint - startPoint); } return pieces; }
private static PlottableChunk[] breakIntoPieces(PlottableChunk original, int numPieces) { PlottableChunk[] pieces = new PlottableChunk[numPieces]; int pieceSize = SPD / numPieces; for(int i = 0; i < pieces.length; i++) { int startPoint = i * pieceSize; int stopPoint = (i + 1) * pieceSize; if(i == pieces.length - 1) { stopPoint = SPD; } pieces[i] = makeSubPlottable(original, startPoint, stopPoint - startPoint); } return pieces; }
1,118,181
private static PlottableChunk makeSubPlottable(PlottableChunk orig, int startPoint, int numPoints) { Plottable subPlott = new Plottable(copy(orig.getData().x_coor, startPoint, numPoints), copy(orig.getData().y_coor, startPoint, numPoints)); return new PlottableChunk(subPlott, startPoint, 1, 2000, PIXELS, orig.getChannel()); }
private static PlottableChunk makeSubPlottable(PlottableChunk orig, int startPoint, int numPixels) { Plottable subPlott = new Plottable(copy(orig.getData().x_coor, startPoint, numPoints), copy(orig.getData().y_coor, startPoint, numPoints)); return new PlottableChunk(subPlott, startPoint, 1, 2000, PIXELS, orig.getChannel()); }
1,118,182
private static PlottableChunk makeSubPlottable(PlottableChunk orig, int startPoint, int numPoints) { Plottable subPlott = new Plottable(copy(orig.getData().x_coor, startPoint, numPoints), copy(orig.getData().y_coor, startPoint, numPoints)); return new PlottableChunk(subPlott, startPoint, 1, 2000, PIXELS, orig.getChannel()); }
private static PlottableChunk makeSubPlottable(PlottableChunk orig, int startPoint, int numPoints) { Plottable subPlott = new Plottable(copy(orig.getData().x_coor, startPoint, numPixels * 2), copy(orig.getData().y_coor, startPoint, numPoints)); return new PlottableChunk(subPlott, startPoint, 1, 2000, PIXELS, orig.getChannel()); }
1,118,183
private static PlottableChunk makeSubPlottable(PlottableChunk orig, int startPoint, int numPoints) { Plottable subPlott = new Plottable(copy(orig.getData().x_coor, startPoint, numPoints), copy(orig.getData().y_coor, startPoint, numPoints)); return new PlottableChunk(subPlott, startPoint, 1, 2000, PIXELS, orig.getChannel()); }
private static PlottableChunk makeSubPlottable(PlottableChunk orig, int startPoint, int numPoints) { Plottable subPlott = new Plottable(copy(orig.getData().x_coor, startPoint, numPoints), copy(orig.getData().y_coor, startPoint, numPoints)); return new PlottableChunk(subPlott, startPoint, 1, 2000, PIXELS, orig.getChannel()); }
1,118,184
public void testPutThenGet() throws SQLException, IOException { plottDb.put(new PlottableChunk[] {data}); PlottableChunk[] out = plottDb.get(data.getTimeRange(), data.getChannel(), data.getPixelsPerDay()); System.out.println(out[0]); assertEquals(data, out[0]); }
public void testPutThenGet() throws SQLException, IOException { plottDb.put(new PlottableChunk[] {data}); PlottableChunk[] out = plottDb.get(data.getTimeRange(), data.getChannel(), data.getPixelsPerDay()); assertEquals(data, out[0]); }
1,118,185
public static LocalSeismogramImpl createSpike(MicroSecondDate time, TimeInterval traceLength, int samplesPerSpike, ChannelId id) { return createRaggedSpike(time, traceLength, samplesPerSpike, 0, id); }
public static LocalSeismogramImpl createSpike(MicroSecondDate time, TimeInterval traceLength, int samplesPerSpike, ChannelId id) { return createRaggedSpike(time, traceLength, samplesPerSpike, 0, id); }
1,118,186
public static Plottable makePlottable(LocalSeismogramImpl seis, MicroSecondTimeRange tr, int pixelsPerDay) throws CodecException { logger.debug("Making plottable for seis starting at " + seis.getBeginTime() + " lasting for " + seis.getTimeInterval() + " with " + seis.getNumPoints() + " points"); logger.debug("The plottable is supposed to cover " + tr + " at " + pixelsPerDay); if(tr.getEndTime().before(seis.getEndTime()) || tr.getBeginTime().after(seis.getEndTime())) { int[] empty = new int[0]; return new Plottable(empty, empty); } //Calculating the number of plottable pixels to cover the full time // range double pixelPeriod = 1 / (double)pixelsPerDay;//in days TimeInterval trInt = (TimeInterval)tr.getInterval() .convertTo(UnitImpl.DAY); double exactNumPixels = trInt.divideBy(pixelPeriod).getValue(); //always round up since a partial pixel means the caller requested data // in that pixel int numPixels = (int)Math.ceil(exactNumPixels); TimeInterval pointPeriod = (TimeInterval)seis.getSampling() .getPeriod() .convertTo(UnitImpl.DAY); double pointsPerPixel = pixelPeriod / pointPeriod.getValue(); int startPoint = getPoint(seis, tr.getBeginTime()); int endPoint = startPoint + (int)(pointsPerPixel * numPixels); int startPixel = 0; if(startPoint < 0) { //Requested time begins before seis, scoot up the start pixel up startPixel = (int)Math.floor((startPoint * -1) / pointsPerPixel); numPixels -= startPixel; } if(endPoint > seis.getNumPoints()) { //Requested time ends after seis, scoot the end pixel back int pointShift = endPoint - seis.getNumPoints(); numPixels -= (int)Math.floor(pointShift / pointsPerPixel); endPoint = seis.getNumPoints(); } int[][] pixels = new int[2][numPixels * 2]; int pixelPoint = startPoint < 0 ? 0 : startPoint; for(int i = 0; i < numPixels; i++) { int pos = 2 * i; int nextPos = pos + 1; pixels[0][pos] = startPixel + i; pixels[0][nextPos] = pixels[0][pos]; int nextPixelPoint = startPoint + (int)((pixels[0][pos] + 1) * pointsPerPixel); if(i == numPixels - 1) { nextPixelPoint = endPoint; } QuantityImpl min = seis.getMinValue(pixelPoint, nextPixelPoint); pixels[1][pos] = (int)min.getValue(); QuantityImpl max = seis.getMaxValue(pixelPoint, nextPixelPoint); pixels[1][nextPos] = (int)max.getValue(); pixelPoint = nextPixelPoint; } return new Plottable(pixels[0], pixels[1]); }
public static Plottable makePlottable(LocalSeismogramImpl seis, MicroSecondTimeRange tr, int pixelsPerDay) throws CodecException { logger.debug("Making plottable for seis starting at " + seis.getBeginTime() + " lasting for " + seis.getTimeInterval() + " with " + seis.getNumPoints() + " points"); logger.debug("The plottable is supposed to cover " + tr + " at " + pixelsPerDay); if(tr.getEndTime().before(seis.getEndTime()) || tr.getBeginTime().after(seis.getEndTime())) { int[] empty = new int[0]; return new Plottable(empty, empty); } //Calculating the number of plottable pixels to cover the full time // range double pixelPeriod = 1 / (double)pixelsPerDay;//in days TimeInterval trInt = (TimeInterval)tr.getInterval() .convertTo(UnitImpl.DAY); double exactNumPixels = trInt.divideBy(pixelPeriod).getValue(); //always round up since a partial pixel means the caller requested data // in that pixel int numPixels = (int)Math.ceil(exactNumPixels); TimeInterval pointPeriod = (TimeInterval)seis.getSampling() .getPeriod() .convertTo(UnitImpl.DAY); double pointsPerPixel = pixelPeriod / pointPeriod.getValue(); int startPoint = getPoint(seis, tr.getBeginTime()); int endPoint = startPoint + (int)(pointsPerPixel * numPixels); int startPixel = 0; if(startPoint < 0) { //Requested time begins before seis, scoot up the start pixel up startPixel = (int)Math.floor((startPoint * -1) / pointsPerPixel); numPixels -= startPixel; } if(endPoint > seis.getNumPoints()) { //Requested time ends after seis, scoot the end pixel back int pointShift = endPoint - seis.getNumPoints(); numPixels -= (int)Math.floor(pointShift / pointsPerPixel); endPoint = seis.getNumPoints(); } int[][] pixels = new int[2][numPixels * 2]; int pixelPoint = startPoint < 0 ? 0 : startPoint; for(int i = 0; i < numPixels; i++) { int pos = 2 * i; int nextPos = pos + 1; pixels[0][pos] = startPixel + i; pixels[0][nextPos] = pixels[0][pos]; int nextPixelPoint = startPoint + (int)((pixels[0][pos] + 1) * pointsPerPixel); if(i == numPixels - 1) { nextPixelPoint = endPoint; } QuantityImpl min = seis.getMinValue(pixelPoint, nextPixelPoint); pixels[1][pos] = (int)min.getValue(); QuantityImpl max = seis.getMaxValue(pixelPoint, nextPixelPoint); pixels[1][nextPos] = (int)max.getValue(); pixelPoint = nextPixelPoint; } return new Plottable(pixels[0], pixels[1]); }
1,118,187
public String doAction(HttpServletRequest request, BwActionForm form) throws Throwable { BwUser user; CalSvcI svci = form.fetchSvci(); gotoDateView(this, form, form.getDate(), form.getViewTypeI(), debug); String userId = getReqPar(request, "userid"); if (userId != null) { user = svci.findUser(userId); if (user == null) { form.getErr().emit("org.bedework.client.error.usernotfound"); return "notFound"; } } else { user = svci.getUser(); } MyCalendarVO scal; Calendar start; Calendar end; Calendar endDay; String st = getReqPar(request, "start"); if (st == null) { /* Set period and start from the current timeview */ TimeView tv = form.getCurTimeView(); scal = tv.getFirstDay(); Locale loc = scal.getCalInfo().getLocale(); // XXX Locale /* Essentially clone so that thbe calculations below don't mess up * the time view. */ scal = new MyCalendarVO(scal.getTime(), loc); start = scal.getCalendar(); end = tv.getLastDay().getTomorrow().getCalendar(); } else { Locale loc = Locale.getDefault(); // XXX Locale Date jdt = CalFacadeUtil.fromISODate(st); scal = new MyCalendarVO(jdt, loc); scal = scal.getFirstDayOfThisWeek(); start = scal.getCalendar(); //BwDateTime startDt = form.getEventStartDate().getDateTime(); end = scal.getNextWeek().getCalendar(); } endDay = scal.getTomorrow().getCalendar(); int interval = getIntReqPar(request, "interval", 1); if (interval <= 0) { form.getErr().emit("org.bedework.client.error.badinterval"); return "error"; } String intunitStr = getReqPar(request, "intunit"); BwDuration dur = new BwDuration(); if (intunitStr != null) { if ("minutes".equals(intunitStr)) { dur.setMinutes(interval); } else if ("hours".equals(intunitStr)) { dur.setHours(interval); } else if ("days".equals(intunitStr)) { dur.setDays(interval); } else if ("weeks".equals(intunitStr)) { dur.setWeeks(interval); } else { form.getErr().emit("org.bedework.client.error.badintervalunit"); return "error"; } } else { dur.setHours(interval); } //int maxRequests = 1000; CalTimezones tzs = svci.getTimezones(); Collection freeBusy = new ArrayList(); /* Get the free busy in daily chunks and process for display */ while (start.before(end)) { Date sdt = start.getTime(); Date edt = endDay.getTime(); if (debug) { debugMsg("getFreeBusy for start = " + sdt + " end = " + edt); } try { BwFreeBusy fb = svci.getFreeBusy(null, user, CalFacadeUtil.getDateTime(sdt, false, false, tzs), CalFacadeUtil.getDateTime(edt, false, false, tzs), dur, true); FormattedFreeBusy ffb = new FormattedFreeBusy(fb); freeBusy.add(ffb); start.add(Calendar.DAY_OF_MONTH, 1); endDay.add(Calendar.DAY_OF_MONTH, 1); } catch (CalFacadeAccessException cfae) { form.getErr().emit("org.bedework.client.error.noaccess"); return "noAccess"; } } form.assignFreeBusy(freeBusy); return "success"; }
public String doAction(HttpServletRequest request, BwActionForm form) throws Throwable { BwUser user; CalSvcI svci = form.fetchSvci(); gotoDateView(this, form, form.getDate(), form.getViewTypeI(), debug); String userId = getReqPar(request, "userid"); if (userId != null) { user = svci.findUser(userId); if (user == null) { form.getErr().emit("org.bedework.client.error.usernotfound"); return "notFound"; } } else { user = svci.getUser(); } MyCalendarVO scal; Calendar start; Calendar end; Calendar endDay; String st = getReqPar(request, "start"); if (st == null) { /* Set period and start from the current timeview */ TimeView tv = form.getCurTimeView(); scal = tv.getFirstDay(); Locale loc = scal.getCalInfo().getLocale(); // XXX Locale /* Essentially clone so that thbe calculations below don't mess up * the time view. */ scal = new MyCalendarVO(scal.getTime(), loc); start = scal.getCalendar(); end = tv.getLastDay().getTomorrow().getCalendar(); } else { Locale loc = Locale.getDefault(); // XXX Locale Date jdt = CalFacadeUtil.fromISODate(st); scal = new MyCalendarVO(jdt, loc); scal = scal.getFirstDayOfThisWeek(); start = scal.getCalendar(); //BwDateTime startDt = form.getEventStartDate().getDateTime(); end = scal.getNextWeek().getCalendar(); } endDay = scal.getTomorrow().getCalendar(); int interval = getIntReqPar(request, "interval", 1); if (interval <= 0) { form.getErr().emit("org.bedework.client.error.badinterval"); return "error"; } String intunitStr = getReqPar(request, "intunit"); BwDuration dur = new BwDuration(); if (intunitStr != null) { if ("minutes".equals(intunitStr)) { dur.setMinutes(interval); } else if ("hours".equals(intunitStr)) { dur.setHours(interval); } else if ("days".equals(intunitStr)) { dur.setDays(interval); } else if ("weeks".equals(intunitStr)) { dur.setWeeks(interval); } else { form.getErr().emit("org.bedework.client.error.badintervalunit"); return "error"; } } else { dur.setHours(interval); } //int maxRequests = 1000; CalTimezones tzs = svci.getTimezones(); Collection freeBusy = new ArrayList(); /* Get the free busy in daily chunks and process for display */ while (start.before(end)) { Date sdt = start.getTime(); Date edt = endDay.getTime(); if (debug) { debugMsg("getFreeBusy for start = " + sdt + " end = " + edt); } try { BwFreeBusy fb = svci.getFreeBusy(null, null, user, CalFacadeUtil.getDateTime(sdt, false, false, tzs), CalFacadeUtil.getDateTime(edt, false, false, tzs), dur, true); FormattedFreeBusy ffb = new FormattedFreeBusy(fb); freeBusy.add(ffb); start.add(Calendar.DAY_OF_MONTH, 1); endDay.add(Calendar.DAY_OF_MONTH, 1); } catch (CalFacadeAccessException cfae) { form.getErr().emit("org.bedework.client.error.noaccess"); return "noAccess"; } } form.assignFreeBusy(freeBusy); return "success"; }
1,118,189
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { /** Check access */ if (!form.getUserAuth().isSuperUser()) { return "noAccess"; }// CalSvcI svci = form.getCalSvcI(); /** We are just updating from the current form values. */ BwUserInfo ui = validateUserInfo(form); if (ui == null) { return "retry"; } if (debug) { debugMsg("Update userInfo " + ui); } //svci.getUserAuth().updateUser(au); form.getMsg().emit("org.bedework.message.userinfo.updated"); return "continue"; }
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { /** Check access */ if (!form.getUserAuth().isSuperUser()) { return "noAccess"; }// CalSvcI svci = form.getCalSvcI(); /** We are just updating from the current form values. */ BwUserInfo ui = validateUserInfo(form); if (ui == null) { return "retry"; } if (debug) { debugMsg("Update userInfo " + ui); } //svci.getUserAuth().updateUser(au); form.getMsg().emit("org.bedework.client.message.userinfo.updated"); return "continue"; }
1,118,190
public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { Graphics2D graphics2D = (Graphics2D) g; if(!recalculateValues) { recalculateValues = false; System.out.println(" DRAWING THE PARTICLE MOTION WITHOUT RECALCULATING THE VALUES"); graphics2D.draw(particleMotion.getShape()); return; } logger.debug("IN DRAW PARTICLE MOTION"); Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.hseis.getSeismogram(); LocalSeismogramImpl vseis = particleMotion.vseis.getSeismogram(); //AmpConfigRegistrar vAmpConfigRegistrar = particleMotion.vAmpConfigRegistrar; //AmpConfigRegistrar hAmpConfigRegistrar = particleMotion.hAmpConfigRegistrar; Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } //drawLabels(particleMotion, graphics2D); graphics2D.setColor(color); Insets insets = getInsets(); Dimension flipDimension = new Dimension(dimension.height, dimension.width); try { System.out.println("In PaintSeismogram hmax = "+hunitRangeImpl.getMaxValue()+ " hmin = "+hunitRangeImpl.getMinValue()); System.out.println("In PaintSeismogram vmax = "+vunitRangeImpl.getMaxValue()+ " vmin = "+vunitRangeImpl.getMinValue()); MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.registrar == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); //System.out.println("beginTime = "+hseis.getBeginTime()); //System.out.println("endTime = "+hseis.getEndTime()); } else { microSecondTimeRange = particleMotion.getTimeRange(); } System.out.println("*************** Beofore getting PlottableSimple"); Date utilStartTime = Calendar.getInstance().getTime(); int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension);*/ /*SimplePlotUtil.compressYvalues(hseis, microSecondTimeRange, hunitRangeImpl, dimension); SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension); */ int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension);*/ SimplePlotUtil.flipArray(vPixels[1], dimension.height); Date utilEndTime = Calendar.getInstance().getTime(); System.out.println("The UTIL TIME is ******* "+ (utilEndTime.getTime() - utilStartTime.getTime())); /* SimplePlotUtil.compressYvalues(vseis, microSecondTimeRange, vunitRangeImpl, dimension); System.out.println("---------------------->Scaling THE Y VALUES "); SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); */ int len = vPixels[1].length; int[] x, y; x = new int[hPixels[1].length]; y = new int[vPixels[1].length]; x = hPixels[1]; y = vPixels[1]; if (hPixels[1].length < len) { len = hPixels.length; } Date drawStartTime = Calendar.getInstance().getTime(); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); Date drawEndTime = Calendar.getInstance().getTime(); System.out.println("The PATH TIME is *********** "+(drawEndTime.getTime() - drawStartTime.getTime())); particleMotion.setShape(shape); System.out.println("After setting the shape"); if(shape == null) System.out.println("The shape is null"); graphics2D.draw(shape); // System.out.println("The shape is drawn"); } catch(Exception e) { e.printStackTrace(); } }
public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { Graphics2D graphics2D = (Graphics2D) g; if(!recalculateValues) { recalculateValues = false; System.out.println(" DRAWING THE PARTICLE MOTION WITHOUT RECALCULATING THE VALUES"); graphics2D.draw(particleMotion.getShape()); return; } logger.debug("IN DRAW PARTICLE MOTION"); Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.hseis.getSeismogram(); LocalSeismogramImpl vseis = particleMotion.vseis.getSeismogram(); //AmpConfigRegistrar vAmpConfigRegistrar = particleMotion.vAmpConfigRegistrar; //AmpConfigRegistrar hAmpConfigRegistrar = particleMotion.hAmpConfigRegistrar; Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } //drawLabels(particleMotion, graphics2D); graphics2D.setColor(color); Insets insets = getInsets(); Dimension flipDimension = new Dimension(dimension.height, dimension.width); try { System.out.println("In PaintSeismogram hmax = "+hunitRangeImpl.getMaxValue()+ " hmin = "+hunitRangeImpl.getMinValue()); System.out.println("In PaintSeismogram vmax = "+vunitRangeImpl.getMaxValue()+ " vmin = "+vunitRangeImpl.getMinValue()); MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.registrar == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); //System.out.println("beginTime = "+hseis.getBeginTime()); //System.out.println("endTime = "+hseis.getEndTime()); } else { microSecondTimeRange = particleMotion.getTimeRange(); } System.out.println("*************** Beofore getting PlottableSimple"); Date utilStartTime = Calendar.getInstance().getTime(); int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension);*/ /*SimplePlotUtil.compressYvalues(hseis, microSecondTimeRange, hunitRangeImpl, dimension); SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension); */ int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension);*/ SimplePlotUtil.flipArray(vPixels[1], dimension.height); Date utilEndTime = Calendar.getInstance().getTime(); System.out.println("The UTIL TIME is ******* "+ (utilEndTime.getTime() - utilStartTime.getTime())); /* SimplePlotUtil.compressYvalues(vseis, microSecondTimeRange, vunitRangeImpl, dimension); System.out.println("---------------------->Scaling THE Y VALUES "); SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); */ int len = vPixels[1].length; int[] x, y; x = new int[hPixels[1].length]; y = new int[vPixels[1].length]; x = hPixels[1]; y = vPixels[1]; if (hPixels[1].length < len) { len = hPixels.length; } Date drawStartTime = Calendar.getInstance().getTime(); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); Date drawEndTime = Calendar.getInstance().getTime(); System.out.println("The PATH TIME is *********** "+(drawEndTime.getTime() - drawStartTime.getTime())); particleMotion.setShape(shape); System.out.println("After setting the shape"); if(shape == null) System.out.println("The shape is null"); graphics2D.draw(shape); // System.out.println("The shape is drawn"); } catch(Exception e) { e.printStackTrace(); } }
1,118,191
public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { Graphics2D graphics2D = (Graphics2D) g; if(!recalculateValues) { recalculateValues = false; System.out.println(" DRAWING THE PARTICLE MOTION WITHOUT RECALCULATING THE VALUES"); graphics2D.draw(particleMotion.getShape()); return; } logger.debug("IN DRAW PARTICLE MOTION"); Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.hseis.getSeismogram(); LocalSeismogramImpl vseis = particleMotion.vseis.getSeismogram(); //AmpConfigRegistrar vAmpConfigRegistrar = particleMotion.vAmpConfigRegistrar; //AmpConfigRegistrar hAmpConfigRegistrar = particleMotion.hAmpConfigRegistrar; Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } //drawLabels(particleMotion, graphics2D); graphics2D.setColor(color); Insets insets = getInsets(); Dimension flipDimension = new Dimension(dimension.height, dimension.width); try { System.out.println("In PaintSeismogram hmax = "+hunitRangeImpl.getMaxValue()+ " hmin = "+hunitRangeImpl.getMinValue()); System.out.println("In PaintSeismogram vmax = "+vunitRangeImpl.getMaxValue()+ " vmin = "+vunitRangeImpl.getMinValue()); MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.registrar == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); //System.out.println("beginTime = "+hseis.getBeginTime()); //System.out.println("endTime = "+hseis.getEndTime()); } else { microSecondTimeRange = particleMotion.getTimeRange(); } System.out.println("*************** Beofore getting PlottableSimple"); Date utilStartTime = Calendar.getInstance().getTime(); int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension);*/ /*SimplePlotUtil.compressYvalues(hseis, microSecondTimeRange, hunitRangeImpl, dimension); SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension); */ int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension);*/ SimplePlotUtil.flipArray(vPixels[1], dimension.height); Date utilEndTime = Calendar.getInstance().getTime(); System.out.println("The UTIL TIME is ******* "+ (utilEndTime.getTime() - utilStartTime.getTime())); /* SimplePlotUtil.compressYvalues(vseis, microSecondTimeRange, vunitRangeImpl, dimension); System.out.println("---------------------->Scaling THE Y VALUES "); SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); */ int len = vPixels[1].length; int[] x, y; x = new int[hPixels[1].length]; y = new int[vPixels[1].length]; x = hPixels[1]; y = vPixels[1]; if (hPixels[1].length < len) { len = hPixels.length; } Date drawStartTime = Calendar.getInstance().getTime(); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); Date drawEndTime = Calendar.getInstance().getTime(); System.out.println("The PATH TIME is *********** "+(drawEndTime.getTime() - drawStartTime.getTime())); particleMotion.setShape(shape); System.out.println("After setting the shape"); if(shape == null) System.out.println("The shape is null"); graphics2D.draw(shape); // System.out.println("The shape is drawn"); } catch(Exception e) { e.printStackTrace(); } }
public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { Graphics2D graphics2D = (Graphics2D) g; if(!recalculateValues) { recalculateValues = false; System.out.println(" DRAWING THE PARTICLE MOTION WITHOUT RECALCULATING THE VALUES"); graphics2D.draw(particleMotion.getShape()); return; } logger.debug("IN DRAW PARTICLE MOTION"); Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.hseis.getSeismogram(); LocalSeismogramImpl vseis = particleMotion.vseis.getSeismogram(); //AmpConfigRegistrar vAmpConfigRegistrar = particleMotion.vAmpConfigRegistrar; //AmpConfigRegistrar hAmpConfigRegistrar = particleMotion.hAmpConfigRegistrar; Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } //drawLabels(particleMotion, graphics2D); graphics2D.setColor(color); Insets insets = getInsets(); Dimension flipDimension = new Dimension(dimension.height, dimension.width); try { System.out.println("In PaintSeismogram hmax = "+hunitRangeImpl.getMaxValue()+ " hmin = "+hunitRangeImpl.getMinValue()); System.out.println("In PaintSeismogram vmax = "+vunitRangeImpl.getMaxValue()+ " vmin = "+vunitRangeImpl.getMinValue()); MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.registrar == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); //System.out.println("beginTime = "+hseis.getBeginTime()); //System.out.println("endTime = "+hseis.getEndTime()); } else { microSecondTimeRange = particleMotion.getTimeRange(); } Date utilStartTime = Calendar.getInstance().getTime(); int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension);*/ /*SimplePlotUtil.compressYvalues(hseis, microSecondTimeRange, hunitRangeImpl, dimension); SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension); */ int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension);*/ SimplePlotUtil.flipArray(vPixels[1], dimension.height); Date utilEndTime = Calendar.getInstance().getTime(); System.out.println("The UTIL TIME is ******* "+ (utilEndTime.getTime() - utilStartTime.getTime())); /* SimplePlotUtil.compressYvalues(vseis, microSecondTimeRange, vunitRangeImpl, dimension); System.out.println("---------------------->Scaling THE Y VALUES "); SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); */ int len = vPixels[1].length; int[] x, y; x = new int[hPixels[1].length]; y = new int[vPixels[1].length]; x = hPixels[1]; y = vPixels[1]; if (hPixels[1].length < len) { len = hPixels.length; } Date drawStartTime = Calendar.getInstance().getTime(); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); Date drawEndTime = Calendar.getInstance().getTime(); System.out.println("The PATH TIME is *********** "+(drawEndTime.getTime() - drawStartTime.getTime())); particleMotion.setShape(shape); System.out.println("After setting the shape"); if(shape == null) System.out.println("The shape is null"); graphics2D.draw(shape); // System.out.println("The shape is drawn"); } catch(Exception e) { e.printStackTrace(); } }
1,118,192
public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { Graphics2D graphics2D = (Graphics2D) g; if(!recalculateValues) { recalculateValues = false; System.out.println(" DRAWING THE PARTICLE MOTION WITHOUT RECALCULATING THE VALUES"); graphics2D.draw(particleMotion.getShape()); return; } logger.debug("IN DRAW PARTICLE MOTION"); Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.hseis.getSeismogram(); LocalSeismogramImpl vseis = particleMotion.vseis.getSeismogram(); //AmpConfigRegistrar vAmpConfigRegistrar = particleMotion.vAmpConfigRegistrar; //AmpConfigRegistrar hAmpConfigRegistrar = particleMotion.hAmpConfigRegistrar; Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } //drawLabels(particleMotion, graphics2D); graphics2D.setColor(color); Insets insets = getInsets(); Dimension flipDimension = new Dimension(dimension.height, dimension.width); try { System.out.println("In PaintSeismogram hmax = "+hunitRangeImpl.getMaxValue()+ " hmin = "+hunitRangeImpl.getMinValue()); System.out.println("In PaintSeismogram vmax = "+vunitRangeImpl.getMaxValue()+ " vmin = "+vunitRangeImpl.getMinValue()); MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.registrar == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); //System.out.println("beginTime = "+hseis.getBeginTime()); //System.out.println("endTime = "+hseis.getEndTime()); } else { microSecondTimeRange = particleMotion.getTimeRange(); } System.out.println("*************** Beofore getting PlottableSimple"); Date utilStartTime = Calendar.getInstance().getTime(); int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension);*/ /*SimplePlotUtil.compressYvalues(hseis, microSecondTimeRange, hunitRangeImpl, dimension); SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension); */ int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension);*/ SimplePlotUtil.flipArray(vPixels[1], dimension.height); Date utilEndTime = Calendar.getInstance().getTime(); System.out.println("The UTIL TIME is ******* "+ (utilEndTime.getTime() - utilStartTime.getTime())); /* SimplePlotUtil.compressYvalues(vseis, microSecondTimeRange, vunitRangeImpl, dimension); System.out.println("---------------------->Scaling THE Y VALUES "); SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); */ int len = vPixels[1].length; int[] x, y; x = new int[hPixels[1].length]; y = new int[vPixels[1].length]; x = hPixels[1]; y = vPixels[1]; if (hPixels[1].length < len) { len = hPixels.length; } Date drawStartTime = Calendar.getInstance().getTime(); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); Date drawEndTime = Calendar.getInstance().getTime(); System.out.println("The PATH TIME is *********** "+(drawEndTime.getTime() - drawStartTime.getTime())); particleMotion.setShape(shape); System.out.println("After setting the shape"); if(shape == null) System.out.println("The shape is null"); graphics2D.draw(shape); // System.out.println("The shape is drawn"); } catch(Exception e) { e.printStackTrace(); } }
public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { Graphics2D graphics2D = (Graphics2D) g; if(!recalculateValues) { recalculateValues = false; System.out.println(" DRAWING THE PARTICLE MOTION WITHOUT RECALCULATING THE VALUES"); graphics2D.draw(particleMotion.getShape()); return; } logger.debug("IN DRAW PARTICLE MOTION"); Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.hseis.getSeismogram(); LocalSeismogramImpl vseis = particleMotion.vseis.getSeismogram(); //AmpConfigRegistrar vAmpConfigRegistrar = particleMotion.vAmpConfigRegistrar; //AmpConfigRegistrar hAmpConfigRegistrar = particleMotion.hAmpConfigRegistrar; Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } //drawLabels(particleMotion, graphics2D); graphics2D.setColor(color); Insets insets = getInsets(); Dimension flipDimension = new Dimension(dimension.height, dimension.width); try { System.out.println("In PaintSeismogram hmax = "+hunitRangeImpl.getMaxValue()+ " hmin = "+hunitRangeImpl.getMinValue()); System.out.println("In PaintSeismogram vmax = "+vunitRangeImpl.getMaxValue()+ " vmin = "+vunitRangeImpl.getMinValue()); MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.registrar == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); //System.out.println("beginTime = "+hseis.getBeginTime()); //System.out.println("endTime = "+hseis.getEndTime()); } else { microSecondTimeRange = particleMotion.getTimeRange(); } System.out.println("*************** Beofore getting PlottableSimple"); Date utilStartTime = Calendar.getInstance().getTime(); int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension);*/ /*SimplePlotUtil.compressYvalues(hseis, microSecondTimeRange, hunitRangeImpl, dimension); SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension); */ int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension);*/ SimplePlotUtil.flipArray(vPixels[1], dimension.height); Date utilEndTime = Calendar.getInstance().getTime(); /* SimplePlotUtil.compressYvalues(vseis, microSecondTimeRange, vunitRangeImpl, dimension); System.out.println("---------------------->Scaling THE Y VALUES "); SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); */ int len = vPixels[1].length; int[] x, y; x = new int[hPixels[1].length]; y = new int[vPixels[1].length]; x = hPixels[1]; y = vPixels[1]; if (hPixels[1].length < len) { len = hPixels.length; } Date drawStartTime = Calendar.getInstance().getTime(); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); Date drawEndTime = Calendar.getInstance().getTime(); System.out.println("The PATH TIME is *********** "+(drawEndTime.getTime() - drawStartTime.getTime())); particleMotion.setShape(shape); System.out.println("After setting the shape"); if(shape == null) System.out.println("The shape is null"); graphics2D.draw(shape); // System.out.println("The shape is drawn"); } catch(Exception e) { e.printStackTrace(); } }
1,118,193
public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { Graphics2D graphics2D = (Graphics2D) g; if(!recalculateValues) { recalculateValues = false; System.out.println(" DRAWING THE PARTICLE MOTION WITHOUT RECALCULATING THE VALUES"); graphics2D.draw(particleMotion.getShape()); return; } logger.debug("IN DRAW PARTICLE MOTION"); Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.hseis.getSeismogram(); LocalSeismogramImpl vseis = particleMotion.vseis.getSeismogram(); //AmpConfigRegistrar vAmpConfigRegistrar = particleMotion.vAmpConfigRegistrar; //AmpConfigRegistrar hAmpConfigRegistrar = particleMotion.hAmpConfigRegistrar; Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } //drawLabels(particleMotion, graphics2D); graphics2D.setColor(color); Insets insets = getInsets(); Dimension flipDimension = new Dimension(dimension.height, dimension.width); try { System.out.println("In PaintSeismogram hmax = "+hunitRangeImpl.getMaxValue()+ " hmin = "+hunitRangeImpl.getMinValue()); System.out.println("In PaintSeismogram vmax = "+vunitRangeImpl.getMaxValue()+ " vmin = "+vunitRangeImpl.getMinValue()); MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.registrar == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); //System.out.println("beginTime = "+hseis.getBeginTime()); //System.out.println("endTime = "+hseis.getEndTime()); } else { microSecondTimeRange = particleMotion.getTimeRange(); } System.out.println("*************** Beofore getting PlottableSimple"); Date utilStartTime = Calendar.getInstance().getTime(); int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension);*/ /*SimplePlotUtil.compressYvalues(hseis, microSecondTimeRange, hunitRangeImpl, dimension); SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension); */ int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension);*/ SimplePlotUtil.flipArray(vPixels[1], dimension.height); Date utilEndTime = Calendar.getInstance().getTime(); System.out.println("The UTIL TIME is ******* "+ (utilEndTime.getTime() - utilStartTime.getTime())); /* SimplePlotUtil.compressYvalues(vseis, microSecondTimeRange, vunitRangeImpl, dimension); System.out.println("---------------------->Scaling THE Y VALUES "); SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); */ int len = vPixels[1].length; int[] x, y; x = new int[hPixels[1].length]; y = new int[vPixels[1].length]; x = hPixels[1]; y = vPixels[1]; if (hPixels[1].length < len) { len = hPixels.length; } Date drawStartTime = Calendar.getInstance().getTime(); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); Date drawEndTime = Calendar.getInstance().getTime(); System.out.println("The PATH TIME is *********** "+(drawEndTime.getTime() - drawStartTime.getTime())); particleMotion.setShape(shape); System.out.println("After setting the shape"); if(shape == null) System.out.println("The shape is null"); graphics2D.draw(shape); // System.out.println("The shape is drawn"); } catch(Exception e) { e.printStackTrace(); } }
public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { Graphics2D graphics2D = (Graphics2D) g; if(!recalculateValues) { recalculateValues = false; System.out.println(" DRAWING THE PARTICLE MOTION WITHOUT RECALCULATING THE VALUES"); graphics2D.draw(particleMotion.getShape()); return; } logger.debug("IN DRAW PARTICLE MOTION"); Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.hseis.getSeismogram(); LocalSeismogramImpl vseis = particleMotion.vseis.getSeismogram(); //AmpConfigRegistrar vAmpConfigRegistrar = particleMotion.vAmpConfigRegistrar; //AmpConfigRegistrar hAmpConfigRegistrar = particleMotion.hAmpConfigRegistrar; Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } //drawLabels(particleMotion, graphics2D); graphics2D.setColor(color); Insets insets = getInsets(); Dimension flipDimension = new Dimension(dimension.height, dimension.width); try { System.out.println("In PaintSeismogram hmax = "+hunitRangeImpl.getMaxValue()+ " hmin = "+hunitRangeImpl.getMinValue()); System.out.println("In PaintSeismogram vmax = "+vunitRangeImpl.getMaxValue()+ " vmin = "+vunitRangeImpl.getMinValue()); MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.registrar == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); //System.out.println("beginTime = "+hseis.getBeginTime()); //System.out.println("endTime = "+hseis.getEndTime()); } else { microSecondTimeRange = particleMotion.getTimeRange(); } System.out.println("*************** Beofore getting PlottableSimple"); Date utilStartTime = Calendar.getInstance().getTime(); int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension);*/ /*SimplePlotUtil.compressYvalues(hseis, microSecondTimeRange, hunitRangeImpl, dimension); SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension); */ int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension);*/ SimplePlotUtil.flipArray(vPixels[1], dimension.height); Date utilEndTime = Calendar.getInstance().getTime(); System.out.println("The UTIL TIME is ******* "+ (utilEndTime.getTime() - utilStartTime.getTime())); /* SimplePlotUtil.compressYvalues(vseis, microSecondTimeRange, vunitRangeImpl, dimension); System.out.println("---------------------->Scaling THE Y VALUES "); SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); */ int len = vPixels[1].length; int[] x, y; x = new int[hPixels[1].length]; y = new int[vPixels[1].length]; x = hPixels[1]; y = vPixels[1]; if (hPixels[1].length < len) { len = hPixels.length; } Date drawStartTime = Calendar.getInstance().getTime(); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); Date drawEndTime = Calendar.getInstance().getTime(); particleMotion.setShape(shape); System.out.println("After setting the shape"); if(shape == null) System.out.println("The shape is null"); graphics2D.draw(shape); // System.out.println("The shape is drawn"); } catch(Exception e) { e.printStackTrace(); } }
1,118,194
public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { Graphics2D graphics2D = (Graphics2D) g; if(!recalculateValues) { recalculateValues = false; System.out.println(" DRAWING THE PARTICLE MOTION WITHOUT RECALCULATING THE VALUES"); graphics2D.draw(particleMotion.getShape()); return; } logger.debug("IN DRAW PARTICLE MOTION"); Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.hseis.getSeismogram(); LocalSeismogramImpl vseis = particleMotion.vseis.getSeismogram(); //AmpConfigRegistrar vAmpConfigRegistrar = particleMotion.vAmpConfigRegistrar; //AmpConfigRegistrar hAmpConfigRegistrar = particleMotion.hAmpConfigRegistrar; Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } //drawLabels(particleMotion, graphics2D); graphics2D.setColor(color); Insets insets = getInsets(); Dimension flipDimension = new Dimension(dimension.height, dimension.width); try { System.out.println("In PaintSeismogram hmax = "+hunitRangeImpl.getMaxValue()+ " hmin = "+hunitRangeImpl.getMinValue()); System.out.println("In PaintSeismogram vmax = "+vunitRangeImpl.getMaxValue()+ " vmin = "+vunitRangeImpl.getMinValue()); MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.registrar == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); //System.out.println("beginTime = "+hseis.getBeginTime()); //System.out.println("endTime = "+hseis.getEndTime()); } else { microSecondTimeRange = particleMotion.getTimeRange(); } System.out.println("*************** Beofore getting PlottableSimple"); Date utilStartTime = Calendar.getInstance().getTime(); int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension);*/ /*SimplePlotUtil.compressYvalues(hseis, microSecondTimeRange, hunitRangeImpl, dimension); SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension); */ int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension);*/ SimplePlotUtil.flipArray(vPixels[1], dimension.height); Date utilEndTime = Calendar.getInstance().getTime(); System.out.println("The UTIL TIME is ******* "+ (utilEndTime.getTime() - utilStartTime.getTime())); /* SimplePlotUtil.compressYvalues(vseis, microSecondTimeRange, vunitRangeImpl, dimension); System.out.println("---------------------->Scaling THE Y VALUES "); SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); */ int len = vPixels[1].length; int[] x, y; x = new int[hPixels[1].length]; y = new int[vPixels[1].length]; x = hPixels[1]; y = vPixels[1]; if (hPixels[1].length < len) { len = hPixels.length; } Date drawStartTime = Calendar.getInstance().getTime(); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); Date drawEndTime = Calendar.getInstance().getTime(); System.out.println("The PATH TIME is *********** "+(drawEndTime.getTime() - drawStartTime.getTime())); particleMotion.setShape(shape); System.out.println("After setting the shape"); if(shape == null) System.out.println("The shape is null"); graphics2D.draw(shape); // System.out.println("The shape is drawn"); } catch(Exception e) { e.printStackTrace(); } }
public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { Graphics2D graphics2D = (Graphics2D) g; if(!recalculateValues) { recalculateValues = false; System.out.println(" DRAWING THE PARTICLE MOTION WITHOUT RECALCULATING THE VALUES"); graphics2D.draw(particleMotion.getShape()); return; } logger.debug("IN DRAW PARTICLE MOTION"); Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.hseis.getSeismogram(); LocalSeismogramImpl vseis = particleMotion.vseis.getSeismogram(); //AmpConfigRegistrar vAmpConfigRegistrar = particleMotion.vAmpConfigRegistrar; //AmpConfigRegistrar hAmpConfigRegistrar = particleMotion.hAmpConfigRegistrar; Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } //drawLabels(particleMotion, graphics2D); graphics2D.setColor(color); Insets insets = getInsets(); Dimension flipDimension = new Dimension(dimension.height, dimension.width); try { System.out.println("In PaintSeismogram hmax = "+hunitRangeImpl.getMaxValue()+ " hmin = "+hunitRangeImpl.getMinValue()); System.out.println("In PaintSeismogram vmax = "+vunitRangeImpl.getMaxValue()+ " vmin = "+vunitRangeImpl.getMinValue()); MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.registrar == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); //System.out.println("beginTime = "+hseis.getBeginTime()); //System.out.println("endTime = "+hseis.getEndTime()); } else { microSecondTimeRange = particleMotion.getTimeRange(); } System.out.println("*************** Beofore getting PlottableSimple"); Date utilStartTime = Calendar.getInstance().getTime(); int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension);*/ /*SimplePlotUtil.compressYvalues(hseis, microSecondTimeRange, hunitRangeImpl, dimension); SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension); */ int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension);*/ SimplePlotUtil.flipArray(vPixels[1], dimension.height); Date utilEndTime = Calendar.getInstance().getTime(); System.out.println("The UTIL TIME is ******* "+ (utilEndTime.getTime() - utilStartTime.getTime())); /* SimplePlotUtil.compressYvalues(vseis, microSecondTimeRange, vunitRangeImpl, dimension); System.out.println("---------------------->Scaling THE Y VALUES "); SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); */ int len = vPixels[1].length; int[] x, y; x = new int[hPixels[1].length]; y = new int[vPixels[1].length]; x = hPixels[1]; y = vPixels[1]; if (hPixels[1].length < len) { len = hPixels.length; } Date drawStartTime = Calendar.getInstance().getTime(); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); Date drawEndTime = Calendar.getInstance().getTime(); System.out.println("The PATH TIME is *********** "+(drawEndTime.getTime() - drawStartTime.getTime())); particleMotion.setShape(shape); if(shape == null) System.out.println("The shape is null"); graphics2D.draw(shape); // System.out.println("The shape is drawn"); } catch(Exception e) { e.printStackTrace(); } }
1,118,195
public synchronized Shape getParticleMotionPath(int[] x, int[] y) { int len = x.length; if(y.length < len) { len = y.length;} GeneralPath generalPath = new GeneralPath(GeneralPath.WIND_EVEN_ODD); if(len != 0) { generalPath.moveTo(x[0], y[0]); } for(int counter = 1; counter < len; counter++) { generalPath.lineTo(x[counter], y[counter]); } /*for(int counter = 0; counter < len; counter++) { generalPath.append(new Rectangle2D.Float(x[counter]-2, y[counter]-2, 4, 4), false); }*/ System.out.println("Before returning from the getParticleMotionPath"); return (Shape)generalPath; }
public synchronized Shape getParticleMotionPath(int[] x, int[] y) { int len = x.length; if(y.length < len) { len = y.length;} GeneralPath generalPath = new GeneralPath(GeneralPath.WIND_EVEN_ODD); if(len != 0) { generalPath.moveTo(x[0], y[0]); } for(int counter = 1; counter < len; counter++) { generalPath.lineTo(x[counter], y[counter]); } /*for(int counter = 0; counter < len; counter++) { generalPath.append(new Rectangle2D.Float(x[counter]-2, y[counter]-2, 4, 4), false); }*/ return (Shape)generalPath; }
1,118,196
public synchronized void paintComponent(Graphics g) { // if(setSelected == 1) g.setColor(Color.red); //else if(setSelected == 2) g.setColor(getBackground()); if(displayKeys.size() == 0) return; Graphics2D graphics2D = (Graphics2D)g; logger.debug("IN PAINT COMPONENT"); vunitRangeImpl = new UnitRangeImpl(getMinVerticalAmplitude(), getMaxVerticalAmplitude(), UnitImpl.COUNT); hunitRangeImpl = new UnitRangeImpl(getMinHorizontalAmplitude(), getMaxHorizontalAmplitude(), UnitImpl.COUNT);// particleMotionDisplay.updateHorizontalAmpScale(hunitRangeImpl);// particleMotionDisplay.updateVerticalAmpScale(vunitRangeImpl); if(startPoint != null && endPoint != null) { graphics2D.setColor(Color.yellow); //logger.debug("Start Point "+startPoint.getX()+" "+startPoint.getY()); //logger.debug("End Point "+endPoint.getX()+" "+endPoint.getY()); java.awt.geom.Rectangle2D.Double rect = new java.awt.geom.Rectangle2D.Double(startPoint.getX(), startPoint.getY(), endPoint.getX() - startPoint.getX(), endPoint.getY() - startPoint.getY()); graphics2D.fill(rect); graphics2D.draw(rect); } int size = displays.size(); //first draw the azimuth if one of the display is horizontal plane for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); if(!displayKeys.contains(particleMotion.key)) continue; drawAzimuth(particleMotion, graphics2D); } Date startTime = Calendar.getInstance().getTime(); // graphics2D.setStroke(new BasicStroke(1.5f)); for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); //if(!getDisplayKey().equals(particleMotion.key)) continue; if(!displayKeys.contains(particleMotion.key)) continue; if(particleMotion.isSelected()) continue; drawParticleMotion(particleMotion, graphics2D); }//end of for System.out.println("ENd of the for"); for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); //if(!getDisplayKey().equals(particleMotion.key)) continue; if(!displayKeys.contains(particleMotion.key)) continue; //drawAzimuth(particleMotion, graphics2D); if(particleMotion.isSelected()) { particleMotion.setSelected(false); drawParticleMotion(particleMotion, g); } } graphics2D.setStroke(new BasicStroke(1.0f)); Date endTime = Calendar.getInstance().getTime(); System.out.println("THE TIME TAKEN IS ********** "+ (endTime.getTime() - startTime.getTime())); }
public synchronized void paintComponent(Graphics g) { // if(setSelected == 1) g.setColor(Color.red); //else if(setSelected == 2) g.setColor(getBackground()); if(displayKeys.size() == 0) return; Graphics2D graphics2D = (Graphics2D)g; logger.debug("IN PAINT COMPONENT"); vunitRangeImpl = new UnitRangeImpl(getMinVerticalAmplitude(), getMaxVerticalAmplitude(), UnitImpl.COUNT); hunitRangeImpl = new UnitRangeImpl(getMinHorizontalAmplitude(), getMaxHorizontalAmplitude(), UnitImpl.COUNT);// particleMotionDisplay.updateHorizontalAmpScale(hunitRangeImpl);// particleMotionDisplay.updateVerticalAmpScale(vunitRangeImpl); if(startPoint != null && endPoint != null) { graphics2D.setColor(Color.yellow); //logger.debug("Start Point "+startPoint.getX()+" "+startPoint.getY()); //logger.debug("End Point "+endPoint.getX()+" "+endPoint.getY()); java.awt.geom.Rectangle2D.Double rect = new java.awt.geom.Rectangle2D.Double(startPoint.getX(), startPoint.getY(), endPoint.getX() - startPoint.getX(), endPoint.getY() - startPoint.getY()); graphics2D.fill(rect); graphics2D.draw(rect); } int size = displays.size(); //first draw the azimuth if one of the display is horizontal plane for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); if(!displayKeys.contains(particleMotion.key)) continue; drawAzimuth(particleMotion, graphics2D); } Date startTime = Calendar.getInstance().getTime(); // graphics2D.setStroke(new BasicStroke(1.5f)); for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); //if(!getDisplayKey().equals(particleMotion.key)) continue; if(!displayKeys.contains(particleMotion.key)) continue; if(particleMotion.isSelected()) continue; drawParticleMotion(particleMotion, graphics2D); }//end of for for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); //if(!getDisplayKey().equals(particleMotion.key)) continue; if(!displayKeys.contains(particleMotion.key)) continue; //drawAzimuth(particleMotion, graphics2D); if(particleMotion.isSelected()) { particleMotion.setSelected(false); drawParticleMotion(particleMotion, g); } } graphics2D.setStroke(new BasicStroke(1.0f)); Date endTime = Calendar.getInstance().getTime(); System.out.println("THE TIME TAKEN IS ********** "+ (endTime.getTime() - startTime.getTime())); }
1,118,197
public synchronized void paintComponent(Graphics g) { // if(setSelected == 1) g.setColor(Color.red); //else if(setSelected == 2) g.setColor(getBackground()); if(displayKeys.size() == 0) return; Graphics2D graphics2D = (Graphics2D)g; logger.debug("IN PAINT COMPONENT"); vunitRangeImpl = new UnitRangeImpl(getMinVerticalAmplitude(), getMaxVerticalAmplitude(), UnitImpl.COUNT); hunitRangeImpl = new UnitRangeImpl(getMinHorizontalAmplitude(), getMaxHorizontalAmplitude(), UnitImpl.COUNT);// particleMotionDisplay.updateHorizontalAmpScale(hunitRangeImpl);// particleMotionDisplay.updateVerticalAmpScale(vunitRangeImpl); if(startPoint != null && endPoint != null) { graphics2D.setColor(Color.yellow); //logger.debug("Start Point "+startPoint.getX()+" "+startPoint.getY()); //logger.debug("End Point "+endPoint.getX()+" "+endPoint.getY()); java.awt.geom.Rectangle2D.Double rect = new java.awt.geom.Rectangle2D.Double(startPoint.getX(), startPoint.getY(), endPoint.getX() - startPoint.getX(), endPoint.getY() - startPoint.getY()); graphics2D.fill(rect); graphics2D.draw(rect); } int size = displays.size(); //first draw the azimuth if one of the display is horizontal plane for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); if(!displayKeys.contains(particleMotion.key)) continue; drawAzimuth(particleMotion, graphics2D); } Date startTime = Calendar.getInstance().getTime(); // graphics2D.setStroke(new BasicStroke(1.5f)); for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); //if(!getDisplayKey().equals(particleMotion.key)) continue; if(!displayKeys.contains(particleMotion.key)) continue; if(particleMotion.isSelected()) continue; drawParticleMotion(particleMotion, graphics2D); }//end of for System.out.println("ENd of the for"); for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); //if(!getDisplayKey().equals(particleMotion.key)) continue; if(!displayKeys.contains(particleMotion.key)) continue; //drawAzimuth(particleMotion, graphics2D); if(particleMotion.isSelected()) { particleMotion.setSelected(false); drawParticleMotion(particleMotion, g); } } graphics2D.setStroke(new BasicStroke(1.0f)); Date endTime = Calendar.getInstance().getTime(); System.out.println("THE TIME TAKEN IS ********** "+ (endTime.getTime() - startTime.getTime())); }
public synchronized void paintComponent(Graphics g) { // if(setSelected == 1) g.setColor(Color.red); //else if(setSelected == 2) g.setColor(getBackground()); if(displayKeys.size() == 0) return; Graphics2D graphics2D = (Graphics2D)g; logger.debug("IN PAINT COMPONENT"); vunitRangeImpl = new UnitRangeImpl(getMinVerticalAmplitude(), getMaxVerticalAmplitude(), UnitImpl.COUNT); hunitRangeImpl = new UnitRangeImpl(getMinHorizontalAmplitude(), getMaxHorizontalAmplitude(), UnitImpl.COUNT);// particleMotionDisplay.updateHorizontalAmpScale(hunitRangeImpl);// particleMotionDisplay.updateVerticalAmpScale(vunitRangeImpl); if(startPoint != null && endPoint != null) { graphics2D.setColor(Color.yellow); //logger.debug("Start Point "+startPoint.getX()+" "+startPoint.getY()); //logger.debug("End Point "+endPoint.getX()+" "+endPoint.getY()); java.awt.geom.Rectangle2D.Double rect = new java.awt.geom.Rectangle2D.Double(startPoint.getX(), startPoint.getY(), endPoint.getX() - startPoint.getX(), endPoint.getY() - startPoint.getY()); graphics2D.fill(rect); graphics2D.draw(rect); } int size = displays.size(); //first draw the azimuth if one of the display is horizontal plane for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); if(!displayKeys.contains(particleMotion.key)) continue; drawAzimuth(particleMotion, graphics2D); } Date startTime = Calendar.getInstance().getTime(); // graphics2D.setStroke(new BasicStroke(1.5f)); for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); //if(!getDisplayKey().equals(particleMotion.key)) continue; if(!displayKeys.contains(particleMotion.key)) continue; if(particleMotion.isSelected()) continue; drawParticleMotion(particleMotion, graphics2D); }//end of for System.out.println("ENd of the for"); for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); //if(!getDisplayKey().equals(particleMotion.key)) continue; if(!displayKeys.contains(particleMotion.key)) continue; //drawAzimuth(particleMotion, graphics2D); if(particleMotion.isSelected()) { particleMotion.setSelected(false); drawParticleMotion(particleMotion, g); } } graphics2D.setStroke(new BasicStroke(1.0f)); Date endTime = Calendar.getInstance().getTime(); }
1,118,198
private void appendProperty(StringBuffer buffer, String propertyName, String propertyValue) throws UnsupportedEncodingException { if (propertyValue != null) { buffer.append("&").append(propertyName).append("=").append(URLEncoder.encode(propertyValue, "UTF-8")); } }
private void appendProperty(StringBuffer buffer, String propertyName, String propertyValue) throws UnsupportedEncodingException { if (propertyValue != null) { buffer.append("&").append(propertyName).append("=").append(URLEncoder.encode(propertyValue, "ISO-8859-1")); } }
1,118,199
private Hashtable getFirstResponse() throws KortathjonustanAuthorizationException { Hashtable properties = null; //System.out.println(" ------ REQUEST ------"); //long lStartTime = System.currentTimeMillis(); try { SSLClient client = getSSLClient(); StringBuffer strPostData = new StringBuffer(); appendProperty(strPostData, PROPERTY_SITE, SITE);//"site=22" appendProperty(strPostData, PROPERTY_USER, USER); appendProperty(strPostData, PROPERTY_PASSWORD, PASSWORD); appendProperty(strPostData, PROPERTY_ACCEPTOR_TERM_ID, ACCEPTOR_TERM_ID); appendProperty(strPostData, PROPERTY_ACCEPTOR_IDENT, ACCEPTOR_IDENTIFICATION); appendProperty(strPostData, PROPERTY_CC_NUMBER, strCCNumber); appendProperty(strPostData, PROPERTY_CC_EXPIRE, strCCExpire); appendProperty(strPostData, PROPERTY_AMOUNT, strAmount); appendProperty(strPostData, PROPERTY_CURRENCY_CODE, strCurrencyCode); appendProperty(strPostData, PROPERTY_CURRENCY_EXPONENT, strCurrencyExponent); appendProperty(strPostData, PROPERTY_CARDHOLDER_NAME, strName); appendProperty(strPostData, PROPERTY_REFERENCE_ID, strReferenceNumber); appendProperty(strPostData, PROPERTY_CURRENT_DATE, strCurrentDate); appendProperty(strPostData, PROPERTY_CC_VERIFY_CODE, strCCVerify); addDefautProperties(strPostData); String strResponse = null; //System.out.println("Request [" + strPostData.toString() + "]"); try { System.out.println("[Korta] PostData = "+strPostData.toString()); strResponse = client.sendRequest(REQUEST_TYPE_AUTHORIZATION, strPostData.toString()); } catch (Exception e) { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("SendRequest failed"); cce.setErrorNumber("-"); cce.setParentException(e); throw cce; } //System.out.println("Response [" + strResponse + "]"); if (strResponse == null) { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("SendRequest returned null"); cce.setErrorNumber("-"); throw cce; } else if (!strResponse.startsWith(PROPERTY_ACTION_CODE)) { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("Invalid response from host, should start with d39 [" + strResponse + "]"); cce.setErrorNumber("-"); throw cce; } else { properties = parseResponse(strResponse); if (CODE_AUTHORIZATOIN_APPROVED.equals(properties.get(PROPERTY_ACTION_CODE))) { return properties; } else { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError(properties.get(PROPERTY_ACTION_CODE_TEXT).toString()); cce.setErrorMessage(properties.get(PROPERTY_ERROR_TEXT).toString()); cce.setErrorNumber(properties.get(PROPERTY_ERROR_CODE).toString()); throw cce; } } } catch (UnsupportedEncodingException e) { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("UnsupportedEncodingException"); cce.setErrorNumber("-"); cce.setParentException(e); throw cce; } }
private Hashtable getFirstResponse() throws KortathjonustanAuthorizationException { Hashtable properties = null; //System.out.println(" ------ REQUEST ------"); //long lStartTime = System.currentTimeMillis(); try { SSLClient client = getSSLClient(); StringBuffer strPostData = new StringBuffer(); appendProperty(strPostData, PROPERTY_SITE, SITE);//"site=22" appendProperty(strPostData, PROPERTY_USER, USER); appendProperty(strPostData, PROPERTY_PASSWORD, PASSWORD); appendProperty(strPostData, PROPERTY_ACCEPTOR_TERM_ID, ACCEPTOR_TERM_ID); appendProperty(strPostData, PROPERTY_ACCEPTOR_IDENT, ACCEPTOR_IDENTIFICATION); appendProperty(strPostData, PROPERTY_CC_NUMBER, strCCNumber); appendProperty(strPostData, PROPERTY_CC_EXPIRE, strCCExpire); appendProperty(strPostData, PROPERTY_AMOUNT, strAmount); appendProperty(strPostData, PROPERTY_CURRENCY_CODE, strCurrencyCode); appendProperty(strPostData, PROPERTY_CURRENCY_EXPONENT, strCurrencyExponent); appendProperty(strPostData, PROPERTY_CARDHOLDER_NAME, strName); appendProperty(strPostData, PROPERTY_REFERENCE_ID, strReferenceNumber); appendProperty(strPostData, PROPERTY_CURRENT_DATE, strCurrentDate); appendProperty(strPostData, PROPERTY_CC_VERIFY_CODE, strCCVerify); addDefautProperties(strPostData); String strResponse = null; //System.out.println("Request [" + strPostData.toString() + "]"); try { strResponse = client.sendRequest(REQUEST_TYPE_AUTHORIZATION, strPostData.toString()); } catch (Exception e) { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("SendRequest failed"); cce.setErrorNumber("-"); cce.setParentException(e); throw cce; } //System.out.println("Response [" + strResponse + "]"); if (strResponse == null) { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("SendRequest returned null"); cce.setErrorNumber("-"); throw cce; } else if (!strResponse.startsWith(PROPERTY_ACTION_CODE)) { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("Invalid response from host, should start with d39 [" + strResponse + "]"); cce.setErrorNumber("-"); throw cce; } else { properties = parseResponse(strResponse); if (CODE_AUTHORIZATOIN_APPROVED.equals(properties.get(PROPERTY_ACTION_CODE))) { return properties; } else { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError(properties.get(PROPERTY_ACTION_CODE_TEXT).toString()); cce.setErrorMessage(properties.get(PROPERTY_ERROR_TEXT).toString()); cce.setErrorNumber(properties.get(PROPERTY_ERROR_CODE).toString()); throw cce; } } } catch (UnsupportedEncodingException e) { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("UnsupportedEncodingException"); cce.setErrorNumber("-"); cce.setParentException(e); throw cce; } }
1,118,200
private String getPostData(Hashtable properties) { StringBuffer strPostData = new StringBuffer(); try { appendProperty(strPostData, PROPERTY_PASSWORD, PASSWORD); addProperties(strPostData, properties); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } System.out.println("[Korta] post_data = "+strPostData.toString()); return strPostData.toString(); }
private String getPostData(Hashtable properties) { StringBuffer strPostData = new StringBuffer(); try { appendProperty(strPostData, PROPERTY_PASSWORD, PASSWORD); addProperties(strPostData, properties); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return strPostData.toString(); }
1,118,201
void process() throws ParserConfigurationException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = factory.newDocumentBuilder(); String userName = System.getProperty("user.name"); dataset = new XMLDataSet(docBuilder, base, "genid"+Math.round(Math.random()*Integer.MAX_VALUE), dsName, userName); Iterator it = paramRefs.keySet().iterator(); while (it.hasNext()) { String key = (String)it.next(); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName, "Added parameter "+key); try { URL dirURL = new URL(base, directory.getName()+"/"); dataset.addParameterRef(new URL(dirURL, (String)paramRefs.get(key)), key, audit); } catch (MalformedURLException e) { //can't happen? e.printStackTrace(); System.err.println("Caught exception on parameterRef " +key+", continuing..."); } // end of try-catch } // end of while (it.hasNext()) File[] sacFiles = directory.listFiles(); //SacTimeSeries sac = new SacTimeSeries(); for (int i=0; i<sacFiles.length; i++) { if (excludes.contains(sacFiles[i].getName())) { continue; } // end of if (excludes.contains(sacFiles[i].getName())) if (paramRefs.containsValue(sacFiles[i].getName())) { continue; } // end of if (excludes.contains(sacFiles[i].getName())) try { //sac.read(sacFiles[i].getCanonicalPath()); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName+" via SacDirToDataSet", "seismogram loaded from sacFiles[i].getCanonicalPath()"); URL seisURL = new URL(base, sacFiles[i].getName()); dataset.addSeismogramRef(seisURL, sacFiles[i].getName(), new Property[0], new ParameterRef[0], audit); } catch (Exception e) { e.printStackTrace(); System.err.println("Caught exception on " +sacFiles[i].getName()+", continuing..."); } // end of try-catch } // end of for (int i=0; i<sacFiles.length; i++) }
void process() throws ParserConfigurationException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = factory.newDocumentBuilder(); String userName = System.getProperty("user.name"); dataset = new XMLDataSet(docBuilder, dirURL, "genid"+Math.round(Math.random()*Integer.MAX_VALUE), dsName, userName); Iterator it = paramRefs.keySet().iterator(); while (it.hasNext()) { String key = (String)it.next(); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName, "Added parameter "+key); try { URL dirURL = new URL(dirURL, directory.getName()+"/"); dataset.addParameterRef(new URL(dirURL, (String)paramRefs.get(key)), key, audit); } catch (MalformedURLException e) { //can't happen? e.printStackTrace(); System.err.println("Caught exception on parameterRef " +key+", continuing..."); } // end of try-catch } // end of while (it.hasNext()) File[] sacFiles = directory.listFiles(); //SacTimeSeries sac = new SacTimeSeries(); for (int i=0; i<sacFiles.length; i++) { if (excludes.contains(sacFiles[i].getName())) { continue; } // end of if (excludes.contains(sacFiles[i].getName())) if (paramRefs.containsValue(sacFiles[i].getName())) { continue; } // end of if (excludes.contains(sacFiles[i].getName())) try { //sac.read(sacFiles[i].getCanonicalPath()); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName+" via SacDirToDataSet", "seismogram loaded from sacFiles[i].getCanonicalPath()"); URL seisURL = new URL(dirURL, sacFiles[i].getName()); dataset.addSeismogramRef(seisURL, sacFiles[i].getName(), new Property[0], new ParameterRef[0], audit); } catch (Exception e) { e.printStackTrace(); System.err.println("Caught exception on " +sacFiles[i].getName()+", continuing..."); } // end of try-catch } // end of for (int i=0; i<sacFiles.length; i++) }
1,118,202
void process() throws ParserConfigurationException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = factory.newDocumentBuilder(); String userName = System.getProperty("user.name"); dataset = new XMLDataSet(docBuilder, base, "genid"+Math.round(Math.random()*Integer.MAX_VALUE), dsName, userName); Iterator it = paramRefs.keySet().iterator(); while (it.hasNext()) { String key = (String)it.next(); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName, "Added parameter "+key); try { URL dirURL = new URL(base, directory.getName()+"/"); dataset.addParameterRef(new URL(dirURL, (String)paramRefs.get(key)), key, audit); } catch (MalformedURLException e) { //can't happen? e.printStackTrace(); System.err.println("Caught exception on parameterRef " +key+", continuing..."); } // end of try-catch } // end of while (it.hasNext()) File[] sacFiles = directory.listFiles(); //SacTimeSeries sac = new SacTimeSeries(); for (int i=0; i<sacFiles.length; i++) { if (excludes.contains(sacFiles[i].getName())) { continue; } // end of if (excludes.contains(sacFiles[i].getName())) if (paramRefs.containsValue(sacFiles[i].getName())) { continue; } // end of if (excludes.contains(sacFiles[i].getName())) try { //sac.read(sacFiles[i].getCanonicalPath()); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName+" via SacDirToDataSet", "seismogram loaded from sacFiles[i].getCanonicalPath()"); URL seisURL = new URL(base, sacFiles[i].getName()); dataset.addSeismogramRef(seisURL, sacFiles[i].getName(), new Property[0], new ParameterRef[0], audit); } catch (Exception e) { e.printStackTrace(); System.err.println("Caught exception on " +sacFiles[i].getName()+", continuing..."); } // end of try-catch } // end of for (int i=0; i<sacFiles.length; i++) }
void process() throws ParserConfigurationException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = factory.newDocumentBuilder(); String userName = System.getProperty("user.name"); dataset = new XMLDataSet(docBuilder, base, "genid"+Math.round(Math.random()*Integer.MAX_VALUE), dsName, userName); Iterator it = paramRefs.keySet().iterator(); while (it.hasNext()) { String key = (String)it.next(); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName, "Added parameter "+key); try { dataset.addParameterRef(new URL(dirURL, (String)paramRefs.get(key)), key, audit); } catch (MalformedURLException e) { //can't happen? e.printStackTrace(); System.err.println("Caught exception on parameterRef " +key+", continuing..."); } // end of try-catch } // end of while (it.hasNext()) File[] sacFiles = directory.listFiles(); //SacTimeSeries sac = new SacTimeSeries(); for (int i=0; i<sacFiles.length; i++) { if (excludes.contains(sacFiles[i].getName())) { continue; } // end of if (excludes.contains(sacFiles[i].getName())) if (paramRefs.containsValue(sacFiles[i].getName())) { continue; } // end of if (excludes.contains(sacFiles[i].getName())) try { //sac.read(sacFiles[i].getCanonicalPath()); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName+" via SacDirToDataSet", "seismogram loaded from sacFiles[i].getCanonicalPath()"); URL seisURL = new URL(base, sacFiles[i].getName()); dataset.addSeismogramRef(seisURL, sacFiles[i].getName(), new Property[0], new ParameterRef[0], audit); } catch (Exception e) { e.printStackTrace(); System.err.println("Caught exception on " +sacFiles[i].getName()+", continuing..."); } // end of try-catch } // end of for (int i=0; i<sacFiles.length; i++) }
1,118,203
void process() throws ParserConfigurationException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = factory.newDocumentBuilder(); String userName = System.getProperty("user.name"); dataset = new XMLDataSet(docBuilder, base, "genid"+Math.round(Math.random()*Integer.MAX_VALUE), dsName, userName); Iterator it = paramRefs.keySet().iterator(); while (it.hasNext()) { String key = (String)it.next(); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName, "Added parameter "+key); try { URL dirURL = new URL(base, directory.getName()+"/"); dataset.addParameterRef(new URL(dirURL, (String)paramRefs.get(key)), key, audit); } catch (MalformedURLException e) { //can't happen? e.printStackTrace(); System.err.println("Caught exception on parameterRef " +key+", continuing..."); } // end of try-catch } // end of while (it.hasNext()) File[] sacFiles = directory.listFiles(); //SacTimeSeries sac = new SacTimeSeries(); for (int i=0; i<sacFiles.length; i++) { if (excludes.contains(sacFiles[i].getName())) { continue; } // end of if (excludes.contains(sacFiles[i].getName())) if (paramRefs.containsValue(sacFiles[i].getName())) { continue; } // end of if (excludes.contains(sacFiles[i].getName())) try { //sac.read(sacFiles[i].getCanonicalPath()); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName+" via SacDirToDataSet", "seismogram loaded from sacFiles[i].getCanonicalPath()"); URL seisURL = new URL(base, sacFiles[i].getName()); dataset.addSeismogramRef(seisURL, sacFiles[i].getName(), new Property[0], new ParameterRef[0], audit); } catch (Exception e) { e.printStackTrace(); System.err.println("Caught exception on " +sacFiles[i].getName()+", continuing..."); } // end of try-catch } // end of for (int i=0; i<sacFiles.length; i++) }
void process() throws ParserConfigurationException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = factory.newDocumentBuilder(); String userName = System.getProperty("user.name"); dataset = new XMLDataSet(docBuilder, base, "genid"+Math.round(Math.random()*Integer.MAX_VALUE), dsName, userName); Iterator it = paramRefs.keySet().iterator(); while (it.hasNext()) { String key = (String)it.next(); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName, "Added parameter "+key); try { URL dirURL = new URL(base, directory.getName()+"/"); dataset.addParameterRef(new URL(dirURL, (String)paramRefs.get(key)), key, audit); } catch (MalformedURLException e) { //can't happen? e.printStackTrace(); System.err.println("Caught exception on parameterRef " +key+", continuing..."); } // end of try-catch } // end of while (it.hasNext()) File[] sacFiles = directory.listFiles(); //SacTimeSeries sac = new SacTimeSeries(); for (int i=0; i<sacFiles.length; i++) { if (excludes.contains(sacFiles[i].getName())) { continue; } // end of if (excludes.contains(sacFiles[i].getName())) if (paramRefs.containsValue(sacFiles[i].getName())) { continue; } // end of if (excludes.contains(sacFiles[i].getName())) try { //sac.read(sacFiles[i].getCanonicalPath()); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName+" via SacDirToDataSet", "seismogram loaded from sacFiles[i].getCanonicalPath()"); URL seisURL = new URL(dirURL, sacFiles[i].getName()); dataset.addSeismogramRef(seisURL, sacFiles[i].getName(), new Property[0], new ParameterRef[0], audit); } catch (Exception e) { e.printStackTrace(); System.err.println("Caught exception on " +sacFiles[i].getName()+", continuing..."); } // end of try-catch } // end of for (int i=0; i<sacFiles.length; i++) }
1,118,204
private int processDoc(Document doc) throws WebdavException { try { WebdavNsIntf intf = getNsIntf(); Element root = doc.getDocumentElement(); /* Get hold of the PROPFIND method instance - we need it to process possible prop requests. */ PropFindMethod pm = (PropFindMethod)intf.findMethod( WebdavMethods.propFind); if (pm == null) { return HttpServletResponse.SC_INTERNAL_SERVER_ERROR; } if (nodeMatches(root, CaldavTags.calendarQuery)) { reportType = reportTypeQuery; } else if (nodeMatches(root, CaldavTags.calendarMultiget)) { reportType = reportTypeMultiGet; } else if (nodeMatches(root, CaldavTags.freeBusyQuery)) { reportType = reportTypeFreeBusy; freeBusy = new FreeBusyQuery(intf, debug); } else if (nodeMatches(root, WebdavTags.expandProperty)) { reportType = reportTypeExpandProperty; } else { throw new WebdavBadRequest(); } Element[] children = getChildren(root); for (int i = 0; i < children.length; i++) { Element curnode = children[i]; /** The names come through looking something like A:allprop etc. */ String nm = curnode.getLocalName(); String ns = curnode.getNamespaceURI(); if (debug) { trace("reqtype: " + nm + " ns: " + ns); } if (reportType == reportTypeFreeBusy) { freeBusy.parse(curnode); } else if (reportType == reportTypeExpandProperty) { } else { /* Two possibilities: <!ELEMENT calendar-multiget (DAV:allprop | DAV:propname | DAV:prop)? calendar-data? DAV:href+> <!ELEMENT calendar-query (DAV:allprop | DAV:propname | DAV:prop)? calendar-data? filter> */ /* First try for a property request */ PropFindMethod.PropRequest pr = pm.tryPropRequest(curnode); if (pr != null) { if (preq != null) { if (debug) { trace("REPORT: preq not null"); } throw new WebdavBadRequest(); } preq = pr; } else if (nodeMatches(curnode, CaldavTags.calendarData)) { if (caldata != null) { if (debug) { trace("REPORT: caldata not null"); } throw new WebdavBadRequest(); } caldata = new CalendarData(debug); caldata.parse(curnode); } else if ((reportType == reportTypeQuery) && nodeMatches(curnode, CaldavTags.filter)) { if (filter != null) { if (debug) { trace("REPORT: filter not null"); } throw new WebdavBadRequest(); } filter = new Filter(intf, debug); int st = filter.parse(curnode); if (st != HttpServletResponse.SC_OK) { return st; } } else if ((reportType == reportTypeMultiGet) && nodeMatches(curnode, WebdavTags.href)) { String href = XmlUtil.getElementContent(curnode); if ((href == null) || (href.length() == 0)) { throw new WebdavBadRequest(); } if (hrefs == null) { hrefs = new ArrayList(); } hrefs.add(href); } else { if (debug) { trace("REPORT: unexpected element"); } throw new WebdavBadRequest(); } } } // Final validation if (reportType == reportTypeMultiGet) { if (hrefs == null) { // need at least 1 throw new WebdavBadRequest(); } } else if (reportType == reportTypeQuery) { if (caldata == null) { // same as empty element? caldata = new CalendarData(debug); } if (filter == null) { // filter required throw new WebdavBadRequest(); } } if (debug) { trace("REPORT: "); if (reportType == reportTypeFreeBusy) { trace("free-busy"); freeBusy.dump(); } else if (reportType == reportTypeQuery) { // Query - optional props + optional calendar data + filter if (caldata != null) { caldata.dump(); } else { trace("No caldata"); } filter.dump(); } else if (reportType == reportTypeMultiGet) { // Multi-get - optional props + optional calendar data + one or more hrefs if (caldata != null) { caldata.dump(); } else { trace("No caldata"); } Iterator it = hrefs.iterator(); while (it.hasNext()) { String href = (String)it.next(); trace(" <DAV:href>" + href + "</DAV:href>"); } } else { } } return HttpServletResponse.SC_OK; } catch (WebdavException wde) { throw wde; } catch (Throwable t) { System.err.println(t.getMessage()); if (debug) { t.printStackTrace(); } return HttpServletResponse.SC_INTERNAL_SERVER_ERROR; } }
private int processDoc(Document doc) throws WebdavException { try { WebdavNsIntf intf = getNsIntf(); Element root = doc.getDocumentElement(); /* Get hold of the PROPFIND method instance - we need it to process possible prop requests. */ PropFindMethod pm = (PropFindMethod)intf.findMethod( WebdavMethods.propFind); if (pm == null) { throw new WebdavException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } if (nodeMatches(root, CaldavTags.calendarQuery)) { reportType = reportTypeQuery; } else if (nodeMatches(root, CaldavTags.calendarMultiget)) { reportType = reportTypeMultiGet; } else if (nodeMatches(root, CaldavTags.freeBusyQuery)) { reportType = reportTypeFreeBusy; freeBusy = new FreeBusyQuery(intf, debug); } else if (nodeMatches(root, WebdavTags.expandProperty)) { reportType = reportTypeExpandProperty; } else { throw new WebdavBadRequest(); } Element[] children = getChildren(root); for (int i = 0; i < children.length; i++) { Element curnode = children[i]; /** The names come through looking something like A:allprop etc. */ String nm = curnode.getLocalName(); String ns = curnode.getNamespaceURI(); if (debug) { trace("reqtype: " + nm + " ns: " + ns); } if (reportType == reportTypeFreeBusy) { freeBusy.parse(curnode); } else if (reportType == reportTypeExpandProperty) { } else { /* Two possibilities: <!ELEMENT calendar-multiget (DAV:allprop | DAV:propname | DAV:prop)? calendar-data? DAV:href+> <!ELEMENT calendar-query (DAV:allprop | DAV:propname | DAV:prop)? calendar-data? filter> */ /* First try for a property request */ PropFindMethod.PropRequest pr = pm.tryPropRequest(curnode); if (pr != null) { if (preq != null) { if (debug) { trace("REPORT: preq not null"); } throw new WebdavBadRequest(); } preq = pr; } else if (nodeMatches(curnode, CaldavTags.calendarData)) { if (caldata != null) { if (debug) { trace("REPORT: caldata not null"); } throw new WebdavBadRequest(); } caldata = new CalendarData(debug); caldata.parse(curnode); } else if ((reportType == reportTypeQuery) && nodeMatches(curnode, CaldavTags.filter)) { if (filter != null) { if (debug) { trace("REPORT: filter not null"); } throw new WebdavBadRequest(); } filter = new Filter(intf, debug); int st = filter.parse(curnode); if (st != HttpServletResponse.SC_OK) { return st; } } else if ((reportType == reportTypeMultiGet) && nodeMatches(curnode, WebdavTags.href)) { String href = XmlUtil.getElementContent(curnode); if ((href == null) || (href.length() == 0)) { throw new WebdavBadRequest(); } if (hrefs == null) { hrefs = new ArrayList(); } hrefs.add(href); } else { if (debug) { trace("REPORT: unexpected element"); } throw new WebdavBadRequest(); } } } // Final validation if (reportType == reportTypeMultiGet) { if (hrefs == null) { // need at least 1 throw new WebdavBadRequest(); } } else if (reportType == reportTypeQuery) { if (caldata == null) { // same as empty element? caldata = new CalendarData(debug); } if (filter == null) { // filter required throw new WebdavBadRequest(); } } if (debug) { trace("REPORT: "); if (reportType == reportTypeFreeBusy) { trace("free-busy"); freeBusy.dump(); } else if (reportType == reportTypeQuery) { // Query - optional props + optional calendar data + filter if (caldata != null) { caldata.dump(); } else { trace("No caldata"); } filter.dump(); } else if (reportType == reportTypeMultiGet) { // Multi-get - optional props + optional calendar data + one or more hrefs if (caldata != null) { caldata.dump(); } else { trace("No caldata"); } Iterator it = hrefs.iterator(); while (it.hasNext()) { String href = (String)it.next(); trace(" <DAV:href>" + href + "</DAV:href>"); } } else { } } return HttpServletResponse.SC_OK; } catch (WebdavException wde) { throw wde; } catch (Throwable t) { System.err.println(t.getMessage()); if (debug) { t.printStackTrace(); } throw new WebdavException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } }
1,118,205
public static URL saveAsSac(LocalSeismogramImpl seis, File directory, Channel channel, EventAccessOperations event) throws IOException, NoPreferredOrigin, CodecException { SacTimeSeries sac; String seisFilename = ""; seisFilename = ChannelIdUtil.toStringNoDates(seis.channel_id); seisFilename.replace(' ', '.'); // check for space-space site File seisFile = new File(directory, seisFilename); int n =0; while (seisFile.exists()) { n++; seisFilename = ChannelIdUtil.toStringNoDates(seis.channel_id)+"."+n; seisFilename.replace(' ', '.'); // check for space-space site seisFile = new File(directory, seisFilename); } // end of while (seisFile.exists()) if (channel != null) { if (event != null) { sac = FissuresToSac.getSAC(seis, channel, event.get_preferred_origin()); } else { sac = FissuresToSac.getSAC(seis, channel); } } else { if (event != null) { sac = FissuresToSac.getSAC(seis, event.get_preferred_origin()); } else { sac = FissuresToSac.getSAC(seis); } } sac.write(seisFile); return seisFile.toURL(); }
public static URL saveAsSac(LocalSeismogramImpl seis, File directory, Channel channel, EventAccessOperations event) throws IOException, NoPreferredOrigin, CodecException { SacTimeSeries sac; String seisFilename = ""; seisFilename = ChannelIdUtil.toStringNoDates(seis.channel_id); seisFilename.replace(' ', '.'); // check for space-space site File seisFile = new File(directory, seisFilename); int n =0; while (seisFile.exists()) { n++; seisFilename = ChannelIdUtil.toStringNoDates(seis.channel_id)+"."+n; seisFilename.replace(' ', '.'); // check for space-space site seisFile = new File(directory, seisFilename); } // end of while (seisFile.exists()) if (channel != null) { if (event != null) { sac = FissuresToSac.getSAC(seis, channel, event.get_preferred_origin()); } else { sac = FissuresToSac.getSAC(seis, channel); } } else { if (event != null) { sac = FissuresToSac.getSAC(seis, event.get_preferred_origin()); } else { sac = FissuresToSac.getSAC(seis); } } sac.write(seisFile); return seisFile.toURL(); }
1,118,206
public static URL saveAsSac(LocalSeismogramImpl seis, File directory, Channel channel, EventAccessOperations event) throws IOException, NoPreferredOrigin, CodecException { SacTimeSeries sac; String seisFilename = ""; seisFilename = ChannelIdUtil.toStringNoDates(seis.channel_id); seisFilename.replace(' ', '.'); // check for space-space site File seisFile = new File(directory, seisFilename); int n =0; while (seisFile.exists()) { n++; seisFilename = ChannelIdUtil.toStringNoDates(seis.channel_id)+"."+n; seisFilename.replace(' ', '.'); // check for space-space site seisFile = new File(directory, seisFilename); } // end of while (seisFile.exists()) if (channel != null) { if (event != null) { sac = FissuresToSac.getSAC(seis, channel, event.get_preferred_origin()); } else { sac = FissuresToSac.getSAC(seis, channel); } } else { if (event != null) { sac = FissuresToSac.getSAC(seis, event.get_preferred_origin()); } else { sac = FissuresToSac.getSAC(seis); } } sac.write(seisFile); return seisFile.toURL(); }
public static URL saveAsSac(LocalSeismogramImpl seis, File directory, Channel channel, EventAccessOperations event) throws IOException, NoPreferredOrigin, CodecException { SacTimeSeries sac; String seisFilename = ""; seisFilename = ChannelIdUtil.toStringNoDates(seis.channel_id); seisFilename.replace(' ', '.'); // check for space-space site File seisFile = new File(directory, seisFilename); int n =0; while (seisFile.exists()) { n++; seisFilename = ChannelIdUtil.toStringNoDates(seis.channel_id)+"."+n; seisFilename.replace(' ', '.'); // check for space-space site seisFile = new File(directory, seisFilename); } // end of while (seisFile.exists()) if (channel != null) { if (event != null) { sac = FissuresToSac.getSAC(seis, channel, event.get_preferred_origin()); } else { sac = FissuresToSac.getSAC(seis, channel); } } else { if (event != null) { sac = FissuresToSac.getSAC(seis, event.get_preferred_origin()); } else { sac = FissuresToSac.getSAC(seis); } } sac.write(seisFile); return seisFile.toURL(); }
1,118,207
private URL appendParameters(URL url, Map<String, String> additionalParams) throws UnsupportedEncodingException, MalformedURLException { // get the request encoding HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); String encoding = request.getCharacterEncoding(); // not found, fallback to UTF-8 if (encoding == null) encoding = "UTF-8"; logger.debug("Original URL: " + url.toExternalForm()); String queryString = url.getQuery(); String path = url.getPath(); logger.debug("Original path: " + path); logger.debug("Original query string: " + queryString); Map<String, List<String>> params = parseParameters(queryString); // merge new parameters for (Entry<String, String> entry : additionalParams.entrySet()) { List<String> values = new ArrayList<String>(1); values.add(entry.getValue()); params.put(entry.getKey(), values); } // convert to query string StringBuilder queryBuf = new StringBuilder(); for (Entry<String, List<String>> entry : params.entrySet()) { String key = entry.getKey(); for (String value : entry.getValue()) { if (queryBuf.length() > 0) { queryBuf.append("&"); } queryBuf.append(URLEncoder.encode(key, encoding)); queryBuf.append("="); queryBuf.append(URLEncoder.encode(value, encoding)); } } queryString = queryBuf.toString(); if (queryString.length() > 0) path += "?" + queryString; logger.debug("New query string: " + queryString); URL result = new URL(url.getProtocol(), url.getHost(), url.getPort(), path); logger.debug("New URL: " + result); return result; }
private URL appendParameters(URL url, Map<String, String> additionalParams) throws UnsupportedEncodingException, MalformedURLException { // get the request encoding HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); String encoding = request.getCharacterEncoding(); // not found, fallback to UTF-8 if (encoding == null) encoding = "UTF-8"; String queryString = url.getQuery(); String path = url.getPath(); logger.debug("Original path: " + path); logger.debug("Original query string: " + queryString); Map<String, List<String>> params = parseParameters(queryString); // merge new parameters for (Entry<String, String> entry : additionalParams.entrySet()) { List<String> values = new ArrayList<String>(1); values.add(entry.getValue()); params.put(entry.getKey(), values); } // convert to query string StringBuilder queryBuf = new StringBuilder(); for (Entry<String, List<String>> entry : params.entrySet()) { String key = entry.getKey(); for (String value : entry.getValue()) { if (queryBuf.length() > 0) { queryBuf.append("&"); } queryBuf.append(URLEncoder.encode(key, encoding)); queryBuf.append("="); queryBuf.append(URLEncoder.encode(value, encoding)); } } queryString = queryBuf.toString(); if (queryString.length() > 0) path += "?" + queryString; logger.debug("New query string: " + queryString); URL result = new URL(url.getProtocol(), url.getHost(), url.getPort(), path); logger.debug("New URL: " + result); return result; }
1,118,208
private URL appendParameters(URL url, Map<String, String> additionalParams) throws UnsupportedEncodingException, MalformedURLException { // get the request encoding HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); String encoding = request.getCharacterEncoding(); // not found, fallback to UTF-8 if (encoding == null) encoding = "UTF-8"; logger.debug("Original URL: " + url.toExternalForm()); String queryString = url.getQuery(); String path = url.getPath(); logger.debug("Original path: " + path); logger.debug("Original query string: " + queryString); Map<String, List<String>> params = parseParameters(queryString); // merge new parameters for (Entry<String, String> entry : additionalParams.entrySet()) { List<String> values = new ArrayList<String>(1); values.add(entry.getValue()); params.put(entry.getKey(), values); } // convert to query string StringBuilder queryBuf = new StringBuilder(); for (Entry<String, List<String>> entry : params.entrySet()) { String key = entry.getKey(); for (String value : entry.getValue()) { if (queryBuf.length() > 0) { queryBuf.append("&"); } queryBuf.append(URLEncoder.encode(key, encoding)); queryBuf.append("="); queryBuf.append(URLEncoder.encode(value, encoding)); } } queryString = queryBuf.toString(); if (queryString.length() > 0) path += "?" + queryString; logger.debug("New query string: " + queryString); URL result = new URL(url.getProtocol(), url.getHost(), url.getPort(), path); logger.debug("New URL: " + result); return result; }
private URL appendParameters(URL url, Map<String, String> additionalParams) throws UnsupportedEncodingException, MalformedURLException { // get the request encoding HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); String encoding = request.getCharacterEncoding(); // not found, fallback to UTF-8 if (encoding == null) encoding = "UTF-8"; logger.debug("Original URL: " + url.toExternalForm()); String queryString = url.getQuery(); String path = url.getPath(); logger.debug("Original path: " + path); logger.debug("Original query string: " + queryString); Map<String, List<String>> params = parseParameters(queryString); // merge new parameters for (Entry<String, String> entry : additionalParams.entrySet()) { List<String> values = new ArrayList<String>(1); values.add(entry.getValue()); params.put(entry.getKey(), values); } // convert to query string StringBuilder queryBuf = new StringBuilder(); for (Entry<String, List<String>> entry : params.entrySet()) { String key = entry.getKey(); for (String value : entry.getValue()) { if (queryBuf.length() > 0) { queryBuf.append("&"); } queryBuf.append(URLEncoder.encode(key, encoding)); queryBuf.append("="); queryBuf.append(URLEncoder.encode(value, encoding)); } } queryString = queryBuf.toString(); if (queryString.length() > 0) path += "?" + queryString; logger.debug("New query string: " + queryString); URL result = new URL(url.getProtocol(), url.getHost(), url.getPort(), path); logger.debug("New URL: " + result); return result; }
1,118,209
private URL appendParameters(URL url, Map<String, String> additionalParams) throws UnsupportedEncodingException, MalformedURLException { // get the request encoding HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); String encoding = request.getCharacterEncoding(); // not found, fallback to UTF-8 if (encoding == null) encoding = "UTF-8"; logger.debug("Original URL: " + url.toExternalForm()); String queryString = url.getQuery(); String path = url.getPath(); logger.debug("Original path: " + path); logger.debug("Original query string: " + queryString); Map<String, List<String>> params = parseParameters(queryString); // merge new parameters for (Entry<String, String> entry : additionalParams.entrySet()) { List<String> values = new ArrayList<String>(1); values.add(entry.getValue()); params.put(entry.getKey(), values); } // convert to query string StringBuilder queryBuf = new StringBuilder(); for (Entry<String, List<String>> entry : params.entrySet()) { String key = entry.getKey(); for (String value : entry.getValue()) { if (queryBuf.length() > 0) { queryBuf.append("&"); } queryBuf.append(URLEncoder.encode(key, encoding)); queryBuf.append("="); queryBuf.append(URLEncoder.encode(value, encoding)); } } queryString = queryBuf.toString(); if (queryString.length() > 0) path += "?" + queryString; logger.debug("New query string: " + queryString); URL result = new URL(url.getProtocol(), url.getHost(), url.getPort(), path); logger.debug("New URL: " + result); return result; }
private URL appendParameters(URL url, Map<String, String> additionalParams) throws UnsupportedEncodingException, MalformedURLException { // get the request encoding HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); String encoding = request.getCharacterEncoding(); // not found, fallback to UTF-8 if (encoding == null) encoding = "UTF-8"; logger.debug("Original URL: " + url.toExternalForm()); String queryString = url.getQuery(); String path = url.getPath(); logger.debug("Original path: " + path); logger.debug("Original query string: " + queryString); Map<String, List<String>> params = parseParameters(queryString); // merge new parameters for (Entry<String, String> entry : additionalParams.entrySet()) { List<String> values = new ArrayList<String>(1); values.add(entry.getValue()); params.put(entry.getKey(), values); } // convert to query string StringBuilder queryBuf = new StringBuilder(); for (Entry<String, List<String>> entry : params.entrySet()) { String key = entry.getKey(); for (String value : entry.getValue()) { if (queryBuf.length() > 0) { queryBuf.append("&"); } queryBuf.append(URLEncoder.encode(key, encoding)); queryBuf.append("="); queryBuf.append(URLEncoder.encode(value, encoding)); } } queryString = queryBuf.toString(); if (queryString.length() > 0) path += "?" + queryString; URL result = new URL(url.getProtocol(), url.getHost(), url.getPort(), path); logger.debug("New URL: " + result); return result; }
1,118,210
private URL appendParameters(URL url, Map<String, String> additionalParams) throws UnsupportedEncodingException, MalformedURLException { // get the request encoding HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); String encoding = request.getCharacterEncoding(); // not found, fallback to UTF-8 if (encoding == null) encoding = "UTF-8"; logger.debug("Original URL: " + url.toExternalForm()); String queryString = url.getQuery(); String path = url.getPath(); logger.debug("Original path: " + path); logger.debug("Original query string: " + queryString); Map<String, List<String>> params = parseParameters(queryString); // merge new parameters for (Entry<String, String> entry : additionalParams.entrySet()) { List<String> values = new ArrayList<String>(1); values.add(entry.getValue()); params.put(entry.getKey(), values); } // convert to query string StringBuilder queryBuf = new StringBuilder(); for (Entry<String, List<String>> entry : params.entrySet()) { String key = entry.getKey(); for (String value : entry.getValue()) { if (queryBuf.length() > 0) { queryBuf.append("&"); } queryBuf.append(URLEncoder.encode(key, encoding)); queryBuf.append("="); queryBuf.append(URLEncoder.encode(value, encoding)); } } queryString = queryBuf.toString(); if (queryString.length() > 0) path += "?" + queryString; logger.debug("New query string: " + queryString); URL result = new URL(url.getProtocol(), url.getHost(), url.getPort(), path); logger.debug("New URL: " + result); return result; }
private URL appendParameters(URL url, Map<String, String> additionalParams) throws UnsupportedEncodingException, MalformedURLException { // get the request encoding HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); String encoding = request.getCharacterEncoding(); // not found, fallback to UTF-8 if (encoding == null) encoding = "UTF-8"; logger.debug("Original URL: " + url.toExternalForm()); String queryString = url.getQuery(); String path = url.getPath(); logger.debug("Original path: " + path); logger.debug("Original query string: " + queryString); Map<String, List<String>> params = parseParameters(queryString); // merge new parameters for (Entry<String, String> entry : additionalParams.entrySet()) { List<String> values = new ArrayList<String>(1); values.add(entry.getValue()); params.put(entry.getKey(), values); } // convert to query string StringBuilder queryBuf = new StringBuilder(); for (Entry<String, List<String>> entry : params.entrySet()) { String key = entry.getKey(); for (String value : entry.getValue()) { if (queryBuf.length() > 0) { queryBuf.append("&"); } queryBuf.append(URLEncoder.encode(key, encoding)); queryBuf.append("="); queryBuf.append(URLEncoder.encode(value, encoding)); } } queryString = queryBuf.toString(); if (queryString.length() > 0) path += "?" + queryString; logger.debug("New query string: " + queryString); URL result = new URL(url.getProtocol(), url.getHost(), url.getPort(), path); return result; }
1,118,211
public int doEndTag() throws JspException { try { JspWriter out = pageContext.getOut(); // get locale-specific stuff locale = getDefaultLocale(); if (resourceBundle == null) resourceBundle = getDefaultResourceBundle(); if (timeZone == null) timeZone = getDefaultTimeZone(); if (dateFormatSymbols == null) dateFormatSymbols = getDefaultDateFormatSymbols(); Date currentTime = new Date(); Calendar selected = null; if (selectedDate != null) { selected = Calendar.getInstance(timeZone, locale); selected.setTime(selectedDate); } if (showDate == null) showDate = new Date(currentTime.getTime()); Calendar now = Calendar.getInstance(timeZone, locale); now.setTime(currentTime); Calendar current = Calendar.getInstance(timeZone, locale); current.setTime(showDate); out.print("<table"); if (outerId != null) { out.print(" id=\""); out.print(encodeAttribute(outerId)); out.print("\""); } if (outerClass != null) { out.print(" class=\""); out.print(encodeAttribute(outerClass)); out.print("\""); } out.print(">"); if (captionVisible) { logger.debug("Prev link: " + prevLink); logger.debug("Next link: " + nextLink); if (prevLink == null) prevLink = getDefaultPrevLink(current); if (nextLink == null) nextLink = getDefaultNextLink(current); out.print("<caption>"); renderPrevLink(out); renderCaption(out, current); renderNextLink(out); out.print("</caption>"); } out.print("<thead>"); renderHead(out); out.print("</thead>"); out.print("<tbody>"); // render cells current.set(Calendar.DAY_OF_MONTH, 1); // get last day of month current.add(Calendar.MONTH, 1); current.set(Calendar.DAY_OF_MONTH, 1); current.add(Calendar.DAY_OF_MONTH, -1); int endDay = current.get(Calendar.DAY_OF_MONTH); // go to first day of month current.set(Calendar.DAY_OF_MONTH, 1); int col = 0; out.print("<tr>"); int firstDow = current.getFirstDayOfWeek(); for (int i = 1; i <= endDay; i++) { int dow = current.get(Calendar.DAY_OF_WEEK); if (col == 7) { col = 0; out.print("</tr>"); out.print("<tr>"); } if (i == 1) { // populate first row with empty cells int skipDays = (dow + 7 - firstDow) % 7; // should always give 0..6 for (int j = 0; j < skipDays; j++) { renderEmptyDay(out, (firstDow + j) % 7); col++; } } // add current day col++; renderDay(out, current, dow, isSameDay(current, now), isSameDay(current, selected)); if (i == endDay) { // populate last row with empty cells while (col < 7) { current.add(Calendar.DAY_OF_MONTH, 1); renderEmptyDay(out, current.get(Calendar.DAY_OF_WEEK)); col++; } } // move to next day current.add(Calendar.DAY_OF_MONTH, 1); } out.print("</tr>"); out.print("</tbody>"); out.print("</table>"); return EVAL_PAGE; } catch (IOException e) { throw new JspException(e); } finally { cleanup(); } }
public int doEndTag() throws JspException { try { JspWriter out = pageContext.getOut(); // get locale-specific stuff locale = getDefaultLocale(); if (resourceBundle == null) resourceBundle = getDefaultResourceBundle(); if (timeZone == null) timeZone = getDefaultTimeZone(); if (dateFormatSymbols == null) dateFormatSymbols = getDefaultDateFormatSymbols(); Date currentTime = new Date(); Calendar selected = null; if (selectedDate != null) { selected = Calendar.getInstance(timeZone, locale); selected.setTime(selectedDate); } if (showDate == null) showDate = new Date(currentTime.getTime()); Calendar now = Calendar.getInstance(timeZone, locale); now.setTime(currentTime); Calendar current = Calendar.getInstance(timeZone, locale); current.setTime(showDate); out.print("<table"); if (outerId != null) { out.print(" id=\""); out.print(encodeAttribute(outerId)); out.print("\""); } if (outerClass != null) { out.print(" class=\""); out.print(encodeAttribute(outerClass)); out.print("\""); } out.print(">"); if (captionVisible) { logger.debug("Prev link: " + prevLink); logger.debug("Next link: " + nextLink); if (prevLink == null) prevLink = getDefaultPrevLink(current); if (nextLink == null) nextLink = getDefaultNextLink(current); out.print("<caption>"); renderPrevLink(out); renderCaption(out, current); renderNextLink(out); out.print("</caption>"); } out.print("<thead>"); renderHead(out); out.print("</thead>"); out.print("<tbody>"); // render cells current.set(Calendar.DAY_OF_MONTH, 1); // get last day of month current.add(Calendar.MONTH, 1); current.set(Calendar.DAY_OF_MONTH, 1); current.add(Calendar.DAY_OF_MONTH, -1); int endDay = current.get(Calendar.DAY_OF_MONTH); // go to first day of month current.set(Calendar.DAY_OF_MONTH, 1); int col = 0; out.print("<tr>"); int firstDow = current.getFirstDayOfWeek(); for (int i = 1; i <= endDay; i++) { int dow = current.get(Calendar.DAY_OF_WEEK); if (col == 7) { col = 0; out.print("</tr>"); out.print("<tr>"); } if (i == 1) { // populate first row with empty cells int skipDays = (dow + 7 - firstDow) % 7; // should always give 0..6 for (int j = 0; j < skipDays; j++) { renderEmptyDay(out, (firstDow + j) % 7); col++; } } // add current day col++; renderDay(out, current, dow, isSameDay(current, now), isSameDay(current, selected)); if (i == endDay) { // populate last row with empty cells while (col < 7) { current.add(Calendar.DAY_OF_MONTH, 1); renderEmptyDay(out, current.get(Calendar.DAY_OF_WEEK)); col++; } } // move to next day current.add(Calendar.DAY_OF_MONTH, 1); } out.print("</tr>"); out.print("</tbody>"); out.print("</table>"); return EVAL_PAGE; } catch (IOException e) { throw new JspException(e); } finally { cleanup(); } }
1,118,212
private URL getCurrentUrl(HttpServletRequest request) throws MalformedURLException { StringBuilder buf = new StringBuilder(); String scheme = request.getScheme(); int port = request.getServerPort(); buf.append(scheme); buf.append("://"); buf.append(request.getServerName()); if ("http".equals(scheme) && port == 80) { // do nothing } else if ("https".equals(scheme) && port == 443) { // do nothing } else if (port < 0) { // do nothing } else { buf.append(":"); DecimalFormat dfPort = new DecimalFormat("#####"); buf.append(dfPort.format(port)); } String forwardUri = (String) request.getAttribute(REQUEST_URI_ATTRIBUTE); if (forwardUri == null) { // use old style method String contextPath = request.getContextPath(); if (contextPath != null) buf.append(contextPath); String servletPath = request.getServletPath(); if (servletPath != null) buf.append(servletPath); String pathInfo = request.getPathInfo(); if (pathInfo != null) buf.append(pathInfo); String queryString = request.getQueryString(); if (queryString != null && queryString.length() > 0) { if (!('?' == queryString.charAt(0))) buf.append("?"); buf.append(queryString); } } else { // use forwarded attributes buf.append(forwardUri); String queryString = (String) request.getAttribute(QUERY_STRING_ATTRIBUTE); if (queryString != null && queryString.length() > 0) { if (!('?' == queryString.charAt(0))) buf.append("?"); buf.append(queryString); } } logger.debug("request_uri: " + request.getAttribute("javax.servlet.forward.request_uri")); logger.debug("context_path: " + request.getAttribute("javax.servlet.forward.context_path")); logger.debug("servlet_path: " + request.getAttribute("javax.servlet.forward.servlet_path")); logger.debug("path_info: " + request.getAttribute("javax.servlet.forward.path_info")); logger.debug("query_string: " + request.getAttribute("javax.servlet.forward.query_string")); logger.debug(""); logger.debug("request.requestURI: " + request.getRequestURI()); logger.debug("request.contextPath: " + request.getContextPath()); logger.debug("request.servletPath: " + request.getServletPath()); logger.debug("request.pathInfo: " + request.getPathInfo()); logger.debug("request.queryString: " + request.getQueryString()); logger.debug("parameters:"); Enumeration parameterNames = request.getParameterNames(); while (parameterNames.hasMoreElements()) { String parameterName = (String) parameterNames.nextElement(); String[] parameterValues = request.getParameterValues(parameterName); for (String parameterValue : parameterValues) { logger.debug(" " + parameterName + "=" + parameterValue); } } String name = buf.toString(); logger.debug("Current URL: " + name); return new URL(name); }
private URL getCurrentUrl(HttpServletRequest request) throws MalformedURLException { StringBuilder buf = new StringBuilder(); String scheme = request.getScheme(); int port = request.getServerPort(); buf.append(scheme); buf.append("://"); buf.append(request.getServerName()); if ("http".equals(scheme) && port == 80) { // do nothing } else if ("https".equals(scheme) && port == 443) { // do nothing } else if (port < 0) { // do nothing } else { buf.append(":"); DecimalFormat dfPort = new DecimalFormat("#####"); buf.append(dfPort.format(port)); } String forwardUri = (String) request.getAttribute(REQUEST_URI_ATTRIBUTE); if (forwardUri == null) { // use old style method String contextPath = request.getContextPath(); if (contextPath != null) buf.append(contextPath); String servletPath = request.getServletPath(); if (servletPath != null) buf.append(servletPath); String pathInfo = request.getPathInfo(); if (pathInfo != null) buf.append(pathInfo); String queryString = request.getQueryString(); if (queryString != null && queryString.length() > 0) { if (!('?' == queryString.charAt(0))) buf.append("?"); buf.append(queryString); } } else { // use forwarded attributes buf.append(forwardUri); String queryString = (String) request.getAttribute(QUERY_STRING_ATTRIBUTE); if (queryString != null && queryString.length() > 0) { if (!('?' == queryString.charAt(0))) buf.append("?"); buf.append(queryString); } } logger.debug("request_uri: " + request.getAttribute("javax.servlet.forward.request_uri")); logger.debug("context_path: " + request.getAttribute("javax.servlet.forward.context_path")); logger.debug("servlet_path: " + request.getAttribute("javax.servlet.forward.servlet_path")); logger.debug("path_info: " + request.getAttribute("javax.servlet.forward.path_info")); logger.debug("query_string: " + request.getAttribute("javax.servlet.forward.query_string")); logger.debug(""); logger.debug("request.requestURI: " + request.getRequestURI()); logger.debug("request.contextPath: " + request.getContextPath()); logger.debug("request.servletPath: " + request.getServletPath()); logger.debug("request.pathInfo: " + request.getPathInfo()); logger.debug("request.queryString: " + request.getQueryString()); logger.debug("parameters:"); Enumeration parameterNames = request.getParameterNames(); while (parameterNames.hasMoreElements()) { String parameterName = (String) parameterNames.nextElement(); String[] parameterValues = request.getParameterValues(parameterName); for (String parameterValue : parameterValues) { logger.debug(" " + parameterName + "=" + parameterValue); } } String name = buf.toString(); logger.debug("Current URL: " + name); return new URL(name); }
1,118,213
private URL getCurrentUrl(HttpServletRequest request) throws MalformedURLException { StringBuilder buf = new StringBuilder(); String scheme = request.getScheme(); int port = request.getServerPort(); buf.append(scheme); buf.append("://"); buf.append(request.getServerName()); if ("http".equals(scheme) && port == 80) { // do nothing } else if ("https".equals(scheme) && port == 443) { // do nothing } else if (port < 0) { // do nothing } else { buf.append(":"); DecimalFormat dfPort = new DecimalFormat("#####"); buf.append(dfPort.format(port)); } String forwardUri = (String) request.getAttribute(REQUEST_URI_ATTRIBUTE); if (forwardUri == null) { // use old style method String contextPath = request.getContextPath(); if (contextPath != null) buf.append(contextPath); String servletPath = request.getServletPath(); if (servletPath != null) buf.append(servletPath); String pathInfo = request.getPathInfo(); if (pathInfo != null) buf.append(pathInfo); String queryString = request.getQueryString(); if (queryString != null && queryString.length() > 0) { if (!('?' == queryString.charAt(0))) buf.append("?"); buf.append(queryString); } } else { // use forwarded attributes buf.append(forwardUri); String queryString = (String) request.getAttribute(QUERY_STRING_ATTRIBUTE); if (queryString != null && queryString.length() > 0) { if (!('?' == queryString.charAt(0))) buf.append("?"); buf.append(queryString); } } logger.debug("request_uri: " + request.getAttribute("javax.servlet.forward.request_uri")); logger.debug("context_path: " + request.getAttribute("javax.servlet.forward.context_path")); logger.debug("servlet_path: " + request.getAttribute("javax.servlet.forward.servlet_path")); logger.debug("path_info: " + request.getAttribute("javax.servlet.forward.path_info")); logger.debug("query_string: " + request.getAttribute("javax.servlet.forward.query_string")); logger.debug(""); logger.debug("request.requestURI: " + request.getRequestURI()); logger.debug("request.contextPath: " + request.getContextPath()); logger.debug("request.servletPath: " + request.getServletPath()); logger.debug("request.pathInfo: " + request.getPathInfo()); logger.debug("request.queryString: " + request.getQueryString()); logger.debug("parameters:"); Enumeration parameterNames = request.getParameterNames(); while (parameterNames.hasMoreElements()) { String parameterName = (String) parameterNames.nextElement(); String[] parameterValues = request.getParameterValues(parameterName); for (String parameterValue : parameterValues) { logger.debug(" " + parameterName + "=" + parameterValue); } } String name = buf.toString(); logger.debug("Current URL: " + name); return new URL(name); }
private URL getCurrentUrl(HttpServletRequest request) throws MalformedURLException { StringBuilder buf = new StringBuilder(); String scheme = request.getScheme(); int port = request.getServerPort(); buf.append(scheme); buf.append("://"); buf.append(request.getServerName()); if ("http".equals(scheme) && port == 80) { // do nothing } else if ("https".equals(scheme) && port == 443) { // do nothing } else if (port < 0) { // do nothing } else { buf.append(":"); DecimalFormat dfPort = new DecimalFormat("#####"); buf.append(dfPort.format(port)); } String forwardUri = (String) request.getAttribute(REQUEST_URI_ATTRIBUTE); if (forwardUri == null) { // use old style method String contextPath = request.getContextPath(); if (contextPath != null) buf.append(contextPath); String servletPath = request.getServletPath(); if (servletPath != null) buf.append(servletPath); String pathInfo = request.getPathInfo(); if (pathInfo != null) buf.append(pathInfo); String queryString = request.getQueryString(); if (queryString != null && queryString.length() > 0) { if (!('?' == queryString.charAt(0))) buf.append("?"); buf.append(queryString); } } else { // use forwarded attributes buf.append(forwardUri); String queryString = (String) request.getAttribute(QUERY_STRING_ATTRIBUTE); if (queryString != null && queryString.length() > 0) { if (!('?' == queryString.charAt(0))) buf.append("?"); buf.append(queryString); } } logger.debug("request_uri: " + request.getAttribute("javax.servlet.forward.request_uri")); logger.debug("context_path: " + request.getAttribute("javax.servlet.forward.context_path")); logger.debug("servlet_path: " + request.getAttribute("javax.servlet.forward.servlet_path")); logger.debug("path_info: " + request.getAttribute("javax.servlet.forward.path_info")); logger.debug("query_string: " + request.getAttribute("javax.servlet.forward.query_string")); logger.debug(""); logger.debug("request.requestURI: " + request.getRequestURI()); logger.debug("request.contextPath: " + request.getContextPath()); logger.debug("request.servletPath: " + request.getServletPath()); logger.debug("request.pathInfo: " + request.getPathInfo()); logger.debug("request.queryString: " + request.getQueryString()); logger.debug("parameters:"); Enumeration parameterNames = request.getParameterNames(); while (parameterNames.hasMoreElements()) { String parameterName = (String) parameterNames.nextElement(); String[] parameterValues = request.getParameterValues(parameterName); for (String parameterValue : parameterValues) { logger.debug(" " + parameterName + "=" + parameterValue); } } String name = buf.toString(); return new URL(name); }
1,118,214
private String getDefaultNextLink(Calendar current) throws MalformedURLException, UnsupportedEncodingException { logger.debug("next link, month=" + current.get(Calendar.MONTH)); Calendar nextCal = Calendar.getInstance(timeZone, locale); nextCal.setTime(current.getTime()); nextCal.add(Calendar.MONTH, 1); return getDefaultNavLink(nextCal); }
private String getDefaultNextLink(Calendar current) throws MalformedURLException, UnsupportedEncodingException { Calendar nextCal = Calendar.getInstance(timeZone, locale); nextCal.setTime(current.getTime()); nextCal.add(Calendar.MONTH, 1); return getDefaultNavLink(nextCal); }
1,118,215
private String getDefaultPrevLink(Calendar current) throws MalformedURLException, UnsupportedEncodingException { logger.debug("prev link, month=" + current.get(Calendar.MONTH)); Calendar prevCal = Calendar.getInstance(timeZone, locale); prevCal.setTime(current.getTime()); prevCal.add(Calendar.MONTH, -1); return getDefaultNavLink(prevCal); }
private String getDefaultPrevLink(Calendar current) throws MalformedURLException, UnsupportedEncodingException { Calendar prevCal = Calendar.getInstance(timeZone, locale); prevCal.setTime(current.getTime()); prevCal.add(Calendar.MONTH, -1); return getDefaultNavLink(prevCal); }
1,118,216
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; int calId = getIntReqPar(request, "calId", -1); if (calId >= 0) { cal = svci.getCalendar(calId); } if (cal == null) { form.getErr().emit("org.bedework.client.error.missingcalendar"); return null; } FormFile upFile = form.getUploadFile(); if (upFile == null) { // Just forget it return "success"; } String fileName = upFile.getFileName(); if ((fileName == null) || (fileName.length() == 0)) { return null; } InputStream is = upFile.getInputStream(); IcalTranslator trans = new IcalTranslator(svci.getIcalCallback(), debug); Collection objs = trans.fromIcal(cal, new InputStreamReader(is)); Iterator it = objs.iterator(); while (it.hasNext()) { Object o = it.next(); if (o instanceof EventInfo) { EventInfo ei = (EventInfo)o; BwEvent ev = ei.getEvent(); if (ei.getNewEvent()) { svci.addEvent(cal, ev, ei.getOverrides()); } else { svci.updateEvent(ev); } } } form.getMsg().emit("org.bedework.client.message.event.added"); return "success"; }
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; int calId = getIntReqPar(request, "calId", -1); if (calId >= 0) { cal = svci.getCalendar(calId); } if (cal == null) { form.getErr().emit("org.bedework.client.error.missingcalendar"); return null; } FormFile upFile = form.getUploadFile(); if (upFile == null) { // Just forget it return "success"; } String fileName = upFile.getFileName(); if ((fileName == null) || (fileName.length() == 0)) { return null; } InputStream is = upFile.getInputStream(); IcalTranslator trans = new IcalTranslator(svci.getIcalCallback(), debug); Collection objs = trans.fromIcal(cal, new InputStreamReader(is)); Iterator it = objs.iterator(); while (it.hasNext()) { Object o = it.next(); if (o instanceof EventInfo) { EventInfo ei = (EventInfo)o; BwEvent ev = ei.getEvent(); if (ei.getNewEvent()) { svci.addEvent(cal, ev, ei.getOverrides()); } else { svci.updateEvent(ev); } } } form.getMsg().emit("org.bedework.client.message.event.added"); return "success"; }
1,118,217
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; int calId = getIntReqPar(request, "calId", -1); if (calId >= 0) { cal = svci.getCalendar(calId); } if (cal == null) { form.getErr().emit("org.bedework.client.error.missingcalendar"); return null; } FormFile upFile = form.getUploadFile(); if (upFile == null) { // Just forget it return "success"; } String fileName = upFile.getFileName(); if ((fileName == null) || (fileName.length() == 0)) { return null; } InputStream is = upFile.getInputStream(); IcalTranslator trans = new IcalTranslator(svci.getIcalCallback(), debug); Collection objs = trans.fromIcal(cal, new InputStreamReader(is)); Iterator it = objs.iterator(); while (it.hasNext()) { Object o = it.next(); if (o instanceof EventInfo) { EventInfo ei = (EventInfo)o; BwEvent ev = ei.getEvent(); if (ei.getNewEvent()) { svci.addEvent(cal, ev, ei.getOverrides()); } else { svci.updateEvent(ev); } } } form.getMsg().emit("org.bedework.client.message.event.added"); return "success"; }
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; int calId = getIntReqPar(request, "calId", -1); if (calId >= 0) { cal = svci.getCalendar(calId); } if (cal == null) { form.getErr().emit("org.bedework.client.error.missingcalendar"); return "retry"; } FormFile upFile = form.getUploadFile(); if (upFile == null) { // Just forget it return "success"; } String fileName = upFile.getFileName(); if ((fileName == null) || (fileName.length() == 0)) { return "retry"; } InputStream is = upFile.getInputStream(); IcalTranslator trans = new IcalTranslator(svci.getIcalCallback(), debug); Collection objs = trans.fromIcal(cal, new InputStreamReader(is)); Iterator it = objs.iterator(); while (it.hasNext()) { Object o = it.next(); if (o instanceof EventInfo) { EventInfo ei = (EventInfo)o; BwEvent ev = ei.getEvent(); if (ei.getNewEvent()) { svci.addEvent(cal, ev, ei.getOverrides()); } else { svci.updateEvent(ev); } } } form.getMsg().emit("org.bedework.client.message.event.added"); return "success"; }
1,118,218
public TimeRangeConfig getInternalConfig(){ System.out.println(internalTimeConfig.getTimeRange().getBeginTime()); return internalTimeConfig; }
public TimeRangeConfig getInternalConfig(){ System.out.println(internalTimeConfig.getTimeRange().getBeginTime()); return internalTimeConfig; }
1,118,219
public Shape draw(Dimension size){ if(visible){ MicroSecondTimeRange overTimeRange = timeRegistrar.getTimeRange(). getOversizedTimeRange(BasicSeismogramDisplay.OVERSIZED_SCALE); if(flagTime.before(overTimeRange.getBeginTime()) || flagTime.after(overTimeRange.getEndTime())) return null; double offset = flagTime.difference(overTimeRange.getBeginTime()).getValue()/overTimeRange.getInterval().getValue(); location = (int)(offset * (double)size.width); Area pole = new Area(new Rectangle(location, 0, 1, size.height)); Area flag = new Area(new Rectangle(location, 0, name.length() * 12, 13)); flag.add(pole); return flag; } return null; }
public Shape draw(Dimension size){ if(visible){ MicroSecondTimeRange overTimeRange = timeRegistrar.getTimeRange(). getOversizedTimeRange(BasicSeismogramDisplay.OVERSIZED_SCALE); if(flagTime.before(overTimeRange.getBeginTime()) || flagTime.after(overTimeRange.getEndTime())) return new GeneralPath(); double offset = flagTime.difference(overTimeRange.getBeginTime()).getValue()/overTimeRange.getInterval().getValue(); location = (int)(offset * (double)size.width); Area pole = new Area(new Rectangle(location, 0, 1, size.height)); Area flag = new Area(new Rectangle(location, 0, name.length() * 12, 13)); flag.add(pole); return flag; } return new GeneralPath(); }
1,118,220
public void lookupResolved(NamedElement resolution) { if (resolution instanceof Classifier){ mySubject.getClassifiers().add(resolution); } }
public void lookupResolved(NamedElement resolution) { if (resolution instanceof Classifier){ mySubject.getClassifiers().add((Classifier)resolution); } }
1,118,222
public static LocalSeismogram removeMean(LocalSeismogram seis){ if(seismo.can_convert_to_float()){ float[] fSeries = seis.get_as_floats(); return new LocalSeismogramImpl(seis, removeMean(fSeries)); }else{ int[] iSeries = seismo.get_as_longs(); return new LocalSeismogramImpl(seis, removeMean(iSeries)); } }
public static LocalSeismogram removeMean(LocalSeismogram seis){ if(seismo.can_convert_to_float()){ float[] fSeries = seis.get_as_floats(); return new LocalSeismogramImpl(seis, removeMean(fSeries)); }else{ int[] iSeries = seismo.get_as_longs(); return new LocalSeismogramImpl(seis, removeMean(iSeries)); } }
1,118,223
public static LocalSeismogram removeMean(LocalSeismogram seis){ if(seismo.can_convert_to_float()){ float[] fSeries = seis.get_as_floats(); return new LocalSeismogramImpl(seis, removeMean(fSeries)); }else{ int[] iSeries = seismo.get_as_longs(); return new LocalSeismogramImpl(seis, removeMean(iSeries)); } }
public static LocalSeismogram removeMean(LocalSeismogram seis){ if(seismo.can_convert_to_float()){ float[] fSeries = seis.get_as_floats(); return new LocalSeismogramImpl(seis, removeMean(fSeries)); }else{ int[] iSeries = seismo.get_as_longs(); return new LocalSeismogramImpl(seis, removeMean(iSeries)); } }
1,118,224
protected static int[][] compressYvalues(LocalSeismogram seismogram, MicroSecondTimeRange tr, UnitRangeImpl ampRange, Dimension size)throws UnsupportedDataEncoding { int[][] uncomp = scaleXvalues(seismogram, tr, ampRange, size); // enough points to take the extra time to compress the line int[][] comp = new int[2][2 * size.width]; int j = 0, startIndex = 0, xvalue = 0, endIndex = 0; if(uncomp[0].length != 0) xvalue = uncomp[0][0]; for(int i = 0; i < uncomp[0].length; i++) { if(uncomp[0][i] != xvalue) { endIndex = i - 1; comp[1][j] = getMinValue(uncomp[1], startIndex, endIndex); comp[1][j+1] = (int)getMaxValue(uncomp[1], startIndex, endIndex); comp[0][j] = uncomp[0][i]; comp[0][j+1] = uncomp[0][i]; j = j + 2; startIndex = endIndex + 1; xvalue = uncomp[0][i]; } } comp[1][j] = getMinValue(uncomp[1], startIndex, endIndex); comp[1][j+1] = (int)getMaxValue(uncomp[1], startIndex, endIndex); comp[0][j] = uncomp[0][endIndex]; comp[0][j+1] = uncomp[0][endIndex]; return comp; }
protected static int[][] compressYvalues(LocalSeismogram seismogram, MicroSecondTimeRange tr, UnitRangeImpl ampRange, Dimension size)throws UnsupportedDataEncoding { int[][] uncomp = scaleXvalues(seismogram, tr, ampRange, size); // enough points to take the extra time to compress the line int[][] comp = new int[2][2 * size.width]; int j = 0, startIndex = 0, xvalue = 0, endIndex = 0; if(uncomp[0].length != 0) xvalue = uncomp[0][0]; for(int i = 0; i < uncomp[0].length; i++) { if(uncomp[0][i] != xvalue) { endIndex = i - 1; comp[1][j] = getMinValue(uncomp[1], startIndex, endIndex); comp[1][j+1] = (int)getMaxValue(uncomp[1], startIndex, endIndex); comp[0][j] = uncomp[0][i]; comp[0][j+1] = uncomp[0][i]; j = j + 2; startIndex = endIndex + 1; xvalue = uncomp[0][i]; } } comp[1][j] = getMinValue(uncomp[1], startIndex, endIndex); comp[1][j+1] = (int)getMaxValue(uncomp[1], startIndex, endIndex); comp[0][j] = uncomp[0][endIndex]; comp[0][j+1] = uncomp[0][endIndex]; return comp; }
1,118,225
protected static int[][] scaleXvalues(LocalSeismogram seismogram, MicroSecondTimeRange timeRange, UnitRangeImpl ampRange, Dimension size) throws UnsupportedDataEncoding { LocalSeismogramImpl seis = (LocalSeismogramImpl)seismogram; int[][] out = new int[2][]; int seisIndex = 0; int pixelIndex = 0; int numAdded = 0; if ( seis.getEndTime().before(timeRange.getBeginTime()) || seis.getBeginTime().after(timeRange.getEndTime()) ) { out[0] = new int[0]; out[1] = new int[0]; logger.info("The end time is before the beginTime in simple seismogram"); return out; } MicroSecondDate tMin = timeRange.getBeginTime(); MicroSecondDate tMax = timeRange.getEndTime(); double yMin = ampRange.getMinValue(); double yMax = ampRange.getMaxValue(); int seisStartIndex = getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), tMin); int seisEndIndex = getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), tMax); if (seisStartIndex < 0) { seisStartIndex = 0; } if (seisEndIndex >= seis.getNumPoints()) { seisEndIndex = seis.getNumPoints()-1; } MicroSecondDate tempdate = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisStartIndex); int pixelStartIndex = getPixel(size.width, tMin, tMax, tempdate); tempdate = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisEndIndex); int pixelEndIndex = getPixel(size.width, tMin, tMax, tempdate); int pixels = size.width; out[0] = new int[2*pixels]; out[1] = new int[out[0].length]; int tempYvalues[] = new int [out[0].length]; seisIndex = seisStartIndex; numAdded = 0; int xvalue = 0; int tempValue; xvalue = Math.round((float)(linearInterp(seisStartIndex, pixelStartIndex, seisEndIndex, pixelEndIndex, seisIndex))); seisIndex++; int j; j = 0; while (seisIndex <= seisEndIndex) { tempValue = Math.round((float)(linearInterp(seisStartIndex, pixelStartIndex, seisEndIndex, pixelEndIndex, seisIndex))); tempYvalues[j++] = (int)seis.getValueAt(seisIndex).getValue(); if(tempValue != xvalue) { out[0][numAdded] = xvalue; out[0][numAdded+1] = xvalue; out[1][numAdded] = tempYvalues[j-1]; out[1][numAdded+1] = tempYvalues[j-1]; j = 0; xvalue = tempValue; numAdded = numAdded+2; } seisIndex++; } out[0][numAdded] = xvalue; out[0][numAdded+1] = xvalue; out[1][numAdded] = tempYvalues[j-1]; out[1][numAdded+1] = tempYvalues[j-1]; int temp[][] = new int[2][numAdded]; System.arraycopy(out[0], 0, temp[0], 0, numAdded); System.arraycopy(out[1], 0, temp[1], 0, numAdded); return temp; }
protected static int[][] scaleXvalues(LocalSeismogram seismogram, MicroSecondTimeRange timeRange, UnitRangeImpl ampRange, Dimension size) throws UnsupportedDataEncoding { LocalSeismogramImpl seis = (LocalSeismogramImpl)seismogram; int[][] out = new int[2][]; int seisIndex = 0; int pixelIndex = 0; int numAdded = 0; if ( seis.getEndTime().before(timeRange.getBeginTime()) || seis.getBeginTime().after(timeRange.getEndTime()) ) { out[0] = new int[0]; out[1] = new int[0]; logger.info("The end time is before the beginTime in simple seismogram"); return out; } MicroSecondDate tMin = timeRange.getBeginTime(); MicroSecondDate tMax = timeRange.getEndTime(); double yMin = ampRange.getMinValue(); double yMax = ampRange.getMaxValue(); int seisStartIndex = getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), tMin); int seisEndIndex = getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), tMax); if (seisStartIndex < 0) { seisStartIndex = 0; } if (seisEndIndex >= seis.getNumPoints()) { seisEndIndex = seis.getNumPoints()-1; } MicroSecondDate tempdate = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisStartIndex); int pixelStartIndex = getPixel(size.width, tMin, tMax, tempdate); tempdate = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisEndIndex); int pixelEndIndex = getPixel(size.width, tMin, tMax, tempdate); int pixels = size.width; out[0] = new int[2*pixels]; out[1] = new int[out[0].length]; int tempYvalues[] = new int [out[0].length]; seisIndex = seisStartIndex; numAdded = 0; int xvalue = 0; int tempValue = 0; xvalue = Math.round((float)(linearInterp(seisStartIndex, pixelStartIndex, seisEndIndex, pixelEndIndex, seisIndex))); seisIndex++; int j; j = 0; while (seisIndex <= seisEndIndex) { tempValue = Math.round((float)(linearInterp(seisStartIndex, pixelStartIndex, seisEndIndex, pixelEndIndex, seisIndex))); tempYvalues[j++] = (int)seis.getValueAt(seisIndex).getValue(); if(tempValue != xvalue) { out[0][numAdded] = xvalue; out[0][numAdded+1] = xvalue; out[1][numAdded] = tempYvalues[j-1]; out[1][numAdded+1] = tempYvalues[j-1]; j = 0; xvalue = tempValue; numAdded = numAdded+2; } seisIndex++; } out[0][numAdded] = xvalue; out[0][numAdded+1] = xvalue; out[1][numAdded] = tempYvalues[j-1]; out[1][numAdded+1] = tempYvalues[j-1]; int temp[][] = new int[2][numAdded]; System.arraycopy(out[0], 0, temp[0], 0, numAdded); System.arraycopy(out[1], 0, temp[1], 0, numAdded); return temp; }
1,118,227
protected static int[][] scaleXvalues(LocalSeismogram seismogram, MicroSecondTimeRange timeRange, UnitRangeImpl ampRange, Dimension size) throws UnsupportedDataEncoding { LocalSeismogramImpl seis = (LocalSeismogramImpl)seismogram; int[][] out = new int[2][]; int seisIndex = 0; int pixelIndex = 0; int numAdded = 0; if ( seis.getEndTime().before(timeRange.getBeginTime()) || seis.getBeginTime().after(timeRange.getEndTime()) ) { out[0] = new int[0]; out[1] = new int[0]; logger.info("The end time is before the beginTime in simple seismogram"); return out; } MicroSecondDate tMin = timeRange.getBeginTime(); MicroSecondDate tMax = timeRange.getEndTime(); double yMin = ampRange.getMinValue(); double yMax = ampRange.getMaxValue(); int seisStartIndex = getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), tMin); int seisEndIndex = getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), tMax); if (seisStartIndex < 0) { seisStartIndex = 0; } if (seisEndIndex >= seis.getNumPoints()) { seisEndIndex = seis.getNumPoints()-1; } MicroSecondDate tempdate = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisStartIndex); int pixelStartIndex = getPixel(size.width, tMin, tMax, tempdate); tempdate = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisEndIndex); int pixelEndIndex = getPixel(size.width, tMin, tMax, tempdate); int pixels = size.width; out[0] = new int[2*pixels]; out[1] = new int[out[0].length]; int tempYvalues[] = new int [out[0].length]; seisIndex = seisStartIndex; numAdded = 0; int xvalue = 0; int tempValue; xvalue = Math.round((float)(linearInterp(seisStartIndex, pixelStartIndex, seisEndIndex, pixelEndIndex, seisIndex))); seisIndex++; int j; j = 0; while (seisIndex <= seisEndIndex) { tempValue = Math.round((float)(linearInterp(seisStartIndex, pixelStartIndex, seisEndIndex, pixelEndIndex, seisIndex))); tempYvalues[j++] = (int)seis.getValueAt(seisIndex).getValue(); if(tempValue != xvalue) { out[0][numAdded] = xvalue; out[0][numAdded+1] = xvalue; out[1][numAdded] = tempYvalues[j-1]; out[1][numAdded+1] = tempYvalues[j-1]; j = 0; xvalue = tempValue; numAdded = numAdded+2; } seisIndex++; } out[0][numAdded] = xvalue; out[0][numAdded+1] = xvalue; out[1][numAdded] = tempYvalues[j-1]; out[1][numAdded+1] = tempYvalues[j-1]; int temp[][] = new int[2][numAdded]; System.arraycopy(out[0], 0, temp[0], 0, numAdded); System.arraycopy(out[1], 0, temp[1], 0, numAdded); return temp; }
protected static int[][] scaleXvalues(LocalSeismogram seismogram, MicroSecondTimeRange timeRange, UnitRangeImpl ampRange, Dimension size) throws UnsupportedDataEncoding { LocalSeismogramImpl seis = (LocalSeismogramImpl)seismogram; int[][] out = new int[2][]; int seisIndex = 0; int pixelIndex = 0; int numAdded = 0; if ( seis.getEndTime().before(timeRange.getBeginTime()) || seis.getBeginTime().after(timeRange.getEndTime()) ) { out[0] = new int[0]; out[1] = new int[0]; logger.info("The end time is before the beginTime in simple seismogram"); return out; } MicroSecondDate tMin = timeRange.getBeginTime(); MicroSecondDate tMax = timeRange.getEndTime(); double yMin = ampRange.getMinValue(); double yMax = ampRange.getMaxValue(); int seisStartIndex = getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), tMin); int seisEndIndex = getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), tMax); if (seisStartIndex < 0) { seisStartIndex = 0; } if (seisEndIndex >= seis.getNumPoints()) { seisEndIndex = seis.getNumPoints()-1; } MicroSecondDate tempdate = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisStartIndex); int pixelStartIndex = getPixel(size.width, tMin, tMax, tempdate); tempdate = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisEndIndex); int pixelEndIndex = getPixel(size.width, tMin, tMax, tempdate); int pixels = size.width; out[0] = new int[2*pixels]; out[1] = new int[out[0].length]; int tempYvalues[] = new int [out[0].length]; seisIndex = seisStartIndex; numAdded = 0; int xvalue = 0; int tempValue; xvalue = Math.round((float)(linearInterp(seisStartIndex, pixelStartIndex, seisEndIndex, pixelEndIndex, seisIndex))); seisIndex++; int j; j = 0; while (seisIndex <= seisEndIndex) { tempValue = Math.round((float)(linearInterp(seisStartIndex, pixelStartIndex, seisEndIndex, pixelEndIndex, seisIndex))); tempYvalues[j++] = (int)seis.getValueAt(seisIndex).getValue(); if(tempValue != xvalue) { out[0][numAdded] = xvalue; out[0][numAdded+1] = xvalue; out[1][numAdded] = tempYvalues[j-1]; out[1][numAdded+1] = tempYvalues[j-1]; j = 0; xvalue = tempValue; numAdded = numAdded+2; } seisIndex++; } out[0][numAdded] = xvalue; out[0][numAdded+1] = xvalue; out[1][numAdded] = tempYvalues[j-1]; out[1][numAdded+1] = tempYvalues[j-1]; int temp[][] = new int[2][numAdded]; System.arraycopy(out[0], 0, temp[0], 0, numAdded); System.arraycopy(out[1], 0, temp[1], 0, numAdded); return temp; }
1,118,228
public void setBegin(MicroSecondDate newBegin){ if ( latestTime.getTime().getEndTime().equals(newBegin)) { throw new IllegalArgumentException("Selection must not have zero width, newBegin and end are the same."); } // end of if () logger.debug("setBegin "+newBegin); MicroSecondDate currentBegin = latestTime.getTime().getBeginTime(); TimeInterval timeInt = (TimeInterval)latestTime.getTime().getInterval().convertTo(UnitImpl.MICROSECOND); double currentInterval = timeInt.getValue(); double shift = (newBegin.getMicroSecondTime() - currentBegin.getMicroSecondTime())/currentInterval; double scale = (currentInterval + currentBegin.subtract(newBegin).getValue())/currentInterval; internalRegistrar.shaleTime(shift, scale); }
public void setBegin(MicroSecondDate newBegin){ if ( latestTime.getTime().getEndTime().equals(newBegin)) { throw new IllegalArgumentException("Selection must not have zero width, newBegin and end are the same."); } // end of if () MicroSecondDate currentBegin = latestTime.getTime().getBeginTime(); TimeInterval timeInt = (TimeInterval)latestTime.getTime().getInterval().convertTo(UnitImpl.MICROSECOND); double currentInterval = timeInt.getValue(); double shift = (newBegin.getMicroSecondTime() - currentBegin.getMicroSecondTime())/currentInterval; double scale = (currentInterval + currentBegin.subtract(newBegin).getValue())/currentInterval; internalRegistrar.shaleTime(shift, scale); }
1,118,230
public void setEnd(MicroSecondDate newEnd){ if ( latestTime.getTime().getBeginTime().equals(newEnd)) { throw new IllegalArgumentException("Selection must not have zero width, begin and newEnd are the same."); } // end of if () logger.debug("setEnd "+newEnd); MicroSecondDate currentEnd = latestTime.getTime().getEndTime(); TimeInterval timeInt = (TimeInterval)latestTime.getTime().getInterval().convertTo(UnitImpl.MICROSECOND); double currentInterval = timeInt.getValue(); double scale = (currentInterval + newEnd.subtract(currentEnd).getValue())/currentInterval; internalRegistrar.shaleTime(0, scale); }
public void setEnd(MicroSecondDate newEnd){ if ( latestTime.getTime().getBeginTime().equals(newEnd)) { throw new IllegalArgumentException("Selection must not have zero width, begin and newEnd are the same."); } // end of if () MicroSecondDate currentEnd = latestTime.getTime().getEndTime(); TimeInterval timeInt = (TimeInterval)latestTime.getTime().getInterval().convertTo(UnitImpl.MICROSECOND); double currentInterval = timeInt.getValue(); double scale = (currentInterval + newEnd.subtract(currentEnd).getValue())/currentInterval; internalRegistrar.shaleTime(0, scale); }
1,118,231