Search in sources :

Example 1 with TextFlow

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);
}
Also used : ScrollPane(javafx.scene.control.ScrollPane) Text(javafx.scene.text.Text) TextFlow(javafx.scene.text.TextFlow)

Example 2 with TextFlow

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);
}
Also used : ScrollPane(javafx.scene.control.ScrollPane) Label(javafx.scene.control.Label) Text(javafx.scene.text.Text) TextFlow(javafx.scene.text.TextFlow) VBox(javafx.scene.layout.VBox)

Example 3 with TextFlow

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();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) HBox(javafx.scene.layout.HBox) SpecResource(com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.model.SpecResource) SpecTabPane(com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.tabs.SpecTabPane) Button(javafx.scene.control.Button) Text(javafx.scene.text.Text) TextFlow(javafx.scene.text.TextFlow) ImageView(javafx.scene.image.ImageView) Scene(javafx.scene.Scene) File(java.io.File)

Example 4 with TextFlow

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);
    }
}
Also used : HBox(jfxtras.scene.layout.HBox) Text(javafx.scene.text.Text) TextFlow(javafx.scene.text.TextFlow) RulePriority(net.sourceforge.pmd.RulePriority) VBox(javafx.scene.layout.VBox)

Example 5 with TextFlow

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");
}
Also used : Slider(javafx.scene.control.Slider) Label(javafx.scene.control.Label) Stage(javafx.stage.Stage) TextFlow(javafx.scene.text.TextFlow) Text(javafx.scene.text.Text) Test(org.junit.Test)

Aggregations

Text (javafx.scene.text.Text)7 TextFlow (javafx.scene.text.TextFlow)7 VBox (javafx.scene.layout.VBox)3 Label (javafx.scene.control.Label)2 ScrollPane (javafx.scene.control.ScrollPane)2 Slider (javafx.scene.control.Slider)2 Stage (javafx.stage.Stage)2 Test (org.junit.Test)2 SpecResource (com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.model.SpecResource)1 SpecTabPane (com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.tabs.SpecTabPane)1 File (java.io.File)1 KeyFrame (javafx.animation.KeyFrame)1 Timeline (javafx.animation.Timeline)1 Insets (javafx.geometry.Insets)1 Scene (javafx.scene.Scene)1 Button (javafx.scene.control.Button)1 Hyperlink (javafx.scene.control.Hyperlink)1 ImageView (javafx.scene.image.ImageView)1 BorderPane (javafx.scene.layout.BorderPane)1 HBox (javafx.scene.layout.HBox)1