MyDoggyToolWindowManager toolWindowManager = new MyDoggyToolWindowManager(...); toolWindowManager.setResourceManager(new ...);
Icon.TOOL_SCROLL_BAR_LEFT = org/noos/xing/mydoggy/plaf/ui/icons/arrowLeft.png Icon.TOOL_SCROLL_BAR_RIGHT = org/noos/xing/mydoggy/plaf/ui/icons/arrowRight.png Color.RAB_MOUSE_IN_BORDER = black Color.TWTB_ID_BACKGROUND_FLASHING_0 = 183,200,232 ResourceBundle = org/noos/xing/mydoggy/plaf/ui/messages/messages
Here are some examples that show how to customize mydoggy. Remember to obtain an instance of ResourceManager you can use the following:
MyDoggyToolWindowManager toolWindowManager = new MyDoggyToolWindowManager(...); ResourceManager resourceManager = toolWindowManager.getResourceManager();
Look at this page to understand at what i'm referring when i write TitleBar, ToolWindowTab, etc..
You can use the following code to set a property value:
resourceManager.putProperty("drag.icon.transparency.enabled", "false");
Here is a list of supported properties.
Name | Type | Description |
drag.icon.transparency.enabled | boolean | Used to enable or disable the transparency of the drag icon. |
drag.icon.useDefault | boolean | Used to enable or disable the use of a simple icon instead of a more complex one during the a drag phase. |
ContentManagerUI.ContentManagerUiListener.import | boolean | Used to enable or disable the import of all listeners from an unmounting ContentManageUI to the new mmounted ContentManagerUI. |
drag.toolwindow.asTab | boolean | Used to enable or disable dragging of toolwindows as tabs. |
Using the org.noos.xing.mydoggy.plaf.ui.transparency.TransparencyManager interface
MyDoggy can manage the transparency of any detached window.
|
JNA provides Java programs easy access to native shared libraries (e.g. DLLs on Windows) without
writing anything but Java code, no JNI or native code is required. This functionality is
comparable to Windows' Platform/Invoke and Python's ctypes. Access is dynamic at runtime without
code generation.
You can found it at
https://jna.dev.java.net/
To use JNA for transparency purpose you can use the following class...
import com.sun.jna.examples.WindowUtils; import java.awt.*; import java.util.Map; import java.util.WeakHashMap; public class JNAWindowTransparencyManager implements TransparencyManager<Window> { private boolean available; private Map<Window, Float> windowTransparencies; public JNAWindowTransparencyManager() { initTransparencyManager(); } public boolean isServiceAvailable() { return available; } public void setAlphaModeRatio(Window component, float transparency) { if (available) { windowTransparencies.put(component, transparency); WindowUtils.setWindowAlpha(component, transparency); } } public boolean isAlphaModeEnabled(Window component) { if (available) { Float transparency = windowTransparencies.get(component); return transparency != null && transparency >= 0.0; } return false; } protected void initTransparencyManager() { available = false; try { Class.forName("com.sun.jna.examples.WindowUtils"); available = WindowUtils.isWindowAlphaSupported(); if (available) this.windowTransparencies = new WeakHashMap<Window, Float>(); } catch (ClassNotFoundException e) {} } }
To integrate the above manager in MyDoggy use the following.
MyDoggyToolWindowManager myDoggyToolWindowManager = new MyDoggyToolWindowManager(...); myDoggyToolWindowManager.getResourceManager().setTransparencyManager( new JNAWindowTransparencyManager() );