Author: jleroux
Date: Sat Oct 17 20:10:34 2009
New Revision: 826303
URL:
http://svn.apache.org/viewvc?rev=826303&view=revLog:
Actually there was no AWT bug. This is fixed in XuiContainer.java.
Note that this works but not the 1st time.
Because it dynamically changes the xpos.properties file but XUI has to load it.
I tried using setPropertyValueInMemory, that I introduced recently for dynamic password changes, but it did not work. I guess XUI would have to reload it, but did not try this way... yet...
So if you want it to work from the start, as for the Language parameter, you have to set it in xpos.properties by hand before launching the OFBiz-POS
Anyway I will rewrite a complete documentation about that and other things.
Modified:
ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Operator.java
Modified: ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java?rev=826303&r1=826302&r2=826303&view=diff==============================================================================
--- ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java (original)
+++ ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java Sat Oct 17 20:10:34 2009
@@ -156,6 +156,9 @@
if (language.compareTo("XuiLabels" + suffix) != 0) {
UtilProperties.setPropertyValue(startupProperties, "Language", "XuiLabels" + suffix);
}
+ if (suffix.equals("zh")) { // TODO maybe needed for other languages using non Latin alphabet
http://en.wikipedia.org/wiki/Alphabet#Types+ UtilProperties.setPropertyValue(startupProperties, "StyleFile", "posstyles" + suffix + ".xml"); // For the moment only a Chinese StyleFile is provided
+ }
frame.setVisible(true);
frame.getContentPane().add(this);
frame.validate();
Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Operator.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Operator.java?rev=826303&r1=826302&r2=826303&view=diff==============================================================================
--- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Operator.java (original)
+++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Operator.java Sat Oct 17 20:10:34 2009
@@ -83,12 +83,7 @@
String fontName = titleStyle.getStyleAsString(XStyle.FONT_FACE);
int fontStyle = titleStyle.getStyleAsInt(XStyle.FONT_WEIGHT);
int fontSize = titleStyle.getStyleAsInt(XStyle.FONT_SIZE);
- Font titleFont = null;
- if (defaultLocale.getLanguage().equals("zh")) { // AWT bug reported at
http://n4.nabble.com/Simplified-Chinese-characters-are-displayed-as-square-boxes-in-POS-td165505.html#a165506- titleFont = new Font(null, fontStyle, fontSize);
- } else {
- titleFont = new Font(fontName, fontStyle, fontSize);
- }
+ Font titleFont = new Font(fontName, fontStyle, fontSize);
Border base = BorderFactory.createEtchedBorder();
TitledBorder border = BorderFactory.createTitledBorder(base, this.getFieldTitle(field.getName()),