• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AnchorLocation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getAnchorLocation

import javafx.stage.PopupWindow.AnchorLocation; //导入依赖的package包/类
/**
 * Returns the position of the upper left corner of the popover winndow
 * 
 * @param pos
 * @return
 */
public static AnchorLocation getAnchorLocation() {
	ConfigIO cfg = ConfigIO.getInstance();
	cfg.getScreenPositionId();
	int scrPosId = cfg.getScreenPositionId();
	ScreenPosition screenPos = getScreenPosition(scrPosId);
	Pos pos = screenPos.getPos();

	switch (pos) {
	case TOP_LEFT:
		return AnchorLocation.CONTENT_TOP_LEFT;

	case TOP_RIGHT:
		return AnchorLocation.CONTENT_TOP_RIGHT;

	case BOTTOM_LEFT:
		return AnchorLocation.CONTENT_BOTTOM_LEFT;

	case BOTTOM_RIGHT:
		return AnchorLocation.CONTENT_BOTTOM_RIGHT;
	default:
		return AnchorLocation.CONTENT_TOP_LEFT;
	}
}
 
开发者ID:michaelnetter,项目名称:dracoon-dropzone,代码行数:30,代码来源:Util.java


示例2: onFilterButtonClicked

import javafx.stage.PopupWindow.AnchorLocation; //导入依赖的package包/类
private void onFilterButtonClicked(MouseEvent event) {
	if (!filterPopup.isShowing()) {
		Bounds bounds = header.getBoundsInLocal();
		Bounds screenBounds = header.localToScreen(bounds);
		int lastColIndex = tableFilter.getTableView().getColumns().size() - 1;
		int thisColIndex = tableFilter.getTableView().getColumns().indexOf(column);
		double xpos;
		if (thisColIndex == lastColIndex) {
			filterPopup.setAnchorLocation(AnchorLocation.CONTENT_TOP_RIGHT);
			Bounds boundsTable = tableFilter.getTableView().getBoundsInLocal();
			Bounds screentToTable = tableFilter.getTableView().localToScreen(boundsTable);
			xpos = screentToTable.getMaxX();
		} else {
			filterPopup.setAnchorLocation(AnchorLocation.CONTENT_TOP_LEFT);
			xpos = screenBounds.getMinX();
		}
		// TODO hack to init with right width
		filterPopup.show(header.getScene().getWindow());
		filterPopup.hide();
		filterPopup.show(header, xpos, screenBounds.getMaxY());
	}
	event.consume();
}
 
开发者ID:maimArt,项目名称:TableFilterFX,代码行数:24,代码来源:ColumnFilter.java


示例3: setTooltipsAndGraphics

import javafx.stage.PopupWindow.AnchorLocation; //导入依赖的package包/类
private void setTooltipsAndGraphics()
{
	Tooltip wwwTooltip = new Tooltip("Who What Where listens to network traffic and analyzes IP packets. Analysis includes geographical location, latency and total amount of packets sent and received from each address.");
	ToolTipUtilities.setTooltipProperties(wwwTooltip, true, GUIController.defaultTooltipMaxWidth, GUIController.defaultFontSize, null);
	labelWWW.setTooltip(wwwTooltip);
	GUIController.setCommonGraphicOnLabeled(labelWWW, GUIController.CommonGraphicImages.TOOLTIP);
	
	Tooltip hotkeyTooltip = new Tooltip("The hotkey can be activated even while " + Main.appTitle + " isn't visible on the screen. "
			+ "The table contents will be read out to you so you don't have to look at the screen. The text to speech voice can be configured from the Options menu.");
	ToolTipUtilities.setTooltipProperties(hotkeyTooltip, true, GUIController.defaultTooltipMaxWidth, GUIController.defaultFontSize, AnchorLocation.WINDOW_TOP_RIGHT); 
	chkboxUseTTS.setTooltip(hotkeyTooltip);
	GUIController.setCommonGraphicOnLabeled(chkboxUseTTS, GUIController.CommonGraphicImages.TOOLTIP);
	
	Tooltip geoIPTooltip = new Tooltip("For each IP address, gets the name of the organization that owns it and its location (country, region and city). GeoIP info isn't always accurate. Right click on any row to see more GeoIP results in the browser.");
	ToolTipUtilities.setTooltipProperties(geoIPTooltip, true, GUIController.defaultTooltipMaxWidth, GUIController.defaultFontSize, null);
	chkboxGetLocation.setTooltip(geoIPTooltip);		
	GUIController.setCommonGraphicOnLabeled(chkboxGetLocation, GUIController.CommonGraphicImages.TOOLTIP);
	
	GUIController.setCommonGraphicOnLabeled(btnConfigCaptureHotkey, GUIController.CommonGraphicImages.HOTKEY);
	GUIController.setGraphicForLabeledControl(btnStart, startWWWImageLocation, ContentDisplay.LEFT);
	GUIController.setCommonGraphicOnLabeled(btnStop, GUIController.CommonGraphicImages.STOP);
	GUIController.setGraphicForLabeledControl(btnExportTableToCSV, exportToCSVImageLocation, ContentDisplay.LEFT);		
}
 
