Search in sources :

Example 6 with LimelightException

use of limelight.LimelightException in project limelight by slagyr.

the class ScenePanel method addToIndex.

public void addToIndex(PropPanel prop) {
    PropPanel value = index.get(prop.getId());
    if (value != null && value != prop)
        throw new LimelightException("Duplicate id: " + prop.getId());
    index.put(prop.getId(), prop);
}
Also used : LimelightException(limelight.LimelightException)

Example 7 with LimelightException

use of limelight.LimelightException in project limelight by slagyr.

the class Packer method pack.

public void pack(String productionPath, String llpName) {
    try {
        DirectoryZipper zipper = DirectoryZipper.fromDir(productionPath);
        if (llpName == null)
            llpName = zipper.getProductionName();
        OutputStream output = Context.fs().outputStream(llpName + ".llp");
        zipper.zipTo(output);
    } catch (Exception e) {
        throw new LimelightException("Failed to pack production: " + productionPath, e);
    }
}
Also used : OutputStream(java.io.OutputStream) LimelightException(limelight.LimelightException) LimelightException(limelight.LimelightException)

Example 8 with LimelightException

use of limelight.LimelightException in project limelight by slagyr.

the class JavaPlayer method addEventActionFor.

public void addEventActionFor(Object player, String eventPrefix, String eventName, String methodName, EventHandler eventHandler) {
    String eventClassName = eventPrefix + StringUtil.capitalCamelCase(eventName.substring(2)) + "Event";
    if ("limelight.ui.events.panel.CastEvent".equals(eventClassName))
        return;
    Class<? extends Event> eventClass;
    try {
        eventClass = (Class<? extends Event>) Class.forName(eventClassName);
    } catch (Exception e) {
        throw new LimelightException(e);
    }
    if (eventClass == null)
        return;
    Method eventMethod = findMethod(methodName);
    final JavaEventAction action = new JavaEventAction(player, eventMethod);
    eventHandler.add(eventClass, action);
}
Also used : Method(java.lang.reflect.Method) LimelightException(limelight.LimelightException) LimelightException(limelight.LimelightException)

Example 9 with LimelightException

use of limelight.LimelightException in project limelight by slagyr.

the class ImagePanel method getImage.

public Image getImage() {
    if (image == null && filename != null && filename.trim().length() > 0) {
        try {
            Scene rootPanel = getRoot();
            if (rootPanel != null && filename != null) {
                ImageCache imageCache = rootPanel.getImageCache();
                setImage(imageCache.getImage(filename));
            }
        } catch (Exception e) {
            throw new LimelightException("Could not load image: " + filename + " (" + e.toString() + ")");
        }
    }
    return image;
}
Also used : LimelightException(limelight.LimelightException) LimelightException(limelight.LimelightException)

Example 10 with LimelightException

use of limelight.LimelightException in project limelight by slagyr.

the class Downloader method download.

public String download(String resource) {
    try {
        URL url = parseURL(resource);
        URLConnection urlConnection = url.openConnection();
        String destination = calculateDesintationFile(url, urlConnection);
        downloadData(urlConnection, destination);
        return destination;
    } catch (Exception e) {
        throw new LimelightException("Failed to download resource: " + e.toString(), e);
    }
}
Also used : URL(java.net.URL) URLConnection(java.net.URLConnection) MalformedURLException(java.net.MalformedURLException) LimelightException(limelight.LimelightException) LimelightException(limelight.LimelightException)

Aggregations

LimelightException (limelight.LimelightException)20 Test (org.junit.Test)2 InputStream (java.io.InputStream)1 OutputStream (java.io.OutputStream)1 Method (java.lang.reflect.Method)1 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 URLConnection (java.net.URLConnection)1 ZipOutputStream (java.util.zip.ZipOutputStream)1 FakePropProxy (limelight.model.api.FakePropProxy)1 RichStyle (limelight.styles.RichStyle)1 Style (limelight.styles.Style)1 AutoDimensionValue (limelight.styles.values.AutoDimensionValue)1 GreedyDimensionValue (limelight.styles.values.GreedyDimensionValue)1 MockStage (limelight.ui.model.MockStage)1 Box (limelight.util.Box)1