Search in sources :

Example 6 with XYItemEntity

use of org.jfree.chart.entity.XYItemEntity in project tdq-studio-se by Talend.

the class TOPChartService method addSpecifiedListenersForCorrelationChart.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.dataprofiler.service.ITOPChartService#addSpecifiedListenersForCorrelationChart(boolean, boolean,
     * java.lang.Object, java.util.List)
     */
@Override
public void addSpecifiedListenersForCorrelationChart(Object chartcomp, final Object chart, final boolean isAvg, final boolean isDate, final Map<Integer, Object> keyWithAdapter) {
    final ChartComposite chartComp = (ChartComposite) chartcomp;
    chartComp.addChartMouseListener(new ChartMouseListener() {

        @Override
        public void chartMouseClicked(ChartMouseEvent event) {
            chartComp.setRangeZoomable(event.getTrigger().getButton() == 1);
            chartComp.setDomainZoomable(event.getTrigger().getButton() == 1);
            if (event.getTrigger().getButton() != 3) {
                return;
            }
            final Menu menu = new Menu(chartComp.getShell(), SWT.POP_UP);
            MenuItem itemShowInFullScreen = new MenuItem(menu, SWT.PUSH);
            // $NON-NLS-1$
            itemShowInFullScreen.setText(Messages.getString("HideSeriesChartComposite.ShowInFullScreen"));
            itemShowInFullScreen.addSelectionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                    Display.getDefault().asyncExec(new Runnable() {

                        @Override
                        public void run() {
                            showChartInFillScreen(chart, isAvg, isDate);
                        }
                    });
                }
            });
            chartComp.setMenu(menu);
            ChartEntity chartEntity = event.getEntity();
            if (chartEntity != null) {
                if (isAvg) {
                    addMenuOnBubbleChart(menu, chartEntity);
                } else if (isDate) {
                    addMenuOnGantChart(menu, chartEntity);
                }
            }
            menu.setVisible(true);
        }

        private void addMenuOnBubbleChart(Menu menu, ChartEntity chartEntity) {
            if (chartEntity instanceof XYItemEntity) {
                XYItemEntity xyItemEntity = (XYItemEntity) chartEntity;
                createMenuItem(menu, xyItemEntity.getItem());
            }
        }

        private void addMenuOnGantChart(Menu menu, ChartEntity chartEntity) {
            if (chartEntity instanceof CategoryItemEntity) {
                CategoryItemEntity itemEntity = (CategoryItemEntity) chartEntity;
                createMenuItem(menu, itemEntity.getCategoryIndex());
            }
        }

        private void createMenuItem(Menu menu, final int seriesK) {
            final SelectionAdapter selectionAdapter = (SelectionAdapter) keyWithAdapter.get(seriesK);
            MenuItem item;
            item = new MenuItem(menu, SWT.PUSH);
            // $NON-NLS-1$
            item.setText(Messages.getString("HideSeriesChartComposite.ViewRow"));
            item.addSelectionListener(selectionAdapter);
        }

        @Override
        public void chartMouseMoved(ChartMouseEvent event) {
        // no need to implement
        }
    });
}
Also used : SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) MenuItem(org.eclipse.swt.widgets.MenuItem) ChartMouseEvent(org.jfree.chart.ChartMouseEvent) ChartMouseListener(org.jfree.chart.ChartMouseListener) XYItemEntity(org.jfree.chart.entity.XYItemEntity) TalendChartComposite(org.talend.dataprofiler.chart.util.TalendChartComposite) ChartComposite(org.jfree.experimental.chart.swt.ChartComposite) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Menu(org.eclipse.swt.widgets.Menu) ChartEntity(org.jfree.chart.entity.ChartEntity) CategoryItemEntity(org.jfree.chart.entity.CategoryItemEntity)

Example 7 with XYItemEntity

use of org.jfree.chart.entity.XYItemEntity in project Course_Generator by patrovite.

the class JPanelAnalysisSpeed method initComponents.

