Package com.volantis.mcs.layouts

Examples of com.volantis.mcs.layouts.Format


         */
        private void validateLayout(Pane pane, int paneWidth, int paneHeight)
        {
            // MMS/SMIL layouts must consist of either two rows and one column,
            // or one row and two columns, or a single pane.
            Format parent = pane.getParent();

            if (parent != null)
            {
                FormatType formatType = parent.getFormatType();
                if (FormatType.GRID.equals(formatType))
                {
                    Grid grid = (Grid)parent;
                    int rows = grid.getRows();
                    int columns = grid.getColumns();
View Full Code Here


        if (attributes.getColumns() >= 2) {
            Element element = dom.openStyledElement("table", attributes,
                    DisplayKeywords.TABLE);

            // The format may be a SpatialFormatIterator.
            Format format = attributes.getFormat();
            if (format instanceof Grid) {

                // NB: We do not need to set the column attribute because it
                // will be resolved and added in the associated transformer

                Grid grid = (Grid) format;

                StringBuffer alignValues = new StringBuffer();
                int numCols = grid.getColumns();
                for (int i = 0; i < numCols; i++) {
                    // All the children must be a Panes since the assoicated
                    // format has no grid children
                    Format childPane = grid.getChildAt(i);

                    // If the layout is incomplete then the childPane could be
                    // null
                    if (childPane != null) {
                        String hAlign = childPane.getHorizontalAlignment();

                        if (FormatConstants.HORIZONTAL_ALIGNMENT_VALUE_CENTER
                                .equals(
                                        hAlign)) {
                            alignValues.append('C');
View Full Code Here

            StyleFormatReference styleFormatReference =
                    (StyleFormatReference) container;
            FormatReference reference = styleFormatReference.getReference();

            // Try and find the format instance.
            Format format = pageContext.getFormat(reference.getStem(),
                    FormatNamespace.CONTAINER);
            if (format != null) {
                instance = (ContainerInstance) pageContext.getFormatInstance(
                        format, reference.getIndex());
            }

        } else if (containerName != null) {

            final ContainerInstance currentContainer =
                pageContext.getCurrentContainerInstance();
            if (specifiedLayout == null && currentContainer != null &&
                containerName.equals(currentContainer.getFormat().getName())) {
                // if no new layout is specified and the container name is the
                // same as the name of the current container then we can use the
                // current container
                specifiedCurrentContainer = true;
            } else {
                DeviceLayoutContext layoutContext = specifiedLayout;
                if (layoutContext == null) {
                    // If none was specified, then try and find the format in
                    // the current layout.
                    layoutContext = pageContext.getDeviceLayoutContext();
                }
                Format format = layoutContext.getFormat(containerName,
                        FormatNamespace.CONTAINER);

                if (format != null) {
                    int dimensions = format.getDimensions();
                    NDimensionalIndex index;
                    if (dimensions > 0) {
                        int[] indeces = new int[dimensions];
                        index = new NDimensionalIndex(indeces);
                    } else {
View Full Code Here

                             + name + " to the page");

                // Write the format tree

            }
            Format root = deviceLayout.getRootFormat();
            if (root != null) {
                FormatInstance rootInstance =
                        formatRendererContext.getFormatInstance(
                                root, index);
                formatRendererContext.renderFormat(rootInstance);
View Full Code Here

        FragmentLinkWriter fragmentLinkWriter =
                context.getFragmentLinkWriter();

        // Walk through the children of the parent (our peers)
        Format parent = fragment.getParent();
        if (parent != null) {
            int numChildren = parent.getNumChildren();
            if (logger.isDebugEnabled()) {
                logger.debug("Searching " + numChildren + " peers");
            }
            for (int child = 0; child < numChildren; child++) {
                // Check if the peer is a fragment
                Format peer = parent.getChildAt(child);
                if (logger.isDebugEnabled()) {
                    logger.debug("Found peer " + peer);
                }
                if ((peer != null)
                        && peer.getFormatType().equals(FormatType.FRAGMENT)) {
                    Fragment peerFragment = (Fragment) peer;
                    // Dont write to ourselves
                    if (!peerFragment.getName().equals(fragment.getName())) {
                        if (logger.isDebugEnabled()) {
                            logger.debug("Adding link to peer fragment"
View Full Code Here

        setDefaultFragment(layout);

        // Activate all the formats.
        FormatActivatorFactoryImpl factory = new FormatActivatorFactoryImpl();
        FormatActivator activator = new RecursingFormatActivatorImpl(factory);
        Format rootFormat = layout.getRootFormat();
        activator.activate(rootFormat);

        // create container name -> {fragment, index} map
        final Map containerNameToFragments =
            buildContainerNameToPositionMap(rootFormat);
View Full Code Here

        String retVal = null;
        if (null != format) {
            if (!(format instanceof Fragment)) {
                int x = format.getNumChildren();
                for (int y = 0; y < x; y++) {
                    Format childFormat = format.getChildAt(y);
                    retVal = getFirstFragment(childFormat);
                    if (retVal != null) {
                        break;
                    }
                }
View Full Code Here

                return false;
            }
        };

        Format root = layout.getRootFormat();
        if (root != null) {
            try {
                root.visit(visitor, null);
            } catch (FormatVisitorException e) {
                throw new UndeclaredThrowableException(e);
            }
        }
View Full Code Here

        }
        if (postambleBuffer != null && !postambleBuffer.isEmpty()) {
            return false;
        }

        Format child = form.getChildAt(0);
        if (child != null) {
            return context.isFormatEmpty(child);
        }

        return true;
View Full Code Here

    protected boolean isEmptyImpl() {

        FormFragment currentFragment = context.getCurrentFormFragment();
        FormFragment fragment = (FormFragment) format;

        Format child = fragment.getChildAt(0);

        if (child != null) {
            if (currentFragment == null || fragment == currentFragment) {
                return context.isFormatEmpty(child);
            } else {
View Full Code Here

TOP

Related Classes of com.volantis.mcs.layouts.Format

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.