Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added image player. sized incompatiable production alert. tweaked san…
…dbox scenes
- Loading branch information
Showing
11 changed files
with
164 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<player class="limelight.builtin.players.Image"> | ||
<onCast>install</onCast> | ||
</player> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package limelight.builtin.players; | ||
|
||
import limelight.ui.events.panel.PanelEvent; | ||
import limelight.ui.model.ImagePanel; | ||
import limelight.ui.model.PropPanel; | ||
|
||
public class Image | ||
{ | ||
private PropPanel propPanel; | ||
private ImagePanel imagePanel; | ||
|
||
public void install(PanelEvent event) | ||
{ | ||
imagePanel = new ImagePanel(); | ||
propPanel = (PropPanel) event.getRecipient(); | ||
propPanel.add(imagePanel); | ||
propPanel.getStagehands().put("image", this); | ||
} | ||
|
||
public PropPanel getPropPanel() | ||
{ | ||
return propPanel; | ||
} | ||
|
||
public ImagePanel getImagePanel() | ||
{ | ||
return imagePanel; | ||
} | ||
|
||
public void setFilename(String path) | ||
{ | ||
imagePanel.setFilename(path); | ||
} | ||
|
||
public String getFilename() | ||
{ | ||
return imagePanel.getFilename(); | ||
} | ||
|
||
public void setRotation(double angle) | ||
{ | ||
imagePanel.setRotation(angle); | ||
} | ||
|
||
public double getRotation() | ||
{ | ||
return imagePanel.getRotation(); | ||
} | ||
|
||
public boolean isScaled() | ||
{ | ||
return imagePanel.isScaled(); | ||
} | ||
|
||
public void setScaled(boolean value) | ||
{ | ||
imagePanel.setScaled(value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package limelight.builtin.players; | ||
|
||
import limelight.model.api.FakePropProxy; | ||
import limelight.ui.events.panel.CastEvent; | ||
import limelight.ui.model.PropPanel; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertNotNull; | ||
|
||
public class ImageTest | ||
{ | ||
public Image image; | ||
public PropPanel propPanel; | ||
|
||
@Before | ||
public void setUp() throws Exception | ||
{ | ||
image = new Image(); | ||
propPanel = new PropPanel(new FakePropProxy()); | ||
image.install(new CastEvent(propPanel)); | ||
} | ||
|
||
@Test | ||
public void installation() throws Exception | ||
{ | ||
assertEquals(propPanel, image.getPropPanel()); | ||
assertNotNull(image.getImagePanel()); | ||
assertEquals(image.getImagePanel(), propPanel.getChildren().get(0)); | ||
assertEquals(true, propPanel.isSterilized()); | ||
assertNotNull(propPanel.getStagehands().get("image")); | ||
assertEquals(Image.class, propPanel.getStagehands().get("image").getClass()); | ||
} | ||
|
||
@Test | ||
public void settingTheImagePath() throws Exception | ||
{ | ||
image.setFilename("foo.jpg"); | ||
assertEquals("foo.jpg", image.getFilename()); | ||
assertEquals("foo.jpg", image.getImagePanel().getFilename()); | ||
} | ||
|
||
@Test | ||
public void rotation() throws Exception | ||
{ | ||
image.setRotation(123.45); | ||
assertEquals(123.45, image.getRotation(), 0.01); | ||
assertEquals(123.45, image.getImagePanel().getRotation(), 0.01); | ||
} | ||
|
||
@Test | ||
public void scaled() throws Exception | ||
{ | ||
assertEquals(true, image.isScaled()); | ||
image.setScaled(false); | ||
assertEquals(false, image.isScaled()); | ||
assertEquals(false, image.getImagePanel().isScaled()); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.