[libbluray-devel] HText, HIcon: fix default look

hpi1 git at videolan.org
Mon May 2 10:29:59 CEST 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sat Apr 30 17:04:23 2016 +0300| [13dda6f6b3773c0ddc349928bdc8c0ab52364403] | committer: hpi1

HText, HIcon: fix default look

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=13dda6f6b3773c0ddc349928bdc8c0ab52364403
---

 src/libbluray/bdj/java/org/havi/ui/HIcon.java |    9 ++++-----
 src/libbluray/bdj/java/org/havi/ui/HText.java |   22 +++++++++++-----------
 2 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/src/libbluray/bdj/java/org/havi/ui/HIcon.java b/src/libbluray/bdj/java/org/havi/ui/HIcon.java
index f6758d9..53352d3 100644
--- a/src/libbluray/bdj/java/org/havi/ui/HIcon.java
+++ b/src/libbluray/bdj/java/org/havi/ui/HIcon.java
@@ -46,13 +46,11 @@ public class HIcon extends HStaticIcon implements HNavigable {
     }
 
     public static void setDefaultLook(HGraphicLook hlook) {
-        DefaultLook = hlook;
+        BDJXletContext.setXletDefaultLook(PROPERTY_LOOK, hlook);
     }
 
     public static HGraphicLook getDefaultLook() {
-        if (DefaultLook == null)
-            org.videolan.Logger.unimplemented("", "getDefaultLook");
-        return DefaultLook;
+        return (HGraphicLook)BDJXletContext.getXletDefaultLook(PROPERTY_LOOK, DEFAULT_LOOK);
     }
 
     public void setMove(int keyCode, HNavigable target) {
@@ -109,7 +107,8 @@ public class HIcon extends HStaticIcon implements HNavigable {
         Logger.unimplemented("", "");
     }
 
-    private static HGraphicLook DefaultLook = null;
+    static final Class DEFAULT_LOOK = HGraphicLook.class;
+    private static final String PROPERTY_LOOK = HIcon.class.getName();
 
     private static final long serialVersionUID = 2006124827619610922L;
 }
diff --git a/src/libbluray/bdj/java/org/havi/ui/HText.java b/src/libbluray/bdj/java/org/havi/ui/HText.java
index 92dc42f..04bda22 100644
--- a/src/libbluray/bdj/java/org/havi/ui/HText.java
+++ b/src/libbluray/bdj/java/org/havi/ui/HText.java
@@ -26,6 +26,7 @@ import java.awt.Font;
 import org.havi.ui.event.HFocusEvent;
 import org.havi.ui.event.HFocusListener;
 
+import org.videolan.BDJXletContext;
 import org.videolan.Logger;
 
 public class HText extends HStaticText implements HNavigable {
@@ -87,16 +88,6 @@ public class HText extends HStaticText implements HNavigable {
         setTextLayoutManager(tlm);
     }
 
-    public static void setDefaultLook(HTextLook look) {
-        DefaultLook = look;
-    }
-
-    public static HTextLook getDefaultLook() {
-        if (DefaultLook == null)
-            DefaultLook = new HTextLook();
-        return DefaultLook;
-    }
-
     public void setMove(int keyCode, HNavigable target) {
         logger.unimplemented("setMove");
     }
@@ -155,7 +146,16 @@ public class HText extends HStaticText implements HNavigable {
         logger.unimplemented("processHFocusEvent");
     }
 
-    private static HTextLook DefaultLook = null;
+    public static void setDefaultLook(HTextLook hlook) {
+        BDJXletContext.setXletDefaultLook(PROPERTY_LOOK, hlook);
+    }
+
+    public static HTextLook getDefaultLook() {
+        return (HTextLook) BDJXletContext.getXletDefaultLook(PROPERTY_LOOK, DEFAULT_LOOK);
+    }
+
+    static final Class DEFAULT_LOOK = HTextLook.class;
+    private static final String PROPERTY_LOOK = HText.class.getName();
 
     private static final long serialVersionUID = -8178609258303529066L;
 



More information about the libbluray-devel mailing list