Hedgecode ChessHog Graphics Module.
</description>
+ <properties>
+ <transcoderVersion>1.11</transcoderVersion>
+ </properties>
+
<dependencies>
<dependency>
<groupId>org.hedgecode.chess</groupId>
<artifactId>chesshog-format</artifactId>
<version>${chessHogVersion}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.xmlgraphics</groupId>
+ <artifactId>batik-transcoder</artifactId>
+ <version>${transcoderVersion}</version>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
import java.util.HashMap;
import java.util.Map;
-import javax.imageio.ImageIO;
-
import org.hedgecode.chess.img.fs.FileSystemDetector;
import org.hedgecode.chess.img.fs.FileSystemContractor;
private static final String IMAGES_DIR =
ImageConstants.RESOURCE_ROOT_DIR.concat(ImageConstants.RESOURCE_IMAGES_DIR);
+ private static final int DEF_IMAGE_SIZE = 100;
+
private Type loadType;
private URI imageResourceUri;
protected Map<String, BufferedImage> loadImages(String imagesPath, ImageFilter filter)
throws ImageException
{
+ return loadImages(imagesPath, filter, DEF_IMAGE_SIZE);
+ }
+
+ protected Map<String, BufferedImage> loadImages(String imagesPath, ImageFilter filter, int size)
+ throws ImageException
+ {
Map<String, BufferedImage> images = new HashMap<>();
try (FileSystemContractor fsc = FileSystemDetector.detect(getImageResourceUri())) {
try (DirectoryStream<Path> ds =
fsc.getPath(imagesPath), filter
)
) {
+ ImageFormatShaper formatShaper = ImageFormatShaper.getInstance();
for (Path file : ds) {
+ String fileName = file.getFileName().toString();
+ String baseName = FilenameUtils.getBaseName(fileName).toLowerCase();
+ String imageFormat = FilenameUtils.getExtension(fileName).toLowerCase();
images.put(
- FilenameUtils.getBaseName(
- file.getFileName().toString()
- ).toLowerCase(),
- ImageIO.read(
- fsc.getResourceAsStream(file)
+ baseName,
+ formatShaper.shape(
+ imageFormat,
+ fsc.getResourceAsStream(file),
+ size
)
);
}
import org.hedgecode.chess.position.Position;
/**
- *
+ * Storage class for chess diagrams.
*
* @author Dmitry Samoshin aka gotty
*/
import org.hedgecode.chess.position.Square;
/**
- *
+ * Builder for chess diagrams.
*
* @author Dmitry Samoshin aka gotty
*/
int squareSize = board.squareSize();
- BufferedImage image = board.render();
+ BufferedImage image = board.getBoard();
Graphics imageGraphics = image.getGraphics();
for (int y = 0; y < Square.getSize(); ++y) {
for (int x = 0; x < Square.getSize(); ++x) {
imageGraphics.drawImage(
pieces.get(colorPiece).getScaledInstance(
squareSize, squareSize, Image.SCALE_SMOOTH
- ),
+ ), // todo: scale in other place
x * squareSize,
y * squareSize,
null
ImageIO.write(
DiagramBuilder.getInstance().build(
- Positions.INITIAL.getPosition(), "test", "shade"
+ Positions.INITIAL.getPosition(), "test", "chess24"
).getImage(),
ImageFormat.PNG.name(),
new File("chessboard" + "." + ImageFormat.PNG.getExt())
private static final String OS = System.getProperty("os.name").toLowerCase();
+ private static final String WIN_OS_TEMPLATE = "win";
+
public static String getName(final String fileName) {
if (fileName == null) {
return null;
}
private static boolean isWindows() {
- return (OS.contains("win"));
+ return (OS.contains(WIN_OS_TEMPLATE));
}
private FilenameUtils() {
import org.hedgecode.chess.position.Position;
/**
- *
+ * Common image builder interface.
*
* @author Dmitry Samoshin aka gotty
*/
public static final String DARK_SQUARE_FILENAME = "dark";
public static final String LIGHT_SQUARE_FILENAME = "light";
+ public static final String BOARD_FILENAME = "board";
public static final String LOCALE_BUNDLE_FILE = "org.hedgecode.chess.img.LocalStrings";
private String localeKey;
private String message;
- ImageException(String localeKey) {
+ public ImageException(String localeKey) {
this.localeKey = localeKey;
this.message = null;
}
- ImageException(String localeKey, String message) {
+ public ImageException(String localeKey, String message) {
this.localeKey = localeKey;
this.message = message;
}
import java.nio.file.Path;
/**
- *
+ * Filter for images by name and extention.
*
* @author Dmitry Samoshin aka gotty
+ * @see DirectoryStream.Filter
*/
public class ImageFilter implements DirectoryStream.Filter<Path> {
import javax.imageio.ImageIO;
/**
- * Supported image formats for reading/writing.
+ * Supported image formats for reading/writing, indicated by type.
*
* @author Dmitry Samoshin aka gotty
*/
public enum ImageFormat {
- PNG ( new String[]{"png"} ),
- GIF ( new String[]{"gif"} ),
- JPG ( new String[]{"jpg", "jpeg"} ),
- SVG ( new String[]{"svg"} ), // todo
- BMP ( new String[]{"bmp", "wbmp"} );
+ PNG ( Type.BITMAP, new String[]{"png"} ),
+ GIF ( Type.BITMAP, new String[]{"gif"} ),
+ JPG ( Type.BITMAP, new String[]{"jpg", "jpeg"} ),
+ BMP ( Type.BITMAP, new String[]{"bmp", "wbmp"} ),
+ SVG ( Type.VECTOR, new String[]{"svg"} );
- private String[] fortmatExts;
+ enum Type {
+
+ BITMAP,
+ VECTOR
+
+ }
+
+ private Type formatType;
+ private String[] formatExts;
private boolean isRead;
private boolean isWrite;
private static String[] allAvailableExts;
- ImageFormat(String[] exts) {
- fortmatExts = exts;
+ ImageFormat(Type type, String[] exts) {
+ formatType = type;
+ formatExts = exts;
isRead = isExist(
- ImageIO.getReaderFormatNames(), fortmatExts
+ ImageIO.getReaderFormatNames(), formatExts
);
isWrite = isExist(
- ImageIO.getWriterFormatNames(), fortmatExts
+ ImageIO.getWriterFormatNames(), formatExts
);
}
+ public Type getType() {
+ return formatType;
+ }
+
public String getExt() {
- return fortmatExts[0];
+ return formatExts[0];
}
public String[] getExts() {
- return fortmatExts;
+ return formatExts;
}
public boolean isRead() {
return false;
}
-
-/*
- public static void main(String[] args) {
- ImageFormat imageFormat = JPG;
- System.out.println("Supported format: " + imageFormat);
- imageFormat = findFormat("jpeg");
- imageFormat = findFormat("svg");
- imageFormat = findFormat("jpeeg");
- }
-*/
-
}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2018-2019. Developed by Hedgecode.
+ *
+ * Licensed 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.
+ */
+
+package org.hedgecode.chess.img;
+
+import java.awt.image.BufferedImage;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.hedgecode.chess.img.bitmap.BitmapImageShaper;
+import org.hedgecode.chess.img.vector.VectorImageShaper;
+
+import static org.hedgecode.chess.img.ImageFormat.Type;
+
+/**
+ * Shaper for images, indicated by type format.
+ *
+ * @author Dmitry Samoshin aka gotty
+ */
+public final class ImageFormatShaper {
+
+ private static ImageFormatShaper _instance = new ImageFormatShaper();
+
+ private Map<Type, ImageShaper> imageShapers = new HashMap<>();
+
+ private ImageFormatShaper() {
+ imageShapers.put(
+ Type.BITMAP,
+ BitmapImageShaper.create()
+ );
+ imageShapers.put(
+ Type.VECTOR,
+ VectorImageShaper.create()
+ );
+ }
+
+ public BufferedImage shape(String imageFormat, InputStream imageStream, int size)
+ throws ImageException
+ {
+ ImageFormat format = ImageFormat.findFormat(imageFormat);
+ if (format != null) {
+ ImageShaper imageShaper = imageShapers.get(
+ format.getType()
+ );
+ return imageShaper.shape(imageStream, size);
+ } else {
+ throw new ImageException("image.unknown.image.format", imageFormat);
+ }
+ }
+
+ public static ImageFormatShaper getInstance() {
+ return _instance;
+ }
+
+}
package org.hedgecode.chess.img;
/**
- *
+ * Common image loader interface.
*
* @author Dmitry Samoshin aka gotty
*/
--- /dev/null
+/*
+ * Copyright (c) 2018-2019. Developed by Hedgecode.
+ *
+ * Licensed 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.
+ */
+
+package org.hedgecode.chess.img;
+
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.InputStream;
+import java.net.URL;
+
+/**
+ * Common image shaper interface.
+ *
+ * @author Dmitry Samoshin aka gotty
+ */
+public interface ImageShaper {
+
+ BufferedImage shape(InputStream imageStream, int size) throws ImageException;
+
+ BufferedImage shape(URL imageUrl, int size) throws ImageException;
+
+ BufferedImage shape(File imageFile, int size) throws ImageException;
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2018-2019. Developed by Hedgecode.
+ *
+ * Licensed 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.
+ */
+
+package org.hedgecode.chess.img.bitmap;
+
+import java.awt.Graphics;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import javax.imageio.ImageIO;
+
+import org.hedgecode.chess.img.ImageException;
+import org.hedgecode.chess.img.ImageShaper;
+
+/**
+ * Shaper for bitmap images.
+ *
+ * @author Dmitry Samoshin aka gotty
+ */
+public class BitmapImageShaper implements ImageShaper {
+
+ private BitmapImageShaper() {
+ }
+
+ @Override
+ public BufferedImage shape(InputStream imageStream, int size) throws ImageException {
+ try {
+ return scaledImage(
+ ImageIO.read(imageStream),
+ size
+ );
+ } catch (IOException e) {
+ throw new ImageException("image.unable.load.bitmap", e.getMessage());
+ }
+ }
+
+ @Override
+ public BufferedImage shape(URL imageUrl, int size) throws ImageException {
+ try {
+ return scaledImage(
+ ImageIO.read(imageUrl),
+ size
+ );
+ } catch (IOException e) {
+ throw new ImageException("image.unable.load.bitmap", e.getMessage());
+ }
+ }
+
+ @Override
+ public BufferedImage shape(File imageFile, int size) throws ImageException {
+ try {
+ return scaledImage(
+ ImageIO.read(imageFile),
+ size
+ );
+ } catch (IOException e) {
+ throw new ImageException("image.unable.load.bitmap", e.getMessage());
+ }
+ }
+
+ private BufferedImage scaledImage(BufferedImage image, int size) {
+ if (image.getWidth() == size && image.getHeight() == size) {
+ return image;
+ }
+ BufferedImage scaledImage = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB);
+ Graphics graphics = scaledImage.createGraphics();
+ graphics.drawImage(
+ image.getScaledInstance(size, size, BufferedImage.SCALE_SMOOTH),
+ 0, 0, null
+ );
+ graphics.dispose();
+ return scaledImage;
+ }
+
+ public static ImageShaper create() {
+ return new BitmapImageShaper();
+ }
+
+}
import org.hedgecode.chess.position.Square;
/**
- *
+ * Storage class for chess board images.
*
* @author Dmitry Samoshin aka gotty
*/
public class Board {
+ private BufferedImage board;
private SquarePair<BufferedImage> squares;
+
private int squareSize;
- Board(SquarePair<BufferedImage> squares) {
+ private Board(SquarePair<BufferedImage> squares) {
this.squares = squares;
int width = Math.max(squares.getDark().getWidth(), squares.getLight().getWidth());
int height = Math.max(squares.getDark().getHeight(), squares.getLight().getHeight());
this.squareSize = Math.max(width, height);
}
+ private Board(BufferedImage board) {
+ this.board = board;
+ this.squareSize = Math.max(board.getWidth(), board.getHeight()) / Square.getSize();
+ }
+
public int squareSize() {
return squareSize;
}
return squareSize * Square.getSize();
}
- public BufferedImage render() {
+ public BufferedImage getBoard() {
+ if (board == null && squares != null) {
+ board = renderBoard();
+ }
+ return board;
+ }
+
+ private BufferedImage renderBoard() {
BufferedImage board = new BufferedImage(
squareSize * Square.getSize(),
squareSize * Square.getSize(),
return board;
}
+ public static Board create(BufferedImage board) {
+ return new Board(board);
+ }
+
public static Board create(SquarePair<BufferedImage> squares) {
return new Board(squares);
}
import org.hedgecode.chess.img.ImageFilter;
/**
- *
+ * Loader for chess board's set of images.
*
* @author Dmitry Samoshin aka gotty
*/
private static final String SQUARE_DARK = ImageConstants.DARK_SQUARE_FILENAME;
private static final String SQUARE_LIGHT = ImageConstants.LIGHT_SQUARE_FILENAME;
- private static final String[] SQUARE_NAMES = {SQUARE_DARK, SQUARE_LIGHT};
+ private static final String BOARD = ImageConstants.BOARD_FILENAME;
+
+ private static final String[] BOARD_SQUARE_NAMES = { BOARD, SQUARE_DARK, SQUARE_LIGHT };
private Map<String, Board> squareSetMap = new HashMap<>();
@Override
public Board load(String name) throws ImageException {
- Board board = null;
+ Board board;
if (Type.STATELESS.equals(loadType()) || !squareSetMap.containsKey(name)) {
String boardPath = FilenameUtils.getFullPath(SQUARES_DIR, name);
- SquarePair<BufferedImage> squarePair = loadSquares(boardPath);
- if (squarePair != null) {
- board = Board.create(squarePair);
- if (Type.STATEFUL.equals(loadType())) {
- squareSetMap.put(name, board);
- }
+ board = loadBoard(boardPath);
+ if (Type.STATEFUL.equals(loadType())) {
+ squareSetMap.put(name, board);
}
} else {
board = squareSetMap.get(name);
squareSetMap.clear();
}
- private SquarePair<BufferedImage> loadSquares(String boardPath) throws ImageException {
+ private Board loadBoard(String boardPath) throws ImageException {
Map<String, BufferedImage> images =
loadImages(
boardPath,
- new ImageFilter(SQUARE_NAMES)
+ new ImageFilter(BOARD_SQUARE_NAMES)
);
- BufferedImage dark = images.get(SQUARE_DARK);
- BufferedImage light = images.get(SQUARE_LIGHT);
- return (dark != null && light != null)
- ? SquarePair.create(dark, light)
- : null; // todo: ImageException
+ BufferedImage board = images.get(BOARD);
+ SquarePair<BufferedImage> squarePair = SquarePair.create(
+ images.get(SQUARE_DARK), images.get(SQUARE_LIGHT)
+ );
+ if (board == null && !squarePair.isFilled()) {
+ throw new ImageException("image.incomplete.board.set", boardPath);
+ }
+ return board != null
+ ? Board.create(board)
+ : Board.create(squarePair);
}
}
import java.util.Objects;
/**
- *
+ * Storage class for set of images of chess board squares.
*
* @author Dmitry Samoshin aka gotty
*/
private final T dark;
private final T light;
- SquarePair(T dark, T light) {
+ private SquarePair(T dark, T light) {
this.dark = dark;
this.light = light;
}
return light;
}
+ public boolean isFilled() {
+ if (this.dark == null || this.light == null) {
+ return false;
+ }
+ return true;
+ }
+
@Override
public boolean equals(Object o) {
if (!(o instanceof SquarePair)) {
import org.hedgecode.chess.img.FilenameUtils;
/**
- *
+ * Default FileSystem contractor.
*
* @author Dmitry Samoshin aka gotty
*/
import java.nio.file.Path;
/**
- *
+ * Common FileSystem contractor interface.
*
* @author Dmitry Samoshin aka gotty
+ * @see FileSystem
*/
public interface FileSystemContractor extends AutoCloseable {
import java.net.URI;
/**
- * File System Detector.
+ * FileSystem Detector.
*
* @author Dmitry Samoshin aka gotty
*/
import org.hedgecode.chess.img.FilenameUtils;
/**
- *
+ * FileSystem contractor for jar-files.
*
* @author Dmitry Samoshin aka gotty
*/
import org.hedgecode.chess.position.Piece;
/**
- *
+ * Storage class for set of images of chess pieces.
*
* @author Dmitry Samoshin aka gotty
*/
private static String[] allPieceNames;
- PieceSet() {
+ private PieceSet() {
}
public void add(String name, BufferedImage image) {
return pieceSetMap.get(colorPiece);
}
- public boolean isFull() {
+ public boolean isFilled() {
for (ColorPiece colorPiece : ColorPiece.values()) {
if (!pieceSetMap.containsKey(colorPiece)
|| (pieceSetMap.get(colorPiece) == null)) {
import org.hedgecode.chess.img.ImageFilter;
/**
- *
+ * Loader for chess piece's set of images.
*
* @author Dmitry Samoshin aka gotty
*/
if (Type.STATELESS.equals(loadType()) || !pieceSetMap.containsKey(name)) {
String piecePath = FilenameUtils.getFullPath(PIECES_DIR, name);
pieceSet = loadPieces(piecePath);
- if (Type.STATEFUL.equals(loadType()) && pieceSet != null) {
+ if (Type.STATEFUL.equals(loadType())) {
pieceSetMap.put(name, pieceSet);
}
} else {
images.get(name)
);
}
- return pieceSet.isFull()
- ? pieceSet
- : null; // todo: ImageException
+ if (!pieceSet.isFilled()) {
+ throw new ImageException("image.incomplete.piece.set", piecePath);
+ }
+ return pieceSet;
}
}
--- /dev/null
+/*
+ * Copyright (c) 2018-2019. Developed by Hedgecode.
+ *
+ * Licensed 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.
+ */
+
+package org.hedgecode.chess.img.vector;
+
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.imageio.ImageIO;
+
+import org.apache.batik.transcoder.TranscoderException;
+import org.apache.batik.transcoder.TranscoderInput;
+import org.apache.batik.transcoder.TranscoderOutput;
+import org.apache.batik.transcoder.image.ImageTranscoder;
+
+import org.hedgecode.chess.img.ImageFormat;
+
+/**
+ * Transcoder for vector square images to {@link BufferedImage}.
+ *
+ * @author Dmitry Samoshin aka gotty
+ * @see ImageTranscoder
+ */
+public class SquareImageTranscoder extends ImageTranscoder {
+
+ private final int type;
+ private BufferedImage image;
+
+ SquareImageTranscoder(int type) {
+ this.type = type;
+ }
+
+ SquareImageTranscoder(int type, int size) {
+ this.type = type;
+ addTranscodingHint(ImageTranscoder.KEY_WIDTH, (float) size);
+ addTranscodingHint(ImageTranscoder.KEY_HEIGHT, (float) size);
+
+ }
+
+ @Override
+ protected void setImageSize(float width, float height) {
+ if (width > 0 && height > 0) {
+ super.setImageSize(width, height);
+ }
+ }
+
+ @Override
+ public BufferedImage createImage(int width, int height) {
+ return new BufferedImage(width, height, type);
+ }
+
+ @Override
+ public void writeImage(BufferedImage image, TranscoderOutput to) throws TranscoderException {
+ this.image = image;
+ }
+
+ public BufferedImage transcode(InputStream inputStream) throws TranscoderException {
+ transcode(
+ new TranscoderInput(inputStream),
+ null
+ );
+ return getImage();
+ }
+
+ public BufferedImage getImage() {
+ return image;
+ }
+
+
+ public static void main(String[] args) throws TranscoderException, IOException {
+ SquareImageTranscoder imageTranscoder =
+ new SquareImageTranscoder(BufferedImage.TYPE_INT_ARGB); // , 250
+ ImageIO.write(
+ imageTranscoder.transcode(
+ ClassLoader.getSystemResourceAsStream("images/pieces/spatial/bb.svg")
+ ),
+ ImageFormat.PNG.name(),
+ new File("bishop" + "." + ImageFormat.PNG.getExt())
+ );
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2018-2019. Developed by Hedgecode.
+ *
+ * Licensed 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.
+ */
+
+package org.hedgecode.chess.img.vector;
+
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import org.apache.batik.transcoder.TranscoderException;
+
+import org.hedgecode.chess.img.ImageException;
+import org.hedgecode.chess.img.ImageShaper;
+
+/**
+ * Shaper for vector images.
+ *
+ * @author Dmitry Samoshin aka gotty
+ */
+public class VectorImageShaper implements ImageShaper {
+
+ private VectorImageShaper() {
+ }
+
+ @Override
+ public BufferedImage shape(InputStream imageStream, int size) throws ImageException {
+ SquareImageTranscoder imageTranscoder =
+ new SquareImageTranscoder(BufferedImage.TYPE_INT_ARGB, size);
+ try {
+ return imageTranscoder.transcode(imageStream);
+ } catch (TranscoderException e) {
+ throw new ImageException("image.unable.load.vector", e.getMessage());
+ }
+ }
+
+ @Override
+ public BufferedImage shape(URL imageUrl, int size) throws ImageException {
+ try {
+ return shape(
+ imageUrl.openStream(),
+ size
+ );
+ } catch (IOException e) {
+ throw new ImageException("image.unable.load.vector", e.getMessage());
+ }
+ }
+
+ @Override
+ public BufferedImage shape(File imageFile, int size) throws ImageException {
+ try {
+ return shape(
+ new FileInputStream(imageFile),
+ size
+ );
+ } catch (FileNotFoundException e) {
+ throw new ImageException("image.unable.load.vector", e.getMessage());
+ }
+ }
+
+ public static ImageShaper create() {
+ return new VectorImageShaper();
+ }
+
+}
image.unable.access.resource=Unable to access resources of graphic module
image.unable.find.resource=Unable to find image resources
+image.unable.load.bitmap=Unable to load bitmap image
+image.unable.load.vector=Unable to load vector image
+image.unknown.image.format=Unknown image format
+image.incomplete.board.set=Incomplete board set for load
+image.incomplete.piece.set=Incomplete piece set for load
image.unable.access.resource=\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0434\u043E\u0441\u0442\u0443\u043F \u043A \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043C \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043C\u043E\u0434\u0443\u043B\u044F
image.unable.find.resource=\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u043D\u0430\u0439\u0442\u0438 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044B
+image.unable.load.bitmap=\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0440\u0430\u0441\u0442\u0440\u043E\u0432\u043E\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435
+image.unable.load.vector=\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0432\u0435\u043A\u0442\u043E\u0440\u043D\u043E\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435
+image.unknown.image.format=\u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u044B\u0439 \u0444\u043E\u0440\u043C\u0430\u0442 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F
+image.incomplete.board.set=\u041D\u0435\u043F\u043E\u043B\u043D\u044B\u0439 \u043D\u0430\u0431\u043E\u0440 \u0434\u043B\u044F \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438 \u0448\u0430\u0445\u043C\u0430\u0442\u043D\u043E\u0439 \u0434\u043E\u0441\u043A\u0438
+image.incomplete.piece.set=\u041D\u0435\u043F\u043E\u043B\u043D\u044B\u0439 \u043D\u0430\u0431\u043E\u0440 \u0434\u043B\u044F \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438 \u0448\u0430\u0445\u043C\u0430\u0442\u043D\u044B\u0445 \u0444\u0438\u0433\u0443\u0440