开发者ID:ck3ck3,项目名称:WhoWhatWhere,代码行数:24,代码来源:AppearanceCounterController.java


示例4: showSelectTabPopUp

import javafx.stage.PopupWindow.AnchorLocation; //导入依赖的package包/类
private void showSelectTabPopUp() {
	LanguageProvider languageProvider = userInterfaceContainer.get(LanguageProvider.class);
	RfxUserinterfaceController userInterfaceController = userInterfaceContainer
			.get(RfxUserinterfaceController.class);
	ViewContainer<View> viewContainer = userInterfaceController.getViewContainer();

	TreeItem<Item> rootNode = new TreeItem<>(new Item(languageProvider));
	rootNode.setExpanded(true);
	RfxItemTreeView itemTreeView = new RfxItemTreeView(rootNode);

	for (int i = 0; i < viewContainer.getViewCount(); i++) {
		View view = viewContainer.getView(i);
		SelectTabItem selectTabItem = new SelectTabItem(languageProvider, viewContainer, view);
		TreeItem<Item> selectTabNode = new TreeItem<>(selectTabItem);
		rootNode.getChildren().add(selectTabNode);
	}
	;

	JFXPopup popup = new JFXPopup();
	popup.setPopupContent(itemTreeView);
	popup.setAnchorLocation(AnchorLocation.CONTENT_TOP_RIGHT);
	popup.show(tabSelectionButton);
}
 
开发者ID:ntenhoeve,项目名称:Introspect-Framework,代码行数:24,代码来源:RfxAppButtonBar.java


示例5: HorizonChart

import javafx.stage.PopupWindow.AnchorLocation; //导入依赖的package包/类
public HorizonChart(final int BANDS, final Series<T> SERIES, final boolean SMOOTHED) {
    series        = SERIES;
    scaleX        = 1;
    scaleY        = 1;
    smoothed      = SMOOTHED;
    referenceZero = true;
    noOfBands     = clamp(1, MAX_NO_OF_BANDS, BANDS);
    noOfItems     = SERIES.getNoOfItems();
    minY          = SERIES.getItems().stream().mapToDouble(Data::getY).min().getAsDouble();
    maxY          = SERIES.getItems().stream().mapToDouble(Data::getY).max().getAsDouble();
    bandWidth     = (maxY - minY) / noOfBands;
    tooltip       = new Tooltip();
    tooltip.setAnchorLocation(AnchorLocation.CONTENT_BOTTOM_LEFT);

    adjustColors();

    // Create list of points
    points = new ArrayList<>(noOfItems);
    prepareData();

    mouseListener           = mouseEvent -> {
        final EventType<? extends MouseEvent> TYPE = mouseEvent.getEventType();
        if (MouseEvent.MOUSE_CLICKED == TYPE) {
            Data<T> data = selectDataAt(mouseEvent.getX());
            tooltip.setText(createTooltipText(data));
            tooltip.setX(mouseEvent.getScreenX());
            tooltip.setY(mouseEvent.getScreenY());
            tooltip.show(getScene().getWindow());
            getSeries().fireSeriesEvent(new SeriesEvent(getSeries(), data, SeriesEventType.SELECT_DATA));
        } else if (MouseEvent.MOUSE_MOVED == TYPE) {
            tooltip.hide();
        } else if (MouseEvent.MOUSE_EXITED == TYPE) {
            tooltip.hide();
        }
    };
    seriesListener          = seriesEvent -> redraw();

    initGraphics();
    registerListeners();
}
 
开发者ID:HanSolo,项目名称:horizon,代码行数:41,代码来源:HorizonChart.java


示例6: setTooltipProperties

import javafx.stage.PopupWindow.AnchorLocation; //导入依赖的package包/类
/**Any parameter can be null to keep its default value
 */
public static void setTooltipProperties(Tooltip tooltip, Boolean wrap, Double maxWidth, Double fontSize, AnchorLocation anchorLocation)
{
	if (wrap != null)
		tooltip.setWrapText(wrap);
	
	if (maxWidth != null)
		tooltip.setMaxWidth(maxWidth);
	
	if (fontSize != null)
		tooltip.setFont(new Font(fontSize));
	
	if (anchorLocation != null)
		tooltip.setAnchorLocation(anchorLocation);
}
 
