Commit 1392ed8c authored by Ian Curtis's avatar Ian Curtis Committed by hpi1

HStaticText, HStaticIcon: properly store default look

parent ecf92f71
......@@ -20,6 +20,7 @@
package org.havi.ui;
import java.awt.Image;
import org.videolan.BDJXletContext;
public class HStaticIcon extends HVisible implements HNoInputPreferred {
public HStaticIcon()
......@@ -41,25 +42,23 @@ public class HStaticIcon extends HVisible implements HNoInputPreferred {
public void setLook(HLook hlook) throws HInvalidLookException
{
if ((hlook != null) && !(hlook instanceof HGraphicLook)) throw new HInvalidLookException();
if ((hlook != null) && !(hlook instanceof HGraphicLook)) {
throw new HInvalidLookException();
}
super.setLook(hlook);
}
public static void setDefaultLook(HGraphicLook hlook)
{
//TODO double check this
DefaultLook = hlook;
BDJXletContext.setXletDefaultLook(PROPERTY_LOOK,hlook);
}
public static HGraphicLook getDefaultLook()
{
//TODO and this
if (DefaultLook == null)
org.videolan.Logger.unimplemented("", "getDefaultLook");
return DefaultLook;
return (HGraphicLook) BDJXletContext.getXletDefaultLook(PROPERTY_LOOK,DEFAULT_LOOK);
}
private static HGraphicLook DefaultLook = null;
private static final String PROPERTY_LOOK = "HStaticIcon";
static final Class DEFAULT_LOOK = HGraphicLook.class;
private static final long serialVersionUID = 2015589998794748072L;
}
......@@ -23,6 +23,7 @@ package org.havi.ui;
import java.awt.Color;
import java.awt.Font;
import org.videolan.BDJXletContext;
import org.videolan.Logger;
public class HStaticText extends HVisible implements HNoInputPreferred {
......@@ -74,19 +75,16 @@ public class HStaticText extends HVisible implements HNoInputPreferred {
public static void setDefaultLook(HTextLook hlook)
{
DefaultLook = hlook;
BDJXletContext.setXletDefaultLook(PROPERTY_LOOK,hlook);
}
public static HTextLook getDefaultLook()
{
if (DefaultLook == null)
DefaultLook = new HTextLook();
return DefaultLook;
return (HTextLook) BDJXletContext.getXletDefaultLook(PROPERTY_LOOK,DEFAULT_LOOK);
}
private static HTextLook DefaultLook = null;
static final Class DEFAULT_LOOK = HGraphicLook.class;
private static final String PROPERTY_LOOK = HStaticText.class.getName();
private static final Logger logger = Logger.getLogger(HStaticText.class.getName());
private static final long serialVersionUID = 4352450387189482885L;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment