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:
Derek DeMoro
2006-09-28 15:43:42 +00:00
committed by derek
parent dd2c9f51ca
commit f8313a6df8
3 changed files with 30 additions and 25 deletions

View File

@ -428,7 +428,6 @@ public class SparkTransferManager {
final SwingWorker worker = new SwingWorker() {
public Object construct() {
try {
Thread.sleep(1000);
final Robot robot = new Robot();
Rectangle area = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
return robot.createScreenCapture(area);

View File

@ -706,6 +706,11 @@ public class ContactGroup extends CollapsiblePane implements MouseListener {
if (!canShowPopup) {
return;
}
if(e == null){
return;
}
int loc = list.locationToIndex(e.getPoint());
Point point = list.indexToLocation(loc);

View File

@ -302,35 +302,36 @@ public final class ContactList extends JPanel implements ActionListener, Contact
final ContactGroup group = (ContactGroup)groupIterator.next();
final ContactItem item = group.getContactItemByJID(bareJID);
if (item != null) {
item.showUserGoingOfflineOnline();
item.setIcon(SparkRes.getImageIcon(SparkRes.CLEAR_BALL_ICON));
group.fireContactGroupUpdated();
int numberOfMillisecondsInTheFuture = 3000;
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() {
public void run() {
Roster roster = SparkManager.getConnection().getRoster();
Presence userPresence = roster.getPresence(bareJID);
if (userPresence != null) {
return;
item.setPresence(null);
// Check for ContactItemHandler.
group.removeContactItem(item);
checkGroup(group);
if (offlineGroup.getContactItemByJID(item.getFullJID()) == null) {
offlineGroup.addContactItem(item);
offlineGroup.fireContactGroupUpdated();
}
}
item.setPresence(null);
// Check for ContactItemHandler.
group.removeContactItem(item);
checkGroup(group);
if (offlineGroup.getContactItemByJID(item.getFullJID()) == null) {
offlineGroup.addContactItem(item);
offlineGroup.fireContactGroupUpdated();
}
}
}, timeToRun);
}, timeToRun);
}
}
}
}