Example usage for javax.swing JOptionPane ERROR_MESSAGE

List of usage examples for javax.swing JOptionPane ERROR_MESSAGE

Introduction

In this page you can find the example usage for javax.swing JOptionPane ERROR_MESSAGE.

Prototype

int ERROR_MESSAGE

To view the source code for javax.swing JOptionPane ERROR_MESSAGE.

Click Source Link

Document

Used for error messages.

Usage

From source file:emailplugin.MailCreator.java

/**
 * Shows a Warning if the Plugin was not configured correctly.
 *
 * @param parent Parent-Dialog/* w  w w  . ja va 2s.  c  om*/
 */
private void showNotConfiguredCorrectly(Frame parent) {
    int ret = JOptionPane.showConfirmDialog(parent,
            mLocalizer.msg("NotConfiguredCorrectly", "Not configured correctly"),
            Localizer.getLocalization(Localizer.I18N_ERROR), JOptionPane.YES_NO_OPTION,
            JOptionPane.ERROR_MESSAGE);

    if (ret == JOptionPane.YES_OPTION) {
        Plugin.getPluginManager().showSettings(mPlugin);
    }
}

From source file:be.ugent.maf.cellmissy.gui.controller.analysis.singlecell.filtering.MultipleCutOffFilteringController.java

/**
 * Private methods and classes//from w  w w  . j av a2s .  co  m
 */
// initialize the main view
private void initMainView() {
    // make a new view
    multipleCutOffPanel = new MultipleCutOffPanel();
    // make a new radio button group for the radio buttons
    ButtonGroup radioButtonGroup = new ButtonGroup();
    radioButtonGroup.add(multipleCutOffPanel.getPixelRadioButton());
    radioButtonGroup.add(multipleCutOffPanel.getMicroMeterRadioButton());

    // pixels or m?
    multipleCutOffPanel.getPixelRadioButton().addActionListener((ActionEvent e) -> {
        multipleCutOffPanel.getConversionFactorTextField().setEnabled(true);
    });

    multipleCutOffPanel.getMicroMeterRadioButton().addActionListener((ActionEvent e) -> {
        // m: we do not need a conversion factor
        multipleCutOffPanel.getConversionFactorTextField().setEnabled(false);
    });

    // set default to micrometer
    multipleCutOffPanel.getMicroMeterRadioButton().setSelected(true);
    // and therefore no need for the conversion factor
    multipleCutOffPanel.getConversionFactorTextField().setEnabled(false);
    // set some default values for the top and bottom translocaton limits
    multipleCutOffPanel.getBottomLimTextField().setText("0.4");
    multipleCutOffPanel.getTopLimTextField().setText("2.8");
    multipleCutOffPanel.getTranslocationStepTextField().setText("0.8");
    multipleCutOffPanel.getPercentageMotileStepsTextField().setText("30");
    percentageMotile = 33;

    // actually do the filtering
    multipleCutOffPanel.getFilterButton().addActionListener((ActionEvent e) -> {

        // try to read the user-inserted values for up and down limit
        // check for number format exception
        try {
            if (multipleCutOffPanel.getPixelRadioButton().isSelected()) {
                double conversionFactor = Double
                        .parseDouble(multipleCutOffPanel.getConversionFactorTextField().getText());
                multipleCutOffPanel.getBottomLimTextField()
                        .setText("" + AnalysisUtils.roundTwoDecimals(
                                Double.parseDouble(multipleCutOffPanel.getBottomLimTextField().getText())
                                        / conversionFactor));
                multipleCutOffPanel.getTopLimTextField()
                        .setText("" + AnalysisUtils.roundTwoDecimals(
                                Double.parseDouble(multipleCutOffPanel.getTopLimTextField().getText())
                                        / conversionFactor));
            }

            int topLimit = (int) (Double.parseDouble(multipleCutOffPanel.getTopLimTextField().getText()) * 10);
            int bottomLimit = (int) (Double.parseDouble(multipleCutOffPanel.getBottomLimTextField().getText())
                    * 10);
            double step = Double.parseDouble(multipleCutOffPanel.getTranslocationStepTextField().getText());
            percentageMotile = Double
                    .parseDouble(multipleCutOffPanel.getPercentageMotileStepsTextField().getText());

            int numberSteps = (int) ((topLimit - bottomLimit) / (10 * step)) + 1;
            motileSteps = new ArrayList<>();

            for (int i = 0; i < numberSteps; i++) {
                motileSteps.add(((double) bottomLimit / 10) + (step * i));
            }
            FilterSwingWorker filterSwingWorker = new FilterSwingWorker();
            filterSwingWorker.execute();

        } catch (NumberFormatException ex) {
            // warn the user and log the error for info
            filteringController.showMessage("Please insert valid numbers!" + "\n " + ex.getMessage(),
                    "number format exception", JOptionPane.ERROR_MESSAGE);
            LOG.error(ex.getMessage());
        }

    });

    // apply a specific cut-off value to all the conditions at once
    multipleCutOffPanel.getApplyCutOffToConditionsButton().addActionListener((ActionEvent e) -> {
        // get the cut-off from the list (sure this is a Double)
        Double value = (Double) multipleCutOffPanel.getCutOffValuesComboBox().getSelectedItem();
        FilterConditionSwingWorker filterConditionSwingWorker = new FilterConditionSwingWorker(value);
        filterConditionSwingWorker.execute();
    });

    // select cut-off for a condition
    multipleCutOffPanel.getSelectCutOffForConditionButton().addActionListener((ActionEvent e) -> {
        if (multipleCutOffPanel.getCutOffValuesComboBox().getSelectedItem() != null) {
            SelectCutOffConditionSwingWorker selectCutOffConditionSwingWorker = new SelectCutOffConditionSwingWorker();
            selectCutOffConditionSwingWorker.execute();
        } else {
            filteringController.showMessage("Please select a cut-off!", "info", JOptionPane.WARNING_MESSAGE);
        }

    });

    AlignedTableRenderer alignedTableRenderer = new AlignedTableRenderer(SwingConstants.LEFT);
    for (int i = 0; i < multipleCutOffPanel.getFilterTrackTable().getColumnModel().getColumnCount(); i++) {
        multipleCutOffPanel.getFilterTrackTable().getColumnModel().getColumn(i)
                .setCellRenderer(alignedTableRenderer);
        multipleCutOffPanel.getSummaryTable().getColumnModel().getColumn(i)
                .setCellRenderer(alignedTableRenderer);
    }
    multipleCutOffPanel.getFilterTrackTable().getTableHeader()
            .setDefaultRenderer(new TableHeaderRenderer(SwingConstants.LEFT));
    multipleCutOffPanel.getSummaryTable().getTableHeader()
            .setDefaultRenderer(new TableHeaderRenderer(SwingConstants.LEFT));

    // add view to parent component
    filteringController.getFilteringPanel().getMultipleCutOffParentPanel().add(multipleCutOffPanel,
            gridBagConstraints);
}