private void initComponents() {
    setLayout(new java.awt.BorderLayout());
    // //-- Left - Toolbar
    // Create_Toolbar();
    // add(toolBar, java.awt.BorderLayout.WEST);
    // 
    // -- Bottom - Info
    jPanelSpeedInfo = new javax.swing.JPanel();
    jPanelSpeedInfo.setOpaque(true);
    jPanelSpeedInfo.setBackground(Color.WHITE);
    jPanelSpeedInfo.setLayout(new GridBagLayout());
    add(jPanelSpeedInfo, java.awt.BorderLayout.SOUTH);
    // -- Start speed/End speed/Speed/Distance
    // -- Start speed
    lbSpeedInfoStartSpeed = new javax.swing.JLabel();
    lbSpeedInfoStartSpeed.setOpaque(true);
    lbSpeedInfoStartSpeed.setBackground(Color.WHITE);
    lbSpeedInfoStartSpeed.setText(" " + bundle.getString("JPanelAnalysisSpeed.lbSpeedInfoStartSpeed.text") + "=0km/h ");
    lbSpeedInfoStartSpeed.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelSpeedInfo, lbSpeedInfoStartSpeed, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.WEST, GridBagConstraints.BOTH);
    // -- End speed
    lbSpeedInfoEndSpeed = new javax.swing.JLabel();
    lbSpeedInfoEndSpeed.setOpaque(true);
    lbSpeedInfoEndSpeed.setBackground(Color.WHITE);
    lbSpeedInfoEndSpeed.setText(" " + bundle.getString("JPanelAnalysisSpeed.lbSpeedInfoEndSpeed.text") + "=0km/h ");
    lbSpeedInfoEndSpeed.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelSpeedInfo, lbSpeedInfoEndSpeed, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.WEST, GridBagConstraints.BOTH);
    // -- Speed
    lbSpeedInfoSpeed = new javax.swing.JLabel();
    lbSpeedInfoSpeed.setOpaque(true);
    lbSpeedInfoSpeed.setBackground(Color.WHITE);
    lbSpeedInfoSpeed.setText(" " + bundle.getString("JPanelAnalysisSpeed.lbSpeedInfoSpeed.text") + "=0km/h ");
    lbSpeedInfoSpeed.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelSpeedInfo, lbSpeedInfoSpeed, 2, 0, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.WEST, GridBagConstraints.BOTH);
    // -- Distance
    lbSpeedInfoDistance = new javax.swing.JLabel();
    lbSpeedInfoDistance.setOpaque(true);
    lbSpeedInfoDistance.setBackground(Color.WHITE);
    lbSpeedInfoDistance.setText(" " + bundle.getString("JPanelAnalysisSpeed.lbSpeedInfoDistance.text") + "=0.000km ");
    lbSpeedInfoDistance.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelSpeedInfo, lbSpeedInfoDistance, 3, 0, 1, 1, 1, 0, 0, 0, 0, 0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL);
    // -- Chart Speed/Dist & Time/Dist
    ChartPanelSpeed = new ChartPanel(chart, true, /* Properties */
    true, /* save */
    true, /* print */
    false, /* zoom */
    true);
    ChartPanelSpeed.setDomainZoomable(false);
    ChartPanelSpeed.setRangeZoomable(false);
    CrosshairOverlay crosshairOverlay = new CrosshairOverlay();
    xCrosshair = new Crosshair(Double.NaN, Color.RED, new BasicStroke(0f));
    xCrosshair.setLabelBackgroundPaint(Color.WHITE);
    crosshairOverlay.addDomainCrosshair(xCrosshair);
    ChartPanelSpeed.addOverlay(crosshairOverlay);
    ChartPanelSpeed.setBackground(new java.awt.Color(255, 0, 51));
    ChartPanelSpeed.addChartMouseListener(new ChartMouseListener() {

        @Override
        public void chartMouseClicked(ChartMouseEvent event) {
            ChartEntity chartentity = event.getEntity();
            if (chartentity instanceof XYItemEntity) {
                XYItemEntity e = (XYItemEntity) chartentity;
                XYDataset d = e.getDataset();
                int s = e.getSeriesIndex();
                int i = e.getItem();
                double x = d.getXValue(s, i);
                xCrosshair.setValue(x);
                RefreshInfo(i);
            }
        }

        @Override
        public void chartMouseMoved(ChartMouseEvent event) {
        }
    });
    add(ChartPanelSpeed, java.awt.BorderLayout.CENTER);
}
Also used : BasicStroke(java.awt.BasicStroke) Color(java.awt.Color) ChartPanel(org.jfree.chart.ChartPanel) GridBagLayout(java.awt.GridBagLayout) Crosshair(org.jfree.chart.plot.Crosshair) ChartMouseEvent(org.jfree.chart.ChartMouseEvent) ChartMouseListener(org.jfree.chart.ChartMouseListener) XYItemEntity(org.jfree.chart.entity.XYItemEntity) JLabel(javax.swing.JLabel) CrosshairOverlay(org.jfree.chart.panel.CrosshairOverlay) XYDataset(org.jfree.data.xy.XYDataset) ChartEntity(org.jfree.chart.entity.ChartEntity) JPanel(javax.swing.JPanel)

