/** * Create instance of {@link SequenceVisualizer}. */ public SequenceVisualizer() { sequenceProperty = new SimpleStringProperty(); offsetProperty = new SimpleIntegerProperty(); onScreenBasesProperty = new SimpleIntegerProperty(); hoveredBaseIdProperty = new SimpleIntegerProperty(-1); sequenceProperty.addListener((observable, oldValue, newValue) -> { if (offsetProperty.get() == 0) { draw(); // force redraw if offset remains unchanged. } offsetProperty.set(0); }); offsetProperty.addListener((observable, oldValue, newValue) -> draw()); hoveredBaseIdProperty.addListener((observable, oldValue, newValue) -> draw()); visibleProperty = new SimpleBooleanProperty(false); }
@BeforeEach void beforeEach() throws GfaParseException { bookmark = new Bookmark(0, 5, 32, "1234"); final GraphStore graphStore = new GraphStore(); graphVisualizer = mock(GraphVisualizer.class); sequenceVisualizer = mock(SequenceVisualizer.class); graphDimensionsCalculator = mock(GraphDimensionsCalculator.class); centerNodeIdProperty = new SimpleIntegerProperty(-1); radiusProperty = new SimpleIntegerProperty(-1); when(graphDimensionsCalculator.getCenterNodeIdProperty()).thenReturn(centerNodeIdProperty); when(graphDimensionsCalculator.getRadiusProperty()).thenReturn(radiusProperty); simpleBookmarkStore = new SimpleBookmarkStore( graphStore, graphVisualizer, graphDimensionsCalculator, sequenceVisualizer); }
/** * Initializes the FXML controller class. */ @Override public void initialize(URL url, ResourceBundle rb) { billItems = FXCollections.observableArrayList(); itemNameColumn.setCellValueFactory((param) -> { return new SimpleStringProperty(param.getValue().getName()); }); qtyColumn.setCellValueFactory((param) -> { return new SimpleIntegerProperty(param.getValue().getQuantity()) .asObject(); }); priceColumn.setCellValueFactory((param) -> { return new SimpleStringProperty( String.format("%.2f", param.getValue().getTotalPrice()) ); }); billTable.setItems(billItems); }
public Add_purchase(String purchaseHsn, String purchaseItem, String purchaseBatch, Integer purchaseQuantity, Float purchaseCost, Float purchaseMrp, String purchaseSalt, String purchaseCompany, String purchaseType, String purchaseExpiry, String purchaseMfd, Integer purchaseSgst, Integer purchaseCgst, Integer purchaseIgst, Integer purchaseIpunit, Integer purchasePpitem) { this.purchaseHsn = new SimpleStringProperty(purchaseHsn); this.purchaseItem = new SimpleStringProperty(purchaseItem); this.purchaseBatch = new SimpleStringProperty(purchaseBatch); this.purchaseQuantity = new SimpleIntegerProperty(purchaseQuantity); this.purchaseCost = new SimpleFloatProperty(purchaseCost); this.purchaseMrp = new SimpleFloatProperty(purchaseMrp); this.purchaseSalt = new SimpleStringProperty(purchaseSalt); this.purchaseCompany = new SimpleStringProperty(purchaseCompany); this.purchaseType = new SimpleStringProperty(purchaseType); this.purchaseExpiry = new SimpleStringProperty(purchaseExpiry); this.purchaseMfd = new SimpleStringProperty(purchaseMfd); this.purchaseSgst = new SimpleIntegerProperty(purchaseSgst); this.purchaseCgst = new SimpleIntegerProperty(purchaseCgst); this.purchaseIgst = new SimpleIntegerProperty(purchaseIgst); this.purchaseIpunit = new SimpleIntegerProperty(purchaseIpunit); this.purchasePpitem = new SimpleIntegerProperty(purchasePpitem); }
public Medicine(int code, String name, String salt, String company, String type, String hsn, String batch, String expiry, int quantity, float mrp, float cost, int sgst, int cgst, int igst) { this.code = new SimpleIntegerProperty(code); this.name = new SimpleStringProperty(name); this.salt = new SimpleStringProperty(salt); this.company = new SimpleStringProperty(company); this.type = new SimpleStringProperty(type); this.hsn = new SimpleStringProperty(hsn); this.batch = new SimpleStringProperty(batch); this.expiry = new SimpleStringProperty(expiry); this.quantity = new SimpleIntegerProperty(quantity); this.mrp = new SimpleFloatProperty(mrp); this.cost = new SimpleFloatProperty(cost); this.sgst = new SimpleIntegerProperty(sgst); this.cgst = new SimpleIntegerProperty(cgst); this.igst = new SimpleIntegerProperty(igst); }
private TX(int id, String desc, BigDecimal amount){ this.amount = new SimpleStringProperty(amount.toPlainString()); this.desc = new SimpleStringProperty(desc); this.id = new SimpleIntegerProperty(id); this.sortID = id; this.timeFilled = new SimpleLongProperty(0); this.status = new SimpleStringProperty("Requested"); this.pin = new SimpleStringProperty(""); }
/** * Creates a default configuration. Paths are set to <tt>[Path to ... Executable]</tt>. */ public GlobalConfig() { verificationTimeout = new SimpleIntegerProperty(3600); simulationTimeout = new SimpleIntegerProperty(60); windowMaximized = new SimpleBooleanProperty(true); windowHeight = new SimpleIntegerProperty(600); windowWidth = new SimpleIntegerProperty(800); editorFontSize = new SimpleIntegerProperty(12); maxLineRollout = new SimpleIntegerProperty(50); editorFontFamily = new SimpleStringProperty("DejaVu Sans Mono"); showLineNumbers = new SimpleBooleanProperty(true); uiLanguage = new SimpleStringProperty("EN"); nuxmvFilename = new SimpleStringProperty( ExecutableLocator.findExecutableFileAsString("nuXmv") .orElse("[Path to nuXmv Executable]")); z3Path = new SimpleStringProperty( ExecutableLocator.findExecutableFileAsString("z3") .orElse("[Path to Z3 Executable]")); getetaCommand = new SimpleStringProperty("java -jar /path/to/geteta.jar -c ${code} -t ${spec} -x"); }
public Transition(int sourceState, double sourceCoefficient, int sourceDelay, int operandState, double operandCoefficient, int operandDelay, int resultState, double resultCoefficient, double probability, int type, int mode, String description) { mSourceState = new SimpleIntegerProperty(sourceState); mSourceCoefficient = new SimpleDoubleProperty(sourceCoefficient); mSourceDelay = new SimpleIntegerProperty(sourceDelay); mOperandState = new SimpleIntegerProperty(operandState); mOperandCoefficient = new SimpleDoubleProperty(operandCoefficient); mOperandDelay = new SimpleIntegerProperty(operandDelay); mResultState = new SimpleIntegerProperty(resultState); mResultCoefficient = new SimpleDoubleProperty(resultCoefficient); mProbability = new SimpleDoubleProperty(probability); mType = new SimpleIntegerProperty(type); mMode = new SimpleIntegerProperty(mode); mDescription = new SimpleStringProperty(description); }
public Driver(String name) { this.name = new SimpleStringProperty(name); this.displayName = new SimpleStringProperty(name); String[] nameChunks = name.split(" "); if (nameChunks.length == 1) { this.shortName = new SimpleStringProperty(name); } else { String firstName = nameChunks[0]; String lastName = nameChunks[nameChunks.length - 1]; this.shortName = new SimpleStringProperty(firstName.charAt(0) + ". " + lastName); } this.car = new SimpleObjectProperty<>(new Car("", new CarClass("", Color.rgb(255, 0, 0)))); this.team = new SimpleStringProperty(""); this.seriesPoints = new SimpleIntegerProperty(0); this.pointsAdjust = new SimpleStringProperty(""); }
/** * 생성자 * * @param parent * @param content */ public TextSearchComposite(Parent parent, ObservableValue<String> content) { loader = new FXMLLoader(); loader.setLocation(TextSearchComposite.class.getResource("TextSearchView.fxml")); loader.setRoot(this); loader.setController(this); try { loader.load(); this.contentProperty = new SimpleStringProperty(); this.contentProperty.bind(content); this.searchResultVOProperty = new SimpleObjectProperty<>(); slidingStartIndexProperty = new SimpleIntegerProperty(); this.parent = parent; } catch (IOException e) { LOGGER.error(ValueUtil.toString(e)); } Platform.runLater(() -> txtFindTextContent.requestFocus()); }
@Override public void onDeath() { dying = true; sprite.setImage(Config.Images.EXPLOSION); sprite.setViewport(new Rectangle2D(0, 0, 40, 40)); SimpleIntegerProperty frameProperty = new SimpleIntegerProperty(); frameProperty.addListener((obs, old, newValue) -> { if (newValue.intValue() > old.intValue()) sprite.setViewport(new Rectangle2D((newValue.intValue() % 5) * 40, (newValue.intValue() / 5) * 40, 40, 40)); }); Timeline t = new Timeline(new KeyFrame(Duration.seconds(1), new KeyValue(frameProperty, 24))); t.setOnFinished(event -> { alive = false; }); t.play(); Config.Audio.EXPLOSION.play(); }
public Powerup(float x, float y, PowerType type) { super(x, y, Config.BLOCK_SIZE, Config.BLOCK_SIZE, BodyType.KINEMATIC, false); this.type = type; sprite = new ImageView(Config.Images.POWERUP); sprite.setFitHeight(Config.BLOCK_SIZE); sprite.setFitWidth(Config.BLOCK_SIZE); sprite.setViewport(new Rectangle2D(0, 0, 81, 81)); getChildren().add(sprite); SimpleIntegerProperty frameProperty = new SimpleIntegerProperty(); frameProperty.addListener((obs, old, newValue) -> { if (newValue.intValue() > old.intValue()) sprite.setViewport(new Rectangle2D(newValue.intValue() * 81, (type.ordinal() + 1) * 81, 81, 81)); }); timeline = new Timeline(new KeyFrame(Duration.seconds(2), new KeyValue(frameProperty, 7))); timeline.setCycleCount(Timeline.INDEFINITE); timeline.play(); }
public Coin(float x, float y) { super(x, y, Config.BLOCK_SIZE, Config.BLOCK_SIZE, BodyType.KINEMATIC, false); sprite = new ImageView(Config.Images.COIN); sprite.setFitHeight(Config.BLOCK_SIZE); sprite.setFitWidth(Config.BLOCK_SIZE); sprite.setViewport(new Rectangle2D(0, 0, 128, 128)); getChildren().add(sprite); SimpleIntegerProperty frameProperty = new SimpleIntegerProperty(); frameProperty.addListener((obs, old, newValue) -> { if (newValue.intValue() > old.intValue()) sprite.setViewport(new Rectangle2D((newValue.intValue() % 8) * 128, (newValue.intValue() / 8) * 128, 128, 128)); }); timeline = new Timeline(new KeyFrame(Duration.seconds(2), new KeyValue(frameProperty, 23))); timeline.setCycleCount(Timeline.INDEFINITE); timeline.play(); }
public ArmorSet() { name = new SimpleStringProperty(""); items = new HashMap<>(); stats = new HashMap<>(); Arrays.asList(ArmorStats.values()) .forEach(as -> stats.put(as, new SimpleIntegerProperty(0))); Arrays.asList(Slot.values()) .forEach( s -> items.put(s, new SimpleObjectProperty<>())); items.values().stream() .forEach(p -> p.addListener(e -> recalculateStats())); }
/** * Constructs a new {@link BuildWallConfigurationImpl}. */ public BuildWallConfigurationImpl() { buildNumberColour = new SimpleObjectProperty<>( DEFAULT_TEXT_COLOUR ); buildNumberFont = new SimpleObjectProperty<>( DEFAULT_PROPERTIES_FONT ); completionEstimateColour = new SimpleObjectProperty<>( DEFAULT_TEXT_COLOUR ); completionEstimateFont = new SimpleObjectProperty<>( DEFAULT_PROPERTIES_FONT ); jobNameColour = new SimpleObjectProperty<>( DEFAULT_TEXT_COLOUR ); jobNameFont = new SimpleObjectProperty<>( DEFAULT_JOB_NAME_FONT ); numberOfColumns = new SimpleIntegerProperty( DEFAULT_NUMBER_OF_COLUMNS ); jobPolicies = new SynchronizedObservableMap<>(); jobPanelDescriptionProvider = new SimpleObjectProperty<>( JobPanelDescriptionProviders.Default ); detailColour = new SimpleObjectProperty<>( DEFAULT_TEXT_COLOUR ); detailFont = new SimpleObjectProperty<>( DEFAULT_PROPERTIES_FONT ); }
@Test public void shouldBreakWhenControlIsSwitchOff() throws InterruptedException{ final int numberOfFlashes = 1000; latch = new CountDownLatch( 1 ); stoppingPoint = 344; counter = new SimpleIntegerProperty( 0 ); DecoupledPlatformImpl.setInstance( new TestPlatformDecouplerImpl( this::interruptAtStoppingPoint ) ); properties.numberOfFlashesProperty().set( numberOfFlashes ); properties.flashOnProperty().set( 1 ); properties.flashOffProperty().set( 1 ); properties.flashingSwitch().set( true ); latch.await(); Thread.sleep( numberOfFlashes ); assertThat( counter.get(), is( stoppingPoint ) ); }
@Test public void shouldAlwaysFlashOffIfInterruptedAtFlashOn() throws InterruptedException{ final int numberOfFlashes = 10; latch = new CountDownLatch( 1 ); stoppingPoint = 5; counter = new SimpleIntegerProperty( 0 ); DecoupledPlatformImpl.setInstance( new TestPlatformDecouplerImpl( this::interruptAtStoppingPoint ) ); properties.numberOfFlashesProperty().set( numberOfFlashes ); properties.flashOnProperty().set( 1 ); properties.flashOffProperty().set( 1 ); properties.flashingSwitch().set( true ); latch.await(); Thread.sleep( numberOfFlashes ); assertThat( counter.get(), is( stoppingPoint + 1 ) ); verify( imageFlasher, times( 3 ) ).flashOn(); verify( imageFlasher, times( 3 ) ).flashOff(); }
/** * Initializes the turtle with an ID and sets default values. * @param id */ public TurtleView (int id) { loadBundles(); Image turtleImage = new Image(this.getClass().getResourceAsStream(DEFAULT_STARTING_TURTLE)); this.setImage(turtleImage); setDefaults(); this.id = id; penColorIndex.addListener(penColorListener()); penColorIndex.setValue(DEFAULT_COLOR_INDEX); shapeIndex = new SimpleIntegerProperty(1); penDown = true; this.setOnMouseClicked(e -> { establishContextMenu().show(this, e.getScreenX(), e.getScreenY()); }); internalEditor = InternalEditor.getInstance(); tooltip = new Tooltip(); visible = true; initializeStateVisualization(); }
/** * Initializes the background color index. */ @SuppressWarnings({ "rawtypes", "unused" }) private void initializeBackgroundColorIndex () { backgroundColorIndex = new SimpleIntegerProperty(); final ChangeListener changeListener = new ChangeListener() { @Override public void changed (ObservableValue observable, Object oldValue, Object newValue) { Integer value = (Integer) newValue; if (value == 0) { setBackgroundColor(DEFAULT_BG_COLOR); } else { setBackgroundColor(Color.valueOf(palette.getString(Integer.toString((value))))); } } }; }
public TrackTableModel(Track track) { this.track = track; trackId = new SimpleStringProperty(track.getTrackId()); trackName = new SimpleStringProperty(track.getTrackName()); artistName = new SimpleStringProperty(track.getArtistName()); albumYear = new SimpleIntegerProperty(track.getYear()); albumName = new SimpleStringProperty(track.getAlbumName()); StringBuilder builder = new StringBuilder(); if (track.getGenres() != null) { track.getGenres().forEach(genre -> builder.append(genre).append(", ")); builder.setLength(builder.length() - 2); } genres = new SimpleStringProperty(builder.toString()); }
/** * Constructs a new {@link SimpleBookmark} instance. * * @param bookmark bookmark associated with this {@link SimpleBookmark} * @param onClick {@link Runnable} that can be retrieved by calling {@link #getOnClick()} * @throws GfaParseException if unable to get the sequence of the node in the bookmark */ public SimpleBookmark(final Bookmark bookmark, final Runnable onClick) throws GfaParseException { this.bookmark = bookmark; this.onClick = onClick; nodeIdProperty = new SimpleIntegerProperty(bookmark.getNodeId()); baseOffsetProperty = new SimpleIntegerProperty(bookmark.getBaseOffset()); descriptionProperty = new SimpleStringProperty(bookmark.getDescription()); radiusProperty = new SimpleIntegerProperty(bookmark.getRadius()); }
@Test void testIncrementLargeAmount() { final IntegerProperty onscreenBase = new SimpleIntegerProperty(10); when(sequenceVisualizer.getOnScreenBasesCountProperty()).thenReturn(onscreenBase); interact(() -> sequenceController.incrementLargeAction(mock(ActionEvent.class))); verify(sequenceVisualizer).incrementOffset(onscreenBase.get()); }
@Test void testDecrementLargeAmount() { final IntegerProperty onscreenBase = new SimpleIntegerProperty(10); when(sequenceVisualizer.getOnScreenBasesCountProperty()).thenReturn(onscreenBase); interact(() -> sequenceController.decrementLargeAction(mock(ActionEvent.class))); verify(sequenceVisualizer).decrementOffset(onscreenBase.get()); }
@BeforeEach void beforeEach() { viewPointProperty = new SimpleLongProperty(0); radiusProperty = new SimpleIntegerProperty(0); graphDimensionsCalculator = mock(GraphDimensionsCalculator.class); when(graphDimensionsCalculator.getViewPointProperty()).thenReturn(viewPointProperty); when(graphDimensionsCalculator.getRadiusProperty()).thenReturn(radiusProperty); when(graphDimensionsCalculator.getNodeCountProperty()).thenReturn(new SimpleIntegerProperty(65)); graphMovementCalculator = new GraphMovementCalculator(graphDimensionsCalculator); graphMovementCalculator.getPanningSensitivityProperty().set(1); graphMovementCalculator.getZoomingSensitivityProperty().set(1); }
public ArchiveEntryWrapper(Archive.ArchiveEntry entry) { this.hash = new SimpleIntegerProperty(entry.getHash()).asObject(); this.name = new SimpleStringProperty(StringUtils.getCommonName(entry).contains(".") ? StringUtils.getCommonName(entry).substring(0, StringUtils.getCommonName(entry).lastIndexOf(".")) : StringUtils.getCommonName(entry)); this.extension = new SimpleStringProperty(StringUtils.getCommonName(entry).contains(".") ? StringUtils.getCommonName(entry).substring(StringUtils.getCommonName(entry).lastIndexOf(".") + 1, StringUtils.getCommonName(entry).length()) : "none"); this.size = new SimpleStringProperty(StringUtils.readableFileSize(entry.getCompresseedSize())); this.image = new ImageView(AppData.getIcon(StringUtils.getCommonName(entry).contains(".") ? StringUtils.getCommonName(entry).substring(StringUtils.getCommonName(entry).lastIndexOf(".") + 1, StringUtils.getCommonName(entry).length()) : "none")); }
public StoreEntryWrapper(int id, String name, String extension, int size) { this.id = new SimpleIntegerProperty(id).asObject(); this.name = new SimpleStringProperty(name.contains(".") ? name.substring(0, name.lastIndexOf(".")) : name); this.extension = new SimpleStringProperty(extension); this.size = new SimpleStringProperty(StringUtils.readableFileSize(size)); this.image = new ImageView(AppData.getIcon(extension)); }
public WorkflowResult(SimpleIntegerProperty runNumber, SimpleDoubleProperty recall, SimpleDoubleProperty precision, SimpleDoubleProperty f1Measure, SimpleDoubleProperty totalTime, SimpleIntegerProperty inputInstances, SimpleIntegerProperty numOfClusters, SimpleIntegerProperty detailsId) { this.runNumber = runNumber; this.recall = recall; this.precision = precision; this.f1Measure = f1Measure; this.totalTime = totalTime; this.inputInstances = inputInstances; this.numOfClusters = numOfClusters; this.detailsId = detailsId; }
private void initVariables() { selectedModel = new SimpleObjectProperty<>(); outputReady = new SimpleBooleanProperty(); zoomValue = new SimpleIntegerProperty(5); showActivationGrid = new SimpleBooleanProperty(); showChannelGrid = new SimpleBooleanProperty(); showLayerListener = (b, o, n) -> showLayer(); showActivationGrid.addListener(showLayerListener); showChannelGrid.addListener(showLayerListener); }
public ObservableGanttTask(GanttTask task) { this.task = task; this.id = new SimpleStringProperty(indentation(task.getLevel()) + TaskUtils.pathToString(task.getPath())); this.name = new SimpleStringProperty(indentation(task.getLevel()) + task.getName()); this.startDate = new SimpleStringProperty(task.getStartDate().toString()); // TODO configure date format this.endDate = new SimpleStringProperty(task.getEndDate().toString()); this.level = new SimpleIntegerProperty(task.getLevel()); }
public ObservableList<TableRowDataModel> convertHistoryArrayListToObservableList(ArrayList Histories) { ObservableList<TableRowDataModel> tempList = FXCollections.observableArrayList(); for (Object history : Histories) { SimpleStringProperty ItemName = new SimpleStringProperty(((DAOShoppingHistory) history).getDaoItem().getItemName()); int amount = ((DAOShoppingHistory) history).getItemQuantity(); int price = ((DAOShoppingHistory) history).getDaoItem().getItemPrice(); tempList.add(new TableRowDataModel(ItemName, new SimpleIntegerProperty(amount), new SimpleIntegerProperty(amount * price))); } return tempList; }
public void loadItemList() { itemList.clear(); ArrayList<DAOItem> itemArrayList = new DAOItem().getItems(); for (DAOItem item : itemArrayList) { itemList.add(new TableRowDataModel(new SimpleStringProperty(item.getItemName()), new SimpleStringProperty(item.getDaoCategory().getCategoryName()), new SimpleIntegerProperty(item.getItemPrice()))); } itemListView.setItems(itemList); itemListView.getSelectionModel().selectFirst(); }
public MavenBean(int id, String sourcePath, String installPath, String groupId, String artifactId, String version) { this.id = new SimpleIntegerProperty(id); this.sourcePath = new SimpleStringProperty(sourcePath); this.installPath = new SimpleStringProperty(installPath); this.groupId = new SimpleStringProperty(groupId); this.artifactId = new SimpleStringProperty(artifactId); this.version = new SimpleStringProperty(version); status = new SimpleStringProperty(""); }
public TeamRanking(int rank, int teamKey) { this.rank = new SimpleIntegerProperty(rank); this.teamKey = new SimpleIntegerProperty(teamKey); this.wins = new SimpleIntegerProperty(0); this.losses = new SimpleIntegerProperty(0); this.ties = new SimpleIntegerProperty(0); this.qualPoints = new SimpleIntegerProperty(0); this.rankPoints = new SimpleIntegerProperty(0); this.highestScore = new SimpleIntegerProperty(0); this.played = new SimpleIntegerProperty(0); }
public Team(int teamKey, int teamDivKey, String regionKey, String leagueKey, String teamNameShort, String teamNameLong, String location) { this.teamKey = new SimpleIntegerProperty(teamKey); this.teamDivKey = new SimpleIntegerProperty(teamDivKey); this.regionKey = new SimpleStringProperty(regionKey); this.leagueKey = new SimpleStringProperty(leagueKey); this.teamNameShort = new SimpleStringProperty(teamNameShort); this.teamNameLong = new SimpleStringProperty(teamNameLong); this.location = new SimpleStringProperty(location); }
/** * Data type used in the TreeTableview for */ public CourseTableDataType(String title, String id, int time, int stars) { this.title = new SimpleStringProperty(title); this.id = new SimpleStringProperty(id); this.time = new SimpleIntegerProperty(time); this.stars = new SimpleIntegerProperty(stars); }
@Test public void testSaveInt() { // given String name = "int"; int value = Integer.MAX_VALUE; IntegerProperty property = new SimpleIntegerProperty(null, name, value); // when PreferencesUtils.save(property, preferences); // then int saved = preferences.getInt(name, -1); assertEquals(value, saved); }
@Test public void testReadInt() { // given String name = "int"; int value = Integer.MIN_VALUE; IntegerProperty property = new SimpleIntegerProperty(null, name, -value); // when preferences.putInt(name, value); // then PreferencesUtils.read(property, preferences); assertEquals(property.getValue().intValue(), value); }
@Test public void testReadWhenSavedValueIsWrongType() { // given int initialValue = 10; IntegerProperty property = new SimpleIntegerProperty(null, "value", initialValue); preferences.putBoolean("value", false); // when PreferencesUtils.read(property, preferences); // then assertEquals(initialValue, property.getValue().intValue()); }