From source file:sim.util.media.chart.ChartGenerator.java

/** Starts a Quicktime movie on the given ChartGenerator.  The size of the movie frame will be the size of
the chart at the time this method is called.  This method ought to be called from the main event loop.
Most of the default movie formats provided will result in a gigantic movie, which you can
re-encode using something smarter (like the Animation or Sorenson codecs) to put to a reasonable size.
On the Mac, Quicktime Pro will do this quite elegantly. */
public void startMovie() {
    // can't start a movie if we're in an applet
    if (SimApplet.isApplet()) {
        Object[] options = { "Oops" };
        JOptionPane.showOptionDialog(this, "You cannot create movies from an applet.",
                "MASON Applet Restriction", JOptionPane.OK_OPTION, JOptionPane.ERROR_MESSAGE, null, options,
                options[0]);//from  www  .  ja va  2s.c  om
        return;
    }

    if (movieMaker != null)
        return; // already running
    movieMaker = new MovieMaker(getFrame());

    if (!movieMaker.start(getBufferedImage()))
        movieMaker = null; // failed
    else {
        movieButton.setText("Stop Movie");

        // emit an image
        update(FORCE_KEY, true);
    }
}

From source file:frames.LoginFrame.java

private void loginButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginButtonActionPerformed
    //Try to acquire permission
    if (semaphore.tryAcquire()) {

        try {//from  w  w w . j  a  v a 2 s.  c  o  m

            JuddiRegistry jr = new JuddiRegistry();

            String authentication = jr.authenticate(email);

            //If user is authenticated
            if (authentication != null) {

                //Call MainFrame
                new MainFrame(jr);

                //Destroy LoginFrame
                dispose();
            } //Else, if user is not authenticated
            else {

                //Show error message to user
                JOptionPane.showMessageDialog(rootPane, "Error to authenticate", "Error",
                        JOptionPane.ERROR_MESSAGE);

                //Release semaphore
                semaphore.release();

            }

        } catch (ConfigurationException | TransportException | RemoteException ex) {

            //Show error message to user
            JOptionPane.showMessageDialog(rootPane, "Error to authenticate", "Error",
                    JOptionPane.ERROR_MESSAGE);

            //Release semaphore
            semaphore.release();
        }
    }
}

From source file:com.moss.bdbadmin.client.ui.BdbAdminClient.java