Example 8 with XYItemEntity

use of org.jfree.chart.entity.XYItemEntity in project Course_Generator by patrovite.

the class JPanelAnalysisSpeedSlope method initComponents.

private void initComponents() {
    setLayout(new java.awt.BorderLayout());
    // -- Left - Toolbar
    Create_Toolbar();
    add(toolBar, java.awt.BorderLayout.WEST);
    // -- Bottom - Info
    jPanelSpeedSlopeInfo = new javax.swing.JPanel();
    jPanelSpeedSlopeInfo.setOpaque(true);
    jPanelSpeedSlopeInfo.setBackground(Color.WHITE);
    jPanelSpeedSlopeInfo.setLayout(new GridBagLayout());
    add(jPanelSpeedSlopeInfo, java.awt.BorderLayout.SOUTH);
    // -- Speed/Slope
    // -- Speed
    lbSpeedSlopeInfoSpeed = new javax.swing.JLabel();
    lbSpeedSlopeInfoSpeed.setOpaque(true);
    lbSpeedSlopeInfoSpeed.setBackground(Color.WHITE);
    lbSpeedSlopeInfoSpeed.setText(" " + bundle.getString("JPanelAnalysisSpeedSlope.lbSpeedSlopeInfoSpeed.text") + "=0km/h ");
    lbSpeedSlopeInfoSpeed.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelSpeedSlopeInfo, lbSpeedSlopeInfoSpeed, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.WEST, GridBagConstraints.BOTH);
    // -- Slope
    lbSpeedSlopeInfoSlope = new javax.swing.JLabel();
    lbSpeedSlopeInfoSlope.setOpaque(true);
    lbSpeedSlopeInfoSlope.setBackground(Color.WHITE);
    lbSpeedSlopeInfoSlope.setText(" " + bundle.getString("JPanelAnalysisSpeedSlope.lbSpeedSlopeInfoSlope.text") + "=0.0% ");
    lbSpeedSlopeInfoSlope.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelSpeedSlopeInfo, lbSpeedSlopeInfoSlope, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL);
    // -- Chart Speed/Dist & Time/Dist
    ChartPanelSpeedSlope = new ChartPanel(chart, true, /* Properties */
    true, /* save */
    true, /* print */
    false, /* zoom */
    true);
    ChartPanelSpeedSlope.setDomainZoomable(false);
    ChartPanelSpeedSlope.setRangeZoomable(false);
    CrosshairOverlay crosshairOverlay = new CrosshairOverlay();
    xCrosshair = new Crosshair(Double.NaN, Color.RED, new BasicStroke(0f));
    xCrosshair.setLabelBackgroundPaint(Color.WHITE);
    // yCrosshair = new Crosshair(Double.NaN, Color.RED, new
    // BasicStroke(0f));
    // yCrosshair.setLabelBackgroundPaint(Color.WHITE);
    crosshairOverlay.addDomainCrosshair(xCrosshair);
    // crosshairOverlay.addRangeCrosshair(yCrosshair);
    ChartPanelSpeedSlope.addOverlay(crosshairOverlay);
    ChartPanelSpeedSlope.setBackground(new java.awt.Color(255, 0, 51));
    ChartPanelSpeedSlope.addChartMouseListener(new ChartMouseListener() {

        @Override
        public void chartMouseClicked(ChartMouseEvent event) {
            ChartEntity chartentity = event.getEntity();
            if (chartentity instanceof XYItemEntity) {
                XYItemEntity e = (XYItemEntity) chartentity;
                XYDataset d = e.getDataset();
                int s = e.getSeriesIndex();
                int i = e.getItem();
                double x = d.getXValue(s, i);
                double y = d.getYValue(s, i);
                xCrosshair.setValue(x);
                // yCrosshair.setValue(y);
                RefreshInfo(i);
            // //Refresh the position on the data grid
            // TableMain.setRowSelectionInterval(i, i);
            // Rectangle rect = TableMain.getCellRect(i, 0, true);
            // TableMain.scrollRectToVisible(rect);
            // //Refresh the marker position on the map
            // RefreshCurrentPosMarker(Track.data.get(i).getLatitude(),
            // Track.data.get(i).getLongitude());
            }
        }

        @Override
        public void chartMouseMoved(ChartMouseEvent event) {
        }
    });
    add(ChartPanelSpeedSlope, java.awt.BorderLayout.CENTER);
}
Also used : BasicStroke(java.awt.BasicStroke) Color(java.awt.Color) ChartPanel(org.jfree.chart.ChartPanel) GridBagLayout(java.awt.GridBagLayout) Crosshair(org.jfree.chart.plot.Crosshair) ChartMouseEvent(org.jfree.chart.ChartMouseEvent) ChartMouseListener(org.jfree.chart.ChartMouseListener) XYItemEntity(org.jfree.chart.entity.XYItemEntity) JLabel(javax.swing.JLabel) CrosshairOverlay(org.jfree.chart.panel.CrosshairOverlay) XYDataset(org.jfree.data.xy.XYDataset) ChartEntity(org.jfree.chart.entity.ChartEntity) JPanel(javax.swing.JPanel)

