Skip to content

Commit

Permalink
Possible to change ptable in batch and in GUI
Browse files Browse the repository at this point in the history
Updated version number
  • Loading branch information
ppdewolf committed May 27, 2019
1 parent b758978 commit 35016a3
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 7 deletions.
33 changes: 33 additions & 0 deletions _TauChanges.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,36 @@ above is RELEASED IN 4.1.7
--------------------------------------------------------------
date : Mar 6, 2018
summary : No longer check for Cplex licence file in Optimal when not using Cplex

date : Mar 21, 2018
summary : Saving the recode tree has been implemented. Reading back still to come.

date : June 11, 2018
summary : Cell Key method implemented (frequency tables)

date : July 2, 2018
summary : Info screen (table summary) adjusted to display CKM info

date : July 9, 2018
summary : CKM for weighted frequency tables implemented

date : July 20, 2018
summary : Saving CKM protected as csv or codevalue did not work correctly

date : Oct 1, 2018
summary : Added percentage of perturbed files in CKM reporting

date : Apr 16, 2019
summary : Linked tables with set of tables as input: fixed bug in case name of table-file contains name of spanning variable

date : May 8, 2019
summary : Basic Info Loss for CKM added, in dialog and in report.

date : May 22, 2019
summary : Now possible to call CKM from batch file

date : May 27, 2019
summary : Now possible to change ptable in GUI suppress-view

above released up to version 4.1.14_BETA
--------------------------------------------------------------
27 changes: 23 additions & 4 deletions src/tauargus/gui/DialogChangePTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
*/
package tauargus.gui;

import argus.utils.SystemUtils;
import java.io.File;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.filechooser.FileNameExtensionFilter;
import tauargus.model.TableSet;
import tauargus.utils.TauArgusUtils;
Expand All @@ -23,6 +25,7 @@ public class DialogChangePTable extends DialogBase{ //javax.swing.JDialog {
public static final int APPROVE_OPTION = 0;

private int returnValue = CANCEL_OPTION;
private TableSet tmpTableSet;

/**
* Creates new form DialogChangePTable
Expand All @@ -34,7 +37,9 @@ public DialogChangePTable(java.awt.Frame parent, boolean modal) {
}

public int showDialog(TableSet tableSet) {
textFieldPTable.setText(tableSet.cellkeyVar.PTableFile);
tmpTableSet=tableSet;
//textFieldPTable.setText(tableSet.cellkeyVar.PTableFile);
textFieldPTable.setText(tmpTableSet.cellkeyVar.PTableFile);
setVisible(true);
return returnValue;
}
Expand Down Expand Up @@ -124,12 +129,25 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
}// </editor-fold>//GEN-END:initComponents

private void buttonCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCancelActionPerformed
setVisible(false);
returnValue = CANCEL_OPTION;
setVisible(false);
}//GEN-LAST:event_buttonCancelActionPerformed

private void buttonOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonOKActionPerformed
// TODO add your handling code here:
if (textFieldPTable.getText().trim().equals(""))
{
JOptionPane.showMessageDialog(this,"Please specify ptable file.");
return;
}
if (!TauArgusUtils.ExistFile(textFieldPTable.getText()))
{
JOptionPane.showMessageDialog(this,"Ptable file "+textFieldPTable.getText()+" does not exist.");
return;
}
SystemUtils.writeLogbook("Ptable file: "+textFieldPTable.getText()+" will be used when applying CKM.");

returnValue = APPROVE_OPTION;
setVisible(false);
}//GEN-LAST:event_buttonOKActionPerformed

private void buttonPTableActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPTableActionPerformed
Expand All @@ -139,8 +157,9 @@ private void buttonPTableActionPerformed(java.awt.event.ActionEvent evt) {//GEN-
filechooser.resetChoosableFileFilters();
if (filechooser.showOpenDialog(this) == javax.swing.JFileChooser.APPROVE_OPTION) {
String hs = filechooser.getSelectedFile().toString();
textFieldPTable.setText(filechooser.getSelectedFile().toString());
textFieldPTable.setText(hs);
TauArgusUtils.putDataDirInRegistry(hs);
tmpTableSet.cellkeyVar.PTableFile=hs;
}
}//GEN-LAST:event_buttonPTableActionPerformed

Expand Down
8 changes: 6 additions & 2 deletions src/tauargus/gui/PanelTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ public void updateSuppressButtons() {

radioButtonCellKey.setVisible(tableSet.CellKeyAvailable);
buttonChangePTable.setVisible(tableSet.CellKeyAvailable);
buttonChangePTable.setEnabled(radioButtonCellKey.isSelected());
if (tableSet.CellKeyAvailable) labelPTable.setText("ptablefile: "+tableSet.cellkeyVar.PTableFile.substring(tableSet.cellkeyVar.PTableFile.lastIndexOf("\\")+1));
labelPTable.setVisible(tableSet.CellKeyAvailable);

Expand Down Expand Up @@ -671,7 +672,10 @@ public void updateSuppressButtons() {
boolean b = (s == TableSet.SUP_CKM) || (s == TableSet.SUP_NO);
checkBoxColoredView.setEnabled(b);
if (!b) checkBoxColoredView.setSelected(false);
if (s == TableSet.SUP_CKM) checkBoxColoredView.setSelected(true);
if (s == TableSet.SUP_CKM) {
checkBoxColoredView.setSelected(true);
buttonChangePTable.setEnabled(false);
}

b = (s == TableSet.SUP_ROUNDING) || (s == TableSet.SUP_CTA) || (s == TableSet.SUP_CKM);
checkBoxOutputView.setEnabled(!b);
Expand Down Expand Up @@ -2176,7 +2180,7 @@ private void radioButtonHyperCubeComponentAdded(java.awt.event.ContainerEvent ev

private void buttonChangePTableActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonChangePTableActionPerformed
DialogChangePTable dialog = new DialogChangePTable(null, true);
dialog.showDialog(tableSet);
if (dialog.showDialog(tableSet)==DialogChangePTable.APPROVE_OPTION) labelPTable.setText("ptablefile: "+tableSet.cellkeyVar.PTableFile.substring(tableSet.cellkeyVar.PTableFile.lastIndexOf("\\")+1));
}//GEN-LAST:event_buttonChangePTableActionPerformed

private void organiseSafetyButtons(CellStatus status) {
Expand Down
2 changes: 1 addition & 1 deletion src/tauargus/model/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class Application {
// Version info
public static final int MAJOR = 4;
public static final int MINOR = 1;
public static final String REVISION = "13_BETA";
public static final String REVISION = "14_BETA";
public static final int BUILD = 1;

// Error codes returned by functions in TauArgusJava dll
Expand Down

0 comments on commit 35016a3

Please sign in to comment.