private void loadConfig() {

    if (!configPath.exists()) {
        return;//from   w w  w  . ja  v a 2  s.  c  o  m
    }

    root.removeAllChildren();
    model.nodeStructureChanged(root);

    Runnable load = new Runnable() {
        public void run() {

            LoadingDialog loading = new LoadingDialog(ancestor);
            try {
                loading.display("Loading Config", "Loading configuration details.");

                Unmarshaller u = configJaxbContext.createUnmarshaller();
                ServiceConfig config = (ServiceConfig) u.unmarshal(configPath);

                for (ServiceInfo info : config.services()) {

                    final ServiceContainer container = new ServiceContainer();
                    container.setInfo(info);

                    boolean success;
                    try {
                        refresh(container);
                        success = true;
                    } catch (Exception ex) {
                        ex.printStackTrace();
                        JOptionPane.showMessageDialog(ancestor, "Could not refresh service " + info.getUrl(),
                                "Service Refresh Failed", JOptionPane.ERROR_MESSAGE);
                        success = false;
                    }

                    class UpdateUI implements Runnable {

                        private final boolean success;

                        public UpdateUI(boolean success) {
                            this.success = success;
                        }

                        public void run() {

                            DefaultMutableTreeNode serviceNode = new DefaultMutableTreeNode(container);
                            root.add(serviceNode);
                            model.nodeStructureChanged(root);
                            //                           model.nodesWereInserted(root, new int[]{ root.getIndex(serviceNode) });

                            if (success) {
                                rebuild(container);
                            }
                        }
                    }

                    SwingUtilities.invokeLater(new UpdateUI(success));
                }
            } catch (Exception ex) {
                ex.printStackTrace();
                JOptionPane.showMessageDialog(ancestor, "Could not load configuration from file: " + configPath,
                        "Config Load Failed", JOptionPane.ERROR_MESSAGE);
            } finally {
                loading.dispose();
            }
        }
    };

    Thread loaderThread = new Thread(load, "LoaderThread");
    loaderThread.start();
}

From source file:net.sf.profiler4j.console.ClassListPanel.java

public void refreshClassList() {
    try {/* w w  w.j  ava  2  s.  c  om*/
        ClassInfo[] classes = app.getClient().listLoadedClasses();
        classListTableModel.setFilters(filterTextField.getText(), onlyInstrumentedCheckBox.isSelected());
        classListTableModel.setClasses(classes);
    } catch (ClientException ce) {
        log.error("Could not refresh class list", ce);
        JOptionPane.showMessageDialog(ClassListPanel.this, "Request error", "Error", JOptionPane.ERROR_MESSAGE);
    }
}

From source file:fi.smaa.jsmaa.gui.JSMAAMainFrame.java

private void showErrorIncompatibleModel(String file, String reason) {
    JOptionPane.showMessageDialog(this, "Error loading model from " + file + ": " + reason + ".", "Load error",
            JOptionPane.ERROR_MESSAGE);
}

From source file:v800_trainer.JUebersicht.java

