Skip to content

Commit

Permalink
Merge remote-tracking branch 'master' of 'https://github.com/arx-deid…
Browse files Browse the repository at this point in the history
  • Loading branch information
ramongonze committed Jul 6, 2020
2 parents e65792f + 2808c70 commit c049aee
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 37 deletions.
Binary file modified lib/ant/swttable/swttable-0.0.1.jar
Binary file not shown.
Binary file modified lib/ant/swttiles/swttiles-0.0.1.jar
Binary file not shown.
Binary file modified lib/de/linearbits/swt/swttable/0.0.1/swttable-0.0.1.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a7d2184dbe46824b1ae322486f1b91fd
63e94f1807cc947953211fea02c9667f
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ae9dc157cbd84ca87427768530ca07ba6cd58f1e
e3e14f7cf86d0ce3002b3eaa91e246e6bd89de36
Binary file modified lib/de/linearbits/swt/swttiles/0.0.1/swttiles-0.0.1.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5b7bd2040a10c79a99ff473ab4da2359
db35dca953993a1123b5cf861692deb5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
786dd231ed5692dcc92180efe838f64e3698663f
95cb1059ef69d3159c9cbdd461cf65e22e1a0f87
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.38</version>
<version>8.0.16</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
Expand Down
45 changes: 21 additions & 24 deletions src/gui/org/deidentifier/arx/gui/view/impl/MainToolBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,11 @@ public void update(final ModelEvent event) {
if (model.getSelectedNode() != null) {
toolbar.setRedraw(false);
labelSelected.setText(Resources.getMessage("MainToolBar.3") + //$NON-NLS-1$
Arrays.toString(model.getSelectedNode().getTransformation()));
labelSelected.pack();
Arrays.toString(model.getSelectedNode().getTransformation()));
layout();
toolbar.setRedraw(true);
}
} else if (event.part == ModelPart.OUTPUT) {

if (model.getOutputTransformation() != null) {

// Statistics
Expand All @@ -179,24 +177,15 @@ public void update(final ModelEvent event) {
toolbar.setRedraw(false);
labelTransformations.setText(Resources.getMessage("MainToolBar.6") + //$NON-NLS-1$
SWTUtil.getPrettyString(statistics.getTransformationsAvailable()));
labelTransformations.pack();

labelApplied.setText(Resources.getMessage("MainToolBar.4") + //$NON-NLS-1$
Arrays.toString(model.getOutputTransformation().getTransformation()));
labelApplied.pack();

// Layout
layout();

toolbar.setRedraw(true);

} else {

reset();

}
} else if (event.part == ModelPart.RESULT) {

if (model.getResult() != null) {

// Statistics
Expand All @@ -209,33 +198,22 @@ public void update(final ModelEvent event) {
toolbar.setRedraw(false);
labelTransformations.setText(Resources.getMessage("MainToolBar.6") + //$NON-NLS-1$
SWTUtil.getPrettyString(statistics.getTransformationsAvailable()));
labelTransformations.pack();

labelSelected.setText(Resources.getMessage("MainToolBar.7")); //$NON-NLS-1$
labelSelected.pack();

labelApplied.setText(Resources.getMessage("MainToolBar.8")); //$NON-NLS-1$
labelApplied.pack();

layout();

toolbar.setRedraw(true);
}

} else if (event.part == ModelPart.SELECTED_ATTRIBUTE) {

// Update label
String attribute = (String)event.data;
toolbar.setRedraw(false);
labelAttribute.setText(Resources.getMessage("MainToolBar.50") + trim(attribute)); //$NON-NLS-1$
labelAttribute.pack();
layout();
toolbar.setRedraw(true);

} else if (event.part == ModelPart.MODEL) {

model = (Model) event.data;

}
}

Expand Down Expand Up @@ -298,6 +276,9 @@ public void widgetSelected(final SelectionEvent e) {
}
}

/**
* Creates the required labels
*/
private void createLabels() {

// Add status labels
Expand Down Expand Up @@ -348,12 +329,23 @@ public void controlResized(final ControlEvent arg0) {
}

/**
* Performs layouting.
* Performs a layout update
*/
private void layout() {

// Disable redrawing
toolbar.setRedraw(false);

// Fix rendering issues on MacOS Catalina
// This seems to enforce an otherwise lost redraw
labelAttribute.setText(labelAttribute.getText());
labelTransformations.setText(labelTransformations.getText());
labelApplied.setText(labelApplied.getText());
labelSelected.setText(labelSelected.getText());
labelAttribute.pack();
labelTransformations.pack();
labelApplied.pack();
labelSelected.pack();

// Adjust size of items and composite
Rectangle bounds = toolbar.getBounds();
Expand Down Expand Up @@ -393,6 +385,11 @@ private void layout() {

// Redraw
toolbar.setRedraw(true);
toolbar.redraw();

// Fix rendering issues on MacOS Catalina
// This seems to enforce an otherwise lost redraw
infoComposite.pack(true);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void dispose() {
public void reset() {
this.attributes = null;
this.table.setCurrentPage(0);
this.table.refreshPage();
this.refreshTable();
SWTUtil.disable(this.table);
}

Expand All @@ -159,11 +159,11 @@ public void update(final ModelEvent event) {
} else if (event.part == ModelPart.ATTRIBUTE_TYPE ||
event.part == ModelPart.ATTRIBUTE_TYPE_BULK_UPDATE) {
if (!attributes.isEmpty()) {
table.refreshPage();
this.refreshTable();
}
} else if (event.part == ModelPart.DATA_TYPE) {
if (!attributes.isEmpty()) {
table.refreshPage();
this.refreshTable();
}
}
}
Expand Down Expand Up @@ -243,7 +243,7 @@ private void actionDataTypeChanged(String label) {
// Set and update
if (changed) {
this.model.getInputDefinition().setDataType(attribute, type);
table.refreshPage();
this.refreshTable();
this.controller.update(new ModelEvent(this, ModelPart.DATA_TYPE, attribute));
}
}
Expand Down Expand Up @@ -375,7 +375,7 @@ else if (i == 3 && e.button == 1) {
String attribute = (String)item.getData();
boolean isResponseVariable = !model.getInputDefinition().isResponseVariable(attribute);
model.getInputDefinition().setResponseVariable(attribute, isResponseVariable);
table.refreshPage();
refreshTable();
controller.update(new ModelEvent(this, ModelPart.RESPONSE_VARIABLES, attribute));
return;
}
Expand All @@ -386,7 +386,7 @@ else if (i == 3 && e.button == 1) {
}
});
this.table.setCurrentPage(0);
this.table.refreshPage();
this.refreshTable();
}

/**
Expand Down Expand Up @@ -542,6 +542,14 @@ private boolean isValidDataType(DataType<?> type, Collection<String> values) {
return true;
}

/**
* Refresh the table
*/
private void refreshTable() {
this.table.getViewer().refresh();
this.table.refreshPage();
}

/**
* Updates the view.
*
Expand All @@ -564,10 +572,10 @@ private void updateEntries() {

// Refresh
this.table.setCurrentPage(0);
this.table.refreshPage();
this.refreshTable();
SWTUtil.enable(this.table);
}

/**
* Update
* @param attribute
Expand Down

0 comments on commit c049aee

Please # to comment.