开发者ID:ck3ck3,项目名称:WhoWhatWhere,代码行数:17,代码来源:ToolTipUtilities.java


示例7: setGraphics

import javafx.stage.PopupWindow.AnchorLocation; //导入依赖的package包/类
private void setGraphics()
{
	GUIController.setCommonGraphicOnLabeled(labelTableHeader, GUIController.CommonGraphicImages.TOOLTIP);
	Tooltip headerTooltip = new Tooltip("Watchdog inspects network traffic and issues a user-customized notification when a packet matches the conditions specified in a rule.");
	ToolTipUtilities.setTooltipProperties(headerTooltip, true, GUIController.defaultTooltipMaxWidth, GUIController.defaultFontSize, null);
	labelTableHeader.setTooltip(headerTooltip);
	
	GUIController.setCommonGraphicOnLabeled(labelRuleList, GUIController.CommonGraphicImages.TOOLTIP);
	Tooltip ruleListTooltip = new Tooltip("The rules are checked in the order that they appear. If a packet matches a rule, the remaining rules will not be checked.");
	ToolTipUtilities.setTooltipProperties(ruleListTooltip, true, GUIController.defaultTooltipMaxWidth, GUIController.defaultFontSize, null);
	labelRuleList.setTooltip(ruleListTooltip);
	
	GUIController.setCommonGraphicOnLabeled(labelCooldownSeconds, GUIController.CommonGraphicImages.TOOLTIP);
	Tooltip cooldownTooltip = new Tooltip("In order to avoid getting flooded with messages, matches that occur during a cooldown period will be ignored and not issue a notification.\nMinimal cooldown period is "
			+ WatchdogUI.minCooldownValue + " seconds.");
	ToolTipUtilities.setTooltipProperties(cooldownTooltip, true, GUIController.defaultTooltipMaxWidth, GUIController.defaultFontSize, AnchorLocation.WINDOW_TOP_RIGHT);
	labelCooldownSeconds.setTooltip(cooldownTooltip);
	
	GUIController.setCommonGraphicOnLabeled(btnAddRow, GUIController.CommonGraphicImages.ADD);
	GUIController.setCommonGraphicOnLabeled(btnEditRow, GUIController.CommonGraphicImages.EDIT);
	GUIController.setCommonGraphicOnLabeled(btnRemoveRow, GUIController.CommonGraphicImages.REMOVE);
	GUIController.setCommonGraphicOnLabeled(btnMoveUp, GUIController.CommonGraphicImages.UP);
	GUIController.setCommonGraphicOnLabeled(btnMoveDown, GUIController.CommonGraphicImages.DOWN);
	GUIController.setCommonGraphicOnLabeled(btnSaveRuleList, GUIController.CommonGraphicImages.SAVE);
	GUIController.setCommonGraphicOnLabeled(menubtnLoadRuleList, GUIController.CommonGraphicImages.LOAD);

	GUIController.setCommonGraphicOnLabeled(btnConfigureHotkey, GUIController.CommonGraphicImages.HOTKEY);

	GUIController.setCommonGraphicOnLabeled(btnStop, GUIController.CommonGraphicImages.STOP);
	GUIController.setGraphicForLabeledControl(btnStart, startWatchdogImageLocation, ContentDisplay.LEFT);
	btnStart.setGraphicTextGap(6);
}
 
开发者ID:ck3ck3,项目名称:WhoWhatWhere,代码行数:33,代码来源:WatchdogController.java


示例8: setColumnHeaderTooltip

import javafx.stage.PopupWindow.AnchorLocation; //导入依赖的package包/类
private void setColumnHeaderTooltip(TableColumn<TraceLineInfo, ?> column, String headerText, String tooltipText)
{
	Label label = new Label(headerText);
	GUIController.setCommonGraphicOnLabeled(label, GUIController.CommonGraphicImages.TOOLTIP);
	Tooltip tooltip = new Tooltip(tooltipText);
	ToolTipUtilities.setTooltipProperties(tooltip, true, GUIController.defaultTooltipMaxWidth, GUIController.defaultFontSize, AnchorLocation.CONTENT_TOP_LEFT);
	label.setTooltip(tooltip);
	label.setMaxWidth(Double.MAX_VALUE); //so the entire header width gives the tooltip
	column.setGraphic(label);
	column.setText("");
}
 
开发者ID:ck3ck3,项目名称:WhoWhatWhere,代码行数:12,代码来源:VisualTraceController.java


