Example usage for javax.swing.border TitledBorder TitledBorder

List of usage examples for javax.swing.border TitledBorder TitledBorder

Introduction

In this page you can find the example usage for javax.swing.border TitledBorder TitledBorder.

Prototype

public TitledBorder(Border border) 

Source Link

Document

Creates a TitledBorder instance with the specified border and an empty title.

Usage

From source file:CombineApp.java

public CombineApp() {
    super("TBandCombineOp");
    Container container = getContentPane();

    displayPanel = new CombinePanel();
    container.add(displayPanel);// www .  java 2  s.  com

    JPanel panel = new JPanel();
    panel.setLayout(new GridLayout(3, 2));
    panel.setBorder(new TitledBorder("Click a Button to Perform the Associated Operation and Reset..."));

    redBandButton = new JButton("Show Red Band");
    redBandButton.addActionListener(new ButtonListener());
    greenBandButton = new JButton("Show Green Band");
    greenBandButton.addActionListener(new ButtonListener());
    blueBandButton = new JButton("Show Blue Band");
    blueBandButton.addActionListener(new ButtonListener());
    inverseBandButton = new JButton("Invert All Bands");
    inverseBandButton.addActionListener(new ButtonListener());
    middleBandButton = new JButton("Average Each Band");
    middleBandButton.addActionListener(new ButtonListener());

    resetButton = new JButton("Reset");
    resetButton.addActionListener(new ButtonListener());

    panel.add(redBandButton);
    panel.add(blueBandButton);
    panel.add(greenBandButton);
    panel.add(inverseBandButton);
    panel.add(middleBandButton);
    panel.add(resetButton);

    container.add(BorderLayout.SOUTH, panel);

    addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);
        }
    });

    setSize(displayPanel.getWidth(), displayPanel.getHeight());
    setVisible(true);
}

From source file:ColorApp.java

public ColorApp() {
    super();/*w w  w  .  j  a  v  a  2s  .  c  o m*/
    Container container = getContentPane();

    displayPanel = new DisplayPanel();
    container.add(displayPanel);

    JPanel panel = new JPanel();
    panel.setLayout(new GridLayout(3, 2));
    panel.setBorder(new TitledBorder("Click a Button to Perform the Associated Operation and Reset..."));

    brightenButton = new JButton("Brightness >>");
    brightenButton.addActionListener(new ButtonListener());
    darkenButton = new JButton("Darkness >>");
    darkenButton.addActionListener(new ButtonListener());
    contrastIncButton = new JButton("Contrast >>");
    contrastIncButton.addActionListener(new ButtonListener());
    contrastDecButton = new JButton("Contrast <<");
    contrastDecButton.addActionListener(new ButtonListener());
    reverseButton = new JButton("Negative");
    reverseButton.addActionListener(new ButtonListener());
    resetButton = new JButton("Reset");
    resetButton.addActionListener(new ButtonListener());

    panel.add(brightenButton);
    panel.add(darkenButton);
    panel.add(contrastIncButton);
    panel.add(contrastDecButton);
    panel.add(reverseButton);
    panel.add(resetButton);

    container.add(BorderLayout.SOUTH, panel);

    addWindowListener(new WindowEventHandler());
    setSize(displayPanel.getWidth(), displayPanel.getHeight() + 25);
    show();
}

From source file:Main.java

/**
 * Creates a labeled panel containing a slider and considering
 * a particular width/*from   w  w w  .j ava2s.  co m*/
 * 
 * @param slider
 * @param label
 * @return a panel for the slider
 */
public static JPanel createSliderPanel(final JSlider slider, String label, int width) {
    final JPanel p = new JPanel();
    p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
    p.setBorder(new TitledBorder(label));
    p.setPreferredSize(new Dimension(width, 60));
    p.add(slider);
    return p;
}

From source file:com.emental.mindraider.ui.panels.ConceptAttachmentsJPanel.java

