bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
private void dateChanged(){ updateToday(); int todaysYear = todayCalendar.get(Calendar.YEAR); int calJulianDay = calendar.get(Calendar.DAY_OF_YEAR); int todaysJulianDay = todayCalendar.get(Calendar.DAY_OF_YEAR); int calYear = calendar.get(Calendar.YEAR); otherButton.setSelected(true); if(calYear == todaysYear){ if(yearBox != null) yearBox.setSelectedIndex(0); if(todaysJulianDay == calJulianDay){ todayButton.setSelected(true); } if(calJulianDay == todaysJulianDay-1 ){ yesButton.setSelected(true); } } else { int indexofyear = todaysYear - calYear; yearBox.setSelectedIndex(indexofyear); } if(monthBox != null) monthBox.setSelectedIndex(calendar.get(Calendar.MONTH)); if(dayBox != null) dayBox.setSelectedIndex(calendar.get(Calendar.DAY_OF_MONTH) - 1); if(hourBox != null) hourBox.setSelectedIndex(calendar.get(Calendar.HOUR_OF_DAY)); if(minuteBox != null) minuteBox.setSelectedIndex(calendar.get(Calendar.MINUTE)); if(secondBox != null) secondBox.setSelectedIndex(calendar.get(Calendar.SECOND)); repaint(); }
|
private void dateChanged(){ updateToday(); int todaysYear = todayCalendar.get(Calendar.YEAR); int calJulianDay = calendar.get(Calendar.DAY_OF_YEAR); int todaysJulianDay = todayCalendar.get(Calendar.DAY_OF_YEAR); int calYear = calendar.get(Calendar.YEAR); otherButton.setSelected(true); if(calYear == todaysYear){ if(yearBox != null) yearBox.setSelectedIndex(0); if(todaysJulianDay == calJulianDay){ todayButton.setSelected(true); } if(calJulianDay == todaysJulianDay-1 ){ yesButton.setSelected(true); } } else if(yearBox != null) { int indexofyear = todaysYear - calYear; yearBox.setSelectedIndex(indexofyear); } if(monthBox != null) monthBox.setSelectedIndex(calendar.get(Calendar.MONTH)); if(dayBox != null) dayBox.setSelectedIndex(calendar.get(Calendar.DAY_OF_MONTH) - 1); if(hourBox != null) hourBox.setSelectedIndex(calendar.get(Calendar.HOUR_OF_DAY)); if(minuteBox != null) minuteBox.setSelectedIndex(calendar.get(Calendar.MINUTE)); if(secondBox != null) secondBox.setSelectedIndex(calendar.get(Calendar.SECOND)); repaint(); }
| 1,118,232
|
public BwFreeBusy getFreeBusy(BwCalendar cal, BwPrincipal who, BwDateTime start, BwDateTime end) throws CalFacadeException { if (!(who instanceof BwUser)) { throw new CalFacadeException("Unsupported: non user principal for free-busy"); } if (isGuest() || (!currentUser().equals(who))) { // No access for the moment throw new CalFacadeAccessException(); } BwUser u = (BwUser)who; Collection subs; if (cal != null) { BwSubscription sub = BwSubscription.makeSubscription(cal); subs = new Vector(); subs.add(sub); } else if (!currentUser().equals(who)) { subs = getSubscriptions(); } else { subs = dbi.fetchPreferences(u).getSubscriptions(); } BwFreeBusy fb = new BwFreeBusy(who, start, end); Iterator subit = subs.iterator(); while (subit.hasNext()) { BwSubscription sub = (BwSubscription)subit.next(); if (!sub.getAffectsFreeBusy()) { continue; } Collection evs = getEvents(sub, null, start, end, CalFacadeDefs.retrieveRecurExpanded); try { /* For the moment just build a single FreeBusyComponentVO */ BwFreeBusyComponent fbc = new BwFreeBusyComponent(); Iterator it = evs.iterator(); TreeSet eventPeriods = new TreeSet(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); // XXX Need to add sub.ignoreTransparency if (BwEvent.transparencyTransparent.equals(ev.getTransparency())) { 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(); } eventPeriods.add(new EventPeriod(new DateTime(dstart), new DateTime(dend))); } /* iterate through the sorted periods combining them where they are adjacent or overlap */ Period p = null; it = eventPeriods.iterator(); while (it.hasNext()) { EventPeriod ep = (EventPeriod)it.next(); if (p == null) { p = new Period(ep.start, ep.end); } else if (ep.start.after(p.getEnd())) { // Non adjacent periods fbc.addPeriod(p); p = new Period(ep.start, ep.end); } 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) { fbc.addPeriod(p); } fb.addTime(fbc); } catch (Throwable t) { throw new CalFacadeException(t); } } return fb; }
|
public BwFreeBusy getFreeBusy(BwCalendar cal, BwPrincipal who, BwDateTime start, BwDateTime end) throws CalFacadeException { if (!(who instanceof BwUser)) { throw new CalFacadeException("Unsupported: non user principal for free-busy"); } if (isGuest() || (!currentUser().equals(who))) { // No access for the moment throw new CalFacadeAccessException(); } BwUser u = (BwUser)who; Collection subs; if (cal != null) { BwSubscription sub = BwSubscription.makeSubscription(cal); subs = new ArrayList(); subs.add(sub); } else if (!currentUser().equals(who)) { subs = getSubscriptions(); } else { subs = dbi.fetchPreferences(u).getSubscriptions(); } BwFreeBusy fb = new BwFreeBusy(who, start, end); Iterator subit = subs.iterator(); while (subit.hasNext()) { BwSubscription sub = (BwSubscription)subit.next(); if (!sub.getAffectsFreeBusy()) { continue; } Collection evs = getEvents(sub, null, start, end, CalFacadeDefs.retrieveRecurExpanded); try { /* For the moment just build a single FreeBusyComponentVO */ BwFreeBusyComponent fbc = new BwFreeBusyComponent(); Iterator it = evs.iterator(); TreeSet eventPeriods = new TreeSet(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); // XXX Need to add sub.ignoreTransparency if (BwEvent.transparencyTransparent.equals(ev.getTransparency())) { 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(); } eventPeriods.add(new EventPeriod(new DateTime(dstart), new DateTime(dend))); } /* iterate through the sorted periods combining them where they are adjacent or overlap */ Period p = null; it = eventPeriods.iterator(); while (it.hasNext()) { EventPeriod ep = (EventPeriod)it.next(); if (p == null) { p = new Period(ep.start, ep.end); } else if (ep.start.after(p.getEnd())) { // Non adjacent periods fbc.addPeriod(p); p = new Period(ep.start, ep.end); } 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) { fbc.addPeriod(p); } fb.addTime(fbc); } catch (Throwable t) { throw new CalFacadeException(t); } } return fb; }
| 1,118,233
|
public Shaker3D(int waveFlag, float baz, float angI) { this.backAzimuth = baz; this.angleOfIncidence = angI; this.setWaveType(waveFlag); }
|
public Shaker3D(int waveFlag, float baz, float angI) { this.backAzimuth = baz; this.angleOfIncidence = angI; this.setWaveType(waveFlag); }
| 1,118,234
|
private JPanel createButtonPanel(final JFrame displayFrame){ JButton closeButton = new JButton("Close"); closeButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { displayFrame.dispose(); displayPanel = null; } }); JButton saveToFile = new JButton("Save"); saveToFile.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ex) { try{ writeFile(); }catch(IOException e){ int result = JOptionPane.showConfirmDialog(displayPanel, "We were unable to write to that file. Try again?", "Trouble writing exception file", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if(result == JOptionPane.OK_OPTION){ actionPerformed(null); } } } public void writeFile()throws IOException{ JFileChooser fileChooser = new JFileChooser(); fileChooser.setSelectedFile(new File(ExceptionReporterUtils.getExceptionClassName(e) + ".txt")); int rtnVal = fileChooser.showSaveDialog(displayPanel); if(rtnVal == JFileChooser.APPROVE_OPTION) { FileWriterReporter writer = new FileWriterReporter(fileChooser.getSelectedFile().getAbsoluteFile()); writer.report(message, e, sections); } } }); JPanel buttonPanel = new JPanel(); buttonPanel.add(closeButton); buttonPanel.add(saveToFile); return buttonPanel; }
|
private JPanel createButtonPanel(){ JButton closeButton = new JButton("Close"); closeButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { displayFrame.dispose(); displayPanel = null; } }); JButton saveToFile = new JButton("Save"); saveToFile.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ex) { try{ writeFile(); }catch(IOException e){ int result = JOptionPane.showConfirmDialog(displayPanel, "We were unable to write to that file. Try again?", "Trouble writing exception file", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if(result == JOptionPane.OK_OPTION){ actionPerformed(null); } } } public void writeFile()throws IOException{ JFileChooser fileChooser = new JFileChooser(); fileChooser.setSelectedFile(new File(ExceptionReporterUtils.getExceptionClassName(e) + ".txt")); int rtnVal = fileChooser.showSaveDialog(displayPanel); if(rtnVal == JFileChooser.APPROVE_OPTION) { FileWriterReporter writer = new FileWriterReporter(fileChooser.getSelectedFile().getAbsoluteFile()); writer.report(message, e, sections); } } }); JPanel buttonPanel = new JPanel(); buttonPanel.add(closeButton); buttonPanel.add(saveToFile); return buttonPanel; }
| 1,118,235
|
public void actionPerformed(ActionEvent ex) { try{ writeFile(); }catch(IOException e){ int result = JOptionPane.showConfirmDialog(displayPanel, "We were unable to write to that file. Try again?", "Trouble writing exception file", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if(result == JOptionPane.OK_OPTION){ actionPerformed(null); } } }
|
public void actionPerformed(ActionEvent ex) { try{ writeFile(); }catch(IOException e){ int result = JOptionPane.showConfirmDialog(displayPanel, "We were unable to write to that file. Try again?", "Trouble writing exception file", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if(result == JOptionPane.OK_OPTION){ actionPerformed(null); } } }
| 1,118,236
|
private void createFrame() { JFrame displayFrame = new JFrame(); displayFrame.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e) { displayPanel = null; } }); displayPanel = new JPanel(new BorderLayout()); displayPanel.add(createButtonPanel(displayFrame), BorderLayout.SOUTH); Dimension dimension = new Dimension(800, 400); displayPanel.setPreferredSize(dimension); displayFrame.setContentPane(displayPanel); displayFrame.setSize(dimension); displayFrame.pack(); displayFrame.show(); }
|
private void createFrame() { displayFrame = new JFrame(); displayFrame.setDefaultCloseOperation (WindowConstants.DISPOSE_ON_CLOSE); displayFrame.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e) { displayPanel = null; } }); displayPanel = new JPanel(new BorderLayout()); displayPanel.add(createButtonPanel(displayFrame), BorderLayout.SOUTH); Dimension dimension = new Dimension(800, 400); displayPanel.setPreferredSize(dimension); displayFrame.setContentPane(displayPanel); displayFrame.setSize(dimension); displayFrame.pack(); displayFrame.show(); }
| 1,118,237
|
private void createFrame() { JFrame displayFrame = new JFrame(); displayFrame.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e) { displayPanel = null; } }); displayPanel = new JPanel(new BorderLayout()); displayPanel.add(createButtonPanel(displayFrame), BorderLayout.SOUTH); Dimension dimension = new Dimension(800, 400); displayPanel.setPreferredSize(dimension); displayFrame.setContentPane(displayPanel); displayFrame.setSize(dimension); displayFrame.pack(); displayFrame.show(); }
|
private void createFrame() { JFrame displayFrame = new JFrame(); displayFrame.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e) { displayPanel = null; } }); displayPanel = new JPanel(new BorderLayout()); displayPanel.add(createButtonPanel(), BorderLayout.SOUTH); Dimension dimension = new Dimension(800, 400); displayPanel.setPreferredSize(dimension); displayFrame.setContentPane(displayPanel); displayFrame.setSize(dimension); displayFrame.pack(); displayFrame.show(); }
| 1,118,238
|
private void createFrame() { JFrame displayFrame = new JFrame(); displayFrame.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e) { displayPanel = null; } }); displayPanel = new JPanel(new BorderLayout()); displayPanel.add(createButtonPanel(displayFrame), BorderLayout.SOUTH); Dimension dimension = new Dimension(800, 400); displayPanel.setPreferredSize(dimension); displayFrame.setContentPane(displayPanel); displayFrame.setSize(dimension); displayFrame.pack(); displayFrame.show(); }
|
private void createFrame() { JFrame displayFrame = new JFrame(); displayFrame.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e) { displayPanel = null; } }); displayPanel = new JPanel(new BorderLayout()); displayPanel.add(createButtonPanel(displayFrame), BorderLayout.SOUTH); Dimension dimension = new Dimension(800, 400); displayPanel.setPreferredSize(dimension); displayFrame.setContentPane(displayPanel); displayFrame.setSize(dimension); displayFrame.pack(); displayFrame.show(); }
| 1,118,239
|
public void report(String message, Throwable e, List sections) { this.message = message; this.e = e; this.sections = sections; if(displayPanel == null){ createFrame(); } displayPanel.add(createGUI(e, message, sections), BorderLayout.CENTER); displayPanel.revalidate(); }
|
public void report(String message, Throwable e, List sections) { this.message = message; this.e = e; this.sections = sections; if(displayPanel == null){ createFrame(); } displayPanel.add(createGUI(e, message, sections), BorderLayout.CENTER); displayPanel.revalidate(); }
| 1,118,240
|
public synchronized MicroSecondDate calculate(Origin origin, Location station) throws TauModelException { QuantityImpl depth = (QuantityImpl)origin.my_location.depth; depth = depth.convertTo(UnitImpl.KILOMETER); taup.setSourceDepth(depth.getValue()); DistAz distAz = new DistAz(station.latitude, station.longitude, origin.my_location.latitude, origin.my_location.longitude); taup.calculate(distAz.delta); Arrival[] arrivals = taup.getArrivals(); MicroSecondDate out = new MicroSecondDate(origin.origin_time); if (arrivals.length > 0) { out = out.add(new TimeInterval(arrivals[0].getTime(), UnitImpl.SECOND)); } return out; }
|
public synchronized MicroSecondDate calculate(Origin origin, Location station) throws TauModelException { QuantityImpl depth = (QuantityImpl)origin.my_location.depth; depth = depth.convertTo(UnitImpl.KILOMETER); taup.setSourceDepth(depth.getValue()); double degrees = SphericalCoords.distance(station.latitude, station.longitude, origin.my_location.latitude, origin.my_location.longitude); taup.calculate(distAz.delta); Arrival[] arrivals = taup.getArrivals(); MicroSecondDate out = new MicroSecondDate(origin.origin_time); if (arrivals.length > 0) { out = out.add(new TimeInterval(arrivals[0].getTime(), UnitImpl.SECOND)); } return out; }
| 1,118,243
|
public synchronized MicroSecondDate calculate(Origin origin, Location station) throws TauModelException { QuantityImpl depth = (QuantityImpl)origin.my_location.depth; depth = depth.convertTo(UnitImpl.KILOMETER); taup.setSourceDepth(depth.getValue()); DistAz distAz = new DistAz(station.latitude, station.longitude, origin.my_location.latitude, origin.my_location.longitude); taup.calculate(distAz.delta); Arrival[] arrivals = taup.getArrivals(); MicroSecondDate out = new MicroSecondDate(origin.origin_time); if (arrivals.length > 0) { out = out.add(new TimeInterval(arrivals[0].getTime(), UnitImpl.SECOND)); } return out; }
|
public synchronized MicroSecondDate calculate(Origin origin, Location station) throws TauModelException { QuantityImpl depth = (QuantityImpl)origin.my_location.depth; depth = depth.convertTo(UnitImpl.KILOMETER); taup.setSourceDepth(depth.getValue()); DistAz distAz = new DistAz(station.latitude, station.longitude, origin.my_location.latitude, origin.my_location.longitude); taup.calculate(degrees); Arrival[] arrivals = taup.getArrivals(); MicroSecondDate out = new MicroSecondDate(origin.origin_time); if (arrivals.length > 0) { out = out.add(new TimeInterval(arrivals[0].getTime(), UnitImpl.SECOND)); } return out; }
| 1,118,244
|
public CalEnv getEnv(ActionForm frm) throws Throwable { CalEnv env = frm.getEnv(); if (env != null) { return env; } env = new CalEnv(envPrefix, debug); frm.assignEnv(env); return env; }
|
public CalEnv getEnv(ActionForm frm) throws Throwable { CalEnv env = frm.getEnv(); if (env != null) { return env; } env = new CalEnv(envPrefix, debug); frm.assignEnv(env); return env; }
| 1,118,245
|
public CalEnv getEnv(ActionForm frm) throws Throwable { CalEnv env = frm.getEnv(); if (env != null) { return env; } env = new CalEnv(envPrefix, debug); frm.assignEnv(env); return env; }
|
public CalEnv getEnv(ActionForm frm) throws Throwable { CalEnv env = frm.getEnv(); if (env != null) { return env; } env = CalEnvFactory.getEnv(envPrefix, debug); frm.assignEnv(env); return env; }
| 1,118,246
|
public void setup(HttpServletRequest request, ActionForm form, MessageResources messages) throws Throwable { BwSession s = BwWebUtil.getState(request); if (s != null) { } else { CalEnv env = getEnv(form); String appName = env.getAppProperty("name"); String appRoot = env.getAppProperty("root"); s = new BwSessionImpl(form.getCurrentUser(), appRoot, appName, form.getPresentationState(), messages, form.getSchemeHostPort(), debug); BwWebUtil.setState(request, s); } boolean changed = false; if (form.getPropertyCollections().size() == 0) { changed = true; } else { changed = modulesChanged(form); } if (changed) { resetProperties(form); } }
|
public void setup(HttpServletRequest request, ActionForm form, MessageResources messages) throws Throwable { BwSession s = BwWebUtil.getState(request); if (s != null) { } else { CalEnvI env = getEnv(form); String appName = env.getAppProperty("name"); String appRoot = env.getAppProperty("root"); s = new BwSessionImpl(form.getCurrentUser(), appRoot, appName, form.getPresentationState(), messages, form.getSchemeHostPort(), debug); BwWebUtil.setState(request, s); } boolean changed = false; if (form.getPropertyCollections().size() == 0) { changed = true; } else { changed = modulesChanged(form); } if (changed) { resetProperties(form); } }
| 1,118,247
|
public CalEnv getEnv() { return env; }
|
public CalEnvI getEnv() { return env; }
| 1,118,248
|
public void assignEnv(CalEnv val) { env = val; }
|
public void assignEnv(CalEnvI val) { env = val; }
| 1,118,249
|
public Properties getProperties() { if (properties == null) { try { properties = (Properties)CalEnv.getProperties().clone(); } catch (Throwable t) { getErr().emit(t); } } return properties; }
|
public Properties getProperties() { if (properties == null) { try { if (env == null) { throw new Exception("No env set"); } properties = (Properties)env.getProperties().clone(); } catch (Throwable t) { getErr().emit(t); } } return properties; }
| 1,118,250
|
public void setEditEvent(BwEvent val) { try { editEvent = val; if (val == null) { getEventDates().setNewEvent(val, fetchSvci().getTimezones()); } else { getEventDates().setFromEvent(val, fetchSvci().getTimezones()); } } catch (Throwable t) { err.emit(t); } }
|
public void setEditEvent(BwEvent val) { try { if (val == null) { getEventDates().setNewEvent(val, fetchSvci().getTimezones()); } else { getEventDates().setFromEvent(val, fetchSvci().getTimezones()); } } catch (Throwable t) { err.emit(t); } }
| 1,118,251
|
public void removeListener(PlayerListener listener);
|
public void removeListener(PlayerListener listener) { listeners.remove(listener); }
| 1,118,253
|
public Collection fromIcal(BwCalendar cal, String val) throws CalFacadeException { try { CalendarBuilder bldr = new CalendarBuilder(new CalendarParserImpl()); return fromIcal(cal, bldr.build(new UnfoldingReader(new StringReader(val)))); } catch (ParserException pe) { if (debug) { error(pe); } throw new IcalMalformedException(pe.getMessage()); } catch (CalFacadeException cfe) { throw cfe; } catch (Throwable t) { throw new CalFacadeException(t); } }
|
public Collection fromIcal(BwCalendar cal, String val) throws CalFacadeException { try { CalendarBuilder bldr = new CalendarBuilder(new CalendarParserImpl()); return fromIcal(cal, bldr.build(new StringReader(val), true)); } catch (ParserException pe) { if (debug) { error(pe); } throw new IcalMalformedException(pe.getMessage()); } catch (CalFacadeException cfe) { throw cfe; } catch (Throwable t) { throw new CalFacadeException(t); } }
| 1,118,254
|
private String doDir(Vector v, DirClass dir, String indent) throws CalFacadeException { if (debug) { trace(indent + "Dir: " + dir.cal.getName()); } Iterator dit = dir.dirs.iterator(); while (dit.hasNext()) { doDir(v, (DirClass)dit.next(), indent + " "); } Iterator tzit = dir.tzs.iterator(); while (tzit.hasNext()) { Calendar ical = (Calendar)tzit.next(); ComponentList cl = ical.getComponents(); if (cl.size() != 1) { throw new CalFacadeException(CalFacadeException.timezonesReadError, cl.size() + " components in Calendar"); } Object o = cl.get(0); if (!(o instanceof VTimeZone)) { throw new CalFacadeException(CalFacadeException.timezonesReadError, "component in Calendar not VTimeZone"); } TimeZoneInfo tzi = new TimeZoneInfo(); tzi.timezone = (VTimeZone)o; tzi.tzid = IcalUtil.getProperty(tzi.timezone, Property.TZID).getValue(); v.add(tzi); if (debug) { trace(indent + "tzid: " + tzi.tzid); } } return null; }
|
private String doDir(ArrayList al, DirClass dir, String indent) throws CalFacadeException { if (debug) { trace(indent + "Dir: " + dir.cal.getName()); } Iterator dit = dir.dirs.iterator(); while (dit.hasNext()) { doDir(v, (DirClass)dit.next(), indent + " "); } Iterator tzit = dir.tzs.iterator(); while (tzit.hasNext()) { Calendar ical = (Calendar)tzit.next(); ComponentList cl = ical.getComponents(); if (cl.size() != 1) { throw new CalFacadeException(CalFacadeException.timezonesReadError, cl.size() + " components in Calendar"); } Object o = cl.get(0); if (!(o instanceof VTimeZone)) { throw new CalFacadeException(CalFacadeException.timezonesReadError, "component in Calendar not VTimeZone"); } TimeZoneInfo tzi = new TimeZoneInfo(); tzi.timezone = (VTimeZone)o; tzi.tzid = IcalUtil.getProperty(tzi.timezone, Property.TZID).getValue(); v.add(tzi); if (debug) { trace(indent + "tzid: " + tzi.tzid); } } return null; }
| 1,118,255
|
private String doDir(Vector v, DirClass dir, String indent) throws CalFacadeException { if (debug) { trace(indent + "Dir: " + dir.cal.getName()); } Iterator dit = dir.dirs.iterator(); while (dit.hasNext()) { doDir(v, (DirClass)dit.next(), indent + " "); } Iterator tzit = dir.tzs.iterator(); while (tzit.hasNext()) { Calendar ical = (Calendar)tzit.next(); ComponentList cl = ical.getComponents(); if (cl.size() != 1) { throw new CalFacadeException(CalFacadeException.timezonesReadError, cl.size() + " components in Calendar"); } Object o = cl.get(0); if (!(o instanceof VTimeZone)) { throw new CalFacadeException(CalFacadeException.timezonesReadError, "component in Calendar not VTimeZone"); } TimeZoneInfo tzi = new TimeZoneInfo(); tzi.timezone = (VTimeZone)o; tzi.tzid = IcalUtil.getProperty(tzi.timezone, Property.TZID).getValue(); v.add(tzi); if (debug) { trace(indent + "tzid: " + tzi.tzid); } } return null; }
|
private String doDir(Vector v, DirClass dir, String indent) throws CalFacadeException { if (debug) { trace(indent + "Dir: " + dir.cal.getName()); } Iterator dit = dir.dirs.iterator(); while (dit.hasNext()) { doDir(al, (DirClass)dit.next(), indent + " "); } Iterator tzit = dir.tzs.iterator(); while (tzit.hasNext()) { Calendar ical = (Calendar)tzit.next(); ComponentList cl = ical.getComponents(); if (cl.size() != 1) { throw new CalFacadeException(CalFacadeException.timezonesReadError, cl.size() + " components in Calendar"); } Object o = cl.get(0); if (!(o instanceof VTimeZone)) { throw new CalFacadeException(CalFacadeException.timezonesReadError, "component in Calendar not VTimeZone"); } TimeZoneInfo tzi = new TimeZoneInfo(); tzi.timezone = (VTimeZone)o; tzi.tzid = IcalUtil.getProperty(tzi.timezone, Property.TZID).getValue(); v.add(tzi); if (debug) { trace(indent + "tzid: " + tzi.tzid); } } return null; }
| 1,118,256
|
private String doDir(Vector v, DirClass dir, String indent) throws CalFacadeException { if (debug) { trace(indent + "Dir: " + dir.cal.getName()); } Iterator dit = dir.dirs.iterator(); while (dit.hasNext()) { doDir(v, (DirClass)dit.next(), indent + " "); } Iterator tzit = dir.tzs.iterator(); while (tzit.hasNext()) { Calendar ical = (Calendar)tzit.next(); ComponentList cl = ical.getComponents(); if (cl.size() != 1) { throw new CalFacadeException(CalFacadeException.timezonesReadError, cl.size() + " components in Calendar"); } Object o = cl.get(0); if (!(o instanceof VTimeZone)) { throw new CalFacadeException(CalFacadeException.timezonesReadError, "component in Calendar not VTimeZone"); } TimeZoneInfo tzi = new TimeZoneInfo(); tzi.timezone = (VTimeZone)o; tzi.tzid = IcalUtil.getProperty(tzi.timezone, Property.TZID).getValue(); v.add(tzi); if (debug) { trace(indent + "tzid: " + tzi.tzid); } } return null; }
|
private String doDir(Vector v, DirClass dir, String indent) throws CalFacadeException { if (debug) { trace(indent + "Dir: " + dir.cal.getName()); } Iterator dit = dir.dirs.iterator(); while (dit.hasNext()) { doDir(v, (DirClass)dit.next(), indent + " "); } Iterator tzit = dir.tzs.iterator(); while (tzit.hasNext()) { Calendar ical = (Calendar)tzit.next(); ComponentList cl = ical.getComponents(); if (cl.size() != 1) { throw new CalFacadeException(CalFacadeException.timezonesReadError, cl.size() + " components in Calendar"); } Object o = cl.get(0); if (!(o instanceof VTimeZone)) { throw new CalFacadeException(CalFacadeException.timezonesReadError, "component in Calendar not VTimeZone"); } TimeZoneInfo tzi = new TimeZoneInfo(); tzi.timezone = (VTimeZone)o; tzi.tzid = IcalUtil.getProperty(tzi.timezone, Property.TZID).getValue(); al.add(tzi); if (debug) { trace(indent + "tzid: " + tzi.tzid); } } return null; }
| 1,118,257
|
public Collection getTimeZones() throws CalFacadeException { /* The input file should look something like: <dir> <name>A-name</name> <dir>...</dir> <file> <name>file1.ics</name> <data>...</data> </file> </dir> We ignore the first name - it represents the root. Each <dir> element may contain other <dir> and <file> elements. Each <name> element is a path element */ DirClass rootDir = parseTzDefs(new InputStreamReader(inStr)); Vector v = new Vector(); doDir(v, rootDir, ""); return v; }
|
public Collection getTimeZones() throws CalFacadeException { /* The input file should look something like: <dir> <name>A-name</name> <dir>...</dir> <file> <name>file1.ics</name> <data>...</data> </file> </dir> We ignore the first name - it represents the root. Each <dir> element may contain other <dir> and <file> elements. Each <name> element is a path element */ DirClass rootDir = parseTzDefs(new InputStreamReader(inStr)); ArrayList al = new ArrayList(); doDir(v, rootDir, ""); return v; }
| 1,118,258
|
public Collection getTimeZones() throws CalFacadeException { /* The input file should look something like: <dir> <name>A-name</name> <dir>...</dir> <file> <name>file1.ics</name> <data>...</data> </file> </dir> We ignore the first name - it represents the root. Each <dir> element may contain other <dir> and <file> elements. Each <name> element is a path element */ DirClass rootDir = parseTzDefs(new InputStreamReader(inStr)); Vector v = new Vector(); doDir(v, rootDir, ""); return v; }
|
public Collection getTimeZones() throws CalFacadeException { /* The input file should look something like: <dir> <name>A-name</name> <dir>...</dir> <file> <name>file1.ics</name> <data>...</data> </file> </dir> We ignore the first name - it represents the root. Each <dir> element may contain other <dir> and <file> elements. Each <name> element is a path element */ DirClass rootDir = parseTzDefs(new InputStreamReader(inStr)); Vector v = new Vector(); doDir(al, rootDir, ""); return v; }
| 1,118,259
|
public Collection getTimeZones() throws CalFacadeException { /* The input file should look something like: <dir> <name>A-name</name> <dir>...</dir> <file> <name>file1.ics</name> <data>...</data> </file> </dir> We ignore the first name - it represents the root. Each <dir> element may contain other <dir> and <file> elements. Each <name> element is a path element */ DirClass rootDir = parseTzDefs(new InputStreamReader(inStr)); Vector v = new Vector(); doDir(v, rootDir, ""); return v; }
|
public Collection getTimeZones() throws CalFacadeException { /* The input file should look something like: <dir> <name>A-name</name> <dir>...</dir> <file> <name>file1.ics</name> <data>...</data> </file> </dir> We ignore the first name - it represents the root. Each <dir> element may contain other <dir> and <file> elements. Each <name> element is a path element */ DirClass rootDir = parseTzDefs(new InputStreamReader(inStr)); Vector v = new Vector(); doDir(v, rootDir, ""); return al; }
| 1,118,260
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g; if (copy != null) { try { AffineTransform insetMove = AffineTransform.getTranslateInstance(x, y); copy.transform(insetMove); Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); insets.left -= x+left; insets.top -= y+top; insets.right -= right + c.getSize().width - x - left; insets.bottom -= bottom + c.getSize().height - y - top; FontMetrics fm = copy.getFontMetrics(); String labelTemp; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); labelTemp = topScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, top - majorTickLength- fm.getLeading()); } } } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top+top+ leftScaleMap.getPixelLocation(i); if (pixelLoc >=insets.top+top && pixelLoc <=height-insets.bottom-bottom) { if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(left-majorTickLength, pixelLoc, left, pixelLoc)); } else { copy.draw(new Line2D.Float(left-minorTickLength, pixelLoc, left, pixelLoc)); } labelTemp = leftScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { if(i == 0) copy.drawString(labelTemp, 0, pixelLoc - 5); else if(i == numTicks - 1) copy.drawString(labelTemp, 0, pixelLoc + 5); else copy.drawString(labelTemp, 0, pixelLoc); } } } } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left+ bottomScaleMap.getPixelLocation(i); if (pixelLoc >=insets.left + left && pixelLoc <= width - insets.right) { if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } labelTemp = bottomScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, height-fm.getLeading()); } } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top + top+ rightScaleMap.getPixelLocation(i); System.out.println("HScaleBorder pixelLoc="+pixelLoc); copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); labelTemp = rightScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g; if (copy != null) { try { AffineTransform insetMove = AffineTransform.getTranslateInstance(x, y); copy.transform(insetMove); Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); insets.left -= x+left; insets.top -= y+top; insets.right -= right + c.getSize().width - x - left; insets.bottom -= bottom + c.getSize().height - y - top; FontMetrics fm = copy.getFontMetrics(); String labelTemp; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); labelTemp = topScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, top - majorTickLength- fm.getLeading()); } } } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top+top+ leftScaleMap.getPixelLocation(i); if (pixelLoc >=insets.top+top && pixelLoc <=height-insets.bottom-bottom) { if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(left-majorTickLength, pixelLoc, left, pixelLoc)); } else { copy.draw(new Line2D.Float(left-minorTickLength, pixelLoc, left, pixelLoc)); } labelTemp = leftScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { if(i == 0) copy.drawString(labelTemp, 0, pixelLoc - 5); else if(i == numTicks - 1) copy.drawString(labelTemp, 0, pixelLoc + 5); else copy.drawString(labelTemp, 0, pixelLoc); } } } } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left+ bottomScaleMap.getPixelLocation(i); if (pixelLoc >=insets.left + left && pixelLoc <= width - insets.right) { if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } labelTemp = bottomScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, height-fm.getLeading()); } } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top + top+ rightScaleMap.getPixelLocation(i); System.out.println("HScaleBorder pixelLoc="+pixelLoc); copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); labelTemp = rightScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,261
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g; if (copy != null) { try { AffineTransform insetMove = AffineTransform.getTranslateInstance(x, y); copy.transform(insetMove); Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); insets.left -= x+left; insets.top -= y+top; insets.right -= right + c.getSize().width - x - left; insets.bottom -= bottom + c.getSize().height - y - top; FontMetrics fm = copy.getFontMetrics(); String labelTemp; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); labelTemp = topScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, top - majorTickLength- fm.getLeading()); } } } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top+top+ leftScaleMap.getPixelLocation(i); if (pixelLoc >=insets.top+top && pixelLoc <=height-insets.bottom-bottom) { if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(left-majorTickLength, pixelLoc, left, pixelLoc)); } else { copy.draw(new Line2D.Float(left-minorTickLength, pixelLoc, left, pixelLoc)); } labelTemp = leftScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { if(i == 0) copy.drawString(labelTemp, 0, pixelLoc - 5); else if(i == numTicks - 1) copy.drawString(labelTemp, 0, pixelLoc + 5); else copy.drawString(labelTemp, 0, pixelLoc); } } } } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left+ bottomScaleMap.getPixelLocation(i); if (pixelLoc >=insets.left + left && pixelLoc <= width - insets.right) { if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } labelTemp = bottomScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, height-fm.getLeading()); } } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top + top+ rightScaleMap.getPixelLocation(i); System.out.println("HScaleBorder pixelLoc="+pixelLoc); copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); labelTemp = rightScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g; if (copy != null) { try { AffineTransform insetMove = AffineTransform.getTranslateInstance(x, y); copy.transform(insetMove); Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); insets.left -= x+left; insets.top -= y+top; insets.right -= right + c.getSize().width - x - left; insets.bottom -= bottom + c.getSize().height - y - top; FontMetrics fm = copy.getFontMetrics(); String labelTemp; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); labelTemp = topScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, top - majorTickLength- fm.getLeading()); } } } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top+top+ leftScaleMap.getPixelLocation(i); if (pixelLoc >=insets.top+top && pixelLoc <=height-insets.bottom-bottom) { if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(left-majorTickLength, pixelLoc, left, pixelLoc)); } else { copy.draw(new Line2D.Float(left-minorTickLength, pixelLoc, left, pixelLoc)); } labelTemp = leftScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { if(i == 0) copy.drawString(labelTemp, 0, pixelLoc - 5); else if(i == numTicks - 1) copy.drawString(labelTemp, 0, pixelLoc + 5); else copy.drawString(labelTemp, 0, pixelLoc); } } } } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left+ bottomScaleMap.getPixelLocation(i); if (pixelLoc >=insets.left + left && pixelLoc <= width - insets.right) { if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } labelTemp = bottomScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, height-fm.getLeading()); } } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top + top+ rightScaleMap.getPixelLocation(i); System.out.println("HScaleBorder pixelLoc="+pixelLoc); copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); labelTemp = rightScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,262
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g; if (copy != null) { try { AffineTransform insetMove = AffineTransform.getTranslateInstance(x, y); copy.transform(insetMove); Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); insets.left -= x+left; insets.top -= y+top; insets.right -= right + c.getSize().width - x - left; insets.bottom -= bottom + c.getSize().height - y - top; FontMetrics fm = copy.getFontMetrics(); String labelTemp; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); labelTemp = topScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, top - majorTickLength- fm.getLeading()); } } } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top+top+ leftScaleMap.getPixelLocation(i); if (pixelLoc >=insets.top+top && pixelLoc <=height-insets.bottom-bottom) { if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(left-majorTickLength, pixelLoc, left, pixelLoc)); } else { copy.draw(new Line2D.Float(left-minorTickLength, pixelLoc, left, pixelLoc)); } labelTemp = leftScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { if(i == 0) copy.drawString(labelTemp, 0, pixelLoc - 5); else if(i == numTicks - 1) copy.drawString(labelTemp, 0, pixelLoc + 5); else copy.drawString(labelTemp, 0, pixelLoc); } } } } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left+ bottomScaleMap.getPixelLocation(i); if (pixelLoc >=insets.left + left && pixelLoc <= width - insets.right) { if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } labelTemp = bottomScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, height-fm.getLeading()); } } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top + top+ rightScaleMap.getPixelLocation(i); System.out.println("HScaleBorder pixelLoc="+pixelLoc); copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); labelTemp = rightScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g; if (copy != null) { try { AffineTransform insetMove = AffineTransform.getTranslateInstance(x, y); copy.transform(insetMove); Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); insets.left -= x+left; insets.top -= y+top; insets.right -= right + c.getSize().width - x - left; insets.bottom -= bottom + c.getSize().height - y - top; FontMetrics fm = copy.getFontMetrics(); System.out.println(x + " " + y + " " + insets.left + " " + insets.right + " " + insets.top + " " + insets.bottom + " " + top + " " + left + " " + bottom + " " + right); String labelTemp; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); labelTemp = topScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, top - majorTickLength- fm.getLeading()); } } } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top+top+ leftScaleMap.getPixelLocation(i); if (pixelLoc >=insets.top+top && pixelLoc <=height-insets.bottom-bottom) { if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(left-majorTickLength, pixelLoc, left, pixelLoc)); } else { copy.draw(new Line2D.Float(left-minorTickLength, pixelLoc, left, pixelLoc)); } labelTemp = leftScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { if(i == 0) copy.drawString(labelTemp, 0, pixelLoc - 5); else if(i == numTicks - 1) copy.drawString(labelTemp, 0, pixelLoc + 5); else copy.drawString(labelTemp, 0, pixelLoc); } } } } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left+ bottomScaleMap.getPixelLocation(i); if (pixelLoc >=insets.left + left && pixelLoc <= width - insets.right) { if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } labelTemp = bottomScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, height-fm.getLeading()); } } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top + top+ rightScaleMap.getPixelLocation(i); System.out.println("HScaleBorder pixelLoc="+pixelLoc); copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); labelTemp = rightScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,263
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g; if (copy != null) { try { AffineTransform insetMove = AffineTransform.getTranslateInstance(x, y); copy.transform(insetMove); Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); insets.left -= x+left; insets.top -= y+top; insets.right -= right + c.getSize().width - x - left; insets.bottom -= bottom + c.getSize().height - y - top; FontMetrics fm = copy.getFontMetrics(); String labelTemp; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); labelTemp = topScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, top - majorTickLength- fm.getLeading()); } } } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top+top+ leftScaleMap.getPixelLocation(i); if (pixelLoc >=insets.top+top && pixelLoc <=height-insets.bottom-bottom) { if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(left-majorTickLength, pixelLoc, left, pixelLoc)); } else { copy.draw(new Line2D.Float(left-minorTickLength, pixelLoc, left, pixelLoc)); } labelTemp = leftScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { if(i == 0) copy.drawString(labelTemp, 0, pixelLoc - 5); else if(i == numTicks - 1) copy.drawString(labelTemp, 0, pixelLoc + 5); else copy.drawString(labelTemp, 0, pixelLoc); } } } } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left+ bottomScaleMap.getPixelLocation(i); if (pixelLoc >=insets.left + left && pixelLoc <= width - insets.right) { if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } labelTemp = bottomScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, height-fm.getLeading()); } } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top + top+ rightScaleMap.getPixelLocation(i); System.out.println("HScaleBorder pixelLoc="+pixelLoc); copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); labelTemp = rightScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g; if (copy != null) { try { AffineTransform insetMove = AffineTransform.getTranslateInstance(x, y); copy.transform(insetMove); Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); insets.left -= x+left; insets.top -= y+top; insets.right -= right + c.getSize().width - x - left; insets.bottom -= bottom + c.getSize().height - y - top; FontMetrics fm = copy.getFontMetrics(); String labelTemp; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); labelTemp = topScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, top - majorTickLength- fm.getLeading()); } } } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top+top+ leftScaleMap.getPixelLocation(i); if (pixelLoc >=insets.top+top && pixelLoc <=height-insets.bottom-bottom) { if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(left-majorTickLength, pixelLoc, left, pixelLoc)); } else { copy.draw(new Line2D.Float(left-minorTickLength, pixelLoc, left, pixelLoc)); } labelTemp = leftScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { if(i == 0) copy.drawString(labelTemp, 0, pixelLoc - 5); else if(i == numTicks - 1) copy.drawString(labelTemp, 0, pixelLoc + 5); else copy.drawString(labelTemp, 0, pixelLoc); } } } } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left+ bottomScaleMap.getPixelLocation(i); if (pixelLoc >=insets.left + left && pixelLoc <= width - insets.right) { if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } labelTemp = bottomScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, height-fm.getLeading()); } } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top + top+ rightScaleMap.getPixelLocation(i); System.out.println("HScaleBorder pixelLoc="+pixelLoc); copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); labelTemp = rightScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,264
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g; if (copy != null) { try { AffineTransform insetMove = AffineTransform.getTranslateInstance(x, y); copy.transform(insetMove); Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); insets.left -= x+left; insets.top -= y+top; insets.right -= right + c.getSize().width - x - left; insets.bottom -= bottom + c.getSize().height - y - top; FontMetrics fm = copy.getFontMetrics(); String labelTemp; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); labelTemp = topScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, top - majorTickLength- fm.getLeading()); } } } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top+top+ leftScaleMap.getPixelLocation(i); if (pixelLoc >=insets.top+top && pixelLoc <=height-insets.bottom-bottom) { if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(left-majorTickLength, pixelLoc, left, pixelLoc)); } else { copy.draw(new Line2D.Float(left-minorTickLength, pixelLoc, left, pixelLoc)); } labelTemp = leftScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { if(i == 0) copy.drawString(labelTemp, 0, pixelLoc - 5); else if(i == numTicks - 1) copy.drawString(labelTemp, 0, pixelLoc + 5); else copy.drawString(labelTemp, 0, pixelLoc); } } } } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left+ bottomScaleMap.getPixelLocation(i); if (pixelLoc >=insets.left + left && pixelLoc <= width - insets.right) { if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } labelTemp = bottomScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, height-fm.getLeading()); } } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top + top+ rightScaleMap.getPixelLocation(i); System.out.println("HScaleBorder pixelLoc="+pixelLoc); copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); labelTemp = rightScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g; if (copy != null) { try { AffineTransform insetMove = AffineTransform.getTranslateInstance(x, y); copy.transform(insetMove); Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); insets.left -= x+left; insets.top -= y+top; insets.right -= right + c.getSize().width - x - left; insets.bottom -= bottom + c.getSize().height - y - top; FontMetrics fm = copy.getFontMetrics(); String labelTemp; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); labelTemp = topScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, top - majorTickLength- fm.getLeading()); } } } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top+top+ leftScaleMap.getPixelLocation(i); if (pixelLoc >=insets.top+top && pixelLoc <=height-insets.bottom-bottom) { if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(left-majorTickLength, pixelLoc, left, pixelLoc)); } else { copy.draw(new Line2D.Float(left-minorTickLength, pixelLoc, left, pixelLoc)); } labelTemp = leftScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { if(i == 0) copy.drawString(labelTemp, 0, pixelLoc - 5); else if(i == numTicks - 1) copy.drawString(labelTemp, 0, pixelLoc + 5); else copy.drawString(labelTemp, 0, pixelLoc); } } } } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left+ bottomScaleMap.getPixelLocation(i); if (pixelLoc >=insets.left + left && pixelLoc <= width - insets.right) { if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } labelTemp = bottomScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, height-fm.getLeading()); } } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top + top+ rightScaleMap.getPixelLocation(i); System.out.println("HScaleBorder pixelLoc="+pixelLoc); copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); labelTemp = rightScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,265
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g; if (copy != null) { try { AffineTransform insetMove = AffineTransform.getTranslateInstance(x, y); copy.transform(insetMove); Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); insets.left -= x+left; insets.top -= y+top; insets.right -= right + c.getSize().width - x - left; insets.bottom -= bottom + c.getSize().height - y - top; FontMetrics fm = copy.getFontMetrics(); String labelTemp; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); labelTemp = topScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, top - majorTickLength- fm.getLeading()); } } } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top+top+ leftScaleMap.getPixelLocation(i); if (pixelLoc >=insets.top+top && pixelLoc <=height-insets.bottom-bottom) { if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(left-majorTickLength, pixelLoc, left, pixelLoc)); } else { copy.draw(new Line2D.Float(left-minorTickLength, pixelLoc, left, pixelLoc)); } labelTemp = leftScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { if(i == 0) copy.drawString(labelTemp, 0, pixelLoc - 5); else if(i == numTicks - 1) copy.drawString(labelTemp, 0, pixelLoc + 5); else copy.drawString(labelTemp, 0, pixelLoc); } } } } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left+ bottomScaleMap.getPixelLocation(i); if (pixelLoc >=insets.left + left && pixelLoc <= width - insets.right) { if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } labelTemp = bottomScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, height-fm.getLeading()); } } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top + top+ rightScaleMap.getPixelLocation(i); System.out.println("HScaleBorder pixelLoc="+pixelLoc); copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); labelTemp = rightScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g; if (copy != null) { try { AffineTransform insetMove = AffineTransform.getTranslateInstance(x, y); copy.transform(insetMove); Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); insets.left -= x+left; insets.top -= y+top; insets.right -= right + c.getSize().width - x - left; insets.bottom -= bottom + c.getSize().height - y - top; FontMetrics fm = copy.getFontMetrics(); String labelTemp; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); labelTemp = topScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, top - majorTickLength- fm.getLeading()); } } } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top+top+ leftScaleMap.getPixelLocation(i); if (pixelLoc >=insets.top+top && pixelLoc <=height-insets.bottom-bottom) { if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(left-majorTickLength, pixelLoc, left, pixelLoc)); } else { copy.draw(new Line2D.Float(left-minorTickLength, pixelLoc, left, pixelLoc)); } labelTemp = leftScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { if(i == 0) copy.drawString(labelTemp, 0, pixelLoc - 5); else if(i == numTicks - 1) copy.drawString(labelTemp, 0, pixelLoc + 5); else copy.drawString(labelTemp, 0, pixelLoc); } } } } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left+ bottomScaleMap.getPixelLocation(i); if (pixelLoc >=insets.left + left && pixelLoc <= width - insets.right) { if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } labelTemp = bottomScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, height-fm.getLeading()); } } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top + top+ rightScaleMap.getPixelLocation(i); System.out.println("HScaleBorder pixelLoc="+pixelLoc); copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); labelTemp = rightScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,266
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g; if (copy != null) { try { AffineTransform insetMove = AffineTransform.getTranslateInstance(x, y); copy.transform(insetMove); Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); insets.left -= x+left; insets.top -= y+top; insets.right -= right + c.getSize().width - x - left; insets.bottom -= bottom + c.getSize().height - y - top; FontMetrics fm = copy.getFontMetrics(); String labelTemp; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); labelTemp = topScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, top - majorTickLength- fm.getLeading()); } } } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top+top+ leftScaleMap.getPixelLocation(i); if (pixelLoc >=insets.top+top && pixelLoc <=height-insets.bottom-bottom) { if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(left-majorTickLength, pixelLoc, left, pixelLoc)); } else { copy.draw(new Line2D.Float(left-minorTickLength, pixelLoc, left, pixelLoc)); } labelTemp = leftScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { if(i == 0) copy.drawString(labelTemp, 0, pixelLoc - 5); else if(i == numTicks - 1) copy.drawString(labelTemp, 0, pixelLoc + 5); else copy.drawString(labelTemp, 0, pixelLoc); } } } } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left+ bottomScaleMap.getPixelLocation(i); if (pixelLoc >=insets.left + left && pixelLoc <= width - insets.right) { if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } labelTemp = bottomScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, height-fm.getLeading()); } } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top + top+ rightScaleMap.getPixelLocation(i); System.out.println("HScaleBorder pixelLoc="+pixelLoc); copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); labelTemp = rightScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g; if (copy != null) { try { AffineTransform insetMove = AffineTransform.getTranslateInstance(x, y); copy.transform(insetMove); Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); insets.left -= x+left; insets.top -= y+top; insets.right -= right + c.getSize().width - x - left; insets.bottom -= bottom + c.getSize().height - y - top; FontMetrics fm = copy.getFontMetrics(); String labelTemp; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); labelTemp = topScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, top - majorTickLength- fm.getLeading()); // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top+top+ leftScaleMap.getPixelLocation(i); if (pixelLoc >=insets.top+top && pixelLoc <=height-insets.bottom-bottom) { if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(left-majorTickLength, pixelLoc, left, pixelLoc)); else { copy.draw(new Line2D.Float(left-minorTickLength, pixelLoc, left, pixelLoc)); labelTemp = leftScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { if(i == 0) copy.drawString(labelTemp, 0, pixelLoc - 5); else if(i == numTicks - 1) copy.drawString(labelTemp, 0, pixelLoc + 5); else copy.drawString(labelTemp, 0, pixelLoc); // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left+ bottomScaleMap.getPixelLocation(i); if (pixelLoc >=insets.left + left && pixelLoc <= width - insets.right) { if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); labelTemp = bottomScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, height-fm.getLeading()); // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top + top+ rightScaleMap.getPixelLocation(i); System.out.println("HScaleBorder pixelLoc="+pixelLoc); copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); labelTemp = rightScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, c.getSize().height-fm.getLeading()); finally { copy.dispose();
| 1,118,267
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g; if (copy != null) { try { AffineTransform insetMove = AffineTransform.getTranslateInstance(x, y); copy.transform(insetMove); Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); insets.left -= x+left; insets.top -= y+top; insets.right -= right + c.getSize().width - x - left; insets.bottom -= bottom + c.getSize().height - y - top; FontMetrics fm = copy.getFontMetrics(); String labelTemp; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); labelTemp = topScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, top - majorTickLength- fm.getLeading()); } } } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top+top+ leftScaleMap.getPixelLocation(i); if (pixelLoc >=insets.top+top && pixelLoc <=height-insets.bottom-bottom) { if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(left-majorTickLength, pixelLoc, left, pixelLoc)); } else { copy.draw(new Line2D.Float(left-minorTickLength, pixelLoc, left, pixelLoc)); } labelTemp = leftScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { if(i == 0) copy.drawString(labelTemp, 0, pixelLoc - 5); else if(i == numTicks - 1) copy.drawString(labelTemp, 0, pixelLoc + 5); else copy.drawString(labelTemp, 0, pixelLoc); } } } } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left+ bottomScaleMap.getPixelLocation(i); if (pixelLoc >=insets.left + left && pixelLoc <= width - insets.right) { if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } labelTemp = bottomScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, height-fm.getLeading()); } } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top + top+ rightScaleMap.getPixelLocation(i); System.out.println("HScaleBorder pixelLoc="+pixelLoc); copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); labelTemp = rightScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g; if (copy != null) { try { AffineTransform insetMove = AffineTransform.getTranslateInstance(x, y); copy.transform(insetMove); Font f = new Font("SansSerif", Font.PLAIN, 9); copy.setFont(f); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); insets.left -= x+left; insets.top -= y+top; insets.right -= right + c.getSize().width - x - left; insets.bottom -= bottom + c.getSize().height - y - top; FontMetrics fm = copy.getFontMetrics(); String labelTemp; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); labelTemp = topScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, top - majorTickLength- fm.getLeading()); } } } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top+top+ leftScaleMap.getPixelLocation(i); if (pixelLoc >=insets.top+top && pixelLoc <=height-insets.bottom-bottom) { if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(left-majorTickLength, pixelLoc, left, pixelLoc)); } else { copy.draw(new Line2D.Float(left-minorTickLength, pixelLoc, left, pixelLoc)); } labelTemp = leftScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { if(i == 0) copy.drawString(labelTemp, 0, pixelLoc - 5); else if(i == numTicks - 1) copy.drawString(labelTemp, 0, pixelLoc + 5); else copy.drawString(labelTemp, 0, pixelLoc); } } } } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + left+ bottomScaleMap.getPixelLocation(i); if (pixelLoc >=insets.left + left && pixelLoc <= width - insets.right) { if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } labelTemp = bottomScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, height-fm.getLeading()); } } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.top + top+ rightScaleMap.getPixelLocation(i); System.out.println("HScaleBorder pixelLoc="+pixelLoc); copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); labelTemp = rightScaleMap.getLabel(i); if (labelTemp != null && labelTemp.length() != 0) { copy.drawString(labelTemp, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,268
|
public static void rotate(float[] x, float[] y, double radians) { rotate(x, y, AffineTransform.getRotateInstance(radians)); }
|
public static void rotate(float[] x, float[] y, double radians) { rotate(x, y, AffineTransform.getRotateInstance(radians)); }
| 1,118,269
|
private void save(Idea idea) throws IOException { out.write("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"); out.write("<opml version=\"1.0\">\n"); out.write(" <head>\n"); out.write(" <title/>\n"); out.write(" </head>\n"); out.write(" <body>\n"); saveIdea(idea); out.write(" </body>\n"); out.write("</opml>\n"); }
|
private void save(Idea idea) throws IOException { out.write("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"); out.write("<opml version=\"1.0\">\n"); out.write(" <head>\n"); out.write(" <title/>\n"); out.write(" </head>\n"); out.write(" <body>\n"); saveIdea(idea); out.write(" </body>\n"); out.write("</opml>\n"); }
| 1,118,270
|
public void addSelection(Selection newSelection){ selections.add(newSelection); }
|
public void addSelection(Selection newSelection){ if(!selections.contains(newSelection)) selections.add(newSelection); }
| 1,118,272
|
public StationId[] getAllStationIds() throws SQLException { return extractAll(getAll); }
|
public StationId[] getAllStationIds() throws SQLException { return extractAll(getAllQuery); }
| 1,118,274
|
public NSNetworkAccess(NetworkAccess na, NetworkId id, ProxyNetworkDC netDC){ super(na); this.id = id; this.netDC = netDC; }
|
public NSNetworkAccess(NetworkAccess na, NetworkId id, ProxyNetworkDC netDC){ super(na); this.id = id; this.netDC = netDC; }
| 1,118,275
|
public void field(String name) throws java.lang.Exception{ BwUser u = (BwUser)top(); if (principalTags(u, name)) { return; } if (name.equals("instanceOwner")) { u.setInstanceOwner(booleanFld()); } else if (name.equals("quota")) { u.setQuota(longFld()); } else if (name.equals("subscriptions")) { // XXX 2.3.2 } else if (name.equals("calendarid")) { // XXX 2.3.2 // Fix it later globals.subscriptionsTbl.put(u, intFld()); } else { unknownTag(name); } }
|
public void field(String name) throws java.lang.Exception{ BwUser u = (BwUser)top(); if (principalTags(u, name)) { return; } if (name.equals("instanceOwner")) { u.setInstanceOwner(booleanFld()); } else if (name.equals("quota")) { u.setQuota(longFld()); } else if (name.equals("subscriptions")) { // XXX 2.3.2 } else if (name.equals("calendarid")) { // XXX 2.3.2 // Fix it later globals.subscriptionsTbl.put(OwnerInfo.makeOwnerInfo(u), intFld()); } else { unknownTag(name); } }
| 1,118,276
|
public void end(String ns, String name) throws Exception { BwTimeZone entity = (BwTimeZone)pop(); globals.timezones++; Calendar ical = IcalTranslator.getCalendar(entity.getVtimezone()); ComponentList cl = ical.getComponents(); if (cl.size() != 1) { error("Exception restoring " + entity); throw new CalFacadeException(CalFacadeException.timezonesReadError, cl.size() + " components in Calendar"); } Object o = cl.get(0); if (!(o instanceof VTimeZone)) { error("Exception restoring " + entity); throw new CalFacadeException(CalFacadeException.timezonesReadError, "component in Calendar not VTimeZone"); } try { // Add it to the cache. Will save in db. globals.getTzcache().saveTimeZone(entity.getTzid(), (VTimeZone)o); } catch (Throwable t) { error("Exception restoring " + entity); throw new Exception(t); } }
|
public void end(String ns, String name) throws Exception { BwTimeZone entity = (BwTimeZone)pop(); globals.timezones++; Calendar ical = IcalTranslator.getCalendar(entity.getVtimezone()); ComponentList cl = ical.getComponents(); if (cl.size() != 1) { error("Exception restoring " + entity); throw new CalFacadeException(CalFacadeException.timezonesReadError, cl.size() + " components in Calendar"); } Object o = cl.get(0); if (!(o instanceof VTimeZone)) { error("Exception restoring " + entity); throw new CalFacadeException(CalFacadeException.timezonesReadError, "component in Calendar not VTimeZone"); } try { // Add it to the cache. Will save in db. VTimeZone vtz = (VTimeZone)o; String tzid = entity.getTzid(); globals.getTzcache().saveTimeZone(tzid, vtz, entity.getPublick()); } catch (Throwable t) { error("Exception restoring " + entity); throw new Exception(t); } }
| 1,118,277
|
private void plotAll(Dimension size) throws UnsupportedDataEncoding{ for(int i = 0; i < seisEnd - seisStart; i++){ points[i][0] = (int)(i/samplesPerPixel); points[i][1] = (int)((seis.getValueAt(i + seisStart).getValue() - minAmp)/range * size.height); } if(points.length < 2){ points = new int[2][2]; points[0][1] = (int)((seis.getValueAt(seisStart).getValue() - minAmp)/range * size.height); points[1][1] = (int)((seis.getValueAt(seisEnd).getValue() - minAmp)/range * size.height); } points[0][0] = 0; if(seisStart != seisEnd){ points[seisEnd - seisStart - 1][0] = size.width; } }
|
private void plotAll(Dimension size) throws UnsupportedDataEncoding{ for(int i = 0; i < seisEnd - seisStart; i++){ points[i][0] = (int)(i/samplesPerPixel); points[i][1] = (int)((seis.getValueAt(i + seisStart).getValue() - minAmp)/range * size.height); } if(points.length < 2){ points = new int[2][2]; points[0][1] = (int)((seis.getValueAt(seisStart).getValue() - minAmp)/range * size.height); points[1][1] = (int)((seis.getValueAt(seisEnd).getValue() - minAmp)/range * size.height); } points[0][0] = 0; if(seisStart != seisEnd){ points[seisEnd - seisStart - 1][0] = size.width; } }
| 1,118,279
|
private void plotAll(Dimension size) throws UnsupportedDataEncoding{ for(int i = 0; i < seisEnd - seisStart; i++){ points[i][0] = (int)(i/samplesPerPixel); points[i][1] = (int)((seis.getValueAt(i + seisStart).getValue() - minAmp)/range * size.height); } if(points.length < 2){ points = new int[2][2]; points[0][1] = (int)((seis.getValueAt(seisStart).getValue() - minAmp)/range * size.height); points[1][1] = (int)((seis.getValueAt(seisEnd).getValue() - minAmp)/range * size.height); } points[0][0] = 0; if(seisStart != seisEnd){ points[seisEnd - seisStart - 1][0] = size.width; } }
|
private void plotAll(Dimension size) throws UnsupportedDataEncoding{ for(int i = 0; i < seisEnd - seisStart; i++){ points[i][0] = (int)(i/samplesPerPixel); points[i][1] = (int)((seis.getValueAt(i + seisStart).getValue() - minAmp)/range * size.height); } if(points.length < 2){ points = new int[2][2]; points[0][1] = (int)((seis.getValueAt(seisStart).getValue() - minAmp)/range * size.height); points[1][1] = (int)((seis.getValueAt(seisEnd).getValue() - minAmp)/range * size.height); } points[0][0] = 0; if(seisStart != seisEnd){ points[seisEnd - seisStart - 1][0] = size.width; } }
| 1,118,280
|
public static ChannelNameAndOrientation[] parse(String chanDipAzi) { if(chanDipAzi.equals("default")) { ChannelNameAndOrientation[] array = new ChannelNameAndOrientation[3]; array[0] = new ChannelNameAndOrientation('Z', 0, -90); array[1] = new ChannelNameAndOrientation('N', 0, 0); array[2] = new ChannelNameAndOrientation('E', 90, 0); return array; } else { List tokens = new ArrayList(); StringTokenizer t = new StringTokenizer(chanDipAzi, "/:"); while(t.hasMoreTokens()) { tokens.add(t.nextToken()); } ChannelNameAndOrientation[] array = new ChannelNameAndOrientation[3]; array[0] = new ChannelNameAndOrientation(((String)tokens.get(0)).charAt(0), Integer.parseInt((String)tokens.get(2)), Integer.parseInt((String)tokens.get(1))); array[1] = new ChannelNameAndOrientation(((String)tokens.get(3)).charAt(0), Integer.parseInt((String)tokens.get(5)), Integer.parseInt((String)tokens.get(4))); array[2] = new ChannelNameAndOrientation(((String)tokens.get(6)).charAt(0), Integer.parseInt((String)tokens.get(8)), Integer.parseInt((String)tokens.get(7))); return array; } }
|
public static ChannelNameAndOrientation[] parse(String chanDipAzi) { if(chanDipAzi.equals("default")) { ChannelNameAndOrientation[] array = new ChannelNameAndOrientation[3]; array[0] = new ChannelNameAndOrientation('Z', 0, -90); array[1] = new ChannelNameAndOrientation('N', 0, 0); array[2] = new ChannelNameAndOrientation('E', 90, 0); return array; } else { List tokens = new ArrayList(); StringTokenizer t = new StringTokenizer(chanDipAzi, "/:"); while(t.hasMoreTokens()) { tokens.add(t.nextToken()); } ChannelNameAndOrientation[] array = new ChannelNameAndOrientation[3]; array[0] = new ChannelNameAndOrientation(((String)tokens.get(0)).charAt(0), Integer.parseInt((String)tokens.get(2)), Integer.parseInt((String)tokens.get(1))); array[1] = new ChannelNameAndOrientation(((String)tokens.get(3)).charAt(0), Integer.parseInt((String)tokens.get(5)), Integer.parseInt((String)tokens.get(4))); array[2] = new ChannelNameAndOrientation(((String)tokens.get(6)).charAt(0), Integer.parseInt((String)tokens.get(8)), Integer.parseInt((String)tokens.get(7))); return array; } }
| 1,118,281
|
public void testClosureLiteral() throws NATException { ATClosure clo = evalAndReturn("{| x, y | 3 }").asClosure(); ATSymbol nam = clo.base_getMethod().base_getName(); ATTable arg = clo.base_getMethod().base_getArguments(); ATAbstractGrammar bdy = clo.base_getMethod().base_getBodyExpression(); ATContext ctx = clo.base_getContext(); assertEquals(AGSymbol.alloc(NATText.atValue("lambda")), nam); assertEquals(atX_, arg.base_at(NATNumber.ONE)); assertEquals(atY_, arg.base_at(NATNumber.atValue(2))); assertEquals(atThree_, bdy.asBegin().getStatements().base_at(NATNumber.ONE)); assertEquals(ctx_, ctx); }
|
public void testClosureLiteral() throws NATException { ATClosure clo = evalAndReturn("{| x, y | 3 }").asClosure(); ATSymbol nam = clo.base_getMethod().base_getName(); ATTable arg = clo.base_getMethod().base_getArguments(); ATAbstractGrammar bdy = clo.base_getMethod().base_getBodyExpression(); ATContext ctx = clo.base_getContext(); assertEquals(AGSymbol.alloc(NATText.atValue("lambda")), nam); assertEquals(atX_, arg.base_at(NATNumber.ONE)); assertEquals(atY_, arg.base_at(NATNumber.atValue(2))); assertEquals(atThree_, bdy.asBegin().base_getStatements().base_at(NATNumber.ONE)); assertEquals(ctx_, ctx); }
| 1,118,282
|
public void testFirstClassMessages() throws NATException { ATMessage methInv = evalAndReturn(".m(3)").asMessage(); ATMessage asyncMsg = evalAndReturn("<-m(3)").asMessage(); assertEquals(atM_, methInv.base_getSelector()); assertEquals(atThree_, methInv.base_getArguments().base_at(NATNumber.ONE)); assertTrue(methInv instanceof ATMethodInvocation); assertEquals(atM_, asyncMsg.base_getSelector()); assertEquals(atThree_, asyncMsg.base_getArguments().base_at(NATNumber.ONE)); assertTrue(asyncMsg instanceof ATAsyncMessage); assertEquals(ctx_.base_getSelf(), ((ATAsyncMessage) asyncMsg).getSender()); }
|
public void testFirstClassMessages() throws NATException { ATMessage methInv = evalAndReturn(".m(3)").asMessage(); ATMessage asyncMsg = evalAndReturn("<-m(3)").asMessage(); assertEquals(atM_, methInv.base_getSelector()); assertEquals(atThree_, methInv.base_getArguments().base_at(NATNumber.ONE)); assertTrue(methInv instanceof ATMethodInvocation); assertEquals(atM_, asyncMsg.base_getSelector()); assertEquals(atThree_, asyncMsg.base_getArguments().base_at(NATNumber.ONE)); assertTrue(asyncMsg instanceof ATAsyncMessage); assertEquals(ctx_.base_getSelf(), ((ATAsyncMessage) asyncMsg).base_getSender()); }
| 1,118,283
|
public NATMethod(ATSymbol name, ATTable parameters, ATAbstractGrammar body) { name_ = name; parameters_ = parameters; body_ = body; }
|
public NATMethod(ATSymbol name, ATTable parameters, ATBegin body) { name_ = name; parameters_ = parameters; body_ = body; }
| 1,118,284
|
public synchronized void removeAll(){ layout = null; tc = null; ac = null; drawables.clear(); displayRemover = null; setBorder(BorderFactory.createEmptyBorder()); painter = null; super.removeAll(); }
|
public void removeAll(){ layout = null; tc = null; ac = null; drawables.clear(); displayRemover = null; setBorder(BorderFactory.createEmptyBorder()); painter = null; super.removeAll(); }
| 1,118,285
|
public void setMethodName(String name, String uri) throws CalFacadeException { if ("REPORT".equals(name)) { setMethod(new ReportMethod(uri)); } else if ("PROPFIND".equals(name)) { setMethod(new PropFindMethod(uri)); } else { super.setMethodName(name, uri); } }
|
public void setMethodName(String name, String uri) throws CalFacadeException { if ("REPORT".equals(name)) { setMethod(new ReportMethod(uri)); } else if ("PROPFIND".equals(name)) { setMethod(new PropFindMethod(uri)); } else { super.setMethodName(name, uri); } }
| 1,118,286
|
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access and set request parameters */ if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } /** Set the objects to null so we get new ones. */ form.initFields(); form.setEvent(null); form.assignAlertEvent(true); form.assignAddingEvent(true); form.resetEvent(); return "continue"; }
|
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access and set request parameters */ if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } /** Set the objects to null so we get new ones. */ form.initFields(); form.setEvent(null); form.assignAlertEvent(true); form.assignAddingEvent(true); form.resetEvent(); return "continue"; }
| 1,118,288
|
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access and set request parameters */ if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } /** Set the objects to null so we get new ones. */ form.initFields(); form.setEvent(null); form.assignAlertEvent(true); form.assignAddingEvent(true); form.resetEvent(); return "continue"; }
|
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access and set request parameters */ if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } /** Set the objects to null so we get new ones. */ form.initFields(); form.setEvent(null); form.assignAlertEvent(true); form.assignAddingEvent(true); return "continue"; }
| 1,118,289
|
public void resetEvent() { getEvent(); // Make sure we have one /* Implant the current id(s) in new entries */ int id = 0; BwCategory k = event.getFirstCategory(); if (k != null) { id = k.getId(); setCategory(k); } /* A is the All box, B is the user preferred values. */ keyId = new IntSelectId(id, IntSelectId.AHasPrecedence); BwSponsor s = event.getSponsor(); id = 0; if (s != null) { id = s.getId(); setSponsor(s); } spId = new IntSelectId(id, IntSelectId.AHasPrecedence); BwLocation l = event.getLocation(); id = 0; if (l != null) { id = l.getId(); setLocation(l); } locId = new IntSelectId(id, IntSelectId.AHasPrecedence); BwCalendar c = event.getCalendar(); id = 0; if (c != null) { id = c.getId(); setCalendar(c); } calendarId = new IntSelectId(id, IntSelectId.AHasPrecedence); }
|
public void resetEvent() { getEvent(); // Make sure we have one /* Implant the current id(s) in new entries */ int id = 0; BwCategory k = event.getFirstCategory(); if (k != null) { id = k.getId(); setCategory(k); } /* A is the All box, B is the user preferred values. */ categoryId = new IntSelectId(id, IntSelectId.AHasPrecedence); BwSponsor s = event.getSponsor(); id = 0; if (s != null) { id = s.getId(); setSponsor(s); } spId = new IntSelectId(id, IntSelectId.AHasPrecedence); BwLocation l = event.getLocation(); id = 0; if (l != null) { id = l.getId(); setLocation(l); } locId = new IntSelectId(id, IntSelectId.AHasPrecedence); BwCalendar c = event.getCalendar(); id = 0; if (c != null) { id = c.getId(); setCalendar(c); } calendarId = new IntSelectId(id, IntSelectId.AHasPrecedence); }
| 1,118,290
|
public PartMo(float baz, float ang) { setLayout(new BorderLayout()); // Create Canvas3D GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration(); // if(config == null) System.out.println("The configuration is NULL"); //else System.out.println("Teh confiugraion is NOT NULL"); Canvas3D canvas3D = new Canvas3D(config); add("Center", canvas3D); BranchGroup scene = createSceneGraph(baz,ang); //System.out.println("after createing scenGraph"); // SimpleUniverse is a Convenience Utility class SimpleUniverse simpleU = new SimpleUniverse(canvas3D); //stem.out.println("formed the simpeUniverse"); //add(canvas3D, BorderLayout.CENTER); //stem.out.println("added the canvas3D to the panel"); // This will move the ViewPlatform back a bit so the // objects in the scene can be viewed. simpleU.getViewingPlatform().setNominalViewingTransform(); //stem.out.println("after setting the nominalViewing transform"); simpleU.addBranchGraph(scene); //stem.out.println("&&&after addBranchGraph(scene)"); //throw new IllegalArgumentException("not important"); } // end of constructor
|
public PartMo(float baz, float ang) { setLayout(new BorderLayout()); // Create Canvas3D GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration(); // if(config == null) System.out.println("The configuration is NULL"); //else System.out.println("Teh confiugraion is NOT NULL"); Canvas3D canvas3D = new Canvas3D(config); add("Center", canvas3D); BranchGroup scene = createSceneGraph(baz,ang); //System.out.println("after createing scenGraph"); // SimpleUniverse is a Convenience Utility class SimpleUniverse simpleU = new SimpleUniverse(canvas3D); //stem.out.println("formed the simpeUniverse"); //add(canvas3D, BorderLayout.CENTER); //stem.out.println("added the canvas3D to the panel"); // This will move the ViewPlatform back a bit so the // objects in the scene can be viewed. simpleU.getViewingPlatform().setNominalViewingTransform(); //stem.out.println("after setting the nominalViewing transform"); simpleU.addBranchGraph(scene); //stem.out.println("&&&after addBranchGraph(scene)"); //throw new IllegalArgumentException("not important"); } // end of constructor
| 1,118,291
|
public BranchGroup createSceneGraph(float baz, float ang) { BranchGroup objRoot = new BranchGroup(); BranchGroup Axes = new Axis().getAxisBG(); BranchGroup Surface = new Axis().getSurfaceBG(); BranchGroup Motion = new MotionVector(baz,ang).getMotionBG(); BranchGroup Trace = new Traces(baz,ang).getTraceBG(); Transform3D rotateX = new Transform3D(); Transform3D rotateY = new Transform3D(); Transform3D rotateZ = new Transform3D(); double zRotation = 90.0d; double xRotation = -135.0d; double yRotation = -45.0d; rotateX.rotX(Math.toRadians(xRotation)); rotateZ.rotZ(Math.toRadians(zRotation)); rotateY.rotY(Math.toRadians(yRotation)); Transform3D rotate = new Transform3D(); Transform3D shift = new Transform3D(); Transform3D scale = new Transform3D(); Transform3D PlaceCoordSystem = new Transform3D(); rotate.mul(rotateZ); rotate.mul(rotateY); rotate.mul(rotateX); scale.setScale(0.5d); shift.setTranslation(new Vector3f(0.0f,0.4f,0.00f)); PlaceCoordSystem.mul(shift); PlaceCoordSystem.mul(rotate); PlaceCoordSystem.mul(scale); Transform3D SurfShift = new Transform3D(); SurfShift.setTranslation(new Vector3f(0.0f,0.36f,0.00f)); Transform3D PlaceSurface = new Transform3D(); PlaceSurface.mul(SurfShift); PlaceSurface.mul(rotate); PlaceSurface.mul(scale); /* Text is placed in the global coordinate sytem at locations transformed by the PlaceCoordSystem object. This keeps them facing the viewer, but in the proper location. */ Point3f textpt = new Point3f(1.0f,0.0f,0.0f); PlaceCoordSystem.transform(textpt); Text2D up = new Text2D("Up", textpt, new Color3f(1.0f, 0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(up); textpt = new Point3f(-1.2f,0.0f,0.0f); PlaceCoordSystem.transform(textpt); Text2D down = new Text2D("Down", textpt, new Color3f(1.0f, 0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(down); textpt = new Point3f(0.0f,1.2f,0.0f); PlaceCoordSystem.transform(textpt); Text2D east = new Text2D("East", textpt, new Color3f(0f, 1.0f, 0.2f), "Helvetica", 16, Font.BOLD); objRoot.addChild(east); textpt = new Point3f(0.0f,-1.2f,0.2f); PlaceCoordSystem.transform(textpt); Text2D west = new Text2D("West", textpt, new Color3f(0f, 1.0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(west); textpt = new Point3f(0.0f,0.0f,1.1f); PlaceCoordSystem.transform(textpt); Text2D north = new Text2D("North", textpt, new Color3f(0f, 0f, 1.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(north); textpt = new Point3f(0.0f,0.0f,-1.2f); PlaceCoordSystem.transform(textpt); Text2D south = new Text2D("South", textpt, new Color3f(0f, 0f, 1.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(south); textpt = new Point3f(-1.2f,-1.4f,-1.0f); Text2D caption = new Text2D("Press and Hold any key to start animation", textpt, new Color3f(0f, 0f, 0.0f), "TimesRoman", 24, Font.BOLD); objRoot.addChild(caption); /* Set up the animation of the traces */ Alpha alpha = new Alpha(-1, 4000); TransformGroup ZsingAlong = new TransformGroup(); Transform3D ZaxisOfPos = new Transform3D(); ZaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); ZsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup NsingAlong = new TransformGroup(); Transform3D NaxisOfPos = new Transform3D(); NaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); NsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup EsingAlong = new TransformGroup(); Transform3D EaxisOfPos = new Transform3D(); EaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); EsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); int nknots = new Traces(baz,ang).getNumberOfPoints(); Point3f zSing[] = new Point3f[nknots]; Point3f eSing[] = new Point3f[nknots]; Point3f nSing[] = new Point3f[nknots]; float knots[] = new float[nknots]; float zknots[] = new float[nknots]; float knotInc = 1.0f/(nknots-1); int i = 0; while (i < nknots) { knots[i] = i*knotInc; zknots[i] = i*knotInc; i++; } new Traces(baz,ang).getSingAlongPoints(zSing,nSing,eSing); //System.out.println("before tjo interpolator"); tjoInterpolator nSinger = new tjoInterpolator(alpha, NsingAlong, NaxisOfPos, knots, nSing); //System.out.println("after tjo interpolator"); nSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); //System.out.println("before tjo interpolator"); tjoInterpolator eSinger = new tjoInterpolator(alpha, EsingAlong, EaxisOfPos, knots, eSing); //System.out.println("after tjo interpolator"); eSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); //System.out.println("before tjo interpolator"); tjoInterpolator zSinger = new tjoInterpolator(alpha, ZsingAlong, ZaxisOfPos, knots, zSing); //System.out.println("after tjo interpolator"); zSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); int GMknots = 41; Point3f GMpoints[] = new Point3f[41]; Point3f GMzOnly[] = new Point3f[41]; Point3f GMeOnly[] = new Point3f[41]; Point3f GMnOnly[] = new Point3f[41]; new MotionVector(baz,ang).getMotionPoints(GMpoints); float gknots[] = new float[GMknots]; float gnotInc = 1.0f/(GMknots-1); i = 0; while (i < GMknots) { gknots[i] = i*gnotInc; // //System.out.println("GM " + i + " " + GMpoints[i]); float t[] = new float[3]; GMpoints[i].get(t); GMzOnly[i]=new Point3f(t[0],0.0f,0.0f); GMeOnly[i]=new Point3f(0.0f,t[1],0.0f); GMnOnly[i]=new Point3f(0.0f,0.0f,t[2]); PlaceCoordSystem.transform(GMpoints[i]); PlaceCoordSystem.transform(GMzOnly[i]); PlaceCoordSystem.transform(GMeOnly[i]); PlaceCoordSystem.transform(GMnOnly[i]); i++; } TransformGroup GMsingAlong = new TransformGroup(); GMsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMzOnly_singAlong = new TransformGroup(); GMzOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMnOnly_singAlong = new TransformGroup(); GMnOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMeOnly_singAlong = new TransformGroup(); GMeOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); Transform3D GMaxisOfPos = new Transform3D(); GMaxisOfPos.set(new Vector3f(0.0f,1.0f,0.0f)); tjoInterpolator gmSinger = new tjoInterpolator(alpha, GMsingAlong, GMaxisOfPos, gknots, GMpoints); gmSinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmZonlySinger = new tjoInterpolator(alpha, GMzOnly_singAlong, GMaxisOfPos, gknots, GMzOnly); gmZonlySinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmNonlySinger = new tjoInterpolator(alpha, GMnOnly_singAlong, GMaxisOfPos, gknots, GMnOnly); gmNonlySinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmEonlySinger = new tjoInterpolator(alpha, GMeOnly_singAlong, GMaxisOfPos, gknots, GMeOnly); gmEonlySinger.setSchedulingBounds(new BoundingSphere()); TransformGroup objPlace3D = new TransformGroup(PlaceCoordSystem); TransformGroup objPlaceSurf = new TransformGroup(PlaceSurface); Background background = new Background(); background.setColor(0.6f, 0.6f, 0.6f); background.setApplicationBounds(new BoundingSphere()); objRoot.addChild(background); objPlace3D.addChild(Axes); objPlace3D.addChild(Motion); objRoot.addChild(objPlace3D); objPlaceSurf.addChild(Surface); objRoot.addChild(objPlaceSurf); /* objPlaceAxesText.addChild(AxesText); objRoot.addChild(objPlaceAxesText); */ objRoot.addChild(Trace); objRoot.addChild(ZsingAlong); objRoot.addChild(zSinger); Appearance zSphere = new Appearance(); ColoringAttributes zCA = new ColoringAttributes(); zCA.setColor(1.0f,0.0f,0.0f); zSphere.setColoringAttributes(zCA); ZsingAlong.addChild(new Sphere(0.02f,zSphere)); objRoot.addChild(NsingAlong); objRoot.addChild(nSinger); Appearance nSphere = new Appearance(); ColoringAttributes nCA = new ColoringAttributes(); nCA.setColor(0.0f,0.0f,1.0f); nSphere.setColoringAttributes(nCA); NsingAlong.addChild(new Sphere(0.02f,nSphere)); objRoot.addChild(EsingAlong); objRoot.addChild(eSinger); Appearance eSphere = new Appearance(); ColoringAttributes eCA = new ColoringAttributes(); eCA.setColor(0.0f,1.0f,0.0f); eSphere.setColoringAttributes(eCA); EsingAlong.addChild(new Sphere(0.02f,eSphere)); objRoot.addChild(GMzOnly_singAlong); objRoot.addChild(gmZonlySinger); Appearance gmZonlySphere = new Appearance(); ColoringAttributes gmZonlyCA = new ColoringAttributes(); gmZonlyCA.setColor(1.0f,0.0f,0.0f); gmZonlySphere.setColoringAttributes(gmZonlyCA); GMzOnly_singAlong.addChild(new Sphere(0.015f,gmZonlySphere)); objRoot.addChild(GMnOnly_singAlong); objRoot.addChild(gmNonlySinger); Appearance gmNonlySphere = new Appearance(); ColoringAttributes gmNonlyCA = new ColoringAttributes(); gmNonlyCA.setColor(0.0f,0.0f,1.0f); gmNonlySphere.setColoringAttributes(gmNonlyCA); GMnOnly_singAlong.addChild(new Sphere(0.015f,gmNonlySphere)); objRoot.addChild(GMeOnly_singAlong); objRoot.addChild(gmEonlySinger); Appearance gmEonlySphere = new Appearance(); ColoringAttributes gmEonlyCA = new ColoringAttributes(); gmEonlyCA.setColor(0.0f,1.0f,0.0f); gmEonlySphere.setColoringAttributes(gmEonlyCA); GMeOnly_singAlong.addChild(new Sphere(0.015f,gmEonlySphere)); objRoot.addChild(GMsingAlong); objRoot.addChild(gmSinger); Appearance gmSphere = new Appearance(); ColoringAttributes gmCA = new ColoringAttributes(); gmCA.setColor(0.4f,0.2f,0.2f); gmSphere.setColoringAttributes(gmCA); GMsingAlong.addChild(new Sphere(0.02f,gmSphere)); // Let Java 3D perform optimizations on this scene graph. objRoot.compile(); //System.out.println("returning from CreaetScene Graph"); return objRoot; } // end of CreateSceneGraph method
|
public BranchGroup createSceneGraph(float baz, float ang) { BranchGroup objRoot = new BranchGroup(); BranchGroup Axes = new Axis().getAxisBG(); BranchGroup Surface = new Axis().getSurfaceBG(); BranchGroup Motion = new MotionVector(baz,ang).getMotionBG(); BranchGroup Trace = new Traces(baz,ang).getTraceBG(); Transform3D rotateX = new Transform3D(); Transform3D rotateY = new Transform3D(); Transform3D rotateZ = new Transform3D(); double zRotation = 90.0d; double xRotation = -135.0d; double yRotation = -45.0d; rotateX.rotX(Math.toRadians(xRotation)); rotateZ.rotZ(Math.toRadians(zRotation)); rotateY.rotY(Math.toRadians(yRotation)); Transform3D rotate = new Transform3D(); Transform3D shift = new Transform3D(); Transform3D scale = new Transform3D(); Transform3D PlaceCoordSystem = new Transform3D(); rotate.mul(rotateZ); rotate.mul(rotateY); rotate.mul(rotateX); scale.setScale(0.5d); shift.setTranslation(new Vector3f(0.0f,0.4f,0.00f)); PlaceCoordSystem.mul(shift); PlaceCoordSystem.mul(rotate); PlaceCoordSystem.mul(scale); Transform3D SurfShift = new Transform3D(); SurfShift.setTranslation(new Vector3f(0.0f,0.36f,0.00f)); Transform3D PlaceSurface = new Transform3D(); PlaceSurface.mul(SurfShift); PlaceSurface.mul(rotate); PlaceSurface.mul(scale); /* Text is placed in the global coordinate sytem at locations transformed by the PlaceCoordSystem object. This keeps them facing the viewer, but in the proper location. */ Point3f textpt = new Point3f(1.0f,0.0f,0.0f); PlaceCoordSystem.transform(textpt); Text2D up = new Text2D("Up", textpt, new Color3f(1.0f, 0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(up); textpt = new Point3f(-1.2f,0.0f,0.0f); PlaceCoordSystem.transform(textpt); Text2D down = new Text2D("Down", textpt, new Color3f(1.0f, 0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(down); textpt = new Point3f(0.0f,1.2f,0.0f); PlaceCoordSystem.transform(textpt); Text2D east = new Text2D("East", textpt, new Color3f(0f, 1.0f, 0.2f), "Helvetica", 16, Font.BOLD); objRoot.addChild(east); textpt = new Point3f(0.0f,-1.2f,0.2f); PlaceCoordSystem.transform(textpt); Text2D west = new Text2D("West", textpt, new Color3f(0f, 1.0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(west); textpt = new Point3f(0.0f,0.0f,1.1f); PlaceCoordSystem.transform(textpt); Text2D north = new Text2D("North", textpt, new Color3f(0f, 0f, 1.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(north); textpt = new Point3f(0.0f,0.0f,-1.2f); PlaceCoordSystem.transform(textpt); Text2D south = new Text2D("South", textpt, new Color3f(0f, 0f, 1.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(south); textpt = new Point3f(-1.2f,-1.4f,-1.0f); Text2D caption = new Text2D("Press and Hold any key to start animation", textpt, new Color3f(0f, 0f, 0.0f), "TimesRoman", 24, Font.BOLD); objRoot.addChild(caption); /* Set up the animation of the traces */ Alpha alpha = new Alpha(-1, 4000); TransformGroup ZsingAlong = new TransformGroup(); Transform3D ZaxisOfPos = new Transform3D(); ZaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); ZsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup NsingAlong = new TransformGroup(); Transform3D NaxisOfPos = new Transform3D(); NaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); NsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup EsingAlong = new TransformGroup(); Transform3D EaxisOfPos = new Transform3D(); EaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); EsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); int nknots = new Traces(baz,ang).getNumberOfPoints(); Point3f zSing[] = new Point3f[nknots]; Point3f eSing[] = new Point3f[nknots]; Point3f nSing[] = new Point3f[nknots]; float knots[] = new float[nknots]; float zknots[] = new float[nknots]; float knotInc = 1.0f/(nknots-1); int i = 0; while (i < nknots) { knots[i] = i*knotInc; zknots[i] = i*knotInc; i++; } new Traces(baz,ang).getSingAlongPoints(zSing,nSing,eSing); //System.out.println("before tjo interpolator"); tjoInterpolator nSinger = new tjoInterpolator(alpha, NsingAlong, NaxisOfPos, knots, nSing); //System.out.println("after tjo interpolator"); nSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); //System.out.println("before tjo interpolator"); tjoInterpolator eSinger = new tjoInterpolator(alpha, EsingAlong, EaxisOfPos, knots, eSing); //System.out.println("after tjo interpolator"); eSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); //System.out.println("before tjo interpolator"); tjoInterpolator zSinger = new tjoInterpolator(alpha, ZsingAlong, ZaxisOfPos, knots, zSing); //System.out.println("after tjo interpolator"); zSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); int GMknots = 41; Point3f GMpoints[] = new Point3f[41]; Point3f GMzOnly[] = new Point3f[41]; Point3f GMeOnly[] = new Point3f[41]; Point3f GMnOnly[] = new Point3f[41]; new MotionVector(baz,ang).getMotionPoints(GMpoints); float gknots[] = new float[GMknots]; float gnotInc = 1.0f/(GMknots-1); i = 0; while (i < GMknots) { gknots[i] = i*gnotInc; // //System.out.println("GM " + i + " " + GMpoints[i]); float t[] = new float[3]; GMpoints[i].get(t); GMzOnly[i]=new Point3f(t[0],0.0f,0.0f); GMeOnly[i]=new Point3f(0.0f,t[1],0.0f); GMnOnly[i]=new Point3f(0.0f,0.0f,t[2]); PlaceCoordSystem.transform(GMpoints[i]); PlaceCoordSystem.transform(GMzOnly[i]); PlaceCoordSystem.transform(GMeOnly[i]); PlaceCoordSystem.transform(GMnOnly[i]); i++; } TransformGroup GMsingAlong = new TransformGroup(); GMsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMzOnly_singAlong = new TransformGroup(); GMzOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMnOnly_singAlong = new TransformGroup(); GMnOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMeOnly_singAlong = new TransformGroup(); GMeOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); Transform3D GMaxisOfPos = new Transform3D(); GMaxisOfPos.set(new Vector3f(0.0f,1.0f,0.0f)); tjoInterpolator gmSinger = new tjoInterpolator(alpha, GMsingAlong, GMaxisOfPos, gknots, GMpoints); gmSinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmZonlySinger = new tjoInterpolator(alpha, GMzOnly_singAlong, GMaxisOfPos, gknots, GMzOnly); gmZonlySinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmNonlySinger = new tjoInterpolator(alpha, GMnOnly_singAlong, GMaxisOfPos, gknots, GMnOnly); gmNonlySinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmEonlySinger = new tjoInterpolator(alpha, GMeOnly_singAlong, GMaxisOfPos, gknots, GMeOnly); gmEonlySinger.setSchedulingBounds(new BoundingSphere()); TransformGroup objPlace3D = new TransformGroup(PlaceCoordSystem); TransformGroup objPlaceSurf = new TransformGroup(PlaceSurface); Background background = new Background(); background.setColor(0.6f, 0.6f, 0.6f); background.setApplicationBounds(new BoundingSphere()); objRoot.addChild(background); objPlace3D.addChild(Axes); objPlace3D.addChild(Motion); objRoot.addChild(objPlace3D); objPlaceSurf.addChild(Surface); objRoot.addChild(objPlaceSurf); /* objPlaceAxesText.addChild(AxesText); objRoot.addChild(objPlaceAxesText); */ objRoot.addChild(Trace); objRoot.addChild(ZsingAlong); objRoot.addChild(zSinger); Appearance zSphere = new Appearance(); ColoringAttributes zCA = new ColoringAttributes(); zCA.setColor(1.0f,0.0f,0.0f); zSphere.setColoringAttributes(zCA); ZsingAlong.addChild(new Sphere(0.02f,zSphere)); objRoot.addChild(NsingAlong); objRoot.addChild(nSinger); Appearance nSphere = new Appearance(); ColoringAttributes nCA = new ColoringAttributes(); nCA.setColor(0.0f,0.0f,1.0f); nSphere.setColoringAttributes(nCA); NsingAlong.addChild(new Sphere(0.02f,nSphere)); objRoot.addChild(EsingAlong); objRoot.addChild(eSinger); Appearance eSphere = new Appearance(); ColoringAttributes eCA = new ColoringAttributes(); eCA.setColor(0.0f,1.0f,0.0f); eSphere.setColoringAttributes(eCA); EsingAlong.addChild(new Sphere(0.02f,eSphere)); objRoot.addChild(GMzOnly_singAlong); objRoot.addChild(gmZonlySinger); Appearance gmZonlySphere = new Appearance(); ColoringAttributes gmZonlyCA = new ColoringAttributes(); gmZonlyCA.setColor(1.0f,0.0f,0.0f); gmZonlySphere.setColoringAttributes(gmZonlyCA); GMzOnly_singAlong.addChild(new Sphere(0.015f,gmZonlySphere)); objRoot.addChild(GMnOnly_singAlong); objRoot.addChild(gmNonlySinger); Appearance gmNonlySphere = new Appearance(); ColoringAttributes gmNonlyCA = new ColoringAttributes(); gmNonlyCA.setColor(0.0f,0.0f,1.0f); gmNonlySphere.setColoringAttributes(gmNonlyCA); GMnOnly_singAlong.addChild(new Sphere(0.015f,gmNonlySphere)); objRoot.addChild(GMeOnly_singAlong); objRoot.addChild(gmEonlySinger); Appearance gmEonlySphere = new Appearance(); ColoringAttributes gmEonlyCA = new ColoringAttributes(); gmEonlyCA.setColor(0.0f,1.0f,0.0f); gmEonlySphere.setColoringAttributes(gmEonlyCA); GMeOnly_singAlong.addChild(new Sphere(0.015f,gmEonlySphere)); objRoot.addChild(GMsingAlong); objRoot.addChild(gmSinger); Appearance gmSphere = new Appearance(); ColoringAttributes gmCA = new ColoringAttributes(); gmCA.setColor(0.4f,0.2f,0.2f); gmSphere.setColoringAttributes(gmCA); GMsingAlong.addChild(new Sphere(0.02f,gmSphere)); // Let Java 3D perform optimizations on this scene graph. objRoot.compile(); //System.out.println("returning from CreaetScene Graph"); return objRoot; } // end of CreateSceneGraph method
| 1,118,292
|
public BranchGroup createSceneGraph(float baz, float ang) { BranchGroup objRoot = new BranchGroup(); BranchGroup Axes = new Axis().getAxisBG(); BranchGroup Surface = new Axis().getSurfaceBG(); BranchGroup Motion = new MotionVector(baz,ang).getMotionBG(); BranchGroup Trace = new Traces(baz,ang).getTraceBG(); Transform3D rotateX = new Transform3D(); Transform3D rotateY = new Transform3D(); Transform3D rotateZ = new Transform3D(); double zRotation = 90.0d; double xRotation = -135.0d; double yRotation = -45.0d; rotateX.rotX(Math.toRadians(xRotation)); rotateZ.rotZ(Math.toRadians(zRotation)); rotateY.rotY(Math.toRadians(yRotation)); Transform3D rotate = new Transform3D(); Transform3D shift = new Transform3D(); Transform3D scale = new Transform3D(); Transform3D PlaceCoordSystem = new Transform3D(); rotate.mul(rotateZ); rotate.mul(rotateY); rotate.mul(rotateX); scale.setScale(0.5d); shift.setTranslation(new Vector3f(0.0f,0.4f,0.00f)); PlaceCoordSystem.mul(shift); PlaceCoordSystem.mul(rotate); PlaceCoordSystem.mul(scale); Transform3D SurfShift = new Transform3D(); SurfShift.setTranslation(new Vector3f(0.0f,0.36f,0.00f)); Transform3D PlaceSurface = new Transform3D(); PlaceSurface.mul(SurfShift); PlaceSurface.mul(rotate); PlaceSurface.mul(scale); /* Text is placed in the global coordinate sytem at locations transformed by the PlaceCoordSystem object. This keeps them facing the viewer, but in the proper location. */ Point3f textpt = new Point3f(1.0f,0.0f,0.0f); PlaceCoordSystem.transform(textpt); Text2D up = new Text2D("Up", textpt, new Color3f(1.0f, 0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(up); textpt = new Point3f(-1.2f,0.0f,0.0f); PlaceCoordSystem.transform(textpt); Text2D down = new Text2D("Down", textpt, new Color3f(1.0f, 0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(down); textpt = new Point3f(0.0f,1.2f,0.0f); PlaceCoordSystem.transform(textpt); Text2D east = new Text2D("East", textpt, new Color3f(0f, 1.0f, 0.2f), "Helvetica", 16, Font.BOLD); objRoot.addChild(east); textpt = new Point3f(0.0f,-1.2f,0.2f); PlaceCoordSystem.transform(textpt); Text2D west = new Text2D("West", textpt, new Color3f(0f, 1.0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(west); textpt = new Point3f(0.0f,0.0f,1.1f); PlaceCoordSystem.transform(textpt); Text2D north = new Text2D("North", textpt, new Color3f(0f, 0f, 1.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(north); textpt = new Point3f(0.0f,0.0f,-1.2f); PlaceCoordSystem.transform(textpt); Text2D south = new Text2D("South", textpt, new Color3f(0f, 0f, 1.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(south); textpt = new Point3f(-1.2f,-1.4f,-1.0f); Text2D caption = new Text2D("Press and Hold any key to start animation", textpt, new Color3f(0f, 0f, 0.0f), "TimesRoman", 24, Font.BOLD); objRoot.addChild(caption); /* Set up the animation of the traces */ Alpha alpha = new Alpha(-1, 4000); TransformGroup ZsingAlong = new TransformGroup(); Transform3D ZaxisOfPos = new Transform3D(); ZaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); ZsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup NsingAlong = new TransformGroup(); Transform3D NaxisOfPos = new Transform3D(); NaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); NsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup EsingAlong = new TransformGroup(); Transform3D EaxisOfPos = new Transform3D(); EaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); EsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); int nknots = new Traces(baz,ang).getNumberOfPoints(); Point3f zSing[] = new Point3f[nknots]; Point3f eSing[] = new Point3f[nknots]; Point3f nSing[] = new Point3f[nknots]; float knots[] = new float[nknots]; float zknots[] = new float[nknots]; float knotInc = 1.0f/(nknots-1); int i = 0; while (i < nknots) { knots[i] = i*knotInc; zknots[i] = i*knotInc; i++; } new Traces(baz,ang).getSingAlongPoints(zSing,nSing,eSing); //System.out.println("before tjo interpolator"); tjoInterpolator nSinger = new tjoInterpolator(alpha, NsingAlong, NaxisOfPos, knots, nSing); //System.out.println("after tjo interpolator"); nSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); //System.out.println("before tjo interpolator"); tjoInterpolator eSinger = new tjoInterpolator(alpha, EsingAlong, EaxisOfPos, knots, eSing); //System.out.println("after tjo interpolator"); eSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); //System.out.println("before tjo interpolator"); tjoInterpolator zSinger = new tjoInterpolator(alpha, ZsingAlong, ZaxisOfPos, knots, zSing); //System.out.println("after tjo interpolator"); zSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); int GMknots = 41; Point3f GMpoints[] = new Point3f[41]; Point3f GMzOnly[] = new Point3f[41]; Point3f GMeOnly[] = new Point3f[41]; Point3f GMnOnly[] = new Point3f[41]; new MotionVector(baz,ang).getMotionPoints(GMpoints); float gknots[] = new float[GMknots]; float gnotInc = 1.0f/(GMknots-1); i = 0; while (i < GMknots) { gknots[i] = i*gnotInc; // //System.out.println("GM " + i + " " + GMpoints[i]); float t[] = new float[3]; GMpoints[i].get(t); GMzOnly[i]=new Point3f(t[0],0.0f,0.0f); GMeOnly[i]=new Point3f(0.0f,t[1],0.0f); GMnOnly[i]=new Point3f(0.0f,0.0f,t[2]); PlaceCoordSystem.transform(GMpoints[i]); PlaceCoordSystem.transform(GMzOnly[i]); PlaceCoordSystem.transform(GMeOnly[i]); PlaceCoordSystem.transform(GMnOnly[i]); i++; } TransformGroup GMsingAlong = new TransformGroup(); GMsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMzOnly_singAlong = new TransformGroup(); GMzOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMnOnly_singAlong = new TransformGroup(); GMnOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMeOnly_singAlong = new TransformGroup(); GMeOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); Transform3D GMaxisOfPos = new Transform3D(); GMaxisOfPos.set(new Vector3f(0.0f,1.0f,0.0f)); tjoInterpolator gmSinger = new tjoInterpolator(alpha, GMsingAlong, GMaxisOfPos, gknots, GMpoints); gmSinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmZonlySinger = new tjoInterpolator(alpha, GMzOnly_singAlong, GMaxisOfPos, gknots, GMzOnly); gmZonlySinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmNonlySinger = new tjoInterpolator(alpha, GMnOnly_singAlong, GMaxisOfPos, gknots, GMnOnly); gmNonlySinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmEonlySinger = new tjoInterpolator(alpha, GMeOnly_singAlong, GMaxisOfPos, gknots, GMeOnly); gmEonlySinger.setSchedulingBounds(new BoundingSphere()); TransformGroup objPlace3D = new TransformGroup(PlaceCoordSystem); TransformGroup objPlaceSurf = new TransformGroup(PlaceSurface); Background background = new Background(); background.setColor(0.6f, 0.6f, 0.6f); background.setApplicationBounds(new BoundingSphere()); objRoot.addChild(background); objPlace3D.addChild(Axes); objPlace3D.addChild(Motion); objRoot.addChild(objPlace3D); objPlaceSurf.addChild(Surface); objRoot.addChild(objPlaceSurf); /* objPlaceAxesText.addChild(AxesText); objRoot.addChild(objPlaceAxesText); */ objRoot.addChild(Trace); objRoot.addChild(ZsingAlong); objRoot.addChild(zSinger); Appearance zSphere = new Appearance(); ColoringAttributes zCA = new ColoringAttributes(); zCA.setColor(1.0f,0.0f,0.0f); zSphere.setColoringAttributes(zCA); ZsingAlong.addChild(new Sphere(0.02f,zSphere)); objRoot.addChild(NsingAlong); objRoot.addChild(nSinger); Appearance nSphere = new Appearance(); ColoringAttributes nCA = new ColoringAttributes(); nCA.setColor(0.0f,0.0f,1.0f); nSphere.setColoringAttributes(nCA); NsingAlong.addChild(new Sphere(0.02f,nSphere)); objRoot.addChild(EsingAlong); objRoot.addChild(eSinger); Appearance eSphere = new Appearance(); ColoringAttributes eCA = new ColoringAttributes(); eCA.setColor(0.0f,1.0f,0.0f); eSphere.setColoringAttributes(eCA); EsingAlong.addChild(new Sphere(0.02f,eSphere)); objRoot.addChild(GMzOnly_singAlong); objRoot.addChild(gmZonlySinger); Appearance gmZonlySphere = new Appearance(); ColoringAttributes gmZonlyCA = new ColoringAttributes(); gmZonlyCA.setColor(1.0f,0.0f,0.0f); gmZonlySphere.setColoringAttributes(gmZonlyCA); GMzOnly_singAlong.addChild(new Sphere(0.015f,gmZonlySphere)); objRoot.addChild(GMnOnly_singAlong); objRoot.addChild(gmNonlySinger); Appearance gmNonlySphere = new Appearance(); ColoringAttributes gmNonlyCA = new ColoringAttributes(); gmNonlyCA.setColor(0.0f,0.0f,1.0f); gmNonlySphere.setColoringAttributes(gmNonlyCA); GMnOnly_singAlong.addChild(new Sphere(0.015f,gmNonlySphere)); objRoot.addChild(GMeOnly_singAlong); objRoot.addChild(gmEonlySinger); Appearance gmEonlySphere = new Appearance(); ColoringAttributes gmEonlyCA = new ColoringAttributes(); gmEonlyCA.setColor(0.0f,1.0f,0.0f); gmEonlySphere.setColoringAttributes(gmEonlyCA); GMeOnly_singAlong.addChild(new Sphere(0.015f,gmEonlySphere)); objRoot.addChild(GMsingAlong); objRoot.addChild(gmSinger); Appearance gmSphere = new Appearance(); ColoringAttributes gmCA = new ColoringAttributes(); gmCA.setColor(0.4f,0.2f,0.2f); gmSphere.setColoringAttributes(gmCA); GMsingAlong.addChild(new Sphere(0.02f,gmSphere)); // Let Java 3D perform optimizations on this scene graph. objRoot.compile(); //System.out.println("returning from CreaetScene Graph"); return objRoot; } // end of CreateSceneGraph method
|
public BranchGroup createSceneGraph(float baz, float ang) { BranchGroup objRoot = new BranchGroup(); BranchGroup Axes = new Axis().getAxisBG(); BranchGroup Surface = new Axis().getSurfaceBG(); BranchGroup Motion = new MotionVector(baz,ang).getMotionBG(); BranchGroup Trace = new Traces(baz,ang).getTraceBG(); Transform3D rotateX = new Transform3D(); Transform3D rotateY = new Transform3D(); Transform3D rotateZ = new Transform3D(); double zRotation = 90.0d; double xRotation = -135.0d; double yRotation = -45.0d; rotateX.rotX(Math.toRadians(xRotation)); rotateZ.rotZ(Math.toRadians(zRotation)); rotateY.rotY(Math.toRadians(yRotation)); Transform3D rotate = new Transform3D(); Transform3D shift = new Transform3D(); Transform3D scale = new Transform3D(); Transform3D PlaceCoordSystem = new Transform3D(); rotate.mul(rotateZ); rotate.mul(rotateY); rotate.mul(rotateX); scale.setScale(0.5d); shift.setTranslation(new Vector3f(0.0f,0.4f,0.00f)); PlaceCoordSystem.mul(shift); PlaceCoordSystem.mul(rotate); PlaceCoordSystem.mul(scale); Transform3D SurfShift = new Transform3D(); SurfShift.setTranslation(new Vector3f(0.0f,0.36f,0.00f)); Transform3D PlaceSurface = new Transform3D(); PlaceSurface.mul(SurfShift); PlaceSurface.mul(rotate); PlaceSurface.mul(scale); /* Text is placed in the global coordinate sytem at locations transformed by the PlaceCoordSystem object. This keeps them facing the viewer, but in the proper location. */ Point3f textpt = new Point3f(1.0f,0.0f,0.0f); PlaceCoordSystem.transform(textpt); Text2D up = new Text2D("Up", textpt, new Color3f(1.0f, 0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(up); textpt = new Point3f(-1.2f,0.0f,0.0f); PlaceCoordSystem.transform(textpt); Text2D down = new Text2D("Down", textpt, new Color3f(1.0f, 0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(down); textpt = new Point3f(0.0f,1.2f,0.0f); PlaceCoordSystem.transform(textpt); Text2D east = new Text2D("East", textpt, new Color3f(0f, 1.0f, 0.2f), "Helvetica", 16, Font.BOLD); objRoot.addChild(east); textpt = new Point3f(0.0f,-1.2f,0.2f); PlaceCoordSystem.transform(textpt); Text2D west = new Text2D("West", textpt, new Color3f(0f, 1.0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(west); textpt = new Point3f(0.0f,0.0f,1.1f); PlaceCoordSystem.transform(textpt); Text2D north = new Text2D("North", textpt, new Color3f(0f, 0f, 1.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(north); textpt = new Point3f(0.0f,0.0f,-1.2f); PlaceCoordSystem.transform(textpt); Text2D south = new Text2D("South", textpt, new Color3f(0f, 0f, 1.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(south); textpt = new Point3f(-1.2f,-1.4f,-1.0f); Text2D caption = new Text2D("Press and Hold any key to start animation", textpt, new Color3f(0f, 0f, 0.0f), "TimesRoman", 24, Font.BOLD); objRoot.addChild(caption); /* * Set up the animation of the traces */ Alpha alpha = new Alpha(-1, 4000); TransformGroup ZsingAlong = new TransformGroup(); Transform3D ZaxisOfPos = new Transform3D(); ZaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); ZsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup NsingAlong = new TransformGroup(); Transform3D NaxisOfPos = new Transform3D(); NaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); NsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup EsingAlong = new TransformGroup(); Transform3D EaxisOfPos = new Transform3D(); EaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); EsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); int nknots = new Traces(baz,ang).getNumberOfPoints(); Point3f zSing[] = new Point3f[nknots]; Point3f eSing[] = new Point3f[nknots]; Point3f nSing[] = new Point3f[nknots]; float knots[] = new float[nknots]; float zknots[] = new float[nknots]; float knotInc = 1.0f/(nknots-1); int i = 0; while (i < nknots) { knots[i] = i*knotInc; zknots[i] = i*knotInc; i++; } new Traces(baz,ang).getSingAlongPoints(zSing,nSing,eSing); //System.out.println("before tjo interpolator"); tjoInterpolator nSinger = new tjoInterpolator(alpha, NsingAlong, NaxisOfPos, knots, nSing); //System.out.println("after tjo interpolator"); nSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); //System.out.println("before tjo interpolator"); tjoInterpolator eSinger = new tjoInterpolator(alpha, EsingAlong, EaxisOfPos, knots, eSing); //System.out.println("after tjo interpolator"); eSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); //System.out.println("before tjo interpolator"); tjoInterpolator zSinger = new tjoInterpolator(alpha, ZsingAlong, ZaxisOfPos, knots, zSing); //System.out.println("after tjo interpolator"); zSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); int GMknots = 41; Point3f GMpoints[] = new Point3f[41]; Point3f GMzOnly[] = new Point3f[41]; Point3f GMeOnly[] = new Point3f[41]; Point3f GMnOnly[] = new Point3f[41]; new MotionVector(baz,ang).getMotionPoints(GMpoints); float gknots[] = new float[GMknots]; float gnotInc = 1.0f/(GMknots-1); i = 0; while (i < GMknots) { gknots[i] = i*gnotInc; // //System.out.println("GM " + i + " " + GMpoints[i]); float t[] = new float[3]; GMpoints[i].get(t); GMzOnly[i]=new Point3f(t[0],0.0f,0.0f); GMeOnly[i]=new Point3f(0.0f,t[1],0.0f); GMnOnly[i]=new Point3f(0.0f,0.0f,t[2]); PlaceCoordSystem.transform(GMpoints[i]); PlaceCoordSystem.transform(GMzOnly[i]); PlaceCoordSystem.transform(GMeOnly[i]); PlaceCoordSystem.transform(GMnOnly[i]); i++; } TransformGroup GMsingAlong = new TransformGroup(); GMsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMzOnly_singAlong = new TransformGroup(); GMzOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMnOnly_singAlong = new TransformGroup(); GMnOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMeOnly_singAlong = new TransformGroup(); GMeOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); Transform3D GMaxisOfPos = new Transform3D(); GMaxisOfPos.set(new Vector3f(0.0f,1.0f,0.0f)); tjoInterpolator gmSinger = new tjoInterpolator(alpha, GMsingAlong, GMaxisOfPos, gknots, GMpoints); gmSinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmZonlySinger = new tjoInterpolator(alpha, GMzOnly_singAlong, GMaxisOfPos, gknots, GMzOnly); gmZonlySinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmNonlySinger = new tjoInterpolator(alpha, GMnOnly_singAlong, GMaxisOfPos, gknots, GMnOnly); gmNonlySinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmEonlySinger = new tjoInterpolator(alpha, GMeOnly_singAlong, GMaxisOfPos, gknots, GMeOnly); gmEonlySinger.setSchedulingBounds(new BoundingSphere()); TransformGroup objPlace3D = new TransformGroup(PlaceCoordSystem); TransformGroup objPlaceSurf = new TransformGroup(PlaceSurface); Background background = new Background(); background.setColor(0.6f, 0.6f, 0.6f); background.setApplicationBounds(new BoundingSphere()); objRoot.addChild(background); objPlace3D.addChild(Axes); objPlace3D.addChild(Motion); objRoot.addChild(objPlace3D); objPlaceSurf.addChild(Surface); objRoot.addChild(objPlaceSurf); /* objPlaceAxesText.addChild(AxesText); objRoot.addChild(objPlaceAxesText); */ objRoot.addChild(Trace); objRoot.addChild(ZsingAlong); objRoot.addChild(zSinger); Appearance zSphere = new Appearance(); ColoringAttributes zCA = new ColoringAttributes(); zCA.setColor(1.0f,0.0f,0.0f); zSphere.setColoringAttributes(zCA); ZsingAlong.addChild(new Sphere(0.02f,zSphere)); objRoot.addChild(NsingAlong); objRoot.addChild(nSinger); Appearance nSphere = new Appearance(); ColoringAttributes nCA = new ColoringAttributes(); nCA.setColor(0.0f,0.0f,1.0f); nSphere.setColoringAttributes(nCA); NsingAlong.addChild(new Sphere(0.02f,nSphere)); objRoot.addChild(EsingAlong); objRoot.addChild(eSinger); Appearance eSphere = new Appearance(); ColoringAttributes eCA = new ColoringAttributes(); eCA.setColor(0.0f,1.0f,0.0f); eSphere.setColoringAttributes(eCA); EsingAlong.addChild(new Sphere(0.02f,eSphere)); objRoot.addChild(GMzOnly_singAlong); objRoot.addChild(gmZonlySinger); Appearance gmZonlySphere = new Appearance(); ColoringAttributes gmZonlyCA = new ColoringAttributes(); gmZonlyCA.setColor(1.0f,0.0f,0.0f); gmZonlySphere.setColoringAttributes(gmZonlyCA); GMzOnly_singAlong.addChild(new Sphere(0.015f,gmZonlySphere)); objRoot.addChild(GMnOnly_singAlong); objRoot.addChild(gmNonlySinger); Appearance gmNonlySphere = new Appearance(); ColoringAttributes gmNonlyCA = new ColoringAttributes(); gmNonlyCA.setColor(0.0f,0.0f,1.0f); gmNonlySphere.setColoringAttributes(gmNonlyCA); GMnOnly_singAlong.addChild(new Sphere(0.015f,gmNonlySphere)); objRoot.addChild(GMeOnly_singAlong); objRoot.addChild(gmEonlySinger); Appearance gmEonlySphere = new Appearance(); ColoringAttributes gmEonlyCA = new ColoringAttributes(); gmEonlyCA.setColor(0.0f,1.0f,0.0f); gmEonlySphere.setColoringAttributes(gmEonlyCA); GMeOnly_singAlong.addChild(new Sphere(0.015f,gmEonlySphere)); objRoot.addChild(GMsingAlong); objRoot.addChild(gmSinger); Appearance gmSphere = new Appearance(); ColoringAttributes gmCA = new ColoringAttributes(); gmCA.setColor(0.4f,0.2f,0.2f); gmSphere.setColoringAttributes(gmCA); GMsingAlong.addChild(new Sphere(0.02f,gmSphere)); // Let Java 3D perform optimizations on this scene graph. objRoot.compile(); //System.out.println("returning from CreaetScene Graph"); return objRoot; } // end of CreateSceneGraph method
| 1,118,293
|
public BranchGroup createSceneGraph(float baz, float ang) { BranchGroup objRoot = new BranchGroup(); BranchGroup Axes = new Axis().getAxisBG(); BranchGroup Surface = new Axis().getSurfaceBG(); BranchGroup Motion = new MotionVector(baz,ang).getMotionBG(); BranchGroup Trace = new Traces(baz,ang).getTraceBG(); Transform3D rotateX = new Transform3D(); Transform3D rotateY = new Transform3D(); Transform3D rotateZ = new Transform3D(); double zRotation = 90.0d; double xRotation = -135.0d; double yRotation = -45.0d; rotateX.rotX(Math.toRadians(xRotation)); rotateZ.rotZ(Math.toRadians(zRotation)); rotateY.rotY(Math.toRadians(yRotation)); Transform3D rotate = new Transform3D(); Transform3D shift = new Transform3D(); Transform3D scale = new Transform3D(); Transform3D PlaceCoordSystem = new Transform3D(); rotate.mul(rotateZ); rotate.mul(rotateY); rotate.mul(rotateX); scale.setScale(0.5d); shift.setTranslation(new Vector3f(0.0f,0.4f,0.00f)); PlaceCoordSystem.mul(shift); PlaceCoordSystem.mul(rotate); PlaceCoordSystem.mul(scale); Transform3D SurfShift = new Transform3D(); SurfShift.setTranslation(new Vector3f(0.0f,0.36f,0.00f)); Transform3D PlaceSurface = new Transform3D(); PlaceSurface.mul(SurfShift); PlaceSurface.mul(rotate); PlaceSurface.mul(scale); /* Text is placed in the global coordinate sytem at locations transformed by the PlaceCoordSystem object. This keeps them facing the viewer, but in the proper location. */ Point3f textpt = new Point3f(1.0f,0.0f,0.0f); PlaceCoordSystem.transform(textpt); Text2D up = new Text2D("Up", textpt, new Color3f(1.0f, 0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(up); textpt = new Point3f(-1.2f,0.0f,0.0f); PlaceCoordSystem.transform(textpt); Text2D down = new Text2D("Down", textpt, new Color3f(1.0f, 0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(down); textpt = new Point3f(0.0f,1.2f,0.0f); PlaceCoordSystem.transform(textpt); Text2D east = new Text2D("East", textpt, new Color3f(0f, 1.0f, 0.2f), "Helvetica", 16, Font.BOLD); objRoot.addChild(east); textpt = new Point3f(0.0f,-1.2f,0.2f); PlaceCoordSystem.transform(textpt); Text2D west = new Text2D("West", textpt, new Color3f(0f, 1.0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(west); textpt = new Point3f(0.0f,0.0f,1.1f); PlaceCoordSystem.transform(textpt); Text2D north = new Text2D("North", textpt, new Color3f(0f, 0f, 1.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(north); textpt = new Point3f(0.0f,0.0f,-1.2f); PlaceCoordSystem.transform(textpt); Text2D south = new Text2D("South", textpt, new Color3f(0f, 0f, 1.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(south); textpt = new Point3f(-1.2f,-1.4f,-1.0f); Text2D caption = new Text2D("Press and Hold any key to start animation", textpt, new Color3f(0f, 0f, 0.0f), "TimesRoman", 24, Font.BOLD); objRoot.addChild(caption); /* Set up the animation of the traces */ Alpha alpha = new Alpha(-1, 4000); TransformGroup ZsingAlong = new TransformGroup(); Transform3D ZaxisOfPos = new Transform3D(); ZaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); ZsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup NsingAlong = new TransformGroup(); Transform3D NaxisOfPos = new Transform3D(); NaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); NsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup EsingAlong = new TransformGroup(); Transform3D EaxisOfPos = new Transform3D(); EaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); EsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); int nknots = new Traces(baz,ang).getNumberOfPoints(); Point3f zSing[] = new Point3f[nknots]; Point3f eSing[] = new Point3f[nknots]; Point3f nSing[] = new Point3f[nknots]; float knots[] = new float[nknots]; float zknots[] = new float[nknots]; float knotInc = 1.0f/(nknots-1); int i = 0; while (i < nknots) { knots[i] = i*knotInc; zknots[i] = i*knotInc; i++; } new Traces(baz,ang).getSingAlongPoints(zSing,nSing,eSing); //System.out.println("before tjo interpolator"); tjoInterpolator nSinger = new tjoInterpolator(alpha, NsingAlong, NaxisOfPos, knots, nSing); //System.out.println("after tjo interpolator"); nSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); //System.out.println("before tjo interpolator"); tjoInterpolator eSinger = new tjoInterpolator(alpha, EsingAlong, EaxisOfPos, knots, eSing); //System.out.println("after tjo interpolator"); eSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); //System.out.println("before tjo interpolator"); tjoInterpolator zSinger = new tjoInterpolator(alpha, ZsingAlong, ZaxisOfPos, knots, zSing); //System.out.println("after tjo interpolator"); zSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); int GMknots = 41; Point3f GMpoints[] = new Point3f[41]; Point3f GMzOnly[] = new Point3f[41]; Point3f GMeOnly[] = new Point3f[41]; Point3f GMnOnly[] = new Point3f[41]; new MotionVector(baz,ang).getMotionPoints(GMpoints); float gknots[] = new float[GMknots]; float gnotInc = 1.0f/(GMknots-1); i = 0; while (i < GMknots) { gknots[i] = i*gnotInc; // //System.out.println("GM " + i + " " + GMpoints[i]); float t[] = new float[3]; GMpoints[i].get(t); GMzOnly[i]=new Point3f(t[0],0.0f,0.0f); GMeOnly[i]=new Point3f(0.0f,t[1],0.0f); GMnOnly[i]=new Point3f(0.0f,0.0f,t[2]); PlaceCoordSystem.transform(GMpoints[i]); PlaceCoordSystem.transform(GMzOnly[i]); PlaceCoordSystem.transform(GMeOnly[i]); PlaceCoordSystem.transform(GMnOnly[i]); i++; } TransformGroup GMsingAlong = new TransformGroup(); GMsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMzOnly_singAlong = new TransformGroup(); GMzOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMnOnly_singAlong = new TransformGroup(); GMnOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMeOnly_singAlong = new TransformGroup(); GMeOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); Transform3D GMaxisOfPos = new Transform3D(); GMaxisOfPos.set(new Vector3f(0.0f,1.0f,0.0f)); tjoInterpolator gmSinger = new tjoInterpolator(alpha, GMsingAlong, GMaxisOfPos, gknots, GMpoints); gmSinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmZonlySinger = new tjoInterpolator(alpha, GMzOnly_singAlong, GMaxisOfPos, gknots, GMzOnly); gmZonlySinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmNonlySinger = new tjoInterpolator(alpha, GMnOnly_singAlong, GMaxisOfPos, gknots, GMnOnly); gmNonlySinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmEonlySinger = new tjoInterpolator(alpha, GMeOnly_singAlong, GMaxisOfPos, gknots, GMeOnly); gmEonlySinger.setSchedulingBounds(new BoundingSphere()); TransformGroup objPlace3D = new TransformGroup(PlaceCoordSystem); TransformGroup objPlaceSurf = new TransformGroup(PlaceSurface); Background background = new Background(); background.setColor(0.6f, 0.6f, 0.6f); background.setApplicationBounds(new BoundingSphere()); objRoot.addChild(background); objPlace3D.addChild(Axes); objPlace3D.addChild(Motion); objRoot.addChild(objPlace3D); objPlaceSurf.addChild(Surface); objRoot.addChild(objPlaceSurf); /* objPlaceAxesText.addChild(AxesText); objRoot.addChild(objPlaceAxesText); */ objRoot.addChild(Trace); objRoot.addChild(ZsingAlong); objRoot.addChild(zSinger); Appearance zSphere = new Appearance(); ColoringAttributes zCA = new ColoringAttributes(); zCA.setColor(1.0f,0.0f,0.0f); zSphere.setColoringAttributes(zCA); ZsingAlong.addChild(new Sphere(0.02f,zSphere)); objRoot.addChild(NsingAlong); objRoot.addChild(nSinger); Appearance nSphere = new Appearance(); ColoringAttributes nCA = new ColoringAttributes(); nCA.setColor(0.0f,0.0f,1.0f); nSphere.setColoringAttributes(nCA); NsingAlong.addChild(new Sphere(0.02f,nSphere)); objRoot.addChild(EsingAlong); objRoot.addChild(eSinger); Appearance eSphere = new Appearance(); ColoringAttributes eCA = new ColoringAttributes(); eCA.setColor(0.0f,1.0f,0.0f); eSphere.setColoringAttributes(eCA); EsingAlong.addChild(new Sphere(0.02f,eSphere)); objRoot.addChild(GMzOnly_singAlong); objRoot.addChild(gmZonlySinger); Appearance gmZonlySphere = new Appearance(); ColoringAttributes gmZonlyCA = new ColoringAttributes(); gmZonlyCA.setColor(1.0f,0.0f,0.0f); gmZonlySphere.setColoringAttributes(gmZonlyCA); GMzOnly_singAlong.addChild(new Sphere(0.015f,gmZonlySphere)); objRoot.addChild(GMnOnly_singAlong); objRoot.addChild(gmNonlySinger); Appearance gmNonlySphere = new Appearance(); ColoringAttributes gmNonlyCA = new ColoringAttributes(); gmNonlyCA.setColor(0.0f,0.0f,1.0f); gmNonlySphere.setColoringAttributes(gmNonlyCA); GMnOnly_singAlong.addChild(new Sphere(0.015f,gmNonlySphere)); objRoot.addChild(GMeOnly_singAlong); objRoot.addChild(gmEonlySinger); Appearance gmEonlySphere = new Appearance(); ColoringAttributes gmEonlyCA = new ColoringAttributes(); gmEonlyCA.setColor(0.0f,1.0f,0.0f); gmEonlySphere.setColoringAttributes(gmEonlyCA); GMeOnly_singAlong.addChild(new Sphere(0.015f,gmEonlySphere)); objRoot.addChild(GMsingAlong); objRoot.addChild(gmSinger); Appearance gmSphere = new Appearance(); ColoringAttributes gmCA = new ColoringAttributes(); gmCA.setColor(0.4f,0.2f,0.2f); gmSphere.setColoringAttributes(gmCA); GMsingAlong.addChild(new Sphere(0.02f,gmSphere)); // Let Java 3D perform optimizations on this scene graph. objRoot.compile(); //System.out.println("returning from CreaetScene Graph"); return objRoot; } // end of CreateSceneGraph method
|
public BranchGroup createSceneGraph(float baz, float ang) { BranchGroup objRoot = new BranchGroup(); BranchGroup Axes = new Axis().getAxisBG(); BranchGroup Surface = new Axis().getSurfaceBG(); BranchGroup Motion = new MotionVector(baz,ang).getMotionBG(); BranchGroup Trace = new Traces(baz,ang).getTraceBG(); Transform3D rotateX = new Transform3D(); Transform3D rotateY = new Transform3D(); Transform3D rotateZ = new Transform3D(); double zRotation = 90.0d; double xRotation = -135.0d; double yRotation = -45.0d; rotateX.rotX(Math.toRadians(xRotation)); rotateZ.rotZ(Math.toRadians(zRotation)); rotateY.rotY(Math.toRadians(yRotation)); Transform3D rotate = new Transform3D(); Transform3D shift = new Transform3D(); Transform3D scale = new Transform3D(); Transform3D PlaceCoordSystem = new Transform3D(); rotate.mul(rotateZ); rotate.mul(rotateY); rotate.mul(rotateX); scale.setScale(0.5d); shift.setTranslation(new Vector3f(0.0f,0.4f,0.00f)); PlaceCoordSystem.mul(shift); PlaceCoordSystem.mul(rotate); PlaceCoordSystem.mul(scale); Transform3D SurfShift = new Transform3D(); SurfShift.setTranslation(new Vector3f(0.0f,0.36f,0.00f)); Transform3D PlaceSurface = new Transform3D(); PlaceSurface.mul(SurfShift); PlaceSurface.mul(rotate); PlaceSurface.mul(scale); /* Text is placed in the global coordinate sytem at locations transformed by the PlaceCoordSystem object. This keeps them facing the viewer, but in the proper location. */ Point3f textpt = new Point3f(1.0f,0.0f,0.0f); PlaceCoordSystem.transform(textpt); Text2D up = new Text2D("Up", textpt, new Color3f(1.0f, 0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(up); textpt = new Point3f(-1.2f,0.0f,0.0f); PlaceCoordSystem.transform(textpt); Text2D down = new Text2D("Down", textpt, new Color3f(1.0f, 0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(down); textpt = new Point3f(0.0f,1.2f,0.0f); PlaceCoordSystem.transform(textpt); Text2D east = new Text2D("East", textpt, new Color3f(0f, 1.0f, 0.2f), "Helvetica", 16, Font.BOLD); objRoot.addChild(east); textpt = new Point3f(0.0f,-1.2f,0.2f); PlaceCoordSystem.transform(textpt); Text2D west = new Text2D("West", textpt, new Color3f(0f, 1.0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(west); textpt = new Point3f(0.0f,0.0f,1.1f); PlaceCoordSystem.transform(textpt); Text2D north = new Text2D("North", textpt, new Color3f(0f, 0f, 1.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(north); textpt = new Point3f(0.0f,0.0f,-1.2f); PlaceCoordSystem.transform(textpt); Text2D south = new Text2D("South", textpt, new Color3f(0f, 0f, 1.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(south); textpt = new Point3f(-1.2f,-1.4f,-1.0f); Text2D caption = new Text2D("Press and Hold any key to start animation", textpt, new Color3f(0f, 0f, 0.0f), "TimesRoman", 24, Font.BOLD); objRoot.addChild(caption); /* Set up the animation of the traces */ Alpha alpha = new Alpha(-1, 4000); TransformGroup ZsingAlong = new TransformGroup(); Transform3D ZaxisOfPos = new Transform3D(); ZaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); ZsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup NsingAlong = new TransformGroup(); Transform3D NaxisOfPos = new Transform3D(); NaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); NsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup EsingAlong = new TransformGroup(); Transform3D EaxisOfPos = new Transform3D(); EaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); EsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); int nknots = new Traces(baz,ang).getNumberOfPoints(); Point3f zSing[] = new Point3f[nknots]; Point3f eSing[] = new Point3f[nknots]; Point3f nSing[] = new Point3f[nknots]; float knots[] = new float[nknots]; float zknots[] = new float[nknots]; float knotInc = 1.0f/(nknots-1); int i = 0; while (i < nknots) { knots[i] = i*knotInc; zknots[i] = i*knotInc; i++; } new Traces(baz,ang).getSingAlongPoints(zSing,nSing,eSing); //System.out.println("before tjo interpolator"); tjoInterpolator nSinger = new tjoInterpolator(alpha, NsingAlong, NaxisOfPos, knots, nSing); //System.out.println("after tjo interpolator"); nSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); //System.out.println("before tjo interpolator"); tjoInterpolator eSinger = new tjoInterpolator(alpha, EsingAlong, EaxisOfPos, knots, eSing); //System.out.println("after tjo interpolator"); eSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); //System.out.println("before tjo interpolator"); tjoInterpolator zSinger = new tjoInterpolator(alpha, ZsingAlong, ZaxisOfPos, knots, zSing); //System.out.println("after tjo interpolator"); zSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); int GMknots = 41; Point3f GMpoints[] = new Point3f[41]; Point3f GMzOnly[] = new Point3f[41]; Point3f GMeOnly[] = new Point3f[41]; Point3f GMnOnly[] = new Point3f[41]; new MotionVector(baz,ang).getMotionPoints(GMpoints); float gknots[] = new float[GMknots]; float gnotInc = 1.0f/(GMknots-1); i = 0; while (i < GMknots) { gknots[i] = i*gnotInc; // //System.out.println("GM " + i + " " + GMpoints[i]); float t[] = new float[3]; GMpoints[i].get(t); GMzOnly[i]=new Point3f(t[0],0.0f,0.0f); GMeOnly[i]=new Point3f(0.0f,t[1],0.0f); GMnOnly[i]=new Point3f(0.0f,0.0f,t[2]); PlaceCoordSystem.transform(GMpoints[i]); PlaceCoordSystem.transform(GMzOnly[i]); PlaceCoordSystem.transform(GMeOnly[i]); PlaceCoordSystem.transform(GMnOnly[i]); i++; } TransformGroup GMsingAlong = new TransformGroup(); GMsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMzOnly_singAlong = new TransformGroup(); GMzOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMnOnly_singAlong = new TransformGroup(); GMnOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMeOnly_singAlong = new TransformGroup(); GMeOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); Transform3D GMaxisOfPos = new Transform3D(); GMaxisOfPos.set(new Vector3f(0.0f,1.0f,0.0f)); tjoInterpolator gmSinger = new tjoInterpolator(alpha, GMsingAlong, GMaxisOfPos, gknots, GMpoints); gmSinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmZonlySinger = new tjoInterpolator(alpha, GMzOnly_singAlong, GMaxisOfPos, gknots, GMzOnly); gmZonlySinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmNonlySinger = new tjoInterpolator(alpha, GMnOnly_singAlong, GMaxisOfPos, gknots, GMnOnly); gmNonlySinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmEonlySinger = new tjoInterpolator(alpha, GMeOnly_singAlong, GMaxisOfPos, gknots, GMeOnly); gmEonlySinger.setSchedulingBounds(new BoundingSphere()); TransformGroup objPlace3D = new TransformGroup(PlaceCoordSystem); TransformGroup objPlaceSurf = new TransformGroup(PlaceSurface); Background background = new Background(); background.setColor(0.6f, 0.6f, 0.6f); background.setApplicationBounds(new BoundingSphere()); objRoot.addChild(background); objPlace3D.addChild(Axes); objPlace3D.addChild(Motion); objRoot.addChild(objPlace3D); objPlaceSurf.addChild(Surface); objRoot.addChild(objPlaceSurf); /* objPlaceAxesText.addChild(AxesText); objRoot.addChild(objPlaceAxesText); */ objRoot.addChild(Trace); objRoot.addChild(ZsingAlong); objRoot.addChild(zSinger); Appearance zSphere = new Appearance(); ColoringAttributes zCA = new ColoringAttributes(); zCA.setColor(1.0f,0.0f,0.0f); zSphere.setColoringAttributes(zCA); ZsingAlong.addChild(new Sphere(0.02f,zSphere)); objRoot.addChild(NsingAlong); objRoot.addChild(nSinger); Appearance nSphere = new Appearance(); ColoringAttributes nCA = new ColoringAttributes(); nCA.setColor(0.0f,0.0f,1.0f); nSphere.setColoringAttributes(nCA); NsingAlong.addChild(new Sphere(0.02f,nSphere)); objRoot.addChild(EsingAlong); objRoot.addChild(eSinger); Appearance eSphere = new Appearance(); ColoringAttributes eCA = new ColoringAttributes(); eCA.setColor(0.0f,1.0f,0.0f); eSphere.setColoringAttributes(eCA); EsingAlong.addChild(new Sphere(0.02f,eSphere)); objRoot.addChild(GMzOnly_singAlong); objRoot.addChild(gmZonlySinger); Appearance gmZonlySphere = new Appearance(); ColoringAttributes gmZonlyCA = new ColoringAttributes(); gmZonlyCA.setColor(1.0f,0.0f,0.0f); gmZonlySphere.setColoringAttributes(gmZonlyCA); GMzOnly_singAlong.addChild(new Sphere(0.015f,gmZonlySphere)); objRoot.addChild(GMnOnly_singAlong); objRoot.addChild(gmNonlySinger); Appearance gmNonlySphere = new Appearance(); ColoringAttributes gmNonlyCA = new ColoringAttributes(); gmNonlyCA.setColor(0.0f,0.0f,1.0f); gmNonlySphere.setColoringAttributes(gmNonlyCA); GMnOnly_singAlong.addChild(new Sphere(0.015f,gmNonlySphere)); objRoot.addChild(GMeOnly_singAlong); objRoot.addChild(gmEonlySinger); Appearance gmEonlySphere = new Appearance(); ColoringAttributes gmEonlyCA = new ColoringAttributes(); gmEonlyCA.setColor(0.0f,1.0f,0.0f); gmEonlySphere.setColoringAttributes(gmEonlyCA); GMeOnly_singAlong.addChild(new Sphere(0.015f,gmEonlySphere)); objRoot.addChild(GMsingAlong); objRoot.addChild(gmSinger); Appearance gmSphere = new Appearance(); ColoringAttributes gmCA = new ColoringAttributes(); gmCA.setColor(0.4f,0.2f,0.2f); gmSphere.setColoringAttributes(gmCA); GMsingAlong.addChild(new Sphere(0.02f,gmSphere)); // Let Java 3D perform optimizations on this scene graph. objRoot.compile(); //System.out.println("returning from CreaetScene Graph"); return objRoot; } // end of CreateSceneGraph method
| 1,118,294
|
public BranchGroup createSceneGraph(float baz, float ang) { BranchGroup objRoot = new BranchGroup(); BranchGroup Axes = new Axis().getAxisBG(); BranchGroup Surface = new Axis().getSurfaceBG(); BranchGroup Motion = new MotionVector(baz,ang).getMotionBG(); BranchGroup Trace = new Traces(baz,ang).getTraceBG(); Transform3D rotateX = new Transform3D(); Transform3D rotateY = new Transform3D(); Transform3D rotateZ = new Transform3D(); double zRotation = 90.0d; double xRotation = -135.0d; double yRotation = -45.0d; rotateX.rotX(Math.toRadians(xRotation)); rotateZ.rotZ(Math.toRadians(zRotation)); rotateY.rotY(Math.toRadians(yRotation)); Transform3D rotate = new Transform3D(); Transform3D shift = new Transform3D(); Transform3D scale = new Transform3D(); Transform3D PlaceCoordSystem = new Transform3D(); rotate.mul(rotateZ); rotate.mul(rotateY); rotate.mul(rotateX); scale.setScale(0.5d); shift.setTranslation(new Vector3f(0.0f,0.4f,0.00f)); PlaceCoordSystem.mul(shift); PlaceCoordSystem.mul(rotate); PlaceCoordSystem.mul(scale); Transform3D SurfShift = new Transform3D(); SurfShift.setTranslation(new Vector3f(0.0f,0.36f,0.00f)); Transform3D PlaceSurface = new Transform3D(); PlaceSurface.mul(SurfShift); PlaceSurface.mul(rotate); PlaceSurface.mul(scale); /* Text is placed in the global coordinate sytem at locations transformed by the PlaceCoordSystem object. This keeps them facing the viewer, but in the proper location. */ Point3f textpt = new Point3f(1.0f,0.0f,0.0f); PlaceCoordSystem.transform(textpt); Text2D up = new Text2D("Up", textpt, new Color3f(1.0f, 0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(up); textpt = new Point3f(-1.2f,0.0f,0.0f); PlaceCoordSystem.transform(textpt); Text2D down = new Text2D("Down", textpt, new Color3f(1.0f, 0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(down); textpt = new Point3f(0.0f,1.2f,0.0f); PlaceCoordSystem.transform(textpt); Text2D east = new Text2D("East", textpt, new Color3f(0f, 1.0f, 0.2f), "Helvetica", 16, Font.BOLD); objRoot.addChild(east); textpt = new Point3f(0.0f,-1.2f,0.2f); PlaceCoordSystem.transform(textpt); Text2D west = new Text2D("West", textpt, new Color3f(0f, 1.0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(west); textpt = new Point3f(0.0f,0.0f,1.1f); PlaceCoordSystem.transform(textpt); Text2D north = new Text2D("North", textpt, new Color3f(0f, 0f, 1.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(north); textpt = new Point3f(0.0f,0.0f,-1.2f); PlaceCoordSystem.transform(textpt); Text2D south = new Text2D("South", textpt, new Color3f(0f, 0f, 1.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(south); textpt = new Point3f(-1.2f,-1.4f,-1.0f); Text2D caption = new Text2D("Press and Hold any key to start animation", textpt, new Color3f(0f, 0f, 0.0f), "TimesRoman", 24, Font.BOLD); objRoot.addChild(caption); /* Set up the animation of the traces */ Alpha alpha = new Alpha(-1, 4000); TransformGroup ZsingAlong = new TransformGroup(); Transform3D ZaxisOfPos = new Transform3D(); ZaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); ZsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup NsingAlong = new TransformGroup(); Transform3D NaxisOfPos = new Transform3D(); NaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); NsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup EsingAlong = new TransformGroup(); Transform3D EaxisOfPos = new Transform3D(); EaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); EsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); int nknots = new Traces(baz,ang).getNumberOfPoints(); Point3f zSing[] = new Point3f[nknots]; Point3f eSing[] = new Point3f[nknots]; Point3f nSing[] = new Point3f[nknots]; float knots[] = new float[nknots]; float zknots[] = new float[nknots]; float knotInc = 1.0f/(nknots-1); int i = 0; while (i < nknots) { knots[i] = i*knotInc; zknots[i] = i*knotInc; i++; } new Traces(baz,ang).getSingAlongPoints(zSing,nSing,eSing); //System.out.println("before tjo interpolator"); tjoInterpolator nSinger = new tjoInterpolator(alpha, NsingAlong, NaxisOfPos, knots, nSing); //System.out.println("after tjo interpolator"); nSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); //System.out.println("before tjo interpolator"); tjoInterpolator eSinger = new tjoInterpolator(alpha, EsingAlong, EaxisOfPos, knots, eSing); //System.out.println("after tjo interpolator"); eSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); //System.out.println("before tjo interpolator"); tjoInterpolator zSinger = new tjoInterpolator(alpha, ZsingAlong, ZaxisOfPos, knots, zSing); //System.out.println("after tjo interpolator"); zSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); int GMknots = 41; Point3f GMpoints[] = new Point3f[41]; Point3f GMzOnly[] = new Point3f[41]; Point3f GMeOnly[] = new Point3f[41]; Point3f GMnOnly[] = new Point3f[41]; new MotionVector(baz,ang).getMotionPoints(GMpoints); float gknots[] = new float[GMknots]; float gnotInc = 1.0f/(GMknots-1); i = 0; while (i < GMknots) { gknots[i] = i*gnotInc; // //System.out.println("GM " + i + " " + GMpoints[i]); float t[] = new float[3]; GMpoints[i].get(t); GMzOnly[i]=new Point3f(t[0],0.0f,0.0f); GMeOnly[i]=new Point3f(0.0f,t[1],0.0f); GMnOnly[i]=new Point3f(0.0f,0.0f,t[2]); PlaceCoordSystem.transform(GMpoints[i]); PlaceCoordSystem.transform(GMzOnly[i]); PlaceCoordSystem.transform(GMeOnly[i]); PlaceCoordSystem.transform(GMnOnly[i]); i++; } TransformGroup GMsingAlong = new TransformGroup(); GMsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMzOnly_singAlong = new TransformGroup(); GMzOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMnOnly_singAlong = new TransformGroup(); GMnOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMeOnly_singAlong = new TransformGroup(); GMeOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); Transform3D GMaxisOfPos = new Transform3D(); GMaxisOfPos.set(new Vector3f(0.0f,1.0f,0.0f)); tjoInterpolator gmSinger = new tjoInterpolator(alpha, GMsingAlong, GMaxisOfPos, gknots, GMpoints); gmSinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmZonlySinger = new tjoInterpolator(alpha, GMzOnly_singAlong, GMaxisOfPos, gknots, GMzOnly); gmZonlySinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmNonlySinger = new tjoInterpolator(alpha, GMnOnly_singAlong, GMaxisOfPos, gknots, GMnOnly); gmNonlySinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmEonlySinger = new tjoInterpolator(alpha, GMeOnly_singAlong, GMaxisOfPos, gknots, GMeOnly); gmEonlySinger.setSchedulingBounds(new BoundingSphere()); TransformGroup objPlace3D = new TransformGroup(PlaceCoordSystem); TransformGroup objPlaceSurf = new TransformGroup(PlaceSurface); Background background = new Background(); background.setColor(0.6f, 0.6f, 0.6f); background.setApplicationBounds(new BoundingSphere()); objRoot.addChild(background); objPlace3D.addChild(Axes); objPlace3D.addChild(Motion); objRoot.addChild(objPlace3D); objPlaceSurf.addChild(Surface); objRoot.addChild(objPlaceSurf); /* objPlaceAxesText.addChild(AxesText); objRoot.addChild(objPlaceAxesText); */ objRoot.addChild(Trace); objRoot.addChild(ZsingAlong); objRoot.addChild(zSinger); Appearance zSphere = new Appearance(); ColoringAttributes zCA = new ColoringAttributes(); zCA.setColor(1.0f,0.0f,0.0f); zSphere.setColoringAttributes(zCA); ZsingAlong.addChild(new Sphere(0.02f,zSphere)); objRoot.addChild(NsingAlong); objRoot.addChild(nSinger); Appearance nSphere = new Appearance(); ColoringAttributes nCA = new ColoringAttributes(); nCA.setColor(0.0f,0.0f,1.0f); nSphere.setColoringAttributes(nCA); NsingAlong.addChild(new Sphere(0.02f,nSphere)); objRoot.addChild(EsingAlong); objRoot.addChild(eSinger); Appearance eSphere = new Appearance(); ColoringAttributes eCA = new ColoringAttributes(); eCA.setColor(0.0f,1.0f,0.0f); eSphere.setColoringAttributes(eCA); EsingAlong.addChild(new Sphere(0.02f,eSphere)); objRoot.addChild(GMzOnly_singAlong); objRoot.addChild(gmZonlySinger); Appearance gmZonlySphere = new Appearance(); ColoringAttributes gmZonlyCA = new ColoringAttributes(); gmZonlyCA.setColor(1.0f,0.0f,0.0f); gmZonlySphere.setColoringAttributes(gmZonlyCA); GMzOnly_singAlong.addChild(new Sphere(0.015f,gmZonlySphere)); objRoot.addChild(GMnOnly_singAlong); objRoot.addChild(gmNonlySinger); Appearance gmNonlySphere = new Appearance(); ColoringAttributes gmNonlyCA = new ColoringAttributes(); gmNonlyCA.setColor(0.0f,0.0f,1.0f); gmNonlySphere.setColoringAttributes(gmNonlyCA); GMnOnly_singAlong.addChild(new Sphere(0.015f,gmNonlySphere)); objRoot.addChild(GMeOnly_singAlong); objRoot.addChild(gmEonlySinger); Appearance gmEonlySphere = new Appearance(); ColoringAttributes gmEonlyCA = new ColoringAttributes(); gmEonlyCA.setColor(0.0f,1.0f,0.0f); gmEonlySphere.setColoringAttributes(gmEonlyCA); GMeOnly_singAlong.addChild(new Sphere(0.015f,gmEonlySphere)); objRoot.addChild(GMsingAlong); objRoot.addChild(gmSinger); Appearance gmSphere = new Appearance(); ColoringAttributes gmCA = new ColoringAttributes(); gmCA.setColor(0.4f,0.2f,0.2f); gmSphere.setColoringAttributes(gmCA); GMsingAlong.addChild(new Sphere(0.02f,gmSphere)); // Let Java 3D perform optimizations on this scene graph. objRoot.compile(); //System.out.println("returning from CreaetScene Graph"); return objRoot; } // end of CreateSceneGraph method
|
public BranchGroup createSceneGraph(float baz, float ang) { BranchGroup objRoot = new BranchGroup(); BranchGroup Axes = new Axis().getAxisBG(); BranchGroup Surface = new Axis().getSurfaceBG(); BranchGroup Motion = new MotionVector(baz,ang).getMotionBG(); BranchGroup Trace = new Traces(baz,ang).getTraceBG(); Transform3D rotateX = new Transform3D(); Transform3D rotateY = new Transform3D(); Transform3D rotateZ = new Transform3D(); double zRotation = 90.0d; double xRotation = -135.0d; double yRotation = -45.0d; rotateX.rotX(Math.toRadians(xRotation)); rotateZ.rotZ(Math.toRadians(zRotation)); rotateY.rotY(Math.toRadians(yRotation)); Transform3D rotate = new Transform3D(); Transform3D shift = new Transform3D(); Transform3D scale = new Transform3D(); Transform3D PlaceCoordSystem = new Transform3D(); rotate.mul(rotateZ); rotate.mul(rotateY); rotate.mul(rotateX); scale.setScale(0.5d); shift.setTranslation(new Vector3f(0.0f,0.4f,0.00f)); PlaceCoordSystem.mul(shift); PlaceCoordSystem.mul(rotate); PlaceCoordSystem.mul(scale); Transform3D SurfShift = new Transform3D(); SurfShift.setTranslation(new Vector3f(0.0f,0.36f,0.00f)); Transform3D PlaceSurface = new Transform3D(); PlaceSurface.mul(SurfShift); PlaceSurface.mul(rotate); PlaceSurface.mul(scale); /* Text is placed in the global coordinate sytem at locations transformed by the PlaceCoordSystem object. This keeps them facing the viewer, but in the proper location. */ Point3f textpt = new Point3f(1.0f,0.0f,0.0f); PlaceCoordSystem.transform(textpt); Text2D up = new Text2D("Up", textpt, new Color3f(1.0f, 0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(up); textpt = new Point3f(-1.2f,0.0f,0.0f); PlaceCoordSystem.transform(textpt); Text2D down = new Text2D("Down", textpt, new Color3f(1.0f, 0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(down); textpt = new Point3f(0.0f,1.2f,0.0f); PlaceCoordSystem.transform(textpt); Text2D east = new Text2D("East", textpt, new Color3f(0f, 1.0f, 0.2f), "Helvetica", 16, Font.BOLD); objRoot.addChild(east); textpt = new Point3f(0.0f,-1.2f,0.2f); PlaceCoordSystem.transform(textpt); Text2D west = new Text2D("West", textpt, new Color3f(0f, 1.0f, 0.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(west); textpt = new Point3f(0.0f,0.0f,1.1f); PlaceCoordSystem.transform(textpt); Text2D north = new Text2D("North", textpt, new Color3f(0f, 0f, 1.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(north); textpt = new Point3f(0.0f,0.0f,-1.2f); PlaceCoordSystem.transform(textpt); Text2D south = new Text2D("South", textpt, new Color3f(0f, 0f, 1.0f), "Helvetica", 16, Font.BOLD); objRoot.addChild(south); textpt = new Point3f(-1.2f,-1.4f,-1.0f); Text2D caption = new Text2D("Press and Hold any key to start animation", textpt, new Color3f(0f, 0f, 0.0f), "TimesRoman", 24, Font.BOLD); objRoot.addChild(caption); /* Set up the animation of the traces */ Alpha alpha = new Alpha(-1, 4000); TransformGroup ZsingAlong = new TransformGroup(); Transform3D ZaxisOfPos = new Transform3D(); ZaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); ZsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup NsingAlong = new TransformGroup(); Transform3D NaxisOfPos = new Transform3D(); NaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); NsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup EsingAlong = new TransformGroup(); Transform3D EaxisOfPos = new Transform3D(); EaxisOfPos.set(new Vector3f(1.0f,0.0f,0.0f)); EsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); int nknots = new Traces(baz,ang).getNumberOfPoints(); Point3f zSing[] = new Point3f[nknots]; Point3f eSing[] = new Point3f[nknots]; Point3f nSing[] = new Point3f[nknots]; float knots[] = new float[nknots]; float zknots[] = new float[nknots]; float knotInc = 1.0f/(nknots-1); int i = 0; while (i < nknots) { knots[i] = i*knotInc; zknots[i] = i*knotInc; } new Traces(baz,ang).getSingAlongPoints(zSing,nSing,eSing); //System.out.println("before tjo interpolator"); tjoInterpolator nSinger = new tjoInterpolator(alpha, NsingAlong, NaxisOfPos, knots, nSing); //System.out.println("after tjo interpolator"); nSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); //System.out.println("before tjo interpolator"); tjoInterpolator eSinger = new tjoInterpolator(alpha, EsingAlong, EaxisOfPos, knots, eSing); //System.out.println("after tjo interpolator"); eSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); //System.out.println("before tjo interpolator"); tjoInterpolator zSinger = new tjoInterpolator(alpha, ZsingAlong, ZaxisOfPos, knots, zSing); //System.out.println("after tjo interpolator"); zSinger.setSchedulingBounds(new BoundingSphere()); //System.out.println("after set scheduling bounds"); int GMknots = 41; Point3f GMpoints[] = new Point3f[41]; Point3f GMzOnly[] = new Point3f[41]; Point3f GMeOnly[] = new Point3f[41]; Point3f GMnOnly[] = new Point3f[41]; new MotionVector(baz,ang).getMotionPoints(GMpoints); float gknots[] = new float[GMknots]; float gnotInc = 1.0f/(GMknots-1); i = 0; while (i < GMknots) { gknots[i] = i*gnotInc; // //System.out.println("GM " + i + " " + GMpoints[i]); float t[] = new float[3]; GMpoints[i].get(t); GMzOnly[i]=new Point3f(t[0],0.0f,0.0f); GMeOnly[i]=new Point3f(0.0f,t[1],0.0f); GMnOnly[i]=new Point3f(0.0f,0.0f,t[2]); PlaceCoordSystem.transform(GMpoints[i]); PlaceCoordSystem.transform(GMzOnly[i]); PlaceCoordSystem.transform(GMeOnly[i]); PlaceCoordSystem.transform(GMnOnly[i]); } TransformGroup GMsingAlong = new TransformGroup(); GMsingAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMzOnly_singAlong = new TransformGroup(); GMzOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMnOnly_singAlong = new TransformGroup(); GMnOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); TransformGroup GMeOnly_singAlong = new TransformGroup(); GMeOnly_singAlong.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); Transform3D GMaxisOfPos = new Transform3D(); GMaxisOfPos.set(new Vector3f(0.0f,1.0f,0.0f)); tjoInterpolator gmSinger = new tjoInterpolator(alpha, GMsingAlong, GMaxisOfPos, gknots, GMpoints); gmSinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmZonlySinger = new tjoInterpolator(alpha, GMzOnly_singAlong, GMaxisOfPos, gknots, GMzOnly); gmZonlySinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmNonlySinger = new tjoInterpolator(alpha, GMnOnly_singAlong, GMaxisOfPos, gknots, GMnOnly); gmNonlySinger.setSchedulingBounds(new BoundingSphere()); tjoInterpolator gmEonlySinger = new tjoInterpolator(alpha, GMeOnly_singAlong, GMaxisOfPos, gknots, GMeOnly); gmEonlySinger.setSchedulingBounds(new BoundingSphere()); TransformGroup objPlace3D = new TransformGroup(PlaceCoordSystem); TransformGroup objPlaceSurf = new TransformGroup(PlaceSurface); Background background = new Background(); background.setColor(0.6f, 0.6f, 0.6f); background.setApplicationBounds(new BoundingSphere()); objRoot.addChild(background); objPlace3D.addChild(Axes); objPlace3D.addChild(Motion); objRoot.addChild(objPlace3D); objPlaceSurf.addChild(Surface); objRoot.addChild(objPlaceSurf); /* objPlaceAxesText.addChild(AxesText); objRoot.addChild(objPlaceAxesText); */ objRoot.addChild(Trace); objRoot.addChild(ZsingAlong); objRoot.addChild(zSinger); Appearance zSphere = new Appearance(); ColoringAttributes zCA = new ColoringAttributes(); zCA.setColor(1.0f,0.0f,0.0f); zSphere.setColoringAttributes(zCA); ZsingAlong.addChild(new Sphere(0.02f,zSphere)); objRoot.addChild(NsingAlong); objRoot.addChild(nSinger); Appearance nSphere = new Appearance(); ColoringAttributes nCA = new ColoringAttributes(); nCA.setColor(0.0f,0.0f,1.0f); nSphere.setColoringAttributes(nCA); NsingAlong.addChild(new Sphere(0.02f,nSphere)); objRoot.addChild(EsingAlong); objRoot.addChild(eSinger); Appearance eSphere = new Appearance(); ColoringAttributes eCA = new ColoringAttributes(); eCA.setColor(0.0f,1.0f,0.0f); eSphere.setColoringAttributes(eCA); EsingAlong.addChild(new Sphere(0.02f,eSphere)); objRoot.addChild(GMzOnly_singAlong); objRoot.addChild(gmZonlySinger); Appearance gmZonlySphere = new Appearance(); ColoringAttributes gmZonlyCA = new ColoringAttributes(); gmZonlyCA.setColor(1.0f,0.0f,0.0f); gmZonlySphere.setColoringAttributes(gmZonlyCA); GMzOnly_singAlong.addChild(new Sphere(0.015f,gmZonlySphere)); objRoot.addChild(GMnOnly_singAlong); objRoot.addChild(gmNonlySinger); Appearance gmNonlySphere = new Appearance(); ColoringAttributes gmNonlyCA = new ColoringAttributes(); gmNonlyCA.setColor(0.0f,0.0f,1.0f); gmNonlySphere.setColoringAttributes(gmNonlyCA); GMnOnly_singAlong.addChild(new Sphere(0.015f,gmNonlySphere)); objRoot.addChild(GMeOnly_singAlong); objRoot.addChild(gmEonlySinger); Appearance gmEonlySphere = new Appearance(); ColoringAttributes gmEonlyCA = new ColoringAttributes(); gmEonlyCA.setColor(0.0f,1.0f,0.0f); gmEonlySphere.setColoringAttributes(gmEonlyCA); GMeOnly_singAlong.addChild(new Sphere(0.015f,gmEonlySphere)); objRoot.addChild(GMsingAlong); objRoot.addChild(gmSinger); Appearance gmSphere = new Appearance(); ColoringAttributes gmCA = new ColoringAttributes(); gmCA.setColor(0.4f,0.2f,0.2f); gmSphere.setColoringAttributes(gmCA); GMsingAlong.addChild(new Sphere(0.02f,gmSphere)); // Let Java 3D perform optimizations on this scene graph. objRoot.compile(); //System.out.println("returning from CreaetScene Graph"); return objRoot; } // end of CreateSceneGraph method
| 1,118,295
|
public Locale calculateLocale(FacesContext ctx) { ViewHandler realHandler = getViewHandlerForContext(ctx); if(realHandler!=null){ return realHandler.calculateLocale(ctx); } else{ throw new RuntimeException ("No ViewHandler Found to calculate Locale"); } }
|
public Locale calculateLocale(FacesContext ctx) { ViewHandler realHandler = getViewHandlerForContext(ctx); if(realHandler!=null){ return realHandler.calculateLocale(ctx); } else{ throw new RuntimeException ("No ViewHandler Found to calculate Locale"); } }
| 1,118,296
|
public UIViewRoot createView(FacesContext ctx, String viewId) { ViewHandler realHandler = getViewHandlerForContext(ctx); if(realHandler!=null){ return realHandler.createView(ctx,viewId); } else{ throw new RuntimeException ("No ViewHandler Found to create View"); } }
|
public UIViewRoot createView(FacesContext ctx, String viewId) { ViewHandler realHandler = getViewHandlerForContext(ctx); if(realHandler!=null){ UIViewRoot root = realHandler.createView(ctx,viewId); root.setLocale(IWContext.getIWContext(ctx).getCurrentLocale()); return root; } else{ throw new RuntimeException ("No ViewHandler Found to create View"); } }
| 1,118,297
|
public UIViewRoot restoreView(FacesContext ctx, String viewId) { ViewHandler realHandler = getViewHandlerForContext(ctx); if(realHandler!=null){ return realHandler.restoreView(ctx,viewId); } else{ throw new RuntimeException ("No ViewHandler Found for restoreView"); } }
|
public UIViewRoot restoreView(FacesContext ctx, String viewId) { ViewHandler realHandler = getViewHandlerForContext(ctx); if(realHandler!=null){ UIViewRoot root = realHandler.restoreView(ctx,viewId); if(root != null){ root.setLocale(IWContext.getIWContext(ctx).getCurrentLocale()); } return root; } else{ throw new RuntimeException ("No ViewHandler Found for restoreView"); } }
| 1,118,298
|
public KortathjonustanAuthorisationEntries findByAuthorizationCode(java.lang.String p0)throws javax.ejb.FinderException{ com.idega.data.IDOEntity entity = this.idoCheckOutPooledEntity(); Object pk = ((KortathjonustanAuthorisationEntriesBMPBean)entity).ejbFindByAuthorizationCode(p0); this.idoCheckInPooledEntity(entity); return this.findByPrimaryKey(pk);}
|
public KortathjonustanAuthorisationEntries findByAuthorizationCode(java.lang.String p0, IWTimestamp stamp)throws javax.ejb.FinderException{ com.idega.data.IDOEntity entity = this.idoCheckOutPooledEntity(); Object pk = ((KortathjonustanAuthorisationEntriesBMPBean)entity).ejbFindByAuthorizationCode(p0); this.idoCheckInPooledEntity(entity); return this.findByPrimaryKey(pk);}
| 1,118,299
|
public KortathjonustanAuthorisationEntries findByAuthorizationCode(java.lang.String p0)throws javax.ejb.FinderException{ com.idega.data.IDOEntity entity = this.idoCheckOutPooledEntity(); Object pk = ((KortathjonustanAuthorisationEntriesBMPBean)entity).ejbFindByAuthorizationCode(p0); this.idoCheckInPooledEntity(entity); return this.findByPrimaryKey(pk);}
|
public KortathjonustanAuthorisationEntries findByAuthorizationCode(java.lang.String p0)throws javax.ejb.FinderException{ com.idega.data.IDOEntity entity = this.idoCheckOutPooledEntity(); Object pk = ((KortathjonustanAuthorisationEntriesBMPBean)entity).ejbFindByAuthorizationCode(p0, stamp); this.idoCheckInPooledEntity(entity); return this.findByPrimaryKey(pk);}
| 1,118,300
|
public SimplePhaseStoN(String phase, TimeInterval shortOffsetBegin, TimeInterval shortOffsetEnd, TimeInterval longOffsetBegin, TimeInterval longOffsetEnd, String modelName, TauPUtil taup) throws TauModelException { this.phase = phase; this.shortOffsetBegin = shortOffsetBegin; this.shortOffsetEnd = shortOffsetEnd; this.longOffsetBegin = longOffsetBegin; this.longOffsetEnd = longOffsetEnd; if (shortOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (shortOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } this.taup = taup; shortCut = new PhaseCut(taup, phase, shortOffsetBegin, phase, shortOffsetEnd); longCut = new PhaseCut(taup, phase, longOffsetBegin, phase, longOffsetEnd); }
|
public SimplePhaseStoN(String phase, TimeInterval shortOffsetBegin, TimeInterval shortOffsetEnd, TimeInterval longOffsetBegin, TimeInterval longOffsetEnd, TauPUtil taup) throws TauModelException { this.phase = phase; this.shortOffsetBegin = shortOffsetBegin; this.shortOffsetEnd = shortOffsetEnd; this.longOffsetBegin = longOffsetBegin; this.longOffsetEnd = longOffsetEnd; if (shortOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (shortOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } this.taup = taup; shortCut = new PhaseCut(taup, phase, shortOffsetBegin, phase, shortOffsetEnd); longCut = new PhaseCut(taup, phase, longOffsetBegin, phase, longOffsetEnd); }
| 1,118,301
|
public SimplePhaseStoN(String phase, TimeInterval shortOffsetBegin, TimeInterval shortOffsetEnd, TimeInterval longOffsetBegin, TimeInterval longOffsetEnd, String modelName, TauPUtil taup) throws TauModelException { this.phase = phase; this.shortOffsetBegin = shortOffsetBegin; this.shortOffsetEnd = shortOffsetEnd; this.longOffsetBegin = longOffsetBegin; this.longOffsetEnd = longOffsetEnd; if (shortOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (shortOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } this.taup = taup; shortCut = new PhaseCut(taup, phase, shortOffsetBegin, phase, shortOffsetEnd); longCut = new PhaseCut(taup, phase, longOffsetBegin, phase, longOffsetEnd); }
|
public SimplePhaseStoN(String phase, TimeInterval shortOffsetBegin, TimeInterval shortOffsetEnd, TimeInterval longOffsetBegin, TimeInterval longOffsetEnd, String modelName, TauPUtil taup) throws TauModelException { this.phase = phase; this.shortOffsetBegin = shortOffsetBegin; this.shortOffsetEnd = shortOffsetEnd; this.longOffsetBegin = longOffsetBegin; this.longOffsetEnd = longOffsetEnd; if (shortOffsetBegin == null) { throw new NullPointerException("shortOffsetEnd cannot be null"); } if (shortOffsetEnd == null) { throw new NullPointerException("shortOffsetEnd cannot be null"); } if (longOffsetBegin == null) { throw new NullPointerException("shortOffsetEnd cannot be null"); } if (longOffsetEnd == null) { throw new NullPointerException("shortOffsetEnd cannot be null"); } this.taup = taup; shortCut = new PhaseCut(taup, phase, shortOffsetBegin, phase, shortOffsetEnd); longCut = new PhaseCut(taup, phase, longOffsetBegin, phase, longOffsetEnd); }
| 1,118,302
|
public SimplePhaseStoN(String phase, TimeInterval shortOffsetBegin, TimeInterval shortOffsetEnd, TimeInterval longOffsetBegin, TimeInterval longOffsetEnd, String modelName, TauPUtil taup) throws TauModelException { this.phase = phase; this.shortOffsetBegin = shortOffsetBegin; this.shortOffsetEnd = shortOffsetEnd; this.longOffsetBegin = longOffsetBegin; this.longOffsetEnd = longOffsetEnd; if (shortOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (shortOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } this.taup = taup; shortCut = new PhaseCut(taup, phase, shortOffsetBegin, phase, shortOffsetEnd); longCut = new PhaseCut(taup, phase, longOffsetBegin, phase, longOffsetEnd); }
|
public SimplePhaseStoN(String phase, TimeInterval shortOffsetBegin, TimeInterval shortOffsetEnd, TimeInterval longOffsetBegin, TimeInterval longOffsetEnd, String modelName, TauPUtil taup) throws TauModelException { this.phase = phase; this.shortOffsetBegin = shortOffsetBegin; this.shortOffsetEnd = shortOffsetEnd; this.longOffsetBegin = longOffsetBegin; this.longOffsetEnd = longOffsetEnd; if (shortOffsetBegin == null) { throw new NullPointerException("longOffsetBegin cannot be null"); } if (shortOffsetEnd == null) { throw new NullPointerException("longOffsetBegin cannot be null"); } if (longOffsetBegin == null) { throw new NullPointerException("longOffsetBegin cannot be null"); } if (longOffsetEnd == null) { throw new NullPointerException("longOffsetBegin cannot be null"); } this.taup = taup; shortCut = new PhaseCut(taup, phase, shortOffsetBegin, phase, shortOffsetEnd); longCut = new PhaseCut(taup, phase, longOffsetBegin, phase, longOffsetEnd); }
| 1,118,303
|
public SimplePhaseStoN(String phase, TimeInterval shortOffsetBegin, TimeInterval shortOffsetEnd, TimeInterval longOffsetBegin, TimeInterval longOffsetEnd, String modelName, TauPUtil taup) throws TauModelException { this.phase = phase; this.shortOffsetBegin = shortOffsetBegin; this.shortOffsetEnd = shortOffsetEnd; this.longOffsetBegin = longOffsetBegin; this.longOffsetEnd = longOffsetEnd; if (shortOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (shortOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetBegin == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } if (longOffsetEnd == null) { throw new NullPointerException("shortOffsetBegin cannot be null"); } this.taup = taup; shortCut = new PhaseCut(taup, phase, shortOffsetBegin, phase, shortOffsetEnd); longCut = new PhaseCut(taup, phase, longOffsetBegin, phase, longOffsetEnd); }
|
public SimplePhaseStoN(String phase, TimeInterval shortOffsetBegin, TimeInterval shortOffsetEnd, TimeInterval longOffsetBegin, TimeInterval longOffsetEnd, String modelName, TauPUtil taup) throws TauModelException { this.phase = phase; this.shortOffsetBegin = shortOffsetBegin; this.shortOffsetEnd = shortOffsetEnd; this.longOffsetBegin = longOffsetBegin; this.longOffsetEnd = longOffsetEnd; if (shortOffsetBegin == null) { throw new NullPointerException("longOffsetEnd cannot be null"); } if (shortOffsetEnd == null) { throw new NullPointerException("longOffsetEnd cannot be null"); } if (longOffsetBegin == null) { throw new NullPointerException("longOffsetEnd cannot be null"); } if (longOffsetEnd == null) { throw new NullPointerException("longOffsetEnd cannot be null"); } this.taup = taup; shortCut = new PhaseCut(taup, phase, shortOffsetBegin, phase, shortOffsetEnd); longCut = new PhaseCut(taup, phase, longOffsetBegin, phase, longOffsetEnd); }
| 1,118,304
|
public double var() { if ( ! varianceCalculated) { variance = binarySumDevSqr(0, getLength(), mean()) / (getLength()-1); } return variance; }
|
public double var() { if ( ! varianceCalculated) { variance = binarySumDevSqr(0, getLength(), mean()) / (getLength()-1); } return variance; }
| 1,118,305
|
public double var() { if ( ! varianceCalculated) { variance = binarySumDevSqr(0, getLength(), mean()) / (getLength()-1); } return variance; }
|
public double var() { if ( ! varianceCalculated) { variance = binarySumDevSqr(0, getLength(), mean()) / (getLength()-1); } return variance; }
| 1,118,306
|
protected ATObject createChild(ATClosure code, boolean parentPointerType) throws InterpreterException { NATIntercessiveMirror extension = new NATIntercessiveMirror( /* dynamic parent */ this, /* lexical parent */ code.base_getContext().base_getLexicalScope(), /* parent porinter type */ parentPointerType); code.base_applyInScope(NATTable.EMPTY, extension); // TODO: is this still necessary? can't we simply return the extension which is already a mirror? return NATMirrorFactory._INSTANCE_.createMirror(extension); }
|
protected ATObject createChild(ATClosure code, boolean parentPointerType) throws InterpreterException { NATIntercessiveMirror extension = new NATIntercessiveMirror( /* dynamic parent */ this, /* lexical parent */ code.base_getContext().base_getLexicalScope(), /* parent porinter type */ parentPointerType); code.base_applyInScope(NATTable.EMPTY, extension); // TODO: is this still necessary? can't we simply return the extension which is already a mirror? return extension; }
| 1,118,307
|
public NATText meta_print() throws InterpreterException { return Reflection.downObject(mirror_.meta_invoke( mirror_, AGSymbol.alloc("print"), NATTable.EMPTY )).asNativeText(); }
|
public NATText meta_print() throws InterpreterException { return Reflection.downObject(mirror_.meta_invoke( mirror_, AGSymbol.jAlloc("print"), NATTable.EMPTY )).asNativeText(); }
| 1,118,308
|
public AvailableDataStationRenderer(boolean useNames, boolean useCodes, boolean codeIsFirst, DataCenterRouter dc, ChannelChooser channelChooser){ super(useNames, useCodes, codeIsFirst); this.dc = dc; this.channelChooser = channelChooser; startThread(); }
|
public AvailableDataStationRenderer(boolean useNames, boolean useCodes, boolean codeIsFirst, DataCenterRouter dc, ChannelChooser channelChooser){ super(useNames, useCodes, codeIsFirst); this.dc = dc; this.channelChooser = channelChooser; startThread(); }
| 1,118,310
|
public void field(String name) throws java.lang.Exception{ BwUser u = (BwUser)top(); if (principalTags(u, name)) { return; } if (name.equals("instanceOwner")) { u.setInstanceOwner(booleanFld()); } else if (name.equals("quota")) { u.setQuota(longFld()); } else if (name.equals("calendarid")) { // 2.3.2 // Fix it later globals.subscriptionsTbl.put(u, intFld()); } else { unknownTag(name); } }
|
public void field(String name) throws java.lang.Exception{ BwUser u = (BwUser)top(); if (principalTags(u, name)) { return; } if (name.equals("instanceOwner")) { u.setInstanceOwner(booleanFld()); } else if (name.equals("quota")) { u.setQuota(longFld()); } else if (name.equals("subscriptions")) { } else if (name.equals("calendarid")) { // 2.3.2 // Fix it later globals.subscriptionsTbl.put(u, intFld()); } else { unknownTag(name); } }
| 1,118,311
|
private void getEdgeValues(MicroSecondTimeRange time, Dimension size){ if(seis.getEndTime().before(time.getBeginTime()) || seis.getBeginTime().after(time.getEndTime())) { startPixel = 0; endPixel = 0; return; } int[] points = DisplayUtils.getSeisPoints(seis, time); System.out.println("calculation points for seismogram shape: " + points[0] + ", " + points[1]); seisStart = points[0]; seisEnd = points[1]; MicroSecondDate temp = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisStart); if(temp.getMicroSecondTime() < time.getBeginTime().getMicroSecondTime()){ temp = time.getBeginTime(); } startPixel = getPixel(size.width, time.getBeginTime(), time.getEndTime(), temp); temp = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisEnd); if(temp.getMicroSecondTime() > time.getEndTime().getMicroSecondTime()){ temp = time.getEndTime(); } endPixel = getPixel(size.width, time.getBeginTime(), time.getEndTime(), temp); System.out.println("pixels to be drawn by seismogram shape: " + startPixel + ", " + endPixel); samplesPerPixel = (seisEnd - seisStart)/(double)(endPixel - startPixel); }
|
private void getEdgeValues(MicroSecondTimeRange time, Dimension size){ if(seis.getEndTime().before(time.getBeginTime()) || seis.getBeginTime().after(time.getEndTime())) { startPixel = 0; endPixel = 0; return; } int[] points = DisplayUtils.getSeisPoints(seis, time); seisStart = points[0]; seisEnd = points[1]; MicroSecondDate temp = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisStart); if(temp.getMicroSecondTime() < time.getBeginTime().getMicroSecondTime()){ temp = time.getBeginTime(); } startPixel = getPixel(size.width, time.getBeginTime(), time.getEndTime(), temp); temp = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisEnd); if(temp.getMicroSecondTime() > time.getEndTime().getMicroSecondTime()){ temp = time.getEndTime(); } endPixel = getPixel(size.width, time.getBeginTime(), time.getEndTime(), temp); System.out.println("pixels to be drawn by seismogram shape: " + startPixel + ", " + endPixel); samplesPerPixel = (seisEnd - seisStart)/(double)(endPixel - startPixel); }
| 1,118,312
|
private void getEdgeValues(MicroSecondTimeRange time, Dimension size){ if(seis.getEndTime().before(time.getBeginTime()) || seis.getBeginTime().after(time.getEndTime())) { startPixel = 0; endPixel = 0; return; } int[] points = DisplayUtils.getSeisPoints(seis, time); System.out.println("calculation points for seismogram shape: " + points[0] + ", " + points[1]); seisStart = points[0]; seisEnd = points[1]; MicroSecondDate temp = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisStart); if(temp.getMicroSecondTime() < time.getBeginTime().getMicroSecondTime()){ temp = time.getBeginTime(); } startPixel = getPixel(size.width, time.getBeginTime(), time.getEndTime(), temp); temp = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisEnd); if(temp.getMicroSecondTime() > time.getEndTime().getMicroSecondTime()){ temp = time.getEndTime(); } endPixel = getPixel(size.width, time.getBeginTime(), time.getEndTime(), temp); System.out.println("pixels to be drawn by seismogram shape: " + startPixel + ", " + endPixel); samplesPerPixel = (seisEnd - seisStart)/(double)(endPixel - startPixel); }
|
private void getEdgeValues(MicroSecondTimeRange time, Dimension size){ if(seis.getEndTime().before(time.getBeginTime()) || seis.getBeginTime().after(time.getEndTime())) { startPixel = 0; endPixel = 0; return; } int[] points = DisplayUtils.getSeisPoints(seis, time); System.out.println("calculation points for seismogram shape: " + points[0] + ", " + points[1]); seisStart = points[0]; seisEnd = points[1]; MicroSecondDate temp = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisStart); if(temp.getMicroSecondTime() < time.getBeginTime().getMicroSecondTime()){ temp = time.getBeginTime(); } startPixel = getPixel(size.width, time.getBeginTime(), time.getEndTime(), temp); temp = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisEnd); if(temp.getMicroSecondTime() > time.getEndTime().getMicroSecondTime()){ temp = time.getEndTime(); } endPixel = getPixel(size.width, time.getBeginTime(), time.getEndTime(), temp); samplesPerPixel = (seisEnd - seisStart)/(double)(endPixel - startPixel); }
| 1,118,313
|
public String[] known_contributors() { try { return jdbcCatalog.getAllContributors(); } catch(SQLException sqle) { logger.error("sql problem", sqle); throw new org.omg.CORBA.UNKNOWN(sqle.toString()); // send exception back to client } }
|
public String[] known_contributors() { try { return jdbcContributor.getAll(); } catch(SQLException sqle) { logger.error("sql problem", sqle); throw new org.omg.CORBA.UNKNOWN(sqle.toString()); // send exception back to client } }
| 1,118,314
|
public EventAccess[] query_events(edu.iris.Fissures.Area the_area, edu.iris.Fissures.Quantity min_depth, edu.iris.Fissures.Quantity max_depth, edu.iris.Fissures.TimeRange time_range, String[] search_types, float min_magnitude, float max_magnitude, String[] catalogs, String[] contributors, int seq_max, EventSeqIterHolder iter) { EventAccess[] eventAccess; logger.debug("In the method query_events of EventFinder"); float minLat; float minLon; float maxLat; float maxLon; if(the_area instanceof BoxArea) { BoxArea box = (BoxArea)the_area; minLat = box.min_latitude; maxLat = box.max_latitude; minLon = box.min_longitude; maxLon = box.max_longitude; } else if(the_area instanceof GlobalArea) { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } else { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } Integer[] eventIds; int counter; try { logger.debug("The minimum depth is " + min_depth.value); logger.debug("The maximum depth is " + max_depth.value); logger.debug("The min_magnitude is " + min_magnitude); logger.debug("The max_magnitude is " + max_magnitude); eventIds = jdbcEventAccess.getOnConstraint(min_depth.value, max_depth.value, minLat, maxLat, minLon, maxLon, time_range.start_time, time_range.end_time, min_magnitude, max_magnitude, search_types, catalogs, contributors); eventAccess = new EventAccess[eventIds.length]; for(counter = 0; counter < eventIds.length; counter++) { EventAccessImpl eventImpl = new EventAccessImpl(jdbcEventAccess, eventIds[counter].intValue()); org.omg.CORBA.Object obj = poa.create_reference_with_id(eventIds[counter].toString() .getBytes(), EventAccessHelper.id()); eventAccess[counter] = EventAccessHelper.narrow(obj); if(eventAccess[counter] == null) logger.debug("The returned reference is null"); } return eventAccess; } catch(SQLException sqle) { logger.error("SQL problem", sqle); throw new org.omg.CORBA.UNKNOWN(sqle.toString()); //send exception // back to client. } catch(NotFound nfe) { logger.error("Not found", nfe); throw new org.omg.CORBA.UNKNOWN(nfe.toString()); //send exceptino // back to client. } catch(Throwable e) { logger.error("Generic Exception ", e); throw new org.omg.CORBA.UNKNOWN(e.toString(), 1, CompletionStatus.COMPLETED_NO); // send // exceptin // back // to // client. } }
|
public EventAccess[] query_events(edu.iris.Fissures.Area the_area, edu.iris.Fissures.Quantity min_depth, edu.iris.Fissures.Quantity max_depth, edu.iris.Fissures.TimeRange time_range, String[] search_types, float min_magnitude, float max_magnitude, String[] catalogs, String[] contributors, int seq_max, EventSeqIterHolder iter) { EventAccess[] eventAccess; logger.debug("In the method query_events of EventFinder"); float minLat; float minLon; float maxLat; float maxLon; if(the_area instanceof BoxArea) { BoxArea box = (BoxArea)the_area; minLat = box.min_latitude; maxLat = box.max_latitude; minLon = box.min_longitude; maxLon = box.max_longitude; } else if(the_area instanceof GlobalArea) { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } else { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } int[] eventIds; int counter; try { logger.debug("The minimum depth is " + min_depth.value); logger.debug("The maximum depth is " + max_depth.value); logger.debug("The min_magnitude is " + min_magnitude); logger.debug("The max_magnitude is " + max_magnitude); eventIds = jdbcEventAccess.getOnConstraint(min_depth.value, max_depth.value, minLat, maxLat, minLon, maxLon, time_range.start_time, time_range.end_time, min_magnitude, max_magnitude, search_types, catalogs, contributors); eventAccess = new EventAccess[eventIds.length]; for(counter = 0; counter < eventIds.length; counter++) { EventAccessImpl eventImpl = new EventAccessImpl(jdbcEventAccess, eventIds[counter].intValue()); org.omg.CORBA.Object obj = poa.create_reference_with_id(eventIds[counter].toString() .getBytes(), EventAccessHelper.id()); eventAccess[counter] = EventAccessHelper.narrow(obj); if(eventAccess[counter] == null) logger.debug("The returned reference is null"); } return eventAccess; } catch(SQLException sqle) { logger.error("SQL problem", sqle); throw new org.omg.CORBA.UNKNOWN(sqle.toString()); //send exception // back to client. } catch(NotFound nfe) { logger.error("Not found", nfe); throw new org.omg.CORBA.UNKNOWN(nfe.toString()); //send exceptino // back to client. } catch(Throwable e) { logger.error("Generic Exception ", e); throw new org.omg.CORBA.UNKNOWN(e.toString(), 1, CompletionStatus.COMPLETED_NO); // send // exceptin // back // to // client. } }
| 1,118,315
|
public EventAccess[] query_events(edu.iris.Fissures.Area the_area, edu.iris.Fissures.Quantity min_depth, edu.iris.Fissures.Quantity max_depth, edu.iris.Fissures.TimeRange time_range, String[] search_types, float min_magnitude, float max_magnitude, String[] catalogs, String[] contributors, int seq_max, EventSeqIterHolder iter) { EventAccess[] eventAccess; logger.debug("In the method query_events of EventFinder"); float minLat; float minLon; float maxLat; float maxLon; if(the_area instanceof BoxArea) { BoxArea box = (BoxArea)the_area; minLat = box.min_latitude; maxLat = box.max_latitude; minLon = box.min_longitude; maxLon = box.max_longitude; } else if(the_area instanceof GlobalArea) { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } else { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } Integer[] eventIds; int counter; try { logger.debug("The minimum depth is " + min_depth.value); logger.debug("The maximum depth is " + max_depth.value); logger.debug("The min_magnitude is " + min_magnitude); logger.debug("The max_magnitude is " + max_magnitude); eventIds = jdbcEventAccess.getOnConstraint(min_depth.value, max_depth.value, minLat, maxLat, minLon, maxLon, time_range.start_time, time_range.end_time, min_magnitude, max_magnitude, search_types, catalogs, contributors); eventAccess = new EventAccess[eventIds.length]; for(counter = 0; counter < eventIds.length; counter++) { EventAccessImpl eventImpl = new EventAccessImpl(jdbcEventAccess, eventIds[counter].intValue()); org.omg.CORBA.Object obj = poa.create_reference_with_id(eventIds[counter].toString() .getBytes(), EventAccessHelper.id()); eventAccess[counter] = EventAccessHelper.narrow(obj); if(eventAccess[counter] == null) logger.debug("The returned reference is null"); } return eventAccess; } catch(SQLException sqle) { logger.error("SQL problem", sqle); throw new org.omg.CORBA.UNKNOWN(sqle.toString()); //send exception // back to client. } catch(NotFound nfe) { logger.error("Not found", nfe); throw new org.omg.CORBA.UNKNOWN(nfe.toString()); //send exceptino // back to client. } catch(Throwable e) { logger.error("Generic Exception ", e); throw new org.omg.CORBA.UNKNOWN(e.toString(), 1, CompletionStatus.COMPLETED_NO); // send // exceptin // back // to // client. } }
|
public EventAccess[] query_events(edu.iris.Fissures.Area the_area, edu.iris.Fissures.Quantity min_depth, edu.iris.Fissures.Quantity max_depth, edu.iris.Fissures.TimeRange time_range, String[] search_types, float min_magnitude, float max_magnitude, String[] catalogs, String[] contributors, int seq_max, EventSeqIterHolder iter) { EventAccess[] eventAccess; logger.debug("In the method query_events of EventFinder"); float minLat; float minLon; float maxLat; float maxLon; if(the_area instanceof BoxArea) { BoxArea box = (BoxArea)the_area; minLat = box.min_latitude; maxLat = box.max_latitude; minLon = box.min_longitude; maxLon = box.max_longitude; } else if(the_area instanceof GlobalArea) { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } else { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } Integer[] eventIds; int counter; try { logger.debug("The minimum depth is " + min_depth.value); logger.debug("The maximum depth is " + max_depth.value); logger.debug("The min_magnitude is " + min_magnitude); logger.debug("The max_magnitude is " + max_magnitude); eventIds = jdbcEventAccess.query(min_depth.value, max_depth.value, minLat, maxLat, minLon, maxLon, time_range.start_time, time_range.end_time, min_magnitude, max_magnitude, search_types, catalogs, contributors); eventAccess = new EventAccess[eventIds.length]; for(counter = 0; counter < eventIds.length; counter++) { EventAccessImpl eventImpl = new EventAccessImpl(jdbcEventAccess, eventIds[counter].intValue()); org.omg.CORBA.Object obj = poa.create_reference_with_id(eventIds[counter].toString() .getBytes(), EventAccessHelper.id()); eventAccess[counter] = EventAccessHelper.narrow(obj); if(eventAccess[counter] == null) logger.debug("The returned reference is null"); } return eventAccess; } catch(SQLException sqle) { logger.error("SQL problem", sqle); throw new org.omg.CORBA.UNKNOWN(sqle.toString()); //send exception // back to client. } catch(NotFound nfe) { logger.error("Not found", nfe); throw new org.omg.CORBA.UNKNOWN(nfe.toString()); //send exceptino // back to client. } catch(Throwable e) { logger.error("Generic Exception ", e); throw new org.omg.CORBA.UNKNOWN(e.toString(), 1, CompletionStatus.COMPLETED_NO); // send // exceptin // back // to // client. } }
| 1,118,316
|
public EventAccess[] query_events(edu.iris.Fissures.Area the_area, edu.iris.Fissures.Quantity min_depth, edu.iris.Fissures.Quantity max_depth, edu.iris.Fissures.TimeRange time_range, String[] search_types, float min_magnitude, float max_magnitude, String[] catalogs, String[] contributors, int seq_max, EventSeqIterHolder iter) { EventAccess[] eventAccess; logger.debug("In the method query_events of EventFinder"); float minLat; float minLon; float maxLat; float maxLon; if(the_area instanceof BoxArea) { BoxArea box = (BoxArea)the_area; minLat = box.min_latitude; maxLat = box.max_latitude; minLon = box.min_longitude; maxLon = box.max_longitude; } else if(the_area instanceof GlobalArea) { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } else { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } Integer[] eventIds; int counter; try { logger.debug("The minimum depth is " + min_depth.value); logger.debug("The maximum depth is " + max_depth.value); logger.debug("The min_magnitude is " + min_magnitude); logger.debug("The max_magnitude is " + max_magnitude); eventIds = jdbcEventAccess.getOnConstraint(min_depth.value, max_depth.value, minLat, maxLat, minLon, maxLon, time_range.start_time, time_range.end_time, min_magnitude, max_magnitude, search_types, catalogs, contributors); eventAccess = new EventAccess[eventIds.length]; for(counter = 0; counter < eventIds.length; counter++) { EventAccessImpl eventImpl = new EventAccessImpl(jdbcEventAccess, eventIds[counter].intValue()); org.omg.CORBA.Object obj = poa.create_reference_with_id(eventIds[counter].toString() .getBytes(), EventAccessHelper.id()); eventAccess[counter] = EventAccessHelper.narrow(obj); if(eventAccess[counter] == null) logger.debug("The returned reference is null"); } return eventAccess; } catch(SQLException sqle) { logger.error("SQL problem", sqle); throw new org.omg.CORBA.UNKNOWN(sqle.toString()); //send exception // back to client. } catch(NotFound nfe) { logger.error("Not found", nfe); throw new org.omg.CORBA.UNKNOWN(nfe.toString()); //send exceptino // back to client. } catch(Throwable e) { logger.error("Generic Exception ", e); throw new org.omg.CORBA.UNKNOWN(e.toString(), 1, CompletionStatus.COMPLETED_NO); // send // exceptin // back // to // client. } }
|
public EventAccess[] query_events(edu.iris.Fissures.Area the_area, edu.iris.Fissures.Quantity min_depth, edu.iris.Fissures.Quantity max_depth, edu.iris.Fissures.TimeRange time_range, String[] search_types, float min_magnitude, float max_magnitude, String[] catalogs, String[] contributors, int seq_max, EventSeqIterHolder iter) { EventAccess[] eventAccess; logger.debug("In the method query_events of EventFinder"); float minLat; float minLon; float maxLat; float maxLon; if(the_area instanceof BoxArea) { BoxArea box = (BoxArea)the_area; minLat = box.min_latitude; maxLat = box.max_latitude; minLon = box.min_longitude; maxLon = box.max_longitude; } else if(the_area instanceof GlobalArea) { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } else { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } Integer[] eventIds; int counter; try { logger.debug("The minimum depth is " + min_depth.value); logger.debug("The maximum depth is " + max_depth.value); logger.debug("The min_magnitude is " + min_magnitude); logger.debug("The max_magnitude is " + max_magnitude); eventIds = jdbcEventAccess.getOnConstraint(min_depth.value, max_depth.value, minLat, maxLat, minLon, maxLon, time_range.start_time, time_range.end_time, min_magnitude, max_magnitude, search_types, catalogs, contributors); eventAccess = new EventAccess[eventIds.length]; for(counter = 0; counter < eventIds.length; counter++) { EventAccessImpl eventImpl = new EventAccessImpl(jdbcEventAccess, eventIds[counter].intValue()); org.omg.CORBA.Object obj = poa.create_reference_with_id(eventIds[counter].toString() .getBytes(), EventAccessHelper.id()); eventAccess[counter] = EventAccessHelper.narrow(obj); if(eventAccess[counter] == null) logger.debug("The returned reference is null"); } return eventAccess; } catch(SQLException sqle) { logger.error("SQL problem", sqle); throw new org.omg.CORBA.UNKNOWN(sqle.toString()); //send exception // back to client. } catch(NotFound nfe) { logger.error("Not found", nfe); throw new org.omg.CORBA.UNKNOWN(nfe.toString()); //send exceptino // back to client. } catch(Throwable e) { logger.error("Generic Exception ", e); throw new org.omg.CORBA.UNKNOWN(e.toString(), 1, CompletionStatus.COMPLETED_NO); // send // exceptin // back // to // client. } }
| 1,118,317
|
public EventAccess[] query_events(edu.iris.Fissures.Area the_area, edu.iris.Fissures.Quantity min_depth, edu.iris.Fissures.Quantity max_depth, edu.iris.Fissures.TimeRange time_range, String[] search_types, float min_magnitude, float max_magnitude, String[] catalogs, String[] contributors, int seq_max, EventSeqIterHolder iter) { EventAccess[] eventAccess; logger.debug("In the method query_events of EventFinder"); float minLat; float minLon; float maxLat; float maxLon; if(the_area instanceof BoxArea) { BoxArea box = (BoxArea)the_area; minLat = box.min_latitude; maxLat = box.max_latitude; minLon = box.min_longitude; maxLon = box.max_longitude; } else if(the_area instanceof GlobalArea) { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } else { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } Integer[] eventIds; int counter; try { logger.debug("The minimum depth is " + min_depth.value); logger.debug("The maximum depth is " + max_depth.value); logger.debug("The min_magnitude is " + min_magnitude); logger.debug("The max_magnitude is " + max_magnitude); eventIds = jdbcEventAccess.getOnConstraint(min_depth.value, max_depth.value, minLat, maxLat, minLon, maxLon, time_range.start_time, time_range.end_time, min_magnitude, max_magnitude, search_types, catalogs, contributors); eventAccess = new EventAccess[eventIds.length]; for(counter = 0; counter < eventIds.length; counter++) { EventAccessImpl eventImpl = new EventAccessImpl(jdbcEventAccess, eventIds[counter].intValue()); org.omg.CORBA.Object obj = poa.create_reference_with_id(eventIds[counter].toString() .getBytes(), EventAccessHelper.id()); eventAccess[counter] = EventAccessHelper.narrow(obj); if(eventAccess[counter] == null) logger.debug("The returned reference is null"); } return eventAccess; } catch(SQLException sqle) { logger.error("SQL problem", sqle); throw new org.omg.CORBA.UNKNOWN(sqle.toString()); //send exception // back to client. } catch(NotFound nfe) { logger.error("Not found", nfe); throw new org.omg.CORBA.UNKNOWN(nfe.toString()); //send exceptino // back to client. } catch(Throwable e) { logger.error("Generic Exception ", e); throw new org.omg.CORBA.UNKNOWN(e.toString(), 1, CompletionStatus.COMPLETED_NO); // send // exceptin // back // to // client. } }
|
public EventAccess[] query_events(edu.iris.Fissures.Area the_area, edu.iris.Fissures.Quantity min_depth, edu.iris.Fissures.Quantity max_depth, edu.iris.Fissures.TimeRange time_range, String[] search_types, float min_magnitude, float max_magnitude, String[] catalogs, String[] contributors, int seq_max, EventSeqIterHolder iter) { EventAccess[] eventAccess; logger.debug("In the method query_events of EventFinder"); float minLat; float minLon; float maxLat; float maxLon; if(the_area instanceof BoxArea) { BoxArea box = (BoxArea)the_area; minLat = box.min_latitude; maxLat = box.max_latitude; minLon = box.min_longitude; maxLon = box.max_longitude; } else if(the_area instanceof GlobalArea) { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } else { minLat = -1 * Float.MAX_VALUE; minLon = -1 * Float.MAX_VALUE; maxLat = Float.MAX_VALUE; maxLon = Float.MAX_VALUE; } Integer[] eventIds; int counter; try { logger.debug("The minimum depth is " + min_depth.value); logger.debug("The maximum depth is " + max_depth.value); logger.debug("The min_magnitude is " + min_magnitude); logger.debug("The max_magnitude is " + max_magnitude); eventIds = jdbcEventAccess.getOnConstraint(min_depth.value, max_depth.value, minLat, maxLat, minLon, maxLon, time_range.start_time, time_range.end_time, min_magnitude, max_magnitude, search_types, catalogs, contributors); eventAccess = new EventAccess[eventIds.length]; for(counter = 0; counter < eventIds.length; counter++) { EventAccessImpl eventImpl = new EventAccessImpl(jdbcEventAccess, eventIds[counter].intValue()); org.omg.CORBA.Object obj = poa.create_reference_with_id(eventIds[counter].toString() .getBytes(), EventAccessHelper.id()); eventAccess[counter] = EventAccessHelper.narrow(obj); if(eventAccess[counter] == null) logger.debug("The returned reference is null"); } return eventAccess; } catch(SQLException sqle) { logger.error("SQL problem", sqle); throw new org.omg.CORBA.UNKNOWN(sqle.toString()); //send exception // back to client. } catch(NotFound nfe) { logger.error("Not found", nfe); throw new org.omg.CORBA.UNKNOWN(nfe.toString()); //send exceptino // back to client. } catch(Throwable e) { logger.error("Generic Exception ", e); throw new org.omg.CORBA.UNKNOWN(e.toString(), 1, CompletionStatus.COMPLETED_NO); // send // exceptin // back // to // client. } }
| 1,118,318
|
public void selectRegion(MouseEvent one, MouseEvent two){ Insets insets = this.getInsets(); Dimension dim = getSize(); double x1percent, x2percent; if(one.getX() < two.getX()){ x1percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x2percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); }else{ x2percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x1percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); } MicroSecondDate current = timeConfig.getTimeRange().getBeginTime(); MicroSecondDate selectionBegin = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x1percent + current.getMicroSecondTime())); MicroSecondDate selectionEnd = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x2percent + current.getMicroSecondTime())); if(currentSelection == null){ Iterator e = selections.iterator(); while(e.hasNext()){ Selection curr = ((Selection)e.next()); if(curr.borders(selectionBegin, selectionEnd)){ currentSelection = curr; break; } } if(currentSelection == null){ selections.add(new Selection(selectionBegin, selectionEnd, timeConfig, plotters)); currentSelection = ((Selection)selections.getFirst()); repaint(); return; } } currentSelection.adjustRange(selectionBegin, selectionEnd); repaint(); }
|
public void selectRegion(MouseEvent one, MouseEvent two){ Insets insets = this.getInsets(); Dimension dim = getSize(); double x1percent, x2percent; if(one.getX() < two.getX()){ x1percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x2percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); }else{ x2percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x1percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); } MicroSecondDate current = timeConfig.getTimeRange().getBeginTime(); MicroSecondDate selectionBegin = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x1percent + current.getMicroSecondTime())); MicroSecondDate selectionEnd = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x2percent + current.getMicroSecondTime())); if(currentSelection == null){ Iterator e = selections.iterator(); while(e.hasNext()){ Selection curr = ((Selection)e.next()); if(curr.borders(selectionBegin, selectionEnd)){ currentSelection = curr; repaint(); return; } } if(currentSelection == null){ selections.add(new Selection(selectionBegin, selectionEnd, timeConfig, plotters)); currentSelection = ((Selection)selections.getFirst()); repaint(); return; } } currentSelection.adjustRange(selectionBegin, selectionEnd); repaint(); }
| 1,118,319
|
public void selectRegion(MouseEvent one, MouseEvent two){ Insets insets = this.getInsets(); Dimension dim = getSize(); double x1percent, x2percent; if(one.getX() < two.getX()){ x1percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x2percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); }else{ x2percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x1percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); } MicroSecondDate current = timeConfig.getTimeRange().getBeginTime(); MicroSecondDate selectionBegin = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x1percent + current.getMicroSecondTime())); MicroSecondDate selectionEnd = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x2percent + current.getMicroSecondTime())); if(currentSelection == null){ Iterator e = selections.iterator(); while(e.hasNext()){ Selection curr = ((Selection)e.next()); if(curr.borders(selectionBegin, selectionEnd)){ currentSelection = curr; break; } } if(currentSelection == null){ selections.add(new Selection(selectionBegin, selectionEnd, timeConfig, plotters)); currentSelection = ((Selection)selections.getFirst()); repaint(); return; } } currentSelection.adjustRange(selectionBegin, selectionEnd); repaint(); }
|
public void selectRegion(MouseEvent one, MouseEvent two){ Insets insets = this.getInsets(); Dimension dim = getSize(); double x1percent, x2percent; if(one.getX() < two.getX()){ x1percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x2percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); }else{ x2percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x1percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); } MicroSecondDate current = timeConfig.getTimeRange().getBeginTime(); MicroSecondDate selectionBegin = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x1percent + current.getMicroSecondTime())); MicroSecondDate selectionEnd = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x2percent + current.getMicroSecondTime())); if(currentSelection == null){ Iterator e = selections.iterator(); while(e.hasNext()){ Selection curr = ((Selection)e.next()); if(curr.borders(selectionBegin, selectionEnd)){ currentSelection = curr; break; } } if(currentSelection == null){ selections.add(new Selection(selectionBegin, selectionEnd, timeConfig, plotters)); currentSelection = ((Selection)selections.getFirst()); repaint(); return; } } currentSelection.adjustRange(selectionBegin, selectionEnd); repaint(); }
| 1,118,320
|
private void drag(int dragAmount, int dragFrom, SeismogramShapeIterator iterator){ iterator.setTotalShift(currentIterator.getTotalShift() + dragAmount); double pointsPerPixel = iterator.getPointsPerPixel(); int[] seisPoints = currentIterator.getSeisPoints(); seisPoints[0] =(int)-(iterator.getTotalShift() * pointsPerPixel) + iterator.getBaseSeisPoint(); seisPoints[1] = seisPoints[0] + (int)(iterator.getSize().width * pointsPerPixel); //System.out.println("SeisPoints: " + seisPoints[0] + ", " + seisPoints[1] + " PointsPixel: " + pointsPerPixel); iterator.setSeisPoints(seisPoints); int[][] points = currentIterator.getPoints(); int length = points[0].length - Math.abs(dragAmount); System.arraycopy(points[0], dragFrom, points[0], dragFrom + dragAmount, length); System.arraycopy(points[1], dragFrom, points[1], dragFrom + dragAmount, length); int[] drawnPixels = getPixels(iterator); iterator.setDrawnPixels(drawnPixels); if(drawnPixels[0] < 0|| drawnPixels[1] < 0){ return; } int drawStart, drawEnd; if(dragAmount < 0){ drawStart = drawnPixels[1] + dragAmount; drawEnd = drawnPixels[1]; }else{ drawStart = drawnPixels[0]; drawEnd = dragAmount--; ++dragAmount; } /*System.out.println("DragAmount: " + dragAmount + " reDrawStart: " + drawStart + " reDrawEnd: " + drawEnd + " DragFrom: " + dragFrom + " DrawStart: " + drawnPixels[0] + " DrawEnd: " + drawnPixels[1]+ " totalShift: " + iterator.getTotalShift() + " SeismogramPoints: " + seisPoints[0] + ", " + seisPoints[1]);*/ plotPixels(drawStart, drawEnd, iterator); }
|
private void drag(int dragAmount, int dragFrom, SeismogramShapeIterator iterator){ iterator.setTotalShift(currentIterator.getTotalShift() + dragAmount); double pointsPerPixel = iterator.getPointsPerPixel(); int[] seisPoints = currentIterator.getSeisPoints(); seisPoints[0] =(int)-(iterator.getTotalShift() * pointsPerPixel) + iterator.getBaseSeisPoint(); seisPoints[1] = seisPoints[0] + (int)(iterator.getSize().width * pointsPerPixel); //System.out.println("SeisPoints: " + seisPoints[0] + ", " + seisPoints[1] + " PointsPixel: " + pointsPerPixel); iterator.setSeisPoints(seisPoints); int[][] points = currentIterator.getPoints(); int length = points[0].length - Math.abs(dragAmount); System.arraycopy(points[0], dragFrom, points[0], dragFrom + dragAmount, length); System.arraycopy(points[1], dragFrom, points[1], dragFrom + dragAmount, length); int[] drawnPixels = getPixels(iterator); iterator.setDrawnPixels(drawnPixels); if(drawnPixels[0] < 0|| drawnPixels[1] < 0){ return; } int drawStart, drawEnd; if(dragAmount < 0){ drawStart = drawnPixels[1] + dragAmount; drawEnd = drawnPixels[1]; }else{ drawStart = drawnPixels[0]; drawEnd = dragAmount--; ++dragAmount; } /*System.out.println("DragAmount: " + dragAmount + " reDrawStart: " + drawStart + " reDrawEnd: " + drawEnd + " DragFrom: " + dragFrom + " DrawStart: " + drawnPixels[0] + " DrawEnd: " + drawnPixels[1]+ " totalShift: " + iterator.getTotalShift() + " SeismogramPoints: " + seisPoints[0] + ", " + seisPoints[1]);*/ plotPixels(drawStart, drawEnd, iterator); }
| 1,118,321
|
public void dragPlot(SeismogramShapeIterator iterator){ iterator.copyBasicInfo(currentIterator); double shiftPercentage = getShiftPercentage(currentIterator.getTime(), iterator.getTime()); double pixels = currentIterator.getSize().width * shiftPercentage + currentIterator.getLeftoverPixels(); //checks if the pixel shift is within 1/1000 of being an even pixel pixels *= 1000; pixels = Math.round(pixels); pixels /= 1000; int shift = 0; if(pixels >= 1){ shift = (int)Math.floor(pixels); drag(shift, 0, iterator); }else if(pixels <= -1){ shift = (int)Math.ceil(pixels); drag(shift, -shift, iterator); }else{ iterator.setSeisPoints(currentIterator.getSeisPoints()); iterator.setDrawnPixels(currentIterator.getDrawnPixels()); iterator.setTotalShift(currentIterator.getTotalShift() + shift); } iterator.setLeftoverPixels(pixels - shift); currentIterator = iterator; }
|
public void dragPlot(SeismogramShapeIterator iterator){ iterator.copyBasicInfo(currentIterator); double shiftPercentage = getShiftPercentage(currentIterator.getTime(), iterator.getTime()); double pixels = currentIterator.getSize().width * shiftPercentage + currentIterator.getLeftoverPixels(); //checks if the pixel shift is within 1/1000 of being an even pixel pixels *= 1000; pixels = Math.round(pixels); pixels /= 1000; int shift = 0; if(pixels >= 1){ shift = (int)Math.floor(pixels); drag(shift, 0, iterator); }else if(pixels <= -1){ shift = (int)Math.ceil(pixels); drag(shift, -shift, iterator); }else{ iterator.setSeisPoints(currentIterator.getSeisPoints()); iterator.setDrawnPixels(currentIterator.getDrawnPixels()); iterator.setTotalShift(currentIterator.getTotalShift() + shift); } iterator.setLeftoverPixels(pixels - shift); currentIterator = iterator; }
| 1,118,322
|
public int[] getPixels(SeismogramShapeIterator iterator){ int[] displayPixels = new int[2]; int[] seisPoints = iterator.getSeisPoints(); double pointsPerPixel = iterator.getPointsPerPixel(); int displayWidth = iterator.getSize().width; double seisPointRange = seisPoints[1] - seisPoints[0]; if(seisPoints[1] < 0 || seisPoints[0] > dss.getSeismogram().getNumPoints()){ displayPixels[0] = -1; displayPixels[1] = -1; iterator.setDrawnPixels(displayPixels); return displayPixels; } if(seisPoints[0] >= 0){ displayPixels[0] = 0; }else{ displayPixels[0] =(int)Math.round(-seisPoints[0]/pointsPerPixel); } if(seisPoints[1] < dss.getSeismogram().getNumPoints()){ displayPixels[1] = displayWidth - 1; }else{ displayPixels[1] = (int)Math.round((dss.getSeismogram().getNumPoints() - seisPoints[0])/ seisPointRange * displayWidth); } iterator.setDrawnPixels(displayPixels); return displayPixels; }
|
public int[] getPixels(SeismogramShapeIterator iterator){ int[] displayPixels = new int[2]; int[] seisPoints = iterator.getSeisPoints(); double pointsPerPixel = iterator.getPointsPerPixel(); int displayWidth = iterator.getSize().width; double seisPointRange = seisPoints[1] - seisPoints[0]; if(seisPoints[1] < 0 || seisPoints[0] > dss.getSeismogram().getNumPoints()){ displayPixels[0] = -1; displayPixels[1] = -1; iterator.setDrawnPixels(displayPixels); return displayPixels; } if(seisPoints[0] >= 0){ displayPixels[0] = 0; }else{ displayPixels[0] =(int)Math.round(-seisPoints[0]/pointsPerPixel); } if(seisPoints[1] < dss.getSeismogram().getNumPoints()){ displayPixels[1] = displayWidth - 1; }else{ displayPixels[1] = (int)Math.round((dss.getSeismogram().getNumPoints() - seisPoints[0])/ seisPointRange * displayWidth); } iterator.setDrawnPixels(displayPixels); return displayPixels; }
| 1,118,323
|
public void plot(SeismogramShapeIterator iterator){ // System.out.println("Plotting all points"); iterator.setSeisPoints(DisplayUtils.getSeisPoints(dss.getSeismogram(), iterator.getTime())); iterator.setBaseSeisPoint(); iterator.setPointsPerPixel(); iterator.setPoints(new int[2][iterator.getSize().width]); plotPixels(iterator); currentIterator = iterator; }
|
public void plot(SeismogramShapeIterator iterator){ // System.out.println("Plotting all points"); iterator.setSeisPoints(DisplayUtils.getSeisPoints(dss.getSeismogram(), iterator.getTime())); iterator.setBaseSeisPoint(); iterator.setPointsPerPixel(); iterator.setPoints(new int[2][iterator.getSize().width]); plotPixels(iterator); currentIterator = iterator; }
| 1,118,324
|
public void update(MicroSecondTimeRange time, UnitRangeImpl amp, Dimension size){ SeismogramShapeIterator newIterator = new SeismogramShapeIterator(time, amp, size); if(lessThanOnePointPerPixel(newIterator)){ //compressPlot(newIterator); }else if(newIterator.isDraggedFrom(currentIterator) && newIterator.hasSimilarAmp(currentIterator)){ dragPlot(newIterator); }else{ plot(newIterator); } }
|
public void update(MicroSecondTimeRange time, UnitRangeImpl amp, Dimension size){ SeismogramShapeIterator newIterator = new SeismogramShapeIterator(time, amp, size); if(lessThanOnePointPerPixel(newIterator)){ //compressPlot(newIterator); }else if(newIterator.isDraggedFrom(currentIterator) && newIterator.hasSimilarAmp(currentIterator)){ dragPlot(newIterator); }else{ plot(newIterator); } }
| 1,118,325
|
public BwCalSuiteWrapper getCalSuite(String name) throws CalFacadeException { return dbi.getCalSuite(name); }
|
public BwCalSuiteWrapper getCalSuite(String name) throws CalFacadeException { return dbi.getCalSuite(name); }
| 1,118,327
|
public void init(CalSvcIPars parsParam) throws CalFacadeException { pars = (CalSvcIPars)parsParam.clone(); debug = pars.getDebug(); //if (userAuth != null) { // userAuth.reinitialise(getUserAuthCallBack()); //} if (userGroups != null) { userGroups.init(getGroupsCallBack()); } if (adminGroups != null) { adminGroups.init(getGroupsCallBack()); } try { env = new CalEnv(pars.getEnvPrefix(), debug); if (pars.isGuest() && (pars.getUser() == null)) { pars.setUser(env.getAppProperty("run.as.user")); } if (pars.getPublicAdmin()) { //adminAutoDeleteSponsors = env.getAppBoolProperty("app.autodeletesponsors"); //adminAutoDeleteLocations = env.getAppBoolProperty("app.autodeletelocations"); adminCanEditAllPublicCategories = env.getAppBoolProperty("allowEditAllCategories"); adminCanEditAllPublicLocations = env.getAppBoolProperty("allowEditAllLocations"); adminCanEditAllPublicSponsors = env.getAppBoolProperty("allowEditAllSponsors"); } timezones = getCal().getTimezones(); /* Nominate our timezone registry */ System.setProperty("net.fortuna.ical4j.timezone.registry", "org.bedework.icalendar.TimeZoneRegistryFactoryImpl"); } catch (CalFacadeException cfe) { throw cfe; } catch (Throwable t) { throw new CalFacadeException(t); } }
|
public void init(CalSvcIPars parsParam) throws CalFacadeException { pars = (CalSvcIPars)parsParam.clone(); debug = pars.getDebug(); //if (userAuth != null) { // userAuth.reinitialise(getUserAuthCallBack()); //} if (userGroups != null) { userGroups.init(getGroupsCallBack()); } if (adminGroups != null) { adminGroups.init(getGroupsCallBack()); } try { env = new CalEnv(pars.getEnvPrefix(), debug); if (pars.isGuest() && (pars.getUser() == null)) { pars.setUser(env.getAppProperty("run.as.user")); } if (pars.getPublicAdmin()) { //adminAutoDeleteSponsors = env.getAppBoolProperty("app.autodeletesponsors"); //adminAutoDeleteLocations = env.getAppBoolProperty("app.autodeletelocations"); adminCanEditAllPublicCategories = env.getAppBoolProperty("allowEditAllCategories"); adminCanEditAllPublicLocations = env.getAppBoolProperty("allowEditAllLocations"); adminCanEditAllPublicSponsors = env.getAppBoolProperty("allowEditAllSponsors"); } timezones = getCal().getTimezones(); /* Nominate our timezone registry */ System.setProperty("net.fortuna.ical4j.timezone.registry", "org.bedework.icalendar.TimeZoneRegistryFactoryImpl"); } catch (CalFacadeException cfe) { throw cfe; } catch (Throwable t) { throw new CalFacadeException(t); } }
| 1,118,328
|
protected void setUp() throws Exception { super.setUp(); evalAndReturn( "def at := object: { \n" + " def mirrors := object: { \n" + " def Factory := jlobby.edu.vub.at.objects.mirrors.NATMirrorFactory.INSTANCE; \n" + " }; \n" + " def unit := object: { \n" + " def XUnitFailed := object: { \n" + " def message := \"Unittest Failed\"; \n" + " def init(@args) { \n" + " if: (args.length > 0) then: { \n" + " message := args[1]; \n" + " } \n" + " } \n" + " }; \n" + " def fail( message ) { raise: XUnitFailed.new( message ) }; \n" + " }; \n" + "}; \n" + "\n" + "def symbol( text ) { jlobby.edu.vub.at.objects.natives.grammar.AGSymbol.alloc( text ) }; \n"); }
|
protected void setUp() throws Exception { super.setUp(); evalAndReturn( "def at := object: { \n" + " def mirrors := object: { \n" + " def Factory := object: {" + " def createMirror(o) { reflect: o }" + " }" + " }; \n" + " def unit := object: { \n" + " def XUnitFailed := object: { \n" + " def message := \"Unittest Failed\"; \n" + " def init(@args) { \n" + " if: (args.length > 0) then: { \n" + " message := args[1]; \n" + " } \n" + " } \n" + " }; \n" + " def fail( message ) { raise: XUnitFailed.new( message ) }; \n" + " }; \n" + "}; \n" + "\n" + "def symbol( text ) { jlobby.edu.vub.at.objects.natives.grammar.AGSymbol.alloc( text ) }; \n"); }
| 1,118,329
|
public void testJavaMirrorBaseRelation() { try { ATObject[] objects = new ATObject[] { NATNil._INSTANCE_, NATBoolean._TRUE_, NATNumber.ZERO, new NATObject(), new NATSuperObject(new NATObject(), Evaluator.getGlobalLexicalScope()), NATTable.EMPTY, new NATIntrospectiveMirror(NATNil._INSTANCE_), new NATIntercessiveMirror(Evaluator.getGlobalLexicalScope(), true) }; ATMirror[] mirrors = new ATMirror[objects.length]; for (int i = 0; i < objects.length; i++) { mirrors[i] = NATMirrorFactory._INSTANCE_.createMirror(objects[i]); } for (int i = 0; i < objects.length; i++) { assertEquals(objects[i], mirrors[i].base_getBase()); }// TODO(discuss) should NATIntrospectiveMirrors be unique? // (requires a map or every object has a lazily initialised pointer)// for (int i = 0; i < objects.length; i++) {// assertEquals(mirrors[i], NATMirrorFactory._INSTANCE_.createMirror(objects[i]));// } } catch (InterpreterException e) { fail(e.getMessage()); } }
|
public void testJavaMirrorBaseRelation() { try { ATObject[] objects = new ATObject[] { NATNil._INSTANCE_, NATBoolean._TRUE_, NATNumber.ZERO, new NATObject(), new NATSuperObject(new NATObject(), Evaluator.getGlobalLexicalScope()), NATTable.EMPTY, NATIntrospectiveMirror.atValue(NATNil._INSTANCE_), new NATIntercessiveMirror(Evaluator.getGlobalLexicalScope(), true) }; ATMirror[] mirrors = new ATMirror[objects.length]; for (int i = 0; i < objects.length; i++) { mirrors[i] = NATMirrorFactory._INSTANCE_.createMirror(objects[i]); } for (int i = 0; i < objects.length; i++) { assertEquals(objects[i], mirrors[i].base_getBase()); }// TODO(discuss) should NATIntrospectiveMirrors be unique? // (requires a map or every object has a lazily initialised pointer)// for (int i = 0; i < objects.length; i++) {// assertEquals(mirrors[i], NATMirrorFactory._INSTANCE_.createMirror(objects[i]));// } } catch (InterpreterException e) { fail(e.getMessage()); } }
| 1,118,330
|
public void testJavaMirrorBaseRelation() { try { ATObject[] objects = new ATObject[] { NATNil._INSTANCE_, NATBoolean._TRUE_, NATNumber.ZERO, new NATObject(), new NATSuperObject(new NATObject(), Evaluator.getGlobalLexicalScope()), NATTable.EMPTY, new NATIntrospectiveMirror(NATNil._INSTANCE_), new NATIntercessiveMirror(Evaluator.getGlobalLexicalScope(), true) }; ATMirror[] mirrors = new ATMirror[objects.length]; for (int i = 0; i < objects.length; i++) { mirrors[i] = NATMirrorFactory._INSTANCE_.createMirror(objects[i]); } for (int i = 0; i < objects.length; i++) { assertEquals(objects[i], mirrors[i].base_getBase()); }// TODO(discuss) should NATIntrospectiveMirrors be unique? // (requires a map or every object has a lazily initialised pointer)// for (int i = 0; i < objects.length; i++) {// assertEquals(mirrors[i], NATMirrorFactory._INSTANCE_.createMirror(objects[i]));// } } catch (InterpreterException e) { fail(e.getMessage()); } }
|
public void testJavaMirrorBaseRelation() { try { ATObject[] objects = new ATObject[] { NATNil._INSTANCE_, NATBoolean._TRUE_, NATNumber.ZERO, new NATObject(), new NATSuperObject(new NATObject(), Evaluator.getGlobalLexicalScope()), NATTable.EMPTY, new NATIntrospectiveMirror(NATNil._INSTANCE_), new NATIntercessiveMirror(Evaluator.getGlobalLexicalScope(), true) }; ATMirror[] mirrors = new ATMirror[objects.length]; for (int i = 0; i < objects.length; i++) { mirrors[i] = NATIntrospectiveMirror.atValue(objects[i]); } for (int i = 0; i < objects.length; i++) { assertEquals(objects[i], mirrors[i].base_getBase()); }// TODO(discuss) should NATIntrospectiveMirrors be unique? // (requires a map or every object has a lazily initialised pointer)// for (int i = 0; i < objects.length; i++) {// assertEquals(mirrors[i], NATMirrorFactory._INSTANCE_.createMirror(objects[i]));// } } catch (InterpreterException e) { fail(e.getMessage()); } }
| 1,118,331
|
public void testJavaMirrorInvocation() { try { ATMirror trueMirror = NATMirrorFactory._INSTANCE_.createMirror(NATBoolean._TRUE_); ATMirror responds = (ATMirror)trueMirror.meta_invoke( trueMirror, AGSymbol.jAlloc("respondsTo"), NATTable.atValue(new ATObject[] { AGSymbol.jAlloc("ifTrue:") })); responds.base_getBase().base_asBoolean().base_ifFalse_(new NativeClosure(NATNil._INSTANCE_) { public ATObject base_apply(ATTable arguments) throws InterpreterException { throw new XUserDefined(NATNil._INSTANCE_); } }); } catch (InterpreterException e) { e.printStackTrace(); fail("exception: "+ e); } }
|
public void testJavaMirrorInvocation() { try { ATMirror trueMirror = NATIntrospectiveMirror.atValue(NATBoolean._TRUE_); ATMirror responds = (ATMirror)trueMirror.meta_invoke( trueMirror, AGSymbol.jAlloc("respondsTo"), NATTable.atValue(new ATObject[] { AGSymbol.jAlloc("ifTrue:") })); responds.base_getBase().base_asBoolean().base_ifFalse_(new NativeClosure(NATNil._INSTANCE_) { public ATObject base_apply(ATTable arguments) throws InterpreterException { throw new XUserDefined(NATNil._INSTANCE_); } }); } catch (InterpreterException e) { e.printStackTrace(); fail("exception: "+ e); } }
| 1,118,332
|
public boolean validateCategory() throws Throwable { boolean ok = true; BwCategory k = getCategory(); k.setWord(Util.checkNull(k.getWord())); k.setDescription(Util.checkNull(k.getDescription())); if (k.getWord() == null) { err.emit("org.bedework.pubevents.error.missingfield", "Category"); ok = false; } return ok; }
|
public boolean validateCategory() throws Throwable { boolean ok = true; BwCategory k = getCategory(); k.setWord(Util.checkNull(k.getWord())); k.setDescription(Util.checkNull(k.getDescription())); if (k.getWord() == null) { err.emit("org.bedework.pubevents.error.missingfield", "Category"); ok = false; } return ok; }
| 1,118,333
|
public boolean validateEventCalendar() { boolean ok = true; if (!calendarId.getChanged()) { if (event.getCalendar() == null) { err.emit("org.bedework.pubevents.error.missingfield", "Calendar"); return false; } return ok; } // The user selected one from the list try { int id = calendarId.getVal(); BwCalendar c = getCalSvcI().getCalendar(id); if ((c == null) || !c.getPublick() || !c.getCalendarCollection()) { // Somebody's faking setCalendar(null); err.emit("org.bedework.pubevents.error.missingfield", "Calendar"); return false; } getEvent().setCalendar(c); setCalendar(c); return true; } catch (Throwable t) { err.emit(t); return false; } }
|
public boolean validateEventCalendar() { boolean ok = true; if (!calendarId.getChanged()) { if (event.getCalendar() == null) { err.emit("org.bedework.pubevents.error.missingfield", "Calendar"); return false; } return ok; } // The user selected one from the list try { int id = calendarId.getVal(); BwCalendar c = getCalSvcI().getCalendar(id); if ((c == null) || !c.getPublick() || !c.getCalendarCollection()) { // Somebody's faking setCalendar(null); err.emit("org.bedework.pubevents.error.missingfield", "Calendar"); return false; } getEvent().setCalendar(c); setCalendar(c); return true; } catch (Throwable t) { err.emit(t); return false; } }
| 1,118,334
|
public boolean validateEventCategory() throws Throwable { int id = keyId.getVal(); if (id <= 0) { if (getEnv().getAppBoolProperty("app.categoryOptional")) { return true; } err.emit("org.bedework.pubevents.error.missingfield", "Category"); return false; } try { BwCategory k = getCalSvcI().getCategory(id); if (k == null) { err.emit("org.bedework.pubevents.error.missingcategory", id); return false; } if (!keyId.getChanged()) { return true; }// oldCategory = getEvent().getCategory(0); /* Currently we replace the only category if it exists */ BwEvent ev = getEvent(); ev.clearCategories(); ev.addCategory(k); setCategory(k); return true; } catch (Throwable t) { err.emit(t); return false; } }
|
public boolean validateEventCategory() throws Throwable { int id = keyId.getVal(); if (id <= 0) { if (getEnv().getAppBoolProperty("app.categoryOptional")) { return true; } err.emit("org.bedework.pubevents.error.missingfield", "Category"); return false; } try { BwCategory k = getCalSvcI().getCategory(id); if (k == null) { err.emit("org.bedework.pubevents.error.missingcategory", id); return false; } if (!keyId.getChanged()) { return true; }// oldCategory = getEvent().getCategory(0); /* Currently we replace the only category if it exists */ BwEvent ev = getEvent(); ev.clearCategories(); ev.addCategory(k); setCategory(k); return true; } catch (Throwable t) { err.emit(t); return false; } }
| 1,118,335
|
public boolean validateEventCategory() throws Throwable { int id = keyId.getVal(); if (id <= 0) { if (getEnv().getAppBoolProperty("app.categoryOptional")) { return true; } err.emit("org.bedework.pubevents.error.missingfield", "Category"); return false; } try { BwCategory k = getCalSvcI().getCategory(id); if (k == null) { err.emit("org.bedework.pubevents.error.missingcategory", id); return false; } if (!keyId.getChanged()) { return true; }// oldCategory = getEvent().getCategory(0); /* Currently we replace the only category if it exists */ BwEvent ev = getEvent(); ev.clearCategories(); ev.addCategory(k); setCategory(k); return true; } catch (Throwable t) { err.emit(t); return false; } }
|
public boolean validateEventCategory() throws Throwable { int id = keyId.getVal(); if (id <= 0) { if (getEnv().getAppBoolProperty("app.categoryOptional")) { return true; } err.emit("org.bedework.pubevents.error.missingfield", "Category"); return false; } try { BwCategory k = getCalSvcI().getCategory(id); if (k == null) { err.emit("org.bedework.client.error.missingcategory", id); return false; } if (!keyId.getChanged()) { return true; }// oldCategory = getEvent().getCategory(0); /* Currently we replace the only category if it exists */ BwEvent ev = getEvent(); ev.clearCategories(); ev.addCategory(k); setCategory(k); return true; } catch (Throwable t) { err.emit(t); return false; } }
| 1,118,336
|
public boolean validateEventLocation() throws Throwable { boolean ok = true; if (!locId.getChanged()) { if (getAutoCreateLocations()) { BwLocation l = getLocation(); if (!BwWebUtil.validateLocation(l, err)) { return false; } getCalSvcI().ensureLocationExists(l); setLocation(l); getEvent().setLocation(l); } if (event.getLocation() == null) { err.emit("org.bedework.pubevents.error.missingfield", "Location"); return false; } return ok; } // The user selected one from the list try { int id = locId.getVal(); BwLocation l = getCalSvcI().getLocation(id); if ((l == null) || !l.getPublick()) { // Somebody's faking setLocation(null); err.emit("org.bedework.pubevents.error.missingfield", "Location"); return false; } getEvent().setLocation(l); setLocation(l); return true; } catch (Throwable t) { err.emit(t); return false; } }
|
public boolean validateEventLocation() throws Throwable { boolean ok = true; if (!locId.getChanged()) { if (getAutoCreateLocations()) { BwLocation l = getLocation(); if (!BwWebUtil.validateLocation(l, err)) { return false; } getCalSvcI().ensureLocationExists(l); setLocation(l); getEvent().setLocation(l); } if (event.getLocation() == null) { err.emit("org.bedework.pubevents.error.missingfield", "Location"); return false; } return ok; } // The user selected one from the list try { int id = locId.getVal(); BwLocation l = getCalSvcI().getLocation(id); if ((l == null) || !l.getPublick()) { // Somebody's faking setLocation(null); err.emit("org.bedework.pubevents.error.missingfield", "Location"); return false; } getEvent().setLocation(l); setLocation(l); return true; } catch (Throwable t) { err.emit(t); return false; } }
| 1,118,337
|
public boolean validateEventSponsor() throws Throwable { boolean ok = true; if (!spId.getChanged()) { if (getAutoCreateSponsors()) { BwSponsor s = getSponsor(); if (!BwWebUtil.validateSponsor(s, err)) { return false; } getCalSvcI().ensureSponsorExists(s); setSponsor(s); getEvent().setSponsor(s); } if (event.getSponsor() == null) { err.emit("org.bedework.pubevents.error.missingfield", "Sponsor"); return false; } return ok; } // The user selected one from the list int id = spId.getVal(); try { BwSponsor s = getCalSvcI().getSponsor(id); if (s == null) { // Somebody's faking setSponsor(null); err.emit("org.bedework.pubevents.error.missingfield", "Sponsor"); return false; } getEvent().setSponsor(s); setSponsor(s); return true; } catch (Throwable t) { err.emit(t); return false; } }
|
public boolean validateEventSponsor() throws Throwable { boolean ok = true; if (!spId.getChanged()) { if (getAutoCreateSponsors()) { BwSponsor s = getSponsor(); if (!BwWebUtil.validateSponsor(s, err)) { return false; } getCalSvcI().ensureSponsorExists(s); setSponsor(s); getEvent().setSponsor(s); } if (event.getSponsor() == null) { err.emit("org.bedework.pubevents.error.missingfield", "Sponsor"); return false; } return ok; } // The user selected one from the list int id = spId.getVal(); try { BwSponsor s = getCalSvcI().getSponsor(id); if (s == null) { // Somebody's faking setSponsor(null); err.emit("org.bedework.pubevents.error.missingfield", "Sponsor"); return false; } getEvent().setSponsor(s); setSponsor(s); return true; } catch (Throwable t) { err.emit(t); return false; } }
| 1,118,338
|
public IntSelectId(int originalValue, int preferred) { reset(originalValue, preferred); }
|
public IntSelectId(int originalValue, int preferred) { reset(originalValue, preferred); }
| 1,118,339
|
public void addSeismogram(DataSetSeismogram dss){ HashMap values = new HashMap(); Document doc = getDocument(); try{ appendLine(doc, ""); LocalSeismogramImpl seis = dss.getSeismogram(); appendHeader(doc, seis.getName()); values.put("Number of Points", twoDecimal.format(seis.getNumPoints())); values.put("ID", seis.get_id()); values.put("Sampling", "" + seis.getSampling()); values.put("Channel ID", ChannelIdUtil.toString(seis.getChannelID())); values.put("Begin Time", "" + seis.getBeginTime()); values.put("End Time" , "" + seis.getEndTime()); values.put("Minimum Value", "" + seis.getMinValue()); values.put("Maximum Value", "" + seis.getMaxValue()); values.put("Mean Value", "" + seis.getMeanValue()); Iterator e = format.iterator(); while(e.hasNext()){ String current = (String)e.next(); appendLabelValue(doc, current, (String)values.get(current)); } } catch(Exception e){ e.printStackTrace(); } }
|
public void addSeismogram(DataSetSeismogram dss){ HashMap values = new HashMap(); Document doc = getDocument(); try{ appendLine(doc, ""); LocalSeismogramImpl seis = dss.getSeismogram(); appendHeader(doc, dss.getName()); values.put("Number of Points", twoDecimal.format(seis.getNumPoints())); values.put("ID", seis.get_id()); values.put("Sampling", "" + seis.getSampling()); values.put("Channel ID", ChannelIdUtil.toString(seis.getChannelID())); values.put("Begin Time", "" + seis.getBeginTime()); values.put("End Time" , "" + seis.getEndTime()); values.put("Minimum Value", "" + seis.getMinValue()); values.put("Maximum Value", "" + seis.getMaxValue()); values.put("Mean Value", "" + seis.getMeanValue()); Iterator e = format.iterator(); while(e.hasNext()){ String current = (String)e.next(); appendLabelValue(doc, current, (String)values.get(current)); } } catch(Exception e){ e.printStackTrace(); } }
| 1,118,340
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.