~ubuntu-branches/ubuntu/oneiric/tuxguitar/oneiric

« back to all changes in this revision

Viewing changes to TuxGuitar-tray/src/org/herac/tuxguitar/tray/TGTrayIcon.java

  • Committer: Bazaar Package Importer
  • Author(s): Philippe Coval
  • Date: 2008-06-19 00:30:30 UTC
  • mto: (5.1.2 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20080619003030-h719szrhsngou7c6
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.herac.tuxguitar.tray;
 
2
 
 
3
import org.eclipse.swt.graphics.Image;
 
4
import org.eclipse.swt.widgets.TrayItem;
 
5
import org.herac.tuxguitar.gui.util.TGFileUtils;
 
6
 
 
7
public class TGTrayIcon {
 
8
        
 
9
        private Image image;
 
10
        private TrayItem item;
 
11
        
 
12
        public TGTrayIcon(){
 
13
                super();
 
14
        }
 
15
        
 
16
        public void setItem(TrayItem item){
 
17
                this.item = item;
 
18
        }
 
19
        
 
20
        public void loadImage(){
 
21
                this.dispose();
 
22
                if(this.item != null && !this.item.isDisposed()){
 
23
                        this.image = TGFileUtils.loadImage("icon-24x24.png");
 
24
                        this.item.setImage(this.image);
 
25
                }
 
26
        }
 
27
        
 
28
        public void dispose(){
 
29
                if(this.image != null && !this.image.isDisposed()){
 
30
                        this.image.dispose();
 
31
                }
 
32
        }
 
33
}