source: other-projects/trunk/greenstone3-extension/mat/org/greenstone/gsdl3_extension/mat/CursorController.java@ 17356

Last change on this file since 17356 was 17356, checked in by cc108, 16 years ago

Updating Mat Source Code

File size: 844 bytes
Line 
1package org.greenstone.gsdl3_extension.mat;
2
3import java.awt.Component;
4import java.awt.Cursor;
5import java.awt.event.ActionEvent;
6import java.awt.event.ActionListener;
7
8public final class CursorController {
9
10 public final static Cursor busyCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
11 public final static Cursor defaultCursor = Cursor.getDefaultCursor();
12
13 private CursorController() {}
14
15 public static ActionListener createListener(final Component component, final ActionListener mainActionListener) {
16 ActionListener actionListener = new ActionListener() {
17 public void actionPerformed(ActionEvent ae) {
18 try {
19 component.setCursor(busyCursor);
20 mainActionListener.actionPerformed(ae);
21 } finally {
22 component.setCursor(defaultCursor);
23 }
24 }
25 };
26 return actionListener;
27 }
28}
Note: See TracBrowser for help on using the repository browser.