示例9: setGraphics

import javafx.stage.PopupWindow.AnchorLocation; //导入依赖的package包/类
private void setGraphics()
{
	GUIController.setNumberTextFieldValidationUI(numFieldPingTimeout, numFieldStopTracingAfter);
	
	GUIController.setGraphicForLabeledControl(btnTrace, traceIconLocation, ContentDisplay.LEFT);
	GUIController.setCommonGraphicOnLabeled(btnAbort, GUIController.CommonGraphicImages.CANCEL);
	
	GUIController.setCommonGraphicOnLabeled(labelVisualTrace, GUIController.CommonGraphicImages.TOOLTIP);
	Tooltip visualTraceTooltip = new Tooltip("Trace the route from your computer to another host on the internet and see it visually on a map.");
	ToolTipUtilities.setTooltipProperties(visualTraceTooltip, true, GUIController.defaultTooltipMaxWidth, GUIController.defaultFontSize, null);
	labelVisualTrace.setTooltip(visualTraceTooltip);
	
	GUIController.setCommonGraphicOnLabeled(labelPingTimeout, GUIController.CommonGraphicImages.TOOLTIP);
	Tooltip pingTimeoutTooltip = new Tooltip("The ping timeout (in milliseconds) for each of the 3 pings for every hop. Default value is 3000.");
	ToolTipUtilities.setTooltipProperties(pingTimeoutTooltip, true, GUIController.defaultTooltipMaxWidth, GUIController.defaultFontSize, AnchorLocation.WINDOW_TOP_LEFT); 
	labelPingTimeout.setTooltip(pingTimeoutTooltip);
	
	GUIController.setCommonGraphicOnLabeled(chkResolveHostnames, GUIController.CommonGraphicImages.TOOLTIP);
	Tooltip resolveHostnamesTooltip = new Tooltip("Try to resolve each IP's hostname. This might slow down the trace.");
	ToolTipUtilities.setTooltipProperties(resolveHostnamesTooltip, true, GUIController.defaultTooltipMaxWidth, GUIController.defaultFontSize, AnchorLocation.WINDOW_TOP_LEFT); 
	chkResolveHostnames.setTooltip(resolveHostnamesTooltip);
	
	GUIController.setCommonGraphicOnLabeled(labelConsecutiveTimeouts, GUIController.CommonGraphicImages.TOOLTIP);
	Tooltip timeouts = new Tooltip("A few timeouts in a row usually mean that the final destination was reached but it ignores trace requests. In order to avoid excessive waiting when this happens, it's recommended to set this value to about 5.");
	ToolTipUtilities.setTooltipProperties(timeouts, true, GUIController.defaultTooltipMaxWidth, GUIController.defaultFontSize, AnchorLocation.WINDOW_TOP_LEFT); 
	labelConsecutiveTimeouts.setTooltip(timeouts);
}
 
开发者ID:ck3ck3,项目名称:WhoWhatWhere,代码行数:28,代码来源:VisualTraceController.java


示例10: setImageViewTooltip

import javafx.stage.PopupWindow.AnchorLocation; //导入依赖的package包/类
/**
	 * Sets {@link Tooltip} for a {@link Node} which nicely shows {@link ImageView} inside.
	 * 
	 * @param nodeToHaveTooltip
	 *            The Node for installing Tooltip.
	 * 
	 * @param imageView
	 *            The ImageView to show inside Tooltip.
	 */
	public static void setImageViewTooltip(Node nodeToHaveTooltip,
			ImageView imageView) {
		// Add shadow to ImageView so the actual image will be clearly distinguishable from
		// tooltip's background.
		DropShadow shadow = new DropShadow(BlurType.ONE_PASS_BOX, Color.GREY, 5.0, 1.0, 0.0, 0.0);
		imageView.setEffect(shadow);
		// TODO: If image is big and StreamSis window is close to the edge, Tooltip is hiding right
		// after it is shown. Need to find workaround.
		Tooltip fullPreviewTP = new Tooltip();
		fullPreviewTP.setGraphic(imageView);
		fullPreviewTP.setAnchorLocation(AnchorLocation.WINDOW_BOTTOM_LEFT);
//		fullPreviewTP.setStyle("-fx-effect: dropshadow(three-pass-box, black, 10,0.5,0,0);");
		Tooltip.install(nodeToHaveTooltip, fullPreviewTP);
	}
 
开发者ID:ubershy,项目名称:StreamSis,代码行数:24,代码来源:GUIUtil.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OIDCTokenResponse类代码示例发布时间:2022-05-23
下一篇:
Java MessageCreationException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap