Search in sources :

Example 6 with SMILRegionElement

use of org.w3c.dom.smil.SMILRegionElement in project android-aosp-mms by slvn.

the class SmilHelper method setRegion.

private static boolean setRegion(SMILRegionMediaElement srme, ArrayList<SMILRegionElement> smilRegions, SMILLayoutElement smilLayout, String regionId, boolean regionPresentInLayout) {
    SMILRegionElement smilRegion = findRegionElementById(smilRegions, regionId);
    if (!regionPresentInLayout && smilRegion != null) {
        srme.setRegion(smilRegion);
        smilLayout.appendChild(smilRegion);
        return true;
    }
    return false;
}
Also used : SMILRegionElement(org.w3c.dom.smil.SMILRegionElement)

Example 7 with SMILRegionElement

use of org.w3c.dom.smil.SMILRegionElement in project android-aosp-mms by slvn.

the class SmilRegionMediaElementImpl method getRegion.

public SMILRegionElement getRegion() {
    if (mRegion == null) {
        SMILDocument doc = (SMILDocument) this.getOwnerDocument();
        NodeList regions = doc.getLayout().getElementsByTagName("region");
        SMILRegionElement region = null;
        for (int i = 0; i < regions.getLength(); i++) {
            region = (SMILRegionElement) regions.item(i);
            if (region.getId().equals(this.getAttribute("region"))) {
                mRegion = region;
            }
        }
    }
    return mRegion;
}
Also used : SMILDocument(org.w3c.dom.smil.SMILDocument) NodeList(org.w3c.dom.NodeList) SMILRegionElement(org.w3c.dom.smil.SMILRegionElement)

Example 8 with SMILRegionElement

use of org.w3c.dom.smil.SMILRegionElement in project qksms by moezbhatti.

the class SmilRegionMediaElementImpl method getRegion.

public SMILRegionElement getRegion() {
    if (mRegion == null) {
        SMILDocument doc = (SMILDocument) this.getOwnerDocument();
        NodeList regions = doc.getLayout().getElementsByTagName("region");
        SMILRegionElement region = null;
        for (int i = 0; i < regions.getLength(); i++) {
            region = (SMILRegionElement) regions.item(i);
            if (region.getId().equals(this.getAttribute("region"))) {
                mRegion = region;
            }
        }
    }
    return mRegion;
}
Also used : SMILDocument(org.w3c.dom.smil.SMILDocument) NodeList(org.w3c.dom.NodeList) SMILRegionElement(org.w3c.dom.smil.SMILRegionElement)

Example 9 with SMILRegionElement

use of org.w3c.dom.smil.SMILRegionElement in project Signal-Android by WhisperSystems.

the class SmilUtil method getRegion.

private static SMILRegionElement getRegion(SMILDocument document, PduPart part) {
    if (PartParser.isAudio(part))
        return null;
    SMILRegionElement region = (SMILRegionElement) document.createElement("region");
    if (PartParser.isText(part)) {
        region.setId("Text");
        region.setTop(SmilUtil.ROOT_HEIGHT);
        region.setHeight(50);
    } else {
        region.setId("Image");
        region.setTop(0);
        region.setHeight(SmilUtil.ROOT_HEIGHT);
    }
    region.setLeft(0);
    region.setWidth(SmilUtil.ROOT_WIDTH);
    region.setFit("meet");
    return region;
}
Also used : SMILRegionElement(org.w3c.dom.smil.SMILRegionElement)

Example 10 with SMILRegionElement

use of org.w3c.dom.smil.SMILRegionElement in project qksms by moezbhatti.

the class MediaModelFactory method getRegionMediaModel.

private static MediaModel getRegionMediaModel(Context context, String tag, String src, SMILRegionMediaElement srme, LayoutModel layouts, PduPart part) throws IOException, MmsException {
    SMILRegionElement sre = srme.getRegion();
    if (sre != null) {
        RegionModel region = layouts.findRegionById(sre.getId());
        if (region != null) {
            return getGenericMediaModel(context, tag, src, srme, part, region);
        }
    } else {
        String rId;
        if (tag.equals(SmilHelper.ELEMENT_TAG_TEXT)) {
            rId = LayoutModel.TEXT_REGION_ID;
        } else {
            rId = LayoutModel.IMAGE_REGION_ID;
        }
        RegionModel region = layouts.findRegionById(rId);
        if (region != null) {
            return getGenericMediaModel(context, tag, src, srme, part, region);
        }
    }
    throw new IllegalArgumentException("Region not found or bad region ID.");
}
Also used : SMILRegionElement(org.w3c.dom.smil.SMILRegionElement)

Aggregations

SMILRegionElement (org.w3c.dom.smil.SMILRegionElement)13 SMILDocument (org.w3c.dom.smil.SMILDocument)8 NodeList (org.w3c.dom.NodeList)5 SMILElement (org.w3c.dom.smil.SMILElement)5 SMILLayoutElement (org.w3c.dom.smil.SMILLayoutElement)5 SMILMediaElement (org.w3c.dom.smil.SMILMediaElement)5 SMILParElement (org.w3c.dom.smil.SMILParElement)5 SMILRootLayoutElement (org.w3c.dom.smil.SMILRootLayoutElement)5 ArrayList (java.util.ArrayList)4 SMILRegionMediaElement (org.w3c.dom.smil.SMILRegionMediaElement)3 SmilDocumentImpl (com.android.mms.dom.smil.SmilDocumentImpl)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 IOException (java.io.IOException)2 UnsupportContentTypeException (com.android.mms.UnsupportContentTypeException)1 UnsupportContentTypeException (com.moez.QKSMS.UnsupportContentTypeException)1 SmilDocumentImpl (org.thoughtcrime.securesms.dom.smil.SmilDocumentImpl)1 PduPart (ws.com.google.android.mms.pdu.PduPart)1