public void init() {
    JPanel pp;// w  w w  .java  2s. c om
    setBorder(new TitledBorder(Messages.getString("ConceptJPanel.attachments")));
    setLayout(new BorderLayout());

    // button
    pp = new JPanel();
    pp.setLayout(new GridLayout(3, 1));
    JButton jbutton = new JButton("", IconsRegistry.getImageIcon("attach.png"));
    jbutton.setToolTipText(Messages.getString("ConceptJPanel.attachLocalResourceToConcept"));
    jbutton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            // some concept must be selected - select graph node according
            // to the selected concept =-> touchgraph
            // method needed
            if (conceptJPanel.getConceptResource() == null) {
                JOptionPane.showMessageDialog(MindRaider.mainJFrame,
                        Messages.getString("ConceptJPanel.attachResourceWarning"),
                        Messages.getString("ConceptJPanel.attachmentError"), JOptionPane.ERROR_MESSAGE);
                return;
            }
            new AttachmentJDialog(conceptJPanel.getConceptResource());
        }
    });
    pp.add(jbutton);
    // @todo edit resource description
    // jbutton=new JButton("",IconsRegistry.getImageIcon("attachLink.png"));
    // jbutton.setToolTipText("Attach web resource to concept");
    // jbutton.addActionListener(new ActionListener() {
    // public void actionPerformed(ActionEvent e) {
    // }
    // });
    // pp.add(jbutton);
    // attach another concept/folder/resource... - perhaps extra frame with
    // radio
    jbutton = new JButton("", IconsRegistry.getImageIcon("launch.png"));
    jbutton.setToolTipText(Messages.getString("ConceptJPanel.showAttachment"));
    jbutton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if (attachmentsTableModel.attachments != null) {
                if (attachments.getSelectedRow() == -1) {
                    JOptionPane.showMessageDialog(MindRaider.mainJFrame,
                            Messages.getString("ConceptJPanel.selectAttachmentToLaunch"),
                            Messages.getString("ConceptJPanel.attachmentError"), JOptionPane.ERROR_MESSAGE);
                    return;
                }
                String uri = attachmentsTableModel.attachments[attachments.getSelectedRow()].getUrl();
                if (uri != null) {
                    Node node = new Node();
                    node.setLabel(uri);
                    node.setURL(uri);
                    node.setType(
                            MindRaider.spidersColorProfileRegistry.getCurrentProfile().getLiteralNodeType());
                    MindRaider.spidersGraph.handleDoubleSelect(node);
                }
            }
        }
    });
    pp.add(jbutton);
    jbutton = new JButton("", IconsRegistry.getImageIcon("explorerDiscardSmall.png"));
    jbutton.setToolTipText(Messages.getString("ConceptJPanel.removeAttachment"));
    pp.add(jbutton);
    jbutton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if (attachmentsTableModel.attachments != null) {
                if (getAttachments().getSelectedRow() != -1) {
                    logger.debug(Messages.getString("ConceptJPanel.removingAttachment",
                            getAttachments().getSelectedRow()));
                    String attachUrl = getAttachmentsTableModel().attachments[getAttachments().getSelectedRow()]
                            .getUrl();
                    logger.debug(Messages.getString("ConceptJPanel.removingAttachmentUrl", attachUrl));
                    if (conceptJPanel.getConceptResource() != null) {
                        // check, that selected node is type of literal
                        // (helper on spiders graph)
                        MindRaider.noteCustodian.removeAttachment(
                                MindRaider.profile.getActiveOutlineUri().toString(),
                                conceptJPanel.getConceptResource(), attachUrl);
                        conceptJPanel.refresh();
                        MindRaider.spidersGraph.renderModel();
                        return;
                    }
                }
                JOptionPane.showMessageDialog(MindRaider.mainJFrame,
                        Messages.getString("ConceptJPanel.selectAttachmentToRemove"),
                        Messages.getString("ConceptJPanel.attachmentError"), JOptionPane.ERROR_MESSAGE);
            }
        }
    });
    add(pp, BorderLayout.EAST);

    // table
    attachmentsTableModel = new AttachmentsTableModel();
    attachments = new JTable(attachmentsTableModel) {

        private static final long serialVersionUID = 1L;

        public String getToolTipText(MouseEvent e) {
            String tip = null;
            java.awt.Point p = e.getPoint();
            int rowIndex = rowAtPoint(p);

            AttachmentsTableModel model = (AttachmentsTableModel) getModel();
            tip = Messages.getString("ConceptJPanel.attachmentUrl") + model.attachments[rowIndex].getUrl();
            // You can omit this part if you know you don't
            // have any renderers that supply their own tool
            // tips.
            // tip = super.getToolTipText(e);
            return tip;
        }
    };
    TableColumn column = attachments.getColumnModel().getColumn(0);
    column.setMaxWidth(50);
    attachments.setRowHeight(20);
    attachments.setAutoscrolls(true);
    attachments.setPreferredScrollableViewportSize(new Dimension(500, 70));
    JScrollPane scrollPane = new JScrollPane(attachments);
    add(scrollPane, BorderLayout.CENTER);
}

