Commit dac877c4 authored by Robert Smith's avatar Robert Smith
Browse files

Add test for PlotEditor

Adds a SWTBot test case for the plot editor.
parent ce132dd3
......@@ -1375,7 +1375,7 @@ public class MeshAppState extends ViewAppState implements
vSize = vertexSize;
vertexSize = (distance < 10f ? 0.0159f * distance + 0.0413f
: 0.2f);
if (vSize != vertexSize) {
if (Math.abs(vSize - vertexSize) > 0.001f) {
updateVertices = true;
vSize = vertexSize;
}
......@@ -1385,7 +1385,7 @@ public class MeshAppState extends ViewAppState implements
// changed.
eSize = edgeSize;
edgeSize = (distance < 10f ? 0.1f * distance + 4f : 5f);
if (eSize != edgeSize) {
if (Math.abs(eSize - edgeSize) > 0.001f) {
updateEdges = true;
eSize = edgeSize;
}
......
......@@ -66,7 +66,7 @@ public class ToolItemMenuListener implements Listener {
// event.detail == SWT.ARROW means the arrow has been clicked.
// event.detail == SWT.NONE means the button has been clicked.
if (event.detail == SWT.ARROW | event.detail == SWT.NONE) {
if (event.detail == SWT.ARROW || event.detail == SWT.NONE) {
Rectangle r = toolItem.getBounds();
Point p = new Point(r.x, r.y + r.height);
p = toolItem.getParent().toDisplay(p.x, p.y);
......
......@@ -67,7 +67,7 @@ public class CoreConnectDialog extends Dialog {
portLabel.setText("Port: ");
// Create a new text box to input port
portField = new Text(comp, SWT.SINGLE | SWT.SINGLE);
portField = new Text(comp, SWT.SINGLE);
data = new GridData(GridData.FILL_HORIZONTAL);
portField.setLayoutData(data);
......
......@@ -111,7 +111,7 @@ public class NewItemWizard extends Wizard implements INewWizard {
String selectedItem = page.getSelectedItem();
// Direct the client to create a new Item if a selection was made
if (selectedItem != null && selectedItem != null) {
if (selectedItem != null) {
finished = client.createItem(selectedItem) > 0;
}
......
......@@ -169,10 +169,10 @@ public class NekWriter implements IComponentVisitor {
hostname = InetAddress.getLocalHost().getHostName();
String iceHeader = String.format(
"C *** Nek5000 reafile generated by ICE ***\n"
+ "C (Eclipse Integrated Computational Environment)\n"
+ "C\n" + "C Created: %-30s\n"
+ "C User: %-30s\n" + "C Hostname: %-30s",
"C *** Nek5000 reafile generated by ICE ***%n"
+ "C (Eclipse Integrated Computational Environment)%n"
+ "C%n" + "C Created: %-30s%n"
+ "C User: %-30s%n" + "C Hostname: %-30s",
date, user, hostname);
// Write to the output stream
......@@ -204,10 +204,10 @@ public class NekWriter implements IComponentVisitor {
String currLine;
// Construct the header
String paramHeader = String.format(" ****** PARAMETERS *****\n"
+ " %9s NEKTON VERSION\n"
+ " %d DIMENSIONAL RUN\n"
+ " %3d PARAMETERS FOLLOW\n",
String paramHeader = String.format(" ****** PARAMETERS *****%n"
+ " %9s NEKTON VERSION%n"
+ " %d DIMENSIONAL RUN%n"
+ " %3d PARAMETERS FOLLOW%n",
properties.getNekVersion(), properties.getNumDimensions(),
numEntries);
......@@ -223,7 +223,7 @@ public class NekWriter implements IComponentVisitor {
currName = currEntry.getName();
currDesc = currEntry.getDescription();
currValue = currEntry.getValue();
currLine = String.format(" %-14s %s %s\n", currValue,
currLine = String.format(" %-14s %s %s%n", currValue,
currName, currDesc);
// Write to the output stream
......@@ -256,7 +256,7 @@ public class NekWriter implements IComponentVisitor {
// Construct the header
String passiveScalarsHeader = String.format(
" %3s Lines of passive scalar data follows"
+ "2 CONDUCT; 2RHOCP\n", numEntries);
+ "2 CONDUCT; 2RHOCP%n", numEntries);
// Write the passive scalars header
byte[] byteArray = passiveScalarsHeader.getBytes();
......@@ -268,7 +268,7 @@ public class NekWriter implements IComponentVisitor {
// Define the current passive scalar line
currEntry = passiveScalars.retrieveAllEntries().get(i);
currValue = currEntry.getValue();
currLine = String.format(" %-10s\n", currValue);
currLine = String.format(" %-10s%n", currValue);
// Write to the output stream
byteArray = currLine.getBytes();
......@@ -301,7 +301,7 @@ public class NekWriter implements IComponentVisitor {
// Construct the header
String switchesHeader = String.format(
" %3s LOGICAL SWITCHES FOLLOW\n", numEntries);
" %3s LOGICAL SWITCHES FOLLOW%n", numEntries);
// Write the logical switches header
byte[] byteArray = switchesHeader.getBytes();
......@@ -318,7 +318,7 @@ public class NekWriter implements IComponentVisitor {
// Construct the current line
if (currName.contains("IFNAV") && currName.contains("IFADVC")) {
currLine = String.format(" %s IFNAV & IFADVC %s\n", // This
currLine = String.format(" %s IFNAV & IFADVC %s%n", // This
// entry's
// name
// has
......@@ -329,10 +329,10 @@ public class NekWriter implements IComponentVisitor {
// just write the
} // name out here
else if (currName.contains("IFTMSH")) {
currLine = String.format(" %s %s %s\n", currValue, currName,
currLine = String.format(" %s %s %s%n", currValue, currName,
currDesc);
} else {
currLine = String.format(" %s %s\n", currValue, currName);
currLine = String.format(" %s %s%n", currValue, currName);
}
// Write to the output stream
byteArray = currLine.getBytes();
......@@ -368,7 +368,7 @@ public class NekWriter implements IComponentVisitor {
currEntry = preNekAxes.retrieveAllEntries().get(i);
currValue = currEntry.getValue();
currName = currEntry.getName();
currLine = String.format(" %s %s\n", currValue, currName);
currLine = String.format(" %s %s%n", currValue, currName);
// Write to the output stream
byteArray = currLine.getBytes();
......@@ -423,7 +423,7 @@ public class NekWriter implements IComponentVisitor {
currQuad = (Quad) mesh.getPolygons().get(i);
currValue = String.format(" ELEMENT%6s [ %4s]" // FORMAT:
// 18X,I6,4X,I3,A1,11x,i5
+ " GROUP %5s\n", (i + 1), currQuad
+ " GROUP %5s%n", (i + 1), currQuad
.getPolygonProperties().getMaterialId(), currQuad
.getPolygonProperties().getGroupNum());
......@@ -467,7 +467,7 @@ public class NekWriter implements IComponentVisitor {
// Construct the proper string format
currValue = String.format(
" %-3s%3d%3d%14.7G%14.7G%14.7G%14.7G%14.7G\n",
" %-3s%3d%3d%14.7G%14.7G%14.7G%14.7G%14.7G%n",
currBC.getType().id, (i + 1), (j + 1),
currBCValues.get(0), currBCValues.get(1),
currBCValues.get(2), currBCValues.get(3),
......@@ -490,7 +490,7 @@ public class NekWriter implements IComponentVisitor {
// Construct the proper string format
currValue = String.format(
" %-3s%3d%3d%14.7G%14.7G%14.7G%14.7G%14.7G\n",
" %-3s%3d%3d%14.7G%14.7G%14.7G%14.7G%14.7G%n",
currBC.getType().id, (i + 1), (j + 1),
currBCValues.get(0), currBCValues.get(1),
currBCValues.get(2), currBCValues.get(3),
......@@ -524,7 +524,7 @@ public class NekWriter implements IComponentVisitor {
// Construct the proper string format
currValue = String
.format(" %-3s%3d%3d%14.7G%14.7G%14.7G%14.7G%14.7G\n",
.format(" %-3s%3d%3d%14.7G%14.7G%14.7G%14.7G%14.7G%n",
currBC.getType().id, (i + 1),
(j + 1), currBCValues.get(0),
currBCValues.get(1),
......@@ -542,8 +542,8 @@ public class NekWriter implements IComponentVisitor {
}
// Write the coordinates to the buffer
currValue = String.format(" %9.6G %9.6G %9.6G %9.6G\n"
+ " %9.6G %9.6G %9.6G %9.6G\n", xCoords.get(0),
currValue = String.format(" %9.6G %9.6G %9.6G %9.6G%n"
+ " %9.6G %9.6G %9.6G %9.6G%n", xCoords.get(0),
xCoords.get(1), xCoords.get(2), xCoords.get(3),
yCoords.get(0), yCoords.get(1), yCoords.get(2),
yCoords.get(3));
......@@ -565,8 +565,8 @@ public class NekWriter implements IComponentVisitor {
// Construct the header
String meshHeader = String
.format(" *** MESH DATA ***\n"
+ " %3d %3d %3d NEL,NDIM,NELV\n",
.format(" *** MESH DATA ***%n"
+ " %3d %3d %3d NEL,NDIM,NELV%n",
properties.getNumThermalElements(),
properties.getNumDimensions(),
properties.getNumFluidElements());
......@@ -605,9 +605,9 @@ public class NekWriter implements IComponentVisitor {
// Construct the header
String curvedSidesHeader = String.format(
" ***** CURVED SIDE DATA *****\n"
" ***** CURVED SIDE DATA *****%n"
+ " %3s Curved sides follow "
+ "IEDGE,IEL,CURVE(I),I=1,5, CCURVE\n", numEntries);
+ "IEDGE,IEL,CURVE(I),I=1,5, CCURVE%n", numEntries);
// Write the curved sides header
byte[] byteArray = curvedSidesHeader.getBytes();
......@@ -642,7 +642,7 @@ public class NekWriter implements IComponentVisitor {
ArrayList<ArrayList<String>> passiveScalarBCs) throws IOException {
// Construct the header
String boundaryConditionHeader = " ***** BOUNDARY CONDITIONS *****\n";
String boundaryConditionHeader = " ***** BOUNDARY CONDITIONS *****%n";
// Write the boundary conditions header
byte[] byteArray = boundaryConditionHeader.getBytes();
......@@ -651,7 +651,7 @@ public class NekWriter implements IComponentVisitor {
// Check that there are fluid boundary conditions
if (!fluidBCs.isEmpty()) {
// Write the fluid boundary conditions header
String fluidHeader = " ***** FLUID BOUNDARY CONDITIONS *****\n";
String fluidHeader = " ***** FLUID BOUNDARY CONDITIONS *****%n";
byteArray = fluidHeader.getBytes();
stream.write(byteArray);
......@@ -661,7 +661,7 @@ public class NekWriter implements IComponentVisitor {
stream.write(byteArray);
}
} else {
String noFluidHeader = " ***** NO FLUID BOUNDARY CONDITIONS *****\n";
String noFluidHeader = " ***** NO FLUID BOUNDARY CONDITIONS *****%n";
byteArray = noFluidHeader.getBytes();
stream.write(byteArray);
}
......@@ -669,7 +669,7 @@ public class NekWriter implements IComponentVisitor {
// Check that there are thermal boundary conditions
if (!thermalBCs.isEmpty()) {
// Write the thermal boundary conditions header
String thermalHeader = " ***** THERMAL BOUNDARY CONDITIONS *****\n";
String thermalHeader = " ***** THERMAL BOUNDARY CONDITIONS *****%n";
byteArray = thermalHeader.getBytes();
stream.write(byteArray);
......@@ -679,7 +679,7 @@ public class NekWriter implements IComponentVisitor {
stream.write(byteArray);
}
} else {
String noThermalHeader = " ***** NO THERMAL BOUNDARY CONDITIONS *****\n";
String noThermalHeader = " ***** NO THERMAL BOUNDARY CONDITIONS *****%n";
byteArray = noThermalHeader.getBytes();
stream.write(byteArray);
}
......@@ -697,7 +697,7 @@ public class NekWriter implements IComponentVisitor {
// Write the passive scalar boundary conditions header
String passiveScalarHeader = String
.format(" ***** PASSIVE SCALAR %3s BOUNDARY CONDITIONS *****\n",
.format(" ***** PASSIVE SCALAR %3s BOUNDARY CONDITIONS *****%n",
(i + 1));
byteArray = passiveScalarHeader.getBytes();
stream.write(byteArray);
......@@ -736,7 +736,7 @@ public class NekWriter implements IComponentVisitor {
// Construct the header
String presolveRestartOptsHeader = String.format(
"%3s PRESOLVE/RESTART OPTIONS *****\n", numEntries);
"%3s PRESOLVE/RESTART OPTIONS *****%n", numEntries);
// Write the presolve/restart options header
byte[] byteArray = presolveRestartOptsHeader.getBytes();
......@@ -746,7 +746,7 @@ public class NekWriter implements IComponentVisitor {
// Define the current pre-solve/restart option
currEntry = presolveRestartOpts.retrieveAllEntries().get(i);
currValue = currEntry.getValue() + "\n";
currValue = currEntry.getValue() + "%n";
// Write to the output stream
byteArray = currValue.getBytes();
......@@ -776,7 +776,7 @@ public class NekWriter implements IComponentVisitor {
// Construct the header
String initialConditionsHeader = String.format(
"%3s INITIAL CONDITIONS *****\n", numEntries);
"%3s INITIAL CONDITIONS *****%n", numEntries);
// Write the initial conditions header
byte[] byteArray = initialConditionsHeader.getBytes();
......@@ -786,7 +786,7 @@ public class NekWriter implements IComponentVisitor {
// Define the current initial condition
currEntry = initialConditions.retrieveAllEntries().get(i);
currValue = currEntry.getValue() + "\n";
currValue = currEntry.getValue() + "%n";
// Write to the output stream
byteArray = currValue.getBytes();
......@@ -817,8 +817,8 @@ public class NekWriter implements IComponentVisitor {
// Construct the header
String driveForceDataHeader = String
.format(" ***** DRIVE FORCE DATA ***** BODY FORCE, FLOW, Q\n"
+ " %3s Lines of Drive force data follow\n",
.format(" ***** DRIVE FORCE DATA ***** BODY FORCE, FLOW, Q%n"
+ " %3s Lines of Drive force data follow%n",
numEntries);
// Write the drive force data header
......@@ -829,7 +829,7 @@ public class NekWriter implements IComponentVisitor {
// Define the current drive force datum
currEntry = driveForceData.retrieveAllEntries().get(i);
currValue = currEntry.getValue() + "\n";
currValue = currEntry.getValue() + "%n";
// Write to the output stream
byteArray = currValue.getBytes();
......@@ -859,8 +859,8 @@ public class NekWriter implements IComponentVisitor {
// Construct the header
String varPropertyDataHeader = String.format(
" ***** Variable Property Data ***** Overrrides Parameter data.\n"
+ "%3s Lines follow.\n", numEntries);
" ***** Variable Property Data ***** Overrrides Parameter data.%n"
+ "%3s Lines follow.%n", numEntries);
// Write the variable property data header
byte[] byteArray = varPropertyDataHeader.getBytes();
......@@ -870,7 +870,7 @@ public class NekWriter implements IComponentVisitor {
// Define the current variable property datum
currEntry = varPropertyData.retrieveAllEntries().get(i);
currValue = currEntry.getValue() + "\n";
currValue = currEntry.getValue() + "%n";
// Write to the output stream
byteArray = currValue.getBytes();
......@@ -901,8 +901,8 @@ public class NekWriter implements IComponentVisitor {
// Construct the header
String historyIntegralDataHeader = String.format(
" ***** HISTORY AND INTEGRAL DATA *****\n"
+ " %3s POINTS. Hcode, I,J,H,IEL\n",
" ***** HISTORY AND INTEGRAL DATA *****%n"
+ " %3s POINTS. Hcode, I,J,H,IEL%n",
numEntries);
// Write the history and integral data header
......@@ -913,7 +913,7 @@ public class NekWriter implements IComponentVisitor {
// Define the current history and integral datum
currEntry = historyIntegralData.retrieveAllEntries().get(i);
currValue = currEntry.getValue() + "\n";
currValue = currEntry.getValue() + "%n";
// Write to the output stream
byteArray = currValue.getBytes();
......@@ -946,8 +946,8 @@ public class NekWriter implements IComponentVisitor {
// Construct the header
String outputFieldSpecHeader = String.format(
" ***** OUTPUT FIELD SPECIFICATION *****\n"
+ " %3s SPECIFICATIONS FOLLOW\n", numEntries);
" ***** OUTPUT FIELD SPECIFICATION *****%n"
+ " %3s SPECIFICATIONS FOLLOW%n", numEntries);
// Write the output field specification header
byte[] byteArray = outputFieldSpecHeader.getBytes();
......@@ -960,7 +960,7 @@ public class NekWriter implements IComponentVisitor {
currName = currEntry.getName();
currValue = ("YES".equals(currEntry.getValue()) ? "T" : ("NO"
.equals(currEntry.getValue()) ? "F" : currEntry.getValue()));
currLine = String.format(" %s %s\n", currValue, currName);
currLine = String.format(" %s %s%n", currValue, currName);
// Write to the output stream
byteArray = currLine.getBytes();
......@@ -992,7 +992,7 @@ public class NekWriter implements IComponentVisitor {
String currLine;
// Construct the header
String objectSpecHeader = " ***** OBJECT SPECIFICATION *****\n";
String objectSpecHeader = " ***** OBJECT SPECIFICATION *****%n";
// Write the object specification header
byte[] byteArray = objectSpecHeader.getBytes();
......@@ -1004,7 +1004,7 @@ public class NekWriter implements IComponentVisitor {
currEntry = objectSpec.retrieveAllEntries().get(i);
currValue = currEntry.getValue();
currName = currEntry.getName();
currLine = String.format(" %3s %-7s Objects\n", currValue,
currLine = String.format(" %3s %-7s Objects%n", currValue,
currName);
// Write to the output stream
......
......@@ -18,9 +18,6 @@
</initializer>
</extension>
<extension
point="org.eclipse.ui.editors">
<editor
......@@ -30,76 +27,5 @@
name="PlotEditor">
</editor>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
defaultHandler="org.eclipse.ice.viz.service.OpenHandler"
id="org.eclipse.ice.viz.service.open"
name="Test">
</command>
</extension>
<!-- <extension
point="org.eclipse.ui.handlers">
<handler
class="org.eclipse.ice.viz.service.OpenHandler"
commandId="org.eclipse.ice.viz.service.open">
</handler>
</extension> -->
<!-- <extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="popup:org.eclipse.ui.navigator.ProjectExplorer#PopupMenu?after=additions">
<command
commandId="org.eclipse.ice.viz.service.open"
id="org.eclipse.ice.viz.service.openContribution"
mnemonic="o">
</command>
<visibleWhen>
<with variable="activeMenuSelection">
<iterate
ifEmpty="false">
<adapt type="org.eclipse.core.resources.IResource">
</adapt>
</iterate>
</with>
</visibleWhen>
</menuContribution>
</extension> -->
<!-- <extension
point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
<propertyContributor contributorId="org.eclipse.ice.viz.service.PlotEditorPropertyContributor">
<propertyCategory category="Plot Editor">
</propertyCategory>
</propertyContributor>
</extension>
<extension
point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
<propertyTabs contributorId="org.eclipse.ice.viz.service.PlotEditorPropertyContributor">
<propertyTab label="Main" category="Plot Editor"
id="ploteditor.main.tab">
</propertyTab>
</propertyTabs>
</extension>
<extension
point="org.eclipse.ui.views.properties.tabbed.propertySections">
<propertySections contributorId="org.eclipse.ice.viz.service.PlotEditor.PropertyContributor">
<propertySection tab="ploteditor.main.tab"
class="org.eclipse.graphiti.examples.tutorial.property
.PlotPropertiesSection"
id="ploteditor.main.tab.properties">
</propertySection>
</propertySections>
</extension> -->
<!-- filter="org.eclipse.graphiti.examples.tutorial.property
.MyTutorialEClassFilter" -->
</plugin>
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.ice.viz.service" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appinfo>
<meta.schema plugin="org.eclipse.ice.viz.service" id="org.eclipse.ui.perspectives" name="org.eclipse.ui.perspectives"/>
</appinfo>
<documentation>
[Enter description of this extension point.]
</documentation>
</annotation>
<element name="extension">
<annotation>
<appinfo>
<meta.element />
</appinfo>
</annotation>
<complexType>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
<appinfo>
<meta.attribute translatable="true"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appinfo>
<meta.section type="since"/>
</appinfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="examples"/>
</appinfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="apiinfo"/>
</appinfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="implementation"/>
</appinfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>
!SESSION 2015-06-23 11:57:53.010 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_31
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -application org.eclipse.ui.ide.workbench
Command-line arguments: -application org.eclipse.ui.ide.workbench -data C:\Users\r8s\workspace\ice\src\org.eclipse.ice.viz.service\src\org\eclipse\ice\viz\service -dev file:C:/Users/r8s/workspace/.metadata/.plugins/org.eclipse.pde.core/Test Recorder Basic Dialog/dev.properties -os win32 -ws win32 -arch x86_64
!ENTRY org.eclipse.e4.ui.workbench 1 0 2015-06-23 11:57:55.930
!MESSAGE Nothing to merge for "platform:/plugin/org.eclipse.ice.materials.ui/materialsFragment.e4xmi"
!ENTRY org.eclipse.jface 2 0 2015-06-23 11:57:57.089
!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2015-06-23 11:57:57.090
!MESSAGE A conflict occurred for ALT+SHIFT+X R:
Binding(ALT+SHIFT+X R,
ParameterizedCommand(Command(org.eclipse.rap.ui.launch.RAPLaunchShortcut.run,Run RAP Application,
Run RAP Application,
Category(org.eclipse.debug.ui.category.run,Run/Debug,Run/Debug command category,true),
org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@44fdce3c,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(ALT+SHIFT+X R,
ParameterizedCommand(Command(org.eclipse.wst.server.launchShortcut.run,Run on Server,
Run the current selection on a server,
Category(org.eclipse.debug.ui.category.run,Run/Debug,Run/Debug command category,true),
org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@712c5463,
,,true),null),