Example 9 with XYItemEntity

use of org.jfree.chart.entity.XYItemEntity in project Course_Generator by patrovite.

the class JPanelAnalysisTimeDist method initComponents.

private void initComponents() {
    setLayout(new java.awt.BorderLayout());
    // -- Bottom - Info
    jPanelTimeDistInfo = new javax.swing.JPanel();
    jPanelTimeDistInfo.setOpaque(true);
    jPanelTimeDistInfo.setBackground(Color.WHITE);
    jPanelTimeDistInfo.setLayout(new GridBagLayout());
    add(jPanelTimeDistInfo, java.awt.BorderLayout.SOUTH);
    // -- Distance/Elevation/Time/Hour/Slope
    lbTimeDistInfoDistance = new javax.swing.JLabel();
    lbTimeDistInfoDistance.setOpaque(true);
    lbTimeDistInfoDistance.setBackground(Color.WHITE);
    lbTimeDistInfoDistance.setText(" " + bundle.getString("JPanelAnalysisTimeDist.lbTimeDistInfoDistance.text") + "=0.000km ");
    lbTimeDistInfoDistance.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelTimeDistInfo, lbTimeDistInfoDistance, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.WEST, GridBagConstraints.BOTH);
    // -- Elevation
    lbTimeDistInfoElevation = new javax.swing.JLabel();
    lbTimeDistInfoElevation.setOpaque(true);
    lbTimeDistInfoElevation.setBackground(Color.WHITE);
    lbTimeDistInfoElevation.setText(" " + bundle.getString("JPanelAnalysisTimeDist.lbTimeDistInfoElevation.text") + "=0m ");
    lbTimeDistInfoElevation.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelTimeDistInfo, lbTimeDistInfoElevation, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.WEST, GridBagConstraints.BOTH);
    // -- Time
    lbTimeDistInfoTime = new javax.swing.JLabel();
    lbTimeDistInfoTime.setOpaque(true);
    lbTimeDistInfoTime.setBackground(Color.WHITE);
    lbTimeDistInfoTime.setText(" " + bundle.getString("JPanelAnalysisTimeDist.lbTimeDistInfoTime.text") + "=00:00:00 ");
    lbTimeDistInfoTime.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelTimeDistInfo, lbTimeDistInfoTime, 2, 0, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.WEST, GridBagConstraints.BOTH);
    // -- Hour
    lbTimeDistInfoHour = new javax.swing.JLabel();
    lbTimeDistInfoHour.setOpaque(true);
    lbTimeDistInfoHour.setBackground(Color.WHITE);
    lbTimeDistInfoHour.setText(" " + bundle.getString("JPanelAnalysisTimeDist.lbTimeDistInfoHour.text") + "=00:00:00 ");
    lbTimeDistInfoHour.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelTimeDistInfo, lbTimeDistInfoHour, 3, 0, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.WEST, GridBagConstraints.BOTH);
    // -- Slope
    lbTimeDistSlope = new javax.swing.JLabel();
    lbTimeDistSlope.setOpaque(true);
    lbTimeDistSlope.setBackground(Color.WHITE);
    lbTimeDistSlope.setText(" " + bundle.getString("JPanelAnalysisTimeDist.lbTimeDistSlope.text") + "=0.0% ");
    lbTimeDistSlope.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelTimeDistInfo, lbTimeDistSlope, 4, 0, 1, 1, 1, 0, 0, 0, 0, 0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL);
    // -- Chart Time/Dist
    ChartPanelTimeDist = new ChartPanel(chart, true, /*Properties*/
    true, /*save*/
    true, /*print*/
    false, /*zoom*/
    true);
    ChartPanelTimeDist.setDomainZoomable(false);
    ChartPanelTimeDist.setRangeZoomable(false);
    CrosshairOverlay crosshairOverlay = new CrosshairOverlay();
    xCrosshair = new Crosshair(Double.NaN, Color.RED, new BasicStroke(0f));
    xCrosshair.setLabelBackgroundPaint(Color.WHITE);
    crosshairOverlay.addDomainCrosshair(xCrosshair);
    ChartPanelTimeDist.addOverlay(crosshairOverlay);
    ChartPanelTimeDist.setBackground(new java.awt.Color(255, 0, 51));
    ChartPanelTimeDist.addChartMouseListener(new ChartMouseListener() {

        @Override
        public void chartMouseClicked(ChartMouseEvent event) {
            ChartEntity chartentity = event.getEntity();
            if (chartentity instanceof XYItemEntity) {
                XYItemEntity e = (XYItemEntity) chartentity;
                XYDataset d = e.getDataset();
                int s = e.getSeriesIndex();
                int i = e.getItem();
                double x = d.getXValue(s, i);
                double y = d.getYValue(s, i);
                xCrosshair.setValue(x);
                RefreshInfo(i);
            // Refresh the position on the data grid
            // TableMain.setRowSelectionInterval(i, i);
            // Rectangle rect = TableMain.getCellRect(i, 0, true);
            // TableMain.scrollRectToVisible(rect);
            // Refresh the marker position on the map
            // RefreshCurrentPosMarker(Track.data.get(i).getLatitude(),
            // Track.data.get(i).getLongitude());
            }
        }

        @Override
        public void chartMouseMoved(ChartMouseEvent event) {
        }
    });
    add(ChartPanelTimeDist, java.awt.BorderLayout.CENTER);
}
Also used : BasicStroke(java.awt.BasicStroke) Color(java.awt.Color) ChartPanel(org.jfree.chart.ChartPanel) GridBagLayout(java.awt.GridBagLayout) Crosshair(org.jfree.chart.plot.Crosshair) ChartMouseEvent(org.jfree.chart.ChartMouseEvent) ChartMouseListener(org.jfree.chart.ChartMouseListener) XYItemEntity(org.jfree.chart.entity.XYItemEntity) JLabel(javax.swing.JLabel) CrosshairOverlay(org.jfree.chart.panel.CrosshairOverlay) XYDataset(org.jfree.data.xy.XYDataset) ChartEntity(org.jfree.chart.entity.ChartEntity) JPanel(javax.swing.JPanel)

