mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
Improve screenshot speed.
git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@5536 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
@ -428,7 +428,6 @@ public class SparkTransferManager {
|
|||||||
final SwingWorker worker = new SwingWorker() {
|
final SwingWorker worker = new SwingWorker() {
|
||||||
public Object construct() {
|
public Object construct() {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(1000);
|
|
||||||
final Robot robot = new Robot();
|
final Robot robot = new Robot();
|
||||||
Rectangle area = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
|
Rectangle area = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
|
||||||
return robot.createScreenCapture(area);
|
return robot.createScreenCapture(area);
|
||||||
|
|||||||
@ -706,6 +706,11 @@ public class ContactGroup extends CollapsiblePane implements MouseListener {
|
|||||||
if (!canShowPopup) {
|
if (!canShowPopup) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(e == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int loc = list.locationToIndex(e.getPoint());
|
int loc = list.locationToIndex(e.getPoint());
|
||||||
Point point = list.indexToLocation(loc);
|
Point point = list.indexToLocation(loc);
|
||||||
|
|
||||||
|
|||||||
@ -302,35 +302,36 @@ public final class ContactList extends JPanel implements ActionListener, Contact
|
|||||||
final ContactGroup group = (ContactGroup)groupIterator.next();
|
final ContactGroup group = (ContactGroup)groupIterator.next();
|
||||||
final ContactItem item = group.getContactItemByJID(bareJID);
|
final ContactItem item = group.getContactItemByJID(bareJID);
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
item.showUserGoingOfflineOnline();
|
|
||||||
item.setIcon(SparkRes.getImageIcon(SparkRes.CLEAR_BALL_ICON));
|
|
||||||
group.fireContactGroupUpdated();
|
|
||||||
|
|
||||||
int numberOfMillisecondsInTheFuture = 3000;
|
int numberOfMillisecondsInTheFuture = 3000;
|
||||||
Date timeToRun = new Date(System.currentTimeMillis() + numberOfMillisecondsInTheFuture);
|
Date timeToRun = new Date(System.currentTimeMillis() + numberOfMillisecondsInTheFuture);
|
||||||
Timer timer = new Timer();
|
|
||||||
|
|
||||||
|
// Only run through if the users presence was online before.
|
||||||
|
if (item.getPresence() != null) {
|
||||||
|
item.showUserGoingOfflineOnline();
|
||||||
|
item.setIcon(SparkRes.getImageIcon(SparkRes.CLEAR_BALL_ICON));
|
||||||
|
group.fireContactGroupUpdated();
|
||||||
|
Timer timer = new Timer();
|
||||||
|
timer.schedule(new TimerTask() {
|
||||||
|
public void run() {
|
||||||
|
Roster roster = SparkManager.getConnection().getRoster();
|
||||||
|
Presence userPresence = roster.getPresence(bareJID);
|
||||||
|
if (userPresence != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
timer.schedule(new TimerTask() {
|
item.setPresence(null);
|
||||||
public void run() {
|
|
||||||
Roster roster = SparkManager.getConnection().getRoster();
|
// Check for ContactItemHandler.
|
||||||
Presence userPresence = roster.getPresence(bareJID);
|
group.removeContactItem(item);
|
||||||
if (userPresence != null) {
|
checkGroup(group);
|
||||||
return;
|
|
||||||
|
if (offlineGroup.getContactItemByJID(item.getFullJID()) == null) {
|
||||||
|
offlineGroup.addContactItem(item);
|
||||||
|
offlineGroup.fireContactGroupUpdated();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}, timeToRun);
|
||||||
item.setPresence(null);
|
}
|
||||||
|
|
||||||
// Check for ContactItemHandler.
|
|
||||||
group.removeContactItem(item);
|
|
||||||
checkGroup(group);
|
|
||||||
|
|
||||||
if (offlineGroup.getContactItemByJID(item.getFullJID()) == null) {
|
|
||||||
offlineGroup.addContactItem(item);
|
|
||||||
offlineGroup.fireContactGroupUpdated();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, timeToRun);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user