Package com.volantis.mcs.layouts

Examples of com.volantis.mcs.layouts.TemporalFormatIterator


     * @throws Exception
     *
     * todo XDIME-CP fix this
     */
    public void notestRenderTemporalFormatIteratorVariable3() throws Exception {
        TemporalFormatIterator temporal = createTemporalFormatIterator();
        temporal.setAttribute(
                TemporalFormatIterator.TEMPORAL_ITERATOR_CLOCK_VALUES, "3");
        temporal.setAttribute(
            TemporalFormatIterator.TEMPORAL_ITERATOR_CELL_COUNT, "0");
        temporal.setAttribute(
            TemporalFormatIterator.TEMPORAL_ITERATOR_CELLS, "variable");
        activateTemporal(temporal);

        createTemporal(getTemporalIteratorFormatRenderer(), temporal);

View Full Code Here


    }

    private TemporalFormatIterator createTemporalFormatIterator()
            throws RepositoryException {

        TemporalFormatIterator temporal =
                new TemporalFormatIterator((CanvasLayout) layout);

        return temporal;
    }
View Full Code Here

        if (!instance.isEmpty()) {
            if (logger.isDebugEnabled()) {
                logger.debug("TemporalFormatIterator.writeOutput");
            }
            TemporalFormatIterator temporal =
                    (TemporalFormatIterator)instance.getFormat();

            // Get the parent index and hang on to it.
            NDimensionalIndex parentIndex = instance.getIndex();
            if (logger.isDebugEnabled()) {
                logger.debug("Parent index is " + parentIndex);
            }

            // Get this temporal format iterator's properties
            IteratorSizeConstraint cellConstraint =
                    temporal.getMaxCellConstraint();

            int elements;
            // Determine no. of elements to render
            if (cellConstraint.isFixed()) {
                elements = cellConstraint.getMaximumValue();
            } else {
                // Get maximum number of cells to be rendered.
                IteratedFormatInstanceCounter instanceCounter =
                        context.getInstanceCounter();
                int cells = instanceCounter.getMaxInstances(
                        temporal, parentIndex);
                if (logger.isDebugEnabled()) {
                    logger.debug("cells=" + cells);
                }

                elements = cellConstraint.getConstrained(cells);
            }

            SlideAttributes attributes = factory.createSlideAttributes();
            String timeValues = (String) temporal.getAttribute(
                    TemporalFormatIterator.TEMPORAL_ITERATOR_CLOCK_VALUES);

            // If this is a space or (for backwards-compatibility) a comma
            // separated list of time values stick 'em into an array
            String timeValueArray[];
            String separator = null;

            if (timeValues.indexOf(',') > -1) {
                separator = ",";
            } else if (timeValues.indexOf(' ') > -1) {
                separator = " ";
            }

            if (separator != null) {
                StringTokenizer st = new StringTokenizer(timeValues,
                                                         separator);
                int index = 0;
                timeValueArray = new String[st.countTokens()];
                while (st.hasMoreTokens()) {
                    timeValueArray[index++] = st.nextToken();
                }
            } else {
                timeValueArray = new String[]{timeValues};
            }

            NDimensionalIndex childIndex = parentIndex.addDimension();

            // Get the module.
            LayoutModule module = context.getLayoutModule();

            // Retrieve the TemporalIterator's child and ensure that it
            // only has a single child.
            int numChildren = temporal.getNumChildren();
            if (numChildren != 1) {
                throw new RendererException(exceptionLocalizer.format(
                        "render-temporal-iterator-multiple-children"));
            }
            Format child = temporal.getChildAt(0);

            // Use the open/closeSlide method in the protocols to create
            // the slide. Visit each child and then close the slide. Do
            // this temporal.TEMPORAL_ITERATOR_CELL_COUNT times to generate
            // the slides
View Full Code Here

TOP

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

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.