Example 10 with XYItemEntity

use of org.jfree.chart.entity.XYItemEntity in project Course_Generator by patrovite.

the class JPanelProfil method initComponents.

private void initComponents() {
    setPreferredSize(new java.awt.Dimension(677, 150));
    setLayout(new java.awt.BorderLayout());
    // -- Profil tool bar
    // ---------------------------------------------------
    Create_Profil_Toolbar();
    add(ToolBarProfil, java.awt.BorderLayout.WEST);
    // -- Profil chart
    // ------------------------------------------------------
    ChartPanelProfil = new ChartPanel(chartProfil);
    CrosshairOverlay crosshairOverlay = new CrosshairOverlay();
    xCrosshair = new Crosshair(Double.NaN, Color.RED, new BasicStroke(0f));
    // xCrosshair.setLabelVisible(true);
    xCrosshair.setLabelBackgroundPaint(Color.WHITE);
    yCrosshair = new Crosshair(Double.NaN, Color.RED, new BasicStroke(0f));
    // yCrosshair.setLabelVisible(true);
    yCrosshair.setLabelBackgroundPaint(Color.WHITE);
    crosshairOverlay.addDomainCrosshair(xCrosshair);
    crosshairOverlay.addRangeCrosshair(yCrosshair);
    ChartPanelProfil.addOverlay(crosshairOverlay);
    ChartPanelProfil.setBackground(new java.awt.Color(255, 0, 51));
    ChartPanelProfil.addChartMouseListener(new ChartMouseListener() {

        @Override
        public void chartMouseClicked(ChartMouseEvent event) {
            ChartEntity chartentity = event.getEntity();
            if (chartentity instanceof XYItemEntity) {
                XYItemEntity e = (XYItemEntity) chartentity;
                XYDataset d = e.getDataset();
                int s = e.getSeriesIndex();
                int i = e.getItem();
                double x = d.getXValue(s, i);
                double y = d.getYValue(s, i);
                xCrosshair.setValue(x);
                yCrosshair.setValue(y);
                RefreshProfilInfo(i);
                notifyProfilSelection();
                index = i;
            // //Refresh the position on the data grid
            // TableMain.setRowSelectionInterval(i, i);
            // Rectangle rect = TableMain.getCellRect(i, 0, true);
            // TableMain.scrollRectToVisible(rect);
            // //Refresh the marker position on the map
            // RefreshCurrentPosMarker(Track.data.get(i).getLatitude(), Track.data.get(i).getLongitude());
            }
        }

        @Override
        public void chartMouseMoved(ChartMouseEvent event) {
        }
    });
    add(ChartPanelProfil, java.awt.BorderLayout.CENTER);
    // -- Profil info bar
    // ---------------------------------------------------
    jPanelProfilInfo = new javax.swing.JPanel();
    jPanelProfilInfo.setLayout(new GridBagLayout());
    add(jPanelProfilInfo, java.awt.BorderLayout.SOUTH);
    // -- Line 0
    // -- Distance
    // ----------------------------------------------------------
    lbProfilDistance = new javax.swing.JLabel();
    lbProfilDistance.setOpaque(true);
    lbProfilDistance.setBackground(Color.WHITE);
    lbProfilDistance.setText(" " + bundle.getString("frmMain.lbProfilDistance.text") + "=0.000km ");
    lbProfilDistance.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelProfilInfo, lbProfilDistance, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.EAST, GridBagConstraints.BOTH);
    // -- Time
    // --------------------------------------------------------------
    lbProfilTime = new javax.swing.JLabel();
    lbProfilTime.setOpaque(true);
    lbProfilTime.setBackground(Color.WHITE);
    lbProfilTime.setText(" " + bundle.getString("frmMain.lbProfilTime.text") + "=00:00:00 ");
    lbProfilTime.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelProfilInfo, lbProfilTime, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.EAST, GridBagConstraints.BOTH);
    // -- Slope
    // -------------------------------------------------------------
    lbProfilSlope = new javax.swing.JLabel();
    lbProfilSlope.setOpaque(true);
    lbProfilSlope.setBackground(Color.WHITE);
    lbProfilSlope.setText(" " + bundle.getString("frmMain.lbProfilSlope.text") + "=0.0% ");
    lbProfilSlope.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelProfilInfo, lbProfilSlope, 2, 0, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.EAST, GridBagConstraints.BOTH);
    // -- Name
    // --------------------------------------------------------------
    lbProfilName = new javax.swing.JLabel();
    lbProfilName.setOpaque(true);
    lbProfilName.setBackground(Color.WHITE);
    lbProfilName.setText(" " + bundle.getString("frmMain.lbProfilName.text") + "= ");
    lbProfilName.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelProfilInfo, lbProfilName, 3, 0, 1, 1, 1, 0, 0, 0, 0, 0, GridBagConstraints.EAST, GridBagConstraints.BOTH);
    // -- Line 1
    // -- Elevation
    // ---------------------------------------------------------
    lbProfilElevation = new javax.swing.JLabel();
    lbProfilElevation.setOpaque(true);
    lbProfilElevation.setBackground(Color.WHITE);
    lbProfilElevation.setText(" " + bundle.getString("frmMain.lbProfilElevation.text") + "=0m ");
    lbProfilElevation.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelProfilInfo, lbProfilElevation, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.EAST, GridBagConstraints.BOTH);
    // -- Hour
    // --------------------------------------------------------------
    lbProfilHour = new javax.swing.JLabel();
    lbProfilHour.setOpaque(true);
    lbProfilHour.setBackground(Color.WHITE);
    lbProfilHour.setText(" " + bundle.getString("frmMain.lbProfilHour.text") + "=00:00:00 ");
    lbProfilHour.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelProfilInfo, lbProfilHour, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.EAST, GridBagConstraints.BOTH);
    // -- Speed
    // -------------------------------------------------------------
    lbProfilSpeed = new javax.swing.JLabel();
    lbProfilSpeed.setOpaque(true);
    lbProfilSpeed.setBackground(Color.WHITE);
    lbProfilSpeed.setText(" " + bundle.getString("frmMain.lbProfilSpeed.text") + "=0.0km/h ");
    lbProfilSpeed.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelProfilInfo, lbProfilSpeed, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.EAST, GridBagConstraints.BOTH);
    // -- Comment
    // -----------------------------------------------------------
    lbProfilComment = new javax.swing.JLabel();
    lbProfilComment.setOpaque(true);
    lbProfilComment.setBackground(Color.WHITE);
    lbProfilComment.setText(" " + bundle.getString("frmMain.lbProfilComment.text") + "= ");
    lbProfilComment.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    Utils.addComponent(jPanelProfilInfo, lbProfilComment, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, GridBagConstraints.EAST, GridBagConstraints.BOTH);
