Example usage for com.jgoodies.forms.builder DefaultFormBuilder append

List of usage examples for com.jgoodies.forms.builder DefaultFormBuilder append

Introduction

In this page you can find the example usage for com.jgoodies.forms.builder DefaultFormBuilder append.

Prototype

public JLabel append(String textWithMnemonic, Component component) 

Source Link

Document

Adds a text label and component to the panel.

Usage

From source file:eu.crisis_economics.abm.dashboard.Page_Parameters.java

License:Open Source License

@SuppressWarnings("unchecked")
private List<ParameterInfo> createAndDisplayAParameterPanel(
        final List<ai.aitia.meme.paramsweep.batch.param.ParameterInfo<?>> batchParameters, final String title,
        final SubmodelInfo parent, final boolean submodelSelectionWithoutNotify,
        final IModelHandler currentModelHandler) {
    final List<ParameterMetaData> metadata = new LinkedList<ParameterMetaData>(),
            unknownFields = new ArrayList<ParameterMetaData>();
    for (final ai.aitia.meme.paramsweep.batch.param.ParameterInfo<?> record : batchParameters) {
        final String parameterName = record.getName(), fieldName = StringUtils.uncapitalize(parameterName);
        Class<?> modelComponentType = parent == null ? currentModelHandler.getModelClass()
                : parent.getActualType();
        while (true) {
            try {
                final Field field = modelComponentType.getDeclaredField(fieldName);
                final ParameterMetaData datum = new ParameterMetaData();
                for (final Annotation element : field.getAnnotations()) {
                    if (element.annotationType().getName() != Layout.class.getName()) // Proxies
                        continue;
                    final Class<? extends Annotation> type = element.annotationType();
                    datum.verboseDescription = (String) type.getMethod("VerboseDescription").invoke(element);
                    datum.banner = (String) type.getMethod("Title").invoke(element);
                    datum.fieldName = (String) " " + type.getMethod("FieldName").invoke(element);
                    datum.imageFileName = (String) type.getMethod("Image").invoke(element);
                    datum.layoutOrder = (Double) type.getMethod("Order").invoke(element);
                }/*  w  w w.j a v  a2s .c  om*/
                datum.parameter = record;
                if (datum.fieldName.trim().isEmpty())
                    datum.fieldName = parameterName.replaceAll("([A-Z])", " $1");
                metadata.add(datum);
                break;
            } catch (final SecurityException e) {
            } catch (final NoSuchFieldException e) {
            } catch (final IllegalArgumentException e) {
            } catch (final IllegalAccessException e) {
            } catch (final InvocationTargetException e) {
            } catch (final NoSuchMethodException e) {
            }
            modelComponentType = modelComponentType.getSuperclass();
            if (modelComponentType == null) {
                ParameterMetaData.createAndRegisterUnknown(fieldName, record, unknownFields);
                break;
            }
        }
    }
    Collections.sort(metadata);
    for (int i = unknownFields.size() - 1; i >= 0; --i)
        metadata.add(0, unknownFields.get(i));

    // initialize single run form
    final DefaultFormBuilder formBuilder = FormsUtils.build("p ~ p:g", "");
    appendMinimumWidthHintToPresentation(formBuilder, 550);

    if (parent == null) {
        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                numberOfTurnsField.grabFocus();
            }
        });

        appendBannerToPresentation(formBuilder, "General Parameters");
        appendTextToPresentation(formBuilder, "Global parameters affecting the entire simulation");

        formBuilder.append(NUMBER_OF_TURNS_LABEL_TEXT, numberOfTurnsField);
        formBuilder.append(NUMBER_OF_TIMESTEPS_TO_IGNORE_LABEL_TEXT, numberTimestepsIgnored);

        appendCheckBoxFieldToPresentation(formBuilder, UPDATE_CHARTS_LABEL_TEXT, onLineChartsCheckBox);
        appendCheckBoxFieldToPresentation(formBuilder, DISPLAY_ADVANCED_CHARTS_LABEL_TEXT,
                advancedChartsCheckBox);
    }

    appendBannerToPresentation(formBuilder, title);

    final DefaultMutableTreeNode parentNode = (parent == null) ? parameterValueComponentTree
            : findParameterInfoNode(parent, false);

    final List<ParameterInfo> info = new ArrayList<ParameterInfo>();

    // Search for a @ConfigurationComponent annotation
    {
        String headerText = "", imagePath = "";
        final Class<?> parentType = parent == null ? currentModelHandler.getModelClass()
                : parent.getActualType();
        for (final Annotation element : parentType.getAnnotations()) { // Proxies
            if (element.annotationType().getName() != ConfigurationComponent.class.getName())
                continue;
            boolean doBreak = false;
            try {
                try {
                    headerText = (String) element.annotationType().getMethod("Description").invoke(element);
                    if (headerText.startsWith("#")) {
                        headerText = (String) parent.getActualType().getMethod(headerText.substring(1))
                                .invoke(parent.getInstance());
                    }
                    doBreak = true;
                } catch (IllegalArgumentException e) {
                } catch (SecurityException e) {
                } catch (IllegalAccessException e) {
                } catch (InvocationTargetException e) {
                } catch (NoSuchMethodException e) {
                }
            } catch (final Exception e) {
            }
            try {
                imagePath = (String) element.annotationType().getMethod("ImagePath").invoke(element);
                doBreak = true;
            } catch (IllegalArgumentException e) {
            } catch (SecurityException e) {
            } catch (IllegalAccessException e) {
            } catch (InvocationTargetException e) {
            } catch (NoSuchMethodException e) {
            }
            if (doBreak)
                break;
        }
        if (!headerText.isEmpty())
            appendHeaderTextToPresentation(formBuilder, headerText);
        if (!imagePath.isEmpty())
            appendImageToPresentation(formBuilder, imagePath);
    }

    if (metadata.isEmpty()) {
        // No fields to display.
        appendTextToPresentation(formBuilder, "No configuration is required for this module.");
    } else {
        for (final ParameterMetaData record : metadata) {
            final ai.aitia.meme.paramsweep.batch.param.ParameterInfo<?> batchParameterInfo = record.parameter;

            if (!record.banner.isEmpty())
                appendBannerToPresentation(formBuilder, record.banner);
            if (!record.imageFileName.isEmpty())
                appendImageToPresentation(formBuilder, record.imageFileName);
            appendTextToPresentation(formBuilder, record.verboseDescription);

            final ParameterInfo parameterInfo = InfoConverter.parameterInfo2ParameterInfo(batchParameterInfo);
            if (parent != null && parameterInfo instanceof ISubmodelGUIInfo) {
                //               sgi.setParentValue(parent.getActualType());
            }

            final JComponent field;
            final DefaultMutableTreeNode oldNode = findParameterInfoNode(parameterInfo, true);
            Pair<ParameterInfo, JComponent> userData = null;
            JComponent oldField = null;
            if (oldNode != null) {
                userData = (Pair<ParameterInfo, JComponent>) oldNode.getUserObject();
                oldField = userData.getSecond();
            }

            if (parameterInfo.isBoolean()) {
                field = new JCheckBox();
                boolean value = oldField != null ? ((JCheckBox) oldField).isSelected()
                        : ((Boolean) batchParameterInfo.getDefaultValue()).booleanValue();
                ((JCheckBox) field).setSelected(value);
            } else if (parameterInfo.isEnum() || parameterInfo instanceof MasonChooserParameterInfo) {
                Object[] elements = null;
                if (parameterInfo.isEnum()) {
                    final Class<Enum<?>> type = (Class<Enum<?>>) parameterInfo.getJavaType();
                    elements = type.getEnumConstants();
                } else {
                    final MasonChooserParameterInfo chooserInfo = (MasonChooserParameterInfo) parameterInfo;
                    elements = chooserInfo.getValidStrings();
                }
                final JComboBox list = new JComboBox(elements);

                if (parameterInfo.isEnum()) {
                    final Object value = oldField != null ? ((JComboBox) oldField).getSelectedItem()
                            : parameterInfo.getValue();
                    list.setSelectedItem(value);
                } else {
                    final int value = oldField != null ? ((JComboBox) oldField).getSelectedIndex()
                            : (Integer) parameterInfo.getValue();
                    list.setSelectedIndex(value);
                }

                field = list;
            } else if (parameterInfo instanceof SubmodelInfo) {
                final SubmodelInfo submodelInfo = (SubmodelInfo) parameterInfo;
                final Object[] elements = new Object[] { "Loading class information..." };
                final JComboBox list = new JComboBox(elements);
                //            field = list;

                final Object value = oldField != null
                        ? ((JComboBox) ((JPanel) oldField).getComponent(0)).getSelectedItem()
                        : new ClassElement(submodelInfo.getActualType(), null);

                new ClassCollector(this, list, submodelInfo, value, submodelSelectionWithoutNotify).execute();

                final JButton rightButton = new JButton();
                rightButton.setOpaque(false);
                rightButton.setRolloverEnabled(true);
                rightButton.setIcon(SHOW_SUBMODEL_ICON);
                rightButton.setRolloverIcon(SHOW_SUBMODEL_ICON_RO);
                rightButton.setDisabledIcon(SHOW_SUBMODEL_ICON_DIS);
                rightButton.setBorder(null);
                rightButton.setToolTipText("Display submodel parameters");
                rightButton.setActionCommand(ACTIONCOMMAND_SHOW_SUBMODEL);
                rightButton.addActionListener(new ActionListener() {

                    @Override
                    public void actionPerformed(ActionEvent arg0) {
                        if (parameterInfo instanceof SubmodelInfo) {
                            SubmodelInfo submodelInfo = (SubmodelInfo) parameterInfo;
                            int level = 0;

                            showHideSubparameters(list, submodelInfo);

                            List<String> components = new ArrayList<String>();
                            components.add(submodelInfo.getName());
                            while (submodelInfo.getParent() != null) {
                                submodelInfo = submodelInfo.getParent();
                                components.add(submodelInfo.getName());
                                level++;
                            }
                            Collections.reverse(components);
                            final String[] breadcrumbText = components.toArray(new String[components.size()]);
                            for (int i = 0; i < breadcrumbText.length; ++i)
                                breadcrumbText[i] = breadcrumbText[i].replaceAll("([A-Z])", " $1");
                            breadcrumb.setPath(
                                    currentModelHandler.getModelClassSimpleName().replaceAll("([A-Z])", " $1"),
                                    breadcrumbText);
                            Style.apply(breadcrumb, dashboard.getCssStyle());

                            // reset all buttons that are nested deeper than this to default color
                            for (int i = submodelButtons.size() - 1; i >= level; i--) {
                                JButton button = submodelButtons.get(i);
                                button.setIcon(SHOW_SUBMODEL_ICON);
                                submodelButtons.remove(i);
                            }

                            rightButton.setIcon(SHOW_SUBMODEL_ICON_RO);
                            submodelButtons.add(rightButton);
                        }
                    }
                });

                field = new JPanel(new BorderLayout());
                field.add(list, BorderLayout.CENTER);
                field.add(rightButton, BorderLayout.EAST);
            } else if (File.class.isAssignableFrom(parameterInfo.getJavaType())) {
                field = new JPanel(new BorderLayout());

                String oldName = "";
                String oldPath = "";
                if (oldField != null) {
                    final JTextField oldTextField = (JTextField) oldField.getComponent(0);
                    oldName = oldTextField.getText();
                    oldPath = oldTextField.getToolTipText();
                } else if (parameterInfo.getValue() != null) {
                    final File file = (File) parameterInfo.getValue();
                    oldName = file.getName();
                    oldPath = file.getAbsolutePath();
                }

                final JTextField textField = new JTextField(oldName);
                textField.setToolTipText(oldPath);
                textField.setInputVerifier(new InputVerifier() {

                    @Override
                    public boolean verify(final JComponent input) {
                        final JTextField inputField = (JTextField) input;
                        if (inputField.getText() == null || inputField.getText().isEmpty()) {
                            final File file = new File("");
                            inputField.setToolTipText(file.getAbsolutePath());
                            hideError();
                            return true;
                        }

                        final File oldFile = new File(inputField.getToolTipText());
                        if (oldFile.exists() && oldFile.getName().equals(inputField.getText().trim())) {
                            hideError();
                            return true;
                        }

                        inputField.setToolTipText("");
                        final File file = new File(inputField.getText().trim());
                        if (file.exists()) {
                            inputField.setToolTipText(file.getAbsolutePath());
                            inputField.setText(file.getName());
                            hideError();
                            return true;
                        } else {
                            final PopupFactory popupFactory = PopupFactory.getSharedInstance();
                            final Point locationOnScreen = inputField.getLocationOnScreen();
                            final JLabel message = new JLabel("Please specify an existing file!");
                            message.setBorder(new LineBorder(Color.RED, 2, true));
                            if (errorPopup != null)
                                errorPopup.hide();
                            errorPopup = popupFactory.getPopup(inputField, message, locationOnScreen.x - 10,
                                    locationOnScreen.y - 30);
                            errorPopup.show();
                            return false;
                        }
                    }
                });

                final JButton browseButton = new JButton(BROWSE_BUTTON_TEXT);
                browseButton.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        final JFileChooser fileDialog = new JFileChooser(
                                !"".equals(textField.getToolTipText()) ? textField.getToolTipText()
                                        : currentDirectory);
                        if (!"".equals(textField.getToolTipText()))
                            fileDialog.setSelectedFile(new File(textField.getToolTipText()));
                        int dialogResult = fileDialog.showOpenDialog(dashboard);
                        if (dialogResult == JFileChooser.APPROVE_OPTION) {
                            final File selectedFile = fileDialog.getSelectedFile();
                            if (selectedFile != null) {
                                currentDirectory = selectedFile.getAbsoluteFile().getParent();
                                textField.setText(selectedFile.getName());
                                textField.setToolTipText(selectedFile.getAbsolutePath());
                            }
                        }
                    }
                });

                field.add(textField, BorderLayout.CENTER);
                field.add(browseButton, BorderLayout.EAST);
            } else if (parameterInfo instanceof MasonIntervalParameterInfo) {
                final MasonIntervalParameterInfo intervalInfo = (MasonIntervalParameterInfo) parameterInfo;

                field = new JPanel(new BorderLayout());

                String oldValueStr = String.valueOf(parameterInfo.getValue());
                if (oldField != null) {
                    final JTextField oldTextField = (JTextField) oldField.getComponent(0);
                    oldValueStr = oldTextField.getText();
                }

                final JTextField textField = new JTextField(oldValueStr);

                PercentJSlider tempSlider = null;
                if (intervalInfo.isDoubleInterval())
                    tempSlider = new PercentJSlider(intervalInfo.getIntervalMin().doubleValue(),
                            intervalInfo.getIntervalMax().doubleValue(), Double.parseDouble(oldValueStr));
                else
                    tempSlider = new PercentJSlider(intervalInfo.getIntervalMin().longValue(),
                            intervalInfo.getIntervalMax().longValue(), Long.parseLong(oldValueStr));

                final PercentJSlider slider = tempSlider;
                slider.setMajorTickSpacing(100);
                slider.setMinorTickSpacing(10);
                slider.setPaintTicks(true);
                slider.setPaintLabels(true);
                slider.addChangeListener(new ChangeListener() {
                    public void stateChanged(final ChangeEvent _) {
                        if (slider.hasFocus()) {
                            final String value = intervalInfo.isDoubleInterval()
                                    ? String.valueOf(slider.getDoubleValue())
                                    : String.valueOf(slider.getLongValue());
                            textField.setText(value);
                            slider.setToolTipText(value);
                        }
                    }
                });

                textField.setInputVerifier(new InputVerifier() {
                    public boolean verify(JComponent input) {
                        final JTextField inputField = (JTextField) input;

                        try {
                            hideError();
                            final String valueStr = inputField.getText().trim();
                            if (intervalInfo.isDoubleInterval()) {
                                final double value = Double.parseDouble(valueStr);
                                if (intervalInfo.isValidValue(valueStr)) {
                                    slider.setValue(value);
                                    return true;
                                } else
                                    showError(
                                            "Please specify a value between " + intervalInfo.getIntervalMin()
                                                    + " and " + intervalInfo.getIntervalMax() + ".",
                                            inputField);
                                return false;
                            } else {
                                final long value = Long.parseLong(valueStr);
                                if (intervalInfo.isValidValue(valueStr)) {
                                    slider.setValue(value);
                                    return true;
                                } else {
                                    showError("Please specify an integer value between "
                                            + intervalInfo.getIntervalMin() + " and "
                                            + intervalInfo.getIntervalMax() + ".", inputField);
                                    return false;
                                }
                            }
                        } catch (final NumberFormatException _) {
                            final String message = "The specified value is not a"
                                    + (intervalInfo.isDoubleInterval() ? "" : "n integer") + " number.";
                            showError(message, inputField);
                            return false;
                        }

                    }
                });

                textField.getDocument().addDocumentListener(new DocumentListener() {
                    //               private Popup errorPopup;

                    public void removeUpdate(final DocumentEvent _) {
                        textFieldChanged();
                    }

                    public void insertUpdate(final DocumentEvent _) {
                        textFieldChanged();
                    }

                    public void changedUpdate(final DocumentEvent _) {
                        textFieldChanged();
                    }

                    private void textFieldChanged() {
                        if (!textField.hasFocus()) {
                            hideError();
                            return;
                        }

                        try {
                            hideError();
                            final String valueStr = textField.getText().trim();
                            if (intervalInfo.isDoubleInterval()) {
                                final double value = Double.parseDouble(valueStr);
                                if (intervalInfo.isValidValue(valueStr))
                                    slider.setValue(value);
                                else
                                    showError("Please specify a value between " + intervalInfo.getIntervalMin()
                                            + " and " + intervalInfo.getIntervalMax() + ".", textField);
                            } else {
                                final long value = Long.parseLong(valueStr);
                                if (intervalInfo.isValidValue(valueStr))
                                    slider.setValue(value);
                                else
                                    showError("Please specify an integer value between "
                                            + intervalInfo.getIntervalMin() + " and "
                                            + intervalInfo.getIntervalMax() + ".", textField);
                            }
                        } catch (final NumberFormatException _) {
                            final String message = "The specified value is not a"
                                    + (intervalInfo.isDoubleInterval() ? "" : "n integer") + " number.";
                            showError(message, textField);
                        }
                    }
                });

                field.add(textField, BorderLayout.CENTER);
                field.add(slider, BorderLayout.SOUTH);
            } else {
                final Object value = oldField != null ? ((JTextField) oldField).getText()
                        : parameterInfo.getValue();
                field = new JTextField(value.toString());
                ((JTextField) field).addActionListener(new ActionListener() {

                    @Override
                    public void actionPerformed(final ActionEvent e) {
                        wizard.clickDefaultButton();
                    }
                });
            }

            final JLabel parameterLabel = new JLabel(record.fieldName);

            final String description = parameterInfo.getDescription();
            if (description != null && !description.isEmpty()) {
                parameterLabel.addMouseListener(new MouseAdapter() {

                    @Override
                    public void mouseEntered(final MouseEvent e) {
                        final DescriptionPopupFactory popupFactory = DescriptionPopupFactory.getInstance();

                        final Popup parameterDescriptionPopup = popupFactory.getPopup(parameterLabel,
                                description, dashboard.getCssStyle());

                        parameterDescriptionPopup.show();
                    }

                });
            }

            if (oldNode != null)
                userData.setSecond(field);
            else {
                final Pair<ParameterInfo, JComponent> pair = new Pair<ParameterInfo, JComponent>(parameterInfo,
                        field);
                final DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(pair);
                parentNode.add(newNode);
            }

            if (field instanceof JCheckBox) {
                parameterLabel
                        .setText("<html><div style=\"margin-bottom: 4pt; margin-top: 6pt; margin-left: 4pt\">"
                                + parameterLabel.getText() + "</div></html>");
                formBuilder.append(parameterLabel, field);

                //            appendCheckBoxFieldToPresentation(
                //               formBuilder, parameterLabel.getText(), (JCheckBox) field);
            } else {
                formBuilder.append(parameterLabel, field);
                final CellConstraints constraints = formBuilder.getLayout().getConstraints(parameterLabel);
                constraints.vAlign = CellConstraints.TOP;
                constraints.insets = new Insets(5, 0, 0, 0);
                formBuilder.getLayout().setConstraints(parameterLabel, constraints);
            }

            // prepare the parameterInfo for the param sweeps
            parameterInfo.setRuns(0);
            parameterInfo.setDefinitionType(ParameterInfo.CONST_DEF);
            parameterInfo.setValue(batchParameterInfo.getDefaultValue());
            info.add(parameterInfo);
        }
    }
    appendVerticalSpaceToPresentation(formBuilder);

    final JPanel panel = formBuilder.getPanel();
    singleRunParametersPanel.add(panel);

    if (singleRunParametersPanel.getComponentCount() > 1) {
        panel.setBorder(
                BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(0, 1, 0, 0, Color.GRAY),
                        BorderFactory.createEmptyBorder(0, 5, 0, 5)));
    } else {
        panel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    }

    Style.apply(panel, dashboard.getCssStyle());

    return info;
}

From source file:eu.crisis_economics.abm.dashboard.Page_Results.java

License:Open Source License

/**
 * Displays the charts which are pre-selected in the model
 * <p>/*w  ww .  jav a 2  s .c o  m*/
 * This method will display charts in the index box. It will display all the charts it can out of a list of known
 * data which may be in the model results file.
 * 
 * @param results the parameters and the results of a given run
 */
public void displayCharts(final Run results, boolean displayAdvancedCharts, final int numInitialStepsToIgnore,
        final boolean partialResults) {
    final CardLayout layout = (CardLayout) getPanel().getLayout();
    layout.show(getPanel(), "CHARTS");

    results.ignoreInitialResults(numInitialStepsToIgnore);
    //      Set<String> seriesNames = results.resultNames();    //all the names of datasets in the results map
    this.advancedCharts = displayAdvancedCharts;
    double[] turnList = new double[results.getResults(TURN_SERIES_NAME).size()]; //the list of time values in each iteration of the simulation (which may be variable-length steps!)

    //make the list of time-steps using a loop
    int i = 0;
    for (Object turn : results.getResults(TURN_SERIES_NAME)) {
        turnList[i++] = ((Number) turn).doubleValue();
    }

    //Make color palette
    int colorCounter = 0;
    final ArrayList<Color> colors = new ArrayList<Color>();
    java.util.Random rand = new java.util.Random();
    for (colorCounter = 0; colorCounter < results.getResultsSize(); colorCounter++) {
        Color c = new Color(rand.nextFloat(), rand.nextFloat(), rand.nextFloat());
        colors.add(c);
    }

    //new experimental pane to replace the tabbed one used previously, which can keep track of multiple experiments.
    //JOutlookBar experimentPane = new JOutlookBar(false);

    JTabbedPane experimentPane = new JTabbedPane(SwingConstants.LEFT, JTabbedPane.WRAP_TAB_LAYOUT);

    int experimentCount = 1;
    if (experimentCounts.containsKey(dashboard.getModelHandler().getModelClass().getName())) {
        experimentCount = experimentCounts.get(dashboard.getModelHandler().getModelClass().getName());
        experimentCount++;
    }
    indexBox.addTab(dashboard.getModelHandler().getModelClass().getSimpleName() + " " + experimentCount,
            experimentPane);
    experimentCounts.put(dashboard.getModelHandler().getModelClass().getName(), experimentCount);

    indexBox.setSelectedIndex(indexBox.getTabCount() - 1);

    JOutlookBar miscPane = new JOutlookBar();
    JOutlookBar banksPane = new JOutlookBar();
    JOutlookBar banksPane2 = new JOutlookBar();
    JOutlookBar centralBankPane = new JOutlookBar();
    JOutlookBar firmsPane = new JOutlookBar();
    JOutlookBar firmsStatisticsPane = new JOutlookBar();
    JOutlookBar firmsPane2 = new JOutlookBar();
    JOutlookBar firmsStatisticsPane2 = new JOutlookBar();
    JOutlookBar fundsPane = new JOutlookBar();
    JOutlookBar governmentPane = new JOutlookBar();
    JOutlookBar householdsPane = new JOutlookBar();
    JOutlookBar householdsStatisticsPane = new JOutlookBar();
    JOutlookBar globalTimePane = new JOutlookBar();
    JOutlookBar globalTimePane2 = new JOutlookBar();
    JOutlookBar globalTimePane3 = new JOutlookBar();
    JOutlookBar globalScatterPane = new JOutlookBar();
    JOutlookBar optimizePane = new JOutlookBar();

    experimentPane.addTab("Parameters", miscPane);
    experimentPane.addTab("Banks", banksPane);
    experimentPane.addTab("Banks 2", banksPane2);
    if (true) { // !(dashboard.getModelHandler().getModelClass().getName().equals(MarketClearingModel.class.getName()))){
        //      if (! dashboard.getModelHandler().getModelClass().getName().equals(MarketClearingModel.class.getName())){
        experimentPane.addTab("Central Bank", centralBankPane);
    }
    if (advancedCharts) {
        experimentPane.addTab("Firms", firmsPane);
        experimentPane.addTab("Firms 2", firmsPane2);
    }
    experimentPane.addTab("Firms' Summary Statistics", firmsStatisticsPane);
    experimentPane.addTab("Firms' Summary Statistics 2", firmsStatisticsPane2);
    //      if (dashboard.getModelHandler().getModelClass().getName().equals(AbstractModel.class.getName())){
    experimentPane.addTab("Funds", fundsPane);
    experimentPane.addTab("Government", governmentPane);
    if (advancedCharts) {
        experimentPane.addTab("Households", householdsPane);
    }
    experimentPane.addTab("Households' Summary Statistics", householdsStatisticsPane);
    //      }
    experimentPane.addTab("Global Time Series 1", globalTimePane);
    experimentPane.addTab("Global Time Series 2", globalTimePane2);
    experimentPane.addTab("Global Time Series 3", globalTimePane3);
    experimentPane.addTab("Global Scatter Plots", globalScatterPane);
    experimentPane.addTab("Optimization", optimizePane);

    // first of all, add the parameters
    DefaultFormBuilder formBuilder = FormsUtils.build("l:p ~ l:p", "");
    //      Set<String> parameterNames = results.parameterNames();
    TreeSet<String> parameterNames = new TreeSet<String>(results.parameterNames());
    for (String parameterName : parameterNames) {
        formBuilder.append(new JLabel(parameterName),
                new JLabel(results.getParameter(parameterName).toString()));
    }
    JPanel parameterPanel = formBuilder.getPanel();
    Style.registerCssClasses(parameterPanel, ".commonPanel");

    miscPane.addBar("Parameters", new JScrollPane(parameterPanel));
    JComponent plotObjects;

    //plot BANK CAPITAL ADEQUACY RATIO - getCapitalAdequacyRatio() method
    plotObjects = multiPlotObjects(results, "bankCapitalAdequacyRatio", "Time",
            "Banks' Capital Adequacy Ratios", false, colors, true);
    if (plotObjects != null) {
        banksPane.addBar("Capital Adequacy Ratio", new JScrollPane(plotObjects));
    }

    //plot BANK CASH RESERVES - getBankCashOverTime() method in Simulation.java
    plotObjects = multiPlotObjects(results, "bankCashReserves", "Time", "Banks' Cash Reserves (monetary units)",
            false, colors, true);
    if (plotObjects != null) {
        banksPane.addBar("Cash Reserves", new JScrollPane(plotObjects));
    }

    //plot BANKS' COMMERCIAL LOANS (ALSO KNOWN AS CREDIT) - bank loans to non-banks such as firms and households, getCommercialLoans() in Bank.java
    plotObjects = multiPlotObjects(results, "bankCommercialLoans", "Time",
            "Banks' Loans to Non-Banks (monetary units)", false, colors, true);
    if (plotObjects != null) {
        banksPane.addBar("Commercial Loans (Credit)", new JScrollPane(plotObjects));
    }

    //plot BANKS' INTERBANK LOANS - bank loans to banks, getInterbankLoans() in Bank.java
    plotObjects = multiPlotObjects(results, "bankInterbankLoans", "Time",
            "Banks' Loans to other Banks on the Interbank Market (monetary units)", false, colors,
            advancedCharts);
    if (plotObjects != null) {
        banksPane.addBar("Interbank Loans", new JScrollPane(plotObjects));
    }

    /*      //plot BANKS' TOTAL LOANS - bank loans to all agents, getLoans() in Bank.java
          plotObjects = multiPlotObjects(results, "bankLoans", "Time", "Banks' Total Loans (monetary units)",true, colors, true);
          if (plotObjects != null){
             banksPane.addBar("Loans (Total)", new JScrollPane(plotObjects));
          }      
    */

    //      if (dashboard.getModelHandler().getModelClass().getName().equals(AbstractModel.class.getName())) 
    {
        //plot BANK TOTAL DEPOSIT ACCOUNT VALUES (NOTE CONTAINS DEPOSITS FROM NOT ONLY HOUSEHOLDS, BUT ALSO FIRMS... NOT SURE BUT POSSIBLY EVEN BANKS???) - method in Simulation.java
        plotObjects = multiPlotObjects(results, "bankDepositAccountHoldings", "Time",
                "Banks' Total Deposit Account Holdings (firms and households if included in the model) (monetary units)",
                false, colors, true);
        if (plotObjects != null) {
            banksPane.addBar("Deposit Account Holdings", new JScrollPane(plotObjects));
        }

        //plot BANK DEPOSITS FROM HOUSEHOLDS ONLY - method getBankDepositsFromHouseholds()
        plotObjects = multiPlotObjects(results, "bankDepositsFromHouseholds", "Time",
                "Banks' Deposits from the Household Sector (monetary units)", false, colors, true);
        if (plotObjects != null) {
            banksPane2.addBar("Deposits from Households", new JScrollPane(plotObjects));
        }
    }
    /*      else// if ((dashboard.getModelHandler().getModelClass().getName().equals(MarketClearingModel.class.getName()))||(dashboard.getModelHandler().getModelClass().getName().equals(MarketClearingModelWithCentralBank.class.getName()))) 
          {
             //plot BANK TOTAL DEPOSIT ACCOUNT VALUES - method in Simulation.java
             plotObjects = multiPlotObjects(results, "bankDepositAccountHoldings", "Time", "Banks' Total Deposit Account Holdings (from firms) (monetary units)", false, colors, true);
             if (plotObjects != null){
    banksPane.addBar("Deposit Account Holdings", new JScrollPane(plotObjects));
             }
          }
    */
    //      else {System.out.println("Model class case not in Page_Results.java");}               

    //plot BANK EQUITY - method in agent.java
    plotObjects = multiPlotObjects(results, "bankEquity", "Time", "Banks' Equity (monetary units)", false,
            colors);
    if (plotObjects != null) {
        banksPane2.addBar("Equity", new JScrollPane(plotObjects));
    }

    //plot BANK LEVERAGE - method in Simulation.java
    plotObjects = multiPlotObjects(results, "BankLeverage", "Time", "Banks' Leverage (total assets / equity)",
            false, colors);
    if (plotObjects != null) {
        banksPane2.addBar("Leverage", new JScrollPane(plotObjects));
    }

    //plot BANK RISK WEIGHTED ASSETS RATIO - getRiskWeightedAssets() method in Bank.java
    plotObjects = multiPlotObjects(results, "bankRiskWeightedAssets", "Time",
            "Banks' Risk-Weighted Assets (monetary units)", false, colors, true);
    if (plotObjects != null) {
        banksPane2.addBar("Risk-Weighted Assets", new JScrollPane(plotObjects));
    }

    //plot BANK STOCK PRICE - note this uses methods for getMarketValue() method in AbstractModel.java
    plotObjects = multiPlotObjects(results, "bankStockPrice", "Time", "Banks' Stock Prices (monetary units)",
            false, colors, advancedCharts);
    if (plotObjects != null) {
        banksPane2.addBar("Stock Prices", new JScrollPane(plotObjects));
    }

    //plot BANK TOTAL ASSETS - method in Simulation.java
    plotObjects = multiPlotObjects(results, "bankTotalAssets", "Time",
            "Banks' Total Assets on their Balance Sheets (monetary units)", false, colors);
    if (plotObjects != null) {
        banksPane2.addBar("Total Assets", new JScrollPane(plotObjects));
    }

    JComponent graphContainer; //Need for using miscBox in Central Bank Indicators and Global Indicators below
    //CENTRAL BANK INDICATORS UNDER ONE TAB USING MISC BOX///////////////////////////////////////////////////////////////////////////////   
    if (true) { // !(dashboard.getModelHandler().getModelClass().getName().equals(MarketClearingModel.class.getName()))){

        Box.createVerticalBox();

        //plot CENTRAL BANK REFINANCING AND OVERNIGHT DEPOSIT INTEREST RATE (rate banks borrow from / lend to central bank) using getKeyInterestRate() and getCBovernightDepositRate() methods in MarketClearingModelWithCentralBank.java, refinancing rate is the target interest rate plus a spread, note the Overnight Deposit rate at the central bank is the target interest rate minus the spread (see CentralBankStrategy.java)
        graphContainer = plotNVariables(new String[] { "CBrefinancingRate", "CBovernightDepositRate" }, results,
                turnList, "Time",
                new String[] {
                        "Central Bank Refinancing and Overnight Deposit Rates (cost of borrowing from / lending to Central Bank)" },
                true, false, false, colors);
        if (graphContainer != null) {
            centralBankPane.addBar("Refinancing and Deposit Rates", new JScrollPane(graphContainer));
            //               miscBox2.add(graphContainer);               
        }

        //plot getBankCashOverTime() method in Simulation.java, and getNegativeAggregateBankLiabilitiesToCentralBank() and getAggregateBankCashReservesMinusLiabilitiesToCentralBank() in MarketClearingModelWithCentralBank.java
        graphContainer = plotNVariables(
                new String[] { "sum(bankCashReserves)", "negativeAggregateBankLiabilitiesToCentralBank",
                        "aggregateBankCashReservesMinusLiabilitiesToCentralBank" },
                results, turnList, "Time",
                new String[] {
                        "Aggregate Banks' Cash Reserves, Banks' Liabilities to Central Bank and the Net Value (monetary units)" },
                true, false, false, colors, true);
        if (graphContainer != null) {
            centralBankPane.addBar("Banking Sector Deposits and Liabilities", new JScrollPane(graphContainer));
            //               miscBox2.add(graphContainer);
        }

        //Method getCBLoanVolume() in MarketClearingModelWithCentralBank.java
        graphContainer = plotNVariables(new String[] { "CBLoanVolume" }, results, turnList, "Time",
                new String[] { "Volume of Loans from Central Bank (monetary units)" }, true, false, false,
                colors, true);
        if (graphContainer != null) {
            centralBankPane.addBar("Loan Volume", new JScrollPane(graphContainer));
            //               miscBox2.add(graphContainer);
        }

        //Method getOvernightVolume() in MarketClearingModelWithCentralBank.java
        graphContainer = plotNVariables(new String[] { "CBdepositVolume" }, results, turnList, "Time",
                new String[] { "Volume of Overnight Deposits lent to Central Bank (monetary units)" }, true,
                false, false, colors, true);
        if (graphContainer != null) {
            centralBankPane.addBar("Deposit Volume", new JScrollPane(graphContainer));
            //               miscBox2.add(graphContainer);
        }

    }
    //END OF CENTRAL BANK INDICATORS//////////////////////////////////////////////////////////////////////////////////////////////////

    //plot FIRM DIVIDEND - method in StockReleasingFirm.java
    plotObjects = multiPlotObjects(results, "firmDividend", "Time", "Firms' Dividend Payout (monetary units)",
            true, colors, advancedCharts);
    if (plotObjects != null) {
        firmsPane.addBar("Dividend Payout", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "firmDividend", false, false, colors, true);
    if (plotObjects != null) {
        firmsStatisticsPane.addBar("Dividend Payout Stats", new JScrollPane(plotObjects));
    }

    //plot FIRM EQUITY VALUE - method in Agent.java
    plotObjects = multiPlotObjects(results, "firmEquity", "Time", "Firms' Equity (monetary units)", true,
            colors, advancedCharts);
    if (plotObjects != null) {
        firmsPane.addBar("Equity", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "firmEquity", false, false, colors, true);
    if (plotObjects != null) {
        firmsStatisticsPane.addBar("Equity Stats", new JScrollPane(plotObjects));
    }

    //plot FIRMS' LOANS PER EQUITY - getLoansPerEquity() in LoanStrategyFirm.java, is this correct for I-O model too?  Ross
    plotObjects = multiPlotObjects(results, "firmLoansPerEquity", "Time", "Firms' Loans Per Equity", true,
            colors, advancedCharts);
    if (plotObjects != null) {
        firmsPane.addBar("Loans Per Equity", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "firmLoansPerEquity", false, false, colors, true);
    if (plotObjects != null) {
        firmsStatisticsPane.addBar("Loans Per Equity Stats", new JScrollPane(plotObjects));
    }

    //plot FIRMS' LOANS AS A PROPORTION OF LOANS + EQUITY - getLoansDividedByLoansPlusEquity() in LoanStrategyFirm.java, is this correct for I-O model too?  Ross
    plotObjects = multiPlotObjects(results, "firmLoansDividedByLoansPlusEquity", "Time",
            "Firms' Loans As a Proportion of their Total Loans Plus Equity", true, colors, advancedCharts);
    if (plotObjects != null) {
        firmsPane.addBar("Loans / (Loans + Equity)", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "firmLoansDividedByLoansPlusEquity", false, false, colors,
            true);
    if (plotObjects != null) {
        firmsStatisticsPane.addBar("Loans / (Loans + Equity) Stats", new JScrollPane(plotObjects));
    }

    //plot FIRMS' GOODS SELLING PRICES - getSellingPrice() in MacroFirm.java (only applicable for I-O model)
    plotObjects = multiPlotObjects(results, "firmGoodsSellingPrice", "Time",
            "Firms' Selling Price for Output Goods (monetary units)", true, colors, advancedCharts);
    if (plotObjects != null) {
        firmsPane.addBar("Output Prices", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "firmGoodsSellingPrice", false, false, colors, true);
    if (plotObjects != null) {
        firmsStatisticsPane.addBar("Output Prices Stats", new JScrollPane(plotObjects));
    }

    //plot FIRM MARKET CAPITALIZATION - getMarketCapitalization() in StockReleasingFirm.java
    plotObjects = multiPlotObjects(results, "firmMarketCapitalization", "Time",
            "Firms' Market Capitalization (monetary units)", true, colors, advancedCharts);
    if (plotObjects != null) {
        firmsPane.addBar("Market Capitalization", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "firmMarketCapitalization", false, false, colors, true);
    if (plotObjects != null) {
        firmsStatisticsPane.addBar("Market Capitalization Stats", new JScrollPane(plotObjects));
    }

    //plot FIRM PRODUCTION - getProduction() in LoanStrategyFirm.java and MacroFirm.java
    plotObjects = multiPlotObjects(results, "firmProduction", "Time", "Firms' Production (units produced)",
            true, colors, advancedCharts);
    if (plotObjects != null) {
        firmsPane.addBar("Production", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "firmProduction", false, false, colors, true);
    if (plotObjects != null) {
        firmsStatisticsPane.addBar("Production Stats", new JScrollPane(plotObjects));
    }

    //plot FIRM PROFIT - getProfit() method in Simulation.java for Fixed Labour market (formerly Cobb-Douglas model) looking at LoanStrategyFirms' getTellProfit() method.  For AbstractModel.java (I-O model), new getProfit() method written picking up profit from MacroFirm.java getProfit() method - Ross
    plotObjects = multiPlotObjects(results, "firmProfit", "Time", "Firms' Profits (monetary units)", true,
            colors, advancedCharts);
    if (plotObjects != null) {
        firmsPane2.addBar("Profits", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "firmProfit", false, false, colors, true);
    if (plotObjects != null) {
        firmsStatisticsPane2.addBar("Profits Stats", new JScrollPane(plotObjects));
    }

    //plot FIRM NUMBER OF SHARES - StockReleasingFirm#getNumberOfEmittedShares()
    plotObjects = multiPlotObjects(results, "firmNumberOfEmittedShares", "Time",
            "Firms' Quantity of Outstanding Shares (number of shares)", true, colors, advancedCharts);
    if (plotObjects != null) {
        firmsPane2.addBar("Number of Shares", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "firmNumberOfEmittedShares", false, false, colors, true);
    if (plotObjects != null) {
        firmsStatisticsPane2.addBar("Number of Shares Stats", new JScrollPane(plotObjects));
    }

    //plot FIRM REVENUE - LoanStrategyFirm::getRevenue() and MacroFirm::getRevenue() for Fixed Labour market (formerly Cobb-Douglas) models and I-O macro models respectively.
    plotObjects = multiPlotObjects(results, "firmRevenue", "Time", "Firms' Revenue (monetary units)", true,
            colors, advancedCharts);
    if (plotObjects != null) {
        firmsPane2.addBar("Revenue", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "firmRevenue", false, false, colors, true);
    if (plotObjects != null) {
        firmsStatisticsPane2.addBar("Revenue Stats", new JScrollPane(plotObjects));
    }

    //plot FIRM STOCK PRICE - note this uses methods for getMarketValue() method in ClearingFirm.java (for models relying on the market clearing mechanism) that returns stock price rather than market capitalization.  Note there is an old version of getMarketValue in StockReleasingFirm.java but that is a relic of Limit Order Book models.
    plotObjects = multiPlotObjects(results, "firmStockPrice", "Time", "Firms' Stock Prices (monetary units)",
            false, colors, advancedCharts);
    if (plotObjects != null) {
        firmsPane2.addBar("Stock Prices", new JScrollPane(plotObjects));
    }

    // 10th, 20th, 30th ... Firm Stock Price Percentiles 
    {
        List<Color> sunrisePalette = new ArrayList<Color>();
        for (int j = 1; j <= 10; ++j)
            sunrisePalette.add(new Color(1.f, j / 10.f, 0.f));
        plotObjects = multiPlotObjects(results, "FirmPercentileStockPrices", "Time",
                "Firms' Stock Prices - 10%, 20%, 30% ... Deciles", false, sunrisePalette, advancedCharts);
        if (plotObjects != null) {
            firmsPane2.addBar("Stock Prices Deciles", new JScrollPane(plotObjects));
        }
    }

    plotObjects = plotSummaryStats(results, turnList, "firmStockPrice", false, false, colors, true);
    if (plotObjects != null) {
        firmsStatisticsPane2.addBar("Stock Prices Stats", new JScrollPane(plotObjects));
    }

    /*      //plot FIRM CHANGE IN STOCK PRICE - method in ClearingFirm.java
          plotObjects = multiPlotObjects(results, "firmLastChangeInStockPrice", "Time", "Firms' Change in Stock Price (monetary units)",true, colors, advancedCharts);
          if (plotObjects != null){
             firmsPane.addBar("Stock Price Change", new JScrollPane(plotObjects));
          }
    */

    //plot FIRM LOG STOCK RETURN (log(P_t/P_t-1)) - method in ClearingFirm.java
    plotObjects = multiPlotObjects(results, "firmLogStockReturn", "Time",
            "Firms' Log Stock Returns (log(Price_t/Price_t-1))", true, colors, advancedCharts);
    if (plotObjects != null) {
        firmsPane2.addBar("Log Stock Return", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "firmLogStockReturn", false, false, colors, true);
    if (plotObjects != null) {
        firmsStatisticsPane2.addBar("Log Stock Return Stats", new JScrollPane(plotObjects));
    }

    //plot AUTOCORRELATION OF FIRMS LOG STOCK RETURN (log(P_t/P_t-1)) - method in ClearingFirm.java
    plotObjects = this.multiPlotAutoCorrelation(results, "firmLogStockReturn", true, colors, partialResults);
    if (plotObjects != null) {
        firmsStatisticsPane2.addBar("Autocorrelation of Log Stock Returns", new JScrollPane(plotObjects));
    }

    //plot FIRM TOTAL ASSETS - method in Simulation.java
    plotObjects = multiPlotObjects(results, "firmTotalAssets", "Time",
            "Firms' Total Assets on their Balance Sheets", true, colors, advancedCharts);
    if (plotObjects != null) {
        firmsPane2.addBar("Total Assets", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "firmTotalAssets", false, false, colors, true);
    if (plotObjects != null) {
        firmsStatisticsPane2.addBar("Total Assets Stats", new JScrollPane(plotObjects));
    }

    //plot FIRM TOTAL STOCK RETURN PER SHARE (includes both dividend and change in stock price) - method in ClearingFirm.java
    plotObjects = multiPlotObjects(results, "firmTotalStockReturn", "Time",
            "Total Return to Stockholders per share including dividend and capital gain (monetary units)", true,
            colors, advancedCharts);
    if (plotObjects != null) {
        firmsPane2.addBar("Total Stock Return", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "firmTotalStockReturn", false, false, colors, true);
    if (plotObjects != null) {
        firmsStatisticsPane2.addBar("Total Stock Return Stats", new JScrollPane(plotObjects));
    }

    //   if (dashboard.getModelHandler().getModelClass().getName().equals(AbstractModel.class.getName()))

    //plot FUNDS' BALANCES - getBalance(Depositor) method in MutualFund.java 
    plotObjects = multiPlotObjects(results, "fundBalance", "Time",
            "The Value of a MutualFund's Cash Deposit in its Bank Account (monetary units)", true, colors,
            true);
    if (plotObjects != null) {
        fundsPane.addBar("Balance at Bank", new JScrollPane(plotObjects));
    }

    //plot FUNDS' EMISSION PRICE (is this fund share price?) - getEmissionPrice() method in MutualFund.java 
    plotObjects = multiPlotObjects(results, "fundEmissionPrice", "Time", "Funds' Emission Prices", true, colors,
            true);
    if (plotObjects != null) {
        fundsPane.addBar("Emission Price", new JScrollPane(plotObjects));
    }

    //plot FUNDS' EQUITY - getEquity method in Agent.java 
    plotObjects = multiPlotObjects(results, "fundEquity", "Time", "Funds' Equity (monetary units)", true,
            colors, true);
    if (plotObjects != null) {
        fundsPane.addBar("Equity", new JScrollPane(plotObjects));
    }

    //plot FUNDS' PERCENTAGE OF INVESTMENT ALLOCATED TO BONDS - getPercentageValueInBonds() method in MutualFund.java 
    plotObjects = multiPlotObjects(results, "fundPercentageValueInBonds", "Time",
            "Funds' Proportion of Investments allocated to Bonds (%)", true, colors, true);
    if (plotObjects != null) {
        fundsPane.addBar("Investment in Bonds (%)", new JScrollPane(plotObjects));
    }

    //plot FUNDS' PERCENTAGE OF INVESTMENT ALLOCATED TO STOCKS - getPercentageValueInStocks() method in MutualFund.java 
    plotObjects = multiPlotObjects(results, "fundPercentageValueInStocks", "Time",
            "Funds' Proportion of Investments allocated to Stocks (%)", true, colors, true);
    if (plotObjects != null) {
        fundsPane.addBar("Investment in Stocks (%)", new JScrollPane(plotObjects));
    }

    //plot FUNDS' PERCENTAGE OF INVESTMENT ALLOCATED TO BANK STOCKS - getPercentageValueInBankStocks() method in MutualFund.java 
    plotObjects = multiPlotObjects(results, "fundPercentageValueInBankStocks", "Time",
            "Funds' Proportion of Investments allocated to Banks' Stocks (%)", true, colors, true);
    if (plotObjects != null) {
        fundsPane.addBar("Investment in Bank Stocks (%)", new JScrollPane(plotObjects));
    }

    //plot FUNDS' PERCENTAGE OF INVESTMENT ALLOCATED TO STOCKS - getPercentageValueInFirmStocks() method in MutualFund.java 
    plotObjects = multiPlotObjects(results, "fundPercentageValueInFirmStocks", "Time",
            "Funds' Proportion of Investments allocated to Firms' Stocks (%)", true, colors, true);
    if (plotObjects != null) {
        fundsPane.addBar("Investment in Firm Stocks (%)", new JScrollPane(plotObjects));
    }

    //plot FUNDS' TOTAL ASSETS - getTotalAssets() method in MutualFund.java 
    plotObjects = multiPlotObjects(results, "fundTotalAssets", "Time", "Funds' Total Assets (monetary units)",
            true, colors, true);
    if (plotObjects != null) {
        fundsPane.addBar("Total Assets", new JScrollPane(plotObjects));
    }

    //plot GOVERNMENT'S CUMULATIVE BAILOUT COSTS - getGovernmentCumulativeBailoutCosts() method in AbstractModel.java 
    graphContainer = plotNVariables(new String[] { "GovernmentCumulativeBailoutCosts" }, results, turnList,
            "Time", new String[] { "The Government's Cumulative Bailout Costs (monetary units)" }, true, false,
            false, colors);
    if (graphContainer != null) {
        governmentPane.addBar("Bailout Costs", new JScrollPane(graphContainer));
    }

    //plot GOVERNMENT'S BUDGET - getTotalExpensesBudget() method in AbstractModel.java 
    graphContainer = plotNVariables(new String[] { "GovernmentBudget" }, results, turnList, "Time",
            new String[] { "The Government's Total Expenses Budget (monetary units)" }, true, false, false,
            colors);
    if (graphContainer != null) {
        governmentPane.addBar("Budget", new JScrollPane(graphContainer));
    }

    //plot GOVERNMENT'S CASH RESERVE - getGovernmentCashReserveValue() method in AbstractModel.java 
    graphContainer = plotNVariables(new String[] { "GovernmentCashReserve" }, results, turnList, "Time",
            new String[] { "The Government's Cash Reserve (monetary units)" }, true, false, false, colors);
    if (graphContainer != null) {
        governmentPane.addBar("Cash Reserve", new JScrollPane(graphContainer));
    }

    //plot GOVERNMENT'S TOTAL EQUITY - getGovernmentEquity() method in AbstractModel.java 
    graphContainer = plotNVariables(new String[] { "GovernmentEquity" }, results, turnList, "Time",
            new String[] { "The Government's Equity (monetary units)" }, true, false, false, colors);
    if (graphContainer != null) {
        governmentPane.addBar("Equity", new JScrollPane(graphContainer));
    }

    //plot GOVERNMENT'S PUBLIC SECTOR WORKFORCE - getPublicSectorWorkforcePerHousehold() etc. method in AbstractModel.java 
    graphContainer = plotNVariables(
            new String[] { "PublicSectorWorkforcePerTotalEmployedPercentage",
                    "PublicSectorWorkforcePerTotalAvailableWorkforcePercentage" },
            results, turnList, "Time",
            new String[] {
                    "The labour employed by the Government per total labour employed, and per total available workforce including unemployed (%)" },
            true, false, false, colors);
    if (graphContainer != null) {
        governmentPane.addBar("Public Sector Employees (%)", new JScrollPane(graphContainer));
    }

    //plot GOVERNMENT'S TAX REVENUE - getTaxRevenue() method in AbstractModel.java 
    graphContainer = plotNVariables(new String[] { "GovernmentTaxRevenue" }, results, turnList, "Time",
            new String[] { "The Government's Tax Revenue (monetary units)" }, true, false, false, colors);
    if (graphContainer != null) {
        governmentPane.addBar("Tax Revenue", new JScrollPane(graphContainer));
    }

    //plot GOVERNMENT'S TOTAL ASSETS - getTotalGovernmentAssets() method in AbstractModel.java 
    graphContainer = plotNVariables(new String[] { "GovernmentTotalAssets" }, results, turnList, "Time",
            new String[] { "The Government's Total Assets (monetary units)" }, true, false, false, colors);
    if (graphContainer != null) {
        governmentPane.addBar("Total Assets", new JScrollPane(graphContainer));
    }

    //plot GOVERNMENT'S TOTAL LIABILITIES - getTotalGovernmentLiabilities() method in AbstractModel.java 
    graphContainer = plotNVariables(new String[] { "GovernmentTotalLiabilities" }, results, turnList, "Time",
            new String[] { "The Government's Total Liabilities (monetary units)" }, true, false, false, colors);
    if (graphContainer != null) {
        governmentPane.addBar("Total Liabilities", new JScrollPane(graphContainer));
    }

    //plot GOVERNMENT'S TOTAL WELFARE COSTS - getGovernmentWelfareCosts() method in Government.java 
    //      graphContainer = plotNVariables(new String[]{"governmentWelfareCosts"}, results, turnList, "Time", new String[]{"The Government's Welfare Costs (monetary units)"}, true, false, false, colors);
    plotObjects = multiPlotObjects(results, "governmentWelfareCosts", "Time",
            "The Government's Welfare Costs (monetary units)", false, colors, advancedCharts);
    if (plotObjects != null) {
        governmentPane.addBar("Welfare Costs", new JScrollPane(plotObjects));
    }

    /*
    //plot HOUSEHOLD CONSUMPTION - see Simulation::getHouseholdConsumptionOverTime()
    plotObjects = multiPlotObjects(results, "householdConsumptionOverTime", "Time", "Households' Consumption (monetary units)",true, colors, advancedCharts);
    if (plotObjects != null){
       householdsPane.addBar("Consumption", new JScrollPane(plotObjects));
    }
    */
    //plot HOUSEHOLD CONSUMPTION BUDGET - see AbstractModel::getHouseholdConsumption(), which outputs MacroHouseholds' consumptionBudget = consumptionPropensity*Budget.  Ross
    plotObjects = multiPlotObjects(results, "householdConsumptionBudget", "Time",
            "Households' Consumption Budget (monetary units)", true, colors, advancedCharts);
    if (plotObjects != null) {
        householdsPane.addBar("Consumption Budget", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "householdConsumptionBudget", false, false, colors, true);
    if (plotObjects != null) {
        householdsStatisticsPane.addBar("Consumption Budget Stats", new JScrollPane(plotObjects));
    }
    /*      graphContainer = plotNVariables(new String[]{"min(householdConsumptionBudget)", "median(householdConsumptionBudget)", "max(householdConsumptionBudget)", "avg(householdConsumptionBudget)"}, results, turnList, "Time", new String[]{"Households' Consumption Budget (monetary units)"}, true, true, false, colors, advancedCharts);
          if (graphContainer != null){
             householdsPane.addBar("Consumption Budget Summary", new JScrollPane(graphContainer));
          }
    */
    //plot HOUSEHOLD DOMESTIC BUDGET - see MacroHousehold::getDomesticBudgetAtThisTime()
    plotObjects = multiPlotObjects(results, "householdDomesticBudget", "Time",
            "Households' Domestic Budget (monetary units)", true, colors, advancedCharts);
    if (plotObjects != null) {
        householdsPane.addBar("Domestic Budget", new JScrollPane(plotObjects));
    }

    //plot HOUSEHOLD CASH SPEND ON GOODS - see MacroHousehold::getTotalCashSpentOnGoodsAtThisTime()
    plotObjects = multiPlotObjects(results, "householdTotalCashSpentOnGoods", "Time",
            "Households' Consumer Spending (monetary units)", true, colors, advancedCharts);
    if (plotObjects != null) {
        householdsPane.addBar("Consumer Spending", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "householdTotalCashSpentOnGoods", false, false, colors,
            true);
    if (plotObjects != null) {
        householdsStatisticsPane.addBar("Consumer Spending Stats", new JScrollPane(plotObjects));
    }

    //plot HOUSEHOLD INVESTMENTS - see getFundContributionAtThisTime() in MacroHousehold.java
    plotObjects = multiPlotObjects(results, "householdFundContribution", "Time",
            "Households' Net Investments In Funds (monetary units)", true, colors, advancedCharts);
    if (plotObjects != null) {
        householdsPane.addBar("MutualFund Contributions", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "householdFundContribution", false, false, colors, true);
    if (plotObjects != null) {
        householdsStatisticsPane.addBar("MutualFund Contributions Stats", new JScrollPane(plotObjects));
    }

    //plot HOUSEHOLD SAVINGS - see Simulation::getHouseholdSavingsOverTime()
    plotObjects = multiPlotObjects(results, "householdSavings", "Time", "Households' Savings (monetary units)",
            true, colors, advancedCharts);
    if (plotObjects != null) {
        householdsPane.addBar("Savings", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "householdSavings", false, false, colors, true);
    if (plotObjects != null) {
        householdsStatisticsPane.addBar("Savings Stats", new JScrollPane(plotObjects));
    }

    //plot HOUSEHOLD TOTAL ASSETS - method in Simulation.java
    plotObjects = multiPlotObjects(results, "householdTotalAssets", "Time",
            "Households' Total Assets on their Balance Sheets", false, colors, advancedCharts);
    if (plotObjects != null) {
        householdsPane.addBar("Total Assets", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "householdTotalAssets", false, false, colors, true);
    if (plotObjects != null) {
        householdsStatisticsPane.addBar("Total Assets Stats", new JScrollPane(plotObjects));
    }

    //plot HOUSEHOLD TOTAL INCOME - see getTotalIncome() in MacroHousehold.java.  This is calculated as the change in value of deposits plus cash spent on consumption.  This should capture all income from wages, dividends received from banks, bank deposit interest, potentially capital gains in holdings of mutual funds if/when they are introduced into the model - Ross
    plotObjects = multiPlotObjects(results, "householdTotalIncome", "Time",
            "Households' Total Income (monetary units)", true, colors, advancedCharts);
    if (plotObjects != null) {
        householdsPane.addBar("Total Income", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "householdTotalIncome", false, false, colors, true);
    if (plotObjects != null) {
        householdsStatisticsPane.addBar("Total Income Stats", new JScrollPane(plotObjects));
    }

    //plot HOUSEHOLD WAGES - see getTotalRemunerationAtThisTime() in MacroHousehold.java.  Also see global indicators chart for 'meanLabourBidPrice' which is an average wage weighted by amount of labour in all contracts.
    plotObjects = multiPlotObjects(results, "householdTotalRemuneration", "Time",
            "Households' Wages (monetary units)", true, colors, advancedCharts);
    if (plotObjects != null) {
        householdsPane.addBar("Wages", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "householdTotalRemuneration", false, false, colors, true);
    if (plotObjects != null) {
        householdsStatisticsPane.addBar("Wages Stats", new JScrollPane(plotObjects));
    }

    //plot HOUSEHOLD WELFARE ALLOWANCE - see getHouseholdWelfareAllowancee() in MasterModel.java.
    plotObjects = multiPlotObjects(results, "householdWelfareAllowance", "Time",
            "Households' Welfare Allowance (monetary units)", true, colors, advancedCharts);
    if (plotObjects != null) {
        householdsPane.addBar("Welfare", new JScrollPane(plotObjects));
    }
    plotObjects = plotSummaryStats(results, turnList, "householdWelfareAllowance", false, false, colors, true);
    if (plotObjects != null) {
        householdsStatisticsPane.addBar("Welfare Stats", new JScrollPane(plotObjects));
    }
    //   }

    /*      //plot Stock Index - see MarketClearingModel::getStockIndexArray()
          plotObjects = multiPlotObjects(results, "stockIndexArray", "Time", "Stock Index [min, avg, max] (market cap in monetary units)", false, colors, advancedCharts);
          if (plotObjects != null){
             miscPane.addBar("Stock Index [min, avg, max]", new JScrollPane(plotObjects));
          }
    */

    /*      //Not working 
          //plot change in log of share price ('log returns').  Note that share price is also known as 'firmStockPrice' - Ross
          plotObjects = multiLogReturnPlotObjects(seriesNames, results, "firmStockPrice", "Time", "Log(SharePrice_(t+1)/SharePrice_t)");
          if (plotObjects != null){
             firmsPane.addBar("Log Stock Return (excluding dividend)", new JScrollPane(plotObjects));
          }
    */

    Box.createVerticalBox();

    //Uses getEquity() method in Agent.java.  Central Bank Equity far larger (approx 10^300 larger!) so best to plot separately in the next plot below.
    //      if (dashboard.getModelHandler().getModelClass().getName().equals(AbstractModel.class.getName())) 
    {
        graphContainer = plotNVariables(
                new String[] { "sum(bankEquity)", "sum(firmEquity)",
                        /*"sum(fundEquity)", */"sum(householdEquity)" },
                results, turnList, "Time",
                new String[] { "Aggregate Bank, Firm and Household Sector Equities (monetary units)" }, true,
                true, false, colors, true);
        if (graphContainer != null) {
            globalTimePane.addBar("Agent Class Equity w/o Central Bank", new JScrollPane(graphContainer));
            //            miscBox.add(graphContainer);
        }
    }
    //      else if (dashboard.getModelHandler().getModelClass().getName().equals(MarketClearingModelWithCentralBank.class.getName())) {
    //         graphContainer = plotNVariables(new String[]{"sum(bankEquity)", "sum(firmEquity)"}, results, turnList, "Time", new String[]{"Aggregate Bank and Firm Sector Equities (monetary units)"}, true, true, false, colors, true);
    //         if (graphContainer != null){
    //            globalTimePane.addBar("Agent Class Equity w/o Central Bank", new JScrollPane(graphContainer));
    ////            miscBox.add(graphContainer);
    //         }
    //      }
    /*      else //if (dashboard.getModelHandler().getModelClass().getName().equals(MarketClearingModel.class.getName()))
          {
             graphContainer = plotNVariables(new String[]{"sum(bankEquity)", "sum(firmEquity)"}, results, turnList, "Time", new String[]{"Aggregate Bank and Firm Sector Equities (monetary units)"}, true, false, false, colors, true);
             if (graphContainer != null){
    globalTimePane.addBar("Agent Class Equity", new JScrollPane(graphContainer));
    //            miscBox.add(graphContainer);
             }
          }
    */
    //      else {System.out.println("Model class case not in Page_Results.java");}

    //plots Central Bank equity using getCBequity in MarketClearingModelWithCentralBank.java, however we get problems plotting very large numbers, so ensure that Central Bank is initialized with cash of at most 10^303 if you want to see graph, whereas it was initialized with Double.MAX_VALUE cash originally (which was too large to plot!). Ross
    //      if (dashboard.getModelHandler().getModelClass().getName().equals(MarketClearingModelWithCentralBank.class.getName())) {
    //         graphContainer = plotNVariables(new String[]{"sum(bankEquity)", "sum(firmEquity)", "CBequity"}, results, turnList, "Time", new String[]{"Central Bank Equity dominates Aggregate Bank and Firm Equities (monetary units)"}, true, true, false, colors, true);
    //         if (graphContainer != null){
    //            globalTimePane.addBar("Agent Class Equity incl. Central Bank", new JScrollPane(graphContainer));
    ////            miscBox.add(graphContainer);
    //         }
    //      }
    //      else
    //      if (dashboard.getModelHandler().getModelClass().getName().equals(AbstractModel.class.getName())) {
    graphContainer = plotNVariables(
            new String[] { "sum(bankEquity)", "sum(firmEquity)",
                    /*"sum(fundEquity)", "GovernmentEquity", */"sum(householdEquity)", "CBequity" },
            results, turnList, "Time",
            new String[] {
                    "Central Bank Equity dominates Aggregate Bank, Firm, and Household Sector Equities (monetary units)" },
            true, true, false, colors, true);
    if (graphContainer != null) {
        globalTimePane.addBar("Agent Class Equity incl. Central Bank", new JScrollPane(graphContainer));
        //            miscBox.add(graphContainer);
    }
    //      }
    //      else {System.out.println("Model class case not in Page_Results.java");}

    //Method getTaxMoneySpentForBanks() in MarketClearingModelWithCentralBank.java
    graphContainer = plotNVariables(new String[] { "TaxMoneySpentForBanks" }, results, turnList, "Time",
            new String[] { "Cumulative Value of Taxpayers Money Used to Bail Out Banks (monetary units)" },
            true, false, false, colors, true);
    if (graphContainer != null) {
        globalTimePane.addBar("Bailout Value", new JScrollPane(graphContainer));
        //             miscBox2.add(graphContainer);
    }

    //Method getCrisisInterventions() in MarketClearingModelWithCentralBank.java
    graphContainer = plotNVariables(new String[] { "BankruptcyEvents" }, results, turnList, "Time",
            new String[] { "Number of banks becoming bankrupt at each time-step" }, true, false, false, colors,
            true);
    if (graphContainer != null) {
        globalTimePane.addBar("Bankruptcy Events", new JScrollPane(graphContainer));
        //             miscBox2.add(graphContainer);

    }

    if (results.resultNames().contains("aggregateBankAssets")
            && results.resultNames().contains("aggregateBankLeverage")) {
        //Calculate 'Growth' over one time-step of Bank Assets and Bank Leverage - to mimic figures 2.2 to 2.5 in Adrian and Shin 2008 paper "Liquidity and Leverage"

        ArrayList<Object> aggBankAssets = (ArrayList<Object>) results.getResults("aggregateBankAssets");
        ArrayList<Object> aggBankLeverage = (ArrayList<Object>) results.getResults("aggregateBankLeverage");
        final ArrayList<Double> logAggBankAssetsGrowth = new ArrayList<Double>();
        for (int t = 1; t < aggBankAssets.size(); t++) {
            logAggBankAssetsGrowth
                    .add(Math.log((Double) aggBankAssets.get(t) / (Double) aggBankAssets.get(t - 1)));
        }
        final ArrayList<Double> logAggBankLeverageGrowth = new ArrayList<Double>();
        for (int t = 1; t < aggBankLeverage.size(); t++) {
            logAggBankLeverageGrowth.add(Math.log(((Number) aggBankLeverage.get(t)).doubleValue()
                    / ((Number) aggBankLeverage.get(t - 1)).doubleValue()));
        }

        graphContainer = this.scatterTwoSeries("logAggBankLeverageGrowth", "logAggBankAssetsGrowth",
                Doubles.toArray(logAggBankLeverageGrowth), Doubles.toArray(logAggBankAssetsGrowth),
                "Aggregate Banks' Leverage Growth (log(L_t/L_t-1))",
                "Aggregate Banks' Assets Growth (log(A_t/A_t-1))", true, true, colors.get(0), true);
        if (graphContainer != null) {
            globalScatterPane.addBar("Banks' Leverage Growth vs. Assets Growth",
                    new JScrollPane(graphContainer));
            //            miscBox.add(graphContainer);

        }
    }

    //plot Aggregate Commercial Loans (bank loans to non-banks) using getAggregateCommercialLoans() method in MarketClearingModel.java
    graphContainer = plotNVariables(new String[] { "AggregateCommercialLoans" }, results, turnList, "Time",
            new String[] { "Credit (aggregate bank loans to non-banks in monetary units)" }, true, false, false,
            colors);
    if (graphContainer != null) {
        globalTimePane.addBar("Credit (commercial loan volume)", new JScrollPane(graphContainer));
        //         miscBox.add(graphContainer);
    }

    //plot Aggregate Interbank Loans (bank loans to banks) using getAggregateInterbankLoans() method in MarketClearingModel.java
    graphContainer = plotNVariables(new String[] { "AggregateInterbankLoans" }, results, turnList, "Time",
            new String[] {
                    "Credit (aggregate bank loans to other banks on the interbank market in monetary units)" },
            true, false, false, colors);
    if (graphContainer != null) {
        globalTimePane.addBar("Credit (interbank loan volume)", new JScrollPane(graphContainer));
        //         miscBox.add(graphContainer);
    }

    //plot Interest Rate using getInterestRates() method in Simulation.java vs Credit (aggregate bank loans to non-banks) using getAggregateCommercialLoans() method in MarketClearingModel.java
    graphContainer = scatterTwoSeries("meanLoanInterestRate", "AggregateCommercialLoans", results,
            "Commercial Loan Interest Rate", "Credit (total bank loans to non-banks in monetary units)", true,
            true, colors.get(0), true);
    if (graphContainer != null) {
        globalScatterPane.addBar("Credit vs. Loan Rate", new JScrollPane(graphContainer));
        //         miscBox.add(graphContainer);
    }

    /*      //CONDITIONAL STATEMENT ALLOWS US TO PLOT PRODUCTION AS GDP PROXY IN FIXED LABOUR MARKET MODELS (MarketClearingModel and MarketClearingModelWithCentralBank) BUT NOT TO REPEAT FOR INPUT/OUTPUT MACRO ECONOMY WHERE GOODS PRICES AND GDP EXISTS (AbstractModel)
          if (!dashboard.getModelHandler().getModelClass().getName().equals(AbstractModel.class.getName())) {      
             //plot Credit-to-Production ratio (where credit is aggregate bank loans to non-banks using getAggregateCommercialLoans() method in MarketClearingModel.java) and production uses getTotalProduction() method in MarketClearingModel.java as a proxy for GDP in Fixed Labour Market model (previously known as the Cobb-Douglas model) as unit price is set to 1, so monetary units and units produced is identical)
             graphContainer = plotNVariables(new String[]{"CommercialLoansToProductionRatio"}, results, turnList, "Time", new String[]{"Credit-to-Production ratio (Loans to non-banks / Production)"}, true, true, false, colors, true);
             if (graphContainer != null){
    globalTimePane.addBar("Credit-to-Production ratio", new JScrollPane(graphContainer));
       //         miscBox.add(graphContainer);
             }
          }
    */
    //      else if (dashboard.getModelHandler().getModelClass().getName().equals(AbstractModel.class.getName())) {
    //plot Credit-to-GDP ratio (where credit is aggregate bank loans) using getAggregateCommercialLoans() method in MarketClearingModel.java and getGDP() in AbstractModel.java
    graphContainer = plotNVariables(new String[] { "CommercialLoansToGDPratio" }, results, turnList, "Time",
            new String[] { "Credit-to-GDP ratio (credit is bank loans to non-banks)" }, true, true, false,
            colors, true);
    if (graphContainer != null) {
        globalTimePane.addBar("Credit-to-GDP ratio", new JScrollPane(graphContainer));
        //            miscBox.add(graphContainer);
    }
    //      }

    //Method getAggEmployment() in AbstractModel.java
    graphContainer = plotNVariables(new String[] { "aggEmployment" }, results, turnList, "Time",
            new String[] { "Aggregate Employment (amount of labour)" }, true, false, false, colors, true);
    if (graphContainer != null) {
        globalTimePane2.addBar("Employment", new JScrollPane(graphContainer));
        //            miscBox.add(graphContainer);
    }

    //Method getAggregateFundAssets() and getAggregateHouseholdFundContribution() in AbstractModel.java
    graphContainer = plotNVariables(
            new String[] { "aggregateFundAssets", "aggregateHouseholdNetContributionsToFunds" }, results,
            turnList, "Time",
            new String[] {
                    "Aggregate Funds' Assets and Aggregate Households' Net Contributions (monetary units)" },
            true, false, false, colors, true);
    if (graphContainer != null) {
        globalTimePane2.addBar("Fund Assets & Household Contributions", new JScrollPane(graphContainer));
    }

    //      if (dashboard.getModelHandler().getModelClass().getName().equals(AbstractModel.class.getName())) {
    //Method getGDP() in AbstractModel.java
    graphContainer = plotNVariables(new String[] { "GDP" }, results, turnList, "Time",
            new String[] { "Gross Domestic Product (monetary units)" }, true, true, false, colors, true);
    if (graphContainer != null) {
        globalTimePane2.addBar("GDP", new JScrollPane(graphContainer));
        //               miscBox.add(graphContainer);
    }

    //plot Credit (aggregate commercial loans using getAggregateCommercialLoans() method in MarketClearingModel.java) vs GDP   
    graphContainer = scatterTwoSeries("AggregateCommercialLoans", "GDP", results,
            "Credit (bank loans to non-banks in monetary units)", "GDP (monetary units)", true, true,
            colors.get(0), true);
    if (graphContainer != null) {
        globalScatterPane.addBar("GDP vs. Credit", new JScrollPane(graphContainer));
        //               miscBox.add(graphContainer);
    }

    //plot Employment (getUnemploymentPercentage() in AbstractModel.java) vs GDP (getGDP() in AbstractModel.java)
    graphContainer = scatterTwoSeries("UnemploymentPercentage", "GDP", results,
            "Unemployment Rate (% of workforce)", "GDP (monetary units)", true, true, colors.get(0), true);
    if (graphContainer != null) {
        globalScatterPane.addBar("GDP vs Unemployment Rate", new JScrollPane(graphContainer));
        //            miscBox.add(graphContainer);
    }
    //      }

    //plot Average Loan Interest Rate using getMeanLoanInterestRates() method in Simulation.java and Stock Dividend-Price Ratio using getStockReturn() method in MarketClearingModel.java, note getStockReturn() as defined in this model is actually only the dividend-price ratio and does not include gains/losses due to share price (a.k.a. capital gains).
    graphContainer = plotNVariables(new String[] { "meanLoanInterestRate" }, results, turnList, "Time",
            new String[] { "Commercial Loan Interest Rate" }, true, false, false, colors);
    if (graphContainer != null) {
        globalTimePane2.addBar("Loan Rate", new JScrollPane(graphContainer));
    }

    //plot Average Loan Interest Rate using getMeanLoanInterestRates() method in Simulation.java and Stock Dividend-Price Ratio using getStockReturn() method in MarketClearingModel.java, note getStockReturn() as defined in this model is actually only the dividend-price ratio and does not include gains/losses due to share price (a.k.a. capital gains).
    graphContainer = plotNVariables(new String[] { "meanLoanInterestRate", "dividendPriceRatio" }, results,
            turnList, "Time",
            new String[] { "Commercial Loan Interest Rate & Average Stock Dividend-Price Ratio" }, true, false,
            false, colors);
    if (graphContainer != null) {
        globalTimePane2.addBar("Loan Rate & Stock Dividend-Price Ratio", new JScrollPane(graphContainer));
        //         miscBox.add(graphContainer);
    }

    //plot Average Loan Interest Rate using getInterestRates() method in Simulation.java and Average Realized Stockholder Return using getTotalStockReturn() method in ClearingFirm.java, note this includes both dividend payout and gains/losses due to stock price change
    graphContainer = plotNVariables(
            new String[] { "meanLoanInterestRate", "dividendPriceRatio", "avg(firmTotalStockReturn)" }, results,
            turnList, "Time",
            new String[] {
                    "Commercial Loan Interest Rate, Average Dividend-Price Ratio & Average Total Stock Return" },
            true, true, false, colors, true);
    if (graphContainer != null) {
        globalTimePane2.addBar("Loan Rate, Stock Dividend-Price Ratio & Total Stock Return",
                new JScrollPane(graphContainer));
        //         miscBox.add(graphContainer);
    }

    //plot getBankCashOverTime() method in Simulation.java and Aggregate Commercial Loans (bank loans to non-banks) using getAggregateCommercialLoans() method in MarketClearingModel.java
    graphContainer = plotNVariables(new String[] { "sum(bankCashReserves)", "AggregateCommercialLoans" },
            results, turnList, "Time",
            new String[] {
                    "Money measures: Aggregate Bank Cash Reserves and Commercial Loans (monetary units)" },
            true, false, false, colors);
    if (graphContainer != null) {
        globalTimePane2.addBar("Money Measures: Cash Reserves and Credit", new JScrollPane(graphContainer));
        //         miscBox.add(graphContainer);
    }

    //plot Total Production using getTotalProduction() method in MarketClearingModel.java as a proxy for GDP in Fixed Labour Market model (previously known as the Cobb-Douglas model) as unit price is set to 1, so monetary units and units produced is identical
    graphContainer = plotNVariables(new String[] { "TotalProduction" }, results, turnList, "Time",
            new String[] { "Total Production (units produced)" }, true, true, false, colors, true);
    if (graphContainer != null) {
        globalTimePane3.addBar("Production", new JScrollPane(graphContainer));
        //            miscBox.add(graphContainer);
    }

    //plot Production (using getTotalProduction() method in MarketClearingModel.java as a proxy for GDP in Simple Market Clearing Model as unit price is set to 1, so monetary units and units produced is identical) vs. Credit (aggregate commercial loans using getAggregateCommercialLoans() method in MarketClearingModel.java)   
    graphContainer = scatterTwoSeries("AggregateCommercialLoans", "TotalProduction", results,
            "Credit (loans to non-banks in monetary units)", "Production (proxy for GDP in units produced)",
            true, true, colors.get(0), true);
    if (graphContainer != null) {
        globalScatterPane.addBar("Production vs. Credit", new JScrollPane(graphContainer));
        //            miscBox.add(graphContainer);
    }

    //plot Stock Market Capitalization
    graphContainer = plotNVariables(new String[] { "StockMarketCapitalization" }, results, turnList, "Time",
            new String[] { "Stock Market Capitalization (monetary units)" }, true, true, false, colors, true);
    if (graphContainer != null) {
        globalTimePane3.addBar("Stock Market Capitalization", new JScrollPane(graphContainer));
    }

    //plot Average Loan Interest Rate using getInterestRates() method in Simulation.java and Average Stock Price using getMarketValue() method in ClearingFirm.java
    graphContainer = plotNVariables(new String[] { "meanLoanInterestRate", "avg(firmStockPrice)" }, results,
            turnList, "Time", new String[] { "Commercial Loan Interest Rate & Average Stock Price" }, true,
            true, false, colors, true);
    if (graphContainer != null) {
        globalTimePane3.addBar("Stock Price & Loan Rate", new JScrollPane(graphContainer));
        //         miscBox.add(graphContainer);
    }

    //plot Average Loan Interest Rate using getInterestRates() method in Simulation.java vs Average Stock Price Ratio using getMarketValue() method in ClearingFirm.java
    graphContainer = scatterTwoSeries("meanLoanInterestRate", "avg(firmStockPrice)", results,
            "Commercial Loan Interest Rate", "Average Stock Price", true, true, colors.get(0), true);
    if (graphContainer != null) {
        globalScatterPane.addBar("Stock Price vs. Loan Rate", new JScrollPane(graphContainer));
        //         miscBox.add(graphContainer);
    }

    //plot Average Loan Interest Rate using getInterestRates() method in Simulation.java vs Average Realized Stockholder Return using getTotalStockReturn() method in ClearingFirm.java, note this includes both dividend payout and gains/losses due to stock price change
    graphContainer = scatterTwoSeries("meanLoanInterestRate", "avg(firmTotalStockReturn)", results,
            "Commercial Loan Interest Rate", "Average Realized Stockholder Return", true, true, colors.get(0),
            true);
    if (graphContainer != null) {
        globalScatterPane.addBar("Total Stock Return vs. Loan Rate", new JScrollPane(graphContainer));
        //         miscBox.add(graphContainer);
    }

    //Methods in AbstractModel.java
    graphContainer = plotNVariables(
            new String[] { "CapitalGainsTaxRate", "DividendTaxRate", "IncomeTaxRate", "ValueAddedTaxRate" },
            results, turnList, "Time",
            new String[] { "Capital Gains, Dividend, Income and Value Added Tax Rates" }, true, true, false,
            colors, true);
    if (graphContainer != null) {
        globalTimePane3.addBar("Tax Rates", new JScrollPane(graphContainer));
    }

    //Method getUnemploymentPercentage() in AbstractModel.java
    graphContainer = plotNVariables(new String[] { "UnemploymentPercentage" }, results, turnList, "Time",
            new String[] { "Unemployment Rate (% of workforce)" }, true, true, false, colors, true);
    if (graphContainer != null) {
        globalTimePane3.addBar("Unemployment Rate", new JScrollPane(graphContainer));
        //            miscBox.add(graphContainer);
    }

    //Method getAverageUnsoldGoods() etc. in AbstractModel.java
    graphContainer = plotNVariables(new String[] { "AverageUnsoldGoods", "MinUnsoldGoods", "MaxUnsoldGoods" },
            results, turnList, "Time",
            new String[] {
                    "Aggregate quantity of goods produced by firms in one time-step that are not sold during the same time-step" },
            true, true, false, colors, true);
    if (graphContainer != null) {
        globalTimePane3.addBar("Unsold Goods", new JScrollPane(graphContainer));
    }

    //Method getMeanLabourBidPrice() in AbstractModel.java
    graphContainer = plotNVariables(new String[] { "meanLabourBidPrice" }, results, turnList, "Time",
            new String[] { "Household (Labour Unit Volume-Weighted) Average Wage (monetary units)" }, true,
            false, false, colors, true);
    if (graphContainer != null) {
        globalTimePane3.addBar("Wages (average over households)", new JScrollPane(graphContainer));
        //            miscBox.add(graphContainer);
    }

    /*         //Method getPercentageOfPopulationReceivingWelfareBenefits() in MasterModel.java
             graphContainer = plotNVariables(new String[]{"PercentageOfPopulationOnWelfare"}, results, turnList, "Time", new String[]{"Proportion of Households registered to receive welfare support from Government (%)"}, true, false, false, colors, true);
             if (graphContainer != null){
    globalTimePane3.addBar("Welfare Recipients (%)", new JScrollPane(graphContainer));
             }
    */

    //Method getObjectiveFunctionValue() in AbstractModel.java
    graphContainer = plotNVariables(new String[] { "objectiveFunctionValue" }, results, turnList, "Time",
            new String[] { "Objective Function Value (sum of square errors to UK data 2014)" }, true, true,
            false, colors, true);
    if (graphContainer != null) {
        optimizePane.addBar("UK Economic Levels", new JScrollPane(graphContainer));
    }

    //Method GDPvolatilityObjectiveFunction() in AbstractModel.java
    graphContainer = plotNVariables(new String[] { "GDPvolatilityObjectiveFunction" }, results, turnList,
            "Time", new String[] { "Relative change in GDP - 0.03" }, true, true, false, colors, true);
    if (graphContainer != null) {
        optimizePane.addBar("Relative Change In GDP", new JScrollPane(graphContainer));
    }

    /*      //Problem - shows the same scale for vastly different numbers - Ariel to sort out plotting with 2 y-axes.
          //Method getGDP() and getUnemploymentRate in AbstractModel.java
          graphContainer = plotNVariables(new String[]{"UnemploymentRate","GDP"}, results, "Time", new String[]{"Unemployment Rate (% households) and GDP (monetary units)"}, true, false, false, colors);
          if (graphContainer != null){
             miscBox.add(graphContainer);
          }
    */

    //      SwingUtilities.invokeLater(new Runnable() {
    //         
    //         @Override
    //         public void run() {
    //            for (DynamicPlot plot : currentOnLinePlots) {
    //               plot.getGraphContainer().getView().autoScale();
    //            }
    //            
    //            for (DynamicPlot plot : currentOffLinePlots.keySet()) {
    //               plot.getGraphContainer().getView().autoScale();
    //            }
    //         }
    //      });

    //      Style.apply(indexBox, dashboard.getCssStyle());
    //      indexBox.validate();
    //      indexBox.repaint();
}

From source file:freemind.common.BooleanProperty.java

License:Open Source License

public void layout(DefaultFormBuilder builder, TextTranslator pTranslator) {
    JLabel label = builder.append(pTranslator.getText(getLabel()), mCheckBox);
    label.setToolTipText(pTranslator.getText(getDescription()));
}

From source file:freemind.common.ColorProperty.java

License:Open Source License

public void layout(DefaultFormBuilder builder, TextTranslator pTranslator) {
    JLabel label = builder.append(pTranslator.getText(getLabel()), mButton);
    label.setToolTipText(pTranslator.getText(getDescription()));
    // add "reset to standard" popup:

    // Create and add a menu item
    JMenuItem item = new JMenuItem(mTranslator.getText("ColorProperty.ResetColor"));
    item.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            setValue(defaultColor);//from w  w  w .  ja  v a 2s  .c  om
        }
    });
    menu.add(item);

    // Set the component to show the popup menu
    mButton.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent evt) {
            if (evt.isPopupTrigger()) {
                menu.show(evt.getComponent(), evt.getX(), evt.getY());
            }
        }

        public void mouseReleased(MouseEvent evt) {
            if (evt.isPopupTrigger()) {
                menu.show(evt.getComponent(), evt.getX(), evt.getY());
            }
        }
    });
}

From source file:freemind.common.ComboProperty.java

License:Open Source License

public void layout(DefaultFormBuilder builder, TextTranslator pTranslator) {
    JLabel label = builder.append(pTranslator.getText(getLabel()), mComboBox);
    label.setToolTipText(pTranslator.getText(getDescription()));
}

From source file:freemind.common.FontProperty.java

License:Open Source License

public void layout(DefaultFormBuilder builder, TextTranslator pTranslator) {
    JLabel label = builder.append(pTranslator.getText(getLabel()), mFontComboBox);
    label.setToolTipText(pTranslator.getText(getDescription()));

}

From source file:freemind.common.IconProperty.java

License:Open Source License

public void layout(DefaultFormBuilder builder, TextTranslator pTranslator) {
    JLabel label = builder.append(pTranslator.getText(getLabel()), mButton);
    label.setToolTipText(pTranslator.getText(getDescription()));
}

From source file:freemind.common.NumberProperty.java

License:Open Source License

public void layout(DefaultFormBuilder builder, TextTranslator pTranslator) {
    // JLabel label = builder
    // .append(pTranslator.getText(getLabel()), slider);
    JLabel label = builder.append(pTranslator.getText(getLabel()), spinner);
    label.setToolTipText(pTranslator.getText(getDescription()));
}

From source file:freemind.common.StringProperty.java

License:Open Source License

public void layout(DefaultFormBuilder builder, TextTranslator pTranslator) {
    JLabel label = builder.append(pTranslator.getText(getLabel()), mTextField);
    label.setToolTipText(pTranslator.getText(getDescription()));
}

From source file:freemind.common.ThreeCheckBoxProperty.java

License:Open Source License

public void layout(DefaultFormBuilder builder, TextTranslator pTranslator) {
    JLabel label = builder.append(pTranslator.getText(getLabel()), mButton);
    String tooltiptext = pTranslator.getText(getDescription());
    label.setToolTipText(tooltiptext);//from w w w .j a  va2s.c  o  m
    mButton.setToolTipText(tooltiptext);
}