bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
public void createPDF() { if (display != null) { if (display instanceof VerticalSeismogramDisplay) { verticleDisplays = ((VerticalSeismogramDisplay)display).getDisplays(); if (verticleDisplays == null) return; if (verticleDisplays.size() == 0) { return; } } init(verticleDisplays.size()); String tmp = this.chooseOutputFile(); if (tmp == null) { createPDF("default.pdf"); } else { createPDF(tmp); } } }
public void createPDF() { if (display != null) { if (display instanceof VerticalSeismogramDisplay) { verticleDisplays = ((VerticalSeismogramDisplay)display).getDisplays(); if (verticleDisplays == null) return; if (verticleDisplays.size() == 0) { return; } } init(verticleDisplays.size()); String tmp = this.chooseOutputFile(); if (tmp == null) { createPDF("default.pdf"); } else { createPDF(tmp); } } }
1,119,940
public void createPDF() { if (display != null) { if (display instanceof VerticalSeismogramDisplay) { verticleDisplays = ((VerticalSeismogramDisplay)display).getDisplays(); if (verticleDisplays == null) return; if (verticleDisplays.size() == 0) { return; } } init(verticleDisplays.size()); String tmp = this.chooseOutputFile(); if (tmp == null) { createPDF("default.pdf"); } else { createPDF(tmp); } } }
public void createPDF() { if (display != null) { if (display instanceof VerticalSeismogramDisplay) { verticleDisplays = ((VerticalSeismogramDisplay)display).getDisplays(); if (verticleDisplays == null) return; if (verticleDisplays.size() == 0) { return; } } init(verticleDisplays.size()); String tmp = this.chooseOutputFile(); if (tmp == null) { createPDF("default.pdf"); } else { createPDF(tmp); } } }
1,119,941
public void createPDF() { if (display != null) { if (display instanceof VerticalSeismogramDisplay) { verticleDisplays = ((VerticalSeismogramDisplay)display).getDisplays(); if (verticleDisplays == null) return; if (verticleDisplays.size() == 0) { return; } } init(verticleDisplays.size()); String tmp = this.chooseOutputFile(); if (tmp == null) { createPDF("default.pdf"); } else { createPDF(tmp); } } }
public void createPDF() { if (display != null) { if (display instanceof VerticalSeismogramDisplay) { verticleDisplays = ((VerticalSeismogramDisplay)display).getDisplays(); if (verticleDisplays == null) return; if (verticleDisplays.size() == 0) { return; init(verticleDisplays.size()); String tmp = this.chooseOutputFile(); if (tmp == null) { createPDF("default.pdf"); else { createPDF(tmp);
1,119,942
public void actionPerformed(ActionEvent e){ int currentNumber = ((Integer)options.getSelectedItem()).intValue(); if(currentNumber < 0){ JOptionPane.showMessageDialog(null, "The number of seismograms selected must be greater than 0", "Selected Too Few", JOptionPane.WARNING_MESSAGE); }else if(currentNumber > numOfSeis){ JOptionPane.showMessageDialog(null, "The number of seismograms selected must less than " + (numOfSeis + 1), "Selected Too Many", JOptionPane.WARNING_MESSAGE); }else{ setSeisPerPage(currentNumber); dialog.dispose(); } }
public void actionPerformed(ActionEvent e){ int currentNumber = ((Integer)options.getSelectedItem()).intValue(); if(currentNumber < 0){ JOptionPane.showMessageDialog(null, "The number of seismograms selected must be greater than 0", "Selected Too Few", JOptionPane.WARNING_MESSAGE); }else if(currentNumber > numOfSeis){ JOptionPane.showMessageDialog(null, "The number of seismograms selected must less than " + (numOfSeis + 1), "Selected Too Many", JOptionPane.WARNING_MESSAGE); }else{ setSeisPerPage(currentNumber); dialog.dispose(); } }
1,119,943
public void actionPerformed(ActionEvent e){ int currentNumber = ((Integer)options.getSelectedItem()).intValue(); if(currentNumber < 0){ JOptionPane.showMessageDialog(null, "The number of seismograms selected must be greater than 0", "Selected Too Few", JOptionPane.WARNING_MESSAGE); }else if(currentNumber > numOfSeis){ JOptionPane.showMessageDialog(null, "The number of seismograms selected must less than " + (numOfSeis + 1), "Selected Too Many", JOptionPane.WARNING_MESSAGE); }else{ setSeisPerPage(currentNumber); dialog.dispose(); } }
public void actionPerformed(ActionEvent e){ int currentNumber = ((Integer)options.getSelectedItem()).intValue(); if(currentNumber < 0){ JOptionPane.showMessageDialog(null, "The number of seismograms selected must be greater than 0", "Selected Too Few", JOptionPane.WARNING_MESSAGE); else if(currentNumber > numOfSeis){ JOptionPane.showMessageDialog(null, "The number of seismograms selected must less than " + (numOfSeis + 1), "Selected Too Many", JOptionPane.WARNING_MESSAGE); else{ setSeisPerPage(currentNumber); dialog.dispose();
1,119,944
public void actionPerformed(ActionEvent e){ setSeisPerPage(-1); dialog.dispose(); }
public void actionPerformed(ActionEvent e){ setSeisPerPage(-1); dialog.dispose(); }
1,119,945
private void setSeisPerPage(int num) { imagesPerPage = num; }
private void setSeisPerPage(int num) { seisPerPageSet = true; imagesPerPage = num; }
1,119,946
public String toString() { StringBuffer sb = new StringBuffer("BwCalendar{"); toStringSegment(sb); sb.append("name="); sb.append(String.valueOf(getName())); sb.append(", path="); sb.append(String.valueOf(getPath())); sb.append(", summary="); sb.append(String.valueOf(getSummary())); sb.append(", description="); sb.append(String.valueOf(getDescription())); sb.append(", mailListId="); sb.append(String.valueOf(getMailListId())); sb.append(", calendarCollection="); sb.append(String.valueOf(getCalendarCollection())); sb.append(")"); return sb.toString(); }
public String toString() { StringBuffer sb = new StringBuffer("BwCalendar{"); toStringSegment(sb); sb.append(", name="); sb.append(String.valueOf(getName())); sb.append(", path="); sb.append(String.valueOf(getPath())); sb.append(", summary="); sb.append(String.valueOf(getSummary())); sb.append(", description="); sb.append(String.valueOf(getDescription())); sb.append(", mailListId="); sb.append(String.valueOf(getMailListId())); sb.append(", calendarCollection="); sb.append(String.valueOf(getCalendarCollection())); sb.append(")"); return sb.toString(); }
1,119,947
private void init() throws Throwable { svci = new CalSvc(); CalSvcIPars pars = new CalSvcIPars(account, UserAuth.superUser, account, null, // XXX needs envPrefix true, // public false, // caldav null, // synchId debug); svci.init(pars); }
private void init() throws Throwable { svci = new CalSvc(); CalSvcIPars pars = new CalSvcIPars(account, account, null, // XXX needs envPrefix true, // public false, // caldav null, // synchId debug); svci.init(pars); }
1,119,949
public void testNullSeed() { IPersonAttributeDao dao = getPersonAttributeDaoInstance(); Map nullMap = null; try { dao.getUserAttributes(nullMap); } catch (IllegalArgumentException iae) { // good, as expected return; } fail("Expected IllegalArgumentException on getUserAttributes(String null)"); }
public void testNullSeed() { IPersonAttributeDao dao = getPersonAttributeDaoInstance(); Map nullMap = null; try { dao.getUserAttributes(nullMap); } catch (IllegalArgumentException iae) { // good, as expected return; } fail("Expected IllegalArgumentException on getUserAttributes((Map)null)"); }
1,119,950
public void testNullUid() { IPersonAttributeDao dao = getPersonAttributeDaoInstance(); String nullString = null; try { dao.getUserAttributes(nullString); } catch (IllegalArgumentException iae) { // good, as expected return; } fail("Expected IllegalArgumentException on getUserAttributes(String null)"); }
public void testNullUid() { IPersonAttributeDao dao = getPersonAttributeDaoInstance(); String nullString = null; try { dao.getUserAttributes(nullString); } catch (IllegalArgumentException iae) { // good, as expected return; } fail("Expected IllegalArgumentException on getUserAttributes((String)null)"); }
1,119,951
public Vector getParamFilters() { if (paramFilters == null) { paramFilters = new Vector(); } return paramFilters; }
public Collection getParamFilters() { if (paramFilters == null) { paramFilters = new Vector(); } return paramFilters; }
1,119,952
public Vector getParamFilters() { if (paramFilters == null) { paramFilters = new Vector(); } return paramFilters; }
public Vector getParamFilters() { if (paramFilters == null) { paramFilters = new ArrayList(); } return paramFilters; }
1,119,953
private boolean validateEvent(PEActionForm form, CalSvcI svci, BwEvent event, MessageEmit err) throws Throwable { boolean ok = validateEventCategory(form, svci, event, err); if (!validateEventSponsor(form, svci, event, err)) { ok = false; } if (!validateEventLocation(form, svci, event, err)) { ok = false; } if (!validateEventCalendar(form, svci, event, err)) { ok = false; } if (!form.getEventDates().updateEvent(event, svci.getTimezones())) { ok = false; } else { ok = BwWebUtil.validateEvent(svci, event, true, // ENUM descriptionRequired err); } return ok; }
private boolean validateEvent(PEActionForm form, CalSvcI svci, BwEvent event, MessageEmit err) throws Throwable { boolean ok = validateEventCategory(form, svci, event, err); if (!validateEventSponsor(form, svci, event, err)) { ok = false; } if (!validateEventLocation(form, svci, event, err)) { ok = false; } if (!validateEventCalendar(form, svci, event, err)) { ok = false; } if (!form.getEventDates().updateEvent(event, svci.getTimezones())) { ok = false; } else { ok = BwWebUtil.validateEvent(svci, event, true, // ENUM descriptionRequired err); } return ok; }
1,119,954
public void setup(HttpServletRequest request, ActionForm form, MessageResources messages) throws Throwable { BwSession s = BwWebUtil.getState(request); if (s != null) { } else { CalEnv env = getEnv(form); String appName = env.getAppProperty("app.name"); String appRoot = env.getAppProperty("app.root"); s = new BwSessionImpl(form.getCurrentUser(), appRoot, appName, form.getPresentationState(), messages, form.getSchemeHostPort(), debug); BwWebUtil.setState(request, s); } }
public void setup(HttpServletRequest request, ActionForm form, MessageResources messages) throws Throwable { BwSession s = BwWebUtil.getState(request); if (s != null) { } else { CalEnv env = getEnv(form); String appName = env.getAppProperty("app.name"); String appRoot = env.getAppProperty("app.root"); s = new BwSessionImpl(form.getCurrentUser(), appRoot, appName, form.getPresentationState(), messages, form.getSchemeHostPort(), debug); BwWebUtil.setState(request, s); } }
1,119,955
public static final ATSymbol downBaseLevelSelector(String jSelector) throws NATException { return AGSymbol.alloc(javaToAmbientTalkSelector(jSelector).replaceFirst(JavaInterfaceAdaptor._BASE_PREFIX_, "")); }
public static final ATSymbol downBaseLevelSelector(String jSelector) throws NATException { if (jSelector.startsWith(JavaInterfaceAdaptor._BGET_PREFIX_)) { return downFieldName(stripPrefix(jSelector, JavaInterfaceAdaptor._BGET_PREFIX_)); } else if (jSelector.startsWith(JavaInterfaceAdaptor._BSET_PREFIX_)) { return downFieldName(stripPrefix(jSelector, JavaInterfaceAdaptor._BSET_PREFIX_)); } else if (jSelector.startsWith(JavaInterfaceAdaptor._BASE_PREFIX_)) { return downSelector(stripPrefix(jSelector, JavaInterfaceAdaptor._BASE_PREFIX_)); } else { throw new XIllegalArgument("Reflection.downBaseLevelSelector was asked to down a non-base level selector: " + jSelector); } }
1,119,956
public static final ATSymbol downMetaLevelSelector(String jSelector) throws NATException { return AGSymbol.alloc(javaToAmbientTalkSelector(jSelector).replaceFirst(JavaInterfaceAdaptor._META_PREFIX_, "")); }
public static final ATSymbol downMetaLevelSelector(String jSelector) throws NATException { if (jSelector.startsWith(JavaInterfaceAdaptor._BGET_PREFIX_)) { return downFieldName(stripPrefix(jSelector, JavaInterfaceAdaptor._BGET_PREFIX_)); } else if (jSelector.startsWith(JavaInterfaceAdaptor._BSET_PREFIX_)) { return downFieldName(stripPrefix(jSelector, JavaInterfaceAdaptor._BSET_PREFIX_)); } else if (jSelector.startsWith(JavaInterfaceAdaptor._BASE_PREFIX_)) { return downSelector(stripPrefix(jSelector, JavaInterfaceAdaptor._BASE_PREFIX_)); } else { throw new XIllegalArgument("Reflection.downBaseLevelSelector was asked to down a non-base level selector: " + jSelector); } }
1,119,957
public static final String upSelector(ATSymbol atSelector) throws NATException { // : -> _ String nam = atSelector.getText().asNativeText().javaValue; nam = nam.replaceAll(":", "_"); // operator symbol -> _op{code}_ Matcher m = symbol.matcher(nam); StringBuffer sb = new StringBuffer(); while (m.find()) { // find every occurence of a non-word character and convert it into a symbol String oprCode = symbol2oprCode(m.group(0)); // only add the _op prefix and _ postfix if the code has been found... m.appendReplacement(sb, (oprCode.length() == 3) ? "_op" + oprCode + "_" : oprCode); } m.appendTail(sb); return sb.toString(); }
public static final String upSelector(ATSymbol atSelector) throws NATException { // : -> _ String nam = atSelector.base_getText().asNativeText().javaValue; nam = nam.replaceAll(":", "_"); // operator symbol -> _op{code}_ Matcher m = symbol.matcher(nam); StringBuffer sb = new StringBuffer(); while (m.find()) { // find every occurence of a non-word character and convert it into a symbol String oprCode = symbol2oprCode(m.group(0)); // only add the _op prefix and _ postfix if the code has been found... m.appendReplacement(sb, (oprCode.length() == 3) ? "_op" + oprCode + "_" : oprCode); } m.appendTail(sb); return sb.toString(); }
1,119,958
public void doAction() { if (Main.getMain().getMode() >= Main.MODE_IN_GAME) { Main.getNetworkConnection().writeMessage("LV;"); } Main.getNetworkConnection().writeMessage("SG;" + SerializedData.getSerializedData().getMaxPlayerCount()); }
public void doAction() { if (Main.getMain().getMode() >= Main.MODE_IN_GAME) { Main.getNetworkConnection().writeMessage("LV;"); } Main.getNetworkConnection().writeMessage("SG;" + SerializedData.getSerializedData().getMaxPlayerCount()); }
1,119,959
public BwSystem getSyspars() throws CalFacadeException { if (syspars == null) { sess.namedQuery("getSystemPars"); sess.setString("name", getSystemName()); syspars = (BwSystem)sess.getUnique(); if (syspars == null) { throw new CalFacadeException("No system parameters with name " + getSystemName()); } if (debug) { trace("Read system parameters: " + syspars); } } return syspars; }
public BwSystem getSyspars() throws CalFacadeException { if (syspars == null) { sess.namedQuery("getSystemPars"); sess.setString("name", getSystemName()); syspars = (BwSystem)sess.getUnique(); if (syspars == null) { throw new CalFacadeException("No system parameters with name " + getSystemName()); } if (debug) { trace("Read system parameters: " + syspars); } } return syspars; }
1,119,960
public LoadPanel() { super(new GridLayout(1, 0)); setBorder(new TitledBorder(Messages.getString("ModuleAutoStartConfigurationPanel.START_AUTOMATICALLY") +":")); //$NON-NLS-1$ //$NON-NLS-2$ final JTable table = new JTable(model); DefaultCellEditor dce = new DefaultCellEditor(new JTextField()); dce.addCellEditorListener(new CellEditorListener() { public void editingCanceled(ChangeEvent arg0) { } public void editingStopped(ChangeEvent arg0) { int i = table.getSelectedRow(); int j = table.getSelectedColumn(); String arg = (String)table.getCellEditor(i, j).getCellEditorValue(); model.args.set(i, arg); model.fireTableCellUpdated(i, j); } }); table.setDefaultEditor(String.class, dce); table.setCellEditor(dce); table.setToolTipText(Messages.getString("ModuleAutoStartConfigurationPanel.DOUBLE_CLICK_TO_MODIFY_ARGUMENTS")); //$NON-NLS-1$ final JPopupMenu rightClickMenu = new JPopupMenu(); JMenuItem editArgsItem = new JMenuItem(Messages.getString("ModuleAutoStartConfigurationPanel.EDIT_ARGUMENTS")); //$NON-NLS-1$ editArgsItem.setToolTipText(Messages.getString("ModuleAutoStartConfigurationPanel.ARGUMENTS_ARE_GIVEN_TO_MODULE")); //$NON-NLS-1$ editArgsItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { int[] selected = table.getSelectedRows(); if (selected.length > 0) { table.editCellAt(selected[0], 1); } } }); rightClickMenu.add(editArgsItem); JMenuItem removeItem = new JMenuItem(Messages.getString("ModuleAutoStartConfigurationPanel.REMOVE")); //$NON-NLS-1$ removeItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int[] selected = table.getSelectedRows(); for (int i = selected.length - 1; i >= 0; i--) { model.remove(selected[i]); } } }); rightClickMenu.add(removeItem); table.addMouseListener(new MouseListener() { public void mouseClicked(MouseEvent e) { } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } public void mousePressed(MouseEvent e) { if (e.getClickCount() == 1 && e.getButton() == MouseEvent.BUTTON3 && table.getSelectedRow() != -1) { rightClickMenu.show(table, e.getX(), e.getY()); } else if (e.getClickCount() == 2 && e.getButton() == MouseEvent.BUTTON1) { int selected = table.getSelectedRow(); if (selected != -1) { table.editCellAt(selected, 1); } } } public void mouseReleased(MouseEvent e) { } }); JScrollPane scrollPane = new JScrollPane(table); add(scrollPane); }
public LoadPanel() { super(new GridLayout(1, 0)); setBorder(new TitledBorder(Messages.getString("ModuleAutoStartConfigurationPanel.START_AUTOMATICALLY") +":")); //$NON-NLS-1$ //$NON-NLS-2$ final JTable table = new JTable(model); DefaultCellEditor dce = new DefaultCellEditor(new JTextField()); dce.addCellEditorListener(new CellEditorListener() { public void editingCanceled(ChangeEvent arg0) { } public void editingStopped(ChangeEvent arg0) { int i = table.getSelectedRow(); int j = table.getSelectedColumn(); String arg = (String)table.getCellEditor(i, j).getCellEditorValue(); model.args.set(i, arg); model.fireTableCellUpdated(i, j); } }); table.setDefaultEditor(String.class, dce); table.setCellEditor(dce); table.setToolTipText(Messages.getString("ModuleAutoStartConfigurationPanel.DOUBLE_CLICK_TO_MODIFY_ARGUMENTS")); //$NON-NLS-1$ final JPopupMenu rightClickMenu = new JPopupMenu(); JMenuItem editArgsItem = new JMenuItem(Messages.getString("ModuleAutoStartConfigurationPanel.EDIT_ARGUMENTS")); //$NON-NLS-1$ editArgsItem.setToolTipText(Messages.getString("ModuleAutoStartConfigurationPanel.ARGUMENTS_ARE_GIVEN_TO_MODULE")); //$NON-NLS-1$ editArgsItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { int[] selected = table.getSelectedRows(); if (selected.length > 0) { table.editCellAt(selected[0], 1); } } }); rightClickMenu.add(editArgsItem); JMenuItem removeItem = new JMenuItem(Messages.getString("ModuleAutoStartConfigurationPanel.REMOVE")); //$NON-NLS-1$ removeItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int[] selected = table.getSelectedRows(); for (int i = selected.length - 1; i >= 0; i--) { model.remove(selected[i]); } } }); rightClickMenu.add(removeItem); table.addMouseListener(new MouseListener() { public void mouseClicked(MouseEvent e) { } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } public void mousePressed(MouseEvent e) { if (e.getClickCount() == 1 && e.getButton() == MouseEvent.BUTTON3 && table.getSelectedRow() != -1) { rightClickMenu.show(table, e.getX(), e.getY()); } else if (e.getClickCount() == 2 && e.getButton() == MouseEvent.BUTTON1) { int selected = table.getSelectedRow(); if (selected != -1) { table.editCellAt(selected, 1); } } } public void mouseReleased(MouseEvent e) { } }); JScrollPane scrollPane = new JScrollPane(table); add(scrollPane); }
1,119,961
public void editingStopped(ChangeEvent arg0) { int i = table.getSelectedRow(); int j = table.getSelectedColumn(); String arg = (String)table.getCellEditor(i, j).getCellEditorValue(); model.args.set(i, arg); model.fireTableCellUpdated(i, j); }
public void editingStopped(ChangeEvent arg0) { int i = table.getSelectedRow(); int j = table.getSelectedColumn(); String arg = (String)table.getCellEditor(i, j).getCellEditorValue(); model.args.set(i, arg); model.fireTableCellUpdated(i, j); }
1,119,962
TimeScaleCalc (int totalPixels, MicroSecondDate beginTime, MicroSecondDate endTime, TimeConfigRegistrar tr){ if (endTime.before(beginTime)) { throw new IllegalArgumentException("endTime must be after beginTime, "+beginTime.toString()+" "+endTime.toString()); } this.totalPixels = totalPixels; setTimes(); calculateTicks(); }
TimeScaleCalc (int totalPixels, MicroSecondDate beginTime, MicroSecondDate endTime, TimeConfigRegistrar tr){ if (endTime.before(beginTime)) { throw new IllegalArgumentException("endTime must be after beginTime, "+beginTime.toString()+" "+endTime.toString()); } this.totalPixels = totalPixels; setTimes(); calculateTicks(); }
1,119,964
TimeScaleCalc (int totalPixels, MicroSecondDate beginTime, MicroSecondDate endTime, TimeConfigRegistrar tr){ if (endTime.before(beginTime)) { throw new IllegalArgumentException("endTime must be after beginTime, "+beginTime.toString()+" "+endTime.toString()); } this.totalPixels = totalPixels; setTimes(); calculateTicks(); }
TimeScaleCalc (int totalPixels, MicroSecondDate beginTime, MicroSecondDate endTime, TimeConfigRegistrar tr){ if (endTime.before(beginTime)) { throw new IllegalArgumentException("endTime must be after beginTime, "+beginTime.toString()+" "+endTime.toString()); } this.totalPixels = totalPixels; setTimes(); }
1,119,965
protected void fireNewDataEvent(SeisDataChangeEvent event) { // use temp array to avoid concurrentModificationException LinkedList tmp = new LinkedList(dssDataListeners); Iterator iterator = tmp.iterator(); while(iterator.hasNext()) { SeisDataChangeListener dssDataListener = (SeisDataChangeListener) iterator.next(); dssDataListener.pushData(event); } }
protected void fireNewDataEvent(SeisDataChangeEvent event) { // use temp array to avoid concurrentModificationException LinkedList tmp; synchronized(dssDataListeners){ tmp = new LinkedList(dssDataListeners); } Iterator iterator = tmp.iterator(); while(iterator.hasNext()) { SeisDataChangeListener dssDataListener = (SeisDataChangeListener) iterator.next(); dssDataListener.pushData(event); } }
1,119,966
public ParticleMotionDisplay(DataSetSeismogram hseis, TimeConfigRegistrar timeConfigRegistrar, AmpConfigRegistrar hAmpConfigRegistrar, AmpConfigRegistrar vAmpConfigRegistrar, Color color, boolean advancedOption) { this.hAmpConfigRegistrar = hAmpConfigRegistrar; this.vAmpConfigRegistrar = vAmpConfigRegistrar; particleDisplayPanel = new JLayeredPane(); OverlayLayout overlayLayout = new OverlayLayout(particleDisplayPanel); radioPanel = new JPanel(); this.setLayout(new BorderLayout()); particleDisplayPanel.setLayout(overlayLayout); radioPanel.setLayout(new GridLayout(1, 0)); if(timeConfigRegistrar != null) { timeConfigRegistrar.addTimeSyncListener(this); } view = new ParticleMotionView(this); view.setSize(new java.awt.Dimension(300, 300)); particleDisplayPanel.add(view, PARTICLE_MOTION_LAYER); hAmpScaleMap = new AmpScaleMapper(50, 4, new UnitRangeImpl(-100, 100, UnitImpl.COUNT) ); vAmpScaleMap = new AmpScaleMapper(50, 4, new UnitRangeImpl(-100, 100, UnitImpl.COUNT) ); scaleBorder = new ScaleBorder(); scaleBorder.setBottomScaleMapper(hAmpScaleMap); scaleBorder.setLeftScaleMapper(vAmpScaleMap); hTitleBorder = new BottomTitleBorder("X - axis Title"); vTitleBorder = new LeftTitleBorder("Y - axis Title"); particleDisplayPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createCompoundBorder( BorderFactory.createRaisedBevelBorder(), // hTitleBorder), BorderFactory.createCompoundBorder(hTitleBorder, vTitleBorder)), BorderFactory.createCompoundBorder( scaleBorder, BorderFactory.createLoweredBevelBorder())) ); add(particleDisplayPanel, BorderLayout.CENTER); radioPanel.setVisible(false); add(radioPanel, BorderLayout.SOUTH); this.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { resize(); } public void componentShown(ComponentEvent e) { resize(); } }); // radioPanel.addContainerListener(new ContainerAdapter() {// public void componentAdded(ContainerEvent e) {// System.out.println("******************************* COMPONENT is ADDED");// resize();// }// public void componentRemove(ContainerEvent e) {// resize();// }// }); updateTimeRange(); ParticleMotionDisplayThread t = new ParticleMotionDisplayThread(hseis, timeConfigRegistrar, hAmpConfigRegistrar, vAmpConfigRegistrar, advancedOption, true, this); t.execute(); }
public ParticleMotionDisplay(DataSetSeismogram hseis, TimeConfigRegistrar timeConfigRegistrar, AmpConfigRegistrar hAmpConfigRegistrar, AmpConfigRegistrar vAmpConfigRegistrar, Color color, boolean advancedOption) { this.hAmpConfigRegistrar = hAmpConfigRegistrar; this.vAmpConfigRegistrar = vAmpConfigRegistrar; particleDisplayPanel = new JLayeredPane(); OverlayLayout overlayLayout = new OverlayLayout(particleDisplayPanel); radioPanel = new JPanel(); this.setLayout(new BorderLayout()); particleDisplayPanel.setLayout(overlayLayout); radioPanel.setLayout(new GridLayout(1, 0)); if(timeConfigRegistrar != null) { timeConfigRegistrar.addTimeSyncListener(this); } view = new ParticleMotionView(this); view.setSize(new java.awt.Dimension(300, 300)); particleDisplayPanel.add(view, PARTICLE_MOTION_LAYER); hAmpScaleMap = new AmpScaleMapper(50, 4, new UnitRangeImpl(-100, 100, UnitImpl.COUNT) ); vAmpScaleMap = new AmpScaleMapper(50, 4, new UnitRangeImpl(-100, 100, UnitImpl.COUNT) ); scaleBorder = new ScaleBorder(); scaleBorder.setBottomScaleMapper(hAmpScaleMap); scaleBorder.setLeftScaleMapper(vAmpScaleMap); hTitleBorder = new BottomTitleBorder("X - axis Title"); vTitleBorder = new LeftTitleBorder("Y - axis Title"); particleDisplayPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createCompoundBorder( BorderFactory.createRaisedBevelBorder(), // hTitleBorder), BorderFactory.createCompoundBorder(hTitleBorder, vTitleBorder)), BorderFactory.createCompoundBorder( scaleBorder, BorderFactory.createLoweredBevelBorder())) ); add(particleDisplayPanel, BorderLayout.CENTER); radioPanel.setVisible(false); add(radioPanel, BorderLayout.SOUTH); this.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { resize(); } public void componentShown(ComponentEvent e) { resize(); } }); // radioPanel.addContainerListener(new ContainerAdapter() {// public void componentAdded(ContainerEvent e) {// System.out.println("******************************* COMPONENT is ADDED");// resize();// }// public void componentRemove(ContainerEvent e) {// resize();// }// }); updateTimeRange(); ParticleMotionDisplayThread t = new ParticleMotionDisplayThread(hseis, timeConfigRegistrar, hAmpConfigRegistrar, vAmpConfigRegistrar, advancedOption, true, this); t.execute(); }
1,119,967
public ParticleMotionDisplay(DataSetSeismogram hseis, TimeConfigRegistrar timeConfigRegistrar, AmpConfigRegistrar hAmpConfigRegistrar, AmpConfigRegistrar vAmpConfigRegistrar, Color color, boolean advancedOption) { this.hAmpConfigRegistrar = hAmpConfigRegistrar; this.vAmpConfigRegistrar = vAmpConfigRegistrar; particleDisplayPanel = new JLayeredPane(); OverlayLayout overlayLayout = new OverlayLayout(particleDisplayPanel); radioPanel = new JPanel(); this.setLayout(new BorderLayout()); particleDisplayPanel.setLayout(overlayLayout); radioPanel.setLayout(new GridLayout(1, 0)); if(timeConfigRegistrar != null) { timeConfigRegistrar.addTimeSyncListener(this); } view = new ParticleMotionView(this); view.setSize(new java.awt.Dimension(300, 300)); particleDisplayPanel.add(view, PARTICLE_MOTION_LAYER); hAmpScaleMap = new AmpScaleMapper(50, 4, new UnitRangeImpl(-100, 100, UnitImpl.COUNT) ); vAmpScaleMap = new AmpScaleMapper(50, 4, new UnitRangeImpl(-100, 100, UnitImpl.COUNT) ); scaleBorder = new ScaleBorder(); scaleBorder.setBottomScaleMapper(hAmpScaleMap); scaleBorder.setLeftScaleMapper(vAmpScaleMap); hTitleBorder = new BottomTitleBorder("X - axis Title"); vTitleBorder = new LeftTitleBorder("Y - axis Title"); particleDisplayPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createCompoundBorder( BorderFactory.createRaisedBevelBorder(), // hTitleBorder), BorderFactory.createCompoundBorder(hTitleBorder, vTitleBorder)), BorderFactory.createCompoundBorder( scaleBorder, BorderFactory.createLoweredBevelBorder())) ); add(particleDisplayPanel, BorderLayout.CENTER); radioPanel.setVisible(false); add(radioPanel, BorderLayout.SOUTH); this.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { resize(); } public void componentShown(ComponentEvent e) { resize(); } }); // radioPanel.addContainerListener(new ContainerAdapter() {// public void componentAdded(ContainerEvent e) {// System.out.println("******************************* COMPONENT is ADDED");// resize();// }// public void componentRemove(ContainerEvent e) {// resize();// }// }); updateTimeRange(); ParticleMotionDisplayThread t = new ParticleMotionDisplayThread(hseis, timeConfigRegistrar, hAmpConfigRegistrar, vAmpConfigRegistrar, advancedOption, true, this); t.execute(); }
public ParticleMotionDisplay(DataSetSeismogram hseis, TimeConfigRegistrar timeConfigRegistrar, AmpConfigRegistrar hAmpConfigRegistrar, AmpConfigRegistrar vAmpConfigRegistrar, Color color, boolean advancedOption) { this.hAmpConfigRegistrar = hAmpConfigRegistrar; this.vAmpConfigRegistrar = vAmpConfigRegistrar; particleDisplayPanel = new JLayeredPane(); OverlayLayout overlayLayout = new OverlayLayout(particleDisplayPanel); radioPanel = new JPanel(); this.setLayout(new BorderLayout()); particleDisplayPanel.setLayout(overlayLayout); radioPanel.setLayout(new GridLayout(1, 0)); if(timeConfigRegistrar != null) { timeConfigRegistrar.addTimeSyncListener(this); } view = new ParticleMotionView(this); view.setSize(new java.awt.Dimension(300, 300)); particleDisplayPanel.add(view, PARTICLE_MOTION_LAYER); hAmpScaleMap = new AmpScaleMapper(50, 4, new UnitRangeImpl(-100, 100, UnitImpl.COUNT) ); vAmpScaleMap = new AmpScaleMapper(50, 4, new UnitRangeImpl(-100, 100, UnitImpl.COUNT) ); scaleBorder = new ScaleBorder(); scaleBorder.setBottomScaleMapper(hAmpScaleMap); scaleBorder.setLeftScaleMapper(vAmpScaleMap); hTitleBorder = new BottomTitleBorder("X - axis Title"); vTitleBorder = new LeftTitleBorder("Y - axis Title"); particleDisplayPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createCompoundBorder( BorderFactory.createRaisedBevelBorder(), // hTitleBorder), BorderFactory.createCompoundBorder(hTitleBorder, vTitleBorder)), BorderFactory.createCompoundBorder( scaleBorder, BorderFactory.createLoweredBevelBorder())) ); add(particleDisplayPanel, BorderLayout.CENTER); radioPanel.setVisible(false); add(radioPanel, BorderLayout.SOUTH); this.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { resize(); } public void componentShown(ComponentEvent e) { resize(); } }); // radioPanel.addContainerListener(new ContainerAdapter() {// public void componentAdded(ContainerEvent e) {// System.out.println("******************************* COMPONENT is ADDED");// resize();// }// public void componentRemove(ContainerEvent e) {// resize();// }// }); updateTimeRange(); ParticleMotionDisplayThread t = new ParticleMotionDisplayThread(hseis, timeConfigRegistrar, hAmpConfigRegistrar, vAmpConfigRegistrar, advancedOption, true, this); t.execute(); }
1,119,968
public ParticleMotionDisplay(DataSetSeismogram hseis, TimeConfigRegistrar timeConfigRegistrar, AmpConfigRegistrar hAmpConfigRegistrar, AmpConfigRegistrar vAmpConfigRegistrar, Color color, boolean advancedOption) { this.hAmpConfigRegistrar = hAmpConfigRegistrar; this.vAmpConfigRegistrar = vAmpConfigRegistrar; particleDisplayPanel = new JLayeredPane(); OverlayLayout overlayLayout = new OverlayLayout(particleDisplayPanel); radioPanel = new JPanel(); this.setLayout(new BorderLayout()); particleDisplayPanel.setLayout(overlayLayout); radioPanel.setLayout(new GridLayout(1, 0)); if(timeConfigRegistrar != null) { timeConfigRegistrar.addTimeSyncListener(this); } view = new ParticleMotionView(this); view.setSize(new java.awt.Dimension(300, 300)); particleDisplayPanel.add(view, PARTICLE_MOTION_LAYER); hAmpScaleMap = new AmpScaleMapper(50, 4, new UnitRangeImpl(-100, 100, UnitImpl.COUNT) ); vAmpScaleMap = new AmpScaleMapper(50, 4, new UnitRangeImpl(-100, 100, UnitImpl.COUNT) ); scaleBorder = new ScaleBorder(); scaleBorder.setBottomScaleMapper(hAmpScaleMap); scaleBorder.setLeftScaleMapper(vAmpScaleMap); hTitleBorder = new BottomTitleBorder("X - axis Title"); vTitleBorder = new LeftTitleBorder("Y - axis Title"); particleDisplayPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createCompoundBorder( BorderFactory.createRaisedBevelBorder(), // hTitleBorder), BorderFactory.createCompoundBorder(hTitleBorder, vTitleBorder)), BorderFactory.createCompoundBorder( scaleBorder, BorderFactory.createLoweredBevelBorder())) ); add(particleDisplayPanel, BorderLayout.CENTER); radioPanel.setVisible(false); add(radioPanel, BorderLayout.SOUTH); this.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { resize(); } public void componentShown(ComponentEvent e) { resize(); } }); // radioPanel.addContainerListener(new ContainerAdapter() {// public void componentAdded(ContainerEvent e) {// System.out.println("******************************* COMPONENT is ADDED");// resize();// }// public void componentRemove(ContainerEvent e) {// resize();// }// }); updateTimeRange(); ParticleMotionDisplayThread t = new ParticleMotionDisplayThread(hseis, timeConfigRegistrar, hAmpConfigRegistrar, vAmpConfigRegistrar, advancedOption, true, this); t.execute(); }
public ParticleMotionDisplay(DataSetSeismogram hseis, TimeConfigRegistrar timeConfigRegistrar, AmpConfigRegistrar hAmpConfigRegistrar, AmpConfigRegistrar vAmpConfigRegistrar, Color color, boolean advancedOption) { this.hAmpConfigRegistrar = hAmpConfigRegistrar; this.vAmpConfigRegistrar = vAmpConfigRegistrar; particleDisplayPanel = new JLayeredPane(); OverlayLayout overlayLayout = new OverlayLayout(particleDisplayPanel); radioPanel = new JPanel(); this.setLayout(new BorderLayout()); particleDisplayPanel.setLayout(overlayLayout); radioPanel.setLayout(new GridLayout(1, 0)); if(timeConfigRegistrar != null) { timeConfigRegistrar.addTimeSyncListener(this); } view = new ParticleMotionView(this); view.setSize(new java.awt.Dimension(300, 300)); particleDisplayPanel.add(view, PARTICLE_MOTION_LAYER); hAmpScaleMap = new AmpScaleMapper(50, 4, new UnitRangeImpl(-100, 100, UnitImpl.COUNT) ); vAmpScaleMap = new AmpScaleMapper(50, 4, new UnitRangeImpl(-100, 100, UnitImpl.COUNT) ); scaleBorder = new ScaleBorder(); scaleBorder.setBottomScaleMapper(hAmpScaleMap); scaleBorder.setLeftScaleMapper(vAmpScaleMap); hTitleBorder = new BottomTitleBorder("X - axis Title"); vTitleBorder = new LeftTitleBorder("Y - axis Title"); particleDisplayPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createCompoundBorder( BorderFactory.createRaisedBevelBorder(), // hTitleBorder), BorderFactory.createCompoundBorder(hTitleBorder, vTitleBorder)), BorderFactory.createCompoundBorder( scaleBorder, BorderFactory.createLoweredBevelBorder())) ); add(particleDisplayPanel, BorderLayout.CENTER); radioPanel.setVisible(false); add(radioPanel, BorderLayout.SOUTH); this.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { resize(); } public void componentShown(ComponentEvent e) { resize(); } }); // radioPanel.addContainerListener(new ContainerAdapter() {// public void componentAdded(ContainerEvent e) {// System.out.println("******************************* COMPONENT is ADDED");// resize();// }// public void componentRemove(ContainerEvent e) {// resize();// }// }); updateTimeRange(); ParticleMotionDisplayThread t = new ParticleMotionDisplayThread(hseis, timeConfigRegistrar, hAmpConfigRegistrar, vAmpConfigRegistrar, advancedOption, true, this); t.execute(); }
1,119,969
public ParticleMotionDisplay(DataSetSeismogram hseis, TimeConfigRegistrar timeConfigRegistrar, AmpConfigRegistrar hAmpConfigRegistrar, AmpConfigRegistrar vAmpConfigRegistrar, Color color, boolean advancedOption) { this.hAmpConfigRegistrar = hAmpConfigRegistrar; this.vAmpConfigRegistrar = vAmpConfigRegistrar; particleDisplayPanel = new JLayeredPane(); OverlayLayout overlayLayout = new OverlayLayout(particleDisplayPanel); radioPanel = new JPanel(); this.setLayout(new BorderLayout()); particleDisplayPanel.setLayout(overlayLayout); radioPanel.setLayout(new GridLayout(1, 0)); if(timeConfigRegistrar != null) { timeConfigRegistrar.addTimeSyncListener(this); } view = new ParticleMotionView(this); view.setSize(new java.awt.Dimension(300, 300)); particleDisplayPanel.add(view, PARTICLE_MOTION_LAYER); hAmpScaleMap = new AmpScaleMapper(50, 4, new UnitRangeImpl(-100, 100, UnitImpl.COUNT) ); vAmpScaleMap = new AmpScaleMapper(50, 4, new UnitRangeImpl(-100, 100, UnitImpl.COUNT) ); scaleBorder = new ScaleBorder(); scaleBorder.setBottomScaleMapper(hAmpScaleMap); scaleBorder.setLeftScaleMapper(vAmpScaleMap); hTitleBorder = new BottomTitleBorder("X - axis Title"); vTitleBorder = new LeftTitleBorder("Y - axis Title"); particleDisplayPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createCompoundBorder( BorderFactory.createRaisedBevelBorder(), // hTitleBorder), BorderFactory.createCompoundBorder(hTitleBorder, vTitleBorder)), BorderFactory.createCompoundBorder( scaleBorder, BorderFactory.createLoweredBevelBorder())) ); add(particleDisplayPanel, BorderLayout.CENTER); radioPanel.setVisible(false); add(radioPanel, BorderLayout.SOUTH); this.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { resize(); } public void componentShown(ComponentEvent e) { resize(); } }); // radioPanel.addContainerListener(new ContainerAdapter() {// public void componentAdded(ContainerEvent e) {// System.out.println("******************************* COMPONENT is ADDED");// resize();// }// public void componentRemove(ContainerEvent e) {// resize();// }// }); updateTimeRange(); ParticleMotionDisplayThread t = new ParticleMotionDisplayThread(hseis, timeConfigRegistrar, hAmpConfigRegistrar, vAmpConfigRegistrar, advancedOption, true, this); t.execute(); }
public ParticleMotionDisplay(DataSetSeismogram hseis, TimeConfigRegistrar timeConfigRegistrar, AmpConfigRegistrar hAmpConfigRegistrar, AmpConfigRegistrar vAmpConfigRegistrar, Color color, boolean advancedOption) { this.hAmpConfigRegistrar = hAmpConfigRegistrar; this.vAmpConfigRegistrar = vAmpConfigRegistrar; particleDisplayPanel = new JLayeredPane(); OverlayLayout overlayLayout = new OverlayLayout(particleDisplayPanel); radioPanel = new JPanel(); this.setLayout(new BorderLayout()); particleDisplayPanel.setLayout(overlayLayout); radioPanel.setLayout(new GridLayout(1, 0)); if(timeConfigRegistrar != null) { timeConfigRegistrar.addTimeSyncListener(this); } view = new ParticleMotionView(this); view.setSize(new java.awt.Dimension(300, 300)); particleDisplayPanel.add(view, PARTICLE_MOTION_LAYER); hAmpScaleMap = new AmpScaleMapper(50, 4, new UnitRangeImpl(-100, 100, UnitImpl.COUNT) ); vAmpScaleMap = new AmpScaleMapper(50, 4, new UnitRangeImpl(-100, 100, UnitImpl.COUNT) ); scaleBorder = new ScaleBorder(); scaleBorder.setBottomScaleMapper(hAmpScaleMap); scaleBorder.setLeftScaleMapper(vAmpScaleMap); hTitleBorder = new BottomTitleBorder("X - axis Title"); vTitleBorder = new LeftTitleBorder("Y - axis Title"); particleDisplayPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createCompoundBorder( BorderFactory.createRaisedBevelBorder(), // hTitleBorder), BorderFactory.createCompoundBorder(hTitleBorder, vTitleBorder)), BorderFactory.createCompoundBorder( scaleBorder, BorderFactory.createLoweredBevelBorder())) ); add(particleDisplayPanel, BorderLayout.CENTER); radioPanel.setVisible(false); add(radioPanel, BorderLayout.SOUTH); this.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { resize(); } public void componentShown(ComponentEvent e) { resize(); } }); // radioPanel.addContainerListener(new ContainerAdapter() {// public void componentAdded(ContainerEvent e) {// System.out.println("******************************* COMPONENT is ADDED");// resize();// }// public void componentRemove(ContainerEvent e) {// resize();// }// }); updateTimeRange(); ParticleMotionDisplayThread t = new ParticleMotionDisplayThread(hseis, timeConfigRegistrar, hAmpConfigRegistrar, vAmpConfigRegistrar, advancedOption, true, this); t.execute(); }
1,119,970
public void changeAccess(Object o, Collection aces) throws CalFacadeException { getCal().changeAccess(o, aces); }
public void changeAccess(Object o, Collection aces) throws CalFacadeException { getCal().changeAccess(o, aces); }
1,119,972
public Collection getAces(Object o) throws CalFacadeException { return getCal().getAces(o); }
public Collection getAces(Object o) throws CalFacadeException { return getCal().getAces(o); }
1,119,973
public void generatePropValue(WebdavNsNode node, WebdavProperty pr) throws WebdavIntfException { QName tag = pr.getTag(); String ns = tag.getNamespaceURI(); boolean isCalendar = node instanceof CaldavCalNode; CaldavCalNode calNode = null; BwCalendar cal = null; if (isCalendar) { calNode = (CaldavCalNode)node; cal = calNode.getCDURI().getCal(); } try { /* Deal with webdav properties */ if (!ns.equals(CaldavDefs.caldavNamespace)) { // Not ours super.generatePropValue(node, pr); return; } if (tag.equals(CaldavTags.calendarDescription)) { if ((cal != null) && (cal.getDescription() != null)) { // XXX lang openPropstat(); xml.property(tag, cal.getDescription()); closePropstat(); } } else if (tag.equals(CaldavTags.calendarTimezone)) { TimeZone tz = getSvci().getTimezones().getDefaultTimeZone(); openPropstat(); xml.property(tag, trans.toStringTzCalendar(tz.getID())); closePropstat(); } else if (tag.equals(CaldavTags.supportedCalendarComponentSet)) { /* e.g. * <C:supported-calendar-component-set * xmlns:C="urn:ietf:params:xml:ns:caldav"> * <C:comp name="VEVENT"/> * <C:comp name="VTODO"/> * </C:supported-calendar-component-set> */ openPropstat(); xml.openTag(tag); xml.startTag(CaldavTags.comp); xml.atribute("name", "VEVENT"); xml.closeTag(tag); closePropstat(); } else if (tag.equals(CaldavTags.supportedCalendarData)) { /* e.g. * <C:supported-calendar-data * xmlns:C="urn:ietf:params:xml:ns:caldav"> * <C:calendar-data content-type="text/calendar" version="2.0"/> * </C:supported-calendar-data> */ openPropstat(); xml.openTag(tag); xml.startTag(CaldavTags.calendarData); xml.atribute("content-type", "text/calendar"); xml.atribute("version", "2.0"); xml.closeTag(tag); closePropstat(); } else if (tag.equals(CaldavTags.maxAttendeesPerInstance)) { } else if (tag.equals(CaldavTags.maxDateTime)) { } else if (tag.equals(CaldavTags.maxInstances)) { } else if (tag.equals(CaldavTags.maxResourceSize)) { /* e.g. * <C:max-resource-size * xmlns:C="urn:ietf:params:xml:ns:caldav">102400</C:max-resource-size> */ openPropstat(); xml.property(tag, String.valueOf(getSvci().getSyspars().getMaxUserEntitySize())); closePropstat(); } else if (tag.equals(CaldavTags.minDateTime)) { } else { // Not known openPropstat(); xml.emptyTag(tag); closePropstat(HttpServletResponse.SC_NOT_FOUND); } } catch (WebdavIntfException wie) { throw wie; } catch (Throwable t) { throw new WebdavIntfException(t); } }
public void generatePropValue(WebdavNsNode node, WebdavProperty pr) throws WebdavIntfException { QName tag = pr.getTag(); String ns = tag.getNamespaceURI(); boolean isCalendar = node instanceof CaldavCalNode; CaldavCalNode calNode = null; BwCalendar cal = null; if (isCalendar) { calNode = (CaldavCalNode)node; cal = calNode.getCDURI().getCal(); } try { /* Deal with webdav properties */ if ((!ns.equals(CaldavDefs.caldavNamespace) && !ns.equals(CaldavDefs.icalNamespace))) { // Not ours super.generatePropValue(node, pr); return; } if (tag.equals(CaldavTags.calendarDescription)) { if ((cal != null) && (cal.getDescription() != null)) { // XXX lang openPropstat(); xml.property(tag, cal.getDescription()); closePropstat(); } } else if (tag.equals(CaldavTags.calendarTimezone)) { TimeZone tz = getSvci().getTimezones().getDefaultTimeZone(); openPropstat(); xml.property(tag, trans.toStringTzCalendar(tz.getID())); closePropstat(); } else if (tag.equals(CaldavTags.supportedCalendarComponentSet)) { /* e.g. * <C:supported-calendar-component-set * xmlns:C="urn:ietf:params:xml:ns:caldav"> * <C:comp name="VEVENT"/> * <C:comp name="VTODO"/> * </C:supported-calendar-component-set> */ openPropstat(); xml.openTag(tag); xml.startTag(CaldavTags.comp); xml.atribute("name", "VEVENT"); xml.closeTag(tag); closePropstat(); } else if (tag.equals(CaldavTags.supportedCalendarData)) { /* e.g. * <C:supported-calendar-data * xmlns:C="urn:ietf:params:xml:ns:caldav"> * <C:calendar-data content-type="text/calendar" version="2.0"/> * </C:supported-calendar-data> */ openPropstat(); xml.openTag(tag); xml.startTag(CaldavTags.calendarData); xml.atribute("content-type", "text/calendar"); xml.atribute("version", "2.0"); xml.closeTag(tag); closePropstat(); } else if (tag.equals(CaldavTags.maxAttendeesPerInstance)) { } else if (tag.equals(CaldavTags.maxDateTime)) { } else if (tag.equals(CaldavTags.maxInstances)) { } else if (tag.equals(CaldavTags.maxResourceSize)) { /* e.g. * <C:max-resource-size * xmlns:C="urn:ietf:params:xml:ns:caldav">102400</C:max-resource-size> */ openPropstat(); xml.property(tag, String.valueOf(getSvci().getSyspars().getMaxUserEntitySize())); closePropstat(); } else if (tag.equals(CaldavTags.minDateTime)) { } else { // Not known openPropstat(); xml.emptyTag(tag); closePropstat(HttpServletResponse.SC_NOT_FOUND); } } catch (WebdavIntfException wie) { throw wie; } catch (Throwable t) { throw new WebdavIntfException(t); } }
1,119,975
public void generatePropValue(WebdavNsNode node, WebdavProperty pr) throws WebdavIntfException { QName tag = pr.getTag(); String ns = tag.getNamespaceURI(); boolean isCalendar = node instanceof CaldavCalNode; CaldavCalNode calNode = null; BwCalendar cal = null; if (isCalendar) { calNode = (CaldavCalNode)node; cal = calNode.getCDURI().getCal(); } try { /* Deal with webdav properties */ if (!ns.equals(CaldavDefs.caldavNamespace)) { // Not ours super.generatePropValue(node, pr); return; } if (tag.equals(CaldavTags.calendarDescription)) { if ((cal != null) && (cal.getDescription() != null)) { // XXX lang openPropstat(); xml.property(tag, cal.getDescription()); closePropstat(); } } else if (tag.equals(CaldavTags.calendarTimezone)) { TimeZone tz = getSvci().getTimezones().getDefaultTimeZone(); openPropstat(); xml.property(tag, trans.toStringTzCalendar(tz.getID())); closePropstat(); } else if (tag.equals(CaldavTags.supportedCalendarComponentSet)) { /* e.g. * <C:supported-calendar-component-set * xmlns:C="urn:ietf:params:xml:ns:caldav"> * <C:comp name="VEVENT"/> * <C:comp name="VTODO"/> * </C:supported-calendar-component-set> */ openPropstat(); xml.openTag(tag); xml.startTag(CaldavTags.comp); xml.atribute("name", "VEVENT"); xml.closeTag(tag); closePropstat(); } else if (tag.equals(CaldavTags.supportedCalendarData)) { /* e.g. * <C:supported-calendar-data * xmlns:C="urn:ietf:params:xml:ns:caldav"> * <C:calendar-data content-type="text/calendar" version="2.0"/> * </C:supported-calendar-data> */ openPropstat(); xml.openTag(tag); xml.startTag(CaldavTags.calendarData); xml.atribute("content-type", "text/calendar"); xml.atribute("version", "2.0"); xml.closeTag(tag); closePropstat(); } else if (tag.equals(CaldavTags.maxAttendeesPerInstance)) { } else if (tag.equals(CaldavTags.maxDateTime)) { } else if (tag.equals(CaldavTags.maxInstances)) { } else if (tag.equals(CaldavTags.maxResourceSize)) { /* e.g. * <C:max-resource-size * xmlns:C="urn:ietf:params:xml:ns:caldav">102400</C:max-resource-size> */ openPropstat(); xml.property(tag, String.valueOf(getSvci().getSyspars().getMaxUserEntitySize())); closePropstat(); } else if (tag.equals(CaldavTags.minDateTime)) { } else { // Not known openPropstat(); xml.emptyTag(tag); closePropstat(HttpServletResponse.SC_NOT_FOUND); } } catch (WebdavIntfException wie) { throw wie; } catch (Throwable t) { throw new WebdavIntfException(t); } }
public void generatePropValue(WebdavNsNode node, WebdavProperty pr) throws WebdavIntfException { QName tag = pr.getTag(); String ns = tag.getNamespaceURI(); boolean isCalendar = node instanceof CaldavCalNode; CaldavCalNode calNode = null; BwCalendar cal = null; if (isCalendar) { calNode = (CaldavCalNode)node; cal = calNode.getCDURI().getCal(); } try { /* Deal with webdav properties */ if (!ns.equals(CaldavDefs.caldavNamespace)) { // Not ours super.generatePropValue(node, pr); return; } if (tag.equals(ICalTags.summary)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.dtstart)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.dtend)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.duration)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.transp)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.due)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.status)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.uid)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.sequence)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.hasRecurrence)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.hasAlarm)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(ICalTags.hasAttachment)) { openPropstat(); xml.property(tag, pr.getPval()); closePropstat(); } else if (tag.equals(CaldavTags.calendarDescription)) { if ((cal != null) && (cal.getDescription() != null)) { // XXX lang openPropstat(); xml.property(tag, cal.getDescription()); closePropstat(); } } else if (tag.equals(CaldavTags.calendarTimezone)) { TimeZone tz = getSvci().getTimezones().getDefaultTimeZone(); openPropstat(); xml.property(tag, trans.toStringTzCalendar(tz.getID())); closePropstat(); } else if (tag.equals(CaldavTags.supportedCalendarComponentSet)) { /* e.g. * <C:supported-calendar-component-set * xmlns:C="urn:ietf:params:xml:ns:caldav"> * <C:comp name="VEVENT"/> * <C:comp name="VTODO"/> * </C:supported-calendar-component-set> */ openPropstat(); xml.openTag(tag); xml.startTag(CaldavTags.comp); xml.atribute("name", "VEVENT"); xml.closeTag(tag); closePropstat(); } else if (tag.equals(CaldavTags.supportedCalendarData)) { /* e.g. * <C:supported-calendar-data * xmlns:C="urn:ietf:params:xml:ns:caldav"> * <C:calendar-data content-type="text/calendar" version="2.0"/> * </C:supported-calendar-data> */ openPropstat(); xml.openTag(tag); xml.startTag(CaldavTags.calendarData); xml.atribute("content-type", "text/calendar"); xml.atribute("version", "2.0"); xml.closeTag(tag); closePropstat(); } else if (tag.equals(CaldavTags.maxAttendeesPerInstance)) { } else if (tag.equals(CaldavTags.maxDateTime)) { } else if (tag.equals(CaldavTags.maxInstances)) { } else if (tag.equals(CaldavTags.maxResourceSize)) { /* e.g. * <C:max-resource-size * xmlns:C="urn:ietf:params:xml:ns:caldav">102400</C:max-resource-size> */ openPropstat(); xml.property(tag, String.valueOf(getSvci().getSyspars().getMaxUserEntitySize())); closePropstat(); } else if (tag.equals(CaldavTags.minDateTime)) { } else { // Not known openPropstat(); xml.emptyTag(tag); closePropstat(HttpServletResponse.SC_NOT_FOUND); } } catch (WebdavIntfException wie) { throw wie; } catch (Throwable t) { throw new WebdavIntfException(t); } }
1,119,976
protected Object getObject(String name, String scope, String property, boolean required) throws JspTagException { try { Object o = RequestUtils.lookup(pageContext, name, property, scope); if (o == null) { if (required) { throw new JspTagException("Unable to find " + name + " in " + scope + " for property " + property); } return null; } return o; } catch (JspTagException jte) { throw jte; } catch (Throwable t) { throw new JspTagException(t.getMessage()); } }
protected Object getObject(String name, String scope, String property, boolean required) throws JspTagException { try { Object o = TagUtils.getInstance().lookup(pageContext, name, property, scope); if (o == null) { if (required) { throw new JspTagException("Unable to find " + name + " in " + scope + " for property " + property); } return null; } return o; } catch (JspTagException jte) { throw jte; } catch (Throwable t) { throw new JspTagException(t.getMessage()); } }
1,119,977
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { try { Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); /*System.out.println("x: " + x + " y: " + y); System.out.println("itop: " + insets.top + " ibottom: " + insets.bottom + "ileft: " + insets.left + " iright: " + insets.right); System.out.println("top: " + top + " bottom: " + bottom + " right: " + right + "left: " + left);*/ FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0) { copy.drawString("No Data", 0, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { try { Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); /*System.out.println("x: " + x + " y: " + y); System.out.println("itop: " + insets.top + " ibottom: " + insets.bottom + "ileft: " + insets.left + " iright: " + insets.right); System.out.println("top: " + top + " bottom: " + bottom + " right: " + right + "left: " + left);*/ FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0) { copy.drawString("No Data", 0, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
1,119,978
public void changeAccess(BwShareableDbentity ent, Collection aces) throws CalFacadeException { try { Acl acl = getAces(ent, privWriteAcl); Iterator it = aces.iterator(); while (it.hasNext()) { Ace ace = (Ace)it.next(); acl.removeAccess(ace); acl.addAce(ace); } ent.setAccess(new String(acl.encode())); } catch (Throwable t) { throw new CalFacadeException(t); } }
public void changeAccess(BwShareableDbentity ent, Collection aces) throws CalFacadeException { try { Acl acl = checkAccess(ent, privWriteAcl, false).acl; Iterator it = aces.iterator(); while (it.hasNext()) { Ace ace = (Ace)it.next(); acl.removeAccess(ace); acl.addAce(ace); } ent.setAccess(new String(acl.encode())); } catch (Throwable t) { throw new CalFacadeException(t); } }
1,119,979
public Collection checkAccess(Collection ents, int desiredAccess, boolean nullForNoAccess) throws CalFacadeException { TreeSet out = new TreeSet(); Iterator it = ents.iterator(); while (it.hasNext()) { BwShareableDbentity sdbe = (BwShareableDbentity)it.next(); if (accessible(sdbe, desiredAccess, nullForNoAccess)) { out.add(sdbe); } } return out; }
public Collection checkAccess(Collection ents, int desiredAccess, boolean nullForNoAccess) throws CalFacadeException { TreeSet out = new TreeSet(); Iterator it = ents.iterator(); while (it.hasNext()) { BwShareableDbentity sdbe = (BwShareableDbentity)it.next(); if (checkAccess(sdbe, desiredAccess, nullForNoAccess).accessAllowed) { out.add(sdbe); } } return out; }
1,119,980
private 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); String appName = getAppName(sess); 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 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); 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(); 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 */ String calSuite = form.retrieveConfig().getCalSuite(); checkSvci(request, form, s, adminUserId, calSuite, getPublicAdmin(form), false, debug); /* 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; }
private 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); String appName = getAppName(sess); 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 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); 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(); 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 */ String calSuite = form.retrieveConfig().getCalSuite(); checkSvci(request, form, s, adminUserId, calSuite, getPublicAdmin(form), false, debug); /* 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,119,981
public void evalAndTestException(String input, Class interpreterExceptionClass) { try { ATAbstractGrammar ptree = NATParser._INSTANCE_.base_parse(NATText.atValue(input)); ptree.meta_eval(ctx_); fail("Expected an exception of type " + interpreterExceptionClass.getSimpleName()); // test should throw an exception } catch (InterpreterException ex) { if (!interpreterExceptionClass.isInstance(ex)) { ex.printStackTrace(); fail("Unexpected exception: "+ex.getMessage()); } } }
public void evalAndTestException(String input, Class interpreterExceptionClass) { try { ATAbstractGrammar ptree = NATParser._INSTANCE_.base_parse(NATText.atValue(input)); ptree.meta_eval(ctx_); fail("Expected an exception of type " + Evaluator.getSimpleName(interpreterExceptionClass)); // test should throw an exception } catch (InterpreterException ex) { if (!interpreterExceptionClass.isInstance(ex)) { ex.printStackTrace(); fail("Unexpected exception: "+ex.getMessage()); } } }
1,119,982
public static final ATObject evalSnippet(Class forTestClass, String name, ATContext inContext) throws InterpreterException { try { File inFile = new File(forTestClass.getResource(forTestClass.getSimpleName() + "-" + name).toURI()); // load the code from the file String code = Evaluator.loadContentOfFile(inFile); // parse and evaluate the code in the proper context and return its result ATAbstractGrammar source = NATParser.parse(inFile.getName(), code); return source.meta_eval(inContext); } catch (IOException e) { throw new XIOProblem(e); } catch (URISyntaxException e) { fail(e.getMessage()); return null; } }
public static final ATObject evalSnippet(Class forTestClass, String name, ATContext inContext) throws InterpreterException { try { File inFile = new File(new URI(forTestClass.getResource(Evaluator.getSimpleName(forTestClass) + "-" + name).toString())); // load the code from the file String code = Evaluator.loadContentOfFile(inFile); // parse and evaluate the code in the proper context and return its result ATAbstractGrammar source = NATParser.parse(inFile.getName(), code); return source.meta_eval(inContext); } catch (IOException e) { throw new XIOProblem(e); } catch (URISyntaxException e) { fail(e.getMessage()); return null; } }
1,119,983
public static final ATObject evalSnippet(Class forTestClass, String name, ATContext inContext) throws InterpreterException { try { File inFile = new File(forTestClass.getResource(forTestClass.getSimpleName() + "-" + name).toURI()); // load the code from the file String code = Evaluator.loadContentOfFile(inFile); // parse and evaluate the code in the proper context and return its result ATAbstractGrammar source = NATParser.parse(inFile.getName(), code); return source.meta_eval(inContext); } catch (IOException e) { throw new XIOProblem(e); } catch (URISyntaxException e) { fail(e.getMessage()); return null; } }
public static final ATObject evalSnippet(Class forTestClass, String name, ATContext inContext) throws InterpreterException { try { File inFile = new File(forTestClass.getResource(forTestClass.getSimpleName() + "-" + name).toURI()); // load the code from the file String code = Evaluator.loadContentOfFile(inFile); // parse and evaluate the code in the proper context and return its result ATAbstractGrammar source = NATParser.parse(inFile.getName(), code); return source.meta_eval(inContext); } catch (IOException e) { throw new XIOProblem(e); } catch (URISyntaxException e) { fail(e.getMessage()); return NATNil._INSTANCE_; } }
1,119,984
public ATTable base_getParameters() throws InterpreterException { Class[] paramTypes = javaMethod_.getParameterTypes(); AGSymbol[] paramNames = new AGSymbol[paramTypes.length]; for (int i = 0; i < paramTypes.length; i++) { paramNames[i] = AGSymbol.alloc(Evaluator.valueNameOf(paramTypes[i])); } return new NATTable(paramNames); }
public ATTable base_getParameters() throws InterpreterException { Class[] paramTypes = javaMethod_.getParameterTypes(); AGSymbol[] paramNames = new AGSymbol[paramTypes.length]; for (int i = 0; i < paramTypes.length; i++) { paramNames[i] = AGSymbol.jAlloc(Evaluator.valueNameOf(paramTypes[i])); } return new NATTable(paramNames); }
1,119,985
public void addCalendar(BwCalendar val, BwCalendar parent) throws CalFacadeException { checkOpen(); /* We need write access to the parent */ access.accessible(parent, privWrite, false); /** Is the parent a calendar collection? *//* sess.namedQuery("countCalendarEventRefs"); sess.setEntity("cal", parent); Integer res = (Integer)sess.getUnique(); if (res.intValue() > 0) {*/ if (parent.getCalendarCollection()) { throw new CalFacadeException(CalFacadeException.illegalCalendarCreation); } /* Ensure the path is unique */ String path = parent.getPath(); if (path == null) { if (parent.getPublick()) { path = ""; } else { path = "/users/" + parent.getOwner().getAccount(); } } path += "/" + val.getName(); sess.namedQuery("getCalendarByPath"); sess.setString("path", path); if (sess.getUnique() != null) { throw new CalFacadeException(CalFacadeException.duplicateCalendar); } val.setPath(path); val.setOwner(user); val.setCalendar(parent); parent.addChild(val); sess.save(parent); }
public void addCalendar(BwCalendar val, BwCalendar parent) throws CalFacadeException { checkOpen(); /* We need write access to the parent */ access.accessible(parent, privWrite, false); /** Is the parent a calendar collection? *//* sess.namedQuery("countCalendarEventRefs"); sess.setEntity("cal", parent); Integer res = (Integer)sess.getUnique(); if (res.intValue() > 0) {*/ if (parent.getCalendarCollection()) { throw new CalFacadeException(CalFacadeException.illegalCalendarCreation); } /* Ensure the path is unique */ String path = parent.getPath(); if (path == null) { if (parent.getPublick()) { path = ""; } else { path = "/users/" + parent.getOwner().getAccount(); } } path += "/" + val.getName(); sess.namedQuery("getCalendarByPath"); sess.setString("path", path); if (sess.getUnique() != null) { throw new CalFacadeException(CalFacadeException.duplicateCalendar); } val.setPath(path); val.setOwner(user); val.setCalendar(parent); parent.addChild(val); sess.save(parent); }
1,119,987
public void addUser(BwUser user) throws CalFacadeException { checkOpen(); user.setCategoryAccess(access.getDefaultPersonalAccess()); user.setLocationAccess(access.getDefaultPersonalAccess()); user.setSponsorAccess(access.getDefaultPersonalAccess()); user.setQuota(getSyspars().getDefaultUserQuota()); sess.save(user); /* Add a user collection to the userCalendarRoot and then a default calendar collection. */ sess.namedQuery("getCalendarByPath"); String path = "/" + getSyspars().getUserCalendarRoot(); sess.setString("path", path); BwCalendar userrootcal = (BwCalendar)sess.getUnique(); if (userrootcal == null) { throw new CalFacadeException("No user root at " + path); } path += "/" + user.getAccount(); sess.namedQuery("getCalendarByPath"); sess.setString("path", path); BwCalendar usercal = (BwCalendar)sess.getUnique(); if (usercal != null) { throw new CalFacadeException("User calendar already exists at " + path); } /* Create a folder for the user */ usercal = new BwCalendar(); usercal.setName(user.getAccount()); usercal.setCreator(user); usercal.setOwner(user); usercal.setPublick(false); usercal.setPath(path); usercal.setCalendar(userrootcal); userrootcal.addChild(usercal); sess.save(userrootcal); /* Create a default calendar */ BwCalendar cal = new BwCalendar(); cal.setName(getSyspars().getUserDefaultCalendar()); cal.setCreator(user); cal.setOwner(user); cal.setPublick(false); cal.setPath(path + "/" + getSyspars().getUserDefaultCalendar()); cal.setCalendar(usercal); cal.setCalendarCollection(true); usercal.addChild(cal); /* Add the trash calendar */ cal = new BwCalendar(); cal.setName(getSyspars().getDefaultTrashCalendar()); cal.setCreator(user); cal.setOwner(user); cal.setPublick(false); cal.setPath(path + "/" + getSyspars().getDefaultTrashCalendar()); cal.setCalendar(usercal); cal.setCalendarCollection(true); usercal.addChild(cal); /* Add the inbox */ cal = new BwCalendar(); cal.setName(getSyspars().getUserInbox()); cal.setCreator(user); cal.setOwner(user); cal.setPublick(false); cal.setPath(path + "/" + getSyspars().getUserInbox()); cal.setCalendar(usercal); cal.setCalendarCollection(true); usercal.addChild(cal); /* Add the outbox */ cal = new BwCalendar(); cal.setName(getSyspars().getUserOutbox()); cal.setCreator(user); cal.setOwner(user); cal.setPublick(false); cal.setPath(path + "/" + getSyspars().getUserOutbox()); cal.setCalendar(usercal); cal.setCalendarCollection(true); usercal.addChild(cal); sess.save(usercal); sess.update(user); }
public void addUser(BwUser user) throws CalFacadeException { checkOpen(); user.setCategoryAccess(access.getDefaultPersonalAccess()); user.setLocationAccess(access.getDefaultPersonalAccess()); user.setSponsorAccess(access.getDefaultPersonalAccess()); user.setQuota(getSyspars().getDefaultUserQuota()); sess.save(user); /* Add a user collection to the userCalendarRoot and then a default calendar collection. */ sess.namedQuery("getCalendarByPath"); String path = "/" + getSyspars().getUserCalendarRoot(); sess.setString("path", path); BwCalendar userrootcal = (BwCalendar)sess.getUnique(); if (userrootcal == null) { throw new CalFacadeException("No user root at " + path); } path += "/" + user.getAccount(); sess.namedQuery("getCalendarByPath"); sess.setString("path", path); BwCalendar usercal = (BwCalendar)sess.getUnique(); if (usercal != null) { throw new CalFacadeException("User calendar already exists at " + path); } /* Create a folder for the user */ usercal = new BwCalendar(); usercal.setName(user.getAccount()); usercal.setCreator(user); usercal.setOwner(user); usercal.setPublick(false); usercal.setPath(path); usercal.setCalendar(userrootcal); userrootcal.addChild(usercal); sess.save(userrootcal); /* Create a default calendar */ BwCalendar cal = new BwCalendar(); cal.setName(getSyspars().getUserDefaultCalendar()); cal.setCreator(user); cal.setOwner(user); cal.setPublick(false); cal.setPath(path + "/" + getSyspars().getUserDefaultCalendar()); cal.setCalendar(usercal); cal.setCalendarCollection(true); usercal.addChild(cal); /* Add the trash calendar */ cal = new BwCalendar(); cal.setName(getSyspars().getDefaultTrashCalendar()); cal.setCreator(user); cal.setOwner(user); cal.setPublick(false); cal.setPath(path + "/" + getSyspars().getDefaultTrashCalendar()); cal.setCalendar(usercal); cal.setCalendarCollection(true); usercal.addChild(cal); /* Add the inbox */ cal = new BwCalendar(); cal.setName(getSyspars().getUserInbox()); cal.setCreator(user); cal.setOwner(user); cal.setPublick(false); cal.setPath(path + "/" + getSyspars().getUserInbox()); cal.setCalendar(usercal); cal.setCalendarCollection(true); usercal.addChild(cal); /* Add the outbox */ cal = new BwCalendar(); cal.setName(getSyspars().getUserOutbox()); cal.setCreator(user); cal.setOwner(user); cal.setPublick(false); cal.setPath(path + "/" + getSyspars().getUserOutbox()); cal.setCalendar(usercal); cal.setCalendarCollection(true); usercal.addChild(cal); sess.save(usercal); sess.update(user); }
1,119,988
public boolean checkCalendarRefs(BwCalendar val) throws CalFacadeException { checkOpen(); sess.namedQuery("countCalendarEventRefs"); sess.setEntity("cal", val); Integer res = (Integer)sess.getUnique(); if (debug) { trace(" ----------- count = " + res); } if (res == null) { return false; } return res.intValue() > 0; }
public boolean checkCalendarRefs(BwCalendar val) throws CalFacadeException { checkOpen(); sess.namedQuery("countCalendarEventRefs"); sess.setEntity("cal", val); Integer res = (Integer)sess.getUnique(); if (debug) { trace(" ----------- count = " + res); } if (res == null) { return false; } return res.intValue() > 0; }
1,119,989
public boolean deleteCalendar(BwCalendar val) throws CalFacadeException { checkOpen(); BwCalendar parent = val.getCalendar(); if (parent == null) { throw new CalFacadeException(CalFacadeException.cannotDeleteCalendarRoot); } //sess.delete(val); parent.removeChild(val); sess.update(parent); return true; }
public boolean deleteCalendar(BwCalendar val) throws CalFacadeException { checkOpen(); BwCalendar parent = val.getCalendar(); if (parent == null) { throw new CalFacadeException(CalFacadeException.cannotDeleteCalendarRoot); } //sess.delete(val); parent.removeChild(val); sess.update(parent); return true; }
1,119,990
public Collection getAddContentCalendarCollections() throws CalFacadeException { if (currentMode == CalintfUtil.guestMode) { return new TreeSet(); } checkOpen(); sess.namedQuery("getUserCalendarCollections"); sess.setEntity("owner", user); sess.cacheableQuery(); return access.checkAccess(sess.getList(), privWriteContent, true); }
public Collection getAddContentCalendarCollections() throws CalFacadeException { if (currentMode == CalintfUtil.guestMode) { return new TreeSet(); } checkOpen(); sess.namedQuery("getUserCalendarCollections"); sess.setEntity("owner", user); sess.cacheableQuery(); return access.checkAccess(sess.getList(), privWriteContent, true); }
1,119,991
public Collection getAddContentPublicCalendarCollections() throws CalFacadeException { checkOpen(); sess.namedQuery("getPublicCalendarCollections"); sess.cacheableQuery(); return access.checkAccess(sess.getList(), privWriteContent, true); }
public Collection getAddContentPublicCalendarCollections() throws CalFacadeException { checkOpen(); sess.namedQuery("getPublicCalendarCollections"); sess.cacheableQuery(); return access.checkAccess(sess.getList(), privWriteContent, true); }
1,119,992
public BwCalendar getCalendar(int val) throws CalFacadeException { checkOpen(); sess.namedQuery("getCalendarById"); sess.setInt("id", val); sess.cacheableQuery(); return (BwCalendar)sess.getUnique(); }
public BwCalendar getCalendar(int val) throws CalFacadeException { checkOpen(); sess.namedQuery("getCalendarById"); sess.setInt("id", val); sess.cacheableQuery(); return (BwCalendar)sess.getUnique(); }
1,119,993
public Collection getCalendarCollections() throws CalFacadeException { checkOpen(); sess.namedQuery("getUserCalendarCollections"); sess.setEntity("owner", user); sess.cacheableQuery(); return access.checkAccess(sess.getList(), privWrite, true); }
public Collection getCalendarCollections() throws CalFacadeException { checkOpen(); sess.namedQuery("getUserCalendarCollections"); sess.setEntity("owner", user); sess.cacheableQuery(); return access.checkAccess(sess.getList(), privWrite, true); }
1,119,994
public BwCalendar getCalendars() throws CalFacadeException { if (currentMode == CalintfUtil.guestMode) { return getPublicCalendars(); } checkOpen(); sess.namedQuery("getCalendarByPath"); sess.setString("path", userCalendarRootPath + "/" + user.getAccount()); sess.cacheableQuery(); return (BwCalendar)sess.getUnique(); }
public BwCalendar getCalendars() throws CalFacadeException { if (currentMode == CalintfUtil.guestMode) { return getPublicCalendars(); } checkOpen(); sess.namedQuery("getCalendarByPath"); sess.setString("path", userCalendarRootPath + "/" + user.getAccount()); sess.cacheableQuery(); return (BwCalendar)sess.getUnique(); }
1,119,995
public BwCalendar getDefaultCalendar() throws CalFacadeException { StringBuffer sb = new StringBuffer(); sb.append("/"); sb.append(getSyspars().getUserCalendarRoot()); sb.append("/"); sb.append(user.getAccount()); sb.append("/"); sb.append(getSyspars().getUserDefaultCalendar()); return getCalendar(sb.toString()); }
public BwCalendar getDefaultCalendar() throws CalFacadeException { StringBuffer sb = new StringBuffer(); sb.append("/"); sb.append(getSyspars().getUserCalendarRoot()); sb.append("/"); sb.append(user.getAccount()); sb.append("/"); sb.append(getSyspars().getUserDefaultCalendar()); return getCalendar(sb.toString()); }
1,119,996
public Collection getPublicCalendarCollections() throws CalFacadeException { checkOpen(); sess.namedQuery("getPublicCalendarCollections"); sess.cacheableQuery(); return access.checkAccess(sess.getList(), privWrite, true); }
public Collection getPublicCalendarCollections() throws CalFacadeException { checkOpen(); sess.namedQuery("getPublicCalendarCollections"); sess.cacheableQuery(); return access.checkAccess(sess.getList(), privWrite, true); }
1,119,997
public BwCalendar getPublicCalendars() throws CalFacadeException { checkOpen(); sess.namedQuery("getCalendarByPath"); sess.setString("path", publicCalendarRootPath); sess.cacheableQuery(); /* XXX access checks */ return (BwCalendar)sess.getUnique(); }
public BwCalendar getPublicCalendars() throws CalFacadeException { checkOpen(); sess.namedQuery("getCalendarByPath"); sess.setString("path", publicCalendarRootPath); sess.cacheableQuery(); /* XXX access checks */ return (BwCalendar)sess.getUnique(); }
1,119,998
public BwCalendar getTrashCalendar() throws CalFacadeException { StringBuffer sb = new StringBuffer(); sb.append("/"); sb.append(getSyspars().getUserCalendarRoot()); sb.append("/"); sb.append(user.getAccount()); sb.append("/"); sb.append(getSyspars().getDefaultTrashCalendar()); return getCalendar(sb.toString()); }
public BwCalendar getTrashCalendar() throws CalFacadeException { StringBuffer sb = new StringBuffer(); sb.append("/"); sb.append(getSyspars().getUserCalendarRoot()); sb.append("/"); sb.append(user.getAccount()); sb.append("/"); sb.append(getSyspars().getDefaultTrashCalendar()); return getCalendar(sb.toString()); }
1,119,999
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } /** Define the roots of the calendars. * / publicCalendarRoot = CalEnv.getGlobalProperty("public.calroot"); userCalendarRoot = CalEnv.getGlobalProperty("user.calroot"); userDefaultCalendar = CalEnv.getGlobalProperty("default.user.calendar"); defaultTrashCalendar = CalEnv.getGlobalProperty("default.trash.calendar"); systemId = CalEnv.getGlobalProperty("systemid"); */ } catch (Throwable t) { throw new CalFacadeException(t); } publicCalendarRootPath = "/" + getSyspars().getPublicCalendarRoot(); userCalendarRootPath = "/" + getSyspars().getUserCalendarRoot(); //systemId = getSyspars().getSystemid(); if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, sess, this.user, debug); categories = new EventProperties(this, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); return userCreated; }
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } /** Define the roots of the calendars. * / publicCalendarRoot = CalEnv.getGlobalProperty("public.calroot"); userCalendarRoot = CalEnv.getGlobalProperty("user.calroot"); userDefaultCalendar = CalEnv.getGlobalProperty("default.user.calendar"); defaultTrashCalendar = CalEnv.getGlobalProperty("default.trash.calendar"); systemId = CalEnv.getGlobalProperty("systemid"); */ } catch (Throwable t) { throw new CalFacadeException(t); } publicCalendarRootPath = "/" + getSyspars().getPublicCalendarRoot(); userCalendarRootPath = "/" + getSyspars().getUserCalendarRoot(); //systemId = getSyspars().getSystemid(); if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, sess, this.user, debug); categories = new EventProperties(this, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); return userCreated; }
1,120,000
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } /** Define the roots of the calendars. * / publicCalendarRoot = CalEnv.getGlobalProperty("public.calroot"); userCalendarRoot = CalEnv.getGlobalProperty("user.calroot"); userDefaultCalendar = CalEnv.getGlobalProperty("default.user.calendar"); defaultTrashCalendar = CalEnv.getGlobalProperty("default.trash.calendar"); systemId = CalEnv.getGlobalProperty("systemid"); */ } catch (Throwable t) { throw new CalFacadeException(t); } publicCalendarRootPath = "/" + getSyspars().getPublicCalendarRoot(); userCalendarRootPath = "/" + getSyspars().getUserCalendarRoot(); //systemId = getSyspars().getSystemid(); if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, sess, this.user, debug); categories = new EventProperties(this, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); return userCreated; }
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } /** Define the roots of the calendars. * / publicCalendarRoot = CalEnv.getGlobalProperty("public.calroot"); userCalendarRoot = CalEnv.getGlobalProperty("user.calroot"); userDefaultCalendar = CalEnv.getGlobalProperty("default.user.calendar"); defaultTrashCalendar = CalEnv.getGlobalProperty("default.trash.calendar"); systemId = CalEnv.getGlobalProperty("systemid"); */ } catch (Throwable t) { throw new CalFacadeException(t); } publicCalendarRootPath = "/" + getSyspars().getPublicCalendarRoot(); userCalendarRootPath = "/" + getSyspars().getUserCalendarRoot(); //systemId = getSyspars().getSystemid(); if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, sess, this.user, debug); categories = new EventProperties(this, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); return userCreated; }
1,120,001
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } /** Define the roots of the calendars. * / publicCalendarRoot = CalEnv.getGlobalProperty("public.calroot"); userCalendarRoot = CalEnv.getGlobalProperty("user.calroot"); userDefaultCalendar = CalEnv.getGlobalProperty("default.user.calendar"); defaultTrashCalendar = CalEnv.getGlobalProperty("default.trash.calendar"); systemId = CalEnv.getGlobalProperty("systemid"); */ } catch (Throwable t) { throw new CalFacadeException(t); } publicCalendarRootPath = "/" + getSyspars().getPublicCalendarRoot(); userCalendarRootPath = "/" + getSyspars().getUserCalendarRoot(); //systemId = getSyspars().getSystemid(); if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, sess, this.user, debug); categories = new EventProperties(this, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); return userCreated; }
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } /** Define the roots of the calendars. * / publicCalendarRoot = CalEnv.getGlobalProperty("public.calroot"); userCalendarRoot = CalEnv.getGlobalProperty("user.calroot"); userDefaultCalendar = CalEnv.getGlobalProperty("default.user.calendar"); defaultTrashCalendar = CalEnv.getGlobalProperty("default.trash.calendar"); systemId = CalEnv.getGlobalProperty("systemid"); */ } catch (Throwable t) { throw new CalFacadeException(t); } publicCalendarRootPath = "/" + getSyspars().getPublicCalendarRoot(); userCalendarRootPath = "/" + getSyspars().getUserCalendarRoot(); //systemId = getSyspars().getSystemid(); if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, this.user, debug); categories = new EventProperties(this, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); return userCreated; }
1,120,002
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } /** Define the roots of the calendars. * / publicCalendarRoot = CalEnv.getGlobalProperty("public.calroot"); userCalendarRoot = CalEnv.getGlobalProperty("user.calroot"); userDefaultCalendar = CalEnv.getGlobalProperty("default.user.calendar"); defaultTrashCalendar = CalEnv.getGlobalProperty("default.trash.calendar"); systemId = CalEnv.getGlobalProperty("systemid"); */ } catch (Throwable t) { throw new CalFacadeException(t); } publicCalendarRootPath = "/" + getSyspars().getPublicCalendarRoot(); userCalendarRootPath = "/" + getSyspars().getUserCalendarRoot(); //systemId = getSyspars().getSystemid(); if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, sess, this.user, debug); categories = new EventProperties(this, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); return userCreated; }
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } /** Define the roots of the calendars. * / publicCalendarRoot = CalEnv.getGlobalProperty("public.calroot"); userCalendarRoot = CalEnv.getGlobalProperty("user.calroot"); userDefaultCalendar = CalEnv.getGlobalProperty("default.user.calendar"); defaultTrashCalendar = CalEnv.getGlobalProperty("default.trash.calendar"); systemId = CalEnv.getGlobalProperty("systemid"); */ } catch (Throwable t) { throw new CalFacadeException(t); } publicCalendarRootPath = "/" + getSyspars().getPublicCalendarRoot(); userCalendarRootPath = "/" + getSyspars().getUserCalendarRoot(); //systemId = getSyspars().getSystemid(); if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, sess, this.user, debug); calendars = new Calendars(this, access, this.user, debug); categories = new EventProperties(this, access, this.user, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); return userCreated; }
1,120,003
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } /** Define the roots of the calendars. * / publicCalendarRoot = CalEnv.getGlobalProperty("public.calroot"); userCalendarRoot = CalEnv.getGlobalProperty("user.calroot"); userDefaultCalendar = CalEnv.getGlobalProperty("default.user.calendar"); defaultTrashCalendar = CalEnv.getGlobalProperty("default.trash.calendar"); systemId = CalEnv.getGlobalProperty("systemid"); */ } catch (Throwable t) { throw new CalFacadeException(t); } publicCalendarRootPath = "/" + getSyspars().getPublicCalendarRoot(); userCalendarRootPath = "/" + getSyspars().getUserCalendarRoot(); //systemId = getSyspars().getSystemid(); if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, sess, this.user, debug); categories = new EventProperties(this, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); return userCreated; }
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } /** Define the roots of the calendars. * / publicCalendarRoot = CalEnv.getGlobalProperty("public.calroot"); userCalendarRoot = CalEnv.getGlobalProperty("user.calroot"); userDefaultCalendar = CalEnv.getGlobalProperty("default.user.calendar"); defaultTrashCalendar = CalEnv.getGlobalProperty("default.trash.calendar"); systemId = CalEnv.getGlobalProperty("systemid"); */ } catch (Throwable t) { throw new CalFacadeException(t); } publicCalendarRootPath = "/" + getSyspars().getPublicCalendarRoot(); userCalendarRootPath = "/" + getSyspars().getUserCalendarRoot(); //systemId = getSyspars().getSystemid(); if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, sess, this.user, debug); categories = new EventProperties(this, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, this.user, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); return userCreated; }
1,120,004
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } /** Define the roots of the calendars. * / publicCalendarRoot = CalEnv.getGlobalProperty("public.calroot"); userCalendarRoot = CalEnv.getGlobalProperty("user.calroot"); userDefaultCalendar = CalEnv.getGlobalProperty("default.user.calendar"); defaultTrashCalendar = CalEnv.getGlobalProperty("default.trash.calendar"); systemId = CalEnv.getGlobalProperty("systemid"); */ } catch (Throwable t) { throw new CalFacadeException(t); } publicCalendarRootPath = "/" + getSyspars().getPublicCalendarRoot(); userCalendarRootPath = "/" + getSyspars().getUserCalendarRoot(); //systemId = getSyspars().getSystemid(); if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, sess, this.user, debug); categories = new EventProperties(this, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); return userCreated; }
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } /** Define the roots of the calendars. * / publicCalendarRoot = CalEnv.getGlobalProperty("public.calroot"); userCalendarRoot = CalEnv.getGlobalProperty("user.calroot"); userDefaultCalendar = CalEnv.getGlobalProperty("default.user.calendar"); defaultTrashCalendar = CalEnv.getGlobalProperty("default.trash.calendar"); systemId = CalEnv.getGlobalProperty("systemid"); */ } catch (Throwable t) { throw new CalFacadeException(t); } publicCalendarRootPath = "/" + getSyspars().getPublicCalendarRoot(); userCalendarRootPath = "/" + getSyspars().getUserCalendarRoot(); //systemId = getSyspars().getSystemid(); if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, sess, this.user, debug); categories = new EventProperties(this, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, this.user, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); return userCreated; }
1,120,005
public synchronized void open() throws CalFacadeException { if (isOpen) { throw new CalFacadeException("Already open"); } isOpen = true; if (sess == null) { if (debug) { log.debug("New hibernate session for " + objTimestamp); } sess = new HibSession(sessFactory, log); if (events != null) { events.setHibSession(sess); } } else { if (debug) { log.debug("Reconnect hibernate session for " + objTimestamp); } sess.reconnect(); } if (access != null) { access.open(); }// personalModified = new Vector(); }
public synchronized void open() throws CalFacadeException { if (isOpen) { throw new CalFacadeException("Already open"); } isOpen = true; if (sess == null) { if (debug) { log.debug("New hibernate session for " + objTimestamp); } sess = new HibSession(sessFactory, log); if (events != null) { events.setHibSession(sess); } } else { if (debug) { log.debug("Reconnect hibernate session for " + objTimestamp); } sess.reconnect(); } if (access != null) { access.open(); }// personalModified = new Vector(); }
1,120,007
public void updateCalendar(BwCalendar val) throws CalFacadeException { checkOpen(); sess.update(val); }
public void updateCalendar(BwCalendar val) throws CalFacadeException { checkOpen(); calendars.updateCalendar(val); }
1,120,008
public void show(JComponent invoker, int x, int y) { menuItemCut.setEnabled(text.isEditable()); menuItemPaste.setEnabled(text.isEditable()); super.show(invoker, x, y); }
public void show(Component invoker, int x, int y) { menuItemCut.setEnabled(text.isEditable()); menuItemPaste.setEnabled(text.isEditable()); super.show(invoker, x, y); }
1,120,009
public Map getParameterMap() { return (parameterMap == null) ? new HashMap(0) : parameterMap; }
public Map getParameterMap() { if (parameterMap == null) { parameterMap = new HashMap(0); } return parameterMap; }
1,120,010
private void addGroupedSelection(Selection creator, VerticalSeismogramDisplay reaper){ DataSetSeismogram[] creatorSeismos = creator.getSeismograms(); DataSetSeismogram[][] componentSorted = DisplayUtils.getComponents(creatorSeismos, "." + creator.getColor()); for(int i = 0; i < componentSorted.length; i++){ ((TimeConfig)creator.getInternalRegistrar()).add(componentSorted[i]); threeSelectionDisplay.addDisplay(componentSorted[i], (TimeConfig)creator.getInternalRegistrar()); } Iterator g = basicDisplays.iterator(); while(g.hasNext()){ BasicSeismogramDisplay current = ((BasicSeismogramDisplay)g.next()); DataSetSeismogram[] basicDisplaySeismos = current.getSeismograms(); for(int i = 0; i < componentSorted.length; i++){ for(int j = 0; j < basicDisplaySeismos.length; j++){ for(int k = 0; k < componentSorted[i].length; k++){ if(componentSorted[i][k].getSeismogram() == basicDisplaySeismos[j].getSeismogram()){ current.add3CSelection(creator); creator.addParent(current); } } } } } Arrival[] parentArrivals = creator.getParent().getArrivals(); if(parentArrivals != null){ ((ComponentSortedSeismogramDisplay)threeSelectionDisplay).addFlags(parentArrivals); } creator.getInternalRegistrar().shaleTime(0, 1); }
private void addGroupedSelection(Selection creator, VerticalSeismogramDisplay reaper){ DataSetSeismogram[] creatorSeismos = creator.getSeismograms(); DataSetSeismogram[][] componentSorted = DisplayUtils.getComponents(creatorSeismos, "." + creator.getColor()); for(int i = 0; i < componentSorted.length; i++){ ((TimeConfig)creator.getInternalRegistrar()).add(componentSorted[i]); threeSelectionDisplay.addDisplay(componentSorted[i], (TimeConfig)creator.getInternalRegistrar()); } Iterator g = basicDisplays.iterator(); while(g.hasNext()){ BasicSeismogramDisplay current = ((BasicSeismogramDisplay)g.next()); DataSetSeismogram[] basicDisplaySeismos = current.getSeismograms(); for(int i = 0; i < componentSorted.length; i++){ for(int j = 0; j < basicDisplaySeismos.length; j++){ for(int k = 0; k < componentSorted[i].length; k++){ if(componentSorted[i][k].getSeismogram() == basicDisplaySeismos[j].getSeismogram()){ current.add3CSelection(creator); creator.addParent(current); } } } } } Arrival[] parentArrivals = creator.getParent().getArrivals(); if(parentArrivals != null){ ((ComponentSortedSeismogramDisplay)threeSelectionDisplay).addFlags(parentArrivals); } creator.getInternalRegistrar().shaleTime(0, 1); }
1,120,011
private void addGroupedSelection(Selection creator, VerticalSeismogramDisplay reaper){ DataSetSeismogram[] creatorSeismos = creator.getSeismograms(); DataSetSeismogram[][] componentSorted = DisplayUtils.getComponents(creatorSeismos, "." + creator.getColor()); for(int i = 0; i < componentSorted.length; i++){ ((TimeConfig)creator.getInternalRegistrar()).add(componentSorted[i]); threeSelectionDisplay.addDisplay(componentSorted[i], (TimeConfig)creator.getInternalRegistrar()); } Iterator g = basicDisplays.iterator(); while(g.hasNext()){ BasicSeismogramDisplay current = ((BasicSeismogramDisplay)g.next()); DataSetSeismogram[] basicDisplaySeismos = current.getSeismograms(); for(int i = 0; i < componentSorted.length; i++){ for(int j = 0; j < basicDisplaySeismos.length; j++){ for(int k = 0; k < componentSorted[i].length; k++){ if(componentSorted[i][k].getSeismogram() == basicDisplaySeismos[j].getSeismogram()){ current.add3CSelection(creator); creator.addParent(current); } } } } } Arrival[] parentArrivals = creator.getParent().getArrivals(); if(parentArrivals != null){ ((ComponentSortedSeismogramDisplay)threeSelectionDisplay).addFlags(parentArrivals); } creator.getInternalRegistrar().shaleTime(0, 1); }
private void addGroupedSelection(Selection creator, VerticalSeismogramDisplay reaper){ DataSetSeismogram[] creatorSeismos = creator.getSeismograms(); DataSetSeismogram[][] componentSorted = DisplayUtils.getComponents(creatorSeismos, "." + creator.getColor()); for(int i = 0; i < componentSorted.length; i++){ ((TimeConfig)creator.getInternalRegistrar()).add(componentSorted[i]); threeSelectionDisplay.addDisplay(componentSorted[i], (TimeConfig)creator.getInternalRegistrar()); } Iterator g = basicDisplays.iterator(); while(g.hasNext()){ BasicSeismogramDisplay current = ((BasicSeismogramDisplay)g.next()); DataSetSeismogram[] basicDisplaySeismos = current.getSeismograms(); for(int i = 0; i < componentSorted.length; i++){ for(int j = 0; j < basicDisplaySeismos.length; j++){ for(int k = 0; k < componentSorted[i].length; k++){ if(componentSorted[i][k].getSeismogram() == basicDisplaySeismos[j].getSeismogram()){ current.add3CSelection(creator); creator.addParent(current); } } } } } Arrival[] parentArrivals = creator.getParent().getArrivals(); if(parentArrivals != null){ ((ComponentSortedSeismogramDisplay)threeSelectionDisplay).addFlags(parentArrivals); } creator.getInternalRegistrar().shaleTime(0, 1); }
1,120,012
public void windowClosing(WindowEvent e) { selectionDisplay.removeAll(); }
public void windowClosing(WindowEvent e) { removeSelectionDisplay(); }
1,120,013
public void createThreeSelectionDisplay(Selection creator){ if(threeSelectionDisplay == null){ logger.debug("creating 3C selection display"); threeSelectionWindow = new JFrame(particleTagWindowName); threeSelectionWindow.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { threeSelectionDisplay.removeAll(); } }); threeSelectionWindow.setSize(400, 400); Toolkit tk = Toolkit.getDefaultToolkit(); threeSelectionWindow.setLocation((tk.getScreenSize().width - threeSelectionWindow.getSize().width)/2, (tk.getScreenSize().height - threeSelectionWindow.getSize().height)/2); threeSelectionDisplay = new MultiSeismogramWindowDisplay(mouseForwarder, motionForwarder, this); addGroupedSelection(creator, threeSelectionDisplay); threeSelectionWindow.getContentPane().add(new JScrollPane(threeSelectionDisplay)); threeSelectionWindow.setVisible(true); }else{ logger.debug("adding another 3Cselection"); addGroupedSelection(creator, threeSelectionDisplay); threeSelectionWindow.toFront(); } }
public void createThreeSelectionDisplay(Selection creator){ if(threeSelectionDisplay == null){ logger.debug("creating 3C selection display"); threeSelectionWindow = new JFrame(particleTagWindowName); threeSelectionWindow.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { threeSelectionDisplay.removeAll(); } }); threeSelectionWindow.setSize(400, 400); Toolkit tk = Toolkit.getDefaultToolkit(); threeSelectionWindow.setLocation((tk.getScreenSize().width - threeSelectionWindow.getSize().width)/2, (tk.getScreenSize().height - threeSelectionWindow.getSize().height)/2); threeSelectionDisplay = new MultiSeismogramWindowDisplay(mouseForwarder, motionForwarder, this); addGroupedSelection(creator, threeSelectionDisplay); threeSelectionWindow.getContentPane().add(new JScrollPane(threeSelectionDisplay)); threeSelectionWindow.setVisible(true); }else{ logger.debug("adding another 3Cselection"); addGroupedSelection(creator, threeSelectionDisplay); threeSelectionWindow.toFront(); } }
1,120,014
public void createThreeSelectionDisplay(Selection creator){ if(threeSelectionDisplay == null){ logger.debug("creating 3C selection display"); threeSelectionWindow = new JFrame(particleTagWindowName); threeSelectionWindow.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { threeSelectionDisplay.removeAll(); } }); threeSelectionWindow.setSize(400, 400); Toolkit tk = Toolkit.getDefaultToolkit(); threeSelectionWindow.setLocation((tk.getScreenSize().width - threeSelectionWindow.getSize().width)/2, (tk.getScreenSize().height - threeSelectionWindow.getSize().height)/2); threeSelectionDisplay = new MultiSeismogramWindowDisplay(mouseForwarder, motionForwarder, this); addGroupedSelection(creator, threeSelectionDisplay); threeSelectionWindow.getContentPane().add(new JScrollPane(threeSelectionDisplay)); threeSelectionWindow.setVisible(true); }else{ logger.debug("adding another 3Cselection"); addGroupedSelection(creator, threeSelectionDisplay); threeSelectionWindow.toFront(); } }
public void createThreeSelectionDisplay(Selection creator){ if(threeSelectionDisplay == null){ logger.debug("creating 3C selection display"); threeSelectionWindow = new JFrame(particleTagWindowName); threeSelectionWindow.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { threeSelectionDisplay.removeAll(); } }); threeSelectionWindow.setSize(400, 400); Toolkit tk = Toolkit.getDefaultToolkit(); threeSelectionWindow.setLocation((tk.getScreenSize().width - threeSelectionWindow.getSize().width)/2, (tk.getScreenSize().height - threeSelectionWindow.getSize().height)/2); threeSelectionDisplay = new MultiSeismogramWindowDisplay(mouseForwarder, motionForwarder, this); addGroupedSelection(creator, threeSelectionDisplay); threeSelectionWindow.getContentPane().add(new JScrollPane(threeSelectionDisplay)); threeSelectionWindow.setVisible(true); }else{ logger.debug("adding another 3Cselection"); addGroupedSelection(creator, threeSelectionDisplay); threeSelectionWindow.toFront(); } }
1,120,015
public void windowClosing(WindowEvent e) { threeSelectionDisplay.removeAll(); }
public void windowClosing(WindowEvent e) { threeSelectionDisplay.removeAll(); }
1,120,016
public ATObject meta_doesNotUnderstand(ATSymbol selector) throws NATException { // first, convert the AmbientTalk name to a Java selector. Java selectors are always valid filenames because // they do not contain special operator characters String javaSelector = Reflection.upSelector(selector); // first, try to see if the file exists and corresponds to a directory File dir = new File(path_, javaSelector); if (dir.exists() && dir.isDirectory()) { // create a new namespace object for this directory NATNamespace childNS = new NATNamespace(name_ + "/" + javaSelector, path_ + File.separator + javaSelector, this); // bind the new child namespace to the selector this.meta_defineField(selector, childNS); return childNS; } else { // try to see if a file with extension .at exists corresponding to the selector File src = new File(path_, javaSelector + _AT_EXT_); if (src.exists() && src.isFile()) { // bind the missing slot to nil to prevent calling this dNU recursively when evaluating the code in the file this.meta_defineField(selector, NATNil._INSTANCE_); // create a new namespace object for this file NATNamespace childNS = new NATNamespace(name_ + "/" + javaSelector + _AT_EXT_, path_ + File.separator + javaSelector, this); try { // load the code from the file String code = loadContentOfFile(src); // construct the proper evaluation context for the code NATContext ctx = new NATContext(childNS, childNS, this); // parse and evaluate the code in the proper context and bind its result to the missing slot ATAbstractGrammar source = NATParser._INSTANCE_.base_parse(NATText.atValue(code)); ATObject result = source.meta_eval(ctx); this.meta_assignField(selector, result); return result; } catch (IOException e) { throw new XIOProblem(e); } catch (XParseError e) { e.setOriginatingFile(src.getAbsolutePath()); throw e; } } else { // neither a matching directory nor a matching file.at were found // perform the default dNU behaviour, which means raising a 'selector not found' exception return super.meta_doesNotUnderstand(selector); } } }
public ATObject meta_doesNotUnderstand(ATSymbol selector) throws NATException { // first, convert the AmbientTalk name to a Java selector. Java selectors are always valid filenames because // they do not contain special operator characters String javaSelector = Reflection.upSelector(selector); // first, try to see if the file exists and corresponds to a directory File dir = new File(path_, javaSelector); if (dir.exists() && dir.isDirectory()) { // create a new namespace object for this directory NATNamespace childNS = new NATNamespace(name_ + "/" + javaSelector, path_ + File.separator + javaSelector, this); // bind the new child namespace to the selector this.meta_defineField(selector, childNS); return childNS; } else { // try to see if a file with extension .at exists corresponding to the selector File src = new File(path_, javaSelector + _AT_EXT_); if (src.exists() && src.isFile()) { // bind the missing slot to nil to prevent calling this dNU recursively when evaluating the code in the file this.meta_defineField(selector, NATNil._INSTANCE_); // create a new namespace object for this file NATNamespace childNS = new NATNamespace(name_ + "/" + javaSelector + _AT_EXT_, path_ + File.separator + javaSelector, this); try { // load the code from the file String code = loadContentOfFile(src); // construct the proper evaluation context for the code NATContext ctx = new NATContext(childNS, childNS, childNS.dynamicParent_); // parse and evaluate the code in the proper context and bind its result to the missing slot ATAbstractGrammar source = NATParser._INSTANCE_.base_parse(NATText.atValue(code)); ATObject result = source.meta_eval(ctx); this.meta_assignField(selector, result); return result; } catch (IOException e) { throw new XIOProblem(e); } catch (XParseError e) { e.setOriginatingFile(src.getAbsolutePath()); throw e; } } else { // neither a matching directory nor a matching file.at were found // perform the default dNU behaviour, which means raising a 'selector not found' exception return super.meta_doesNotUnderstand(selector); } } }
1,120,017
public AGApplication(ATSymbol sel, ATTable arg) { selector_ = sel; arguments_ = arg; }
public AGApplication(ATSymbol sel, ATTable arg) { selector_ = sel; arguments_ = arg; }
1,120,018
public ATObject meta_eval(ATContext ctx) throws NATException { return ctx.getLexicalScope().meta_call(selector_, NATTable.evaluateArguments(arguments_.asNativeTable(), ctx)); }
public ATObject meta_eval(ATContext ctx) throws NATException { ATClosure clo = funExp_.meta_eval(ctx).asClosure(); return clo.meta_apply(NATTable.evaluateArguments(arguments_.asNativeTable(), ctx)); }
1,120,019
public NATText meta_print() throws XTypeMismatch { return NATText.atValue(selector_.meta_print().javaValue + NATTable.printAsList(arguments_).javaValue); }
public NATText meta_print() throws XTypeMismatch { return NATText.atValue(funExp_.meta_print().javaValue + NATTable.printAsList(arguments_).javaValue); }
1,120,020
public ATObject meta_quote(ATContext ctx) throws NATException { return new AGApplication(selector_.meta_quote(ctx).asSymbol(), arguments_.meta_quote(ctx).asTable()); }
public ATObject meta_quote(ATContext ctx) throws NATException { return new AGApplication(funExp_.meta_quote(ctx).asExpression(), arguments_.meta_quote(ctx).asTable()); }
1,120,021
public void run() { JTextComponent copyright = createCopyrightPanel(); HTMLBrowser license = new HTMLBrowser(LICENSE_HTML); remove(label); JSplitPane splitPane = new JSplitPane( JSplitPane.VERTICAL_SPLIT); splitPane.add(new JScrollPane(copyright)); splitPane.add(new JScrollPane(license)); int location = (int)((double)getHeight() * 0.4); splitPane.setDividerLocation((location > 0) ? location : 100); add(splitPane); repaint(); revalidate(); }
public void run() { JTextComponent copyright = createCopyrightPanel(); HTMLBrowser license = new HTMLBrowser(LICENSE_HTML); remove(label); JSplitPane splitPane = new JSplitPane( JSplitPane.VERTICAL_SPLIT); splitPane.add(new JScrollPane(copyright)); splitPane.add(license); int location = (int)((double)getHeight() * 0.4); splitPane.setDividerLocation((location > 0) ? location : 100); add(splitPane); repaint(); revalidate(); }
1,120,022
private boolean executeQueries(QuerySQL query, QueryToSQLBridge bridge) throws RemoteException { QueryResult queryResult = bridge.executeQueries(query); // check if everything is fine if (queryResult == null || queryResult.isEmpty()) { // nothing to do return false; } // get the design of the report JasperReportBusiness reportBusiness = getReportBusiness(); int designId = ((Integer) parameterMap.get(CURRENT_LAYOUT_ID)).intValue(); JasperDesign design = reportBusiness.getDesign(designId); // synchronize design and result Map designParameters = new HashMap(); designParameters.put(REPORT_HEADLINE_KEY, query.getName()); JasperPrint print = reportBusiness.printSynchronizedReport(queryResult, designParameters, design); // create html report String uri; String format = (String) parameterMap.get(CURRENT_OUTPUT_FORMAT); if (PDF_KEY.equals(format)) { uri = reportBusiness.getPdfReport(print, "report"); } else if (EXCEL_KEY.equals(format)) { uri = reportBusiness.getExcelReport(print, "report"); } else { uri = reportBusiness.getHtmlReport(print, "report"); } // open an extra window with scrollbars getParentPage().setOnLoad("window.open('" + uri + "' , 'newWin', 'width=600,height=400,scrollbars=yes')"); return true; }
private boolean executeQueries(QuerySQL query, QueryToSQLBridge bridge) throws RemoteException { QueryResult queryResult = bridge.executeQueries(query); // check if everything is fine if (queryResult == null || queryResult.isEmpty()) { // nothing to do return false; } // get the design of the report JasperReportBusiness reportBusiness = getReportBusiness(); int designId = ((Integer) parameterMap.get(CURRENT_LAYOUT_ID)).intValue(); JasperDesign design = reportBusiness.getDesign(designId); // synchronize design and result Map designParameters = new HashMap(); designParameters.put(REPORT_HEADLINE_KEY, query.getName()); JasperPrint print = reportBusiness.printSynchronizedReport(queryResult, designParameters, design); // create html report String uri; String format = (String) parameterMap.get(CURRENT_OUTPUT_FORMAT); if (PDF_KEY.equals(format)) { uri = reportBusiness.getPdfReport(print, "report"); } else if (EXCEL_KEY.equals(format)) { uri = reportBusiness.getExcelReport(print, "report"); } else { uri = reportBusiness.getHtmlReport(print, "report"); } // open an extra window with scrollbars getParentPage().setOnLoad("window.open('" + uri + "' , 'newWin', 'width=600,height=400,scrollbars=yes')"); return true; }
1,120,023
private void getSingleQueryView(IWBundle bundle, IWResourceBundle resourceBundle, String action, IWContext iwc) throws RemoteException { String errorMessage = null; QueryService queryService = getQueryService(); int currentQueryId = ((Integer) parameterMap.get(CURRENT_QUERY_ID)).intValue(); QueryHelper queryHelper = queryService.getQueryHelper(currentQueryId); QueryToSQLBridge bridge = getQueryToSQLBridge(); QuerySQL query = null; try { query = bridge.createQuerySQL(queryHelper, iwc); } catch (QueryGenerationException ex) { String message = "[ReportOverview]: Can't generate query."; System.err.println(message + " Message is: " + ex.getMessage()); ex.printStackTrace(System.err); errorMessage = resourceBundle.getLocalizedString("ro_query_could not_be_created", "Query could not be created"); } // execute query if the query was successfully created if (errorMessage == null) { // // query is dynamic // if (query.isDynamic()) { Map identifierValueMap = query.getIdentifierValueMap(); if (SHOW_SINGLE_QUERY_CHECK_IF_DYNAMIC.equals(action)) { // show input fields showInputFields(query, identifierValueMap, resourceBundle); } else { // get the values of the input fields Map modifiedValues = getModifiedIdentiferValueMap(identifierValueMap, iwc); query.setIdentifierValueMap(modifiedValues); // show result of query if (! executeQueries(query, bridge)) { errorMessage = resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } // show again the input fields if (errorMessage != null) { addErrorMessage(errorMessage); } showInputFields(query, modifiedValues, resourceBundle); } // // good bye - query is dynamic // return; } // // query is not dynamic // else { boolean isOkay = executeQueries(query, bridge); if (! isOkay) { errorMessage = resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } } } // show list if query is not dynamic and if an error occurred if (errorMessage != null) { addErrorMessage(errorMessage); } getListOfQueries(bundle, resourceBundle); }
private void getSingleQueryView(IWBundle bundle, IWResourceBundle resourceBundle, String action, IWContext iwc) throws RemoteException { String errorMessage = null; QueryService queryService = getQueryService(); int currentQueryId = ((Integer) parameterMap.get(CURRENT_QUERY_ID)).intValue(); QueryHelper queryHelper = queryService.getQueryHelper(currentQueryId); QueryToSQLBridge bridge = getQueryToSQLBridge(); QuerySQL query = null; try { query = bridge.createQuerySQL(queryHelper, iwc); } catch (QueryGenerationException ex) { String message = "[ReportOverview]: Can't generate query."; System.err.println(message + " Message is: " + ex.getMessage()); ex.printStackTrace(System.err); errorMessage = resourceBundle.getLocalizedString("ro_query_could not_be_created", "Query could not be created"); } // execute query if the query was successfully created if (errorMessage == null) { // // query is dynamic // if (query.isDynamic()) { Map identifierValueMap = query.getIdentifierValueMap(); if (SHOW_SINGLE_QUERY_CHECK_IF_DYNAMIC.equals(action)) { // show input fields showInputFields(query, identifierValueMap, resourceBundle); } else { // get the values of the input fields Map modifiedValues = getModifiedIdentiferValueMap(identifierValueMap, iwc); query.setIdentifierValueMap(modifiedValues); // show result of query List executedSQLStatements = new ArrayList(); boolean isOkay = executeQueries(query, bridge, executedSQLStatements); addExecutedSQLQueries(executedSQLStatements); if (! isOkay) { errorMessage = resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } // show again the input fields if (errorMessage != null) { addErrorMessage(errorMessage); } showInputFields(query, modifiedValues, resourceBundle); } // // good bye - query is dynamic // return; } // // query is not dynamic // else { boolean isOkay = executeQueries(query, bridge); if (! isOkay) { errorMessage = resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } } } // show list if query is not dynamic and if an error occurred if (errorMessage != null) { addErrorMessage(errorMessage); } getListOfQueries(bundle, resourceBundle); }
1,120,024
private void getSingleQueryView(IWBundle bundle, IWResourceBundle resourceBundle, String action, IWContext iwc) throws RemoteException { String errorMessage = null; QueryService queryService = getQueryService(); int currentQueryId = ((Integer) parameterMap.get(CURRENT_QUERY_ID)).intValue(); QueryHelper queryHelper = queryService.getQueryHelper(currentQueryId); QueryToSQLBridge bridge = getQueryToSQLBridge(); QuerySQL query = null; try { query = bridge.createQuerySQL(queryHelper, iwc); } catch (QueryGenerationException ex) { String message = "[ReportOverview]: Can't generate query."; System.err.println(message + " Message is: " + ex.getMessage()); ex.printStackTrace(System.err); errorMessage = resourceBundle.getLocalizedString("ro_query_could not_be_created", "Query could not be created"); } // execute query if the query was successfully created if (errorMessage == null) { // // query is dynamic // if (query.isDynamic()) { Map identifierValueMap = query.getIdentifierValueMap(); if (SHOW_SINGLE_QUERY_CHECK_IF_DYNAMIC.equals(action)) { // show input fields showInputFields(query, identifierValueMap, resourceBundle); } else { // get the values of the input fields Map modifiedValues = getModifiedIdentiferValueMap(identifierValueMap, iwc); query.setIdentifierValueMap(modifiedValues); // show result of query if (! executeQueries(query, bridge)) { errorMessage = resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } // show again the input fields if (errorMessage != null) { addErrorMessage(errorMessage); } showInputFields(query, modifiedValues, resourceBundle); } // // good bye - query is dynamic // return; } // // query is not dynamic // else { boolean isOkay = executeQueries(query, bridge); if (! isOkay) { errorMessage = resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } } } // show list if query is not dynamic and if an error occurred if (errorMessage != null) { addErrorMessage(errorMessage); } getListOfQueries(bundle, resourceBundle); }
private void getSingleQueryView(IWBundle bundle, IWResourceBundle resourceBundle, String action, IWContext iwc) throws RemoteException { String errorMessage = null; QueryService queryService = getQueryService(); int currentQueryId = ((Integer) parameterMap.get(CURRENT_QUERY_ID)).intValue(); QueryHelper queryHelper = queryService.getQueryHelper(currentQueryId); QueryToSQLBridge bridge = getQueryToSQLBridge(); QuerySQL query = null; try { query = bridge.createQuerySQL(queryHelper, iwc); } catch (QueryGenerationException ex) { String message = "[ReportOverview]: Can't generate query."; System.err.println(message + " Message is: " + ex.getMessage()); ex.printStackTrace(System.err); errorMessage = resourceBundle.getLocalizedString("ro_query_could not_be_created", "Query could not be created"); } // execute query if the query was successfully created if (errorMessage == null) { // // query is dynamic // if (query.isDynamic()) { Map identifierValueMap = query.getIdentifierValueMap(); if (SHOW_SINGLE_QUERY_CHECK_IF_DYNAMIC.equals(action)) { // show input fields showInputFields(query, identifierValueMap, resourceBundle); } else { // get the values of the input fields Map modifiedValues = getModifiedIdentiferValueMap(identifierValueMap, iwc); query.setIdentifierValueMap(modifiedValues); // show result of query if (! executeQueries(query, bridge)) { errorMessage = resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } // show again the input fields if (errorMessage != null) { addErrorMessage(errorMessage); } showInputFields(query, modifiedValues, resourceBundle); } // // good bye - query is dynamic // return; } // // query is not dynamic // else { List executedSQLStatements = new ArrayList(); boolean isOkay = executeQueries(query, bridge, executedSQLStatements); addExecutedSQLQueries(executedSQLStatements); if (! isOkay) { errorMessage = resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } } } // show list if query is not dynamic and if an error occurred if (errorMessage != null) { addErrorMessage(errorMessage); } getListOfQueries(bundle, resourceBundle); }
1,120,025
public void layout(IFigure container) { Rectangle clientArea = transposer.t(container.getClientArea()); List children = container.getChildren(); int numChildren = children.size(); Dimension prefSizes [] = new Dimension[numChildren]; Dimension minSizes [] = new Dimension[numChildren]; int wHint = getLaneOrientation()== HORIZONTAL ? container.getClientArea(Rectangle.SINGLETON).width : -1; int hHint = getLaneOrientation()== VERTICAL ? container.getClientArea(Rectangle.SINGLETON).height : -1; int totalPrefHeight = 0; for (int i = 0; i < numChildren; i++) { IFigure child = (IFigure)children.get(i); prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint)); minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint)); totalPrefHeight += prefSizes[i].height; } int expansion = totalPrefHeight < clientArea.height ? (clientArea.height - totalPrefHeight) / children.size() : 0; int x = clientArea.x; int y = clientArea.y; for (int i = 0; i < numChildren; i++) { int prefHeight = prefSizes[i].height; int prefWidth = prefSizes[i].width; int minWidth = minSizes[i].width; Rectangle newBounds = new Rectangle(x, y, prefWidth, prefHeight); IFigure child = (IFigure)children.get(i); newBounds.width = Math.max(minWidth, clientArea.width); newBounds.height += expansion; child.setBounds(transposer.t(newBounds)); y += newBounds.height; } }
public void layout(IFigure container) { List children = container.getChildren(); int numChildren = children.size(); Dimension prefSizes [] = new Dimension[numChildren]; Dimension minSizes [] = new Dimension[numChildren]; int wHint = getLaneOrientation()== HORIZONTAL ? container.getClientArea(Rectangle.SINGLETON).width : -1; int hHint = getLaneOrientation()== VERTICAL ? container.getClientArea(Rectangle.SINGLETON).height : -1; int totalPrefHeight = 0; for (int i = 0; i < numChildren; i++) { IFigure child = (IFigure)children.get(i); prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint)); minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint)); totalPrefHeight += prefSizes[i].height; } int expansion = totalPrefHeight < clientArea.height ? (clientArea.height - totalPrefHeight) / children.size() : 0; int x = clientArea.x; int y = clientArea.y; for (int i = 0; i < numChildren; i++) { int prefHeight = prefSizes[i].height; int prefWidth = prefSizes[i].width; int minWidth = minSizes[i].width; Rectangle newBounds = new Rectangle(x, y, prefWidth, prefHeight); IFigure child = (IFigure)children.get(i); newBounds.width = Math.max(minWidth, clientArea.width); newBounds.height += expansion; child.setBounds(transposer.t(newBounds)); y += newBounds.height; } }
1,120,026
public void layout(IFigure container) { Rectangle clientArea = transposer.t(container.getClientArea()); List children = container.getChildren(); int numChildren = children.size(); Dimension prefSizes [] = new Dimension[numChildren]; Dimension minSizes [] = new Dimension[numChildren]; int wHint = getLaneOrientation()== HORIZONTAL ? container.getClientArea(Rectangle.SINGLETON).width : -1; int hHint = getLaneOrientation()== VERTICAL ? container.getClientArea(Rectangle.SINGLETON).height : -1; int totalPrefHeight = 0; for (int i = 0; i < numChildren; i++) { IFigure child = (IFigure)children.get(i); prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint)); minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint)); totalPrefHeight += prefSizes[i].height; } int expansion = totalPrefHeight < clientArea.height ? (clientArea.height - totalPrefHeight) / children.size() : 0; int x = clientArea.x; int y = clientArea.y; for (int i = 0; i < numChildren; i++) { int prefHeight = prefSizes[i].height; int prefWidth = prefSizes[i].width; int minWidth = minSizes[i].width; Rectangle newBounds = new Rectangle(x, y, prefWidth, prefHeight); IFigure child = (IFigure)children.get(i); newBounds.width = Math.max(minWidth, clientArea.width); newBounds.height += expansion; child.setBounds(transposer.t(newBounds)); y += newBounds.height; } }
public void layout(IFigure container) { Rectangle clientArea = transposer.t(container.getClientArea()); List children = container.getChildren(); int numChildren = children.size(); Dimension prefSizes [] = new Dimension[numChildren]; Dimension minSizes [] = new Dimension[numChildren]; int wHint = getLaneOrientation()== HORIZONTAL ? container.getClientArea(Rectangle.SINGLETON).width : -1; int hHint = getLaneOrientation()== VERTICAL ? container.getClientArea(Rectangle.SINGLETON).height : -1; int totalPrefHeight = 0; for (int i = 0; i < numChildren; i++) { IFigure child = (IFigure)children.get(i); prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint)); minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint)); totalPrefHeight += prefSizes[i].height; } int expansion = totalPrefHeight < clientArea.height ? (clientArea.height - totalPrefHeight) / children.size() : 0; int x = clientArea.x; int y = clientArea.y; for (int i = 0; i < numChildren; i++) { int prefHeight = prefSizes[i].height; int prefWidth = prefSizes[i].width; int minWidth = minSizes[i].width; Rectangle newBounds = new Rectangle(x, y, prefWidth, prefHeight); IFigure child = (IFigure)children.get(i); newBounds.width = Math.max(minWidth, clientArea.width); newBounds.height += expansion; child.setBounds(transposer.t(newBounds)); y += newBounds.height; } }
1,120,027
public void layout(IFigure container) { Rectangle clientArea = transposer.t(container.getClientArea()); List children = container.getChildren(); int numChildren = children.size(); Dimension prefSizes [] = new Dimension[numChildren]; Dimension minSizes [] = new Dimension[numChildren]; int wHint = getLaneOrientation()== HORIZONTAL ? container.getClientArea(Rectangle.SINGLETON).width : -1; int hHint = getLaneOrientation()== VERTICAL ? container.getClientArea(Rectangle.SINGLETON).height : -1; int totalPrefHeight = 0; for (int i = 0; i < numChildren; i++) { IFigure child = (IFigure)children.get(i); prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint)); minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint)); totalPrefHeight += prefSizes[i].height; } int expansion = totalPrefHeight < clientArea.height ? (clientArea.height - totalPrefHeight) / children.size() : 0; int x = clientArea.x; int y = clientArea.y; for (int i = 0; i < numChildren; i++) { int prefHeight = prefSizes[i].height; int prefWidth = prefSizes[i].width; int minWidth = minSizes[i].width; Rectangle newBounds = new Rectangle(x, y, prefWidth, prefHeight); IFigure child = (IFigure)children.get(i); newBounds.width = Math.max(minWidth, clientArea.width); newBounds.height += expansion; child.setBounds(transposer.t(newBounds)); y += newBounds.height; } }
public void layout(IFigure container) { Rectangle clientArea = transposer.t(container.getClientArea()); List children = container.getChildren(); int numChildren = children.size(); Dimension prefSizes [] = new Dimension[numChildren]; Dimension minSizes [] = new Dimension[numChildren]; int wHint = getLaneOrientation()== HORIZONTAL ? container.getClientArea(Rectangle.SINGLETON).width : -1; int hHint = getLaneOrientation()== VERTICAL ? container.getClientArea(Rectangle.SINGLETON).height : -1; for (int i = 0; i < numChildren; i++) { IFigure child = (IFigure) children.get(i); for (int i = 0; i < numChildren; i++) { IFigure child = (IFigure)children.get(i); prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint)); minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint)); totalPrefHeight += prefSizes[i].height; } int expansion = totalPrefHeight < clientArea.height ? (clientArea.height - totalPrefHeight) / children.size() : 0; int x = clientArea.x; int y = clientArea.y; for (int i = 0; i < numChildren; i++) { int prefHeight = prefSizes[i].height; int prefWidth = prefSizes[i].width; int minWidth = minSizes[i].width; Rectangle newBounds = new Rectangle(x, y, prefWidth, prefHeight); IFigure child = (IFigure)children.get(i); newBounds.width = Math.max(minWidth, clientArea.width); newBounds.height += expansion; child.setBounds(transposer.t(newBounds)); y += newBounds.height; } }
1,120,028
public void layout(IFigure container) { Rectangle clientArea = transposer.t(container.getClientArea()); List children = container.getChildren(); int numChildren = children.size(); Dimension prefSizes [] = new Dimension[numChildren]; Dimension minSizes [] = new Dimension[numChildren]; int wHint = getLaneOrientation()== HORIZONTAL ? container.getClientArea(Rectangle.SINGLETON).width : -1; int hHint = getLaneOrientation()== VERTICAL ? container.getClientArea(Rectangle.SINGLETON).height : -1; int totalPrefHeight = 0; for (int i = 0; i < numChildren; i++) { IFigure child = (IFigure)children.get(i); prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint)); minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint)); totalPrefHeight += prefSizes[i].height; } int expansion = totalPrefHeight < clientArea.height ? (clientArea.height - totalPrefHeight) / children.size() : 0; int x = clientArea.x; int y = clientArea.y; for (int i = 0; i < numChildren; i++) { int prefHeight = prefSizes[i].height; int prefWidth = prefSizes[i].width; int minWidth = minSizes[i].width; Rectangle newBounds = new Rectangle(x, y, prefWidth, prefHeight); IFigure child = (IFigure)children.get(i); newBounds.width = Math.max(minWidth, clientArea.width); newBounds.height += expansion; child.setBounds(transposer.t(newBounds)); y += newBounds.height; } }
public void layout(IFigure container) { Rectangle clientArea = transposer.t(container.getClientArea()); List children = container.getChildren(); int numChildren = children.size(); Dimension prefSizes [] = new Dimension[numChildren]; Dimension minSizes [] = new Dimension[numChildren]; int wHint = getLaneOrientation()== HORIZONTAL ? container.getClientArea(Rectangle.SINGLETON).width : -1; int hHint = getLaneOrientation()== VERTICAL ? container.getClientArea(Rectangle.SINGLETON).height : -1; int totalPrefHeight = 0; for (int i = 0; i < numChildren; i++) { IFigure child = (IFigure)children.get(i); prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint)); minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint)); totalPrefHeight += prefSizes[i].height; } int expansion = totalPrefHeight < clientArea.height ? (clientArea.height - totalPrefHeight) / children.size() : 0; int x = clientArea.x; int y = clientArea.y; for (int i = 0; i < numChildren; i++) { int prefHeight = prefSizes[i].height; int prefWidth = prefSizes[i].width; int minWidth = minSizes[i].width; Rectangle newBounds = new Rectangle(x, y, prefWidth, prefHeight); IFigure child = (IFigure)children.get(i); newBounds.width = Math.max(minWidth, clientArea.width); newBounds.height += expansion; child.setBounds(transposer.t(newBounds)); y += newBounds.height; } }
1,120,029
public void layout(IFigure container) { Rectangle clientArea = transposer.t(container.getClientArea()); List children = container.getChildren(); int numChildren = children.size(); Dimension prefSizes [] = new Dimension[numChildren]; Dimension minSizes [] = new Dimension[numChildren]; int wHint = getLaneOrientation()== HORIZONTAL ? container.getClientArea(Rectangle.SINGLETON).width : -1; int hHint = getLaneOrientation()== VERTICAL ? container.getClientArea(Rectangle.SINGLETON).height : -1; int totalPrefHeight = 0; for (int i = 0; i < numChildren; i++) { IFigure child = (IFigure)children.get(i); prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint)); minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint)); totalPrefHeight += prefSizes[i].height; } int expansion = totalPrefHeight < clientArea.height ? (clientArea.height - totalPrefHeight) / children.size() : 0; int x = clientArea.x; int y = clientArea.y; for (int i = 0; i < numChildren; i++) { int prefHeight = prefSizes[i].height; int prefWidth = prefSizes[i].width; int minWidth = minSizes[i].width; Rectangle newBounds = new Rectangle(x, y, prefWidth, prefHeight); IFigure child = (IFigure)children.get(i); newBounds.width = Math.max(minWidth, clientArea.width); newBounds.height += expansion; child.setBounds(transposer.t(newBounds)); y += newBounds.height; } }
public void layout(IFigure container) { Rectangle clientArea = transposer.t(container.getClientArea()); List children = container.getChildren(); int numChildren = children.size(); Dimension prefSizes [] = new Dimension[numChildren]; Dimension minSizes [] = new Dimension[numChildren]; int wHint = getLaneOrientation()== HORIZONTAL ? container.getClientArea(Rectangle.SINGLETON).width : -1; int hHint = getLaneOrientation()== VERTICAL ? container.getClientArea(Rectangle.SINGLETON).height : -1; int totalPrefHeight = 0; for (int i = 0; i < numChildren; i++) { IFigure child = (IFigure)children.get(i); prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint)); minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint)); totalPrefHeight += prefSizes[i].height; } int expansion = totalPrefHeight < clientArea.height ? (clientArea.height - totalPrefHeight) / children.size() : 0; int x = clientArea.x; int y = clientArea.y; for (int i = 0; i < numChildren; i++) { int prefHeight = prefSizes[i].height; int prefWidth = prefSizes[i].width; int minWidth = minSizes[i].width; Rectangle newBounds = new Rectangle(x, y, prefWidth, prefHeight); IFigure child = (IFigure)children.get(i); newBounds.width = Math.max(minWidth, clientArea.width); newBounds.height += expansion; child.setBounds(transposer.t(newBounds)); y += newBounds.height; } }
1,120,030
public void layout(IFigure container) { Rectangle clientArea = transposer.t(container.getClientArea()); List children = container.getChildren(); int numChildren = children.size(); Dimension prefSizes [] = new Dimension[numChildren]; Dimension minSizes [] = new Dimension[numChildren]; int wHint = getLaneOrientation()== HORIZONTAL ? container.getClientArea(Rectangle.SINGLETON).width : -1; int hHint = getLaneOrientation()== VERTICAL ? container.getClientArea(Rectangle.SINGLETON).height : -1; int totalPrefHeight = 0; for (int i = 0; i < numChildren; i++) { IFigure child = (IFigure)children.get(i); prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint)); minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint)); totalPrefHeight += prefSizes[i].height; } int expansion = totalPrefHeight < clientArea.height ? (clientArea.height - totalPrefHeight) / children.size() : 0; int x = clientArea.x; int y = clientArea.y; for (int i = 0; i < numChildren; i++) { int prefHeight = prefSizes[i].height; int prefWidth = prefSizes[i].width; int minWidth = minSizes[i].width; Rectangle newBounds = new Rectangle(x, y, prefWidth, prefHeight); IFigure child = (IFigure)children.get(i); newBounds.width = Math.max(minWidth, clientArea.width); newBounds.height += expansion; child.setBounds(transposer.t(newBounds)); y += newBounds.height; } }
public void layout(IFigure container) { Rectangle clientArea = transposer.t(container.getClientArea()); List children = container.getChildren(); int numChildren = children.size(); Dimension prefSizes [] = new Dimension[numChildren]; Dimension minSizes [] = new Dimension[numChildren]; int wHint = getLaneOrientation()== HORIZONTAL ? container.getClientArea(Rectangle.SINGLETON).width : -1; int hHint = getLaneOrientation()== VERTICAL ? container.getClientArea(Rectangle.SINGLETON).height : -1; int totalPrefHeight = 0; for (int i = 0; i < numChildren; i++) { IFigure child = (IFigure)children.get(i); prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint)); minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint)); totalPrefHeight += prefSizes[i].height; } int expansion = totalPrefHeight < clientArea.height ? (clientArea.height - totalPrefHeight) / children.size() : 0; int x = clientArea.x; int y = clientArea.y; for (int i = 0; i < numChildren; i++) { int prefHeight = prefSizes[i].height; int prefWidth = prefSizes[i].width; int minWidth = minSizes[i].width; Rectangle newBounds = new Rectangle(x, y, prefWidth, prefHeight); IFigure child = (IFigure)children.get(i); newBounds.width = Math.max(minWidth, clientArea.width); newBounds.height += expansion; child.setBounds(transposer.t(newBounds)); y += newBounds.height; } }
1,120,031
public void layout(IFigure container) { Rectangle clientArea = transposer.t(container.getClientArea()); List children = container.getChildren(); int numChildren = children.size(); Dimension prefSizes [] = new Dimension[numChildren]; Dimension minSizes [] = new Dimension[numChildren]; int wHint = getLaneOrientation()== HORIZONTAL ? container.getClientArea(Rectangle.SINGLETON).width : -1; int hHint = getLaneOrientation()== VERTICAL ? container.getClientArea(Rectangle.SINGLETON).height : -1; int totalPrefHeight = 0; for (int i = 0; i < numChildren; i++) { IFigure child = (IFigure)children.get(i); prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint)); minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint)); totalPrefHeight += prefSizes[i].height; } int expansion = totalPrefHeight < clientArea.height ? (clientArea.height - totalPrefHeight) / children.size() : 0; int x = clientArea.x; int y = clientArea.y; for (int i = 0; i < numChildren; i++) { int prefHeight = prefSizes[i].height; int prefWidth = prefSizes[i].width; int minWidth = minSizes[i].width; Rectangle newBounds = new Rectangle(x, y, prefWidth, prefHeight); IFigure child = (IFigure)children.get(i); newBounds.width = Math.max(minWidth, clientArea.width); newBounds.height += expansion; child.setBounds(transposer.t(newBounds)); y += newBounds.height; } }
public void layout(IFigure container) { Rectangle clientArea = transposer.t(container.getClientArea()); List children = container.getChildren(); int numChildren = children.size(); Dimension prefSizes [] = new Dimension[numChildren]; Dimension minSizes [] = new Dimension[numChildren]; int wHint = getLaneOrientation()== HORIZONTAL ? container.getClientArea(Rectangle.SINGLETON).width : -1; int hHint = getLaneOrientation()== VERTICAL ? container.getClientArea(Rectangle.SINGLETON).height : -1; int totalPrefHeight = 0; for (int i = 0; i < numChildren; i++) { IFigure child = (IFigure)children.get(i); prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint)); minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint)); totalPrefHeight += prefSizes[i].height; } int expansion = totalPrefHeight < clientArea.height ? (clientArea.height - totalPrefHeight) / children.size() : 0; int x = clientArea.x; int y = clientArea.y; for (int i = 0; i < numChildren; i++) { int prefHeight = prefSizes[i].height; int prefWidth = prefSizes[i].width; int minWidth = minSizes[i].width; Rectangle newBounds = new Rectangle(x, y, prefWidth, prefHeight); IFigure child = (IFigure)children.get(i); newBounds.width = Math.max(minWidth, clientArea.width); newBounds.height += expansion; child.setBounds(transposer.t(newBounds)); y += newBounds.height; } }
1,120,032
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** ================================================================= * Selecting a group - any access if no group set * ================================================================= */ /** Check access */ if (!form.getUserAuth().isContentAdminUser()) { return "noAccess"; } form.assignGroupSet(false); form.assignChoosingGroup(false); // Back to main menu. Abstract action will do the rest. String temp = checkGroup(request, form, false); if (temp == null) { form.getErr().emit("org.bedework.pubevents.error.choosegroupsuppressed"); return "error"; } return "continue"; }
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** ================================================================= * Selecting a group - any access if no group set * ================================================================= */ /** Check access */ if (!form.getUserAuth().isContentAdminUser()) { return "noAccess"; } form.assignGroupSet(false); form.assignChoosingGroup(false); // Back to main menu. Abstract action will do the rest. String temp = checkGroup(request, form, false); if (temp == null) { form.getErr().emit("org.bedework.client.error.choosegroupsuppressed"); return "error"; } return "continue"; }
1,120,033
public CalintfHelper(Calintf cal, AccessUtil access, int currentMode, boolean ignoreCreator, boolean debug) { this.cal = cal; this.access = access; this.currentMode = currentMode; this.ignoreCreator = ignoreCreator; this.debug = debug; }
public CalintfHelper(Calintf cal, AccessUtil access, int currentMode, boolean debug) { this.cal = cal; this.access = access; this.currentMode = currentMode; this.ignoreCreator = ignoreCreator; this.debug = debug; }
1,120,035
public CalintfHelper(Calintf cal, AccessUtil access, int currentMode, boolean ignoreCreator, boolean debug) { this.cal = cal; this.access = access; this.currentMode = currentMode; this.ignoreCreator = ignoreCreator; this.debug = debug; }
public CalintfHelper(Calintf cal, AccessUtil access, int currentMode, boolean ignoreCreator, boolean debug) { this.cal = cal; this.access = access; this.currentMode = currentMode; this.debug = debug; }
1,120,036
public MainPanel(final AudioPlayer owner) { super(new BorderLayout()); final JList list = new JList(playlist.getListModel()); list.setCellRenderer(new ListCellRenderer() { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { File file = (File)value; if (!labeltable.containsKey(file)) { ListComponent label = new ListComponent(file.toString()); labeltable.put(file, label); } ListComponent comp = (ListComponent)labeltable.get(file); if (isSelected) { comp.setForeground(Color.BLUE); } else { comp.setForeground(list.getForeground()); } return comp; } }); list.addMouseListener(new MouseListener() { public void mouseClicked(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) { int index = list.getSelectedIndex(); if (index != -1) { playlist.play(index); } } } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } public void mousePressed(MouseEvent e) { } public void mouseReleased(MouseEvent e) { } }); playlist.addListener(new PlaylistListener() { public void playbackStarted(Player player) { File file = player.getFile(); ListComponent comp = (ListComponent)labeltable.get(file); comp.update(file, true); } public void playbackStopped(Player player) { File file = player.getFile(); ListComponent comp = (ListComponent)labeltable.get(file); comp.update(file, false); } public void playbackCompleted(Player player) { File file = player.getFile(); ListComponent comp = (ListComponent)labeltable.get(file); comp.update(file, false); } }); JButton add = new JButton(Messages.getString("MainPanel.ADD_FILE")); //$NON-NLS-1$ add.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { final JFileChooser fileChooser = new JFileChooser(); fileChooser.setFileFilter(new FileFilter() { public boolean accept(File f) { return f.isDirectory() || f.toString().toLowerCase().endsWith(Messages.getString("MainPanel.DOT_MP3")); //$NON-NLS-1$ } public String getDescription() { return Messages.getString("MainPanel.DOT_MP3_FILES"); //$NON-NLS-1$ } }); int ret = fileChooser.showOpenDialog(owner.getPanelInstance()); if (ret == JFileChooser.APPROVE_OPTION) { File f = fileChooser.getSelectedFile(); playlist.add(f); } } }); JButton del = new JButton(Messages.getString("MainPanel.DELETE_FILE")); //$NON-NLS-1$ del.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int[] arr = list.getSelectedIndices(); if (arr != null) { for (int i = arr.length - 1; i >= 0; i--) { playlist.remove(arr[i]); } } } }); JPanel p = new JPanel(); p.add(add); p.add(del); add(p, BorderLayout.NORTH); JScrollPane scrollPane = new JScrollPane(list); add(scrollPane, BorderLayout.CENTER); ControlPanel ctrlPanel = new ControlPanel(owner); add(ctrlPanel, BorderLayout.SOUTH); }
public MainPanel(final AudioPlayer owner) { super(new BorderLayout()); final JList list = new JList(playlist.getListModel()); list.setCellRenderer(new ListCellRenderer() { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { File file = (File)value; if (!labeltable.containsKey(file)) { ListComponent label = new ListComponent(file.toString()); labeltable.put(file, label); } ListComponent comp = (ListComponent)labeltable.get(file); if (isSelected) { comp.setForeground(Color.BLUE); } else { comp.setForeground(list.getForeground()); } return comp; } }); list.addMouseListener(new MouseListener() { public void mouseClicked(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) { int index = list.getSelectedIndex(); if (index != -1) { playlist.play(index); } } } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } public void mousePressed(MouseEvent e) { } public void mouseReleased(MouseEvent e) { } }); playlist.addListener(new PlaylistListener() { public void playbackStarted(Player player) { File file = player.getFile(); ListComponent comp = (ListComponent)labeltable.get(file); comp.update(file, true); } public void playbackStopped(Player player) { File file = player.getFile(); ListComponent comp = (ListComponent)labeltable.get(file); comp.update(file, false); } public void playbackCompleted(Player player) { File file = player.getFile(); ListComponent comp = (ListComponent)labeltable.get(file); comp.update(file, false); } }); JButton add = new JButton(Messages.getString("MainPanel.ADD_FILE")); //$NON-NLS-1$ add.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { final JFileChooser fileChooser = new JFileChooser(); fileChooser.setFileFilter(new FileFilter() { public boolean accept(File f) { return f.isDirectory() || f.toString().toLowerCase().endsWith(Messages.getString("MainPanel.DOT_MP3")); //$NON-NLS-1$ } public String getDescription() { return Messages.getString("MainPanel.DOT_MP3_FILES"); //$NON-NLS-1$ } }); int ret = fileChooser.showOpenDialog(owner.getPanelInstance()); if (ret == JFileChooser.APPROVE_OPTION) { File f = fileChooser.getSelectedFile(); playlist.add(f); } } }); JButton del = new JButton(Messages.getString("MainPanel.DELETE_FILE")); //$NON-NLS-1$ del.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int[] arr = list.getSelectedIndices(); if (arr != null) { for (int i = arr.length - 1; i >= 0; i--) { playlist.remove(arr[i]); } } } }); JPanel p = new JPanel(); p.add(add); p.add(del); add(p, BorderLayout.NORTH); JScrollPane scrollPane = new JScrollPane(list); add(scrollPane, BorderLayout.CENTER); ControlPanel ctrlPanel = new ControlPanel(owner); add(ctrlPanel, BorderLayout.SOUTH); }
1,120,037
public void actionPerformed(ActionEvent e) { final JFileChooser fileChooser = new JFileChooser(); fileChooser.setFileFilter(new FileFilter() { public boolean accept(File f) { return f.isDirectory() || f.toString().toLowerCase().endsWith(Messages.getString("MainPanel.DOT_MP3")); //$NON-NLS-1$ } public String getDescription() { return Messages.getString("MainPanel.DOT_MP3_FILES"); //$NON-NLS-1$ } }); int ret = fileChooser.showOpenDialog(owner.getPanelInstance()); if (ret == JFileChooser.APPROVE_OPTION) { File f = fileChooser.getSelectedFile(); playlist.add(f); } }
public void actionPerformed(ActionEvent e) { final JFileChooser fileChooser = new JFileChooser(); fileChooser.setFileFilter(new FileFilter() { public boolean accept(File f) { return f.isDirectory() || f.toString().toLowerCase().endsWith(Messages.getString("MainPanel.DOT_MP3")); //$NON-NLS-1$ } public String getDescription() { return Messages.getString("MainPanel.DOT_MP3_FILES"); //$NON-NLS-1$ } }); int ret = fileChooser.showOpenDialog(owner.getPanelInstance()); if (ret == JFileChooser.APPROVE_OPTION) { File f = fileChooser.getSelectedFile(); playlist.add(f); } }
1,120,039
public boolean accept(File f) { return f.isDirectory() || f.toString().toLowerCase().endsWith(Messages.getString("MainPanel.DOT_MP3")); //$NON-NLS-1$ }
public boolean accept(File f) { return f.isDirectory() || f.toString().toLowerCase().endsWith(Messages.getString("MainPanel.DOT_MP3")); //$NON-NLS-1$ }
1,120,040
public void actionPerformed(ActionEvent e) { int[] arr = list.getSelectedIndices(); if (arr != null) { for (int i = arr.length - 1; i >= 0; i--) { playlist.remove(arr[i]); } } }
public void actionPerformed(ActionEvent e) { int[] arr = list.getSelectedIndices(); if (arr != null) { for (int i = arr.length - 1; i >= 0; i--) { playlist.remove(arr[i]); } } }
1,120,041
public String getXmlAccess() { try { if (xmlAccess == null) { Acl acl = svci.getAcl(getEvent()); xmlAccess = AccessAppUtil.getXmlAclString(acl); } } catch (Throwable t) { error(t); } return xmlAccess; }
public String getXmlAccess() { try { if (xmlAccess == null) { Acl acl = eventInfo.getCurrentAccess().acl; xmlAccess = AccessAppUtil.getXmlAclString(acl); } } catch (Throwable t) { error(t); } return xmlAccess; }
1,120,044
private void createLinkTo(final Point2D p) { if (this.ideaMap != null) { IdeaView hit = this.ideaMap.getViewAt(p); if (hit != null) { Idea selectedIdea = this.ideaMap.getSelected(); if (selectedIdea != null) { Idea hitIdea = hit.getIdea(); selectedIdea.addLink(new IdeaLink(selectedIdea, hitIdea)); } } } }
private void createLinkTo(final Point2D p) { if (this.ideaMap != null) { IdeaView hit = this.ideaMap.getViewAt(p); if ((hit != null) && (hit instanceof BranchView)) { Idea selectedIdea = this.ideaMap.getSelected(); if (selectedIdea != null) { Idea hitIdea = hit.getIdea(); selectedIdea.addLink(new IdeaLink(selectedIdea, hitIdea)); } } } }
1,120,047
public ATFraction base_abs() { return NATFraction.atValue(Math.abs(javaValue)); }
public ATNumeric base_abs() { return NATFraction.atValue(Math.abs(javaValue)); }
1,120,048
public ATFraction base_dec() { return NATFraction.atValue(javaValue-1); }
public ATNumeric base_dec() { return NATFraction.atValue(javaValue-1); }
1,120,049
public ATFraction base_inc() { return NATFraction.atValue(javaValue+1); }
public ATNumeric base_inc() { return NATFraction.atValue(javaValue+1); }
1,120,050
public CalTimezones getTzcache() throws Throwable { if (tzcache != null) { return tzcache; } if (syspars.getTzid() == null) { throw new Exception("syspars.tzid not initialised"); } tzcache = new TimezonesImpl(config.getDebug(), getPublicUser(), rintf); tzcache.setDefaultTimeZoneId(syspars.getTzid()); if (config.getFrom2p3px() && (config.getTimezonesFilename() != null)) { // Populate from a file TimeZonesParser tzp = new TimeZonesParser( new FileInputStream(config.getTimezonesFilename()), config.getDebug()); Collection tzis = tzp.getTimeZones(); Iterator it = tzis.iterator(); while (it.hasNext()) { TimeZonesParser.TimeZoneInfo tzi = (TimeZonesParser.TimeZoneInfo)it.next(); tzcache.saveTimeZone(tzi.tzid, tzi.timezone); timezones++; } } return tzcache; }
public SATimezonesImpl getTzcache() throws Throwable { if (tzcache != null) { return tzcache; } if (syspars.getTzid() == null) { throw new Exception("syspars.tzid not initialised"); } tzcache = new TimezonesImpl(config.getDebug(), getPublicUser(), rintf); tzcache.setDefaultTimeZoneId(syspars.getTzid()); if (config.getFrom2p3px() && (config.getTimezonesFilename() != null)) { // Populate from a file TimeZonesParser tzp = new TimeZonesParser( new FileInputStream(config.getTimezonesFilename()), config.getDebug()); Collection tzis = tzp.getTimeZones(); Iterator it = tzis.iterator(); while (it.hasNext()) { TimeZonesParser.TimeZoneInfo tzi = (TimeZonesParser.TimeZoneInfo)it.next(); tzcache.saveTimeZone(tzi.tzid, tzi.timezone); timezones++; } } return tzcache; }
1,120,051