当前位置: 首页>>代码示例>>Java>>正文


Java MarkerType类代码示例

本文整理汇总了Java中eu.hansolo.medusa.Marker.MarkerType的典型用法代码示例。如果您正苦于以下问题:Java MarkerType类的具体用法?Java MarkerType怎么用?Java MarkerType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MarkerType类属于eu.hansolo.medusa.Marker包,在下文中一共展示了MarkerType类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: build

import eu.hansolo.medusa.Marker.MarkerType; //导入依赖的package包/类
public final Marker build() {
    final Marker MARKER = new Marker();
    for (String key : properties.keySet()) {
        if ("value".equals(key)) {
            MARKER.setValue(((DoubleProperty) properties.get(key)).get());
        } else if("text".equals(key)) {
            MARKER.setText(((StringProperty) properties.get(key)).get());
        } else if ("color".equals(key)) {
            MARKER.setColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("markerType".equals(key)) {
            MARKER.setMarkerType(((ObjectProperty<MarkerType>) properties.get(key)).get());
        } else if ("onMarkerPressed".equals(key)) {
            MARKER.setOnMarkerPressed(((ObjectProperty<EventHandler>) properties.get(key)).get());
        } else if ("onMarkerReleased".equals(key)) {
            MARKER.setOnMarkerReleased(((ObjectProperty<EventHandler>) properties.get(key)).get());
        } else if ("onMarkerExceeded".equals(key)) {
            MARKER.setOnMarkerExceeded(((ObjectProperty<EventHandler>) properties.get(key)).get());
        } else if ("onMarkerUnderrun".equals(key)) {
            MARKER.setOnMarkerUnderrun(((ObjectProperty<EventHandler>) properties.get(key)).get());
        } else if ("styleClass".equals(key)) {
            MARKER.setStyleClass(((StringProperty) properties.get(key)).get());
        }
    }
    return MARKER;
}
 
开发者ID:HanSolo,项目名称:Medusa,代码行数:26,代码来源:MarkerBuilder.java

示例2: testGauge

import eu.hansolo.medusa.Marker.MarkerType; //导入依赖的package包/类
@Test
public void testGauge() throws InterruptedException {
  GridPane pane = new GridPane();
  Gauge gauge = GaugeBuilder.create().minValue(0).maxValue(100)
      .tickLabelDecimals(0).decimals(1).autoScale(true).animated(true)
      // .backgroundPaint(Color.TRANSPARENT)
      // .borderPaint(Color.LIGHTGRAY)
      // .knobColor(Color.rgb(0, 90, 120))
      .shadowsEnabled(true)
      // .tickLabelColor(Color.rgb(0, 175, 248))
      // .ledColor(Color.rgb(0, 175, 248))
      .ledVisible(true).ledBlinking(true).sectionsVisible(true)
      .sections(new Section(75, 100, Color.rgb(139, 195, 102, 0.5)))
      .areasVisible(true)
      .areas(new Section(0.00, 25, Color.rgb(234, 83, 79, 0.5)))
      .majorTickMarkColor(Color.MAGENTA)
      // .minorTickMarkColor(Color.rgb(0, 175, 248))
      .majorTickMarkType(TickMarkType.TRAPEZOID)
      .mediumTickMarkType(TickMarkType.DOT)
      .minorTickMarkType(TickMarkType.LINE)
      .tickLabelOrientation(TickLabelOrientation.ORTHOGONAL)
      .tickMarkSections(new Section(0.25, 0.5, Color.rgb(241, 161, 71)))
      .tickMarkSectionsVisible(true)
      .markers(new Marker(0.5, "", Color.CYAN, MarkerType.TRIANGLE))
      .markersVisible(true)
      // .majorTickMarksVisible(true)
      // .minorTickMarksVisible(true)
      .tickLabelLocation(TickLabelLocation.INSIDE)
      // .tickLabelsVisible(true)
      .tickLabelSections(new Section(0.1, 0.3, Color.rgb(0, 175, 248)))
      // .tickLabelSectionsVisible(true)
      .title("SOC")
      // .titleColor(Color.rgb(223, 223, 223))
      .unit("%").lcdDesign(LcdDesign.SECTIONS).lcdVisible(true)
      .lcdFont(LcdFont.STANDARD)
      // .unitColor(Color.rgb(223, 223, 223))
      // .valueColor(Color.rgb(223, 223, 223))
      .needleSize(NeedleSize.THICK).build();
  FGauge framedGauge = new FGauge(gauge, GaugeDesign.ENZO,
      GaugeBackground.DARK_GRAY);

  pane.add(framedGauge, 0, 0);

  DoubleProperty dproperty = new SimpleDoubleProperty(85.0);

  SampleApp sampleApp = new SampleApp("Gauge", pane, 67, 2, 2);
  sampleApp.show();
  sampleApp.waitOpen();
  Stage stage = sampleApp.getStage();
  framedGauge.prefWidthProperty().bind(stage.widthProperty());
  framedGauge.prefHeightProperty().bind(stage.heightProperty());
  gauge.valueProperty().bind(dproperty);
  while (stage.isShowing()) {
    Thread.sleep(15);
    Platform.runLater(() -> dproperty.setValue(dproperty.getValue() - 0.1));
    if (dproperty.getValue() < 45)
      sampleApp.close();
  }
}
 
开发者ID:BITPlan,项目名称:can4eve,代码行数:60,代码来源:TestAppGUI.java

示例3: markerType

import eu.hansolo.medusa.Marker.MarkerType; //导入依赖的package包/类
public final B markerType(final MarkerType TYPE) {
    properties.put("markerType", new SimpleObjectProperty<>(TYPE));
    return (B)this;
}
 
开发者ID:HanSolo,项目名称:Medusa,代码行数:5,代码来源:MarkerBuilder.java


注:本文中的eu.hansolo.medusa.Marker.MarkerType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。