Package com.volantis.mcs.layouts

Examples of com.volantis.mcs.layouts.Format


        while(iterator.hasNext()) {
            FormatType type = (FormatType) iterator.next();
            Class formatClass = type.getFormatClass();

            Format format = null;
            // Try initialising with a canvas layout first.
            Class[] argTypes;
            argTypes = new Class[] { CanvasLayout.class };
            try {
                Constructor constructor = formatClass.getConstructor(argTypes);
View Full Code Here


            boolean finished = false;
            Iterator iterator = elementNames.iterator();
            while (!finished && iterator.hasNext()) {
                String element = (String) iterator.next();

                Format format = findFormat(element);
                if (format != null) {
                    // We have found a format so obtain its attributes and
                    // update the intersection list accordingly.
                    List attributeList = Arrays.asList(format.getUserAttributes());
                    intersection = updateIntersection(intersection, attributeList);
                } else {
                    // No format found so determine whether this is a grid row
                    // or grid column element. If it is then update the intersection
                    // accordingly. If it isn't then the intersection must be
View Full Code Here

     *
     * @param element the element name to match with a format's element name.
     * @return the found format, or null if not found.
     */
    private Format findFormat(String element) {
        Format result = null;
        if (element != null) {
            Iterator iterator = formats.iterator();
            while (iterator.hasNext() && result == null) {
                Format format = (Format) iterator.next();
                if (element.equals(format.getFormatType().getElementName())) {
                    result = format;
                }
            }
        }
        return result;
View Full Code Here

            int[] userIndeces,
            FormatNamespace namespace) {

        NDimensionalIndex index = NDimensionalIndex.ZERO_DIMENSIONS;

        Format format = context.getFormat(stem, namespace);

        if (format != null) {
            int dims = format.getDimensions();
            int[] indeces;
            int limit = Math.min(dims, userIndeces.length);
            indeces = new int[dims];
            System.arraycopy(userIndeces, 0, indeces, 0, limit);
View Full Code Here

     * @param name      the name of the format to retrieve
     * @param namespace the namespace of format to retreive
     * @return the format.
     */
    public Format getFormat(String name, FormatNamespace namespace) {
        Format format = null;
        FormatScope formatScope = getFormatScope();
        if (formatScope != null) {
            format = formatScope.retrieveFormat(name, namespace);
        }

View Full Code Here

            throws RendererException {
        try {
            if (!instance.isEmpty()) {
                Form form = (Form)instance.getFormat();

                Format child = form.getChildAt(0);

                // If there is no child then there is nothing to write.
                if (child == null) {
                    return;
                }
View Full Code Here

                    if (cachingDirectives != null) {
                        cachingDirectives.disable();
                    }

                    Fragment fragment = (Fragment)instance.getFormat();
                    Format child = fragment.getChildAt(0);

                    // If there is no child then there is nothing to write,
                    // not even a link.
                    if (child == null) {
                        return;
View Full Code Here

        // is null because otherwise the grid will be
        // misaligned.

        module.writeOpenGridChild(childAttributes);

        Format child = grid.getChildAt(row, column);

        if (child != null) {
            FormatInstance childInstance =
                    context.getFormatInstance(
                            child, gridInstance.getIndex());
View Full Code Here

    public void render(final FormatRendererContext context, final FormatInstance instance)
            throws RendererException {
        try {
            if (!instance.isEmpty()) {
                Replica replica = (Replica)instance.getFormat();
                Format replicaFormat = replica.getFormat();

                if (logger.isDebugEnabled()) {
                    logger.debug("Rendering replicant format " +
                            replicaFormat.getFormatType());
                }

                if (replicaFormat == null) {
                    throw new IOException(exceptionLocalizer.format(
                            "render-replica-no-replicant", replica));
View Full Code Here

                // Write out children
                int index;
                for (int r = 0; r < rows; r += 1) {
                    for (int c = 0; c < columns; c += 1) {
                        index = r * columns + c;
                        Format child = grid.getChildAt(index);
                        if (child != null) {
                            FormatInstance childInstance =
                                    context.getFormatInstance(child,
                                            instance.getIndex());
                            context.renderFormat(childInstance);
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.