aboutsummaryrefslogtreecommitdiffstats
path: root/demos/effect/show.html
Commit message (Collapse)AuthorAgeFilesLines
* Demos: Add device-width viewport meta to all demosJörn Zaefferer2015-09-301-0/+1
| | | | Ref 343c2651729af2fdf020dd538fce0855785f5a0d
* Effects: Style updatesAlexander Schmitz2015-08-211-3/+3
| | | | | Ref #14246 Ref gh-1588
* Effects: Update demos to use AMDAlexander Schmitz2015-07-211-19/+2
| | | | Ref #10119
* Effects: Remove core event/alias and deprecated module dependenciesAlexander Schmitz2015-05-201-1/+1
|
* Effects: RewriteMike Sherov2014-12-101-2/+4
| | | | | | | | | | | | | | | | | | 1. Introduces a set of helper methods to easily create and define new effects. 2. Uses clip animations and placeholders instead of wrappers for clip effects. 3. Ensures all animations are detectable as animated Fixes #10599 Fixes #9477 Fixes #9257 Fixes #9066 Fixes #8867 Fixes #8671 Fixes #8505 Fixes #7885 Fixes #7041 Closes gh-1017
* Effects Demos: Fix typeErrors on puff and size demosMike Sherov2014-09-101-0/+2
|
* Build: Reorganize external directoryScott González2014-06-241-1/+1
| | | | | | | Put each external library into its own directory. Move jquery.js to external. Ref gh-1266
* Button demo: Replace anchors with more appropriate buttonsJörn Zaefferer2014-04-241-2/+1
|
* All: Rename jquery.js to exclude version in filenameJörn Zaefferer2014-03-051-1/+1
|
* All: Rename all files, removing the "jquery.ui." prefix;Rafael Xavier de Souza2014-01-241-13/+13
| | | | | | | - By executing https://gist.github.com/jzaefferer/893fcf70b7eebc1dc271; Fixes #9464 Closes gh-1029
* Updating jQuery to 1.10.2.Bruno M. Custódio2013-07-051-1/+1
| | | | | Adding jQuery 1.10.0, 1.10.1, 1.10.2, 2.0.0, 2.0.1, 2.0.2 and 2.0.3 to the tests directory.
* Effects (core): Unite demos into the same single effect/ pathRafael Xavier de Souza2013-06-221-0/+97
ld } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* $Id$ */
 
package org.apache.fop.pdf;

import java.io.IOException;

/**
 * This class is serves as a factory from
 */
public class StreamCacheFactory {

    private static boolean defaultCacheToFile = false;
    private static StreamCacheFactory fileInstance = null;
    private static StreamCacheFactory memoryInstance = null;

    private boolean cacheToFile = false;
    
    /**
     * Returns an instance of a StreamCacheFactory with the requested features.
     * @param cacheToFile True if file shall be cached using a temporary file
     * @return StreamCacheFactory the requested factory
     */
    public static StreamCacheFactory getInstance(boolean cacheToFile) {
        if (cacheToFile) {
            if (fileInstance == null) {
                fileInstance = new StreamCacheFactory(true);
            }
            return fileInstance;
        } else {
            if (memoryInstance == null) {
                memoryInstance = new StreamCacheFactory(false);
            }
            return memoryInstance;
        }
    }
    
    /**
     * Returns an instance of a StreamCacheFactory depending on the default
     * setting for cacheToFile.
     * @return StreamCacheFactory the requested factory
     */
    public static StreamCacheFactory getInstance() {
        return getInstance(defaultCacheToFile);
    }
    
    /**
     * Sets the global default for cacheToFile
     * @param cacheToFile True if stream caches should be held in files.
     */
    public static void setDefaultCacheToFile(boolean cacheToFile) {
        defaultCacheToFile = cacheToFile;
    }

    /**
     * Creates a new StreamCacheFactory.
     * @param cacheToFile True if file shall be cached using a temporary file
     */
    public StreamCacheFactory(boolean cacheToFile) {
        this.cacheToFile = cacheToFile;
    }
    
    /**
     * Get the correct implementation (based on cacheToFile) of
     * StreamCache.
     * @throws IOException if there is an IO error
     * @return a new StreamCache for caching streams
     */
    public StreamCache createStreamCache() throws IOException {
        if (this.cacheToFile) {
            return new TempFileStreamCache();
        } else {
            return new InMemoryStreamCache();
        }
    }
    
    /**
     * Get the correct implementation (based on cacheToFile) of
     * StreamCache.
     * @param hintSize a hint about the approximate expected size of the buffer
     * @throws IOException if there is an IO error
     * @return a new StreamCache for caching streams
     */
    public StreamCache createStreamCache(int hintSize) throws IOException {
        if (this.cacheToFile) {
            return new TempFileStreamCache();
        } else {
            return new InMemoryStreamCache(hintSize);
        }
    }
    
    /**
     * Get the value of the global cacheToFile flag.
     * @return the current cache to file flag
     */
    public boolean getCacheToFile() {
        return this.cacheToFile;
    }
    

}