[sikuli] 378/385: Correcting indentation
Gilles Filippini
pini at moszumanska.debian.org
Sun Jun 29 19:26:39 UTC 2014
This is an automated email from the git hooks/post-receive script.
pini pushed a commit to tag upstream/1.1.0_beta1
in repository sikuli.
commit 3bd0ae4f28b33f373d24f55e26f9a7b28e24f947
Author: Johan Sjöblom <sjoblomj at student.chalmers.se>
Date: Fri May 2 20:46:24 2014 +0200
Correcting indentation
---
API/src/main/java/org/sikuli/script/Region.java | 88 +++++++++++-----------
.../java/org/sikuli/ide/SikuliIDEStatusBar.java | 46 +++++------
.../src/main/java/org/sikuli/tesseract/Run.java | 74 +++++++++---------
3 files changed, 103 insertions(+), 105 deletions(-)
diff --git a/API/src/main/java/org/sikuli/script/Region.java b/API/src/main/java/org/sikuli/script/Region.java
index 9abaf1a..885dc0e 100644
--- a/API/src/main/java/org/sikuli/script/Region.java
+++ b/API/src/main/java/org/sikuli/script/Region.java
@@ -1301,7 +1301,7 @@ public class Region {
/**
* create a region enlarged w pixels on left and right side
- * and h pixels at top and bottom
+ * and h pixels at top and bottom
*
* @param w
* @param h
@@ -1315,7 +1315,7 @@ public class Region {
/**
* create a region enlarged l pixels on left and r pixels right side
- * and t pixels at top side and b pixels a bottom side.
+ * and t pixels at top side and b pixels a bottom side.
* negative values go inside (shrink)
*
* @param l add to the left
@@ -1338,7 +1338,7 @@ public class Region {
/**
* positive offset goes to the right.
- * might be off current screen
+ * might be off current screen
*
* @return point with given offset horizontally to middle point on right edge
*/
@@ -1348,7 +1348,7 @@ public class Region {
/**
* create a region right of the right side with same height.
- * the new region extends to the right screen border<br>
+ * the new region extends to the right screen border<br>
* use grow() to include the current region
*
* @return the new region
@@ -1360,8 +1360,8 @@ public class Region {
/**
* create a region right of the right side with same height and given width.
- * negative width creates the right part with width inside the region
- * <br />use grow() to include the current region
+ * negative width creates the right part with width inside the region<br />
+ * use grow() to include the current region
*
* @param width
* @return the new region
@@ -1783,7 +1783,7 @@ public class Region {
return this;
}
Debug.action("toggle highlight " + toString() + ": " + toEnable +
- (color != null ? " color: " + color : ""));
+ (color != null ? " color: " + color : ""));
if (toEnable) {
overlay = new ScreenHighlighter(getScreen(), color);
overlay.highlight(this);
@@ -1838,13 +1838,13 @@ public class Region {
* @return this region
*/
public Region highlight(int secs) {
- return highlight(secs, null);
+ return highlight(secs, null);
}
/**
* Show highlight in selected color
- *
+ *
* @param secs time in seconds
* @param color Color of frame (see method highlight(color))
* @return this region
@@ -2542,9 +2542,8 @@ public class Region {
public boolean hasObserver() {
if (regionObserver != null) {
return regionObserver.hasObservers();
- } else {
- return false;
}
+ return false;
}
/**
@@ -2607,38 +2606,38 @@ public class Region {
* and notify the given observer about this event<br />
* for details about the observe event handler: {@link ObserverCallBack}<br />
* for details about APPEAR/VANISH/CHANGE events: {@link ObserveEvent}<br />
- * @param <PSI> Pattern, String or Image
+ * @param <PSI> Pattern, String or Image
* @param target
* @param observer
* @return the event's name
*/
public <PSI> String onAppear(PSI target, Object observer) {
- return onAppearDo(target, observer);
- }
+ return onAppearDo(target, observer);
+ }
/**
* a subsequently started observer in this region should wait for target
* success and details about the event can be obtained using @{link Observing}<br />
* for details about the observe event handler: {@link ObserverCallBack}<br />
* for details about APPEAR/VANISH/CHANGE events: {@link ObserveEvent}<br />
- * @param <PSI> Pattern, String or Image
+ * @param <PSI> Pattern, String or Image
* @param target
* @return the event's name
*/
public <PSI> String onAppear(PSI target) {
- return onAppearDo(target, null);
- }
+ return onAppearDo(target, null);
+ }
/**
*INTERNAL USE ONLY: for use with scripting API bridges
- * @param <PSI> Pattern, String or Image
- * @param target
- * @param observer
- * @return the event's name
+ * @param <PSI> Pattern, String or Image
+ * @param target
+ * @param observer
+ * @return the event's name
*/
public <PSI> String onAppearJ(PSI target, Object observer) {
- return onAppearDo(target, observer);
- }
+ return onAppearDo(target, observer);
+ }
private <PSI> String onAppearDo(PSI target, Object observer) {
String name = Observing.add(this,
@@ -2653,38 +2652,38 @@ public class Region {
* and notify the given observer about this event<br />
* for details about the observe event handler: {@link ObserverCallBack}<br />
* for details about APPEAR/VANISH/CHANGE events: {@link ObserveEvent}<br />
- * @param <PSI> Pattern, String or Image
+ * @param <PSI> Pattern, String or Image
* @param target
* @param observer
* @return the event's name
*/
public <PSI> String onVanish(PSI target, Object observer) {
- return onVanishDo(target, observer);
- }
+ return onVanishDo(target, observer);
+ }
/**
* a subsequently started observer in this region should wait for the target to vanish
* success and details about the event can be obtained using @{link Observing}<br />
* for details about the observe event handler: {@link ObserverCallBack}<br />
* for details about APPEAR/VANISH/CHANGE events: {@link ObserveEvent}<br />
- * @param <PSI> Pattern, String or Image
+ * @param <PSI> Pattern, String or Image
* @param target
* @return the event's name
*/
public <PSI> String onVanish(PSI target) {
- return onVanishDo(target, null);
- }
+ return onVanishDo(target, null);
+ }
/**
*INTERNAL USE ONLY: for use with scripting API bridges
- * @param <PSI> Pattern, String or Image
- * @param target
- * @param observer
- * @return the event's name
+ * @param <PSI> Pattern, String or Image
+ * @param target
+ * @param observer
+ * @return the event's name
*/
public <PSI> String onVanishJ(PSI target, Object observer) {
- return onVanishDo(target, observer);
- }
+ return onVanishDo(target, observer);
+ }
private <PSI> String onVanishDo(PSI target, Object observer) {
String name = Observing.add(this,
@@ -2746,9 +2745,9 @@ public class Region {
/**
*INTERNAL USE ONLY: for use with scripting API bridges
- * @param minSize
- * @param observer
- * @return the event's name
+ * @param minSize
+ * @param observer
+ * @return the event's name
*/
public String onChangeJ(int minSize, Object observer) {
if (minSize == 0) {
@@ -2767,9 +2766,9 @@ public class Region {
/**
* start an observer in this region that runs forever (use stopObserving() in handler)
- for details about the observe event handler: {@link ObserverCallBack}
+ * for details about the observe event handler: {@link ObserverCallBack}
* for details about APPEAR/VANISH/CHANGE events: {@link ObserveEvent}
- * @return false if not possible, true if events have happened
+ * @return false if not possible, true if events have happened
*/
public boolean observe() {
return observe(Float.POSITIVE_INFINITY);
@@ -2788,9 +2787,9 @@ public class Region {
/**
*INTERNAL USE ONLY: for use with scripting API bridges
- * @param secs
- * @param bg
- * @return false if not possible, true if events have happened
+ * @param secs
+ * @param bg
+ * @return false if not possible, true if events have happened
*/
public boolean observeJ(double secs, boolean bg) {
if (bg) {
@@ -2867,11 +2866,10 @@ public class Region {
Thread observeThread = new Thread(new ObserverThread(secs));
observeThread.start();
log(lvl, "observeInBackground now running");
- return true;
+ return true;
}
private class ObserverThread implements Runnable {
-
private double time;
ObserverThread(double time) {
diff --git a/IDE/src/main/java/org/sikuli/ide/SikuliIDEStatusBar.java b/IDE/src/main/java/org/sikuli/ide/SikuliIDEStatusBar.java
old mode 100755
new mode 100644
index dd2ba73..95c68bc
--- a/IDE/src/main/java/org/sikuli/ide/SikuliIDEStatusBar.java
+++ b/IDE/src/main/java/org/sikuli/ide/SikuliIDEStatusBar.java
@@ -18,10 +18,10 @@ class SikuliIDEStatusBar extends JPanel {
private JLabel _lblMsg;
private JLabel _lblCaretPos;
- private String currentContentType = "???";
- private int currentRow;
- private int currentCol;
- private long starting;
+ private String currentContentType = "???";
+ private int currentRow;
+ private int currentCol;
+ private long starting;
public SikuliIDEStatusBar() {
setLayout(new BorderLayout());
@@ -32,7 +32,7 @@ class SikuliIDEStatusBar extends JPanel {
_lblMsg = new JLabel();
_lblMsg.setPreferredSize(new Dimension(400, 20));
_lblMsg.setUI(new EmphasizedLabelUI());
- _lblMsg.setFont(new Font("Monaco", Font.TRUETYPE_FONT, 11));
+ _lblMsg.setFont(new Font("Monaco", Font.TRUETYPE_FONT, 11));
_lblCaretPos = new JLabel();
_lblCaretPos.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 15));
_lblCaretPos.setUI(new EmphasizedLabelUI());
@@ -41,37 +41,37 @@ class SikuliIDEStatusBar extends JPanel {
resetMessage();
add(_lblMsg, BorderLayout.WEST);
add(_lblCaretPos, BorderLayout.LINE_END);
-// add(rightPanel, BorderLayout.EAST);
+// add(rightPanel, BorderLayout.EAST);
}
- public void setCurrentContentType(String ct) {
- if (ct == null) {
- return;
- }
- currentContentType = ct.replaceFirst(".*?\\/", "");
- setCaretPosition(-1, 0);
- }
+ public void setCurrentContentType(String ct) {
+ if (ct == null) {
+ return;
+ }
+ currentContentType = ct.replaceFirst(".*?\\/", "");
+ setCaretPosition(-1, 0);
+ }
public void setCaretPosition(int row, int col) {
- if (row > -1) {
- currentRow = row;
- currentCol = col;
- }
+ if (row > -1) {
+ currentRow = row;
+ currentCol = col;
+ }
_lblCaretPos.setText(String.format("(%s) | R: %d | C: %d", currentContentType, currentRow, currentCol));
- if (starting > 0 && new Date().getTime() - starting > 3000) {
- resetMessage();
- }
+ if (starting > 0 && new Date().getTime() - starting > 3000) {
+ resetMessage();
+ }
}
public void setMessage(String text) {
_lblMsg.setText(" " + text);
- repaint();
- starting = new Date().getTime();
+ repaint();
+ starting = new Date().getTime();
}
public void resetMessage() {
setMessage(Settings.SikuliVersionIDE + " --- Build: " + RunSetup.timestampBuilt);
- starting = 0;
+ starting = 0;
}
// @Override
// protected void paintComponent(Graphics g) {
diff --git a/Tesseract4SikuliX/src/main/java/org/sikuli/tesseract/Run.java b/Tesseract4SikuliX/src/main/java/org/sikuli/tesseract/Run.java
index 850cf5b..1e243df 100644
--- a/Tesseract4SikuliX/src/main/java/org/sikuli/tesseract/Run.java
+++ b/Tesseract4SikuliX/src/main/java/org/sikuli/tesseract/Run.java
@@ -12,41 +12,41 @@ import org.sikuli.script.*;
public class Run
{
- static String basePath = "/Users/rhocke/SikuliX";
- static String libPath = basePath + "/libs";
- static String datapath = libPath + "/tessdata";
- static String testFile = "/tesstest.png";
- static String language = "eng";
- static TessAPI.TessBaseAPI handle;
-
- public static void main( String[] args ) throws IOException
- {
- Debug.setDebugLevel(3);
- Screen s = new Screen();
- new Finder();
-
- System.setProperty("jna.encoding", "UTF8");
- System.setProperty("jna.library.path", libPath);
- handle = TessAPI.TessBaseAPICreate();
- TessAPI.TessBaseAPIInit3(handle, datapath, language);
-
-// ScreenImage si = s.userCapture();
- BufferedImage image = ImageIO.read(new File(basePath + testFile)); //si.getImage();
-
- ByteBuffer buf = Image.convertImageData(image);
- int bpp = image.getColorModel().getPixelSize();
- int bytespp = bpp / 8;
- int bytespl = (int) Math.ceil(image.getWidth() * bpp / 8.0);
-
- TessAPI.TessBaseAPISetPageSegMode(handle, TessAPI.TessPageSegMode.PSM_AUTO);
- TessAPI.TessBaseAPISetImage(handle, buf, image.getWidth(), image.getHeight(), bytespp, bytespl);
-// TessAPI.TessBaseAPISetRectangle(handle, 0, 0, 1024, 800);
- Pointer utf8Text = TessAPI.TessBaseAPIGetUTF8Text(handle);
-
- String result = utf8Text.getString(0);
- System.out.println(testFile + " returned: ***[\n" + result + "\n]***");
-
- TessAPI.TessDeleteText(utf8Text);
- TessAPI.TessBaseAPIDelete(handle);
- }
+ static String basePath = "/Users/rhocke/SikuliX";
+ static String libPath = basePath + "/libs";
+ static String datapath = libPath + "/tessdata";
+ static String testFile = "/tesstest.png";
+ static String language = "eng";
+ static TessAPI.TessBaseAPI handle;
+
+ public static void main( String[] args ) throws IOException
+ {
+ Debug.setDebugLevel(3);
+ Screen s = new Screen();
+ new Finder();
+
+ System.setProperty("jna.encoding", "UTF8");
+ System.setProperty("jna.library.path", libPath);
+ handle = TessAPI.TessBaseAPICreate();
+ TessAPI.TessBaseAPIInit3(handle, datapath, language);
+
+ // ScreenImage si = s.userCapture();
+ BufferedImage image = ImageIO.read(new File(basePath + testFile)); //si.getImage();
+
+ ByteBuffer buf = Image.convertImageData(image);
+ int bpp = image.getColorModel().getPixelSize();
+ int bytespp = bpp / 8;
+ int bytespl = (int) Math.ceil(image.getWidth() * bpp / 8.0);
+
+ TessAPI.TessBaseAPISetPageSegMode(handle, TessAPI.TessPageSegMode.PSM_AUTO);
+ TessAPI.TessBaseAPISetImage(handle, buf, image.getWidth(), image.getHeight(), bytespp, bytespl);
+ // TessAPI.TessBaseAPISetRectangle(handle, 0, 0, 1024, 800);
+ Pointer utf8Text = TessAPI.TessBaseAPIGetUTF8Text(handle);
+
+ String result = utf8Text.getString(0);
+ System.out.println(testFile + " returned: ***[\n" + result + "\n]***");
+
+ TessAPI.TessDeleteText(utf8Text);
+ TessAPI.TessBaseAPIDelete(handle);
+ }
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/sikuli.git
More information about the pkg-java-commits
mailing list