Commit 4bae40f9 authored by helene ortiz's avatar helene ortiz
Browse files

Make some graphical modifications following migration to GTK3.

parent b7cb46b7
......@@ -11,8 +11,9 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-13">
<attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
......
4.0.134 dd/mm/yyyy
-------
* Make some graphical modifications following migration to GTK3.
4.0.133 02/12/2021
-------
* Add multiple y axis functionnality.
4.0.132 14/10/2021
-------
* Avoid crash if 'extensions' attribute for file text widgets is not provided.
4.0.131 08/10/2021
-------
* Avoid some crashes occuring during client synchronisation, if commandbox is deleted once created.
......
java $args -DSWT_GTK3=0 -Djava.library.path=lib64/gtk:lib64/common/calculator:/usr/lib:/usr/lib:/usr/lib/x86_64-linux-gnu/jni -Djava.util.logging.config.file=conf/client/logging.properties -jar lib64/nomadgui-gtk.linux.x86_64.jar $1
......@@ -117,11 +117,13 @@
<artifactId>slf4j-jdk14</artifactId>
<version>1.6.6</version>
</dependency>
<!--
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
</dependency>
-->
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt-main</artifactId>
......@@ -140,7 +142,7 @@
<dependency>
<groupId>fr.ill.ics</groupId>
<artifactId>nomadcommandsystem</artifactId>
<version>4.0.52</version>
<version>4.0.53-SNAPSHOT</version>
</dependency>
<dependency> <!-- For CollectionUtils -->
<groupId>org.apache.commons</groupId>
......
......@@ -72,6 +72,9 @@ public class SWTAdministratorLoginPeer extends AdministratorLoginPeer {
gridData.horizontalSpan = 2;
text.setLayoutData(gridData);
// H.ORTIZ Dec 2021: Since GTK3
text.setBackground(SWTColorFactory.getBackgroundColor());
Button logInButton = SWTWidgetFactory.getInstance().createPushButton(composite, "logInButtonLabel");
logInButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
......
......@@ -581,8 +581,8 @@ public class SWTWidgetFactory extends WidgetFactory {
*/
public GridData getButtonGridData() {
GridData gridData = getGridData();
gridData.widthHint = WidgetFactory.BUTTON_WIDTH;
gridData.heightHint = WidgetFactory.BUTTON_HEIGHT;
gridData.widthHint = Magnifier.getScaledValue(WidgetFactory.BUTTON_WIDTH);
gridData.heightHint = Magnifier.getScaledValue(WidgetFactory.BUTTON_HEIGHT);
gridData.grabExcessHorizontalSpace = false;
gridData.grabExcessVerticalSpace = false;
return gridData;
......@@ -1363,6 +1363,4 @@ public class SWTWidgetFactory extends WidgetFactory {
}
});
}
}
\ No newline at end of file
......@@ -125,6 +125,10 @@ public class SWTLoginPopup extends SWTAuthenticationPopup {
passwordGridData.horizontalAlignment = SWT.BEGINNING;
passwordGridData.widthHint = LOGIN_WIDTH;
password.setLayoutData(gridData);
// H.ORTIZ Dec 2021: Since GTK3
login.setBackground(SWTColorFactory.getBackgroundColor());
password.setBackground(SWTColorFactory.getBackgroundColor());
loginButton = SWTWidgetFactory.getInstance().createPushButton(buttonsComposite, "loginButtonLabel");
loginButton.addSelectionListener(new SelectionAdapter() {
......
/*
* Nomad Instrument Control Software
*
* Copyright 2011 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
package fr.ill.ics.client.view.menu.swt;
import org.eclipse.swt.widgets.Display;
import fr.ill.ics.client.view.menu.IMenuAction;
import fr.ill.ics.client.view.swt.SWTMainWindowPeer;
import fr.ill.ics.client.view.util.dialog.DialogManager;
import fr.ill.ics.common.Nomad;
/**
*
* @author ortizh
*
*/
public class SWTAboutVersionAction implements IMenuAction {
/**
* Display Nomad version information
*/
public void execute(boolean checked, int x, int y) {
Display display = ((SWTMainWindowPeer)SWTMainWindowPeer.getInstance()).getDisplay();
DialogManager.getInstance().nomadAboutMessageDialog(Nomad.getVersion(), "About");
}
}
\ No newline at end of file
......@@ -21,11 +21,10 @@ import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.Base64;
import javax.imageio.ImageIO;
import org.apache.xerces.impl.dv.util.Base64;
public abstract class ImageUtils {
/**
......@@ -46,7 +45,7 @@ public abstract class ImageUtils {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ImageIO.write(img, imageType, bos); // Write the image in the outputStream
byte[] imageBytes = bos.toByteArray();
imageString = Base64.encode(imageBytes);
imageString = Base64.getEncoder().encodeToString(imageBytes);
} catch (IOException e) {
// TODO Auto-generated catch block
......
......@@ -108,6 +108,7 @@ public class SWTExpressionCapturePeer extends ExpressionCapturePeer {
expressionText = SWTWidgetFactory.getInstance().createStyledText(innerComposite, SWT.MULTI | SWT.WRAP, FontFactory.STANDARD_STYLE);
expressionText.setFont(SWTFontFactory.getStandardFont(FontFactory.commandLineFontDataHeight));
GridData gridData = SWTWidgetFactory.getInstance().getHorizontalGridData();
gridData.heightHint = Magnifier.getScaledValue(80);
expressionText.setLayoutData(gridData);
expressionText.setBackground(SWTColorFactory.getTextBackgroundColor());
......@@ -221,7 +222,7 @@ public class SWTExpressionCapturePeer extends ExpressionCapturePeer {
}
Point location = shell.getDisplay().map(text, null, text.getLocation());
shell.setSize(Magnifier.getScaledValue(500), Magnifier.getScaledValue(150));
shell.setSize(Magnifier.getScaledValue(500), Magnifier.getScaledValue(170));
shell.setRedraw(false);
shell.setLocation(location.x - text.getLocation().x + 1, location.y + 1);
shell.open();
......
......@@ -22,7 +22,6 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import fr.ill.ics.client.control.plugin.ControllerPlugin;
import fr.ill.ics.client.view.factory.WidgetFactory;
import fr.ill.ics.client.view.factory.swt.SWTWidgetFactory;
import fr.ill.ics.client.view.magnifier.Magnifier;
import fr.ill.ics.client.view.magnifier.swt.SWTMagnifier;
......@@ -88,7 +87,7 @@ public class SWTCButton extends CButton {
Magnifier.getInstance().removeWidgetMagnifyListener(this);
} else {
SWTMagnifier.getInstance().magnifyControl(button, initialFontSize);
button.setLayoutData(SWTWidgetFactory.getInstance().getImageGridData(Magnifier.getScaledValue(WidgetFactory.BUTTON_WIDTH), Magnifier.getScaledValue(WidgetFactory.BUTTON_HEIGHT), true));
button.setLayoutData(SWTWidgetFactory.getInstance().getButtonGridData());
}
}
}
\ No newline at end of file
......@@ -86,6 +86,12 @@ public class SWTPText extends PText {
if (getProperty() != null) {
System.out.println("PText linked with property " + getProperty().getPropertyID() + "." + getProperty().getName());
System.out.println("UndoState is " + getProperty().getUndoState() + " MAX LENGTH = " + valueMaxLength);
if (text.getLayoutData() != null) {
System.out.println("LayoutData " + text.getLayoutData());
if (text.getLayoutData() instanceof GridData) {
System.out.println(((GridData)text.getLayoutData()).widthHint);
}
}
} else {
System.out.println("PText linked with a null property");
}
......
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