Search in sources :

Example 1 with LimelightException

use of limelight.LimelightException in project limelight by slagyr.

the class RubyProduction method spawnRubyRuntime.

private void spawnRubyRuntime() {
    SpawnRubyThread spawnThread = new SpawnRubyThread(newProductionSrc, id);
    spawnThread.production = this;
    spawnThread.start();
    try {
        spawnThread.join();
        if (spawnThread.error != null)
            throw spawnThread.error;
        else if (spawnThread.proxy != null) {
            rubyRuntime = spawnThread.ruby;
            rubies.put(id, rubyRuntime);
            setProxy(spawnThread.proxy);
        } else {
            spawnThread.ruby.tearDown();
            spawnThread = null;
            gc();
        }
    } catch (Exception e) {
        throw new LimelightException("Failed to start JRuby Runtime", e);
    } finally {
        if (spawnThread != null)
            spawnThread.clear();
    }
}
Also used : LimelightException(limelight.LimelightException) LimelightException(limelight.LimelightException)

Example 2 with LimelightException

use of limelight.LimelightException in project limelight by slagyr.

the class Animation method update.

public void update() {
    makeupMissedUpdates();
    timer.markTime();
    try {
        doUpdate();
    } catch (Exception e) {
        stop();
        throw new LimelightException("Animation Cancelled", e);
    }
}
Also used : LimelightException(limelight.LimelightException) LimelightException(limelight.LimelightException)

Example 3 with LimelightException

use of limelight.LimelightException in project limelight by slagyr.

the class Studio method downloadLll.

private String downloadLll(String productionPath) {
    try {
        String url = fs.readTextFile(productionPath).trim();
        Log.debug("Studio - downloading production: " + url);
        String result = Downloader.get(url);
        return unpackLlp(result);
    } catch (Exception e) {
        throw new LimelightException("Failed to download or unpack .lll: " + productionPath, e);
    }
}
Also used : LimelightException(limelight.LimelightException) LimelightException(limelight.LimelightException)

Example 4 with LimelightException

use of limelight.LimelightException in project limelight by slagyr.

the class Theater method add.

public void add(Stage stage) {
    Log.info("Theater - adding stage: '" + stage.getName() + "'");
    if (get(stage.getName()) != null)
        throw new LimelightException("Duplicate stage name: '" + stage.getName() + "'");
    stages.add(stage);
    stage.getEventHandler().add(StageActivatedEvent.class, ActivateStageAction.instance);
    stage.getEventHandler().add(StageDeactivatedEvent.class, DeactivateStageAction.instance);
    stage.getEventHandler().add(StageClosedEvent.class, StageClosedAction.instance);
    stage.setTheater(this);
}
Also used : LimelightException(limelight.LimelightException)

Example 5 with LimelightException

use of limelight.LimelightException in project limelight by slagyr.

the class PropPanelLayout method snapToSize.

public void snapToSize(PropPanel panel) {
    if (// can happen if removed from tree
    panel.getParent() == null)
        return;
    Box maxArea = panel.getParent().getChildConsumableBounds();
    Style style = panel.getStyle();
    if (style.getCompiledWidth() instanceof AutoDimensionValue && style.getCompiledHeight() instanceof GreedyDimensionValue)
        throw new LimelightException("A greedy height is not allowed with auto width.");
    int newWidth = style.getCompiledWidth().calculateDimension(maxArea.width, style.getCompiledMinWidth(), style.getCompiledMaxWidth(), panel.greediness.width);
    int newHeight = style.getCompiledHeight().calculateDimension(maxArea.height, style.getCompiledMinHeight(), style.getCompiledMaxHeight(), panel.greediness.height);
    // TODO MDM - Hacky Hack!!!!  More thought needs to go into the way layouts are down and how greedy fits into it all
    //    if(topLevel && style.getCompiledWidth() instanceof GreedyDimensionValue && panel.getWidth() > newWidth)
    //      newWidth = panel.getWidth();
    //    if(topLevel && style.getCompiledHeight() instanceof GreedyDimensionValue && panel.getHeight() > newHeight)
    //      newHeight = panel.getHeight();
    panel.setSize(newWidth, newHeight);
    panel.resetPendingSizeChange();
}
Also used : Style(limelight.styles.Style) Box(limelight.util.Box) AutoDimensionValue(limelight.styles.values.AutoDimensionValue) GreedyDimensionValue(limelight.styles.values.GreedyDimensionValue) 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