本文整理汇总了Java中javafx.scene.chart.NumberAxis.setMinorTickVisible方法的典型用法代码示例。如果您正苦于以下问题:Java NumberAxis.setMinorTickVisible方法的具体用法?Java NumberAxis.setMinorTickVisible怎么用?Java NumberAxis.setMinorTickVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.chart.NumberAxis
的用法示例。
在下文中一共展示了NumberAxis.setMinorTickVisible方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createIntegerTimingDiagram
import javafx.scene.chart.NumberAxis; //导入方法依赖的package包/类
/**
* Generates an integer timing diagram.
*
* @param concreteSpec the concrete specification which should be used to extract the needed
* information
* @param specIoVar the variable for which a diagram should be generated
* @param globalXAxis global x axis used for all diagrams
* @param selection selection that should be updated when hovering with mouse
* @param activated only update selection if true
* @return A {@link Pair} which holds a {@link TimingDiagramController} and a {@link NumberAxis}
*/
public static Pair<TimingDiagramController, Axis> createIntegerTimingDiagram(
ConcreteSpecification concreteSpec, ValidIoVariable specIoVar, NumberAxis globalXAxis,
Selection selection, BooleanProperty activated) {
NumberAxis yaxis = new NumberAxis(0, 10, 1);
yaxis.setPrefWidth(30);
yaxis.setSide(Side.LEFT);
yaxis.setTickLabelFormatter(new IntegerTickLabelConverter());
yaxis.setMinorTickVisible(false);
TimingDiagramController timingDiagramController = new TimingDiagramController(globalXAxis,
yaxis, concreteSpec, specIoVar, selection, activated);
return new ImmutablePair<>(timingDiagramController, yaxis);
}
示例2: draw
import javafx.scene.chart.NumberAxis; //导入方法依赖的package包/类
@Override
public void draw() {
NumberAxis xAxis = new NumberAxis();
NumberAxis yAxis = new NumberAxis();
xAxis.setMinorTickVisible(false);
xAxis.setTickMarkVisible(false);
xAxis.setTickLabelsVisible(false);
xAxis.setAutoRanging(false);
yAxis.setMinorTickVisible(false);
yAxis.setTickMarkVisible(false);
yAxis.setLabel("ms");
XYChart.Series<Number, Number> youngSeries = new XYChart.Series<>();
XYChart.Series<Number, Number> concurrentSeries = new XYChart.Series<>();
XYChart.Series<Number, Number> fullSeries = new XYChart.Series<>();
ScatterChart<Number, Number> chart = new ScatterChart<Number, Number>(xAxis, yAxis, FXCollections.observableArrayList(youngSeries, concurrentSeries, fullSeries));
chart.setAnimated(false);
chart.setLegendVisible(false);
Stage stage = super.createStage(chart, "Pause time");
for(LogData log : super.logdata){
String phase;
double time;
if(!super.shouldProcess(log) || (log.getTags().size() != 1)){
continue;
}
long gcid = super.getGcId();
Matcher matcher = PAUSE_TIME_PATTERN.matcher(super.getLogBody());
if(!matcher.matches()){
continue;
}
phase = matcher.group(1);
time = Double.parseDouble(matcher.group(2));
LogTimeValue logTimeValue = LogTimeValue.getLogTimeValue(log, super.chartWizardController.getTimeRange());
XYChart.Data<Number, Number> data = new XYChart.Data<>(logTimeValue.getValue(), time);
if(phase.startsWith("Full")){
fullSeries.getData().add(data);
data.getNode().setStyle("-fx-background-color: black;");
}
else if(phase.startsWith("Young")) {
youngSeries.getData().add(data);
data.getNode().setStyle("-fx-background-color: skyblue;");
}
else{
concurrentSeries.getData().add(data);
data.getNode().setStyle("-fx-background-color: orange;");
}
data.getNode().addEventHandler(MouseEvent.MOUSE_ENTERED_TARGET, e -> setTooltipValue(logTimeValue.toString(), phase, gcid));
data.getNode().addEventHandler(MouseEvent.MOUSE_CLICKED, e -> super.showLogWindow(super.gcEventList.get(gcid), "GC ID: " + gcid));
Tooltip.install(data.getNode(), tooltip);
}
if(youngSeries.getData().isEmpty() && concurrentSeries.getData().isEmpty() && fullSeries.getData().isEmpty()){
(new Alert(Alert.AlertType.ERROR, "No GC data", ButtonType.OK)).showAndWait();
return;
}
DoubleSummaryStatistics stats = Stream.concat(youngSeries.getData().stream(), Stream.concat(concurrentSeries.getData().stream(), fullSeries.getData().stream()))
.mapToDouble(d -> d.getXValue().doubleValue())
.summaryStatistics();
xAxis.setLowerBound(stats.getMin());
xAxis.setUpperBound(stats.getMax());
stage.show();
}
示例3: draw
import javafx.scene.chart.NumberAxis; //导入方法依赖的package包/类
@Override
public void draw() {
collectVmOpInfo();
NumberAxis xAxis = new NumberAxis();
NumberAxis yAxis = new NumberAxis();
xAxis.setMinorTickVisible(false);
xAxis.setTickMarkVisible(false);
xAxis.setTickLabelsVisible(false);
xAxis.setAutoRanging(false);
yAxis.setMinorTickVisible(false);
yAxis.setTickMarkVisible(false);
XYChart.Series<Number, Number> series = new XYChart.Series<>();
ScatterChart<Number, Number> chart = new ScatterChart<Number, Number>(xAxis, yAxis, FXCollections.observableArrayList(series));
chart.setAnimated(false);
chart.setLegendVisible(false);
Stage stage = super.createStage(chart, "VM Operations");
for(Map.Entry<LogTimeValue, List<LogData>> entry : vmOpMap.entrySet()){
double elapsedTime = LogTimeValue.getLogTimeValue(entry.getValue().get(entry.getValue().size() - 1), super.chartWizardController.getTimeRange()).getValue().doubleValue() - entry.getKey().getValue().doubleValue();
XYChart.Data<Number, Number> data = new XYChart.Data<>(entry.getKey().getValue(), elapsedTime);
series.getData().add(data);
Matcher matcher = VMOP_START_PATTERN.matcher(entry.getValue().get(0).getMessage());
matcher.matches();
String opName = matcher.group(2);
data.getNode().addEventHandler(MouseEvent.MOUSE_ENTERED_TARGET, e -> setTooltipText(entry.getKey().toString(), opName, elapsedTime));
data.getNode().addEventHandler(MouseEvent.MOUSE_CLICKED, e -> super.showLogWindow(entry.getValue(), entry.getKey().toString() + ": " + opName));
Tooltip.install(data.getNode(), tooltip);
}
if(series.getData().isEmpty()){
(new Alert(Alert.AlertType.ERROR, "No VM Operation data", ButtonType.OK)).showAndWait();
return;
}
DoubleSummaryStatistics stats = series.getData()
.stream()
.mapToDouble(d -> d.getXValue().doubleValue())
.summaryStatistics();
xAxis.setLowerBound(stats.getMin());
xAxis.setUpperBound(stats.getMax());
stage.show();
}
示例4: draw
import javafx.scene.chart.NumberAxis; //导入方法依赖的package包/类
@Override
public void draw() {
NumberAxis xAxis = new NumberAxis();
NumberAxis yAxis = new NumberAxis();
xAxis.setMinorTickVisible(false);
xAxis.setTickMarkVisible(false);
xAxis.setTickLabelsVisible(false);
xAxis.setAutoRanging(false);
yAxis.setMinorTickVisible(false);
yAxis.setTickMarkVisible(false);
yAxis.setLabel("MB");
XYChart.Series<Number, Long> capacitySeries = new XYChart.Series<>();
XYChart.Series<Number, Long> usageSeries = new XYChart.Series<>();
AreaChart<Number, Long> chart = new AreaChart(xAxis, yAxis, FXCollections.observableArrayList(capacitySeries, usageSeries));
chart.setAnimated(false);
chart.setLegendVisible(false);
chart.lookup(".series0").setStyle("-fx-fill: red; -fx-stroke: red;"); // capacity
chart.lookup(".series1").setStyle("-fx-fill: blue; -fx-stroke: blue;"); // usage
Stage stage = super.createStage(chart, "Metaspace usage");
for(LogData log : super.logdata){
long capacity;
long usage;
if(!super.shouldProcess(log) || (log.getTags().size() != 2) || !log.getTags().contains("metaspace")){
continue;
}
long gcid = super.getGcId();
Matcher matcher = METASPACE_USAGE_PATTERN.matcher(super.getLogBody());
if(!matcher.matches()){
continue;
}
usage = Long.parseLong(matcher.group(1)) / 1024; // in MB
capacity = Long.parseLong(matcher.group(2)) / 1024; // in MB
LogTimeValue logTimeValue = LogTimeValue.getLogTimeValue(log, super.chartWizardController.getTimeRange());
XYChart.Data<Number, Long> capacityData = new XYChart.Data<>(logTimeValue.getValue(), capacity);
XYChart.Data<Number, Long> usageData = new XYChart.Data<>(logTimeValue.getValue(), usage);
capacitySeries.getData().add(capacityData);
usageSeries.getData().add(usageData);
Node capacityDataNode = capacityData.getNode();
Node usageDataNode = usageData.getNode();
capacityDataNode.lookup(".chart-area-symbol").setStyle(BASE_SYMBOL_STYLE + "-fx-background-color: white, red;");
usageDataNode.lookup(".chart-area-symbol").setStyle(BASE_SYMBOL_STYLE + "-fx-background-color: white, blue;");
capacityDataNode.addEventHandler(MouseEvent.MOUSE_ENTERED_TARGET, e -> capacityDataNode.setOpacity(1.0d));
capacityDataNode.addEventHandler(MouseEvent.MOUSE_EXITED_TARGET, e -> capacityDataNode.setOpacity(0.0d));
usageDataNode.addEventHandler(MouseEvent.MOUSE_ENTERED_TARGET, e -> usageDataNode.setOpacity(1.0d));
usageDataNode.addEventHandler(MouseEvent.MOUSE_EXITED_TARGET, e -> usageDataNode.setOpacity(0.0d));
capacityDataNode.addEventHandler(MouseEvent.MOUSE_ENTERED_TARGET, e -> setTooltipValue(logTimeValue.toString(), capacity, usage, gcid));
usageDataNode.addEventHandler(MouseEvent.MOUSE_ENTERED_TARGET, e -> setTooltipValue(logTimeValue.toString(), capacity, usage, gcid));
capacityDataNode.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> super.showLogWindow(super.gcEventList.get(gcid), "GC ID: " + gcid));
usageDataNode.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> super.showLogWindow(super.gcEventList.get(gcid), "GC ID: " + gcid));
Tooltip.install(capacityData.getNode(), tooltip);
Tooltip.install(usageData.getNode(), tooltip);
}
if(capacitySeries.getData().size() == 0){
(new Alert(Alert.AlertType.ERROR, "No GC data", ButtonType.OK)).showAndWait();
return;
}
xAxis.setLowerBound(capacitySeries.getData().get(0).getXValue().doubleValue());
xAxis.setUpperBound(capacitySeries.getData().get(capacitySeries.getData().size() - 1).getXValue().doubleValue());
stage.show();
}
示例5: init
import javafx.scene.chart.NumberAxis; //导入方法依赖的package包/类
private void init(Stage primaryStage) {
instance = this;
xAxis = new NumberAxis();
xAxis.setForceZeroInRange(false);
xAxis.setAutoRanging(true);
xAxis.setLabel("Time");
xAxis.setTickLabelsVisible(false);
xAxis.setTickMarkVisible(true);
xAxis.setMinorTickVisible(false);
yAxis = new NumberAxis();
yAxis.setAutoRanging(false);
yAxis.setForceZeroInRange(false);
//yAxis.setLowerBound(210.4);
//yAxis.setUpperBound(212);
yAxis.setLabel("Stock Price ($)");
//-- Chart
final LineChart<Number, Number> sc = new LineChart<Number, Number>(xAxis, yAxis) {
// Override to remove symbols on each data point
@Override
protected void dataItemAdded(Series<Number, Number> series, int itemIndex, Data<Number, Number> item) {
}
};
sc.setCursor(Cursor.CROSSHAIR);
sc.setAnimated(false);
sc.setId("stockChart");
// sc.setTitle("Stock Price");
//-- Chart Series
stockPriceSeries = new XYChart.Series<Number, Number>();
stockPriceSeries.setName("Last Close");
emaPriceSeries = new XYChart.Series<Number, Number>();
emaPriceSeries.setName("Med Avg");
predictionSeries = new XYChart.Series<Number, Number>();
predictionSeries.setName("Predicted Med Avg.");
sc.getData().addAll(stockPriceSeries, emaPriceSeries, predictionSeries);
sc.getStylesheets().add("style.css");
sc.applyCss();
primaryStage.setScene(new Scene(sc));
}