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);
}
}
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();
}
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();
}
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);
}
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);
}
Aggregations