This file contains hidden or 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
| package currencyconverter.app; | |
| import javafx.application.Application; | |
| import javafx.fxml.FXMLLoader; | |
| import javafx.scene.Parent; | |
| import javafx.scene.Scene; | |
| import javafx.stage.Stage; | |
| public class CurrencyConverter extends Application { |
This file contains hidden or 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
| package currencyconverter.app; | |
| public enum Currency { | |
| USD("U.S. Dollar", 1.0), | |
| GBP("British Pound", 1.56285), | |
| EUR("Euro", 1.22293); | |
| private double dollarConversionRate; | |
| private String fullName; |
This file contains hidden or 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
| package currencyconverter.app; | |
| import javafx.beans.value.ChangeListener; | |
| import javafx.collections.FXCollections; | |
| import javafx.collections.ObservableList; | |
| import javafx.event.ActionEvent; | |
| import javafx.fxml.FXML; | |
| import javafx.fxml.Initializable; | |
| import javafx.scene.control.Button; | |
| import javafx.scene.control.CheckBox; |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <?import java.lang.*?> | |
| <?import javafx.geometry.*?> | |
| <?import javafx.geometry.Insets?> | |
| <?import javafx.scene.control.*?> | |
| <?import javafx.scene.layout.*?> | |
| <AnchorPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="currencyconverter.app.Controller"> | |
| <children> |
This file contains hidden or 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
| public class HexagonalMapGUI extends JFrame { | |
| static final int MAP_WIDTH = 10; // number of columns | |
| static final int MAP_HEIGHT = 10; // number of rows | |
| static final TerrainType SOME_TERRAIN_TYPE = TerrainType.FOREST; | |
| private HexagonalMap map; | |
| private MapInfo info; | |
| private JPanel mainPanel; | |
| public HexagonalMapGUI() { |
This file contains hidden or 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
| public class HexagonalMap extends JPanel { | |
| private int width; // Number of columns | |
| private int height; // Number of rows | |
| private int hexSide; // Side of the hexagon | |
| private int hexOffset; // Distance from left horizontal vertex to vertical axis | |
| private int hexApotheme; // Apotheme of the hexagon = radius of inscribed circumference | |
| private int hexRectWidth; // Width of the circumscribed rectangle | |
| private int hexRectHeight; // Height of the circumscribed rectangle | |
| private int hexGridWidth; // hexOffset + hexSide (b + s) | |
| private BufferedImage globalImage; |
This file contains hidden or 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
| public class Board { | |
| private Tile[][] tiles; | |
| private int width; | |
| private int height; | |
| private Board(int width, int height) { | |
| this.width = width; | |
| this.height = height; | |
| } |
This file contains hidden or 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
| public enum Directions { | |
| N, | |
| NE, | |
| N_NE, | |
| SE, | |
| N_SE, | |
| NE_SE, | |
| N_NE_SE, | |
| S, |
This file contains hidden or 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
| public enum Direction { | |
| N(0, -1, -1), | |
| NE(1, 0, -1), | |
| SE(1, 1, 0), | |
| S(0, 1, 1), | |
| SW(-1, 1, 0), | |
| NW(-1, 0, -1), | |
| C(0, 0, 0); | |
| private final int incColumn; | |
| private final int incRowEven; |
This file contains hidden or 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
| public class Tile { | |
| private java.util.Map<TerrainType, Directions> terrain; | |
| private Tile() { | |
| this.terrain = new EnumMap<>(TerrainType.class); | |
| } | |
| public Map<TerrainType, Directions> getTerrain() { | |
| return terrain; | |
| } |
NewerOlder