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

Last change on this file since 18093 was 18093, checked in by cc108, 15 years ago

new Mat source code

File size: 841 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 private CursorController() {}
13
14 public static ActionListener createListener(final Component component, final ActionListener mainActionListener) {
15 ActionListener actionListener = new ActionListener() {
16 public void actionPerformed(ActionEvent ae) {
17 try {
18 component.setCursor(busyCursor);
19 mainActionListener.actionPerformed(ae);
20 } finally {
21 component.setCursor(defaultCursor);
22 }
23 }
24 };
25 return actionListener;
26 }
27}
Note: See TracBrowser for help on using the repository browser.