Commit e1c22584 authored by Christoph Döbber's avatar Christoph Döbber
Browse files

fixed repaint bug

refs 844
parent 522cb19f
......@@ -55,8 +55,6 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.ComponentArchitecture;
import org.fortiss.af3.deployment.model.ComponentAllocation;
......@@ -151,15 +149,6 @@ public class DeploymentEditorBackend extends DeploymentGEFEditorBase {
parent.setLayout(new FillLayout());
gui = new DeploymentEditorGUI(parent, SWT.NONE);
// BUGFIX: https://af3.fortiss.org/issues/902
gui.addListener(SWT.Resize, new Listener() {
@Override
public void handleEvent(Event event) {
gui.pack(true);
gui.layout(true, true);
}
});
initDeploymentModel();
setupCombos();
......@@ -175,7 +164,6 @@ public class DeploymentEditorBackend extends DeploymentGEFEditorBase {
});
changeDeploymentViewTo(getPlatformArchitecture());
}
/**
......
......@@ -34,8 +34,8 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.ui.forms.widgets.Form;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
/**
*
......@@ -73,11 +73,11 @@ public class DeploymentEditorGUI extends Composite {
super(parent, style);
setLayout(new FillLayout(SWT.HORIZONTAL));
ScrolledForm frmNewForm = formToolkit.createScrolledForm(this);
Form frmNewForm = formToolkit.createForm(this);
formToolkit.paintBordersFor(frmNewForm);
frmNewForm.setText("Component-ECU Mapping Editor");
frmNewForm.getBody().setLayout(new GridLayout(2, false));
formToolkit.decorateFormHeading(frmNewForm.getForm());
formToolkit.decorateFormHeading(frmNewForm);
comboViewer = new ComboViewer(frmNewForm.getBody(), SWT.NONE);
Combo combo = comboViewer.getCombo();
......
......@@ -28,8 +28,8 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.ui.forms.widgets.Form;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
/**
*
......@@ -39,8 +39,7 @@ import org.eclipse.ui.forms.widgets.ScrolledForm;
* @ConQAT.Rating GREEN Hash: EE0BA8A6931DE4579A15F5160A2129B9
*/
public class DeploymentMappingsEditorGUI extends Composite {
private final FormToolkit formToolkit = new FormToolkit(
Display.getDefault());
private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
private Table table;
private Table table_1;
private TableViewer tableViewer;
......@@ -64,17 +63,15 @@ public class DeploymentMappingsEditorGUI extends Composite {
super(parent, style);
setLayout(new FillLayout(SWT.HORIZONTAL));
ScrolledForm scrldfrmDeployment = formToolkit.createScrolledForm(this);
Form scrldfrmDeployment = formToolkit.createForm(this);
formToolkit.paintBordersFor(scrldfrmDeployment);
scrldfrmDeployment.setText("Deployment Mappings");
scrldfrmDeployment.getBody().setLayout(new GridLayout(2, false));
formToolkit.decorateFormHeading(scrldfrmDeployment.getForm());
formToolkit.decorateFormHeading(scrldfrmDeployment);
Composite composite = new Composite(scrldfrmDeployment.getBody(),
SWT.NONE);
Composite composite = new Composite(scrldfrmDeployment.getBody(), SWT.NONE);
composite.setLayout(new GridLayout(2, false));
composite.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false,
1, 1));
composite.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false, 1, 1));
formToolkit.adapt(composite);
formToolkit.paintBordersFor(composite);
......@@ -86,8 +83,7 @@ public class DeploymentMappingsEditorGUI extends Composite {
formToolkit.adapt(btnNewButton_1, true, true);
btnNewButton_1.setText("Remove");
Composite composite_1 = new Composite(scrldfrmDeployment.getBody(),
SWT.NONE);
Composite composite_1 = new Composite(scrldfrmDeployment.getBody(), SWT.NONE);
formToolkit.adapt(composite_1);
formToolkit.paintBordersFor(composite_1);
composite_1.setLayout(new GridLayout(2, false));
......@@ -100,8 +96,8 @@ public class DeploymentMappingsEditorGUI extends Composite {
btnRemove.setText("Remove");
formToolkit.adapt(btnRemove, true, true);
tableViewer = new TableViewer(scrldfrmDeployment.getBody(), SWT.BORDER
| SWT.FULL_SELECTION);
tableViewer =
new TableViewer(scrldfrmDeployment.getBody(), SWT.BORDER | SWT.FULL_SELECTION);
table = tableViewer.getTable();
GridData gd_table = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
gd_table.heightHint = 497;
......@@ -121,11 +117,10 @@ public class DeploymentMappingsEditorGUI extends Composite {
tblclmnEcu.setWidth(200);
tblclmnEcu.setText("ECU");
tableViewer_1 = new TableViewer(scrldfrmDeployment.getBody(),
SWT.BORDER | SWT.FULL_SELECTION);
tableViewer_1 =
new TableViewer(scrldfrmDeployment.getBody(), SWT.BORDER | SWT.FULL_SELECTION);
table_1 = tableViewer_1.getTable();
table_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1,
1));
table_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
table_1.setLinesVisible(true);
table_1.setHeaderVisible(true);
formToolkit.paintBordersFor(table_1);
......
......@@ -38,8 +38,6 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.InputPort;
import org.fortiss.af3.component.model.OutputPort;
......@@ -75,16 +73,6 @@ public class DeploymentPortMappingEditorBackend extends DeploymentConnectorMappi
/** {@inheritDoc} */
@Override
public void createPartControl(Composite parent) {
parent.addListener(SWT.Resize, new Listener() {
/** {@inheritDoc} */
@Override
public void handleEvent(Event event) {
// FIXME - doesnt yet do it! repaint bug
// gui.getScrolledForm().reflow(false);
// gui.layout();
// Display.getCurrent().update();
}
});
addModelListener();
parent.setLayout(new FillLayout());
gui = new DeploymentPortMappingEditorGUI(parent, SWT.NONE);
......
......@@ -20,7 +20,6 @@ package org.fortiss.af3.deployment.ui.editor;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
......@@ -31,8 +30,8 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.ui.forms.widgets.Form;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.wb.swt.SWTResourceManager;
/**
......@@ -76,7 +75,7 @@ public class DeploymentPortMappingEditorGUI extends Composite {
private Table table_7;
private TableViewer tableViewer_7;
private TableViewerColumn tableViewerColumn_9;
private ScrolledForm scrldfrmPortMappingEditor;
private Form scrldfrmPortMappingEditor;
/**
* Create the composite.
......@@ -88,22 +87,15 @@ public class DeploymentPortMappingEditorGUI extends Composite {
super(parent, style);
setLayout(new FillLayout(SWT.HORIZONTAL));
scrldfrmPortMappingEditor = formToolkit.createScrolledForm(this);
scrldfrmPortMappingEditor = formToolkit.createForm(this);
scrldfrmPortMappingEditor.getBody().setBackground(
SWTResourceManager.getColor(SWT.COLOR_WHITE));
formToolkit.paintBordersFor(scrldfrmPortMappingEditor);
scrldfrmPortMappingEditor.setText("Sensor/Actuator-Port Mapping Editor");
FillLayout fillLayout = new FillLayout(SWT.HORIZONTAL);
FillLayout fillLayout = new FillLayout(SWT.VERTICAL);
scrldfrmPortMappingEditor.getBody().setLayout(fillLayout);
SashForm sashForm =
new SashForm(scrldfrmPortMappingEditor.getBody(), SWT.BORDER | SWT.SMOOTH |
SWT.VERTICAL);
sashForm.setForeground(SWTResourceManager.getColor(SWT.COLOR_BLACK));
formToolkit.adapt(sashForm);
formToolkit.paintBordersFor(sashForm);
Composite composite = new Composite(sashForm, SWT.BORDER | SWT.NO_BACKGROUND);
Composite composite = new Composite(scrldfrmPortMappingEditor.getBody(), SWT.NO_BACKGROUND);
formToolkit.adapt(composite);
formToolkit.paintBordersFor(composite);
GridLayout gl_composite = new GridLayout(3, false);
......@@ -143,7 +135,8 @@ public class DeploymentPortMappingEditorGUI extends Composite {
formToolkit.adapt(composite_4);
formToolkit.paintBordersFor(composite_4);
Composite composite_1 = new Composite(sashForm, SWT.BORDER | SWT.NO_BACKGROUND);
Composite composite_1 =
new Composite(scrldfrmPortMappingEditor.getBody(), SWT.NO_BACKGROUND);
formToolkit.adapt(composite_1);
formToolkit.paintBordersFor(composite_1);
GridLayout gl_composite_1 = new GridLayout(2, false);
......@@ -271,7 +264,8 @@ public class DeploymentPortMappingEditorGUI extends Composite {
button.setText("Add Mapping");
formToolkit.adapt(button, true, true);
Composite composite_2 = new Composite(sashForm, SWT.BORDER | SWT.NO_BACKGROUND);
Composite composite_2 =
new Composite(scrldfrmPortMappingEditor.getBody(), SWT.NO_BACKGROUND);
formToolkit.adapt(composite_2);
formToolkit.paintBordersFor(composite_2);
composite_2.setLayout(new GridLayout(2, false));
......@@ -336,8 +330,7 @@ public class DeploymentPortMappingEditorGUI extends Composite {
TableColumn tblclmnHardwareTransmitter = tableViewerColumn_8.getColumn();
tblclmnHardwareTransmitter.setWidth(250);
tblclmnHardwareTransmitter.setText("Hardware Transmitter");
sashForm.setWeights(new int[] {288, 282, 288});
formToolkit.decorateFormHeading(scrldfrmPortMappingEditor.getForm());
formToolkit.decorateFormHeading(scrldfrmPortMappingEditor);
}
......@@ -442,7 +435,4 @@ public class DeploymentPortMappingEditorGUI extends Composite {
return tableViewerColumn_9;
}
public ScrolledForm getScrolledForm() {
return scrldfrmPortMappingEditor;
}
}
......@@ -34,8 +34,6 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.InputPort;
import org.fortiss.af3.component.model.OutputPort;
......@@ -71,16 +69,6 @@ public class DeploymentTransceiverMappingEditorBackend extends DeploymentConnect
/** {@inheritDoc} */
@Override
public void createPartControl(Composite parent) {
parent.addListener(SWT.Resize, new Listener() {
/** {@inheritDoc} */
@Override
public void handleEvent(Event event) {
// FIXME - doesnt yet do it! repaint bug
// gui.getScrolledForm().reflow(false);
// gui.layout();
// Display.getCurrent().update();
}
});
addModelListener();
parent.setLayout(new FillLayout());
gui = new DeploymentTransceiverMappingEditorGUI(parent, SWT.NONE);
......
......@@ -20,7 +20,6 @@ package org.fortiss.af3.deployment.ui.editor;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
......@@ -31,8 +30,8 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.ui.forms.widgets.Form;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.wb.swt.SWTResourceManager;
/**
......@@ -74,7 +73,7 @@ public class DeploymentTransceiverMappingEditorGUI extends Composite {
private Table table_7;
private TableViewer tableViewer_7;
private TableViewerColumn tableViewerColumn_9;
private ScrolledForm scrldfrmPortMappingEditor;
private Form scrldfrmPortMappingEditor;
/**
* Create the composite.
......@@ -86,22 +85,15 @@ public class DeploymentTransceiverMappingEditorGUI extends Composite {
super(parent, style);
setLayout(new FillLayout(SWT.HORIZONTAL));
scrldfrmPortMappingEditor = formToolkit.createScrolledForm(this);
scrldfrmPortMappingEditor = formToolkit.createForm(this);
scrldfrmPortMappingEditor.getBody().setBackground(
SWTResourceManager.getColor(SWT.COLOR_WHITE));
formToolkit.paintBordersFor(scrldfrmPortMappingEditor);
scrldfrmPortMappingEditor.setText("Transceiver-Port Mapping Editor");
FillLayout fillLayout = new FillLayout(SWT.HORIZONTAL);
FillLayout fillLayout = new FillLayout(SWT.VERTICAL);
scrldfrmPortMappingEditor.getBody().setLayout(fillLayout);
SashForm sashForm =
new SashForm(scrldfrmPortMappingEditor.getBody(), SWT.BORDER | SWT.SMOOTH |
SWT.VERTICAL);
sashForm.setForeground(SWTResourceManager.getColor(SWT.COLOR_BLACK));
formToolkit.adapt(sashForm);
formToolkit.paintBordersFor(sashForm);
Composite composite = new Composite(sashForm, SWT.BORDER | SWT.NO_BACKGROUND);
Composite composite = new Composite(scrldfrmPortMappingEditor.getBody(), SWT.NO_BACKGROUND);
formToolkit.adapt(composite);
formToolkit.paintBordersFor(composite);
GridLayout gl_composite = new GridLayout(3, false);
......@@ -141,7 +133,8 @@ public class DeploymentTransceiverMappingEditorGUI extends Composite {
formToolkit.adapt(composite_4);
formToolkit.paintBordersFor(composite_4);
Composite composite_1 = new Composite(sashForm, SWT.BORDER | SWT.NO_BACKGROUND);
Composite composite_1 =
new Composite(scrldfrmPortMappingEditor.getBody(), SWT.NO_BACKGROUND);
formToolkit.adapt(composite_1);
formToolkit.paintBordersFor(composite_1);
GridLayout gl_composite_1 = new GridLayout(3, false);
......@@ -255,7 +248,8 @@ public class DeploymentTransceiverMappingEditorGUI extends Composite {
button.setText("Add Mapping");
formToolkit.adapt(button, true, true);
Composite composite_2 = new Composite(sashForm, SWT.BORDER | SWT.NO_BACKGROUND);
Composite composite_2 =
new Composite(scrldfrmPortMappingEditor.getBody(), SWT.NO_BACKGROUND);
formToolkit.adapt(composite_2);
formToolkit.paintBordersFor(composite_2);
composite_2.setLayout(new GridLayout(2, false));
......@@ -320,8 +314,7 @@ public class DeploymentTransceiverMappingEditorGUI extends Composite {
TableColumn tblclmnHardwareTransmitter = tableViewerColumn_8.getColumn();
tblclmnHardwareTransmitter.setWidth(250);
tblclmnHardwareTransmitter.setText("Hardware Transmitter");
sashForm.setWeights(new int[] {288, 282, 288});
formToolkit.decorateFormHeading(scrldfrmPortMappingEditor.getForm());
formToolkit.decorateFormHeading(scrldfrmPortMappingEditor);
}
......@@ -418,7 +411,4 @@ public class DeploymentTransceiverMappingEditorGUI extends Composite {
return tableViewerColumn_9;
}
public ScrolledForm getScrolledForm() {
return scrldfrmPortMappingEditor;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment