/*
* GraphOptions.java
*
* Created on 10 November 2005, 00:14
*
* AsItHappens - real-time network monitor
* Copyright (C) 2006 Mark Abrahams
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
package nz.co.abrahams.asithappens.cartgraph;
import nz.co.abrahams.asithappens.core.DAOFactory;
import nz.co.abrahams.asithappens.core.DBException;
import nz.co.abrahams.asithappens.*;
import nz.co.abrahams.asithappens.uiutil.ErrorHandler;
import nz.co.abrahams.asithappens.uiutil.ColorCellRenderer;
import nz.co.abrahams.asithappens.uiutil.SetDisplaysTableModel;
import nz.co.abrahams.asithappens.uiutil.ColorCellEditor;
import nz.co.abrahams.asithappens.uiutil.SetDisplay;
import javax.swing.*;
import javax.swing.table.*;
/**
* Dialog that contains graph property options that can be adjusted by the user.
* The options presented in the dialog correspond to properties of the
* TimeSeriesContext instance used for the graph.
* <p>
* The dialog is modal on the parent graph.
*
* @author mark
*/
public class TimeSeriesOptionsDialog extends javax.swing.JDialog {
/** Sets display table columns */
/** The graph for which options are changed */
protected DataGraph graph;
/** The underlying context for the graph */
protected TimeSeriesContext context;
/** Sets display table */
protected JTable setDisplaysTable;
/** Creates new TimeSeriesOptionsDialog */
public TimeSeriesOptionsDialog(DataGraph graph, TimeSeriesContext context) {
super(graph, true);
this.graph = graph;
this.context = context;
initComponents();
initializeTable();
setTitle("Options for " + context.getData().getTitle());
fixGraphTopField.setEditable(true);
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
horizontalDensityButtonGroup = new javax.swing.ButtonGroup();
horizontalOverlayButtonGroup = new javax.swing.ButtonGroup();
verticalDensityButtonGroup = new javax.swing.ButtonGroup();
verticalOverlayButtonGroup = new javax.swing.ButtonGroup();
aggregationButtonGroup = new javax.swing.ButtonGroup();
markingsButtonGroup = new javax.swing.ButtonGroup();
graphTopButtonGroup = new javax.swing.ButtonGroup();
interpolationButtonGroup = new javax.swing.ButtonGroup();
positioningGroup = new javax.swing.ButtonGroup();
titleLabel = new javax.swing.JLabel();
titleField = new javax.swing.JTextField();
descriptionLabel = new javax.swing.JLabel();
descriptionFieldLabel = new javax.swing.JLabel();
stickyCheckBox = new javax.swing.JCheckBox();
showTrimCheckBox = new javax.swing.JCheckBox();
showLabelsCheckBox = new javax.swing.JCheckBox();
storeCheckBox = new javax.swing.JCheckBox();
horizontalCheckBox = new javax.swing.JCheckBox();
horizontalMajorButton = new javax.swing.JRadioButton();
horizontalMinorButton = new javax.swing.JRadioButton();
verticalCheckBox = new javax.swing.JCheckBox();
verticalMajorButton = new javax.swing.JRadioButton();
verticalMinorButton = new javax.swing.JRadioButton();
gridLinesLabel = new javax.swing.JLabel();
inFrontButton = new javax.swing.JRadioButton();
behindButton = new javax.swing.JRadioButton();
positioningLabel = new javax.swing.JLabel();
positioningGroundedButton = new javax.swing.JRadioButton();
positioningStackedButton = new javax.swing.JRadioButton();
aggregationLabel = new javax.swing.JLabel();
averageAggregationButton = new javax.swing.JRadioButton();
maximumAggregationButton = new javax.swing.JRadioButton();
interpolationLabel = new javax.swing.JLabel();
noneInterpolationButton = new javax.swing.JRadioButton();
flatInterpolationButton = new javax.swing.JRadioButton();
slopingInterpolationButton = new javax.swing.JRadioButton();
timeMarkingsLabel = new javax.swing.JLabel();
absoluteMarkingsButton = new javax.swing.JRadioButton();
relativeMarkingsButton = new javax.swing.JRadioButton();
graphTopLabel = new javax.swing.JLabel();
autoGraphTopButton = new javax.swing.JRadioButton();
fixGraphTopButton = new javax.swing.JRadioButton();
fixGraphTopField = new javax.swing.JTextField();
fixGraphUnitsComboBox = new javax.swing.JComboBox(TimeSeriesContext.VALUE_UNITS);
okButton = new javax.swing.JButton();
applyButton = new javax.swing.JButton();
cancelButton = new javax.swing.JButton();
setDisplayLabel = new javax.swing.JLabel();
setDisplayPane = new javax.swing.JScrollPane();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
formWindowClosing(evt);
}
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
}
});
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
titleLabel.setText("Title");
getContentPane().add(titleLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, -1, -1));
getContentPane().add(titleField, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 10, 310, -1));
getContentPane().add(descriptionLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 30, -1, -1));
getContentPane().add(descriptionFieldLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 30, -1, -1));
stickyCheckBox.setText("Sticky window");
getContentPane().add(stickyCheckBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 60, -1, -1));
showTrimCheckBox.setText("Show trim");
getContentPane().add(showTrimCheckBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 80, -1, -1));
showLabelsCheckBox.setText("Show labels");
getContentPane().add(showLabelsCheckBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 80, -1, -1));
storeCheckBox.setText("Stored session");
getContentPane().add(storeCheckBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 60, -1, -1));
horizontalCheckBox.setText("Horizontal grid lines");
horizontalCheckBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
horizontalCheckBoxActionPerformed(evt);
}
});
getContentPane().add(horizontalCheckBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 120, -1, -1));
horizontalDensityButtonGroup.add(horizontalMajorButton);
horizontalMajorButton.setText("Major marks only");
getContentPane().add(horizontalMajorButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 140, -1, -1));
horizontalDensityButtonGroup.add(horizontalMinorButton);
horizontalMinorButton.setText("Add minor marks");
getContentPane().add(horizontalMinorButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 160, -1, -1));
verticalCheckBox.setText("Vertical grid lines");
verticalCheckBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
verticalCheckBoxActionPerformed(evt);
}
});
getContentPane().add(verticalCheckBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 120, -1, -1));
verticalDensityButtonGroup.add(verticalMajorButton);
verticalMajorButton.setText("Major marks only");
getContentPane().add(verticalMajorButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 140, -1, -1));
verticalDensityButtonGroup.add(verticalMinorButton);
verticalMinorButton.setText("Add minor marks");
getContentPane().add(verticalMinorButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 160, -1, -1));
gridLinesLabel.setText("Grid lines");
getContentPane().add(gridLinesLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 200, -1, -1));
horizontalOverlayButtonGroup.add(inFrontButton);
inFrontButton.setText("In front of data");
getContentPane().add(inFrontButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 220, -1, -1));
horizontalOverlayButtonGroup.add(behindButton);
behindButton.setText("Behind data");
getContentPane().add(behindButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 240, -1, -1));
positioningLabel.setText("Set positioning");
getContentPane().add(positioningLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 200, -1, -1));
positioningGroup.add(positioningGroundedButton);
positioningGroundedButton.setText("Grounded");
positioningGroundedButton.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
getContentPane().add(positioningGroundedButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 220, 80, -1));
positioningGroup.add(positioningStackedButton);
positioningStackedButton.setText("Stacked");
positioningStackedButton.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
getContentPane().add(positioningStackedButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 240, 70, -1));
aggregationLabel.setText("Aggregation");
getContentPane().add(aggregationLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 280, -1, -1));
aggregationButtonGroup.add(averageAggregationButton);
averageAggregationButton.setText("Average");
getContentPane().add(averageAggregationButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 300, -1, -1));
aggregationButtonGroup.add(maximumAggregationButton);
maximumAggregationButton.setText("Maximum");
getContentPane().add(maximumAggregationButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 320, -1, -1));
interpolationLabel.setText("Interpolation");
getContentPane().add(interpolationLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 280, -1, -1));
interpolationButtonGroup.add(noneInterpolationButton);
noneInterpolationButton.setText("None");
getContentPane().add(noneInterpolationButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 300, -1, -1));
interpolationButtonGroup.add(flatInterpolationButton);
flatInterpolationButton.setText("Flat");
getContentPane().add(flatInterpolationButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 320, -1, -1));
interpolationButtonGroup.add(slopingInterpolationButton);
slopingInterpolationButton.setText("Sloping");
getContentPane().add(slopingInterpolationButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 340, -1, -1));
timeMarkingsLabel.setText("Time markings");
getContentPane().add(timeMarkingsLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 380, -1, -1));
markingsButtonGroup.add(absoluteMarkingsButton);
absoluteMarkingsButton.setText("Absolute");
getContentPane().add(absoluteMarkingsButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 400, -1, -1));
markingsButtonGroup.add(relativeMarkingsButton);
relativeMarkingsButton.setText("Relative");
getContentPane().add(relativeMarkingsButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 420, -1, -1));
graphTopLabel.setText("Graph top");
getContentPane().add(graphTopLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 380, -1, -1));
graphTopButtonGroup.add(autoGraphTopButton);
autoGraphTopButton.setText("Automatically scale");
autoGraphTopButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
autoGraphTopButtonActionPerformed(evt);
}
});
getContentPane().add(autoGraphTopButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 400, -1, -1));
graphTopButtonGroup.add(fixGraphTopButton);
fixGraphTopButton.setText("Fix to");
fixGraphTopButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
fixGraphTopButtonActionPerformed(evt);
}
});
getContentPane().add(fixGraphTopButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 420, -1, -1));
getContentPane().add(fixGraphTopField, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 420, 60, 20));
getContentPane().add(fixGraphUnitsComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 420, 40, 20));
okButton.setText("OK");
okButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
okButtonActionPerformed(evt);
}
});
getContentPane().add(okButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 460, 80, -1));
applyButton.setText("Apply");
applyButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
applyButtonActionPerformed(evt);
}
});
getContentPane().add(applyButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 460, 80, -1));
cancelButton.setText("Cancel");
cancelButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cancelButtonActionPerformed(evt);
}
});
getContentPane().add(cancelButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 460, 80, -1));
setDisplayLabel.setText("Set display");
getContentPane().add(setDisplayLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 40, -1, -1));
getContentPane().add(setDisplayPane, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 70, 330, 370));
pack();
}// </editor-fold>//GEN-END:initComponents
/**
* Enables/disables other vertical grid line components on selection/deselection
* of the main vertical checkbox.
*
* @param evt checkbox action event
*/
private void verticalCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_verticalCheckBoxActionPerformed
if ( verticalCheckBox.isSelected() ) {
verticalMinorButton.setEnabled(true);
verticalMajorButton.setEnabled(true);
} else {
verticalMinorButton.setEnabled(false);
verticalMajorButton.setEnabled(false);
}
}//GEN-LAST:event_verticalCheckBoxActionPerformed
/**
* Enables/disables other horizontal grid line components on selection/deselection
* of the main horizoncal checkbox.
*
* @param evt checkbox action event
*/
private void horizontalCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_horizontalCheckBoxActionPerformed
if ( horizontalCheckBox.isSelected() ) {
horizontalMinorButton.setEnabled(true);
horizontalMajorButton.setEnabled(true);
} else {
horizontalMinorButton.setEnabled(false);
horizontalMajorButton.setEnabled(false);
}
}//GEN-LAST:event_horizontalCheckBoxActionPerformed
/**
* Disables "fix to" field when automatic graph top is selected.
*
* @param evt checkbox action event
*/
private void autoGraphTopButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_autoGraphTopButtonActionPerformed
fixGraphTopField.setEnabled(false);
fixGraphUnitsComboBox.setEnabled(false);
}//GEN-LAST:event_autoGraphTopButtonActionPerformed
/**
* Enables "fix to" field when corresponding radio button is selected.
*/
private void fixGraphTopButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fixGraphTopButtonActionPerformed
fixGraphTopField.setEnabled(true);
fixGraphUnitsComboBox.setEnabled(true);
}//GEN-LAST:event_fixGraphTopButtonActionPerformed
/** Loads options when dialog is opened. */
private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
loadOptions();
}//GEN-LAST:event_formWindowOpened
/** Disposes dialog without changes to context when "cancel" is selected. */
private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
dispose();
}//GEN-LAST:event_cancelButtonActionPerformed
/** Saves option set to context and redraws graph when "apply" is selected. */
private void applyButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_applyButtonActionPerformed
saveOptions();
graph.summarizeRescaleRepaint();
}//GEN-LAST:event_applyButtonActionPerformed
/** Saves option set to context, redraws graph and disposes of window
* when "OK" is selected. */
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
saveOptions();
graph.summarizeRescaleRepaint();
dispose();
}//GEN-LAST:event_okButtonActionPerformed
/** Disposes of window when closed through windowing system. */
private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
dispose();
}//GEN-LAST:event_formWindowClosing
/** Loads options from graph context to GUI components. */
protected void loadOptions() {
descriptionFieldLabel.setText(context.getData().getShortDescription());
titleField.setText(context.getData().getTitle());
stickyCheckBox.setSelected(context.getStickyWindow());
showLabelsCheckBox.setSelected(context.getShowLabels());
showTrimCheckBox.setSelected(context.getShowTrim());
storeCheckBox.setSelected(context.getData().isStoring());
storeCheckBox.setEnabled(false);
horizontalCheckBox.setSelected(context.horizontalGridLines());
if ( context.horizontalMinorLines() )
horizontalMinorButton.setSelected(true);
else
horizontalMajorButton.setSelected(true);
if ( ! context.horizontalGridLines() ) {
horizontalMinorButton.setEnabled(false);
horizontalMajorButton.setEnabled(false);
}
verticalCheckBox.setSelected(context.verticalGridLines());
if ( context.verticalMinorLines() )
verticalMinorButton.setSelected(true);
else
verticalMajorButton.setSelected(true);
if ( ! context.verticalGridLines() ) {
verticalMinorButton.setEnabled(false);
verticalMajorButton.setEnabled(false);
}
if ( context.linesInFront() )
inFrontButton.setSelected(true);
else
behindButton.setSelected(true);
switch ( context.getSetsPositioning() ) {
case Grounded:
positioningGroundedButton.setSelected(true);
break;
case Stacked:
positioningStackedButton.setSelected(true);
break;
}
switch ( context.getAggregation() ) {
case Average:
averageAggregationButton.setSelected(true);
break;
case Maximum:
maximumAggregationButton.setSelected(true);
}
switch ( context.getInterpolation() ) {
case None:
noneInterpolationButton.setSelected(true);
break;
case Flat:
flatInterpolationButton.setSelected(true);
break;
case Sloping:
slopingInterpolationButton.setSelected(true);
}
if ( context.getXAxisAbsoluteTimes() )
absoluteMarkingsButton.setSelected(true);
else
relativeMarkingsButton.setSelected(true);
if ( context.getFixedGraphTop() == 0 ) {
autoGraphTopButton.setSelected(true);
fixGraphTopField.setEnabled(false);
fixGraphUnitsComboBox.setEnabled(false);
} else {
fixGraphTopButton.setSelected(true);
fixGraphTopField.setText(Double.toString(context.getFixedGraphTop()));
fixGraphUnitsComboBox.setSelectedItem(context.getFixedGraphTopUnits());
}
}
/** Saves options from GUI components to graph context. */
protected void saveOptions() {
DataGraphDAO graphDAO;
try {
context.setStickyWindow(stickyCheckBox.isSelected());
context.setShowLabels(showLabelsCheckBox.isSelected());
context.setShowTrim(showTrimCheckBox.isSelected());
graph.setAlwaysOnTop(context.getStickyWindow());
//context.setStoring(storeCheckBox.isSelected());
context.setHorizontalGridLines(horizontalCheckBox.isSelected());
context.setHorizontalMinorLines(horizontalMinorButton.isSelected());
context.setLinesInFront(inFrontButton.isSelected());
context.setVerticalGridLines(verticalCheckBox.isSelected());
context.setVerticalMinorLines(verticalMinorButton.isSelected());
if ( positioningGroundedButton.isSelected() )
context.setSetsPositioning(SetDisplay.Positioning.Grounded);
else if ( positioningStackedButton.isSelected() )
context.setSetsPositioning(SetDisplay.Positioning.Stacked);
if ( averageAggregationButton.isSelected() )
context.setAggregation(TimeSeriesContext.Aggregation.Average);
else if ( maximumAggregationButton.isSelected() )
context.setAggregation(TimeSeriesContext.Aggregation.Maximum);
if ( noneInterpolationButton.isSelected() )
context.setInterpolation(TimeSeriesContext.Interpolation.None);
else if ( flatInterpolationButton.isSelected() )
context.setInterpolation(TimeSeriesContext.Interpolation.Flat);
else if ( slopingInterpolationButton.isSelected() )
context.setInterpolation(TimeSeriesContext.Interpolation.Sloping);
context.setXAxisAbsoluteTimes(absoluteMarkingsButton.isSelected());
if ( autoGraphTopButton.isSelected() ) {
context.setUseFixedGraphTop(false);
context.setFixedGraphTop(0);
} else {
//context.setFixedGraphTop(TimeSeriesContext.findUnitValue(Double.valueOf(fixGraphTopField.getText()), ((Character)fixGraphUnitsComboBox.getSelectedItem()).charValue()));
context.setUseFixedGraphTop(true);
context.setFixedGraphTop(Double.valueOf(fixGraphTopField.getText()));
context.setFixedGraphTopUnits(((Character)fixGraphUnitsComboBox.getSelectedItem()).charValue());
}
context.getData().setTitle(titleField.getText());
((SetDisplaysTableModel)(setDisplaysTable.getModel())).saveDataToContext();
//graph.store();
if ( graph.getContext().getData().isCollecting() && graph.getContext().getData().isStoring() ) {
graphDAO = DAOFactory.getDataGraphDAO();
graphDAO.updateGraph(graph);
graphDAO.closeConnection();
}
} catch (DBException e) {
ErrorHandler.modalError(this, "Check database connectivity", "Cannot update title in database", e);
} catch (NumberFormatException e) {
ErrorHandler.modalError(this, "Ensure number format is correct", "Cannot interpret number format");
} finally {
graph.setTitle(context.getData().getTitle());
setTitle("Options for " + context.getData().getTitle());
}
}
public void initializeTable() {
JComboBox setDisplayCombo;
setDisplaysTable = new JTable(new SetDisplaysTableModel(context));
setDisplaysTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
setDisplayPane.setViewportView(setDisplaysTable);
setDisplayCombo = new JComboBox();
for ( SetDisplay.Style type : SetDisplay.Style.values() )
setDisplayCombo.addItem(type.toString());
setDisplaysTable.getColumnModel().getColumn(SetDisplaysTableModel.Columns.Style.ordinal()).setCellEditor(new DefaultCellEditor(setDisplayCombo));
setDisplaysTable.getColumnModel().getColumn(SetDisplaysTableModel.Columns.Style.ordinal()).setCellRenderer(new DefaultTableCellRenderer() {
public void setValue(Object value) {
setText( (value == null) ? "" : ((SetDisplay.Style)value).toString() );
}
});
setDisplaysTable.getColumnModel().getColumn(SetDisplaysTableModel.Columns.Color.ordinal()).setCellEditor(new ColorCellEditor());
setDisplaysTable.getColumnModel().getColumn(SetDisplaysTableModel.Columns.Color.ordinal()).setCellRenderer(new ColorCellRenderer());
setDisplaysTable.getColumnModel().getColumn(SetDisplaysTableModel.Columns.Label.ordinal()).setPreferredWidth(150);
setDisplaysTable.getColumnModel().getColumn(SetDisplaysTableModel.Columns.Style.ordinal()).setPreferredWidth(60);
setDisplaysTable.getColumnModel().getColumn(SetDisplaysTableModel.Columns.Color.ordinal()).setPreferredWidth(60);
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JRadioButton absoluteMarkingsButton;
private javax.swing.ButtonGroup aggregationButtonGroup;
private javax.swing.JLabel aggregationLabel;
private javax.swing.JButton applyButton;
private javax.swing.JRadioButton autoGraphTopButton;
private javax.swing.JRadioButton averageAggregationButton;
private javax.swing.JRadioButton behindButton;
private javax.swing.JButton cancelButton;
private javax.swing.JLabel descriptionFieldLabel;
private javax.swing.JLabel descriptionLabel;
private javax.swing.JRadioButton fixGraphTopButton;
private javax.swing.JTextField fixGraphTopField;
private javax.swing.JComboBox fixGraphUnitsComboBox;
private javax.swing.JRadioButton flatInterpolationButton;
private javax.swing.ButtonGroup graphTopButtonGroup;
private javax.swing.JLabel graphTopLabel;
private javax.swing.JLabel gridLinesLabel;
private javax.swing.JCheckBox horizontalCheckBox;
private javax.swing.ButtonGroup horizontalDensityButtonGroup;
private javax.swing.JRadioButton horizontalMajorButton;
private javax.swing.JRadioButton horizontalMinorButton;
private javax.swing.ButtonGroup horizontalOverlayButtonGroup;
private javax.swing.JRadioButton inFrontButton;
private javax.swing.ButtonGroup interpolationButtonGroup;
private javax.swing.JLabel interpolationLabel;
private javax.swing.ButtonGroup markingsButtonGroup;
private javax.swing.JRadioButton maximumAggregationButton;
private javax.swing.JRadioButton noneInterpolationButton;
private javax.swing.JButton okButton;
private javax.swing.JRadioButton positioningGroundedButton;
private javax.swing.ButtonGroup positioningGroup;
private javax.swing.JLabel positioningLabel;
private javax.swing.JRadioButton positioningStackedButton;
private javax.swing.JRadioButton relativeMarkingsButton;
private javax.swing.JLabel setDisplayLabel;
private javax.swing.JScrollPane setDisplayPane;
private javax.swing.JCheckBox showLabelsCheckBox;
private javax.swing.JCheckBox showTrimCheckBox;
private javax.swing.JRadioButton slopingInterpolationButton;
private javax.swing.JCheckBox stickyCheckBox;
private javax.swing.JCheckBox storeCheckBox;
private javax.swing.JLabel timeMarkingsLabel;
private javax.swing.JTextField titleField;
private javax.swing.JLabel titleLabel;
private javax.swing.JCheckBox verticalCheckBox;
private javax.swing.ButtonGroup verticalDensityButtonGroup;
private javax.swing.JRadioButton verticalMajorButton;
private javax.swing.JRadioButton verticalMinorButton;
private javax.swing.ButtonGroup verticalOverlayButtonGroup;
// End of variables declaration//GEN-END:variables
}