public JPanel Update_Uebersicht(JCicloTronic JTronicHandle) {

    int i;//  w w  w .  ja  v  a 2s .  c  o m
    Day xTime[];
    Today = new GregorianCalendar();
    double y1Werte[];
    double y2Werte[];
    double y3Werte[];
    double y4Werte[];
    double y5Werte[];
    double y6Werte[];
    double y7Werte[];
    double y8Werte[];
    double y9Werte[];
    double y10Werte[];
    double SummeZeit = 0;
    double Summekm = 0;
    double Summehm = 0;
    double SummeZeit12Mon = 0;
    double Summekm12Mon = 0;
    double Summehm12Mon = 0;
    int AnzahlJahre = 0;
    int Selektiert = 0;
    int SelektiertVergl = 0;
    int Jahr;
    int Linecount = 0;
    boolean Vergleich = false;
    XYItemRenderer renderer;
    XYBarRenderer rendererb;

    JFreeChart chart;

    AnzahlJahre = JTronicHandle.Auswahl_bersicht.getItemCount();
    Selektiert = JTronicHandle.Auswahl_bersicht.getSelectedIndex();
    SelektiertVergl = JTronicHandle.JahrVergleich.getSelectedIndex();
    if (SelektiertVergl == 0 || Selektiert == SelektiertVergl - 1)
        Vergleich = false;
    else
        Vergleich = true;

    xTime = new Day[366];

    y1Werte = new double[366];
    y2Werte = new double[366];
    y3Werte = new double[366];
    y4Werte = new double[366];
    y5Werte = new double[366];
    y6Werte = new double[366];
    y7Werte = new double[366];
    y8Werte = new double[366];
    y9Werte = new double[366];
    y10Werte = new double[366];
    TimeSeries dataset;

    dataset = new TimeSeries("dummy");

    dataset.add(new Day(1, 1, 1900), 1);

    TimeSeriesCollection dataset1 = new TimeSeriesCollection(dataset);

    chart = ChartFactory.createTimeSeriesChart(
            "Jahresbersicht " + JTronicHandle.Auswahl_bersicht.getSelectedItem().toString(), "Zeit", "",
            dataset1, true, true, true);

    XYToolTipGenerator ToolTip = new StandardXYToolTipGenerator("{0}: ({1}, {2})",
            (DateFormat) new SimpleDateFormat("dd.MM"), NumberFormat.getInstance());

    if (SelektiertVergl != 0)
        chart.addSubtitle(new TextTitle(
                "Vergleich mit Jahr " + JTronicHandle.JahrVergleich.getSelectedItem().toString()));
    chart.setBackgroundPaint(Color.white);

    JTronicHandle.applyChartTheme(chart);

    XYPlot plot = chart.getXYPlot();
    plot.setOrientation(PlotOrientation.VERTICAL);
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
    plot.setDomainCrosshairVisible(true);
    plot.setRangeCrosshairVisible(true);
    plot.setRangeCrosshairLockedOnData(false);
    plot.setDomainCrosshairLockedOnData(false);
    if (!JTronicHandle.jRadioButton_jahresverlauf.isSelected()) {
        DateAxis MyAxis = new DateAxis();
        MyAxis = (DateAxis) plot.getDomainAxis();
        MyAxis.setTickMarkPosition(DateTickMarkPosition.MIDDLE);
        MyAxis.setDateFormatOverride(new SimpleDateFormat("MMM-yyyy"));

        plot.setDomainGridlinesVisible(false);

    }

    plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
    plot.getRangeAxis().setFixedDimension(15.0);

    plot.getDomainAxis().setTickLabelInsets(new RectangleInsets(2.0, 1.0, 2.0, 1.0));

    Jahr = Integer.parseInt(JTronicHandle.Auswahl_bersicht.getSelectedItem().toString());

    for (i = 0; i < 366; i++) {
        SummeZeit12Mon += (double) Zeit[Selektiert + 1][i];
        Summekm12Mon += (double) kmJahr[Selektiert + 1][i];
        Summehm12Mon += (double) HmJahr[Selektiert + 1][i];

    }

    y4Werte[0] = SummeZeit12Mon;
    y5Werte[0] = Summekm12Mon;
    y6Werte[0] = Summehm12Mon;

    xTime[0] = new Day(31, 12, Jahr - 1);
    for (i = 1; i < 366; i++) {
        try {
            xTime[i] = new Day(xTime[i - 1].next().getStart());

        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, "Exception GregorianCalender  " + e, "Achtung!",
                    JOptionPane.ERROR_MESSAGE);
        }

        if (JTronicHandle.jRadioButton_jahresverlauf.isSelected()) {
            SummeZeit += (double) Zeit[Selektiert][i];
            Summekm += (double) kmJahr[Selektiert][i];
            Summehm += (double) HmJahr[Selektiert][i];
            y1Werte[i] = SummeZeit;
            y2Werte[i] = Summekm;
            y3Werte[i] = Summehm;

            y4Werte[i] = y4Werte[i - 1] - (double) Zeit[Selektiert + 1][i] + (double) Zeit[Selektiert][i];
            y5Werte[i] = y5Werte[i - 1] - (double) kmJahr[Selektiert + 1][i] + (double) kmJahr[Selektiert][i];
            y6Werte[i] = y6Werte[i - 1] - (double) HmJahr[Selektiert + 1][i] + (double) HmJahr[Selektiert][i];

        } else {
            Day n = new Day(1, xTime[i].getMonth(), xTime[i].getYear());
            try {
                Kalender = new GregorianCalendar(xTime[i].getYear(), xTime[i].getMonth() - 1, 1);

            } catch (Exception e) {
                JOptionPane.showMessageDialog(null, "Exception GregorianCalender  " + e, "Achtung!",
                        JOptionPane.ERROR_MESSAGE);

            }
            int j = (int) Kalender.get(Kalender.DAY_OF_YEAR);
            for (int m = 0; m < 6; m++) {
                y1Werte[j + m + 1] += (double) Zeit[Selektiert][i];
                y2Werte[j + m + 11] += (double) kmJahr[Selektiert][i];
                y3Werte[j + m + 21] += (double) HmJahr[Selektiert][i];

            }
        }

    }

    dataset = new TimeSeries("Trainingszeit " + JTronicHandle.Auswahl_bersicht.getSelectedItem().toString());
    for (i = 0; i < 366; i++) {
        dataset.add(xTime[i], y1Werte[i]);
    }

    dataset1 = new TimeSeriesCollection(dataset);
    NumberAxis axis = new NumberAxis();
    try {
        axis = (NumberAxis) plot.getRangeAxis().clone();
    } catch (Exception e) {
    }
    axis.setLabel("Stunden");
    axis.setAutoRangeIncludesZero(true);
    axis.setLabelPaint(Color.BLACK);
    axis.setTickLabelPaint(Color.BLACK);
    plot.setRangeAxis(0, axis);
    plot.setRangeAxisLocation(0, AxisLocation.BOTTOM_OR_LEFT);

    plot.setDataset(Linecount, dataset1);
    plot.mapDatasetToRangeAxis(Linecount, 0);

    if (JTronicHandle.jRadioButton_jahresverlauf.isSelected()) {
        renderer = new StandardXYItemRenderer(2, ToolTip);
        renderer.setSeriesPaint(0, getColour(Linecount, 255));

        plot.setRenderer(Linecount, renderer);
    } else {
        rendererb = new XYBarRenderer();
        rendererb.setSeriesPaint(0, getColour(Linecount, 150));
        rendererb.setShadowVisible(false);
        rendererb.setDrawBarOutline(false);
        rendererb.setBarPainter(new StandardXYBarPainter());

        plot.setRenderer(Linecount, rendererb);
    }

    Linecount++;

    dataset = new TimeSeries(
            "Trainingskilometer " + JTronicHandle.Auswahl_bersicht.getSelectedItem().toString());
    for (i = 0; i < 366; i++) {
        dataset.add(xTime[i], y2Werte[i]);

    }

    TimeSeriesCollection dataset2 = new TimeSeriesCollection(dataset);

    NumberAxis axis2 = new NumberAxis();
    try {
        axis2 = (NumberAxis) plot.getRangeAxis().clone();
    } catch (Exception e) {
    }
    ;
    axis2.setLabel("Kilometer");
    axis2.setAutoRangeIncludesZero(true);
    axis2.setLabelPaint(Color.BLACK);
    axis2.setTickLabelPaint(Color.BLACK);

    plot.setRangeAxis(1, axis2);
    plot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_LEFT);

    plot.setDataset(Linecount, dataset2);
    plot.mapDatasetToRangeAxis(Linecount, 1);

    if (JTronicHandle.jRadioButton_jahresverlauf.isSelected()) {
        renderer = new StandardXYItemRenderer(2, ToolTip);
        renderer.setSeriesPaint(0, getColour(Linecount, 255));

        plot.setRenderer(Linecount, renderer);
    } else {
        rendererb = new XYBarRenderer();
        rendererb.setSeriesPaint(0, getColour(Linecount, 150));
        rendererb.setShadowVisible(false);
        rendererb.setDrawBarOutline(false);
        rendererb.setBarPainter(new StandardXYBarPainter());

        plot.setRenderer(Linecount, rendererb);
    }

    Linecount++;

    dataset = new TimeSeries(
            "Trainingshhenmeter " + JTronicHandle.Auswahl_bersicht.getSelectedItem().toString());
    for (i = 0; i < 366; i++) {
        dataset.add(xTime[i], y3Werte[i]);

    }

    TimeSeriesCollection dataset3 = new TimeSeriesCollection(dataset);

    NumberAxis axis3 = new NumberAxis("Hhenmeter");
    try {
        axis3 = (NumberAxis) plot.getRangeAxis().clone();
    } catch (Exception e) {
    }
    ;
    axis3.setLabel("Hhenmeter");
    axis3.setAutoRangeIncludesZero(true);
    axis3.setLabelPaint(Color.BLACK);
    axis3.setTickLabelPaint(Color.BLACK);

    plot.setRangeAxis(2, axis3);
    plot.setRangeAxisLocation(2, AxisLocation.BOTTOM_OR_RIGHT);

    plot.setDataset(Linecount, dataset3);
    plot.mapDatasetToRangeAxis(Linecount, 2);

    if (JTronicHandle.jRadioButton_jahresverlauf.isSelected()) {
        renderer = new StandardXYItemRenderer(2, ToolTip);
        renderer.setSeriesPaint(0, getColour(Linecount, 255));

        plot.setRenderer(Linecount, renderer);
    } else {
        rendererb = new XYBarRenderer();
        rendererb.setSeriesPaint(0, getColour(Linecount, 150));
        rendererb.setShadowVisible(false);
        rendererb.setDrawBarOutline(false);
        rendererb.setBarPainter(new StandardXYBarPainter());

        plot.setRenderer(Linecount, rendererb);
    }

    Linecount++;

    if (Vergleich == true) {
        SummeZeit = 0;
        Summekm = 0;
        Summehm = 0;

        SummeZeit12Mon = 0;
        Summekm12Mon = 0;
        Summehm12Mon = 0;

        for (i = 0; i < 366; i++) {
            SummeZeit12Mon += (double) Zeit[SelektiertVergl - 1][i];
            Summekm12Mon += (double) kmJahr[SelektiertVergl - 1][i];
            Summehm12Mon += (double) HmJahr[SelektiertVergl - 1][i];
        }

        y4Werte[0] = SummeZeit12Mon;
        y5Werte[0] = Summekm12Mon;
        y6Werte[0] = Summehm12Mon;

        for (i = 1; i < 366; i++) {
            try {

            } catch (Exception e) {
                JOptionPane.showMessageDialog(null, "Exception GregorianCalender  " + e, "Achtung!",
                        JOptionPane.ERROR_MESSAGE);
            }
            ;
            if (JTronicHandle.jRadioButton_jahresverlauf.isSelected()) {
                SummeZeit += (double) Zeit[SelektiertVergl - 1][i];
                Summekm += (double) kmJahr[SelektiertVergl - 1][i];
                Summehm += (double) HmJahr[SelektiertVergl - 1][i];
                y7Werte[i] = SummeZeit;
                y8Werte[i] = Summekm;
                y9Werte[i] = Summehm;

                y4Werte[i] = y4Werte[i - 1] - (double) Zeit[SelektiertVergl - 1][i]
                        + (double) Zeit[Selektiert][i];
                y5Werte[i] = y5Werte[i - 1] - (double) kmJahr[SelektiertVergl - 1][i]
                        + (double) kmJahr[Selektiert][i];
                y6Werte[i] = y6Werte[i - 1] - (double) HmJahr[SelektiertVergl - 1][i]
                        + (double) HmJahr[Selektiert][i];
            } else {
                Day n = new Day(1, xTime[i].getMonth(), xTime[i].getYear());
                try {
                    Kalender = new GregorianCalendar(xTime[i].getYear(), xTime[i].getMonth() - 1, 1);

                } catch (Exception e) {
                    JOptionPane.showMessageDialog(null, "Exception GregorianCalender  " + e, "Achtung!",
                            JOptionPane.ERROR_MESSAGE);

                }
                int j = (int) Kalender.get(Kalender.DAY_OF_YEAR);
                for (int m = 0; m < 5; m++) {
                    y7Werte[j + m + 4] += (double) Zeit[SelektiertVergl - 1][i];
                    y8Werte[j + m + 14] += (double) kmJahr[SelektiertVergl - 1][i];
                    y9Werte[j + m + 24] += (double) HmJahr[SelektiertVergl - 1][i];

                }

            }

        }

        if (JTronicHandle.jRadioButton_jahresverlauf.isSelected()) {
            dataset = new TimeSeries("Trainingszeit ber 12 Monate ");
            for (i = 0; i < 366; i++) {
                dataset.add(xTime[i], y4Werte[i]);
            }

            TimeSeriesCollection dataset4 = new TimeSeriesCollection(dataset);

            plot.setDataset(Linecount, dataset4);
            plot.mapDatasetToRangeAxis(Linecount, 0);

            if (JTronicHandle.jRadioButton_jahresverlauf.isSelected()) {
                renderer = new StandardXYItemRenderer(2, ToolTip);
                renderer.setSeriesPaint(0, getColour(Linecount, 255));

                plot.setRenderer(Linecount, renderer);
            } else {
                rendererb = new XYBarRenderer();
                rendererb.setSeriesPaint(0, getColour(Linecount, 150));
                rendererb.setShadowVisible(false);
                rendererb.setBarPainter(new StandardXYBarPainter());

                plot.setRenderer(Linecount, rendererb);
            }

            Linecount++;

            dataset = new TimeSeries("Trainingskilometer ber 12 Monate ");
            for (i = 0; i < 366; i++) {
                dataset.add(xTime[i], y5Werte[i]);
            }

            TimeSeriesCollection dataset5 = new TimeSeriesCollection(dataset);

            plot.setDataset(Linecount, dataset5);
            plot.mapDatasetToRangeAxis(Linecount, 1);

            if (JTronicHandle.jRadioButton_jahresverlauf.isSelected()) {
                renderer = new StandardXYItemRenderer(2, ToolTip);
                renderer.setSeriesPaint(0, getColour(Linecount, 255));

                plot.setRenderer(Linecount, renderer);
            } else {
                rendererb = new XYBarRenderer();
                rendererb.setSeriesPaint(0, getColour(Linecount, 150));
                rendererb.setShadowVisible(false);
                rendererb.setGradientPaintTransformer(null);
                rendererb.setBarPainter(new StandardXYBarPainter());

                plot.setRenderer(Linecount, rendererb);
            }

            Linecount++;

            dataset = new TimeSeries("Trainingshhenmeter ber 12 Monate ");
            for (i = 0; i < 366; i++) {
                dataset.add(xTime[i], y6Werte[i]);
            }

            TimeSeriesCollection dataset6 = new TimeSeriesCollection(dataset);

            plot.setDataset(Linecount, dataset6);
            plot.mapDatasetToRangeAxis(Linecount, 2);

            if (JTronicHandle.jRadioButton_jahresverlauf.isSelected()) {
                renderer = new StandardXYItemRenderer(2, ToolTip);
                renderer.setSeriesPaint(0, getColour(Linecount, 255));

                plot.setRenderer(Linecount, renderer);
            } else {
                rendererb = new XYBarRenderer();
                rendererb.setSeriesPaint(0, getColour(Linecount, 150));
                rendererb.setShadowVisible(false);
                rendererb.setGradientPaintTransformer(null);
                rendererb.setBarPainter(new StandardXYBarPainter());

                plot.setRenderer(Linecount, rendererb);
            }

        }
        Linecount++;

        dataset = new TimeSeries("Trainingszeit " + JTronicHandle.JahrVergleich.getSelectedItem().toString());
        for (i = 0; i < 366; i++) {
            dataset.add(xTime[i], y7Werte[i]);
        }

        TimeSeriesCollection dataset7 = new TimeSeriesCollection(dataset);

        plot.setDataset(Linecount, dataset7);
        plot.mapDatasetToRangeAxis(Linecount, 0);

        if (JTronicHandle.jRadioButton_jahresverlauf.isSelected()) {
            renderer = new StandardXYItemRenderer(2, ToolTip);
            renderer.setSeriesPaint(0, getColour(Linecount, 255));

            plot.setRenderer(Linecount, renderer);
        } else {
            rendererb = new XYBarRenderer();
            rendererb.setSeriesPaint(0, getColour(Linecount, 150));
            rendererb.setShadowVisible(false);
            rendererb.setGradientPaintTransformer(null);
            rendererb.setBarPainter(new StandardXYBarPainter());

            plot.setRenderer(Linecount, rendererb);
        }
        Linecount++;

        dataset = new TimeSeries(
                "Trainingskilometer " + JTronicHandle.JahrVergleich.getSelectedItem().toString());
        for (i = 0; i < 366; i++) {
            dataset.add(xTime[i], y8Werte[i]);
        }

        TimeSeriesCollection dataset8 = new TimeSeriesCollection(dataset);

        plot.setDataset(Linecount, dataset8);
        plot.mapDatasetToRangeAxis(Linecount, 1);

        if (JTronicHandle.jRadioButton_jahresverlauf.isSelected()) {
            renderer = new StandardXYItemRenderer(2, ToolTip);
            renderer.setSeriesPaint(0, getColour(Linecount, 255));

            plot.setRenderer(Linecount, renderer);
        } else {
            rendererb = new XYBarRenderer();
            rendererb.setSeriesPaint(0, getColour(Linecount, 150));
            rendererb.setShadowVisible(false);
            rendererb.setGradientPaintTransformer(null);
            rendererb.setBarPainter(new StandardXYBarPainter());

            plot.setRenderer(Linecount, rendererb);
        }

        Linecount++;

        dataset = new TimeSeries(
                "Trainingshhenmeter " + JTronicHandle.JahrVergleich.getSelectedItem().toString());
        for (i = 0; i < 366; i++) {
            dataset.add(xTime[i], y9Werte[i]);
        }

        TimeSeriesCollection dataset9 = new TimeSeriesCollection(dataset);

        plot.setDataset(Linecount, dataset9);
        plot.mapDatasetToRangeAxis(Linecount, 2);

        if (JTronicHandle.jRadioButton_jahresverlauf.isSelected()) {
            renderer = new StandardXYItemRenderer(2, ToolTip);
            renderer.setSeriesPaint(0, getColour(Linecount, 255));

            plot.setRenderer(Linecount, renderer);
        } else {
            rendererb = new XYBarRenderer();
            rendererb.setSeriesPaint(0, getColour(Linecount, 150));
            rendererb.setShadowVisible(false);
            rendererb.setGradientPaintTransformer(null);
            rendererb.setBarPainter(new StandardXYBarPainter());

            plot.setRenderer(Linecount, rendererb);
        }

    }

    if (!JTronicHandle.jRadioButton_jahresverlauf.isSelected()) {

        double max = axis.getRange().getUpperBound();
        for (i = 0; i < 12; i++) {
            try {
                Kalender = new GregorianCalendar(Integer.parseInt(DataProperty.getProperty("Jahr", "0")), i, 1);

            } catch (Exception e) {
                JOptionPane.showMessageDialog(null, "JUebersicht\nException GregorianCalender  " + e,
                        "Achtung!", JOptionPane.ERROR_MESSAGE);
            }

            y10Werte[Kalender.get(Kalender.DAY_OF_YEAR)] = max;
            y10Werte[Kalender.get(Kalender.DAY_OF_YEAR) + 1] = 0;
        }
        dataset = new TimeSeries("");

        for (i = 0; i < 366; i++) {

            dataset.add(xTime[i], y10Werte[i]);

        }
        TimeSeriesCollection dataset10 = new TimeSeriesCollection(dataset);
        plot.setDataset(Linecount + 1, dataset10);
        plot.mapDatasetToRangeAxis(Linecount + 1, 0);

        renderer = new StandardXYItemRenderer(2, ToolTip);
        renderer.setSeriesPaint(0, Color.white);

        plot.setRenderer(Linecount + 1, renderer);
        plot.getDomainAxis().setAutoRange(false);
        axis.setRange(0, max);

    }

    if (JTronicHandle.jRadioButton_jahresverlauf.isSelected()) {
        axis2.setRange(0, axis2.getRange().getUpperBound() * 1.5);
        axis3.setRange(0, axis3.getRange().getUpperBound() * 2);
        plot.setDomainCrosshairValue(
                (double) new GregorianCalendar(Jahr, Today.get(Today.MONTH), Today.get(Today.DAY_OF_MONTH))
                        .getTimeInMillis());

    }

    chart.setPadding(padding);
    ChartPanel Panel = new ChartPanel(chart);
    Panel.setDismissDelay(100000);

    return Panel;

}

