Source code: com/gui/JspmGraphicsEnvironment.java
1 /*-----------------------------------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (C) */
4 /* */
5 /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU */
6 /* General Public License as published by the Free Software Foundation; either version 2 of the */
7 /* License, or (at your option) any later version. */
8 /* */
9 /* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; */
10 /* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */
11 /* PURPOSE. See the GNU General Public License for more details. */
12 /* */
13 /* You should have received a copy of the GNU General Public License along with this program; if */
14 /* not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */
15 /* 02111-1307 USA */
16 /* */
17 /*-----------------------------------------------------------------------------------------------------*/
18 /* */
19 /* Author: Steve Randall (strand012001@yahoo.com) */
20 /* Version: 0.0.1 */
21 /* Date: 05/09/2001 */
22 /* */
23 /*-----------------------------------------------------------------------------------------------------*/
24
25 package com.gui;
26
27 /*
28 * Java classes
29 */
30 import java.util.*;
31 import java.awt.*;
32
33 /*
34 * Swing classes
35 */
36 import javax.swing.*;
37 import javax.swing.tree.*;
38 import javax.swing.event.*;
39
40 /**
41 * This class provides information about the graphics environment
42 *
43 * @author Steve Randall (strand012001@yahoo.com)
44 * @version 1.0.1
45 * @date 25/07/2001
46 *
47 */
48 public class JspmGraphicsEnvironment
49 {
50 public int offX = 0;
51 public int offY = 0;
52 public int maxX = 0;
53 public int maxY = 0;
54 public int centerX = 0;
55 public int centerY = 0;
56
57 Rectangle gr;
58
59 public JspmGraphicsEnvironment() {
60
61 gr = new Rectangle(0, 0, 0, 0);
62
63 /*
64 * Get the enviroment
65 */
66 GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
67 GraphicsDevice[] gs = ge.getScreenDevices();
68
69 for( int i = 0; i < gs.length; i++) {
70 GraphicsDevice gd = gs[i];
71 GraphicsConfiguration gc = gd.getDefaultConfiguration();
72 gr = gc.getBounds();
73 maxX = gr.width;
74 maxY = gr.height;
75 centerX = gr.width/2;
76 centerY = gr.height/2;
77 }
78 }
79 }
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102