[sikuli] 225/385: the scripting language of current tab is shown right in the status bar. left side can show a message for a restricted time (now 3 seconds)
Gilles Filippini
pini at moszumanska.debian.org
Sun Jun 29 19:26:16 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 9d70975a28fe99e5ae4094022abea714c3209cb2
Author: Raimund Hocke <info at its-me-raiman.de>
Date: Wed Feb 19 14:19:16 2014 +0100
the scripting language of current tab is shown right in the status bar. left side can show a message for a restricted time (now 3 seconds)
---
.../java/org/sikuli/ide/SikuliIDEStatusBar.java | 24 ++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/IDE/src/main/java/org/sikuli/ide/SikuliIDEStatusBar.java b/IDE/src/main/java/org/sikuli/ide/SikuliIDEStatusBar.java
index dd0e590..dd2ba73 100755
--- a/IDE/src/main/java/org/sikuli/ide/SikuliIDEStatusBar.java
+++ b/IDE/src/main/java/org/sikuli/ide/SikuliIDEStatusBar.java
@@ -10,6 +10,7 @@ import java.awt.*;
import javax.swing.*;
import com.explodingpixels.macwidgets.plaf.EmphasizedLabelUI;
+import java.util.Date;
import org.sikuli.basics.RunSetup;
import org.sikuli.basics.Settings;
@@ -18,6 +19,9 @@ class SikuliIDEStatusBar extends JPanel {
private JLabel _lblMsg;
private JLabel _lblCaretPos;
private String currentContentType = "???";
+ private int currentRow;
+ private int currentCol;
+ private long starting;
public SikuliIDEStatusBar() {
setLayout(new BorderLayout());
@@ -40,22 +44,34 @@ class SikuliIDEStatusBar extends JPanel {
// add(rightPanel, BorderLayout.EAST);
}
- public void setCurrentContentType(String currentContentType) {
- this.currentContentType = currentContentType;
- repaint();
+ public void setCurrentContentType(String ct) {
+ if (ct == null) {
+ return;
+ }
+ currentContentType = ct.replaceFirst(".*?\\/", "");
+ setCaretPosition(-1, 0);
}
public void setCaretPosition(int row, int col) {
- _lblCaretPos.setText(String.format("(%s) | R: %d | C: %d", currentContentType, row, 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();
+ }
}
public void setMessage(String text) {
_lblMsg.setText(" " + text);
repaint();
+ starting = new Date().getTime();
}
public void resetMessage() {
setMessage(Settings.SikuliVersionIDE + " --- Build: " + RunSetup.timestampBuilt);
+ starting = 0;
}
// @Override
// protected void paintComponent(Graphics g) {
--
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