1 | /**********************************************************************
|
---|
2 | *
|
---|
3 | * PhindTitle.java -- backdrops to empty ResultDisplay panels.
|
---|
4 | *
|
---|
5 | * Copyright 1997-2000 Gordon W. Paynter
|
---|
6 | * Copyright 2000 The New Zealand Digital Library Project
|
---|
7 | *
|
---|
8 | * A component of the Greenstone digital library software
|
---|
9 | * from the New Zealand Digital Library Project at the
|
---|
10 | * University of Waikato, New Zealand.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or modify
|
---|
13 | * it under the terms of the GNU General Public License as published by
|
---|
14 | * the Free Software Foundation; either version 2 of the License, or
|
---|
15 | * (at your option) any later version.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful,
|
---|
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
20 | * GNU General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, write to the Free Software
|
---|
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
25 | *
|
---|
26 | *********************************************************************/
|
---|
27 |
|
---|
28 |
|
---|
29 | /*********************************************************************
|
---|
30 |
|
---|
31 | PhindTitle is for drawing backdrops in empty ResultDisplay panels.
|
---|
32 |
|
---|
33 | **********************************************************************/
|
---|
34 | package org.greenstone.applet.phind;
|
---|
35 | //package org.nzdl.gsdl.Phind;
|
---|
36 |
|
---|
37 | import java.applet.Applet;
|
---|
38 | import java.awt.Canvas;
|
---|
39 | import java.awt.Color;
|
---|
40 | import java.awt.Dimension;
|
---|
41 | import java.awt.Graphics;
|
---|
42 | import java.awt.Image;
|
---|
43 |
|
---|
44 | public class PhindTitle extends Canvas {
|
---|
45 |
|
---|
46 | Phind phind;
|
---|
47 | static Image backgroundImage;
|
---|
48 | boolean displayInfo;
|
---|
49 |
|
---|
50 | PhindTitle(Phind p) {
|
---|
51 | phind = p;
|
---|
52 | }
|
---|
53 |
|
---|
54 | public void update(Graphics g) {
|
---|
55 | paint(g);
|
---|
56 | }
|
---|
57 |
|
---|
58 | public void paint(Graphics g) {
|
---|
59 | Dimension canvasSize = getSize();
|
---|
60 |
|
---|
61 | Color fore = phind.panel_fg;
|
---|
62 | Color back = phind.panel_bg;
|
---|
63 |
|
---|
64 | // set the screen background
|
---|
65 | if (phind.showImage)
|
---|
66 | try {
|
---|
67 | g.drawImage(phind.backgroundImage,
|
---|
68 | 0, 0, canvasSize.width, canvasSize.height, back, null);
|
---|
69 | } catch (Exception e) {
|
---|
70 | System.err.println("PhindTitle paint: " + e);
|
---|
71 | }
|
---|
72 | else {
|
---|
73 | g.setColor(back);
|
---|
74 | g.fillRect(0,0, canvasSize.width, canvasSize.height);
|
---|
75 | }
|
---|
76 | }
|
---|
77 | }
|
---|
78 |
|
---|
79 |
|
---|
80 |
|
---|
81 |
|
---|
82 |
|
---|
83 |
|
---|
84 |
|
---|