コード例 #1
0
 public String getBackgroundImage() {
   String sURI = null;
   RenderHotspot oRender = QTIUtil.getRenderHotspot((Item) getBeanObject());
   if (oRender != null) {
     Material oMaterial = QTIUtil.getFirstMaterial(oRender);
     if (oMaterial != null) {
       Matimage oMat = QTIUtil.getMatimage(oMaterial);
       if (oMat != null) {
         sURI = oMat.getURI();
       }
     }
   }
   return sURI;
 }
コード例 #2
0
 protected void setBackgroundImage(Item oItem, String sURI, int iWidth, int iHeight) {
   RenderHotspot oRender = QTIUtil.getRenderHotspot(oItem);
   if (oRender != null && sURI != null) {
     Material oMaterial = QTIUtil.getFirstMaterial(oRender);
     if (oMaterial != null) {
       Matimage oMat = QTIUtil.getMatimage(oMaterial);
       if (oMat != null) {
         oMat.setURI(sURI);
         oMat.setWidth(iWidth);
         oMat.setHeight(iHeight);
       }
     } else {
       oMaterial = Material.createWithMatimage(null, sURI, iWidth, iHeight);
       oRender.addMaterial(oMaterial);
       oRender.setObjectPosition(
           oRender.getContents(), oMaterial, oRender.getContentPosition(oMaterial), 0);
     }
   }
 }