Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
e0283951
Commit
e0283951
authored
Apr 27, 2015
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
java JopWindow font and encoding fix
parent
44b8f6d9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
7 deletions
+44
-7
java/jpwr/jop/src/Jop.java
java/jpwr/jop/src/Jop.java
+6
-1
java/jpwr/jop/src/JopLang.java
java/jpwr/jop/src/JopLang.java
+2
-2
java/jpwr/jop/src/JopOp.java
java/jpwr/jop/src/JopOp.java
+32
-0
java/jpwr/jop/src/JopOpWindow.java
java/jpwr/jop/src/JopOpWindow.java
+4
-4
No files found.
java/jpwr/jop/src/Jop.java
View file @
e0283951
...
...
@@ -37,6 +37,9 @@
package
jpwr.jop
;
import
java.awt.*
;
import
java.awt.font.*
;
/**
Jop basic definitions.
*/
...
...
@@ -45,7 +48,9 @@ public class Jop {
public
static
final
int
BUTTON_ACTION_RESET
=
1
;
public
static
final
int
BUTTON_ACTION_TOGGLE
=
2
;
public
static
final
int
BUTTON_ACTION_COMMAND
=
3
;
public
static
Font
defFont14
=
new
Font
(
"Lucida Sans"
,
Font
.
PLAIN
,
14
);
public
static
Font
defFont16
=
new
Font
(
"Lucida Sans"
,
Font
.
PLAIN
,
16
);
public
static
Font
defFont20
=
new
Font
(
"Lucida Sans"
,
Font
.
PLAIN
,
20
);
public
static
int
executeCommand
(
JopSession
session
,
String
command
)
{
return
JopSpider
.
command
(
session
,
command
);
}
...
...
java/jpwr/jop/src/JopLang.java
View file @
e0283951
...
...
@@ -375,7 +375,7 @@ public class JopLang {
if
(
i
==
1
&&
lang
==
LANGUAGE_zh_CN
)
r2
=
new
InputStreamReader
(
in
,
"UTF-8"
);
else
r2
=
new
InputStreamReader
(
in
);
r2
=
new
InputStreamReader
(
in
,
"ISO-8859-1"
);
reader
=
new
BufferedReader
(
r2
);
}
catch
(
Exception
e
)
{
...
...
@@ -395,7 +395,7 @@ public class JopLang {
reader
=
new
BufferedReader
(
new
InputStreamReader
(
new
FileInputStream
(
filename
),
"UTF-8"
));
}
else
reader
=
new
BufferedReader
(
new
InputStreamReader
(
new
FileInputStream
(
filename
)));
reader
=
new
BufferedReader
(
new
InputStreamReader
(
new
FileInputStream
(
filename
)
,
"ISO-8859-1"
));
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"Unable to open file "
+
filename
);
...
...
java/jpwr/jop/src/JopOp.java
View file @
e0283951
...
...
@@ -37,6 +37,38 @@ public class JopOp {
frame
.
setBounds
(
0
,
0
,
frameSize
.
width
,
screenSize
.
height
);
// frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
frame
.
setVisible
(
true
);
UIManager
.
put
(
"Button.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"ToggleButton.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"RadioButton.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"CheckBox.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"ColorChooser.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"ComboBox.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"Label.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"List.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"MenuBar.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"MenuItem.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"RadioButtonMenuItem.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"CheckBoxMenuItem.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"Menu.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"PopupMenu.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"OptionPane.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"Panel.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"ProgressBar.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"ScrollPane.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"Viewport.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"TabbedPane.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"Table.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"TableHeader.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"TextField.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"PasswordField.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"TextArea.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"TextPane.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"EditorPane.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"TitledBorder.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"ToolBar.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"ToolTip.font"
,
Jop
.
defFont14
);
UIManager
.
put
(
"Tree.font"
,
Jop
.
defFont14
);
}
//Main method
...
...
java/jpwr/jop/src/JopOpWindow.java
View file @
e0283951
...
...
@@ -93,8 +93,7 @@ public class JopOpWindow extends JPanel {
if
(
srettxt
.
evenSts
())
return
;
JLabel
llabel
=
new
JLabel
(
srettxt
.
str
);
Font
f
=
new
Font
(
"Helvetica"
,
Font
.
BOLD
,
24
);
llabel
.
setFont
(
f
);
llabel
.
setFont
(
Jop
.
defFont20
);
this
.
add
(
llabel
);
s
=
sret
.
str
+
".Text"
;
...
...
@@ -102,8 +101,7 @@ public class JopOpWindow extends JPanel {
if
(
srettxt
.
evenSts
())
return
;
llabel
=
new
JLabel
(
srettxt
.
str
);
f
=
new
Font
(
"Helvetica"
,
Font
.
BOLD
,
16
);
llabel
.
setFont
(
f
);
llabel
.
setFont
(
Jop
.
defFont16
);
this
.
add
(
llabel
);
this
.
add
(
new
JSeparator
());
...
...
@@ -313,6 +311,8 @@ public class JopOpWindow extends JPanel {
this
.
session
=
bsession
;
this
.
action
=
name
;
this
.
type
=
btype
;
setFont
(
Jop
.
defFont14
);
setText
(
text
);
setHorizontalTextPosition
(
SwingConstants
.
LEFT
);
this
.
addMouseListener
(
new
MouseAdapter
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment