FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
processing/app/src/processing/app/ui/About.java at master · unexCoder/processing · GitHub
unexCoder
processing
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
processing
/
app
/
src
/
processing
/
app
/
ui
/
About.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
111 lines (88 loc) · 3.16 KB
Breadcrumbs
processing
/
app
/
src
/
processing
/
app
/
ui
/
About.java
Copy path
File metadata and controls
111 lines (88 loc) · 3.16 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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
103
104
105
106
107
108
109
110
111
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Part of the Processing project - http://processing.org
Copyright (c) 2012-19 The Processing Foundation
Copyright (c) 2004-12 Ben Fry and Casey Reas
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package
processing
.
app
.
ui
;
import
java
.
awt
.
Color
;
import
java
.
awt
.
Font
;
import
java
.
awt
.
Frame
;
import
java
.
awt
.
Graphics
;
import
java
.
awt
.
Graphics2D
;
import
java
.
awt
.
RenderingHints
;
import
java
.
awt
.
Window
;
import
java
.
awt
.
event
.
KeyAdapter
;
import
java
.
awt
.
event
.
KeyEvent
;
import
java
.
awt
.
event
.
MouseAdapter
;
import
java
.
awt
.
event
.
MouseEvent
;
import
javax
.
swing
.
ImageIcon
;
import
processing
.
app
.
Base
;
import
processing
.
app
.
Platform
;
public
class
About
extends
Window
{
ImageIcon
icon
;
int
width
,
height
;
public
About
(
Frame
frame
) {
super
(
frame
);
icon
=
Toolkit
.
getLibIconX
(
"about"
);
width
=
icon
.
getIconWidth
();
height
=
icon
.
getIconHeight
();
/*
if (Toolkit.highResDisplay()) {
image = Toolkit.getLibImage("about-2x.jpg"); //$NON-NLS-1$
width = image.getWidth(null) / 2;
height = image.getHeight(null) / 2;
} else {
image = Toolkit.getLibImage("about.jpg"); //$NON-NLS-1$
width = image.getWidth(null);
height = image.getHeight(null);
}
*/
addMouseListener
(
new
MouseAdapter
() {
public
void
mousePressed
(
MouseEvent
e
) {
dispose
();
}
});
addKeyListener
(
new
KeyAdapter
() {
public
void
keyTyped
(
KeyEvent
e
) {
System
.
out
.
println
(
e
);
if
(
e
.
getKeyCode
() ==
KeyEvent
.
VK_ESCAPE
) {
dispose
();
}
}
});
// Dimension screen = Toolkit.getScreenSize();
// setBounds((screen.width-width)/2, (screen.height-height)/2, width, height);
setSize
(
width
,
height
);
// setLocationRelativeTo(null);
setLocationRelativeTo
(
frame
);
setVisible
(
true
);
requestFocus
();
}
public
void
paint
(
Graphics
g
) {
// Graphics2D g2 = Toolkit.prepareGraphics(g);
// g2.scale(0.5, 0.5);
Graphics2D
g2
= (
Graphics2D
)
g
;
// OS X looks better doing its own thing, Windows and Linux need AA
g2
.
setRenderingHint
(
RenderingHints
.
KEY_TEXT_ANTIALIASING
,
Platform
.
isMacOS
() ?
RenderingHints
.
VALUE_TEXT_ANTIALIAS_DEFAULT
:
RenderingHints
.
VALUE_TEXT_ANTIALIAS_ON
);
g
.
drawImage
(
icon
.
getImage
(),
0
,
0
,
width
,
height
,
null
);
// g.setColor(Color.ORANGE);
// g.fillRect(0, 0, width, height);
g
.
setFont
(
Toolkit
.
getSansFont
(
12
,
Font
.
PLAIN
));
g
.
setColor
(
Color
.
WHITE
);
g
.
drawString
(
Base
.
getVersionName
(),
26
,
29
);
}
}
Back
|
FazBrowse Home
|
New Git URL