use of cbit.vcell.data.DataSymbol in project vcell by virtualcell.
the class DataSymbolsSpecPanel method onSelectedObjectsChange.
@Override
protected void onSelectedObjectsChange(Object[] selectedObjects) {
DataSymbol dataSymbol = null;
if (selectedObjects != null && selectedObjects.length == 1 && selectedObjects[0] instanceof DataSymbol) {
dataSymbol = (DataSymbol) selectedObjects[0];
}
setDataSymbol(dataSymbol);
}
use of cbit.vcell.data.DataSymbol in project vcell by virtualcell.
the class MicroscopeMeasurementPanel method refreshInterface.
protected void refreshInterface() {
if (simulationContext == null) {
return;
}
MicroscopeMeasurement microscopeMeasurement = simulationContext.getMicroscopeMeasurement();
nameTextField.setText(microscopeMeasurement.getName());
refreshFluorescenceSpeciesList(microscopeMeasurement);
refreshAllSpeciesList();
ConvolutionKernel ck = microscopeMeasurement.getConvolutionKernel();
if (ck instanceof ProjectionZKernel) {
rdbtnZprojection.setSelected(true);
BeanUtils.enableComponents(gaussianPsfPanel, false);
BeanUtils.enableComponents(experimentalPsfPanel, false);
} else if (ck instanceof GaussianConvolutionKernel) {
radioButtonGaussian.setSelected(true);
BeanUtils.enableComponents(gaussianPsfPanel, true);
BeanUtils.enableComponents(experimentalPsfPanel, false);
sigmaXYTextField.setText(((GaussianConvolutionKernel) ck).getSigmaXY_um().infix());
sigmaZTextField.setText(((GaussianConvolutionKernel) ck).getSigmaZ_um().infix());
} else if (ck instanceof ExperimentalPSF) {
rdbtnExperimental.setSelected(true);
BeanUtils.enableComponents(gaussianPsfPanel, false);
BeanUtils.enableComponents(experimentalPsfPanel, true);
}
pointSpreadFunctionsComboModel.removeAllElements();
if (simulationContext.getDataContext() != null) {
for (DataSymbol dataSymbol : simulationContext.getDataContext().getDataSymbols()) {
if (dataSymbol.getDataSymbolType().equals(DataSymbolType.POINT_SPREAD_FUNCTION)) {
pointSpreadFunctionsComboModel.addElement(dataSymbol.getName());
}
}
}
}
use of cbit.vcell.data.DataSymbol in project vcell by virtualcell.
the class DataSymbolsSpecPanel method setDataSymbol.
// public void createDataSymbol() throws Exception, UserCancelException{
// final int VFRAP_DATASET = 0;
// final int VFRAP_SPECIALS = 1;
// final int ASSOCIATE_EXISTING_FD = 2;
// final int POINT_SPREAD_FUNCTION = 3;
// final int IMAGE_FILE = 4;
// final int COPY_FROM_BIOMODEL = 5;
// int[] dataSymbolSource = null;
//
// String[][] choices = new String[][] {{ADD_VFRAP_DATASET_MENU},{ADD_VFRAP_SPECIALS_MENU},{ADD_ASSOCIATE_EXISTING_FD_MENU},
// {ADD_PSF_MENU},{ADD_IMAGE_FILE_MENU},{ADD_COPY_FROM_BIOMODEL_MENU} };
//
// dataSymbolSource = DialogUtils.showComponentOKCancelTableList(
// getComponent(),
// "Choose a source for the data symbol.",
// new String[] {"Available Sources:"},
// choices, ListSelectionModel.SINGLE_SELECTION);
//
// if(dataSymbolSource[0] == VFRAP_DATASET){
// getDataSymbolsPanel().addVFrapOriginalImages();
// }else if(dataSymbolSource[0] == VFRAP_SPECIALS){
// getDataSymbolsPanel().addVFrapDerivedImages();
// }else if(dataSymbolSource[0] == ASSOCIATE_EXISTING_FD){
// Component requesterComponent = DataSymbolsSpecPanel.this;
// DocumentWindow documentWindow = (DocumentWindow)BeanUtils.findTypeParentOfComponent(requesterComponent, DocumentWindow.class);
// documentWindow.getTopLevelWindowManager().getRequestManager().showFieldDataWindow(new FieldDataWindowManager.DataSymbolCallBack() {
// public void createDataSymbol(ExternalDataIdentifier dataSetID,
// String fieldDataVarName, VariableType fieldDataVarType,
// double fieldDataVarTime) {
//
// System.out.println(dataSetID+" "+fieldDataVarName+" "+fieldDataVarType+" "+fieldDataVarTime);
// // ex: incomplete 51780592 danv(26766043) fluor Volume_VariableType 23.680419921875
//
// DecimalFormat df = new DecimalFormat("###000.00"); // max time interval we can display is about 11 days
// String fluorName = fieldDataVarName + "_" + df.format(fieldDataVarTime).substring(0, df.format(fieldDataVarTime).indexOf(".")) + "s" + df.format(fieldDataVarTime).substring(1+df.format(fieldDataVarTime).indexOf(".")) + "_" + dataSetID.getName();
// // TODO: symbol names may not be unique, must check for unicity and prompt the user
// FieldDataSymbol dataSymbol = new FieldDataSymbol(fluorName, DataSymbolType.GENERIC_SYMBOL,
// getSimulationContext().getDataContext(), VCUnitDefinition.UNIT_TBD,
// dataSetID,
// fieldDataVarName, fieldDataVarType.getTypeName(), fieldDataVarTime);
// getSimulationContext().getDataContext().addDataSymbol(dataSymbol);
//
// }
// });
// }else if(dataSymbolSource[0] == POINT_SPREAD_FUNCTION){
// PointSpreadFunctionManagement psfManager = new PointSpreadFunctionManagement(DataSymbolsSpecPanel.this,
// getSimulationContext());
// psfManager.importPointSpreadFunction();
// }else if(dataSymbolSource[0] == IMAGE_FILE){
// throw new RuntimeException("Option not yet implemented.");
// }else if(dataSymbolSource[0] == COPY_FROM_BIOMODEL){
// throw new RuntimeException("Option not yet implemented.");
// }else{
// throw new IllegalArgumentException("Error selecting data symbol, Unknown Source type " + dataSymbolSource[0]);
// }
// }
public void setDataSymbol(Object object) {
if (object == null) {
// TODO: display empty image
return;
}
if (((DataSymbol) object).equals(ivjCurrentSymbol)) {
return;
} else {
ivjCurrentSymbol = (DataSymbol) object;
}
// manage checkbox status depending on type of current data symbol
DataSymbolType dsType = ivjCurrentSymbol.getDataSymbolType();
switch(dsType) {
case GENERIC_SYMBOL:
getChckbxPointSpreadFunction().setEnabled(true);
getChckbxPointSpreadFunction().setSelected(false);
break;
case POINT_SPREAD_FUNCTION:
getChckbxPointSpreadFunction().setEnabled(true);
getChckbxPointSpreadFunction().setSelected(true);
break;
default:
getChckbxPointSpreadFunction().setEnabled(false);
getChckbxPointSpreadFunction().setSelected(false);
break;
}
// displays iconized image for the current (field?) data symbol
getImagePlaneManagerPanel().setMode(ImagePaneModel.MESH_MODE);
int w = Integer.valueOf(30).intValue() + 5 * (countW % 5);
int h = Integer.valueOf(20).intValue() + 3 * (countH % 7);
String type = "double";
System.out.println(" " + w + ", " + h);
SourceDataInfo sdi = ImagePaneScrollerTest.getExampleSDI(type, w, h);
getImagePlaneManagerPanel().setSourceDataInfo(sdi);
countW++;
countH++;
}
use of cbit.vcell.data.DataSymbol in project vcell by virtualcell.
the class DataSymbolsTableModel method simulationContextChange.
/**
* Sets the simulationContext property (cbit.vcell.mapping.SimulationContext) value.
* @param simulationContext The new value for the property.
* @see #getSimulationContext
*/
@Override
protected void simulationContextChange(java.beans.PropertyChangeEvent evt) {
super.simulationContextChange(evt);
SimulationContext oldValue = (SimulationContext) evt.getOldValue();
if (oldValue != null) {
oldValue.getDataContext().removePropertyChangeListener(this);
for (DataSymbol ds : oldValue.getDataContext().getDataSymbols()) {
ds.removePropertyChangeListener(this);
}
}
SimulationContext newValue = (SimulationContext) evt.getNewValue();
if (newValue != null) {
newValue.getDataContext().addPropertyChangeListener(this);
for (DataSymbol ds : newValue.getDataContext().getDataSymbols()) {
ds.addPropertyChangeListener(this);
}
}
}
use of cbit.vcell.data.DataSymbol in project vcell by virtualcell.
the class VFrapXmlHelper method CreateSaveVFrapDataSymbols.
public static void CreateSaveVFrapDataSymbols(Hashtable<String, Object> hashTable, BioModel bioModel, ExternalDataIdentifier vfrapMisc) {
String[] channelNames = (String[]) hashTable.get("channelNames");
DataSymbolType[] channelVFrapImageType = (DataSymbolType[]) hashTable.get("channelVFrapImageType");
String initialFieldDataName = (String) hashTable.get("initialFieldDataName");
SimulationContext simContext = bioModel.getSimulationContexts()[0];
ModelUnitSystem modelUnitSystem = bioModel.getModel().getUnitSystem();
for (int i = 0; i < channelNames.length; i++) {
// TODO: construct dataSymbolName from vFrapConstants::nameFromToken()
// item name postfixed with field data name
String dataSymbolName = channelNames[i] + "_" + initialFieldDataName;
DataSymbol dataSymbol = new FieldDataSymbol(dataSymbolName, channelVFrapImageType[i], simContext.getDataContext(), modelUnitSystem.getInstance_TBD(), vfrapMisc, channelNames[i], VariableType.VOLUME.getTypeName(), 0D);
simContext.getDataContext().addDataSymbol(dataSymbol);
}
}
Aggregations