rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
publicCalendarRootPath = "/" + getSyspars().getPublicCalendarRoot(); userCalendarRootPath = "/" + getSyspars().getUserCalendarRoot();
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; }
addUser(new BwUser(authenticatedUser));
addNewUser(new BwUser(authenticatedUser));
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; }
events = new Events(this, access, sess, this.user, debug);
events = new Events(this, access, this.user, debug);
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; }
categories = new EventProperties(this,
calendars = new Calendars(this, access, this.user, debug); categories = new EventProperties(this, access, this.user,
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; }
locations = new EventProperties(this,
locations = new EventProperties(this, access, this.user,
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; }
sponsors = new EventProperties(this,
sponsors = new EventProperties(this, access, this.user,
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; }
if (userCreated) { calendars.addNewCalendars(); }
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; }
if (events != null) { events.setHibSession(sess); }
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(); }
sess.update(val);
calendars.updateCalendar(val);
public void updateCalendar(BwCalendar val) throws CalFacadeException { checkOpen(); sess.update(val); }
public void show(JComponent invoker, int x, int y) {
public void show(Component invoker, int x, int y) {
public void show(JComponent invoker, int x, int y) { menuItemCut.setEnabled(text.isEditable()); menuItemPaste.setEnabled(text.isEditable()); super.show(invoker, x, y); }
return (parameterMap == null) ? new HashMap(0) : parameterMap;
if (parameterMap == null) { parameterMap = new HashMap(0); } return parameterMap;
public Map getParameterMap() { return (parameterMap == null) ? new HashMap(0) : parameterMap; }
((TimeConfig)creator.getInternalRegistrar()).add(componentSorted[i]); threeSelectionDisplay.addDisplay(componentSorted[i], (TimeConfig)creator.getInternalRegistrar());
if(componentSorted[i].length > 0){ ((TimeConfig)creator.getInternalRegistrar()).add(componentSorted[i]); BasicSeismogramDisplay newDisplay = threeSelectionDisplay.addDisplay(componentSorted[i], (TimeConfig)creator.getInternalRegistrar()); creator.addDisplay(newDisplay); if(parentArrivals != null){ newDisplay.addFlags(parentArrivals); } }
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); }
Arrival[] parentArrivals = creator.getParent().getArrivals(); if(parentArrivals != null){ ((ComponentSortedSeismogramDisplay)threeSelectionDisplay).addFlags(parentArrivals); }
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); }
selectionDisplay.removeAll();
removeSelectionDisplay();
public void windowClosing(WindowEvent e) { selectionDisplay.removeAll(); }
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);
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(); } }
threeSelectionWindow.getContentPane().add(new JScrollPane(threeSelectionDisplay)); threeSelectionWindow.setVisible(true);
if(threeSelectionDisplay.getDisplays().size() > 0){ threeSelectionWindow = new JFrame(particleTagWindowName); threeSelectionWindow.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { remove3CSelectionDisplay(); } }); threeSelectionWindow.setSize(400, 400); Toolkit tk = Toolkit.getDefaultToolkit(); threeSelectionWindow.setLocation((tk.getScreenSize().width - threeSelectionWindow.getSize().width)/2, (tk.getScreenSize().height - threeSelectionWindow.getSize().height)/2); threeSelectionWindow.getContentPane().add(new JScrollPane(threeSelectionDisplay)); threeSelectionWindow.setVisible(true); }else{ remove3CSelectionDisplay(); JOptionPane.showMessageDialog(null, "The other components weren't found to create the Particle Motion Zone, so it can't be created.", "Other Components not found", JOptionPane.WARNING_MESSAGE); }
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(); } }
threeSelectionDisplay.removeAll(); }
remove3CSelectionDisplay(); }
public void windowClosing(WindowEvent e) { threeSelectionDisplay.removeAll(); }
NATContext ctx = new NATContext(childNS, childNS, this);
NATContext ctx = new NATContext(childNS, childNS, childNS.dynamicParent_);
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 AGApplication(ATSymbol sel, ATTable arg) { selector_ = sel;
public AGApplication(ATExpression fun, ATTable arg) { funExp_ = fun;
public AGApplication(ATSymbol sel, ATTable arg) { selector_ = sel; arguments_ = arg; }
return ctx.getLexicalScope().meta_call(selector_, NATTable.evaluateArguments(arguments_.asNativeTable(), ctx));
ATClosure clo = funExp_.meta_eval(ctx).asClosure(); return clo.meta_apply(NATTable.evaluateArguments(arguments_.asNativeTable(), ctx));
public ATObject meta_eval(ATContext ctx) throws NATException { return ctx.getLexicalScope().meta_call(selector_, NATTable.evaluateArguments(arguments_.asNativeTable(), ctx)); }
return NATText.atValue(selector_.meta_print().javaValue + NATTable.printAsList(arguments_).javaValue);
return NATText.atValue(funExp_.meta_print().javaValue + NATTable.printAsList(arguments_).javaValue);
public NATText meta_print() throws XTypeMismatch { return NATText.atValue(selector_.meta_print().javaValue + NATTable.printAsList(arguments_).javaValue); }
return new AGApplication(selector_.meta_quote(ctx).asSymbol(),
return new AGApplication(funExp_.meta_quote(ctx).asExpression(),
public ATObject meta_quote(ATContext ctx) throws NATException { return new AGApplication(selector_.meta_quote(ctx).asSymbol(), arguments_.meta_quote(ctx).asTable()); }
splitPane.add(new JScrollPane(license));
splitPane.add(license);
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(); }
private boolean executeQueries(QuerySQL query, QueryToSQLBridge bridge) throws RemoteException { QueryResult queryResult = bridge.executeQueries(query);
private boolean executeQueries(QuerySQL query, QueryToSQLBridge bridge, List executedSQLQueries) throws RemoteException { QueryResult queryResult = bridge.executeQueries(query, executedSQLQueries);
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; }
if (! executeQueries(query, bridge)) {
List executedSQLStatements = new ArrayList(); boolean isOkay = executeQueries(query, bridge, executedSQLStatements); addExecutedSQLQueries(executedSQLStatements); if (! isOkay) {
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); }
boolean isOkay = executeQueries(query, bridge);
List executedSQLStatements = new ArrayList(); boolean isOkay = executeQueries(query, bridge, executedSQLStatements); addExecutedSQLQueries(executedSQLStatements);
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); }
Rectangle clientArea = transposer.t(container.getClientArea());
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; } }
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;
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; } }
int totalPrefHeight = 0;
for (int i = 0; i < numChildren; i++) { IFigure child = (IFigure) children.get(i);
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; } }
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;
prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint)); minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint));
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; } }
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);
totalPrefHeight += prefSizes[i].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; } }
IFigure child = (IFigure)children.get(i); newBounds.width = Math.max(minWidth, clientArea.width); newBounds.height += expansion; child.setBounds(transposer.t(newBounds));
Rectangle clientArea = transposer.t(container.getClientArea()); int expansion = totalPrefHeight < clientArea.height ? (clientArea.height - totalPrefHeight) / children.size() : 0;
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; } }
y += newBounds.height; }
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; } }
form.getErr().emit("org.bedework.pubevents.error.choosegroupsuppressed");
form.getErr().emit("org.bedework.client.error.choosegroupsuppressed");
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"; }
changed = false;
public void reset(int originalValue, int preferred) { this.originalValue = originalValue; this.newValue = originalValue; precedence = preferred; }
int currentMode, boolean ignoreCreator,
int currentMode,
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; }
this.ignoreCreator = ignoreCreator;
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; }
return f.isDirectory() || f.toString().toLowerCase().endsWith(Messages.getString("MainPanel.DOT_MP3"));
return f.isDirectory() || Util.isAudioFile(f);
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); }
p.add(addDir);
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); }
return f.isDirectory() || f.toString().toLowerCase().endsWith(Messages.getString("MainPanel.DOT_MP3"));
return f.isDirectory() || Util.isAudioFile(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); } }
return f.isDirectory() || f.toString().toLowerCase().endsWith(Messages.getString("MainPanel.DOT_MP3"));
return f.isDirectory() || Util.isAudioFile(f);
public boolean accept(File f) { return f.isDirectory() || f.toString().toLowerCase().endsWith(Messages.getString("MainPanel.DOT_MP3")); //$NON-NLS-1$ }
int[] arr = list.getSelectedIndices(); if (arr != null) { for (int i = arr.length - 1; i >= 0; i--) { playlist.remove(arr[i]);
final JFileChooser fileChooser = new JFileChooser(); fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fileChooser.setFileFilter(new FileFilter() { public boolean accept(File f) { return f.isDirectory();
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 String getDescription() { return Messages.getString("MainPanel.DIRECTORIES"); } }); int ret = fileChooser.showOpenDialog(owner.getPanelInstance()); if (ret == JFileChooser.APPROVE_OPTION) { File f = fileChooser.getSelectedFile(); playlist.addDirectory(f);
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]); } } }
playlist.stop();
public void dispose() { playlist.save(); }
Acl acl = svci.getAcl(getEvent());
Acl acl = eventInfo.getCurrentAccess().acl;
public String getXmlAccess() { try { if (xmlAccess == null) { Acl acl = svci.getAcl(getEvent()); xmlAccess = AccessAppUtil.getXmlAclString(acl); } } catch (Throwable t) { error(t); } return xmlAccess; }
this.envPrefix = envPrefix;
public CalSvcIPars(String authUser, int rights, String user, boolean publicAdmin, boolean caldav, String synchId, boolean debug) { this.authUser = authUser; this.rights = rights; this.user = user; this.publicAdmin = publicAdmin; this.caldav = caldav; this.synchId = synchId; this.debug = debug; }
getEnvPrefix(),
public Object clone() { CalSvcIPars pars = new CalSvcIPars(getAuthUser(), getRights(), getUser(), getPublicAdmin(), getCaldav(), getSynchId(), getDebug()); return pars; }
if (hit != null) {
if ((hit != null) && (hit instanceof BranchView)) {
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)); } } } }
public ATFraction base_abs() {
public ATNumeric base_abs() {
public ATFraction base_abs() { return NATFraction.atValue(Math.abs(javaValue)); }
public ATFraction base_dec() {
public ATNumeric base_dec() {
public ATFraction base_dec() { return NATFraction.atValue(javaValue-1); }
public ATFraction base_inc() {
public ATNumeric base_inc() {
public ATFraction base_inc() { return NATFraction.atValue(javaValue+1); }
public CalTimezones getTzcache() throws Throwable {
public SATimezonesImpl getTzcache() throws Throwable {
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; }
tzcache = new TimezonesImpl(config.getDebug(), getPublicUser(), rintf);
tzcache = new TimezonesImpl(config.getDebug(), getPublicUser(), this);
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; }
if (config.getFrom2p3px() && (config.getTimezonesFilename() != null)) { 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++; } }
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; }
IdeaReader reader = factory.read(new File(absPath));
Idea idea = factory.read(new File(absPath));
public void openDocument() throws IOException, ReaderException { FileDialog chooser = new FileDialog(mainframe, "Open OPML file", FileDialog.LOAD); chooser.setVisible(true); String filename = chooser.getFile(); if (filename != null) { String absPath = chooser.getDirectory() + chooser.getFile(); ReaderFactory factory = ReaderFactory.getInstance(); IdeaReader reader = factory.read(new File(absPath)); IdeaMap ideaMap = mainframe.getIdeaMap(); ideaMap.setIdea(reader.getIdea()); mainframe.setCurrentFile(absPath); } }
ideaMap.setIdea(reader.getIdea());
ideaMap.setIdea(idea);
public void openDocument() throws IOException, ReaderException { FileDialog chooser = new FileDialog(mainframe, "Open OPML file", FileDialog.LOAD); chooser.setVisible(true); String filename = chooser.getFile(); if (filename != null) { String absPath = chooser.getDirectory() + chooser.getFile(); ReaderFactory factory = ReaderFactory.getInstance(); IdeaReader reader = factory.read(new File(absPath)); IdeaMap ideaMap = mainframe.getIdeaMap(); ideaMap.setIdea(reader.getIdea()); mainframe.setCurrentFile(absPath); } }
for (int j=0; j<chans.length; j++) { String chanKey = ChannelIdUtil.toString(chans[j].get_id()); if ( ! channelMap.containsKey(chanKey)) { channelMap.put(chanKey, chans[j]); if ( ! sites.contains(chans[j].my_site.get_code())) { sites.addElement(chans[j].my_site.get_code()); } if ( ! channels.contains(chans[j].get_code())) { channels.addElement(chans[j].get_code()); }
for (int j=0; j<chans.length; j++) { String chanKey = ChannelIdUtil.toString(chans[j].get_id()); if ( ! channelMap.containsKey(chanKey)) { channelMap.put(chanKey, chans[j]); if ( ! sites.contains(chans[j].my_site.get_code())) { sites.addElement(chans[j].my_site.get_code()); } if ( ! channels.contains(chans[j].get_code())) { channels.addElement(chans[j].get_code()); } } }
void addChannels(Channel[] chans) { for (int j=0; j<chans.length; j++) { String chanKey = ChannelIdUtil.toString(chans[j].get_id()); if ( ! channelMap.containsKey(chanKey)) { channelMap.put(chanKey, chans[j]); if ( ! sites.contains(chans[j].my_site.get_code())) { sites.addElement(chans[j].my_site.get_code()); } if ( ! channels.contains(chans[j].get_code())) { channels.addElement(chans[j].get_code()); } } } // end of for (int j=0; j<chans.length; j++) }
} }
void addChannels(Channel[] chans) { for (int j=0; j<chans.length; j++) { String chanKey = ChannelIdUtil.toString(chans[j].get_id()); if ( ! channelMap.containsKey(chanKey)) { channelMap.put(chanKey, chans[j]); if ( ! sites.contains(chans[j].my_site.get_code())) { sites.addElement(chans[j].my_site.get_code()); } if ( ! channels.contains(chans[j].get_code())) { channels.addElement(chans[j].get_code()); } } } // end of for (int j=0; j<chans.length; j++) }
for (int j=0; j<chans.length; j++) { String chanKey = ChannelIdUtil.toString(chans[j].get_id()); if ( channelMap.containsKey(chanKey)) { channelMap.remove(chanKey);
for (int j=0; j<chans.length; j++) { String chanKey = ChannelIdUtil.toString(chans[j].get_id()); if ( channelMap.containsKey(chanKey)) { channelMap.remove(chanKey); } }
void removeChannels(Channel[] chans) { for (int j=0; j<chans.length; j++) { String chanKey = ChannelIdUtil.toString(chans[j].get_id()); if ( channelMap.containsKey(chanKey)) { channelMap.remove(chanKey); } } }
} }
void removeChannels(Channel[] chans) { for (int j=0; j<chans.length; j++) { String chanKey = ChannelIdUtil.toString(chans[j].get_id()); if ( channelMap.containsKey(chanKey)) { channelMap.remove(chanKey); } } }
setProgressOwner(this); ListSelectionModel selModel = stationList.getSelectionModel(); NetworkAccess[] nets = getSelectedNetworks(); setProgressMax(this, e.getLastIndex()-e.getFirstIndex()+1); for (int i=e.getFirstIndex(); i<=e.getLastIndex(); i++) { String staName = (String)stationNames.getElementAt(i); LinkedList stations = (LinkedList)stationMap.get(staName); Iterator it = stations.iterator(); while ( it.hasNext()) { Station sta = (Station)it.next(); Channel[] chans = null; NetworkAccess net = (NetworkAccess) netIdToNetMap.get(NetworkIdUtil.toString(sta.get_id().network_id)); if ( net != null) { chans = net.retrieve_for_station(sta.get_id()); } else { logger.warn("Unable to find network server for station "+sta.name+" "+StationIdUtil.toString(sta.get_id())); continue; } synchronized (ChannelChooser.this) { if (this.equals(getChannelLoader())) { if (stationList.isSelectedIndex(i)) { addChannels(chans); } else { removeChannels(chans); } } else { return; } }
setProgressOwner(this); ListSelectionModel selModel = stationList.getSelectionModel(); NetworkAccess[] nets = getSelectedNetworks(); setProgressMax(this, e.getLastIndex()-e.getFirstIndex()+1); for (int i=e.getFirstIndex(); i<=e.getLastIndex(); i++) { String staName = (String)stationNames.getElementAt(i); LinkedList stations = (LinkedList)stationMap.get(staName); Iterator it = stations.iterator(); while ( it.hasNext()) { Station sta = (Station)it.next(); Channel[] chans = null; NetworkAccess net = (NetworkAccess) netIdToNetMap.get(NetworkIdUtil.toString(sta.get_id().network_id)); if ( net != null) { chans = net.retrieve_for_station(sta.get_id()); } else { logger.warn("Unable to find network server for station "+sta.name+" "+StationIdUtil.toString(sta.get_id())); continue; } synchronized (ChannelChooser.this) { if (this.equals(getChannelLoader())) { if (stationList.isSelectedIndex(i)) { addChannels(chans); } else { removeChannels(chans); } } else { return; } } } setProgressValue(this, i-e.getFirstIndex()); } progressBar.setValue(progressBar.getMaximum());
public void run() { setProgressOwner(this); ListSelectionModel selModel = stationList.getSelectionModel(); // assume only one selected network at at time... NetworkAccess[] nets = getSelectedNetworks(); setProgressMax(this, e.getLastIndex()-e.getFirstIndex()+1); for (int i=e.getFirstIndex(); i<=e.getLastIndex(); i++) { String staName = (String)stationNames.getElementAt(i); LinkedList stations = (LinkedList)stationMap.get(staName); Iterator it = stations.iterator(); while ( it.hasNext()) { Station sta = (Station)it.next(); Channel[] chans = null; NetworkAccess net = (NetworkAccess) netIdToNetMap.get(NetworkIdUtil.toString(sta.get_id().network_id)); if ( net != null) { chans = net.retrieve_for_station(sta.get_id()); } else { logger.warn("Unable to find network server for station "+sta.name+" "+StationIdUtil.toString(sta.get_id())); continue; } // end of if () synchronized (ChannelChooser.this) { if (this.equals(getChannelLoader())) { if (stationList.isSelectedIndex(i)) { addChannels(chans); } else { removeChannels(chans); } // end of else } else { // no loner active channel loader return; } // end of else } // end of while () } setProgressValue(this, i-e.getFirstIndex()); } // end of for (int i=e.getFirstIndex(); i<e.getLastIndex(); i++) progressBar.setValue(progressBar.getMaximum()); }
setProgressValue(this, i-e.getFirstIndex()); } progressBar.setValue(progressBar.getMaximum()); }
public void run() { setProgressOwner(this); ListSelectionModel selModel = stationList.getSelectionModel(); // assume only one selected network at at time... NetworkAccess[] nets = getSelectedNetworks(); setProgressMax(this, e.getLastIndex()-e.getFirstIndex()+1); for (int i=e.getFirstIndex(); i<=e.getLastIndex(); i++) { String staName = (String)stationNames.getElementAt(i); LinkedList stations = (LinkedList)stationMap.get(staName); Iterator it = stations.iterator(); while ( it.hasNext()) { Station sta = (Station)it.next(); Channel[] chans = null; NetworkAccess net = (NetworkAccess) netIdToNetMap.get(NetworkIdUtil.toString(sta.get_id().network_id)); if ( net != null) { chans = net.retrieve_for_station(sta.get_id()); } else { logger.warn("Unable to find network server for station "+sta.name+" "+StationIdUtil.toString(sta.get_id())); continue; } // end of if () synchronized (ChannelChooser.this) { if (this.equals(getChannelLoader())) { if (stationList.isSelectedIndex(i)) { addChannels(chans); } else { removeChannels(chans); } // end of else } else { // no loner active channel loader return; } // end of else } // end of while () } setProgressValue(this, i-e.getFirstIndex()); } // end of for (int i=e.getFirstIndex(); i<e.getLastIndex(); i++) progressBar.setValue(progressBar.getMaximum()); }
setProgressOwner(this); CacheNetworkAccess cache; logger.debug("Before networks"); if(configuredNetworks == null || configuredNetworks.length == 0) { NetworkAccess[] nets = netdc.a_finder().retrieve_all(); netDCToNetMap.put(netdc, nets); setProgressMax(this, nets.length+1); int progressVal = 1; setProgressValue(this, progressVal); progressVal++; logger.debug("Got all networks, num="+nets.length); for (int i=0; i<nets.length; i++) { if (nets[i] != null) { cache = new DNDNetworkAccess(nets[i]); NetworkAttr attr = cache.get_attributes(); netIdToNetMap.put(NetworkIdUtil.toString(cache.get_attributes().get_id()), cache); logger.debug("Got attributes "+attr.get_code()); networkAdd(cache); } else { logger.warn("a networkaccess returned from NetworkFinder.retrieve_all() is null, skipping."); } setProgressValue(this, progressVal); progressVal++;
setProgressOwner(this); CacheNetworkAccess cache; logger.debug("Before networks"); if(configuredNetworks == null || configuredNetworks.length == 0) { NetworkAccess[] nets = netdc.a_finder().retrieve_all(); netDCToNetMap.put(netdc, nets); setProgressMax(this, nets.length+1); int progressVal = 1; setProgressValue(this, progressVal); progressVal++; logger.debug("Got all networks, num="+nets.length); for (int i=0; i<nets.length; i++) { if (nets[i] != null) { cache = new DNDNetworkAccess(nets[i]); NetworkAttr attr = cache.get_attributes(); netIdToNetMap.put(NetworkIdUtil.toString(cache.get_attributes().get_id()), cache); logger.debug("Got attributes "+attr.get_code()); networkAdd(cache); } else { logger.warn("a networkaccess returned from NetworkFinder.retrieve_all() is null, skipping."); } setProgressValue(this, progressVal); progressVal++; } } else { int totalNetworks = 0; setProgressMax(this, configuredNetworks.length); for(int counter = 0; counter < configuredNetworks.length; counter++) { try { logger.debug("Getting network for "+configuredNetworks[counter]); NetworkAccess[] nets = netdc.a_finder().retrieve_by_code(configuredNetworks[counter]); logger.debug("Got "+nets.length+" networks for "+configuredNetworks[counter]); for(int subCounter = 0; subCounter < nets.length; subCounter++) { if (nets[subCounter] != null) { cache = new DNDNetworkAccess(nets[subCounter]); NetworkAttr attr = cache.get_attributes(); NetworkAccess[] storedNets = (NetworkAccess[])netDCToNetMap.get(netdc); if ( storedNets == null) { storedNets = new NetworkAccess[1]; storedNets[0] = cache; netDCToNetMap.put(netdc, storedNets); } else { NetworkAccess[] tmp = new NetworkAccess[storedNets.length+1]; System.arraycopy(storedNets, 0, tmp, 0, storedNets.length); tmp[storedNets.length] = cache; netDCToNetMap.put(netdc, tmp); } netIdToNetMap.put(NetworkIdUtil.toString(cache.get_attributes().get_id()), cache); logger.debug("Got attributes "+attr.get_code()); networkAdd(cache); totalNetworks++; } else { logger.warn("a networkaccess returned from NetworkFinder.retrieve_by_code is null, skipping."); } } }catch(NetworkNotFound nnfe) { logger.warn("Network "+configuredNetworks[counter]+" not found while getting network access uding NetworkFinder.retrieve_by_code"); } setProgressValue(this, counter+1); } } if (doSelect) { SwingUtilities.invokeLater(new Runnable() { public void run() { networkList.getSelectionModel().setSelectionInterval(0, networkList.getModel().getSize()-1); } }); } setProgressValue(this, progressBar.getMaximum());
public void run() { setProgressOwner(this); CacheNetworkAccess cache; logger.debug("Before networks"); if(configuredNetworks == null || configuredNetworks.length == 0) { NetworkAccess[] nets = netdc.a_finder().retrieve_all(); netDCToNetMap.put(netdc, nets); setProgressMax(this, nets.length+1); int progressVal = 1; setProgressValue(this, progressVal); progressVal++; logger.debug("Got all networks, num="+nets.length); for (int i=0; i<nets.length; i++) { // skip null networks...probably a bug on the server if (nets[i] != null) { // cache = new CacheNetworkAccess(nets[i]); cache = new DNDNetworkAccess(nets[i]); NetworkAttr attr = cache.get_attributes(); netIdToNetMap.put(NetworkIdUtil.toString(cache.get_attributes().get_id()), cache); logger.debug("Got attributes "+attr.get_code()); // preload attributes networkAdd(cache); } else { logger.warn("a networkaccess returned from NetworkFinder.retrieve_all() is null, skipping."); } // end of else setProgressValue(this, progressVal); progressVal++; } } else { //when the channelChooser is configured with networkCodes.... int totalNetworks = 0; setProgressMax(this, configuredNetworks.length); for(int counter = 0; counter < configuredNetworks.length; counter++) { try { logger.debug("Getting network for "+configuredNetworks[counter]); NetworkAccess[] nets = netdc.a_finder().retrieve_by_code(configuredNetworks[counter]); logger.debug("Got "+nets.length+" networks for "+configuredNetworks[counter]); for(int subCounter = 0; subCounter < nets.length; subCounter++) { if (nets[subCounter] != null) { // cache = new CacheNetworkAccess(nets[subCounter]); // preload attributes cache = new DNDNetworkAccess(nets[subCounter]); NetworkAttr attr = cache.get_attributes(); NetworkAccess[] storedNets = (NetworkAccess[])netDCToNetMap.get(netdc); if ( storedNets == null) { storedNets = new NetworkAccess[1]; storedNets[0] = cache; netDCToNetMap.put(netdc, storedNets); } else { NetworkAccess[] tmp = new NetworkAccess[storedNets.length+1]; System.arraycopy(storedNets, 0, tmp, 0, storedNets.length); tmp[storedNets.length] = cache; netDCToNetMap.put(netdc, tmp); } // end of else netIdToNetMap.put(NetworkIdUtil.toString(cache.get_attributes().get_id()), cache); logger.debug("Got attributes "+attr.get_code()); networkAdd(cache); totalNetworks++; } else { logger.warn("a networkaccess returned from NetworkFinder.retrieve_by_code is null, skipping."); } // end of else }//end of inner for subCounter = 0; }catch(NetworkNotFound nnfe) { logger.warn("Network "+configuredNetworks[counter]+" not found while getting network access uding NetworkFinder.retrieve_by_code"); } setProgressValue(this, counter+1); }//end of outer for counter = 0; }//end of if else checking for configuredNetworks == null if (doSelect) { // need to do this later to give java Event thread time to set // up network list before setting selection SwingUtilities.invokeLater(new Runnable() { public void run() { networkList.getSelectionModel().setSelectionInterval(0, networkList.getModel().getSize()-1); } }); } // end of if () setProgressValue(this, progressBar.getMaximum()); }
} else { int totalNetworks = 0; setProgressMax(this, configuredNetworks.length); for(int counter = 0; counter < configuredNetworks.length; counter++) { try { logger.debug("Getting network for "+configuredNetworks[counter]); NetworkAccess[] nets = netdc.a_finder().retrieve_by_code(configuredNetworks[counter]); logger.debug("Got "+nets.length+" networks for "+configuredNetworks[counter]); for(int subCounter = 0; subCounter < nets.length; subCounter++) { if (nets[subCounter] != null) { cache = new DNDNetworkAccess(nets[subCounter]); NetworkAttr attr = cache.get_attributes(); NetworkAccess[] storedNets = (NetworkAccess[])netDCToNetMap.get(netdc); if ( storedNets == null) { storedNets = new NetworkAccess[1]; storedNets[0] = cache; netDCToNetMap.put(netdc, storedNets); } else { NetworkAccess[] tmp = new NetworkAccess[storedNets.length+1]; System.arraycopy(storedNets, 0, tmp, 0, storedNets.length); tmp[storedNets.length] = cache; netDCToNetMap.put(netdc, tmp); } netIdToNetMap.put(NetworkIdUtil.toString(cache.get_attributes().get_id()), cache); logger.debug("Got attributes "+attr.get_code()); networkAdd(cache); totalNetworks++; } else { logger.warn("a networkaccess returned from NetworkFinder.retrieve_by_code is null, skipping."); } } }catch(NetworkNotFound nnfe) { logger.warn("Network "+configuredNetworks[counter]+" not found while getting network access uding NetworkFinder.retrieve_by_code"); } setProgressValue(this, counter+1); } } if (doSelect) { SwingUtilities.invokeLater(new Runnable() { public void run() { networkList.getSelectionModel().setSelectionInterval(0, networkList.getModel().getSize()-1); } }); } setProgressValue(this, progressBar.getMaximum()); }
public void run() { setProgressOwner(this); CacheNetworkAccess cache; logger.debug("Before networks"); if(configuredNetworks == null || configuredNetworks.length == 0) { NetworkAccess[] nets = netdc.a_finder().retrieve_all(); netDCToNetMap.put(netdc, nets); setProgressMax(this, nets.length+1); int progressVal = 1; setProgressValue(this, progressVal); progressVal++; logger.debug("Got all networks, num="+nets.length); for (int i=0; i<nets.length; i++) { // skip null networks...probably a bug on the server if (nets[i] != null) { // cache = new CacheNetworkAccess(nets[i]); cache = new DNDNetworkAccess(nets[i]); NetworkAttr attr = cache.get_attributes(); netIdToNetMap.put(NetworkIdUtil.toString(cache.get_attributes().get_id()), cache); logger.debug("Got attributes "+attr.get_code()); // preload attributes networkAdd(cache); } else { logger.warn("a networkaccess returned from NetworkFinder.retrieve_all() is null, skipping."); } // end of else setProgressValue(this, progressVal); progressVal++; } } else { //when the channelChooser is configured with networkCodes.... int totalNetworks = 0; setProgressMax(this, configuredNetworks.length); for(int counter = 0; counter < configuredNetworks.length; counter++) { try { logger.debug("Getting network for "+configuredNetworks[counter]); NetworkAccess[] nets = netdc.a_finder().retrieve_by_code(configuredNetworks[counter]); logger.debug("Got "+nets.length+" networks for "+configuredNetworks[counter]); for(int subCounter = 0; subCounter < nets.length; subCounter++) { if (nets[subCounter] != null) { // cache = new CacheNetworkAccess(nets[subCounter]); // preload attributes cache = new DNDNetworkAccess(nets[subCounter]); NetworkAttr attr = cache.get_attributes(); NetworkAccess[] storedNets = (NetworkAccess[])netDCToNetMap.get(netdc); if ( storedNets == null) { storedNets = new NetworkAccess[1]; storedNets[0] = cache; netDCToNetMap.put(netdc, storedNets); } else { NetworkAccess[] tmp = new NetworkAccess[storedNets.length+1]; System.arraycopy(storedNets, 0, tmp, 0, storedNets.length); tmp[storedNets.length] = cache; netDCToNetMap.put(netdc, tmp); } // end of else netIdToNetMap.put(NetworkIdUtil.toString(cache.get_attributes().get_id()), cache); logger.debug("Got attributes "+attr.get_code()); networkAdd(cache); totalNetworks++; } else { logger.warn("a networkaccess returned from NetworkFinder.retrieve_by_code is null, skipping."); } // end of else }//end of inner for subCounter = 0; }catch(NetworkNotFound nnfe) { logger.warn("Network "+configuredNetworks[counter]+" not found while getting network access uding NetworkFinder.retrieve_by_code"); } setProgressValue(this, counter+1); }//end of outer for counter = 0; }//end of if else checking for configuredNetworks == null if (doSelect) { // need to do this later to give java Event thread time to set // up network list before setting selection SwingUtilities.invokeLater(new Runnable() { public void run() { networkList.getSelectionModel().setSelectionInterval(0, networkList.getModel().getSize()-1); } }); } // end of if () setProgressValue(this, progressBar.getMaximum()); }
setProgressOwner(this); setProgressMax(this, 100); logger.debug("There are "+nets.length+" selected networks."); try { synchronized (ChannelChooser.this) { if (this.equals(getStationLoader())) { clearStationsFromThread(); }
setProgressOwner(this); setProgressMax(this, 100); logger.debug("There are "+nets.length+" selected networks."); try { synchronized (ChannelChooser.this) { if (this.equals(getStationLoader())) { clearStationsFromThread(); } } int netProgressInc = 50 / nets.length; int progressValue = 10; setProgressValue(this, progressValue); for (int i=0; i<nets.length; i++) { logger.debug("Before get stations"); Station[] newStations = nets[i].retrieve_stations(); logger.debug("got "+newStations.length+" stations"); setProgressValue(this, progressValue+netProgressInc/2); for (int j=0; j<newStations.length; j++) { synchronized (ChannelChooser.this) { if (this.equals(getStationLoader())) { stationAdd(newStations[j]); } else { return; } } setProgressValue(this, progressValue+netProgressInc/2- (newStations.length-j)/newStations.length); } setProgressValue(this, 100); logger.debug("finished adding stations"); } logger.debug("There are "+stationNames.getSize()+" items in the station list model"); } catch (Exception e) { ExceptionHandlerGUI.handleException("Unable to get stations.", e); }
public void run() { setProgressOwner(this); setProgressMax(this, 100); logger.debug("There are "+nets.length+" selected networks."); try { synchronized (ChannelChooser.this) { if (this.equals(getStationLoader())) { clearStationsFromThread(); } } int netProgressInc = 50 / nets.length; int progressValue = 10; setProgressValue(this, progressValue); for (int i=0; i<nets.length; i++) { logger.debug("Before get stations"); Station[] newStations = nets[i].retrieve_stations(); logger.debug("got "+newStations.length+" stations"); setProgressValue(this, progressValue+netProgressInc/2); for (int j=0; j<newStations.length; j++) { synchronized (ChannelChooser.this) { if (this.equals(getStationLoader())) { stationAdd(newStations[j]);// try {// sleep((int)(.01*1000)); // } catch (InterruptedException e) { // } // end of try-catch } else { // no longer the active station loader return; } // end of else } setProgressValue(this, progressValue+netProgressInc/2- (newStations.length-j)/newStations.length); } setProgressValue(this, 100); logger.debug("finished adding stations");// try {// sleep((int)(.01*1000)); // } catch (InterruptedException e) { // } // end of try-catch } // end of for ((int i=0; i<nets.length; i++) logger.debug("There are "+stationNames.getSize()+" items in the station list model"); // stationList.validate(); //stationList.repaint(); } catch (Exception e) { edu.sc.seis.fissuresUtil.exceptionHandlerGUI.ExceptionHandlerGUI.handleException(e); } // end of try-catch } }
int netProgressInc = 50 / nets.length; int progressValue = 10; setProgressValue(this, progressValue); for (int i=0; i<nets.length; i++) { logger.debug("Before get stations"); Station[] newStations = nets[i].retrieve_stations(); logger.debug("got "+newStations.length+" stations"); setProgressValue(this, progressValue+netProgressInc/2); for (int j=0; j<newStations.length; j++) { synchronized (ChannelChooser.this) { if (this.equals(getStationLoader())) { stationAdd(newStations[j]); } else { return; } } setProgressValue(this, progressValue+netProgressInc/2- (newStations.length-j)/newStations.length); } setProgressValue(this, 100); logger.debug("finished adding stations"); } logger.debug("There are "+stationNames.getSize()+" items in the station list model"); } catch (Exception e) { edu.sc.seis.fissuresUtil.exceptionHandlerGUI.ExceptionHandlerGUI.handleException(e); } }
public void run() { setProgressOwner(this); setProgressMax(this, 100); logger.debug("There are "+nets.length+" selected networks."); try { synchronized (ChannelChooser.this) { if (this.equals(getStationLoader())) { clearStationsFromThread(); } } int netProgressInc = 50 / nets.length; int progressValue = 10; setProgressValue(this, progressValue); for (int i=0; i<nets.length; i++) { logger.debug("Before get stations"); Station[] newStations = nets[i].retrieve_stations(); logger.debug("got "+newStations.length+" stations"); setProgressValue(this, progressValue+netProgressInc/2); for (int j=0; j<newStations.length; j++) { synchronized (ChannelChooser.this) { if (this.equals(getStationLoader())) { stationAdd(newStations[j]);// try {// sleep((int)(.01*1000)); // } catch (InterruptedException e) { // } // end of try-catch } else { // no longer the active station loader return; } // end of else } setProgressValue(this, progressValue+netProgressInc/2- (newStations.length-j)/newStations.length); } setProgressValue(this, 100); logger.debug("finished adding stations");// try {// sleep((int)(.01*1000)); // } catch (InterruptedException e) { // } // end of try-catch } // end of for ((int i=0; i<nets.length; i++) logger.debug("There are "+stationNames.getSize()+" items in the station list model"); // stationList.validate(); //stationList.repaint(); } catch (Exception e) { edu.sc.seis.fissuresUtil.exceptionHandlerGUI.ExceptionHandlerGUI.handleException(e); } // end of try-catch } }
if (extension != null && !extension.equals(getFilePath().getFileExtension())) {
if (extension != null && !getFilePath().toString().endsWith("." + extension)) {
protected boolean validatePage() { if (!super.validatePage()) { return false; } String extension = getExtension(); if (extension != null && !extension.equals(getFilePath().getFileExtension())) { setErrorMessage(NLS.bind("File name should have ''{0}'' extension.", extension)); return false; } return true; }
}
endtzid = eend.getTzid(); } CalTimezones ctz = getTimezones(); dstart = ctz.getUtc(dstart, sttzid, null); dend = ctz.getUtc(dend, endtzid, null);
public BwFreeBusy getFreeBusy(Collection subs, BwCalendar cal, BwPrincipal who, BwDateTime start, BwDateTime end, BwDuration granularity, boolean returnAll) throws CalFacadeException { if (!(who instanceof BwUser)) { throw new CalFacadeException("Unsupported: non user principal for free-busy"); } BwUser u = (BwUser)who; if (subs != null) { // Use these } else if (cal != null) { getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); BwSubscription sub = BwSubscription.makeSubscription(cal); subs = new ArrayList(); subs.add(sub); } else if (currentUser().equals(who)) { subs = getSubscriptions(); } else { /* First see if we have free busy access to the users calendar */ cal = getCal().getCalendars(u, PrivilegeDefs.privReadFreeBusy); if (cal == null) { throw new CalFacadeAccessException(); } getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); subs = dbi.fetchPreferences(u).getSubscriptions(); } BwFreeBusy fb = new BwFreeBusy(who, start, end); Collection events = new TreeSet(); Iterator subit = subs.iterator(); while (subit.hasNext()) { BwSubscription sub = (BwSubscription)subit.next(); if (!sub.getAffectsFreeBusy()) { continue; } // XXX If it's an external subscription we probably just get free busy and // merge it in. Collection evs = getEvents(sub, null, start, end, CalFacadeDefs.retrieveRecurExpanded, true); // Filter out transparent events Iterator it = evs.iterator(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); if (!sub.getIgnoreTransparency() && BwEvent.transparencyTransparent.equals(ev.getTransparency())) { // Ignore this one. continue; } if (BwEvent.statusCancelled.equals(ev.getStatus())) { // Ignore this one. continue; } events.add(ei); } } try { if (granularity != null) { // chunked. GetPeriodsPars gpp = new GetPeriodsPars(); gpp.periods = events; gpp.startDt = start; gpp.dur = granularity; gpp.tzcache = getTimezones(); BwFreeBusyComponent fbc = null; if (!returnAll) { // One component fbc = new BwFreeBusyComponent(); fb.addTime(fbc); } int limit = 10000; // XXX do this better /* endDt is null first time through, then represents end of last * segment. */ while ((gpp.endDt == null) || (gpp.endDt.before(end))) { //if (debug) { // trace("gpp.startDt=" + gpp.startDt + " end=" + end); //} if (limit < 0) { throw new CalFacadeException("org.bedework.svci.limit.exceeded"); } limit--; Collection periodEvents = Granulator.getPeriodsEvents(gpp); if (returnAll) { fbc = new BwFreeBusyComponent(); fb.addTime(fbc); DateTime psdt = new DateTime(gpp.startDt.getDtval()); DateTime pedt = new DateTime(gpp.endDt.getDtval()); psdt.setUtc(true); pedt.setUtc(true); fbc.addPeriod(new Period(psdt, pedt)); if (periodEvents.size() == 0) { fbc.setType(BwFreeBusyComponent.typeFree); } else { fbc.setType(getFreeBusyType(periodEvents)); } } else if (periodEvents.size() != 0) { /* Some events fall in the period. Add an entry. * We eliminated cancelled events earler. Now we should set the * free/busy type based on the events status. */ DateTime psdt = new DateTime(gpp.startDt.getDtval()); DateTime pedt = new DateTime(gpp.endDt.getDtval()); psdt.setUtc(true); pedt.setUtc(true); if (fbc == null) { fbc = new BwFreeBusyComponent(); fb.addTime(fbc); } fbc.addPeriod(new Period(psdt, pedt)); fbc.setType(getFreeBusyType(periodEvents)); } } return fb; } Iterator it = events.iterator(); TreeSet eventPeriods = new TreeSet(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); if (BwEvent.statusCancelled.equals(ev.getStatus())) { // Ignore this one. continue; } // Ignore if times were specified and this event is outside the times BwDateTime estart = ev.getDtstart(); BwDateTime eend = ev.getDtend(); /* Don't report out of the requested period */ String dstart; String dend; if (estart.before(start)) { dstart = start.getDtval(); } else { dstart = estart.getDtval(); } if (eend.after(end)) { dend = end.getDtval(); } else { dend = eend.getDtval(); } DateTime psdt = new DateTime(dstart); DateTime pedt = new DateTime(dend); psdt.setUtc(true); pedt.setUtc(true); int type = BwFreeBusyComponent.typeBusy; if (BwEvent.statusTentative.equals(ev.getStatus())) { type = BwFreeBusyComponent.typeBusyTentative; } eventPeriods.add(new EventPeriod(psdt, pedt, type)); } /* iterate through the sorted periods combining them where they are adjacent or overlap */ Period p = null; /* For the moment just build a single BwFreeBusyComponent */ BwFreeBusyComponent fbc = null; int lastType = 0; it = eventPeriods.iterator(); while (it.hasNext()) { EventPeriod ep = (EventPeriod)it.next(); if (debug) { trace(ep.toString()); } if (p == null) { p = new Period(ep.start, ep.end); lastType = ep.type; } else if ((lastType != ep.type) || ep.start.after(p.getEnd())) { // Non adjacent periods if (fbc == null) { fbc = new BwFreeBusyComponent(); fbc.setType(lastType); fb.addTime(fbc); } fbc.addPeriod(p); if (lastType != ep.type) { fbc = null; } p = new Period(ep.start, ep.end); lastType = ep.type; } else if (ep.end.after(p.getEnd())) { // Extend the current period p = new Period(p.getStart(), ep.end); } // else it falls within the existing period } if (p != null) { if ((fbc == null) || (lastType != fbc.getType())) { fbc = new BwFreeBusyComponent(); fbc.setType(lastType); fb.addTime(fbc); } fbc.addPeriod(p); } } catch (Throwable t) { if (debug) { error(t); } throw new CalFacadeException(t); } return fb; }
if (!isSelected) { setEditing(false); }
public void setSelected(boolean isSelected) { this.selected = isSelected; repaintRequired(); }
getNsIntf().emitSupportedPrivSet(node);
private int doPropFind(WebdavNsNode node, PropRequest preq) throws WebdavException { Enumeration en = preq.props.elements(); while (en.hasMoreElements()) { WebdavProperty pr = (WebdavProperty)en.nextElement(); QName tag = pr.getTag(); String ns = tag.getNamespaceURI(); /* Deal with webdav properties */ if (ns.equals(WebdavTags.namespace)) { if (tag.equals(WebdavTags.creationdate)) { // dav 13.1 if (node.getCreDate() != null) { property(WebdavTags.creationdate, node.getCreDate()); } } else if (tag.equals(WebdavTags.displayname)) { // dav 13.2 property(WebdavTags.displayname, node.getName()); } else if (tag.equals(WebdavTags.getcontentlanguage)) { // dav 13.3 } else if (tag.equals(WebdavTags.getcontentlength)) { // dav 13.4 } else if (tag.equals(WebdavTags.getcontenttype)) { // dav 13.5 getNsIntf().generatePropContenttype(node); } else if (tag.equals(WebdavTags.getetag)) { // dav 13.6 property(WebdavTags.getetag, getEntityTag(node, true)); } else if (tag.equals(WebdavTags.getlastmodified)) { // dav 13.7 if (node.getLastmodDate() != null) { property(WebdavTags.getlastmodified, node.getLastmodDate()); } } else if (tag.equals(WebdavTags.lockdiscovery)) { // dav 13.8 } else if (tag.equals(WebdavTags.resourcetype)) { // dav 13.9 getNsIntf().generatePropResourcetype(node); } else if (tag.equals(WebdavTags.source)) { // dav 13.10 } else if (tag.equals(WebdavTags.supportedlock)) { // dav 13.11 } else if (tag.equals(WebdavTags.owner)) { // access 5.1 openTag(WebdavTags.owner); property(WebdavTags.href, getNsIntf().makeUserHref(node.getOwner())); closeTag(WebdavTags.owner); } else if (tag.equals(WebdavTags.supportedPrivilegeSet)) { // access 5.2 } else if (tag.equals(WebdavTags.currentUserPrivilegeSet)) { // access 5.3 } else if (tag.equals(WebdavTags.acl)) { // access 5.4 getNsIntf().emitAcl(node); } else if (tag.equals(WebdavTags.aclRestrictions)) { // access 5.5 } else if (tag.equals(WebdavTags.inheritedAclSet)) { // access 5.6 } else if (tag.equals(WebdavTags.principalCollectionSet)) { // access 5.7 } } else { } } return HttpServletResponse.SC_OK; }
firstDay.set(Calendar.HOUR_OF_DAY, 0); firstDay.set(Calendar.MINUTE, 0); firstDay.set(Calendar.SECOND, 0); firstDay.set(Calendar.MILLISECOND, 0);
public MyCalendarVO getFirstDayOfThisMonth() { Calendar firstDay = (Calendar)calendar.clone(); firstDay.set(Calendar.DAY_OF_MONTH, calendar.getMinimum(Calendar.DAY_OF_MONTH)); return new MyCalendarVO(firstDay, calInfo.getLocale()); }
c.set(Calendar.HOUR_OF_DAY, 0); c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); c.set(Calendar.MILLISECOND, 0);
public MyCalendarVO getLastDayOfThisMonth() { Calendar c = (Calendar)calendar.clone(); c.set(Calendar.DAY_OF_MONTH, calendar.getMinimum(Calendar.DAY_OF_MONTH)); c.add(Calendar.MONTH, 1); c.add(Calendar.DATE, -1); return new MyCalendarVO(c, calInfo.getLocale()); }
c.set(Calendar.HOUR_OF_DAY, 0); c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); c.set(Calendar.MILLISECOND, 0);
public MyCalendarVO getLastDayOfThisWeek() { Calendar c = (Calendar)calendar.clone(); c.set(Calendar.DAY_OF_WEEK, calInfo.getFirstDayOfWeek()); c.add(Calendar.WEEK_OF_YEAR, 1); c.add(Calendar.DATE, -1); return new MyCalendarVO(c, calInfo.getLocale()); }
int id = getIntReqPar(request, "calId", -1);
String calPath = request.getParameter("calPath");
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "notFound"; } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; EventInfo ei = null; BwEvent ev = null; String rpar = getReqPar(request, "guid"); if (rpar != null) { // Assume event ei = findEvent(request, form); if (ei == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchevent"); return "doNothing"; } ev = ei.getEvent(); } else { int id = getIntReqPar(request, "calId", -1); if (id < 0) { // bogus request return "notFound"; } cal = svci.getCalendar(id); if (cal == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchcalendar", id); return "notFound"; } } String how = getReqPar(request, "how"); if (how == null) { form.getErr().emit("org.bedework.client.error.nohowaccess"); return "error"; } int desiredAccess = -1; //boolean defaultAccess = false; if (how.equals("r")) { desiredAccess = PrivilegeDefs.privRead; } else if (how.equals("w")) { desiredAccess = PrivilegeDefs.privWrite; } else if (how.equals("f")) { desiredAccess = PrivilegeDefs.privReadFreeBusy; } else if (how.equals("d")) { //defaultAccess = true; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else { form.getErr().emit("org.bedework.client.error.badhow"); return "error"; } String whoTypeStr = request.getParameter("whoType"); int whoType = -1; if (whoTypeStr == null) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("owner")) { whoType = Ace.whoTypeOwner; } else if (whoTypeStr.equals("user")) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("group")) { whoType = Ace.whoTypeGroup; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else if (whoTypeStr.equals("unauth")) { whoType = Ace.whoTypeUnauthenticated; } else if (whoTypeStr.equals("other")) { whoType = Ace.whoTypeOther; } else { form.getErr().emit("org.bedework.client.error.badwhotype"); return "error"; } String who = request.getParameter("who"); if (who != null) { BwUser user = svci.findUser(who); if (user == null) { form.getErr().emit("org.bedework.client.error.usernotfound"); return "notFound"; } } else { who = null; } ArrayList aces = new ArrayList(); aces.add(new Ace(who, false, whoType, Privileges.makePriv(desiredAccess))); if (ev != null) { svci.changeAccess(ev, aces); svci.updateEvent(ev); } else { svci.changeAccess(cal, aces); svci.updateCalendar(cal); } return "success"; }
if (id < 0) {
if (calPath == null) {
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "notFound"; } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; EventInfo ei = null; BwEvent ev = null; String rpar = getReqPar(request, "guid"); if (rpar != null) { // Assume event ei = findEvent(request, form); if (ei == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchevent"); return "doNothing"; } ev = ei.getEvent(); } else { int id = getIntReqPar(request, "calId", -1); if (id < 0) { // bogus request return "notFound"; } cal = svci.getCalendar(id); if (cal == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchcalendar", id); return "notFound"; } } String how = getReqPar(request, "how"); if (how == null) { form.getErr().emit("org.bedework.client.error.nohowaccess"); return "error"; } int desiredAccess = -1; //boolean defaultAccess = false; if (how.equals("r")) { desiredAccess = PrivilegeDefs.privRead; } else if (how.equals("w")) { desiredAccess = PrivilegeDefs.privWrite; } else if (how.equals("f")) { desiredAccess = PrivilegeDefs.privReadFreeBusy; } else if (how.equals("d")) { //defaultAccess = true; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else { form.getErr().emit("org.bedework.client.error.badhow"); return "error"; } String whoTypeStr = request.getParameter("whoType"); int whoType = -1; if (whoTypeStr == null) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("owner")) { whoType = Ace.whoTypeOwner; } else if (whoTypeStr.equals("user")) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("group")) { whoType = Ace.whoTypeGroup; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else if (whoTypeStr.equals("unauth")) { whoType = Ace.whoTypeUnauthenticated; } else if (whoTypeStr.equals("other")) { whoType = Ace.whoTypeOther; } else { form.getErr().emit("org.bedework.client.error.badwhotype"); return "error"; } String who = request.getParameter("who"); if (who != null) { BwUser user = svci.findUser(who); if (user == null) { form.getErr().emit("org.bedework.client.error.usernotfound"); return "notFound"; } } else { who = null; } ArrayList aces = new ArrayList(); aces.add(new Ace(who, false, whoType, Privileges.makePriv(desiredAccess))); if (ev != null) { svci.changeAccess(ev, aces); svci.updateEvent(ev); } else { svci.changeAccess(cal, aces); svci.updateCalendar(cal); } return "success"; }
cal = svci.getCalendar(id);
cal = svci.getCalendar(calPath);
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "notFound"; } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; EventInfo ei = null; BwEvent ev = null; String rpar = getReqPar(request, "guid"); if (rpar != null) { // Assume event ei = findEvent(request, form); if (ei == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchevent"); return "doNothing"; } ev = ei.getEvent(); } else { int id = getIntReqPar(request, "calId", -1); if (id < 0) { // bogus request return "notFound"; } cal = svci.getCalendar(id); if (cal == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchcalendar", id); return "notFound"; } } String how = getReqPar(request, "how"); if (how == null) { form.getErr().emit("org.bedework.client.error.nohowaccess"); return "error"; } int desiredAccess = -1; //boolean defaultAccess = false; if (how.equals("r")) { desiredAccess = PrivilegeDefs.privRead; } else if (how.equals("w")) { desiredAccess = PrivilegeDefs.privWrite; } else if (how.equals("f")) { desiredAccess = PrivilegeDefs.privReadFreeBusy; } else if (how.equals("d")) { //defaultAccess = true; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else { form.getErr().emit("org.bedework.client.error.badhow"); return "error"; } String whoTypeStr = request.getParameter("whoType"); int whoType = -1; if (whoTypeStr == null) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("owner")) { whoType = Ace.whoTypeOwner; } else if (whoTypeStr.equals("user")) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("group")) { whoType = Ace.whoTypeGroup; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else if (whoTypeStr.equals("unauth")) { whoType = Ace.whoTypeUnauthenticated; } else if (whoTypeStr.equals("other")) { whoType = Ace.whoTypeOther; } else { form.getErr().emit("org.bedework.client.error.badwhotype"); return "error"; } String who = request.getParameter("who"); if (who != null) { BwUser user = svci.findUser(who); if (user == null) { form.getErr().emit("org.bedework.client.error.usernotfound"); return "notFound"; } } else { who = null; } ArrayList aces = new ArrayList(); aces.add(new Ace(who, false, whoType, Privileges.makePriv(desiredAccess))); if (ev != null) { svci.changeAccess(ev, aces); svci.updateEvent(ev); } else { svci.changeAccess(cal, aces); svci.updateCalendar(cal); } return "success"; }
form.getErr().emit("org.bedework.client.error.nosuchcalendar", id);
form.getErr().emit("org.bedework.client.error.nosuchcalendar", calPath);
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "notFound"; } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; EventInfo ei = null; BwEvent ev = null; String rpar = getReqPar(request, "guid"); if (rpar != null) { // Assume event ei = findEvent(request, form); if (ei == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchevent"); return "doNothing"; } ev = ei.getEvent(); } else { int id = getIntReqPar(request, "calId", -1); if (id < 0) { // bogus request return "notFound"; } cal = svci.getCalendar(id); if (cal == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchcalendar", id); return "notFound"; } } String how = getReqPar(request, "how"); if (how == null) { form.getErr().emit("org.bedework.client.error.nohowaccess"); return "error"; } int desiredAccess = -1; //boolean defaultAccess = false; if (how.equals("r")) { desiredAccess = PrivilegeDefs.privRead; } else if (how.equals("w")) { desiredAccess = PrivilegeDefs.privWrite; } else if (how.equals("f")) { desiredAccess = PrivilegeDefs.privReadFreeBusy; } else if (how.equals("d")) { //defaultAccess = true; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else { form.getErr().emit("org.bedework.client.error.badhow"); return "error"; } String whoTypeStr = request.getParameter("whoType"); int whoType = -1; if (whoTypeStr == null) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("owner")) { whoType = Ace.whoTypeOwner; } else if (whoTypeStr.equals("user")) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("group")) { whoType = Ace.whoTypeGroup; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else if (whoTypeStr.equals("unauth")) { whoType = Ace.whoTypeUnauthenticated; } else if (whoTypeStr.equals("other")) { whoType = Ace.whoTypeOther; } else { form.getErr().emit("org.bedework.client.error.badwhotype"); return "error"; } String who = request.getParameter("who"); if (who != null) { BwUser user = svci.findUser(who); if (user == null) { form.getErr().emit("org.bedework.client.error.usernotfound"); return "notFound"; } } else { who = null; } ArrayList aces = new ArrayList(); aces.add(new Ace(who, false, whoType, Privileges.makePriv(desiredAccess))); if (ev != null) { svci.changeAccess(ev, aces); svci.updateEvent(ev); } else { svci.changeAccess(cal, aces); svci.updateCalendar(cal); } return "success"; }
} String how = getReqPar(request, "how"); if (how == null) { form.getErr().emit("org.bedework.client.error.nohowaccess"); return "error"; } int desiredAccess = -1; if (how.equals("r")) { desiredAccess = PrivilegeDefs.privRead; } else if (how.equals("w")) { desiredAccess = PrivilegeDefs.privWrite; } else if (how.equals("f")) { desiredAccess = PrivilegeDefs.privReadFreeBusy; } else if (how.equals("d")) { form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else { form.getErr().emit("org.bedework.client.error.badhow"); return "error";
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "notFound"; } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; EventInfo ei = null; BwEvent ev = null; String rpar = getReqPar(request, "guid"); if (rpar != null) { // Assume event ei = findEvent(request, form); if (ei == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchevent"); return "doNothing"; } ev = ei.getEvent(); } else { int id = getIntReqPar(request, "calId", -1); if (id < 0) { // bogus request return "notFound"; } cal = svci.getCalendar(id); if (cal == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchcalendar", id); return "notFound"; } } String how = getReqPar(request, "how"); if (how == null) { form.getErr().emit("org.bedework.client.error.nohowaccess"); return "error"; } int desiredAccess = -1; //boolean defaultAccess = false; if (how.equals("r")) { desiredAccess = PrivilegeDefs.privRead; } else if (how.equals("w")) { desiredAccess = PrivilegeDefs.privWrite; } else if (how.equals("f")) { desiredAccess = PrivilegeDefs.privReadFreeBusy; } else if (how.equals("d")) { //defaultAccess = true; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else { form.getErr().emit("org.bedework.client.error.badhow"); return "error"; } String whoTypeStr = request.getParameter("whoType"); int whoType = -1; if (whoTypeStr == null) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("owner")) { whoType = Ace.whoTypeOwner; } else if (whoTypeStr.equals("user")) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("group")) { whoType = Ace.whoTypeGroup; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else if (whoTypeStr.equals("unauth")) { whoType = Ace.whoTypeUnauthenticated; } else if (whoTypeStr.equals("other")) { whoType = Ace.whoTypeOther; } else { form.getErr().emit("org.bedework.client.error.badwhotype"); return "error"; } String who = request.getParameter("who"); if (who != null) { BwUser user = svci.findUser(who); if (user == null) { form.getErr().emit("org.bedework.client.error.usernotfound"); return "notFound"; } } else { who = null; } ArrayList aces = new ArrayList(); aces.add(new Ace(who, false, whoType, Privileges.makePriv(desiredAccess))); if (ev != null) { svci.changeAccess(ev, aces); svci.updateEvent(ev); } else { svci.changeAccess(cal, aces); svci.updateCalendar(cal); } return "success"; }
aces.add(new Ace(who, false, whoType, Privileges.makePriv(desiredAccess)));
String how = getReqPar(request, "how"); if (how == null) { form.getErr().emit("org.bedework.client.error.nohowaccess"); return "error"; } char[] howchs = how.toCharArray(); for (int hi = 0; hi <= howchs.length; hi++) { char howch = howchs[hi]; boolean found = false; for (int pi = 0; pi <= PrivilegeDefs.privMaxType; pi++) { if (howch == PrivilegeDefs.privEncoding[pi]) { aces.add(new Ace(who, false, whoType, Privileges.makePriv(pi))); found = true; break; } if (!found) { form.getErr().emit("org.bedework.client.error.badhow"); return "error"; } } }
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "notFound"; } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; EventInfo ei = null; BwEvent ev = null; String rpar = getReqPar(request, "guid"); if (rpar != null) { // Assume event ei = findEvent(request, form); if (ei == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchevent"); return "doNothing"; } ev = ei.getEvent(); } else { int id = getIntReqPar(request, "calId", -1); if (id < 0) { // bogus request return "notFound"; } cal = svci.getCalendar(id); if (cal == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchcalendar", id); return "notFound"; } } String how = getReqPar(request, "how"); if (how == null) { form.getErr().emit("org.bedework.client.error.nohowaccess"); return "error"; } int desiredAccess = -1; //boolean defaultAccess = false; if (how.equals("r")) { desiredAccess = PrivilegeDefs.privRead; } else if (how.equals("w")) { desiredAccess = PrivilegeDefs.privWrite; } else if (how.equals("f")) { desiredAccess = PrivilegeDefs.privReadFreeBusy; } else if (how.equals("d")) { //defaultAccess = true; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else { form.getErr().emit("org.bedework.client.error.badhow"); return "error"; } String whoTypeStr = request.getParameter("whoType"); int whoType = -1; if (whoTypeStr == null) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("owner")) { whoType = Ace.whoTypeOwner; } else if (whoTypeStr.equals("user")) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("group")) { whoType = Ace.whoTypeGroup; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else if (whoTypeStr.equals("unauth")) { whoType = Ace.whoTypeUnauthenticated; } else if (whoTypeStr.equals("other")) { whoType = Ace.whoTypeOther; } else { form.getErr().emit("org.bedework.client.error.badwhotype"); return "error"; } String who = request.getParameter("who"); if (who != null) { BwUser user = svci.findUser(who); if (user == null) { form.getErr().emit("org.bedework.client.error.usernotfound"); return "notFound"; } } else { who = null; } ArrayList aces = new ArrayList(); aces.add(new Ace(who, false, whoType, Privileges.makePriv(desiredAccess))); if (ev != null) { svci.changeAccess(ev, aces); svci.updateEvent(ev); } else { svci.changeAccess(cal, aces); svci.updateCalendar(cal); } return "success"; }
globals.categories++;
globals.calendars++;
private void dumpCalendar(BwCalendar val) throws Throwable { tagStart(objectCalendar); shareableContainedEntityTags(val); taggedVal("name", val.getName()); taggedVal("path", val.getPath()); taggedVal("summary", val.getSummary()); taggedVal("description", val.getDescription()); taggedVal("mailListId", val.getMailListId()); taggedVal("calendarCollection", val.getCalendarCollection()); taggedVal("calType", val.getCalType()); tagEnd(objectCalendar); Iterator children = val.getChildren().iterator(); while (children.hasNext()) { dumpCalendar((BwCalendar)children.next()); } globals.categories++; }
semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.profile.edit.parts.ElementImportEditPart.VISUAL_ID);
semanticHint = UMLVisualIDRegistry.getType(ElementImportEditPart.VISUAL_ID);
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) { if (semanticHint == null) { semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.profile.edit.parts.ElementImportEditPart.VISUAL_ID); view.setType(semanticHint); } super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted); if (!ProfileEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) { EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation(); shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ shortcutAnnotation.getDetails().put("modelID", ProfileEditPart.MODEL_ID); //$NON-NLS-1$ view.getEAnnotations().add(shortcutAnnotation); } getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(ReferencedMetaclassNode_classNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint()); }
assertEquals("yes?", Reflection.upSelector(AGSymbol.alloc("yes?")));
assertEquals("yes_opque_", Reflection.upSelector(AGSymbol.alloc("yes?")));
public void testUpSelector() throws NATException { assertEquals("foo_", Reflection.upSelector(AGSymbol.alloc("foo:"))); assertEquals("foo_bar_", Reflection.upSelector(AGSymbol.alloc("foo:bar:"))); assertEquals("_oppls_", Reflection.upSelector(AGSymbol.alloc("+"))); assertEquals("set_opnot_", Reflection.upSelector(AGSymbol.alloc("set!"))); assertEquals("foo__opltx_bar_", Reflection.upSelector(AGSymbol.alloc("foo:<bar:"))); assertEquals("_opbla_", Reflection.upSelector(AGSymbol.alloc(":opbla:"))); assertEquals("yes?", Reflection.upSelector(AGSymbol.alloc("yes?"))); }
form.getErr().emit("org.bedework.client.missingfield", "name");
form.getErr().emit("org.bedework.client.error.missingfield", "name");
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String name = Util.checkNull(request.getParameter("name")); if (name == null) { form.getErr().emit("org.bedework.client.missingfield", "name"); return "error"; } String add = Util.checkNull(request.getParameter("add")); String remove = Util.checkNull(request.getParameter("remove")); if (add != null) { BwSubscription sub = svc.findSubscription(add); if (sub == null) { form.getErr().emit("org.bedework.client.notfound", add); return "notFound"; } if (!svc.addViewSubscription(name, sub)) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } } if (remove != null) { BwSubscription sub = svc.findSubscription(remove); if (sub == null) { form.getErr().emit("org.bedework.client.notfound", remove); return "notFound"; } if (!svc.removeViewSubscription(name, sub)) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } } /* boolean makeDefaultView = false; String str = request.getParameter("makedefaultview"); if (str != null) { makeDefaultView = str.equals("true"); } /* XXX Update prefs here * / if (changed) { form.getErr().emit("org.bedework.client.notadded"); return "notAdded"; } */ BwView view = svc.findView(name); if (view == null) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } form.setView(view); return "success"; }
form.getErr().emit("org.bedework.client.notfound", add);
form.getErr().emit("org.bedework.client.error.nosuchsubscription", add);
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String name = Util.checkNull(request.getParameter("name")); if (name == null) { form.getErr().emit("org.bedework.client.missingfield", "name"); return "error"; } String add = Util.checkNull(request.getParameter("add")); String remove = Util.checkNull(request.getParameter("remove")); if (add != null) { BwSubscription sub = svc.findSubscription(add); if (sub == null) { form.getErr().emit("org.bedework.client.notfound", add); return "notFound"; } if (!svc.addViewSubscription(name, sub)) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } } if (remove != null) { BwSubscription sub = svc.findSubscription(remove); if (sub == null) { form.getErr().emit("org.bedework.client.notfound", remove); return "notFound"; } if (!svc.removeViewSubscription(name, sub)) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } } /* boolean makeDefaultView = false; String str = request.getParameter("makedefaultview"); if (str != null) { makeDefaultView = str.equals("true"); } /* XXX Update prefs here * / if (changed) { form.getErr().emit("org.bedework.client.notadded"); return "notAdded"; } */ BwView view = svc.findView(name); if (view == null) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } form.setView(view); return "success"; }
form.getErr().emit("org.bedework.client.notfound", name);
form.getErr().emit("org.bedework.client.error.viewnotfound", name);
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String name = Util.checkNull(request.getParameter("name")); if (name == null) { form.getErr().emit("org.bedework.client.missingfield", "name"); return "error"; } String add = Util.checkNull(request.getParameter("add")); String remove = Util.checkNull(request.getParameter("remove")); if (add != null) { BwSubscription sub = svc.findSubscription(add); if (sub == null) { form.getErr().emit("org.bedework.client.notfound", add); return "notFound"; } if (!svc.addViewSubscription(name, sub)) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } } if (remove != null) { BwSubscription sub = svc.findSubscription(remove); if (sub == null) { form.getErr().emit("org.bedework.client.notfound", remove); return "notFound"; } if (!svc.removeViewSubscription(name, sub)) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } } /* boolean makeDefaultView = false; String str = request.getParameter("makedefaultview"); if (str != null) { makeDefaultView = str.equals("true"); } /* XXX Update prefs here * / if (changed) { form.getErr().emit("org.bedework.client.notadded"); return "notAdded"; } */ BwView view = svc.findView(name); if (view == null) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } form.setView(view); return "success"; }
form.getErr().emit("org.bedework.client.notfound", remove);
form.getErr().emit("org.bedework.client.error.nosuchsubscription", remove);
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String name = Util.checkNull(request.getParameter("name")); if (name == null) { form.getErr().emit("org.bedework.client.missingfield", "name"); return "error"; } String add = Util.checkNull(request.getParameter("add")); String remove = Util.checkNull(request.getParameter("remove")); if (add != null) { BwSubscription sub = svc.findSubscription(add); if (sub == null) { form.getErr().emit("org.bedework.client.notfound", add); return "notFound"; } if (!svc.addViewSubscription(name, sub)) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } } if (remove != null) { BwSubscription sub = svc.findSubscription(remove); if (sub == null) { form.getErr().emit("org.bedework.client.notfound", remove); return "notFound"; } if (!svc.removeViewSubscription(name, sub)) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } } /* boolean makeDefaultView = false; String str = request.getParameter("makedefaultview"); if (str != null) { makeDefaultView = str.equals("true"); } /* XXX Update prefs here * / if (changed) { form.getErr().emit("org.bedework.client.notadded"); return "notAdded"; } */ BwView view = svc.findView(name); if (view == null) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } form.setView(view); return "success"; }
public boolean init(String url,
public boolean init(String systemName, String url,
public boolean init(String url, String authenticatedUser, String user, boolean publicAdmin, Groups groups, String synchId, boolean debug) throws CalFacadeException;
tElementFont.setFontSize(10);
tElementFont.setFontSize(FONT_SIZE_COLUMN_HEADER);
private void addFieldToColumnHeader(String fieldName, Class classType, int columnWidth){ _designDoc.addParameter(fieldName,String.class); TextField tField = new TextField(); tField.setIsBlankWhenNull(true); tField.setIsStretchWithOverflow(true); tField.setEvaluationTimeAsNow(); tField.setHyperlinkTypeAsNone(); ReportElement rElement = new ReportElement(_columnsXCoordinateForColumnHeader,0,columnWidth,_columnHeaderHeight); _columnsXCoordinateForColumnHeader += columnWidth; rElement.setPositionTypeAsFloat(); rElement.setIsPrintRepeatedValues(true); rElement.setIsRemoveLineWhenBlank(false); rElement.setIsPrintInFirstWholeBand(false); rElement.setIsPrintWhenDetailOverflows(false); tField.addContent(rElement); TextElement tElement = new TextElement(); tElement.setTextAlignmentAsLeft(); tElement.setVerticalAlignmentAsTop(); tElement.setLineSpacingAsSingle(); Font tElementFont = new Font(); tElementFont.setIsBold(true); tElementFont.setFontSize(10); tElement.addContent(tElementFont); tField.addContent(tElement); TextFieldExpression tfExpression = new TextFieldExpression(); tfExpression.setClassType(classType); tfExpression.addParameter(fieldName); tField.addContent(tfExpression); _designDoc.getColumnHeader().addContent(tField); }
tElementFont.setFontSize(10);
tElementFont.setFontSize(FONT_SIZE_PAGE_HEADER);
private void addParameterToPageHeader(String prmName, int prmWidth, Class classType,boolean underline, boolean bold){ _designDoc.addParameter(prmName,String.class); TextField tField = new TextField(); tField.setIsBlankWhenNull(false); tField.setIsStretchWithOverflow(true); tField.setEvaluationTimeAsNow(); tField.setHyperlinkTypeAsNone(); ReportElement rElement = new ReportElement(_headerParametersXCoordinate,_headerParametersYCoordinate,prmWidth,_headerParametersHeight); _headerParametersXCoordinate += prmWidth; rElement.setPositionTypeAsFloat(); rElement.setIsPrintRepeatedValues(true); rElement.setIsRemoveLineWhenBlank(false); rElement.setIsPrintInFirstWholeBand(false); rElement.setIsPrintWhenDetailOverflows(false); tField.addContent(rElement); TextElement tElement = new TextElement(); tElement.setTextAlignmentAsLeft(); tElement.setVerticalAlignmentAsTop(); tElement.setLineSpacingAsSingle(); Font tElementFont = new Font(); tElementFont.setIsUnderline(underline); tElementFont.setIsBold(bold); tElementFont.setFontSize(10); tElement.addContent(tElementFont); tField.addContent(tElement); TextFieldExpression tfExpression = new TextFieldExpression(); tfExpression.setClassType(classType); tfExpression.addParameter(prmName); tField.addContent(tfExpression); _designDoc.getPageHeader().addContent(tField); }
tElementFont.setFontSize(10);
tElementFont.setFontSize(FONT_SIZE_TEXT_FIELD);
private void createTextField(TextFieldExpression textFieldExpression, int columnWidth){ TextField tField = new TextField(); tField.setIsBlankWhenNull(true); tField.setIsStretchWithOverflow(true); tField.setEvaluationTimeAsNow(); tField.setHyperlinkTypeAsNone(); ReportElement rElement = new ReportElement(_columnsXCoordinateForDetail,0,columnWidth,_detailHeight); _columnsXCoordinateForDetail += columnWidth; rElement.setPositionTypeAsFloat(); rElement.setIsPrintRepeatedValues(true); rElement.setIsRemoveLineWhenBlank(false); rElement.setIsPrintInFirstWholeBand(false); rElement.setIsPrintWhenDetailOverflows(false); tField.addContent(rElement); TextElement tElement = new TextElement(); tElement.setTextAlignmentAsLeft(); tElement.setVerticalAlignmentAsTop(); tElement.setLineSpacingAsSingle(); Font tElementFont = new Font(); tElementFont.setFontSize(10); tElement.addContent(tElementFont); tField.addContent(tElement); tField.addContent(textFieldExpression); _designDoc.getDetail().addContent(tField); }
tElementFont.setFontSize(16);
tElementFont.setFontSize(FONT_SIZE_TITLE);
private void createTitle() { Title title = new Title(); title.setHeight(_reportTitleHeight); //title.setIsSplitAllowed(true); TextField tField1 = new TextField(); tField1.setIsBlankWhenNull(true); tField1.setIsStretchWithOverflow(true); tField1.setEvaluationTimeAsNow(); tField1.setHyperlinkTypeAsNone(); ReportElement rElement = new ReportElement(0,0,500,_reportTitleHeight); rElement.setPositionTypeAsFixRelativeToTop(); rElement.setIsPrintRepeatedValues(true); rElement.setIsRemoveLineWhenBlank(false); rElement.setIsPrintInFirstWholeBand(false); rElement.setIsPrintWhenDetailOverflows(false); tField1.addContent(rElement); TextElement tElement = new TextElement(); tElement.setTextAlignmentAsCenter(); tElement.setVerticalAlignmentAsTop(); tElement.setLineSpacingAsSingle(); Font tElementFont = new Font(); tElementFont.setFontSize(16); tElementFont.setIsBold(true); tElement.addContent(tElementFont); tField1.addContent(tElement); TextFieldExpression tfExpression = new TextFieldExpression(); tfExpression.setClassType(String.class); tfExpression.addParameter(PRM_REPORT_NAME); tField1.addContent(tfExpression); title.addContent(tField1); _designDoc.setTitle(title); }
case KeyEvent.VK_EQUALS: if (evt.getModifiersEx() != 0) { this.ideaMap.zoomIn(); } break;
public void keyPressed(final KeyEvent evt) { switch(evt.getKeyCode()) { case KeyEvent.VK_SPACE: ticker.stop(); maxSpeed = 0.0; break; case KeyEvent.VK_UP: selectUp(); break; case KeyEvent.VK_DOWN: selectDown(); break; case KeyEvent.VK_LEFT: selectLeft(); break; case KeyEvent.VK_RIGHT: selectRight(); break; case KeyEvent.VK_BACK_SPACE: case KeyEvent.VK_DELETE: deleteSelected(); break; case KeyEvent.VK_ESCAPE: IdeaView hit2 = this.ideaMap.getSelectedView(); if (hit2 != null) { unEditIdeaView(hit2); } break; case KeyEvent.VK_ENTER: if (evt.getModifiers() != 0) { IdeaView hit = this.ideaMap.getSelectedView(); if (hit != null) { editIdeaView(hit); } } else { insertIdea(); } break; case KeyEvent.VK_TAB: insertChild(); break; case KeyEvent.VK_EQUALS: if (evt.getModifiersEx() != 0) { this.ideaMap.zoomIn(); } break; default: // Do nothing } }
semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.profile.edit.parts.GeneralizationEditPart.VISUAL_ID);
semanticHint = UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID);
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) { if (semanticHint == null) { semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.profile.edit.parts.GeneralizationEditPart.VISUAL_ID); view.setType(semanticHint); } super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted); if (!ProfileEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) { EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation(); shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ shortcutAnnotation.getDetails().put("modelID", ProfileEditPart.MODEL_ID); //$NON-NLS-1$ view.getEAnnotations().add(shortcutAnnotation); } }
public BwFreeBusy getFreeBusy(CalSvcI svci, String user) throws WebdavException {
public BwFreeBusy getFreeBusy(CalSvcI svci, String account) throws WebdavException {
public BwFreeBusy getFreeBusy(CalSvcI svci, String user) throws WebdavException { try { BwFreeBusy fb = svci.getFreeBusy(null, new BwUser(user), timeRange.getStart(), timeRange.getEnd(), null, false); if (debug) { trace("Got " + fb); } return fb; } catch (Throwable t) { throw new WebdavException(t); } }
BwFreeBusy fb = svci.getFreeBusy(null, new BwUser(user),
BwUser user = svci.findUser(account); if (user == null) { throw WebdavIntfException.unauthorized(); } BwFreeBusy fb = svci.getFreeBusy(null, user,
public BwFreeBusy getFreeBusy(CalSvcI svci, String user) throws WebdavException { try { BwFreeBusy fb = svci.getFreeBusy(null, new BwUser(user), timeRange.getStart(), timeRange.getEnd(), null, false); if (debug) { trace("Got " + fb); } return fb; } catch (Throwable t) { throw new WebdavException(t); } }
access.checkAccess(val, privWrite, false);
public void updateCalendar(BwCalendar val) throws CalFacadeException { getSess().update(val); }
int lastIdx = siz.implValue - 1;
int lastIdx = siz.javaValue - 1;
public ATObject meta_eval(ATContext ctx) { NATNumber siz = statements_.getLength().asNativeNumber(); int lastIdx = siz.implValue - 1; for (int i = 0; i < lastIdx; i++) { statements_.at(NATNumber.atValue(i)).meta_eval(ctx); } return statements_.at(NATNumber.atValue(lastIdx)).meta_eval(ctx); }
statements_.at(NATNumber.atValue(i)).meta_eval(ctx);
statements_.at(NATNumber.atValue(i)).asStatement().meta_eval(ctx);
public ATObject meta_eval(ATContext ctx) { NATNumber siz = statements_.getLength().asNativeNumber(); int lastIdx = siz.implValue - 1; for (int i = 0; i < lastIdx; i++) { statements_.at(NATNumber.atValue(i)).meta_eval(ctx); } return statements_.at(NATNumber.atValue(lastIdx)).meta_eval(ctx); }
return statements_.at(NATNumber.atValue(lastIdx)).meta_eval(ctx);
return statements_.at(NATNumber.atValue(lastIdx)).asStatement().meta_eval(ctx);
public ATObject meta_eval(ATContext ctx) { NATNumber siz = statements_.getLength().asNativeNumber(); int lastIdx = siz.implValue - 1; for (int i = 0; i < lastIdx; i++) { statements_.at(NATNumber.atValue(i)).meta_eval(ctx); } return statements_.at(NATNumber.atValue(lastIdx)).meta_eval(ctx); }
if (selectedIdea != null) {
if ((selectedIdea != null) && (this.ideaMap.getSelectedView() instanceof BranchView)) {
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)); } } } }