summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-07-06 12:33:33 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-07-06 12:33:33 +0200
commite4767bccc7324d4b61a334bf6c0558d0080045e2 (patch)
tree728a5df44f02ca10f760b979873c990cd4c0d265 /pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls
parent3422e5eb2819f5de304f25dc622f5284813bb9b4 (diff)
downloadpdf-over-e4767bccc7324d4b61a334bf6c0558d0080045e2.tar.gz
pdf-over-e4767bccc7324d4b61a334bf6c0558d0080045e2.tar.bz2
pdf-over-e4767bccc7324d4b61a334bf6c0558d0080045e2.zip
remove NON-NLS comments, cleanup whitespace
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ClickableCanvas.java22
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/Dialog.java8
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorDialog.java2
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java4
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/InputDialog.java6
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java52
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarEndButton.java10
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarMiddleButton.java24
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarRectangleButton.java54
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarStartButton.java58
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/PasswordInputDialog.java2
11 files changed, 121 insertions, 121 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ClickableCanvas.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ClickableCanvas.java
index c14a2373..e2246761 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ClickableCanvas.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ClickableCanvas.java
@@ -28,19 +28,19 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
/**
- *
+ *
*/
public class ClickableCanvas extends Canvas {
-
+
private Image image = null;
-
+
/**
* @param parent
* @param style
*/
public ClickableCanvas(Composite parent, int style) {
super(parent, style);
-
+
this.addPaintListener(new PaintListener() {
@Override
@@ -65,7 +65,7 @@ public class ClickableCanvas extends Canvas {
/**
* Gets the image
- *
+ *
* @return the image
*/
public Image getImage() {
@@ -74,7 +74,7 @@ public class ClickableCanvas extends Canvas {
/**
* Sets the Image
- *
+ *
* @param image
* the imgage to set
*/
@@ -84,7 +84,7 @@ public class ClickableCanvas extends Canvas {
/**
* Main painting method
- *
+ *
* @param e
*/
void paintControl(PaintEvent e) {
@@ -93,7 +93,7 @@ public class ClickableCanvas extends Canvas {
/**
* Paint the text or image on the button
- *
+ *
* @param e
*/
protected void paintText(PaintEvent e) {
@@ -103,9 +103,9 @@ public class ClickableCanvas extends Canvas {
// e.gc.fillGradientRectangle(0, 1, width, height / 4, true);
if (this.image != null) {
-
+
//log.debug("Width: " + width + " Height: " + height);
-
+
int w = 0;
Image tmp = null;
if(this.image.getImageData().width < width) {
@@ -116,7 +116,7 @@ public class ClickableCanvas extends Canvas {
} else {
tmp = new Image(getDisplay(), this.image.getImageData());
}
-
+
e.gc.drawImage(tmp, w, w);
}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/Dialog.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/Dialog.java
index 6d14dbd7..de3fb157 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/Dialog.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/Dialog.java
@@ -26,7 +26,7 @@ import org.eclipse.swt.widgets.Shell;
public class Dialog {
private MessageBox box;
-
+
/**
* Message box buttons
*/
@@ -42,7 +42,7 @@ public class Dialog {
/** Display yes and no buttons */
YES_NO
};
-
+
/**
* Message box icon
*/
@@ -58,7 +58,7 @@ public class Dialog {
/** Working icon */
WORKING
};
-
+
/**
* @param parent The parent shell
* @param title The dialog title
@@ -114,7 +114,7 @@ public class Dialog {
/**
* Open error dialog
- *
+ *
* @return SWT.OK | SWT.IGNORE | SWT.ABORT | SWT.RETRY | SWT.CANCEL
*/
public int open() {
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorDialog.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorDialog.java
index f6863b4f..f2c7b8e6 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorDialog.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorDialog.java
@@ -30,7 +30,7 @@ public class ErrorDialog extends Dialog {
* @param button The buttons to be shown
*/
public ErrorDialog(Shell parent, String message, BUTTONS button) {
- super(parent, Messages.getString("error.Title"), //$NON-NLS-1$
+ super(parent, Messages.getString("error.Title"), //
message, button, ICON.ERROR);
}
}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java
index 0b5ca4b9..ba2949d8 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java
@@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory;
import at.asit.pdfover.commons.Constants;
/**
- *
+ *
*/
public class ErrorMarker extends Label {
@@ -53,7 +53,7 @@ public class ErrorMarker extends Label {
public ErrorMarker(Composite parent, int style,
String message) {
super(parent, style);
-
+
InputStream stream = this.getClass().getResourceAsStream(Constants.RES_IMG_ERROR);
this.errorImg = new Image(getDisplay(), new ImageData(stream));
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/InputDialog.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/InputDialog.java
index 3822bbd7..f86ed4db 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/InputDialog.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/InputDialog.java
@@ -31,7 +31,7 @@ import org.eclipse.swt.widgets.Text;
import at.asit.pdfover.commons.Messages;
/**
- *
+ *
*/
public class InputDialog extends org.eclipse.swt.widgets.Dialog {
/**
@@ -134,7 +134,7 @@ public class InputDialog extends org.eclipse.swt.widgets.Dialog {
data.horizontalSpan = 2;
text.setLayoutData(data);
Button ok = new Button(shell, SWT.PUSH);
- ok.setText(Messages.getString("common.Ok")); //$NON-NLS-1$
+ ok.setText(Messages.getString("common.Ok")); //
data = new GridData(GridData.FILL_HORIZONTAL);
ok.setLayoutData(data);
ok.addSelectionListener(new SelectionAdapter() {
@@ -145,7 +145,7 @@ public class InputDialog extends org.eclipse.swt.widgets.Dialog {
}
});
Button cancel = new Button(shell, SWT.PUSH);
- cancel.setText(Messages.getString("common.Cancel")); //$NON-NLS-1$
+ cancel.setText(Messages.getString("common.Cancel")); //
data = new GridData(GridData.FILL_HORIZONTAL);
cancel.setLayoutData(data);
cancel.addSelectionListener(new SelectionAdapter() {
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java
index e03b427d..ee17f6b8 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java
@@ -36,15 +36,15 @@ import at.asit.pdfover.commons.Constants;
* Main Bar Button implementation
*/
public abstract class MainBarButton extends Canvas {
-
+
/**
* If borders are drawn with a gradient effect this sets the size
*/
public static final int GradientFactor = 5;
-
+
/**
* Number of pixel of the altitude of the triangle representing the arrow within the button shapes
- *
+ *
* This should be a multiple of 2!
*/
public static final int SplitFactor = 10;
@@ -66,7 +66,7 @@ public abstract class MainBarButton extends Canvas {
private Color inactiveText = null;
- private String text = ""; //$NON-NLS-1$
+ private String text = ""; //
private boolean active = true;
@@ -167,11 +167,11 @@ public abstract class MainBarButton extends Canvas {
public void setBorderColor(Color borderColor) {
this.borderColor = borderColor;
}
-
+
/**
* Gets the image
- *
+ *
* @return the image
*/
public Image getImage() {
@@ -180,7 +180,7 @@ public abstract class MainBarButton extends Canvas {
/**
* Sets the Image
- *
+ *
* @param image
* the imgage to set
*/
@@ -190,7 +190,7 @@ public abstract class MainBarButton extends Canvas {
/**
* Sets if this button is active
- *
+ *
* @param active
* the active state
*/
@@ -206,7 +206,7 @@ public abstract class MainBarButton extends Canvas {
/**
* Gets if this button is active
- *
+ *
* @return the active state
*/
public boolean getActive() {
@@ -215,7 +215,7 @@ public abstract class MainBarButton extends Canvas {
/**
* Gets the button text
- *
+ *
* @return the text
*/
public String getText() {
@@ -224,7 +224,7 @@ public abstract class MainBarButton extends Canvas {
/**
* Sets the text for the button
- *
+ *
* @param text
* the text to set
*/
@@ -234,7 +234,7 @@ public abstract class MainBarButton extends Canvas {
/**
* Paint 3D style borders
- *
+ *
* @param e
*/
protected void paintBackground(PaintEvent e) {
@@ -242,14 +242,14 @@ public abstract class MainBarButton extends Canvas {
int height = size.y - 4;
int width = size.x;
-
+
e.gc.setForeground(this.activeBackground1);
e.gc.setBackground(this.activeBackground);
-
+
e.gc.fillGradientRectangle(0, height, width, -1 * height, true);
-
+
//e.gc.setBackground(activeBackground);
-
+
// LEFT
// e.gc.fillGradientRectangle(0, 0, factor, height, false);
@@ -261,20 +261,20 @@ public abstract class MainBarButton extends Canvas {
/**
* Main painting method
- *
+ *
* @param e
*/
void paintControl(PaintEvent e) {
Color forecurrent = e.gc.getForeground();
Color backcurrent = e.gc.getBackground();
-
+
e.gc.setForeground(getBorderColor());
if(this.getActive()) {
this.paintBackground(e);
}
e.gc.setForeground(getBorderColor());
-
+
this.paintButton(e);
e.gc.setForeground(forecurrent);
@@ -285,7 +285,7 @@ public abstract class MainBarButton extends Canvas {
/**
* paint the inner button
- *
+ *
* @param e
*/
protected void paintButton(PaintEvent e) {
@@ -294,7 +294,7 @@ public abstract class MainBarButton extends Canvas {
/**
* Paint the text or image on the button
- *
+ *
* @param e
*/
protected void paintText(PaintEvent e) {
@@ -331,9 +331,9 @@ public abstract class MainBarButton extends Canvas {
e.gc.setForeground(current);
} else {
-
+
//log.debug("Width: " + width + " Height: " + height);
-
+
int w = 0;
Image tmp = null;
if(this.image.getImageData().width < width) {
@@ -344,7 +344,7 @@ public abstract class MainBarButton extends Canvas {
} else {
tmp = new Image(getDisplay(), this.image.getImageData());
}
-
+
e.gc.drawImage(tmp, w, w);
}
@@ -352,7 +352,7 @@ public abstract class MainBarButton extends Canvas {
/**
* change the text position
- *
+ *
* @param positionX
* the position
* @return the new position
@@ -363,7 +363,7 @@ public abstract class MainBarButton extends Canvas {
/**
* Gets the region of the button
- *
+ *
* @return the button region
*/
protected abstract Region getCustomRegion();
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarEndButton.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarEndButton.java
index 636de621..fa4c40c2 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarEndButton.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarEndButton.java
@@ -24,7 +24,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- *
+ *
*/
public class MainBarEndButton extends MainBarButton {
/**
@@ -44,7 +44,7 @@ public class MainBarEndButton extends MainBarButton {
/*
* (non-Javadoc)
- *
+ *
* @see
* at.asit.pdfover.gui.controls.MainBarButton#paintButton(org.eclipse.swt
* .events.PaintEvent)
@@ -56,7 +56,7 @@ public class MainBarEndButton extends MainBarButton {
int split = 10;
int width = size.x - 1;
-
+
e.gc.drawLine(0, 0, width, 0);
e.gc.drawLine(width, 0, width, height);
e.gc.drawLine(width, height, 0, height);
@@ -67,7 +67,7 @@ public class MainBarEndButton extends MainBarButton {
/*
* (non-Javadoc)
- *
+ *
* @see at.asit.pdfover.gui.controls.MainBarButton#getCustomRegion()
*/
@Override
@@ -87,7 +87,7 @@ public class MainBarEndButton extends MainBarButton {
}
/**
- * change the text position
+ * change the text position
* @param positionX the position
* @return the new position
*/
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarMiddleButton.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarMiddleButton.java
index 6d992799..63cc50a2 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarMiddleButton.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarMiddleButton.java
@@ -24,7 +24,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- *
+ *
*/
public class MainBarMiddleButton extends MainBarButton {
/**
@@ -47,14 +47,14 @@ public class MainBarMiddleButton extends MainBarButton {
*/
@Override
protected void paintButton(PaintEvent e) {
-
+
Point size = this.getSize();
-
+
int height = size.y - 3;
int split = SplitFactor;
int width = size.x - split;
-
+
e.gc.drawLine(0, 0, width, 0);
e.gc.drawLine(width, 0, width+split, (height) / 2);
e.gc.drawLine(width+split, (height) / 2, width, height);
@@ -64,7 +64,7 @@ public class MainBarMiddleButton extends MainBarButton {
}
-
+
/* (non-Javadoc)
* @see at.asit.pdfover.gui.controls.MainBarButton#getCustomRegion()
*/
@@ -75,17 +75,17 @@ public class MainBarMiddleButton extends MainBarButton {
int height = size.y - 2;
int split = SplitFactor;
-
+
int width = size.x - split;
Region reg = new Region();
- reg.add(new int[] {
- 0, 0,
- width, 0,
+ reg.add(new int[] {
+ 0, 0,
+ width, 0,
width + split, (height) / 2,
- width, height,
- 0, height,
- 0+split, (height) / 2,
+ width, height,
+ 0, height,
+ 0+split, (height) / 2,
0, 0 });
return reg;
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarRectangleButton.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarRectangleButton.java
index ce423977..9e35d3d6 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarRectangleButton.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarRectangleButton.java
@@ -25,7 +25,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- *
+ *
*/
public class MainBarRectangleButton extends MainBarButton {
@@ -71,7 +71,7 @@ public class MainBarRectangleButton extends MainBarButton {
/*
* (non-Javadoc)
- *
+ *
* @see
* at.asit.pdfover.gui.controls.MainBarButton#paintButton(org.eclipse.swt
* .events.PaintEvent)
@@ -103,55 +103,55 @@ public class MainBarRectangleButton extends MainBarButton {
Region left_reg = new Region();
left_reg.add(new int[] { 0, 0, factor, factor, factor, height-factor, 0, height, 0, 0 });
-
+
Region right_reg = new Region();
- right_reg.add(new int[] { width, 0,
- width - factor, factor,
+ right_reg.add(new int[] { width, 0,
+ width - factor, factor,
width - factor, height-factor, width, height, width, 0 });
-
+
Region top_reg = new Region();
- top_reg.add(new int[] {
- 0, 0,
- factor, factor,
- width - factor, factor,
- width, 0,
+ top_reg.add(new int[] {
+ 0, 0,
+ factor, factor,
+ width - factor, factor,
+ width, 0,
0, 0 });
-
+
Region bottom_reg = new Region();
- bottom_reg.add(new int[] {
- 0, height,
- factor, height-factor,
- width - factor, height-factor,
+ bottom_reg.add(new int[] {
+ 0, height,
+ factor, height-factor,
+ width - factor, height-factor,
width, height, 0, height });
-
+
e.gc.setClipping(top_reg);
-
- //TOP
+
+ //TOP
e.gc.fillGradientRectangle(0, 0, width, factor, true);
-
+
e.gc.setClipping(bottom_reg);
-
- //BOTTOM
+
+ //BOTTOM
e.gc.fillGradientRectangle(0, height, width, -1 * (factor),
true);
-
+
e.gc.setClipping(left_reg);
-
+
// LEFT
e.gc.fillGradientRectangle(0, 0, factor, height, false);
-
+
e.gc.setClipping(right_reg);
// RIGTH
e.gc.fillGradientRectangle(width, 0, -1 * factor, height,
false);
-
+
e.gc.setClipping((Region)null);
}
/*
* (non-Javadoc)
- *
+ *
* @see at.asit.pdfover.gui.controls.MainBarButton#getCustomRegion()
*/
@Override
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarStartButton.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarStartButton.java
index 489f17b3..265bccf6 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarStartButton.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarStartButton.java
@@ -24,7 +24,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- *
+ *
*/
public class MainBarStartButton extends MainBarButton {
/**
@@ -56,52 +56,52 @@ public class MainBarStartButton extends MainBarButton {
Region left_reg = new Region();
left_reg.add(new int[] { 0, 0, factor, factor, factor, height-factor, 0, height, 0, 0 });
-
+
Region right1_reg = new Region();
- right1_reg.add(new int[] { width, 0,
- width - factor, factor,
+ right1_reg.add(new int[] { width, 0,
+ width - factor, factor,
width - factor, height-factor, width, height, width, 0 });
-
+
Region top_reg = new Region();
- top_reg.add(new int[] {
- 0, 0,
- factor, factor,
- width - factor, factor,
- width, 0,
+ top_reg.add(new int[] {
+ 0, 0,
+ factor, factor,
+ width - factor, factor,
+ width, 0,
0, 0 });
-
+
Region bottom_reg = new Region();
- bottom_reg.add(new int[] {
- 0, height,
- factor, height-factor,
- width - factor, height-factor,
+ bottom_reg.add(new int[] {
+ 0, height,
+ factor, height-factor,
+ width - factor, height-factor,
width, height, 0, height });
-
+
e.gc.setClipping(top_reg);
-
- //TOP
+
+ //TOP
e.gc.fillGradientRectangle(0, 0, width, factor, true);
-
+
e.gc.setClipping(bottom_reg);
-
- //BOTTOM
+
+ //BOTTOM
e.gc.fillGradientRectangle(0, height, width, -1 * (factor),
true);
-
+
e.gc.setClipping(left_reg);
-
+
// LEFT
e.gc.fillGradientRectangle(0, 0, factor, height, false);
-
+
e.gc.setClipping(right1_reg);
// RIGTH
e.gc.fillGradientRectangle(width, 0, -1 * factor, height,
false);
-
+
e.gc.setClipping((Region)null);*/
}
-
+
/* (non-Javadoc)
* @see at.asit.pdfover.gui.controls.MainBarButton#paintButton(org.eclipse.swt.events.PaintEvent)
*/
@@ -114,7 +114,7 @@ public class MainBarStartButton extends MainBarButton {
int split = SplitFactor;
int width = size.x - split;
-
+
e.gc.drawLine(0, 0, width, 0);
e.gc.drawLine(width, 0, width + split, (height) / 2);
e.gc.drawLine(width + split, (height) / 2, width, height);
@@ -142,9 +142,9 @@ public class MainBarStartButton extends MainBarButton {
return reg;
}
-
+
/**
- * change the text position
+ * change the text position
* @param positionX the position
* @return the new position
*/
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/PasswordInputDialog.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/PasswordInputDialog.java
index 1659b73c..12b41a3e 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/PasswordInputDialog.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/PasswordInputDialog.java
@@ -20,7 +20,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Shell;
/**
- *
+ *
*/
public class PasswordInputDialog extends InputDialog {