Search in sources :

Example 41 with Text

use of javafx.scene.text.Text 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 42 with Text

use of javafx.scene.text.Text in project Gargoyle by callakrsos.

the class LettersPane method createLetter.

public void createLetter(String c) {
    final Text letter = new Text(c);
    letter.setFill(Color.BLACK);
    letter.setFont(FONT_DEFAULT);
    letter.setTextOrigin(VPos.TOP);
    letter.setTranslateX((getWidth() - letter.getBoundsInLocal().getWidth()) / 2);
    letter.setTranslateY((getHeight() - letter.getBoundsInLocal().getHeight()) / 2);
    getChildren().add(letter);
    createRandomTimeLine(letter).play();
}
Also used : Text(javafx.scene.text.Text)

Example 43 with Text

use of javafx.scene.text.Text 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 44 with Text

use of javafx.scene.text.Text in project FXGL by AlmasB.

the class ScifiSample method initUI.

@Override
protected void initUI() {
    getGameScene().removeUINode(levelText);
    getGameScene().removeUINode(panel);
    levelText = new LevelText("Level " + (level - 1));
    getGameScene().addUINode(levelText);
    panel = new InGamePanel();
    Text text = getUIFactory().newText("No Network Connection", Color.BLACK, 24.0);
    text.setTranslateX(getWidth() / 3 / 2 - text.getLayoutBounds().getWidth() / 2);
    text.setTranslateY(getHeight() / 2);
    panel.getChildren().add(text);
    getGameScene().addUINode(panel);
}
Also used : InGamePanel(com.almasb.fxgl.ui.InGamePanel) LevelText(com.almasb.fxgl.ui.LevelText) Text(javafx.scene.text.Text) LevelText(com.almasb.fxgl.ui.LevelText)

Example 45 with Text

use of javafx.scene.text.Text in project FXGL by AlmasB.

the class HighlightSample method initUI.

@Override
protected void initUI() {
    Text text = getUIFactory().newText("Level 1", Color.WHITESMOKE, 46.0);
    DropShadow ds = new DropShadow(25, 0, 0, Color.BLACK);
    text.setEffect(ds);
    getUIFactory().centerText(text);
    getGameScene().addUINode(text);
}
Also used : Text(javafx.scene.text.Text) DropShadow(javafx.scene.effect.DropShadow)

Aggregations

Text (javafx.scene.text.Text)313 VBox (javafx.scene.layout.VBox)55 TextFlow (javafx.scene.text.TextFlow)55 Label (javafx.scene.control.Label)51 Pane (javafx.scene.layout.Pane)34 Font (javafx.scene.text.Font)30 Button (javafx.scene.control.Button)25 Region (javafx.scene.layout.Region)25 Group (javafx.scene.Group)23 GridPane (javafx.scene.layout.GridPane)23 List (java.util.List)22 Rectangle (javafx.scene.shape.Rectangle)22 HBox (javafx.scene.layout.HBox)21 StackPane (javafx.scene.layout.StackPane)20 Color (javafx.scene.paint.Color)20 Insets (javafx.geometry.Insets)17 Canvas (javafx.scene.canvas.Canvas)17 Circle (javafx.scene.shape.Circle)17 TextWithStyle (org.phoenicis.javafx.views.common.TextWithStyle)17 ScrollPane (javafx.scene.control.ScrollPane)16