use of cbit.rmi.event.ExportEvent in project vcell by virtualcell.
the class VirtualFrapWindowManager method startExport.
public void startExport(Component requester, OutputContext outContext, ExportSpecs exportSpecs) {
try {
ExportServiceImpl exportServiceImpl = new ExportServiceImpl();
DataServerImpl dataServerImpl = new DataServerImpl(localWorkSpace.getDataSetControllerImpl(), exportServiceImpl);
exportServiceImpl.addExportListener(new ExportListener() {
public void exportMessage(ExportEvent event) {
System.out.println(event.toString());
}
});
exportServiceImpl.makeRemoteFile(null, LocalWorkspace.getDefaultOwner(), dataServerImpl, exportSpecs);
} catch (DataAccessException e) {
e.printStackTrace(System.out);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
use of cbit.rmi.event.ExportEvent in project vcell by virtualcell.
the class ExportServiceImpl method fireExportAssembling.
protected void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String format) {
User user = null;
Object object = jobRequestIDs.get(new Long(jobID));
if (object != null) {
user = (User) object;
}
ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_ASSEMBLING, format, null, null, null, null);
fireExportEvent(event);
}
use of cbit.rmi.event.ExportEvent in project vcell by virtualcell.
the class ExportServiceImpl method fireExportProgress.
/**
* Insert the method's description here.
* Creation date: (4/1/2001 11:20:45 AM)
* @param exportSpecs cbit.vcell.export.server.ExportSpecs
* @param progress double
*/
protected void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format, double progress) {
User user = null;
Object object = jobRequestIDs.get(new Long(jobID));
if (object != null) {
user = (User) object;
}
ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_PROGRESS, format, null, new Double(progress), null, null);
fireExportEvent(event);
}
use of cbit.rmi.event.ExportEvent in project vcell by virtualcell.
the class ExportServiceImpl method fireExportCompleted.
/**
* Insert the method's description here.
* Creation date: (4/1/2001 11:20:45 AM)
* @deprecated
*/
protected ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, String format, String location, ExportSpecs exportSpecs) {
User user = null;
Object object = jobRequestIDs.get(new Long(jobID));
if (object != null) {
user = (User) object;
}
TimeSpecs timeSpecs = (exportSpecs != null) ? exportSpecs.getTimeSpecs() : (null);
VariableSpecs varSpecs = (exportSpecs != null) ? exportSpecs.getVariableSpecs() : (null);
final KeyValue dataKey;
if (vcdID instanceof VCSimulationDataIdentifier) {
dataKey = ((VCSimulationDataIdentifier) vcdID).getSimulationKey();
} else if (vcdID instanceof ExternalDataIdentifier) {
dataKey = ((ExternalDataIdentifier) vcdID).getSimulationKey();
} else {
throw new RuntimeException("unexpected VCDataIdentifier");
}
ExportEvent event = new ExportEvent(this, jobID, user, vcdID.getID(), dataKey, ExportEvent.EXPORT_COMPLETE, format, location, null, timeSpecs, varSpecs);
fireExportEvent(event);
return event;
}
use of cbit.rmi.event.ExportEvent in project vcell by virtualcell.
the class ExportMonitorPanelTest method main.
/**
* main entrypoint - starts the part when it is run as an application
* @param args java.lang.String[]
*/
public static void main(java.lang.String[] args) {
try {
JFrame frame = new javax.swing.JFrame();
ExportMonitorPanel aExportMonitorPanel;
aExportMonitorPanel = new ExportMonitorPanel();
frame.setContentPane(aExportMonitorPanel);
frame.setSize(aExportMonitorPanel.getSize());
frame.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
System.exit(0);
}
});
frame.show();
java.awt.Insets insets = frame.getInsets();
frame.setSize(frame.getWidth() + insets.left + insets.right, frame.getHeight() + insets.top + insets.bottom);
VCSimulationDataIdentifier vcSimDataId = new VCSimulationDataIdentifier(new VCSimulationIdentifier(new KeyValue("234"), null), 1);
aExportMonitorPanel.addExportEvent(new ExportEvent(aExportMonitorPanel, 123456789L, null, vcSimDataId.getID(), vcSimDataId.getSimulationKey(), ExportEvent.EXPORT_PROGRESS, "CSV", "", new Double(0.47), null, null), "bogus [application: model]");
aExportMonitorPanel.addExportEvent(new ExportEvent(aExportMonitorPanel, 987654321L, null, vcSimDataId.getID(), vcSimDataId.getSimulationKey(), ExportEvent.EXPORT_COMPLETE, "GIF", "http://nrcam.uchc.edu/export/987654321.zip", new Double(1), null, null), "simulation [application: model]");
frame.pack();
frame.setVisible(true);
} catch (Throwable exception) {
System.err.println("Exception occurred in main() of javax.swing.JPanel");
exception.printStackTrace(System.out);
}
}
Aggregations