use of jfxtras.scene.layout.HBox in project Gargoyle by callakrsos.
the class DesignerFx method createXPathVersionPanel.
private javafx.scene.Node createXPathVersionPanel() {
HBox p = new HBox(5);
p.setPadding(new Insets(5, 5, 5, 5));
// JPanel p = new JPanel();
Label e = new Label("XPath Version:");
e.setAlignment(Pos.CENTER_LEFT);
p.add(e);
for (Object[] values : XPathRule.VERSION_DESCRIPTOR.choices()) {
// JRadioButton b = new JRadioButton();
RadioButton b = new RadioButton((String) values[0]);
// b.setText((String) values[0]);
b.setUserData(b.getText());
// b.setActionCommand(b.getText());
if (values[0].equals(XPathRule.VERSION_DESCRIPTOR.defaultValue())) {
b.setSelected(true);
}
b.setToggleGroup(xpathVersionButtonGroup);
// xpathVersionButtonGroup.add(b);
p.add(b);
}
// createSwingContent(swingNode, p);
return p;
}
use of jfxtras.scene.layout.HBox 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 jfxtras.scene.layout.HBox in project Gargoyle by callakrsos.
the class DesignerFx method createXPathQueryPanel.
private BorderPane createXPathQueryPanel() {
BorderPane borderPane = new BorderPane();
// JPanel p = new JPanel();
// p.setLayout(new BorderLayout());
// xpathQueryArea.setBorder(BorderFactory.createLineBorder(Color.black));
// makeTextComponentUndoable(xpathQueryArea);
// ScrollPane scrollPane = new ScrollPane(xpathQueryArea);
// scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
// scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
final Button b = createGoButton();
BorderPane topBorderPane = new BorderPane();
// JPanel topPanel = new JPanel();
// topPanel.setLayout(new BorderLayout());
Label value = new Label("XPath Query (if any):");
// value.setPrefSize(Label.USE_COMPUTED_SIZE, Double.MAX_VALUE);
value.setAlignment(Pos.CENTER_LEFT);
HBox value2 = new HBox(5, value);
value2.setPadding(new Insets(5, 5, 5, 5));
topBorderPane.setLeft(value2);
// topPanel.add(new JLabel("XPath Query (if any):"), BorderLayout.WEST);
// topPanel.add(createXPathVersionPanel(), BorderLayout.EAST);
topBorderPane.setRight(createXPathVersionPanel());
borderPane.setBottom(b);
// SwingNode scrollPaneFx = new SwingNode();
// createSwingContent(scrollPaneFx, scrollPane);
borderPane.setCenter(xpathQueryArea);
// p.add(topPanel, BorderLayout.NORTH);
// p.add(scrollPane, BorderLayout.CENTER);
borderPane.setTop(topBorderPane);
// createSwingContent(swingNode, p);
return borderPane;
}
use of jfxtras.scene.layout.HBox in project Gargoyle by callakrsos.
the class ColorAnalysisExam method start.
/*
* (non-Javadoc)
*
* @see javafx.application.Application#start(javafx.stage.Stage)
*/
@Override
public void start(Stage primaryStage) throws Exception {
BorderPane root = new BorderPane();
ColorPicker value = new ColorPicker();
root.setTop(value);
List<Label> arrayList = new ArrayList<>();
for (int i = 0; i < 7; i++) {
Label region = new Label();
region.setPrefWidth(100);
region.setPrefHeight(100);
String text = "";
switch(i) {
case 0:
text = "Default";
break;
case 1:
text = "Brigher";
break;
case 2:
text = "darker";
break;
case 3:
text = "desaturate";
break;
case 4:
text = "grayscale";
break;
case 5:
text = "invert";
break;
case 6:
text = "saturate";
break;
}
region.setText(text);
arrayList.add(region);
}
Region region2 = new Region();
region2.setPrefWidth(100);
region2.setPrefHeight(100);
value.valueProperty().addListener((oba, o, n) -> {
arrayList.get(0).setBackground(new Background(new BackgroundFill(n, CornerRadii.EMPTY, new Insets(0))));
arrayList.get(1).setBackground(new Background(new BackgroundFill(n.brighter(), CornerRadii.EMPTY, new Insets(0))));
arrayList.get(2).setBackground(new Background(new BackgroundFill(n.darker(), CornerRadii.EMPTY, new Insets(0))));
arrayList.get(3).setBackground(new Background(new BackgroundFill(n.desaturate(), CornerRadii.EMPTY, new Insets(0))));
arrayList.get(4).setBackground(new Background(new BackgroundFill(n.grayscale(), CornerRadii.EMPTY, new Insets(0))));
arrayList.get(5).setBackground(new Background(new BackgroundFill(n.invert(), CornerRadii.EMPTY, new Insets(0))));
arrayList.get(6).setBackground(new Background(new BackgroundFill(n.saturate(), CornerRadii.EMPTY, new Insets(0))));
});
HBox value2 = new HBox();
value2.getChildren().addAll(arrayList);
root.setCenter(value2);
primaryStage.setScene(new Scene(root));
primaryStage.show();
}
Aggregations