// -- Distance / Time / Slope / Name
// -- Elevation / Hour / Speed / Comment
}
Also used : BasicStroke(java.awt.BasicStroke) Color(java.awt.Color) ChartPanel(org.jfree.chart.ChartPanel) GridBagLayout(java.awt.GridBagLayout) Crosshair(org.jfree.chart.plot.Crosshair) ChartMouseEvent(org.jfree.chart.ChartMouseEvent) ChartMouseListener(org.jfree.chart.ChartMouseListener) XYItemEntity(org.jfree.chart.entity.XYItemEntity) JLabel(javax.swing.JLabel) CrosshairOverlay(org.jfree.chart.panel.CrosshairOverlay) XYDataset(org.jfree.data.xy.XYDataset) ChartEntity(org.jfree.chart.entity.ChartEntity) JPanel(javax.swing.JPanel)

Aggregations

XYItemEntity (org.jfree.chart.entity.XYItemEntity)18 ChartEntity (org.jfree.chart.entity.ChartEntity)12 ChartMouseEvent (org.jfree.chart.ChartMouseEvent)6 ChartMouseListener (org.jfree.chart.ChartMouseListener)6 XYToolTipGenerator (org.jfree.chart.labels.XYToolTipGenerator)6 BasicStroke (java.awt.BasicStroke)5 Color (java.awt.Color)5 GridBagLayout (java.awt.GridBagLayout)5 JLabel (javax.swing.JLabel)5 ChartPanel (org.jfree.chart.ChartPanel)5 CrosshairOverlay (org.jfree.chart.panel.CrosshairOverlay)5 Crosshair (org.jfree.chart.plot.Crosshair)5 XYDataset (org.jfree.data.xy.XYDataset)5 Shape (java.awt.Shape)4 JPanel (javax.swing.JPanel)4 EntityCollection (org.jfree.chart.entity.EntityCollection)4 PlotOrientation (org.jfree.chart.plot.PlotOrientation)4 Paint (java.awt.Paint)3 Stroke (java.awt.Stroke)3 Ellipse2D (java.awt.geom.Ellipse2D)3