Search in sources :

Example 1 with ODEDataInterface

use of cbit.vcell.client.data.ODEDataInterface in project vcell by virtualcell.

the class ODESolverPlotSpecificationPanel method initConnections.

/**
 * Initializes connections
 * @exception java.lang.Exception The exception description.
 */
@SuppressWarnings({ "serial", "unchecked" })
private void initConnections() throws java.lang.Exception {
    // user code begin {1}
    // user code end
    getFilterPanel().addPropertyChangeListener(ivjEventHandler);
    getYAxisChoice().addListSelectionListener(ivjEventHandler);
    this.addPropertyChangeListener(ivjEventHandler);
    getXAxisComboBox_frm().addItemListener(ivjEventHandler);
    getLogSensCheckbox().addActionListener(ivjEventHandler);
    getSensitivityParameterSlider().addChangeListener(ivjEventHandler);
    connPtoP1SetTarget();
    connPtoP3SetTarget();
    getYAxisChoice().setCellRenderer(new DefaultListCellRenderer() {

        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
            super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
            ODEDataInterface mdi = getMyDataInterface();
            if (mdi == null) {
                return this;
            }
            String varName = (String) value;
            ColumnDescription cd = null;
            try {
                cd = mdi.getColumnDescription(varName);
            } catch (ObjectNotFoundException e) {
                e.printStackTrace();
            }
            if (cd instanceof FunctionColumnDescription && ((FunctionColumnDescription) cd).getIsUserDefined()) {
                if (function_icon == null) {
                    function_icon = new ImageIcon(getClass().getResource("/icons/function_icon.png"));
                }
                setIcon(function_icon);
            }
            if (mdi.getDataSymbolMetadataResolver() != null && mdi.getDataSymbolMetadataResolver().getDataSymbolMetadata(varName) != null) {
                DataSymbolMetadata dsm = mdi.getDataSymbolMetadataResolver().getDataSymbolMetadata(varName);
                String tooltipString = dsm.tooltipString;
                if (tooltipString == null) {
                    tooltipString = varName;
                }
                setToolTipText(tooltipString);
            }
            return this;
        }
    });
}
Also used : ImageIcon(javax.swing.ImageIcon) ColumnDescription(cbit.vcell.util.ColumnDescription) FunctionColumnDescription(cbit.vcell.math.FunctionColumnDescription) DataSymbolMetadata(cbit.vcell.solver.DataSymbolMetadata) ODEDataInterface(cbit.vcell.client.data.ODEDataInterface) DefaultListCellRenderer(javax.swing.DefaultListCellRenderer) ObjectNotFoundException(org.vcell.util.ObjectNotFoundException) Component(java.awt.Component) FunctionColumnDescription(cbit.vcell.math.FunctionColumnDescription) JList(javax.swing.JList)

Example 2 with ODEDataInterface

use of cbit.vcell.client.data.ODEDataInterface in project vcell by virtualcell.

the class ODESolverPlotSpecificationPanel method setMyDataInterface.

/**
 * Sets the odeSolverResultSet property (cbit.vcell.solver.ode.ODESolverResultSet) value.
 * @param odeSolverResultSet The new value for the property.
 * @see #getOdeSolverResultSet
 */
public void setMyDataInterface(ODEDataInterface newMyDataInterface) {
    ODEDataInterface oldValue = oDEDataInterface;
    /* Stop listening for events from the current object */
    if (oldValue != null) {
        oldValue.removePropertyChangeListener(ivjEventHandler);
    }
    oDEDataInterface = newMyDataInterface;
    if (oDEDataInterface != null) {
        oDEDataInterface.addPropertyChangeListener(ivjEventHandler);
    }
    firePropertyChange(ODESOLVERRESULTSET_CHANGED, oldValue, oDEDataInterface);
}
Also used : ODEDataInterface(cbit.vcell.client.data.ODEDataInterface)

Aggregations

ODEDataInterface (cbit.vcell.client.data.ODEDataInterface)2 FunctionColumnDescription (cbit.vcell.math.FunctionColumnDescription)1 DataSymbolMetadata (cbit.vcell.solver.DataSymbolMetadata)1 ColumnDescription (cbit.vcell.util.ColumnDescription)1 Component (java.awt.Component)1 DefaultListCellRenderer (javax.swing.DefaultListCellRenderer)1 ImageIcon (javax.swing.ImageIcon)1 JList (javax.swing.JList)1 ObjectNotFoundException (org.vcell.util.ObjectNotFoundException)1