Main.java
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;
import java.awt.Graphics;
import javax.tv.xlet.Xlet;
import javax.tv.xlet.XletContext;
import org.bluray.storage.DataAreaInfo;
import org.bluray.storage.StorageManager;
import org.havi.ui.HScene;
import org.havi.ui.HSceneFactory;
import org.havi.ui.HScreen;
public class Main extends Container implements Xlet{
int x = 100, y = 100;
public void initXlet(XletContext xc){
try {
Font font = new Font(null, java.awt.Font.BOLD, 48);
HScene hs= HSceneFactory.getInstance().getFullScreenScene(
HScreen.getDefaultHScreen().getDefaultHGraphicsDevice());
hs.setFont(font);
hs.setVisible(true);
Graphics g = hs.getGraphics();
g.setColor(Color.white);
// StorageManagerを取得
StorageManager sm = StorageManager.getInstance();
// BUDAおよびADAのDataAreaInfoを取得
DataAreaInfo BudaI = sm.getBindingunitDataAreaInfo();
DataAreaInfo AdaI = sm.getPersistentDataAreaInfo();
g.drawString("BUDA free/total[byte]: "+BudaI.getFreeSpace()+" / "+BudaI.getTotalSpace(), x, y); y+=50;
g.drawString("ADA free/total[byte]: "+AdaI.getFreeSpace()+" / "+AdaI.getTotalSpace(), x, y); y+=50;
} catch (Exception e){
}
}
public void startXlet(){}
public void pauseXlet(){ }
public void destroyXlet(boolean unconditional){ }
}