mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
resource optimization
This commit is contained in:
@@ -285,7 +285,8 @@ public class Freeway3x3_03 extends AbstractTransparentComponent<Void> implements
|
||||
if (svgDiagram == null) {
|
||||
try {
|
||||
byte[] data =
|
||||
IOUtils.toByteArray(Freeway3x3_03.class.getResourceAsStream("/freeway_3x3-03.svg"));
|
||||
IOUtils.toByteArray(Freeway3x3_03.class.getResourceAsStream(
|
||||
"/component-drawings/freeway_3x3-03.svg"));
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(data);
|
||||
SVGUniverse universe = new SVGUniverse();
|
||||
URI url = universe.loadSVG(bis,
|
||||
|
||||
@@ -40,7 +40,6 @@ import org.diylc.awt.ImageUtils;
|
||||
import org.diylc.common.ObjectCache;
|
||||
import org.diylc.common.Orientation;
|
||||
import org.diylc.components.AbstractTransparentComponent;
|
||||
import org.diylc.components.boards.AbstractBoard;
|
||||
import org.diylc.components.transform.ImageTransformer;
|
||||
import org.diylc.core.ComponentState;
|
||||
import org.diylc.core.IDIYComponent;
|
||||
@@ -72,7 +71,7 @@ public class Image extends AbstractTransparentComponent<Void> {
|
||||
private Orientation orientation;
|
||||
|
||||
static {
|
||||
String name = "/image.png";
|
||||
String name = "/diylc-library-images/image.png";
|
||||
try (InputStream inputStream = Image.class.getResourceAsStream(name)) {
|
||||
if (inputStream != null) {
|
||||
ICON = new ImageIcon(inputStream.readAllBytes(), name);
|
||||
@@ -99,7 +98,7 @@ public class Image extends AbstractTransparentComponent<Void> {
|
||||
|
||||
public Image() {
|
||||
try {
|
||||
data = IOUtils.toByteArray(Image.class.getResourceAsStream("/image.png"));
|
||||
data = IOUtils.toByteArray(Image.class.getResourceAsStream("/diylc-library-images/image.png"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -81,7 +81,8 @@ public class SVGImage extends AbstractTransparentComponent<Void> {
|
||||
|
||||
public SVGImage() {
|
||||
try {
|
||||
data = IOUtils.toByteArray(SVGImage.class.getResourceAsStream("/diylc.svg"));
|
||||
data = IOUtils.toByteArray(SVGImage.class.getResourceAsStream(
|
||||
"/diylc-library-images/diylc.svg"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Reference in New Issue
Block a user