diff --git a/src/enginuity/Settings.java b/src/enginuity/Settings.java index 86be3662..fd7796d1 100644 --- a/src/enginuity/Settings.java +++ b/src/enginuity/Settings.java @@ -33,7 +33,7 @@ public class Settings implements Serializable { private Color increaseBorder = new Color(255, 0, 0); private Color decreaseBorder = new Color(0, 0, 255); private Color axisColor = new Color(255, 255, 255); - private boolean singleTableView = false; + private int tableClickCount = 2; // number of clicks to open table public Settings() { //center window by default @@ -157,14 +157,6 @@ public class Settings implements Serializable { this.minColor = minColor; } - public boolean isSingleTableView() { - return singleTableView; - } - - public void setSingleTableView(boolean singleTableView) { - this.singleTableView = singleTableView; - } - public Color getHighlightColor() { return highlightColor; } @@ -214,4 +206,12 @@ public class Settings implements Serializable { if (userLevel > 5) userLevel = 5; else if (userLevel < 1) userLevel = 1; } + + public int getTableClickCount() { + return tableClickCount; + } + + public void setTableClickCount(int tableClickCount) { + this.tableClickCount = tableClickCount; + } } \ No newline at end of file diff --git a/src/enginuity/swing/RomTree.java b/src/enginuity/swing/RomTree.java index 577ad612..c0bdf315 100644 --- a/src/enginuity/swing/RomTree.java +++ b/src/enginuity/swing/RomTree.java @@ -25,7 +25,7 @@ public class RomTree extends JTree implements MouseListener { } public void mouseClicked(MouseEvent e) { - if (e.getClickCount() == 2) { + if (e.getClickCount() == container.getSettings().getTableClickCount()) { try { TableTreeNode node = (TableTreeNode)this.getLastSelectedPathComponent(); container.displayTable(node.getFrame()); diff --git a/src/enginuity/swing/SettingsForm.form b/src/enginuity/swing/SettingsForm.form index 7629a1ac..1ecb6c10 100644 --- a/src/enginuity/swing/SettingsForm.form +++ b/src/enginuity/swing/SettingsForm.form @@ -7,6 +7,9 @@ + + + @@ -23,109 +26,16 @@ - + - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -133,6 +43,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -148,70 +79,20 @@ - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -236,106 +117,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -394,71 +175,332 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/enginuity/swing/SettingsForm.java b/src/enginuity/swing/SettingsForm.java index e116afbd..a3bba49f 100644 --- a/src/enginuity/swing/SettingsForm.java +++ b/src/enginuity/swing/SettingsForm.java @@ -36,6 +36,7 @@ public class SettingsForm extends JFrame implements MouseListener { btnEcuDefinitionBrowse.addMouseListener(this); btnChooseFont.addMouseListener(this); reset.addMouseListener(this); + } private void initSettings() { @@ -44,7 +45,6 @@ public class SettingsForm extends JFrame implements MouseListener { obsoleteWarning.setSelected(settings.isObsoleteWarning()); calcConflictWarning.setSelected(settings.isCalcConflictWarning()); - singleTableView.setSelected(settings.isSingleTableView()); debug.setSelected(settings.isDebug()); maxColor.setBackground(settings.getMaxColor()); @@ -59,6 +59,12 @@ public class SettingsForm extends JFrame implements MouseListener { btnChooseFont.setFont(settings.getTableFont()); btnChooseFont.setText(settings.getTableFont().getFontName()); + + if (settings.getTableClickCount() == 1) { // single click opens table + tableClickCount.setSelectedIndex(0); + } else { // double click opens table + tableClickCount.setSelectedIndex(1); + } } // //GEN-BEGIN:initComponents @@ -66,77 +72,45 @@ public class SettingsForm extends JFrame implements MouseListener { lblEcuDef = new javax.swing.JLabel(); ecuDefinitionFile = new javax.swing.JTextField(); btnEcuDefinitionBrowse = new javax.swing.JButton(); - lblMax = new javax.swing.JLabel(); - lblMin = new javax.swing.JLabel(); - lblHighlight = new javax.swing.JLabel(); - lblAxis = new javax.swing.JLabel(); - maxColor = new javax.swing.JLabel(); - minColor = new javax.swing.JLabel(); - highlightColor = new javax.swing.JLabel(); - axisColor = new javax.swing.JLabel(); - lblIncrease = new javax.swing.JLabel(); - lblDecrease = new javax.swing.JLabel(); - lblBackgrounds = new javax.swing.JLabel(); - increaseColor = new javax.swing.JLabel(); obsoleteWarning = new javax.swing.JCheckBox(); calcConflictWarning = new javax.swing.JCheckBox(); debug = new javax.swing.JCheckBox(); btnCancel = new javax.swing.JButton(); btnOk = new javax.swing.JButton(); btnApply = new javax.swing.JButton(); + reset = new javax.swing.JButton(); + jPanel1 = new javax.swing.JPanel(); + jPanel2 = new javax.swing.JPanel(); + lblAxis = new javax.swing.JLabel(); + lblHighlight = new javax.swing.JLabel(); + lblMin = new javax.swing.JLabel(); + lblMax = new javax.swing.JLabel(); + maxColor = new javax.swing.JLabel(); + minColor = new javax.swing.JLabel(); + highlightColor = new javax.swing.JLabel(); + axisColor = new javax.swing.JLabel(); + jPanel3 = new javax.swing.JPanel(); + lblIncrease = new javax.swing.JLabel(); + increaseColor = new javax.swing.JLabel(); decreaseColor = new javax.swing.JLabel(); - lblBorders = new javax.swing.JLabel(); - lblCellSize = new javax.swing.JLabel(); + lblDecrease = new javax.swing.JLabel(); lblCellHeight = new javax.swing.JLabel(); - lblCellWidth = new javax.swing.JLabel(); - cellWidth = new javax.swing.JTextField(); cellHeight = new javax.swing.JTextField(); - singleTableView = new javax.swing.JCheckBox(); + cellWidth = new javax.swing.JTextField(); + lblCellWidth = new javax.swing.JLabel(); lblFont = new javax.swing.JLabel(); btnChooseFont = new javax.swing.JButton(); - reset = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + tableClickCount = new javax.swing.JComboBox(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Enginuity Settings"); setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); + setFont(new java.awt.Font("Tahoma", 0, 11)); lblEcuDef.setText("ECU Definition File:"); btnEcuDefinitionBrowse.setText("Browse"); - lblMax.setText("Maximum Value:"); - - lblMin.setText("Minimum Value:"); - - lblHighlight.setText("Highlighted Cell:"); - - lblAxis.setText("Axis Cell:"); - - maxColor.setBackground(new java.awt.Color(255, 0, 0)); - maxColor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - maxColor.setOpaque(true); - - minColor.setBackground(new java.awt.Color(255, 0, 0)); - minColor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - minColor.setOpaque(true); - - highlightColor.setBackground(new java.awt.Color(255, 0, 0)); - highlightColor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - highlightColor.setOpaque(true); - - axisColor.setBackground(new java.awt.Color(255, 0, 0)); - axisColor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - axisColor.setOpaque(true); - - lblIncrease.setText("Increased Value:"); - - lblDecrease.setText("Decreased Value:"); - - lblBackgrounds.setText("Backgrounds"); - - increaseColor.setBackground(new java.awt.Color(255, 0, 0)); - increaseColor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - increaseColor.setOpaque(true); - obsoleteWarning.setText("Warn me when opening out of date ECU image revision"); obsoleteWarning.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); obsoleteWarning.setMargin(new java.awt.Insets(0, 0, 0, 0)); @@ -159,28 +133,169 @@ public class SettingsForm extends JFrame implements MouseListener { btnApply.setMnemonic('A'); btnApply.setText("Apply"); + reset.setText("Restore Defaults"); + + jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Data Cells")); + jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Background")); + lblAxis.setText("Axis Cell:"); + + lblHighlight.setText("Highlighted Cell:"); + + lblMin.setText("Minimum Value:"); + + lblMax.setText("Maximum Value:"); + + maxColor.setBackground(new java.awt.Color(255, 0, 0)); + maxColor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + maxColor.setOpaque(true); + + minColor.setBackground(new java.awt.Color(255, 0, 0)); + minColor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + minColor.setOpaque(true); + + highlightColor.setBackground(new java.awt.Color(255, 0, 0)); + highlightColor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + highlightColor.setOpaque(true); + + axisColor.setBackground(new java.awt.Color(255, 0, 0)); + axisColor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + axisColor.setOpaque(true); + + org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2Layout.createSequentialGroup() + .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) + .add(lblAxis) + .add(lblHighlight) + .add(lblMin)) + .add(lblMax)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(org.jdesktop.layout.GroupLayout.TRAILING, maxColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(org.jdesktop.layout.GroupLayout.TRAILING, minColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(org.jdesktop.layout.GroupLayout.TRAILING, highlightColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(org.jdesktop.layout.GroupLayout.TRAILING, axisColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addContainerGap()) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel2Layout.createSequentialGroup() + .add(maxColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(minColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(highlightColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(axisColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(jPanel2Layout.createSequentialGroup() + .add(lblMax) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(lblMin) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(lblHighlight) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(lblAxis)) + ); + + jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Border")); + lblIncrease.setText("Increased Value:"); + + increaseColor.setBackground(new java.awt.Color(255, 0, 0)); + increaseColor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + increaseColor.setOpaque(true); + decreaseColor.setBackground(new java.awt.Color(255, 0, 0)); decreaseColor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); decreaseColor.setOpaque(true); - lblBorders.setText("Borders"); + lblDecrease.setText("Decreased Value:"); - lblCellSize.setText("Cell Size"); + org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel3Layout.createSequentialGroup() + .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(lblDecrease) + .add(jPanel3Layout.createSequentialGroup() + .add(3, 3, 3) + .add(lblIncrease))) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(increaseColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(decreaseColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) + ); + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel3Layout.createSequentialGroup() + .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(increaseColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(lblIncrease)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(lblDecrease) + .add(decreaseColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(42, Short.MAX_VALUE)) + ); lblCellHeight.setText("Height:"); lblCellWidth.setText("Width:"); - singleTableView.setText("Open tables in place of existing tables"); - singleTableView.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); - singleTableView.setEnabled(false); - singleTableView.setMargin(new java.awt.Insets(0, 0, 0, 0)); - - lblFont.setText("Font"); + lblFont.setText("Font:"); btnChooseFont.setText("Choose"); - reset.setText("Restore Defaults"); + org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup() + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE) + .add(jPanel1Layout.createSequentialGroup() + .add(lblCellHeight) + .add(10, 10, 10) + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(btnChooseFont, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 107, Short.MAX_VALUE) + .add(jPanel1Layout.createSequentialGroup() + .add(cellHeight, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 57, Short.MAX_VALUE))))) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel1Layout.createSequentialGroup() + .add(lblCellWidth) + .add(10, 10, 10) + .add(cellWidth, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) + .add(jPanel1Layout.createSequentialGroup() + .add(lblFont) + .addContainerGap()) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel1Layout.createSequentialGroup() + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(lblCellHeight) + .add(cellHeight, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(lblCellWidth) + .add(cellWidth, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(lblFont) + .add(btnChooseFont, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) + ); + + jLabel1.setText("click to open tables"); + + tableClickCount.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Single", "Double" })); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); @@ -190,77 +305,11 @@ public class SettingsForm extends JFrame implements MouseListener { .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(10, 10, 10) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(lblEcuDef) - .add(layout.createSequentialGroup() - .add(ecuDefinitionFile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 257, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(btnEcuDefinitionBrowse)))) - .add(layout.createSequentialGroup() - .addContainerGap() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(calcConflictWarning) - .add(obsoleteWarning) - .add(singleTableView) - .add(debug))) - .add(layout.createSequentialGroup() - .addContainerGap() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(layout.createSequentialGroup() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(layout.createSequentialGroup() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) - .add(lblAxis) - .add(lblHighlight) - .add(lblMin)) - .add(lblMax)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(org.jdesktop.layout.GroupLayout.TRAILING, maxColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(org.jdesktop.layout.GroupLayout.TRAILING, minColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(org.jdesktop.layout.GroupLayout.TRAILING, highlightColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(org.jdesktop.layout.GroupLayout.TRAILING, axisColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) - .add(layout.createSequentialGroup() - .add(53, 53, 53) - .add(lblCellSize))) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(layout.createSequentialGroup() - .add(57, 57, 57) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(layout.createSequentialGroup() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(lblDecrease) - .add(layout.createSequentialGroup() - .add(3, 3, 3) - .add(lblIncrease))) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(increaseColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(decreaseColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) - .add(layout.createSequentialGroup() - .add(47, 47, 47) - .add(lblBorders)) - .add(btnChooseFont, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE))) - .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(lblFont) - .add(65, 65, 65)))) - .add(layout.createSequentialGroup() - .add(47, 47, 47) - .add(lblBackgrounds)))) - .add(layout.createSequentialGroup() - .add(20, 20, 20) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) - .add(lblCellWidth) - .add(lblCellHeight)) + .add(ecuDefinitionFile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 257, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) - .add(layout.createSequentialGroup() - .add(10, 10, 10) - .add(cellWidth, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .add(cellHeight, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) - .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() + .add(btnEcuDefinitionBrowse) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)) + .add(layout.createSequentialGroup() .addContainerGap() .add(reset) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 34, Short.MAX_VALUE) @@ -268,7 +317,23 @@ public class SettingsForm extends JFrame implements MouseListener { .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(btnOk) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(btnCancel))) + .add(btnCancel)) + .add(layout.createSequentialGroup() + .addContainerGap() + .add(jPanel1, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .add(layout.createSequentialGroup() + .addContainerGap() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(calcConflictWarning) + .add(obsoleteWarning) + .add(debug) + .add(layout.createSequentialGroup() + .add(tableClickCount, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jLabel1)))) + .add(layout.createSequentialGroup() + .addContainerGap() + .add(lblEcuDef))) .addContainerGap()) ); layout.setVerticalGroup( @@ -280,58 +345,19 @@ public class SettingsForm extends JFrame implements MouseListener { .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(btnEcuDefinitionBrowse) .add(ecuDefinitionFile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .add(27, 27, 27) + .add(28, 28, 28) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(jLabel1) + .add(tableClickCount, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(obsoleteWarning) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(calcConflictWarning) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(singleTableView) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(debug) - .add(31, 31, 31) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(layout.createSequentialGroup() - .add(lblBorders) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(increaseColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(lblIncrease)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(lblDecrease) - .add(decreaseColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) - .add(layout.createSequentialGroup() - .add(lblBackgrounds) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(lblMax) - .add(maxColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(lblMin) - .add(minColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(lblHighlight) - .add(highlightColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(lblAxis) - .add(axisColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) - .add(29, 29, 29) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(lblCellSize) - .add(lblFont)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(lblCellWidth) - .add(cellWidth, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(btnChooseFont, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 29, Short.MAX_VALUE)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(lblCellHeight) - .add(cellHeight, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 8, Short.MAX_VALUE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 30, Short.MAX_VALUE) + .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(34, 34, 34) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(btnCancel) .add(btnOk) @@ -437,7 +463,6 @@ public class SettingsForm extends JFrame implements MouseListener { settings.setObsoleteWarning(obsoleteWarning.isSelected()); settings.setCalcConflictWarning(calcConflictWarning.isSelected()); - settings.setSingleTableView(singleTableView.isSelected()); settings.setDebug(debug.isSelected()); settings.setMaxColor(maxColor.getBackground()); @@ -452,6 +477,12 @@ public class SettingsForm extends JFrame implements MouseListener { settings.setTableFont(btnChooseFont.getFont()); + if (tableClickCount.getSelectedIndex() == 0) { // single click opens table + settings.setTableClickCount(1); + } else { // double click opens table + settings.setTableClickCount(2); + } + parent.setSettings(settings); } @@ -475,11 +506,12 @@ public class SettingsForm extends JFrame implements MouseListener { private javax.swing.JTextField ecuDefinitionFile; private javax.swing.JLabel highlightColor; private javax.swing.JLabel increaseColor; + private javax.swing.JLabel jLabel1; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; private javax.swing.JLabel lblAxis; - private javax.swing.JLabel lblBackgrounds; - private javax.swing.JLabel lblBorders; private javax.swing.JLabel lblCellHeight; - private javax.swing.JLabel lblCellSize; private javax.swing.JLabel lblCellWidth; private javax.swing.JLabel lblDecrease; private javax.swing.JLabel lblEcuDef; @@ -492,7 +524,7 @@ public class SettingsForm extends JFrame implements MouseListener { private javax.swing.JLabel minColor; private javax.swing.JCheckBox obsoleteWarning; private javax.swing.JButton reset; - private javax.swing.JCheckBox singleTableView; + private javax.swing.JComboBox tableClickCount; // End of variables declaration//GEN-END:variables } \ No newline at end of file diff --git a/src/enginuity/xml/DOMSettingsBuilder.java b/src/enginuity/xml/DOMSettingsBuilder.java index eb3f1c58..472ef664 100644 --- a/src/enginuity/xml/DOMSettingsBuilder.java +++ b/src/enginuity/xml/DOMSettingsBuilder.java @@ -119,6 +119,11 @@ public class DOMSettingsBuilder { userLevel.setAttribute("value", settings.getUserLevel()+""); options.appendChild(userLevel); + // table click count + IIOMetadataNode tableClickCount = new IIOMetadataNode("tableclickcount"); + tableClickCount.setAttribute("value", settings.getTableClickCount()+""); + options.appendChild(tableClickCount); + return options; } @@ -179,11 +184,6 @@ public class DOMSettingsBuilder { tableDisplay.appendChild(colors); - // single table view - IIOMetadataNode singleTable = new IIOMetadataNode("singletableview"); - singleTable.setAttribute("value", settings.isSingleTableView()+""); - tableDisplay.appendChild(singleTable); - return tableDisplay; } } \ No newline at end of file diff --git a/src/enginuity/xml/DOMSettingsUnmarshaller.java b/src/enginuity/xml/DOMSettingsUnmarshaller.java index bfac021b..140ddc8b 100644 --- a/src/enginuity/xml/DOMSettingsUnmarshaller.java +++ b/src/enginuity/xml/DOMSettingsUnmarshaller.java @@ -117,6 +117,10 @@ public class DOMSettingsUnmarshaller { } else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("userlevel")) { settings.setUserLevel(unmarshallAttribute(n, "value", 4)); + + } else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("tableclickcount")) { + settings.setTableClickCount(unmarshallAttribute(n, "value", 2)); + } } return settings; @@ -140,11 +144,7 @@ public class DOMSettingsUnmarshaller { } else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("colors")) { settings = unmarshallColors(n, settings); - - } else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("singletableview")) { - settings.setDebug(unmarshallAttribute(n, "value", true)); - - } + } } return settings; }