private void setSelectedStyle(DecoratedText label, Boolean newValue) { if (newValue) { applyStyle(label, ACTIVE_LABEL_STYLE); removeStyle(label, DEFAULT_LABEL_STYLE); removeStyle(label, DISABLED_LABEL_STYLE); } else { applyStyle(label, DEFAULT_LABEL_STYLE); removeStyle(label, ACTIVE_LABEL_STYLE); removeStyle(label, DISABLED_LABEL_STYLE); } }
/** * Remove the bold style from all Text elements. * @param texts list of text nodes that should have their style reset. */ private void resetStyles(List<DecoratedText> texts) { for (DecoratedText text : texts) { text.setStyle(DEFAULT_NON_SELECTED_STYLE); } }
@Override public void changed(ObservableValue<? extends Boolean> observableValue, Boolean oldValue, Boolean newValue) { nextShip.setDisable(!newValue); prevShip.setDisable(!newValue); } });
public DecoratedText createSimpleDecoratedText(String template) { DecoratedText text = new DecoratedText(); text.setText(template); return text; }
/** * Create a Node that forces vertical spacing. * @param heigth of the spacing node. * @return Node with specified <code>heigth</code>. */ public Node createVerticalSpacer(int heigth) { return new PlaceHolder(1, heigth); }
@Override public void applyStyle(String style) { for (Node node : getChildren()) { if (node instanceof IApplicableStyle) { ((IApplicableStyle)node).applyStyle(style); } else { node.setStyle(style); } } } }
@Override public void applyStyle(String style) { for (Node node : getChildren()) { if (node instanceof IApplicableStyle) { ((IApplicableStyle)node).applyStyle(style); } else { node.setStyle(style); } } } }
@Override public void applyStyle(String style) { for (Node node : getChildren()) { if (node instanceof IApplicableStyle) { ((IApplicableStyle)node).applyStyle(style); } else { node.setStyle(style); } } } }
private void deactivateAll() { for (Node node : loans) { if (node instanceof DecoratedText) { ((DecoratedText)node).applyStyle(DEFAULT_NON_SELECTED_STYLE); } } }
@Override protected boolean computeValue() { return moneyTransfer.getAmount() > 0; } };
/** * Compute the filename based on the stretching factor * @param width of the button * @param height of the button * @return best matching stone slab image file name */ private String getFileName(int width, int height) { float f = width*1f/height; String minDistFileName="StoneSlabBorderless.png"; return getFileName(f, minDistFileName,slabMap); } /**
/** * Splitting up the text onto pages. * @param text to be split * @return list of Pages. */ public List<Page> splitIntoPages(Text text) { return splitIntoPages(text, false); } /**
@Override public PaginationV2 build() { return new PaginationV2(backButtonLabel, nextButtonLabel, backButtonNode, nextButtonNode, firstLastPageAction, text, contentMaxWidth, contentMaxHeight, paddingLocal, navigationLabelFont, headerFont, paragraphFont, centeredFont); } }
/** * Create a new instance for the money transfer. * @return new control for the money transfer. */ public MoneyTransfer getMoneyTransfer(IDataImageLoader imageLoader) { return new MoneyTransfer(imageLoader); } }
@Override public List<CssMetaData<? extends Styleable, ?>> getControlCssMetaData() { return getClassCssMetaData(); } public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData() {
/** * Compute the line height and add it to the page height. * @param line to be checked * @param currentPageHeight current page height without <code>line</code> * @return new page height */ private double updatePageHeight(String line, double currentPageHeight) { double lineHeigth = sizing.computeTextHeight(font, line, Double.MAX_VALUE); currentPageHeight += lineSpacing + lineHeigth; return currentPageHeight; }
private void deactivateAll() { for (Node node : loans) { if (node instanceof DecoratedText) { ((DecoratedText)node).applyStyle(DEFAULT_NON_SELECTED_STYLE); } } } private EventHandler<MouseEvent> createAcceptHandler() {
@Override protected boolean computeValue() { return moneyTransfer.getAmount() > 0; } };
/** * Compute the filename based on the stretching factor * @param width of the button * @param height of the button * @return best matching stone slab extension file name. */ public String getFileNameExt(double width, double height, int capWidth) { float f = (float)((capWidth-width)/height); return getFileName(f, "StoneSlabExt.png",slabExtMap); }
private void deactivateAll() { for (Node node : loans) { if (node instanceof DecoratedText) { ((DecoratedText)node).applyStyle(DEFAULT_NON_SELECTED_STYLE); } } }