本文整理匯總了Java中javafx.scene.paint.Color.WHITE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Color.WHITE屬性的具體用法?Java Color.WHITE怎麽用?Java Color.WHITE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類javafx.scene.paint.Color
的用法示例。
在下文中一共展示了Color.WHITE屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: start
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Atbash JWK Manager");
BorderPane root = new BorderPane();
Scene scene = new Scene(root, 600, 350, Color.WHITE);
primaryStage.setMinWidth(500);
primaryStage.setMinHeight(300);
new ApplicationMenu(primaryStage, root).initialize();
new HomeView(primaryStage, root).initialize();
new Footer(primaryStage, root).initialize();
root.prefHeightProperty().bind(scene.heightProperty());
root.prefWidthProperty().bind(scene.widthProperty());
primaryStage.setScene(scene);
primaryStage.show();
}
示例2: SunburstChart
public SunburstChart(final TreeNode TREE) {
backgroundPaint = Color.TRANSPARENT;
borderPaint = Color.TRANSPARENT;
borderWidth = 0d;
segments = new ArrayList<>(64);
_visibleData = VisibleData.NAME;
_textOrientation = TextOrientation.TANGENT;
_backgroundColor = Color.WHITE;
_textColor = Color.BLACK;
_useColorFromParent = false;
_decimals = 0;
_interactive = false;
_autoTextColor = true;
_brightTextColor = BRIGHT_TEXT_COLOR;
_darkTextColor = DARK_TEXT_COLOR;
_useChartDataTextColor = false;
formatString = "%.0f";
tree = TREE;
levelMap = new HashMap<>(8);
sizeListener = o -> resize();
initGraphics();
registerListeners();
}
示例3: DataUpdateDialog
public DataUpdateDialog(TatMain app, Window owner, FinancialMarket fm, TatConfig config, boolean bUpdateMode) {
super();
this.bUpdateMode = bUpdateMode;
this.fm = fm;
this.config = config;
setResizable(false);
initStyle(StageStyle.DECORATED);
initOwner(owner);
application = app;
if (bUpdateMode == true){
setTitle("View & update market data");
} else {
setTitle("Select a market data");
}
initModality(Modality.APPLICATION_MODAL);
Image appIcon = new Image("icon/UPDATE_MARKET_DATA.png");
getIcons().add(appIcon);
root = new Group();
Scene scene = new Scene(root, 700, 620, Color.WHITE);
ImagePattern pattern = new ImagePattern(new Image("icon/bk5.jpg"));
scene.setFill(pattern);
setScene(scene);
marketDataTreeView = new MarketDataTreeViewNode(application, fm, config, this.bUpdateMode);
initGui();
//Add listener to exit when press Esc key
addEventHandler(KeyEvent.KEY_PRESSED, (KeyEvent event) -> {
if (KeyCode.ESCAPE == event.getCode()) {
DataUpdateDialog.this.close();
}
});
setX(owner.getX() + Math.abs(owner.getWidth() - scene.getWidth()) / 2.0);
setY(owner.getY() + Math.abs(owner.getHeight() - scene.getHeight()) / 2.0);
}
示例4: makeErrorGUI
/**
* Make a Error Dialog
* @return BorderPane
*/
public void makeErrorGUI() {
root = new Group();
Scene scene = new Scene(root, 360, 185, Color.WHITE);
ImagePattern pattern = new ImagePattern(new Image("icon/bk2.jpg"));
scene.setFill(pattern);
setTitle("Error");
setScene(scene);
Image appIcon = new Image("icon/ERROR.png");
getIcons().add(appIcon);
BorderPane bp = new BorderPane();
textArea = new TextArea(message);
textArea.setEditable(false);
textArea.setWrapText(true);
textArea.setMaxWidth(320);
textArea.setMaxHeight(130);
HBox hBox = new HBox();
hBox.setSpacing(5);
hBox.setPadding(new Insets(5,0,0,0));
hBox.setAlignment(Pos.BOTTOM_RIGHT);
hBox.getChildren().addAll(openLogButton,okButton);
bp.setCenter(textArea);
bp.setBottom(hBox);
root.getChildren().add(bp);
sizeToScene();
setX(owner.getX() + Math.abs(owner.getWidth() - scene.getWidth()) / 2.0);
setY(owner.getY() + Math.abs(owner.getHeight() - scene.getHeight()) / 2.0);
}
示例5: SunburstChart
public SunburstChart(final TreeNode<T> TREE) {
backgroundPaint = Color.TRANSPARENT;
borderPaint = Color.TRANSPARENT;
borderWidth = 0d;
segments = new ArrayList<>(64);
_visibleData = VisibleData.NAME;
_textOrientation = TextOrientation.TANGENT;
_backgroundColor = Color.WHITE;
_textColor = Color.BLACK;
_useColorFromParent = false;
_decimals = 0;
_interactive = false;
_autoTextColor = true;
_brightTextColor = BRIGHT_TEXT_COLOR;
_darkTextColor = DARK_TEXT_COLOR;
_useChartItemTextColor = false;
formatString = "%.0f";
tree = TREE;
levelMap = new HashMap<>(8);
sizeListener = o -> resize();
initGraphics();
registerListeners();
}
示例6: makeInfoGUI
/**
* Make Information Dialog
* @return BorderPane
*/
public void makeInfoGUI() {
root = new Group();
Scene scene = new Scene(root, 360, 185, Color.WHITE);
ImagePattern pattern = new ImagePattern(new Image("icon/bk2.jpg"));
scene.setFill(pattern);
setTitle("Information");
setScene(scene);
Image appIcon = new Image("icon/INFO.png");
getIcons().add(appIcon);
BorderPane bp = new BorderPane();
textArea = new TextArea(message);
textArea.setEditable(false);
textArea.setWrapText(true);
textArea.setMaxWidth(320);
textArea.setMaxHeight(130);
HBox hBox = new HBox();
hBox.setSpacing(5);
hBox.setPadding(new Insets(5,0,0,0));
hBox.setAlignment(Pos.BOTTOM_RIGHT);
hBox.getChildren().addAll(okButton);
bp.setCenter(textArea);
bp.setBottom(hBox);
root.getChildren().add(bp);
sizeToScene();
setX(owner.getX() + Math.abs(owner.getWidth() - scene.getWidth()) / 2.0);
setY(owner.getY() + Math.abs(owner.getHeight() - scene.getHeight()) / 2.0);
}
示例7: DataImportDialog
public DataImportDialog(Window owner, FinancialMarket fm, TatConfig config) {
super();
this.fm = fm;
this.config = config;
setResizable(false);
initStyle(StageStyle.DECORATED);
initOwner(owner);
setTitle("Financial Market Import");
initModality(Modality.APPLICATION_MODAL);
Image appIcon = new Image("icon/IMPORT_MARKET_DATA.png");
getIcons().add(appIcon);
root = new Group();
Scene scene = new Scene(root, 500, 440, Color.WHITE);
ImagePattern pattern = new ImagePattern(new Image("icon/bk5.jpg"));
scene.setFill(pattern);
setScene(scene);
initGui();
//Add listener to exit when press Esc key
addEventHandler(KeyEvent.KEY_PRESSED, (KeyEvent event) -> {
if (KeyCode.ESCAPE == event.getCode()) {
DataImportDialog.this.close();
}
if (KeyCode.ENTER == event.getCode()) {
doImport();
}
});
setX(owner.getX() + Math.abs(owner.getWidth() - scene.getWidth()) / 2.0);
setY(owner.getY() + Math.abs(owner.getHeight() - scene.getHeight()) / 2.0);
}
示例8: createIndicatorCircle
private Circle createIndicatorCircle(int i) {
Circle circle = new Circle(INDICATOR_RADIUS, Color.WHITE);
circle.setStroke(Color.BLACK);
circle.fillProperty().bind(
new When(
currentStep.greaterThanOrEqualTo(i))
.then(Color.DODGERBLUE)
.otherwise(Color.WHITE));
return circle;
}
示例9: testChangeTrueColor
@Test
@Disabled
public void testChangeTrueColor() {
final Color color = Color.WHITE;
widget.getSource().setData(true);
widget.setTrueColor(color);
WaitForAsyncUtils.waitForFxEvents();
assertEquals(color, getBackground(), "Background was the wrong color");
}
示例10: getImagePixel
public static Color getImagePixel(File file) {
try {
return getImagePixel(new FileInputStream(file));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
return Color.WHITE;
}
示例11: getMaxCount
public static Color getMaxCount(List<String> s) {
List<String> list = s;
Map<String, Integer> map = new HashMap<String, Integer>();
for (String c : list) {
Integer l = map.get(c);
if (l == null)
l = 1;
else
l++;
map.put(c, l);
}
String max = null;
long num = 0;
for (Map.Entry<String, Integer> entry : map.entrySet()) {
String key = entry.getKey();
Integer temp = entry.getValue();
if (max == null || temp > num) {
max = key;
num = temp;
}
}
String str[] = max.split("\\-");
if (str.length == 3) {
return Color.rgb(Integer.parseInt(str[0]), Integer.parseInt(str[1]),
Integer.parseInt(str[2]));
}
return Color.WHITE;
}
示例12: CoxcombChart
public CoxcombChart(final List<ChartItem> ITEMS) {
width = PREFERRED_WIDTH;
height = PREFERRED_HEIGHT;
size = PREFERRED_WIDTH;
items = FXCollections.observableArrayList(ITEMS);
_textColor = Color.WHITE;
_autoTextColor = true;
_order = Order.DESCENDING;
_equalSegmentAngles = false;
itemListener = e -> reorder(getOrder());
itemListListener = c -> {
while (c.next()) {
if (c.wasAdded()) {
c.getAddedSubList().forEach(addedItem -> addedItem.setOnItemEvent(itemListener));
reorder(getOrder());
} else if (c.wasRemoved()) {
c.getRemoved().forEach(removedItem -> removedItem.removeItemEventListener(itemListener));
reorder(getOrder());
}
}
redraw();
};
mouseHandler = e -> handleMouseEvent(e);
listeners = new CopyOnWriteArrayList<>();
initGraphics();
registerListeners();
}
示例13: prepareTimeGrahLabelsContents
private Node prepareTimeGrahLabelsContents(Collection<StateRectangle> stateRectangles,
TimeRange windowRange) {
double minX = getWidget().timestampToPaneXPos(windowRange.getStartTime());
final String ellipsisStr = DebugOptions.ELLIPSIS_STRING;
final double ellipsisWidth = getWidget().getDebugOptions().getEllipsisWidth();
final Font textFont = getWidget().getDebugOptions().stateLabelFont.get();
final OverrunStyle overrunStyle = OverrunStyle.ELLIPSIS;
final Color textColor = Color.WHITE;
/* Requires a ~2 pixels adjustment to be centered on the states */
final double yOffset = TimeGraphWidget.ENTRY_HEIGHT / 2.0 + 2.0;
Collection<Node> texts = stateRectangles.stream()
/* Only try to annotate rectangles that are large enough */
.filter(stateRect -> stateRect.getWidth() > ellipsisWidth)
.filter(stateRect -> stateRect.getStateInterval().getLabel() != null)
.map(stateRect -> {
String labelText = requireNonNull(stateRect.getStateInterval().getLabel());
/* A small offset looks better here */
double textX = Math.max(minX, stateRect.getX()) + 4.0;
double textY = stateRect.getY() + yOffset;
double rectEndX = stateRect.getX() + stateRect.getWidth();
double minWidth = rectEndX - textX;
String ellipsedText = JfxUtils.computeClippedText(textFont,
labelText,
minWidth,
overrunStyle,
ellipsisStr);
if (ellipsedText.equals(ellipsisStr)) {
return null;
}
Text text = new Text(textX, textY, ellipsedText);
text.setFont(textFont);
text.setFill(textColor);
return text;
})
.filter(Objects::nonNull)
.collect(Collectors.toList());
return new Group(texts);
}
示例14: SanFranciscoFireworks
public SanFranciscoFireworks() {
// create a color palette of 180 colors
colors = new Paint[181];
colors[0] = new RadialGradient(0, 0, 0.5, 0.5, 0.5, true, CycleMethod.NO_CYCLE,
new Stop(0, Color.WHITE),
new Stop(0.2, Color.hsb(59, 0.38, 1)),
new Stop(0.6, Color.hsb(59, 0.38, 1,0.1)),
new Stop(1, Color.hsb(59, 0.38, 1,0))
);
for (int h=0;h<360;h+=2) {
colors[1+(h/2)] = new RadialGradient(0, 0, 0.5, 0.5, 0.5, true, CycleMethod.NO_CYCLE,
new Stop(0, Color.WHITE),
new Stop(0.2, Color.hsb(h, 1, 1)),
new Stop(0.6, Color.hsb(h, 1, 1,0.1)),
new Stop(1, Color.hsb(h, 1, 1,0))
);
}
// create canvas
canvas = new Canvas(1024, 500);
canvas.setBlendMode(BlendMode.ADD);
canvas.setEffect(new Reflection(0,0.4,0.15,0));
background = new ImageView(getClass().getResource("sf.jpg").toExternalForm());
getChildren().addAll(background,canvas);
// create animation timer that will be called every frame
// final AnimationTimer timer = new AnimationTimer() {
timer = new AnimationTimer() {
@Override public void handle(long now) {
GraphicsContext gc = canvas.getGraphicsContext2D();
// clear area with transparent black
gc.setFill(Color.rgb(0, 0, 0, 0.2));
gc.fillRect(0, 0, 1024, 708);
// draw fireworks
drawFireworks(gc);
// countdown to launching the next firework
if (countDownTillNextFirework == 0) {
countDownTillNextFirework = 10 + (int)(Math.random()*30);
fireParticle();
}
countDownTillNextFirework --;
}
};
}
示例15: LegendItem
public LegendItem(final Symbol SYMBOL, final String TEXT, final Color SYMBOL_FILL) {
this(SYMBOL, TEXT, SYMBOL_FILL, Color.WHITE, Color.BLACK);
}