use of javafx.scene.text.TextFlow in project POL-POM-5 by PlayOnLinux.
the class StepRepresentationMessage method drawStepContent.
@Override
protected void drawStepContent() {
Text textWidget = new Text(textToShow);
textWidget.setId("stepText");
ScrollPane scrollPane = new ScrollPane();
scrollPane.setId("stepScrollPane");
scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scrollPane.setFitToWidth(true);
scrollPane.setContent(new TextFlow(textWidget));
this.addToContentPane(scrollPane);
VBox.setVgrow(scrollPane, Priority.ALWAYS);
}
use of javafx.scene.text.TextFlow in project POL-POM-5 by PlayOnLinux.
the class StepRepresentationPresentation method drawStepContent.
@Override
protected void drawStepContent() {
final String title = this.getParentWizardTitle();
VBox contentPane = new VBox();
contentPane.setId("presentationBackground");
Label titleWidget = new Label(title + "\n\n");
titleWidget.setId("presentationTextTitle");
Text textWidget = new Text(textToShow);
textWidget.setId("presentationText");
TextFlow flow = new TextFlow();
flow.getChildren().add(textWidget);
ScrollPane scrollPane = new ScrollPane();
scrollPane.setId("presentationScrollPane");
scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scrollPane.setFitToWidth(true);
scrollPane.setContent(flow);
VBox.setVgrow(scrollPane, Priority.ALWAYS);
contentPane.getChildren().add(scrollPane);
getParent().getRoot().setCenter(contentPane);
}
use of javafx.scene.text.TextFlow in project Gargoyle by callakrsos.
the class SpecExample method start.
@Override
public void start(Stage primaryStage) throws Exception {
String projectDir = System.getProperty("user.dir");
File file = new File(projectDir, "src/main/java/com/kyj/fx/voeditor/visual/example/SpecExample.java");
SpecResource specResource = new SpecResource(new File(projectDir), file);
SpecTabPane center = new SpecTabPane(specResource);
Button btnCapture = new Button("SnapShot");
ImageView ivOrigin = new ImageView();
btnCapture.setOnAction(ev -> {
FxUtil.snapShot(center, new File("example.png"));
FxUtil.printJob(primaryStage, center);
});
Text text1 = new Text("Big italic red text");
text1.setFill(Color.RED);
text1.setFont(Font.font("Helvetica", FontPosture.ITALIC, 40));
Text text2 = new Text(" little bold blue text");
text2.setFill(Color.BLUE);
text2.setFont(Font.font("Helvetica", FontWeight.BOLD, 10));
TextFlow textFlow = new TextFlow(text1, text2);
BorderPane root = new BorderPane(center);
root.setTop(new HBox(textFlow, btnCapture));
root.setBottom(ivOrigin);
root.setPrefSize(800, 600);
Scene value = new Scene(root, 800, 600);
primaryStage.setScene(value);
primaryStage.show();
}
use of javafx.scene.text.TextFlow in project Gargoyle by callakrsos.
the class PMDListCell method updateItem.
// public PMDListCell(StringConverter<RuleViolation> stringConverter) {
// this();
// this.defaultStringConverter = stringConverter;
// }
/* (non-Javadoc)
* @see javafx.scene.control.Cell#updateItem(java.lang.Object, boolean)
*/
@Override
protected void updateItem(RuleViolation item, boolean empty) {
super.updateItem(item, empty);
setText("");
if (empty) {
setGraphic(null);
} else {
VBox vBox = new VBox();
HBox hBox = new HBox(5);
Text index = new Text();
TextFlow lineExp = new TextFlow();
Text line = new Text();
Text priority = new Text();
Text fileName = new Text();
Text methodName = new Text();
Text title = new Text();
Text message = new Text();
Text text = new Text("Index :");
text.setStyle("-fx-font-weight:bold;");
lineExp.getChildren().addAll(text, new Text(String.valueOf(getIndex())));
RulePriority prior = item.getRule().getPriority();
hBox.setStyle("-fx-background-color:transparent");
index.setStyle("-fx-fill:black;");
line.setStyle("-fx-fill:black;");
hBox.getChildren().addAll(lineExp, line, vBox);
vBox.getChildren().addAll(priority, fileName, methodName, title, message);
int priorityLevel = prior.getPriority();
priority.setStyle(getPriorityStyle(prior));
priority.setText(String.format("위험도 레벨 : [%d] - %s ", priorityLevel, prior.getName()));
fileName.setText(String.format("파일위치명 : %s", item.getFilename()));
methodName.setText(String.format("메소드명 : %s", item.getMethodName()));
// message.setStyle("-fx-font-style:italic;-fx-font-smoothing-type: lcd;");
title.setText(String.format("룰셋명 : %s 위반사항이름 : %s", item.getRule().getRuleSetName(), item.getRule().getName()));
message.setText(String.format("관련 메세지 : %s", /*item.getRule().getMessage()*/
item.getDescription()));
// item.getRule().
// message.setFont(Font.font(default1.getFamily(), FontWeight.BOLD, default1.getSize()));
line.setText(String.format("Line : %d", item.getBeginLine()));
setGraphic(hBox);
}
}
use of javafx.scene.text.TextFlow in project Smartcity-Smarthouse by TechnionYP5777.
the class StoveGuiTest method testStoveSensor.
@Test
public void testStoveSensor() throws Exception {
click("#appsTab");
ListView<String> l = find("#listView");
assert l.getItems().isEmpty();
installAppOnSystem(StoveModuleGui.class);
assertEquals(l.getItems().size(), 1);
click("Stove Application");
Slider tempSlider = find("#tempSlider");
Stage stage1 = (Stage) find("#tempLabelSensor").getScene().getWindow();
try {
FXTestUtils.bringToFront(stage1);
} catch (Exception e) {
log.error("Unable to show stage", e);
}
click("#onOffButton");
click("#tempSlider");
moveBy(15, 0);
click();
int temperature = (int) Math.round(tempSlider.getValue());
assertEquals("Temperature: " + temperature, ((Label) find("#tempLabelSensor")).getText());
assertEquals("The stove temperature is: " + temperature, ((Label) find("#tempLabel")).getText());
assertEquals("The stove is running for:", ((Label) find("#timeLabel")).getText().substring(0, 25));
TextFlow console = (TextFlow) find("#console");
assertEquals("true", ((Text) console.getChildren().get(1)).getText());
assertEquals(Integer.valueOf(temperature), Integer.valueOf(((Text) console.getChildren().get(3)).getText()));
click("#onOffButton");
assertEquals("The stove is: Off", ((Label) find("#timeLabel")).getText());
assertEquals("false", ((Text) console.getChildren().get(1)).getText());
assertEquals(Integer.valueOf(temperature), Integer.valueOf(((Text) console.getChildren().get(3)).getText()));
click("#onOffButton");
Stage stage2 = (Stage) find("#stoveConfigButton").getScene().getWindow();
try {
FXTestUtils.bringToFront(stage2);
} catch (Exception e) {
log.error("Unable to show stage", e);
}
click("#stoveConfigButton");
click("#secs").type("10");
click("#cels").type("85");
click("#Apply");
waitUntil((Label) find("#timeLabel"), (Label label) -> (label.getTextFill() == Color.RED), 60);
try {
FXTestUtils.bringToFront(stage1);
} catch (Exception e) {
log.error("Unable to show stage", e);
}
click("#tempSlider");
moveBy(55, 0);
click();
assertEquals(Color.RED, ((Label) find("#tempLabel")).getTextFill());
click("#tempSlider");
assertEquals(Color.BLACK, ((Label) find("#tempLabel")).getTextFill());
click("#onOffButton");
click("#onOffButton");
assertEquals(Color.BLACK, ((Label) find("#timeLabel")).getTextFill());
click("#onOffButton");
}
Aggregations