Skip to content

Commit

Permalink
Weighted frequency tables
Browse files Browse the repository at this point in the history
Ability to toggle "Difference view" when CKM is used
  • Loading branch information
ppdewolf committed Jul 9, 2018
1 parent d9f3b30 commit 351aa42
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 46 deletions.
9 changes: 5 additions & 4 deletions src/tauargus/gui/DialogSpecifyTablesMicro.form
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@
</Group>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="scrollPaneTables" pref="113" max="32767" attributes="0"/>
<Component id="scrollPaneTables" pref="102" max="32767" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="buttonComputeTables" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonCancel" alignment="3" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="buttonComputeTables" max="32767" attributes="0"/>
<Component id="buttonCancel" max="32767" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
Expand Down
9 changes: 5 additions & 4 deletions src/tauargus/gui/DialogSpecifyTablesMicro.java
Original file line number Diff line number Diff line change
Expand Up @@ -1688,11 +1688,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(panelParameters, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(scrollPaneTables, javax.swing.GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE)
.addComponent(scrollPaneTables, javax.swing.GroupLayout.DEFAULT_SIZE, 102, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(buttonComputeTables)
.addComponent(buttonCancel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(buttonComputeTables, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonCancel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);

panelExplanatoryVariables.getAccessibleContext().setAccessibleName("Explanatory variables");
Expand Down
31 changes: 15 additions & 16 deletions src/tauargus/gui/PanelTable.form
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="scrollPane" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="panelBottomButtons" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
Expand Down Expand Up @@ -136,8 +136,9 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="scrollPane" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="panelBottomButtons" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="7" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="panelCellInformation" min="-2" max="-2" attributes="0"/>
Expand Down Expand Up @@ -805,21 +806,19 @@
<Component id="comboBoxNrOfVertLevels" min="-2" pref="31" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="labelDecimals" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="comboBoxDecimals" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="checkBoxThousandSeparator" alignment="0" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="labelDecimals" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxThousandSeparator" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="comboBoxDecimals" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="checkBoxCKMView" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxColoredView" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxOutputView" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="3" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
Expand All @@ -841,7 +840,7 @@
<Component id="LabelNrOfVertLevels" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="comboBoxNrOfVertLevels" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxThousandSeparator" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxCKMView" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxColoredView" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
Expand Down Expand Up @@ -974,12 +973,12 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkBoxThousandSeparatorActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxCKMView">
<Component class="javax.swing.JCheckBox" name="checkBoxColoredView">
<Properties>
<Property name="text" type="java.lang.String" value="Difference view"/>
<Property name="text" type="java.lang.String" value="Colored view"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkBoxCKMViewActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkBoxColoredViewActionPerformed"/>
</Events>
</Component>
</SubComponents>
Expand Down
44 changes: 22 additions & 22 deletions src/tauargus/gui/PanelTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table
}

setForeground(cell.status.getForegroundColor());
if (!(checkBoxCKMView.isEnabled() && checkBoxCKMView.isSelected())){
if (!(checkBoxColoredView.isEnabled() && checkBoxColoredView.isSelected())){
setBackground(getBackgroundColor(cell, getRowCode(rowIndex)));
}
else{
Expand Down Expand Up @@ -665,8 +665,8 @@ public void updateSuppressButtons() {
}

boolean b = (s == TableSet.SUP_CKM || s == TableSet.SUP_NO);
checkBoxCKMView.setEnabled(b);
if (!b) checkBoxCKMView.setSelected(false);
checkBoxColoredView.setEnabled(b);
if (!b) checkBoxColoredView.setSelected(false);

b = (s == TableSet.SUP_ROUNDING) || (s == TableSet.SUP_CTA) || (s == TableSet.SUP_CKM);
checkBoxOutputView.setEnabled(!b);
Expand Down Expand Up @@ -894,7 +894,7 @@ private void initComponents() {
comboBoxDecimals = new javax.swing.JComboBox();
checkBoxOutputView = new javax.swing.JCheckBox();
checkBoxThousandSeparator = new javax.swing.JCheckBox();
checkBoxCKMView = new javax.swing.JCheckBox();
checkBoxColoredView = new javax.swing.JCheckBox();

table.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
Expand Down Expand Up @@ -1330,10 +1330,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
}
});

checkBoxCKMView.setText("Difference view");
checkBoxCKMView.addActionListener(new java.awt.event.ActionListener() {
checkBoxColoredView.setText("Colored view");
checkBoxColoredView.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
checkBoxCKMViewActionPerformed(evt);
checkBoxColoredViewActionPerformed(evt);
}
});

Expand All @@ -1357,18 +1357,17 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(LabelNrOfVertLevels)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(comboBoxNrOfVertLevels, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(0, 0, Short.MAX_VALUE)
.addGroup(panelBottomButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelBottomButtonsLayout.createSequentialGroup()
.addComponent(labelDecimals)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(comboBoxDecimals, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(panelBottomButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(labelDecimals)
.addComponent(checkBoxThousandSeparator))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(comboBoxDecimals, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(panelBottomButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(checkBoxCKMView)
.addComponent(checkBoxColoredView)
.addComponent(checkBoxOutputView))
.addGap(3, 3, 3))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
panelBottomButtonsLayout.setVerticalGroup(
panelBottomButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
Expand All @@ -1387,7 +1386,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(LabelNrOfVertLevels)
.addComponent(comboBoxNrOfVertLevels, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(checkBoxThousandSeparator)
.addComponent(checkBoxCKMView))
.addComponent(checkBoxColoredView))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);

Expand Down Expand Up @@ -1434,7 +1433,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(scrollPane)
.addGroup(layout.createSequentialGroup()
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(panelBottomButtons, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
.addGap(18, 18, 18)
Expand Down Expand Up @@ -1487,8 +1486,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(scrollPane)
.addGap(18, 18, 18)
.addComponent(panelBottomButtons, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(panelBottomButtons, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(7, 7, 7))
.addGroup(layout.createSequentialGroup()
.addComponent(panelCellInformation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
Expand Down Expand Up @@ -2143,10 +2143,10 @@ private void radioButtonCellKeyActionPerformed(java.awt.event.ActionEvent evt) {
updateSuppressButtons();
}//GEN-LAST:event_radioButtonCellKeyActionPerformed

private void checkBoxCKMViewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkBoxCKMViewActionPerformed
private void checkBoxColoredViewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkBoxColoredViewActionPerformed
((AbstractTableModel)table.getModel()).fireTableDataChanged();
adjustColumnWidths();
}//GEN-LAST:event_checkBoxCKMViewActionPerformed
}//GEN-LAST:event_checkBoxColoredViewActionPerformed

private void organiseSafetyButtons(CellStatus status) {
if (status.isEmpty()) {
Expand Down Expand Up @@ -2218,7 +2218,7 @@ private void organiseSafetyButtons(CellStatus status) {
private javax.swing.JButton buttonTableSummary;
private javax.swing.JButton buttonUndoSuppress;
private javax.swing.JButton buttonUnsafe;
private javax.swing.JCheckBox checkBoxCKMView;
private javax.swing.JCheckBox checkBoxColoredView;
private javax.swing.JCheckBox checkBoxInverseWeight;
private javax.swing.JCheckBox checkBoxOutputView;
private javax.swing.JCheckBox checkBoxThousandSeparator;
Expand Down

0 comments on commit 351aa42

Please sign in to comment.