From source file:lu.lippmann.cdb.ext.hydviga.ui.SimilarCasesFrame.java

/**
 * Constructor./*from   w  ww  .  j  a  v a 2  s  . c o m*/
 */
SimilarCasesFrame(final Instances ds, final int dateIdx, final StationsDataProvider gcp, String attrname,
        final int gapsize, final int position, final double x, final double y, final int year,
        final String season, final boolean isDuringRising) throws Exception {
    LogoHelper.setLogo(this);
    this.setTitle("KnowledgeDB: Suggested configurations / similar cases");

    this.inputCaseTablePanel = new JXPanel();
    this.inputCaseTablePanel.setBorder(new TitledBorder("Present case"));
    this.inputCaseChartPanel = new JXPanel();
    this.inputCaseChartPanel.setBorder(new TitledBorder("Profile of the present case"));
    this.outputCasesTablePanel = new JXPanel();
    this.outputCasesTablePanel.setBorder(new TitledBorder("Suggested cases"));
    this.outputCasesChartPanel = new JXPanel();
    this.outputCasesChartPanel.setBorder(new TitledBorder("Profile of the selected suggested case"));

    getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.PAGE_AXIS));
    getContentPane().add(inputCaseTablePanel);
    getContentPane().add(inputCaseChartPanel);
    getContentPane().add(outputCasesTablePanel);
    getContentPane().add(outputCasesChartPanel);

    final Instances res = GapFillingKnowledgeDB.findSimilarCases(attrname, x, y, year, season, gapsize,
            position, isDuringRising, gcp.findDownstreamStation(attrname) != null,
            gcp.findUpstreamStation(attrname) != null,
            GapsUtil.measureHighMiddleLowInterval(ds, ds.attribute(attrname).index(), position - 1));

    final Instances inputCase = new Instances(res);
    while (inputCase.numInstances() > 1)
        inputCase.remove(1);
    final JXTable inputCaseTable = buidJXTable(inputCase);
    final JScrollPane inputScrollPane = new JScrollPane(inputCaseTable);
    //System.out.println(inputScrollPane.getPreferredSize());
    inputScrollPane.setPreferredSize(
            new Dimension(COMPONENT_WIDTH, (int) (50 + inputScrollPane.getPreferredSize().getHeight())));
    this.inputCaseTablePanel.add(inputScrollPane);

    final ChartPanel inputcp = GapsUIUtil.buildGapChartPanel(ds, dateIdx, ds.attribute(attrname), gapsize,
            position);
    inputcp.getChart().removeLegend();
    inputcp.setPreferredSize(CHART_DIMENSION);
    this.inputCaseChartPanel.add(inputcp);

    final Instances outputCases = new Instances(res);
    outputCases.remove(0);
    final JXTable outputCasesTable = buidJXTable(outputCases);
    final JScrollPane outputScrollPane = new JScrollPane(outputCasesTable);
    outputScrollPane.setPreferredSize(
            new Dimension(COMPONENT_WIDTH, (int) (50 + outputScrollPane.getPreferredSize().getHeight())));
    this.outputCasesTablePanel.add(outputScrollPane);

    outputCasesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    outputCasesTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        @Override
        public void valueChanged(ListSelectionEvent e) {
            if (!e.getValueIsAdjusting()) {
                final int modelRow = outputCasesTable.getSelectedRow();

                final String attrname = outputCasesTable.getModel().getValueAt(modelRow, 1).toString();
                final int gapsize = (int) Double
                        .valueOf(outputCasesTable.getModel().getValueAt(modelRow, 4).toString()).doubleValue();
                final int position = (int) Double
                        .valueOf(outputCasesTable.getModel().getValueAt(modelRow, 5).toString()).doubleValue();

                try {
                    final ChartPanel cp = GapsUIUtil.buildGapChartPanel(ds, dateIdx, ds.attribute(attrname),
                            gapsize, position);
                    cp.getChart().removeLegend();
                    cp.setPreferredSize(CHART_DIMENSION);
                    outputCasesChartPanel.removeAll();
                    outputCasesChartPanel.add(cp);
                    getContentPane().repaint();
                    pack();
                } catch (Exception e1) {
                    e1.printStackTrace();
                }
            }
        }
    });

    outputCasesTable.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseReleased(final MouseEvent e) {
            final InstanceTableModel instanceTableModel = (InstanceTableModel) outputCasesTable.getModel();
            final int row = outputCasesTable.rowAtPoint(e.getPoint());
            final int modelRow = outputCasesTable.convertRowIndexToModel(row);

            final String attrname = instanceTableModel.getValueAt(modelRow, 1).toString();
            final int gapsize = (int) Double.valueOf(instanceTableModel.getValueAt(modelRow, 4).toString())
                    .doubleValue();
            final int position = (int) Double.valueOf(instanceTableModel.getValueAt(modelRow, 5).toString())
                    .doubleValue();

            if (e.isPopupTrigger()) {
                final JPopupMenu jPopupMenu = new JPopupMenu("feur");

                final JMenuItem mi = new JMenuItem("Use this configuration");
                mi.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(final ActionEvent e) {
                        System.out.println("not implemented!");
                    }
                });
                jPopupMenu.add(mi);
                jPopupMenu.show(outputCasesTable, e.getX(), e.getY());
            } else {
                // nothing?
            }
        }
    });

    setPreferredSize(new Dimension(FRAME_WIDTH, 900));

    pack();
    setVisible(true);

    /* select the first row */
    outputCasesTable.setRowSelectionInterval(0, 0);
}