From source file:com.sshtools.j2ssh.authentication.UserGridCredential.java

public static GSSCredential getUserCredential(SshConnectionProperties properties)
        throws GSSException, IOException {

    CertUtil.init();//from w w  w .  j  av  a2  s . c  o m

    SAVE_MYPROXY_PROXY = ((SshToolsConnectionProfile) properties)
            .getApplicationPropertyBoolean(SshTerminalPanel.PREF_SAVE_PROXY, SAVE_MYPROXY_PROXY);
    SAVE_GRID_PROXY_INIT_PROXY = ((SshToolsConnectionProfile) properties)
            .getApplicationPropertyBoolean(SshTerminalPanel.PREF_SAVE_PROXY, SAVE_GRID_PROXY_INIT_PROXY);
    SAVE_PKCS12_PROXY = ((SshToolsConnectionProfile) properties)
            .getApplicationPropertyBoolean(SshTerminalPanel.PREF_SAVE_PROXY, SAVE_PKCS12_PROXY);
    SAVE_BROWSER_PROXY = ((SshToolsConnectionProfile) properties)
            .getApplicationPropertyBoolean(SshTerminalPanel.PREF_SAVE_PROXY, SAVE_BROWSER_PROXY);
    myProxyPrompt = MyProxyPrompt.getInstance();
    myProxyPrompt.setProperties(properties);
    gridProxyInitPrompt = GridProxyInitPrompt.getInstance();
    gridProxyInitPrompt.setTitle("Enter your grid certificate passphrase");

    CoGProperties cogproperties = CoGProperties.getDefault();
    checkCACertificates(cogproperties);

    int proxyType = GSIConstants.GSI_3_IMPERSONATION_PROXY;
    try {
        String cur = ((SshToolsConnectionProfile) properties).getApplicationProperty(
                SshTerminalPanel.PREF_PROXY_TYPE, Integer.toString(GSIConstants.GSI_3_IMPERSONATION_PROXY));
        proxyType = Integer.parseInt(cur);
    } catch (Exception e) {
        throw new Error("Programming Error", e);
    }
    int lifetimeHours = 12;
    try {
        String cur = ((SshToolsConnectionProfile) properties)
                .getApplicationProperty(SshTerminalPanel.PREF_PROXY_LENGTH, "12");
        lifetimeHours = Integer.parseInt(cur);
    } catch (Exception e) {
        throw new Error("Programming Error", e);
    }

    String order = PreferencesStore.get(SshTerminalPanel.PREF_AUTH_ORDER, "param,proxy,cert,other");

    if (properties instanceof SshToolsConnectionProfile) {
        SshToolsConnectionProfile profile = (SshToolsConnectionProfile) properties;
        order = profile.getApplicationProperty(SshTerminalPanel.PREF_AUTH_ORDER, order);
    }
    String meths[] = order.split("(,|\\s)");

    log.debug("Loading grid proxy.");
    GSSCredential gsscredential = null;
    do {
        if (gsscredential != null)
            break;
        for (int i = 0; i < meths.length; i++) {
            if (gsscredential != null)
                break;
            String m = meths[i];
            if (meths[i].equals(""))
                continue;
            if (meths[i].equals("proxy")) {
                gsscredential = loadExistingProxy();
            } else if (meths[i].equals("param")) {
                gsscredential = loadProxyFromParam();
            } else if (meths[i].equals("other")) {
                gsscredential = retrieveRemoteProxy(properties, proxyType, lifetimeHours);
            } else if (meths[i].equals("cert")) {
                gsscredential = createProxy(proxyType, lifetimeHours, properties);
            } else if (meths[i].equals("browser")) {
                gsscredential = chooseCert(proxyType, lifetimeHours, properties);
            } else if (meths[i].equals("krb")) {
                gsscredential = saslProxy(properties, lifetimeHours);
            } else {
                JOptionPane.showMessageDialog(properties.getWindow(),
                        "Method '" + meths[i] + "' is an unknown authentication method, skipping.",
                        "GSI-SSHTerm Authentication", JOptionPane.ERROR_MESSAGE);
            }
        }
    } while (true);
    return gsscredential;
}

From source file:com.stam.batchmove.SelectionFrame.java

private void selectFilesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectFilesActionPerformed
    String path = sourceDir.getText();
    if (path == null || path.trim().equals("")) {
        JOptionPane.showMessageDialog(this, "You must first select a source directory", "Error",
                JOptionPane.ERROR_MESSAGE);
        return;// w w  w  . j  a  v a2 s. c om
    }

    File sourceDir = new File(path);
    File[] sourceDirFilesArr = sourceDir.listFiles();
    List<File> files = Arrays.asList(sourceDirFilesArr);

    String[] columnNames = { "", "Filename", "Size", "Type" };
    Object[][] data = new Object[files.size()][4];

    int fileNo = 0;
    for (File file : files) {
        data[fileNo][0] = false;
        data[fileNo][1] = file.getAbsolutePath();
        data[fileNo][2] = file.length();
        data[fileNo][3] = file.isFile() ? "File" : "Directory";

        fileNo++;
    }
    BatchMoveUtils.showFilesFrame(data, columnNames, this);
}