ScreenFX is a library for JavaFX 8 which allows you to install a small and lightweight popup container to your application stages. This popup has abilities to handle positioning and resizing events of each stage. Please read further to learn how to use.
This tool is inspired originally by the tool "Asus Multiframe" which was only capable to handle two screens. As the tool multiframe does not work an java applications and because of the screen number limitation i decided to write my own tool box.
This library is written for JavaFX 8 and was built with JDK 1.8.0-b121. If you compile the sources with JDK 1.7 it could mabye work 100% without any trouble.
ScreenFX will read out your current system hardware configuration for screen devices and will create a grid layout:
As you can see the layout reacts on the total count of screens. If only one screen is available, ScreenFX will only show one (the default colored main screen #1). If more screens are installed all secondary screens get a darker color than screen #1.
The installation of ScreenFX is very easy. You do not need to initialize the tool manually. You only have to install the tool once per stage.
screenfx-current.jar into your JavaFX project and call the function like this:
Stage stage = new Stage(); ScreenFX screenFX = new ScreenFX(); screenFX.installOn(stage);
If you want more access to ScreenFX you can adjust the following properties (as listed in the features list):
Stage stage = new Stage(); ScreenFXProperties.put("iconSet", new ArrayList()); ScreenFXProperties.put("popupKeyCodeCombination", new KeyCodeCombination(KeyCode.S, KeyCombination.CONTROL_DOWN)); ScreenFXProperties.put("quickResizeKeyCodeCombination", KeyCode.CONTROL); ScreenFXProperties.put("activateTaskbarKeyCodeCombination", KeyCode.SHIFT); ScreenFXProperties.setResourceBundle(your custom resource bundle); ScreenFXProperties.setResourcePath(//your custom path to icon and style files); ScreenFXProperties.setTaskbarIncludeSelectedProperties(//your initial config for the 9 taskbar include checkboxes); ScreenFXProperties.setAllowTooltips(//true/false); ScreenFXProperties.setExitDelayTime(//your delay time as a long value); screenFX.installOn(//stage);
There are four possible ways to set single key accelerators or key combinations of ScreenFX:
ScreenFXProperties.put("popupKeyCodeCombination", new KeyCodeCombination(KeyCode.S, KeyCombination.CONTROL_DOWN)); ScreenFXProperties.put("popupKeyCodeCombination", KeyCode.S); ScreenFXProperties.put("popupKeyCodeCombination", KeyCode.SHIFT); //you can also use modifiers! ScreenFXProperties.put("popupKeyCodeCombination", KeyCombination.keyCombination("Ctrl+Alt+X")); ScreenFXProperties.put("popupKeyCodeCombination", KeyCharacterCombination.keyCombination("Ctrl+S"));
If you want to remove the key combinations do some property remove() call like the following example shows
ScreenFXProperties.remove("popupKeyCodeCombination"); ScreenFXProperties.remove("quickResizeKeyCodeCombination"); ScreenFXProperties.remove("activateTaskbarKeyCodeCombination");
- can be used with normal builder-like source code as well as using with FXML and a controller class. See the example distributed with the library.
- compatible up to 9 screens (cubic layout, master screen in middle of cube)
- control one stage from another (install controller button for stage nr. 1 on a stage nr. 2)
- standard language support german + english
- should be compatible with all operating systems (tested only Windows 7/8/8.1)
- includes calculations for maximum real screen size or the screen size respecting elements like windows taskbar which reduce the area for resizing windows
- global configuration options which are:
- change key combinations
- enable/disable tooltips
- add custom icon set
- add custom language resource files
- change the delay time to exit ScreenFX when moving mouse out of popup
- configuration is global so you controll all the ScreenFX containers with only one singleton class
- for each stage you can allow an own ScreenFX container separately
- resize window to screen halfs or quarters
- put window to screen edges or corners
- set to fullscreen (fully fullscreen or fullscreen showing taskbar)
- maximize window in width, height or both
- jump the window to each screen you want (even in fullscreen)
- access ScreenFX through key combination (default: ctrl + s) or via button pressing (you need a JavaFX component which extends the class ButtonBase)
- add resize effect:http://stackoverflow.com/questions/17306981/how-do-i-create-a-resize-animation-for-javafx-stage
- create a stylesheet which contains all the styles, effects, filters and hoverings which are currently done with hard coded event handlers
- build an interactive demo for all major and minor properties which have influence to ScreenFX, for example StageStyle, isResizable(), isFullsceen(), Locale, visibility; include property editor for ScreenFXProperties, add button for "create random test stages", add tab for html viewer for this github page content and/or javadoc
- create an algorithm to break the current 9 screen cubic layout to a more common flexible layout
- change the time a tooltip is displayed before it's going to automatically hides
- tidy up/refactor code bricks
- fix issue that if you control one stage from another some key combinations do not work because the other stage has focus and does not react on the defined ones
- fix issue that when a screen gets removed from hardware while ScreenFX is shown there are some ugly nonlocatable exceptions thrown. These exceptions are thrown casually by some effects like Glow and ColorAdjust
- add data validator for class ScreenFXProperties so there cannot be thrown a NullPointerException or add != null check for each property getting
- make a fix if activating the popup with ctrl + s and holding ctrl (or a similar key combination where the modifier is the same) there wont be set the resize doubleclick emulation event
- fix the checkbox height - instead of setting the font size to 10px there must be a way to style the box from checkbox in its width/height separately without styling it's label
- put some try-catch methods into code to grant more stability
/* * ScreenFX - A plugin library for JavaFX 8 adding features for resizing * and arranging stage windows on a multiple screen hardware configuration * * Copyright (C) 2014 Mario Voigt * Ulmenstr. 35 * 09112 Chemnitz * Germany * email@example.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0.html */