From source file:brainflow.core.ImageBrowser.java

private void initSourceView() {
    sourceView = new JList();
    final DefaultListModel model = new DefaultListModel();
    for (IImageSource source : sourceList.sourceList) {
        model.addElement(source);/*from ww  w  . java  2  s . c o  m*/
    }

    sourceView.setModel(model);
    sourceView.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    ButtonPanel panel = new ButtonPanel(SwingConstants.CENTER);

    JButton nextButton = new JButton("Next");
    ImageIcon icon = new ImageIcon(getClass().getClassLoader().getResource("icons/control_play_blue.png"));
    nextButton.setIcon(icon);

    JButton prevButton = new JButton("Previous");
    icon = new ImageIcon(getClass().getClassLoader().getResource("icons/control_rev_blue.png"));
    prevButton.setIcon(icon);
    panel.addButton(prevButton);
    panel.addButton(nextButton);
    panel.setSizeConstraint(ButtonPanel.SAME_SIZE);

    JPanel container = new JPanel(new BorderLayout());
    container.setBorder(new TitledBorder("Image List"));
    container.add(new JScrollPane(sourceView), BorderLayout.CENTER);
    container.add(panel, BorderLayout.SOUTH);
    add(container, BorderLayout.WEST);

    nextButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            int index = sourceView.getSelectedIndex();
            if (index == (sourceList.size() - 1)) {
                index = 0;
            } else {
                index++;
            }

            updateView(index);

        }
    });

    sourceView.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        @Override
        public void valueChanged(ListSelectionEvent e) {
            int index = sourceView.getSelectedIndex();
            if (currentModel.getSelectedLayer().getDataSource() != sourceView.getSelectedValue()) {
                System.out.println("updating view");
                updateView(index);
            } else {
                System.out.println("not updating view ");
            }

        }
    });
}

From source file:lu.lippmann.cdb.datasetview.tabs.WeightedMapOfDecisionTreesTabView.java

/**
 * Constructor./*from w w w  .jav  a 2s . c  o m*/
 */
public WeightedMapOfDecisionTreesTabView(final EventPublisher eventPublisher,
        final CommandDispatcher commandDispatcher, final ApplicationContext applicationContext) {
    super();

    this.applicationContext = applicationContext;
    this.commandDispatcher = commandDispatcher;
    this.eventPublisher = eventPublisher;

    final double defaultValueConfidenceFactor = DecisionTreeHelper.HIGH_CONFIDENCE_FACTOR;
    this.dtFactory = new J48DecisionTreeFactory(defaultValueConfidenceFactor, false);
    this.panel = new JXPanel();
    this.panel.setLayout(new BorderLayout());

    this.slider = new JSlider();
    this.slider.setBorder(new TitledBorder("Confidence factor"));
    this.slider.setOpaque(false);
    this.slider.setMaximum((int) (defaultValueConfidenceFactor * 100));
    this.slider.setValue((int) (defaultValueConfidenceFactor * 100));
    this.slider.setMinimum(1);
    this.slider.setMinorTickSpacing(1);
    this.slider.setMajorTickSpacing(10);
    this.slider.setPaintTicks(true);
    this.slider.setPaintLabels(true);
    this.panel.add(this.slider, BorderLayout.SOUTH);

    this.attrSelectionCombo = new JComboBox();
    this.attrSelectionCombo.setBorder(new TitledBorder("Attribute used to split"));

    final JXPanel cmdPanel = new JXPanel();
    cmdPanel.setLayout(new BorderLayout());
    cmdPanel.add(this.attrSelectionCombo, BorderLayout.CENTER);
    this.withWeightCheckBox = new JCheckBox("Weighted");
    this.withWeightCheckBox.setBorder(new TitledBorder("With weight"));
    cmdPanel.add(this.withWeightCheckBox, BorderLayout.EAST);
    this.panel.add(cmdPanel, BorderLayout.NORTH);
}

From source file:org.jfree.chart.demo.selection.SelectionDemo6Pie.java

public SelectionDemo6Pie(String title) {
    super(title);
    JPanel chartPanel = createDemoPanel();
    chartPanel.setPreferredSize(new java.awt.Dimension(700, 500));

    JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    split.add(chartPanel);/*www .  j  ava2 s .  co  m*/

    this.model = new DefaultTableModel(new String[] { "section", "value:" }, 0);
    this.table = new JTable(this.model);
    TableColumnModel tcm = this.table.getColumnModel();
    JPanel p = new JPanel(new BorderLayout());
    JScrollPane scroller = new JScrollPane(this.table);
    p.add(scroller);
    p.setBorder(BorderFactory.createCompoundBorder(new TitledBorder("Selected Items: "),
            new EmptyBorder(4, 4, 4, 4)));
    split.add(p);
    setContentPane(split);
}

From source file:lu.lippmann.cdb.lab.mds.MDSViewBuilder.java

/**
 * //from w  w w.j  a  v  a2s.  co m
 */
public static JXPanel buildMDSViewFromDataSet(final Instances instances, final MDSResult mdsResult,
        final int maxInstances, final Listener<Instances> listener, final String... attrNameToUseAsPointTitle)
        throws Exception {

    final XYSeriesCollection dataset = new XYSeriesCollection();

    final JFreeChart chart = ChartFactory.createScatterPlot("", // title 
            "X", "Y", // axis labels 
            dataset, // dataset 
            PlotOrientation.VERTICAL, attrNameToUseAsPointTitle.length == 0, // legend? 
            true, // tooltips? yes 
            false // URLs? no 
    );

    final XYPlot xyPlot = (XYPlot) chart.getPlot();

    xyPlot.setBackgroundPaint(Color.WHITE);
    xyPlot.getDomainAxis().setTickLabelsVisible(false);
    xyPlot.getRangeAxis().setTickLabelsVisible(false);

    //FIXME : should be different for Shih
    if (!mdsResult.isNormalized()) {
        String stress = FormatterUtil.DECIMAL_FORMAT
                .format(ClassicMDS.getKruskalStressFromMDSResult(mdsResult));
        chart.setTitle(mdsResult.getCInstances().isCollapsed()
                ? "Collapsed MDS(Instances=" + maxInstances + ",Stress=" + stress + ")"
                : "MDS(Stress=" + stress + ")");
    } else {
        chart.setTitle(mdsResult.getCInstances().isCollapsed() ? "Collapsed MDS(Instances=" + maxInstances + ")"
                : "MDS");
    }

    final SimpleMatrix coordinates = mdsResult.getCoordinates();
    buildFilteredSeries(mdsResult, xyPlot, attrNameToUseAsPointTitle);

    final ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setMouseWheelEnabled(true);
    chartPanel.setPreferredSize(new Dimension(1200, 900));
    chartPanel.setBorder(new TitledBorder("MDS Projection"));
    chartPanel.setBackground(Color.WHITE);

    final JButton selectionButton = new JButton("Select data");
    selectionButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            final org.jfree.data.Range XDomainRange = xyPlot.getDomainAxis().getRange();
            final org.jfree.data.Range YDomainRange = xyPlot.getRangeAxis().getRange();
            final Instances cInstances = mdsResult.getCollapsedInstances();
            final Instances selectedInstances = new Instances(cInstances, 0);
            List<Instances> clusters = null;
            if (mdsResult.getCInstances().isCollapsed()) {
                clusters = mdsResult.getCInstances().getCentroidMap().getClusters();
            }
            for (int i = 0; i < cInstances.numInstances(); i++) {
                final Instance centroid = instances.instance(i);
                if (XDomainRange.contains(coordinates.get(i, 0))
                        && YDomainRange.contains(coordinates.get(i, 1))) {
                    if (mdsResult.getCInstances().isCollapsed()) {
                        if (clusters != null) {
                            final Instances elementsOfCluster = clusters.get(i);
                            final int nbElements = elementsOfCluster.numInstances();
                            for (int k = 0; k < nbElements; k++) {
                                selectedInstances.add(elementsOfCluster.get(k));
                            }
                        }
                    } else {
                        selectedInstances.add(centroid);
                    }
                }
            }
            if (listener != null) {
                listener.onAction(selectedInstances);
            }
        }
    });

    final JXPanel allPanel = new JXPanel();
    allPanel.setLayout(new BorderLayout());
    allPanel.add(chartPanel, BorderLayout.CENTER);
    final JXPanel southPanel = new JXPanel();
    southPanel.add(selectionButton);
    allPanel.add(southPanel, BorderLayout.SOUTH);
    return allPanel;
}

From source file:lu.lippmann.cdb.common.gui.ts.TimeSeriesChartUtil.java

public static ChartPanel buildChartPanelForNominalAttribute(final Instances ds, final Attribute attr,
        final int dateIdx) {
    final TaskSeriesCollection localTaskSeriesCollection = new TaskSeriesCollection();
    final java.util.List<String> names = new ArrayList<String>();

    final Set<String> present = WekaDataStatsUtil.getPresentValuesForNominalAttribute(ds, attr.index());
    for (final String pr : present) {
        names.add(pr);//from w  w w. ja va2s .c  om
        localTaskSeriesCollection.add(new TaskSeries(pr));
    }

    final Calendar cal = Calendar.getInstance();
    try {
        for (final double[] dd : WekaTimeSeriesUtil.split(ds, attr.index())) {
            cal.setTimeInMillis((long) dd[0]);
            final Date start = cal.getTime();
            cal.setTimeInMillis((long) dd[1]);
            final Date end = cal.getTime();
            final String sd = ds.instance((int) dd[2]).stringValue(attr);
            localTaskSeriesCollection.getSeries(sd).add(new Task("T", start, end));
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

    final XYTaskDataset localXYTaskDataset = new XYTaskDataset(localTaskSeriesCollection);
    localXYTaskDataset.setTransposed(true);
    localXYTaskDataset.setSeriesWidth(0.6D);

    final DateAxis localDateAxis = new DateAxis(DATE_TIME_LABEL);
    final SymbolAxis localSymbolAxis = new SymbolAxis("", names.toArray(new String[names.size()]));
    localSymbolAxis.setGridBandsVisible(false);
    final XYBarRenderer localXYBarRenderer = new XYBarRenderer();
    localXYBarRenderer.setUseYInterval(true);
    localXYBarRenderer.setShadowVisible(false);
    final XYPlot localXYPlot = new XYPlot(localXYTaskDataset, localDateAxis, localSymbolAxis,
            localXYBarRenderer);

    final CombinedDomainXYPlot localCombinedDomainXYPlot = new CombinedDomainXYPlot(
            new DateAxis(DATE_TIME_LABEL));
    localCombinedDomainXYPlot.add(localXYPlot);
    final JFreeChart localJFreeChart = new JFreeChart("", localCombinedDomainXYPlot);
    localJFreeChart.setBackgroundPaint(Color.white);

    final ChartPanel cp = new ChartPanel(localJFreeChart, true);
    cp.setBorder(new TitledBorder(attr.name()));
    return cp;
}