Java Code Examples for javax.swing.UIManager#removePropertyChangeListener()
The following examples show how to use
javax.swing.UIManager#removePropertyChangeListener() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BasicLizziePaneUI.java From lizzie with GNU General Public License v3.0 | 6 votes |
public void windowClosing(WindowEvent w) { if (lizziePane.isFloatable()) { if (dragWindow != null) dragWindow.setVisible(false); floating = false; if (floatingLizziePane == null) floatingLizziePane = createFloatingWindow(lizziePane); if (floatingLizziePane instanceof Window) ((Window) floatingLizziePane).setVisible(false); floatingLizziePane.getContentPane().remove(lizziePane); String constraint = constraintBeforeFloating; if (dockingSource == null) dockingSource = lizziePane.getParent(); if (propertyListener != null) UIManager.removePropertyChangeListener(propertyListener); dockingSource.add(lizziePane, constraint); dockingSource.invalidate(); Container dockingSourceParent = dockingSource.getParent(); if (dockingSourceParent != null) dockingSourceParent.validate(); dockingSource.repaint(); } }
Example 2
Source File: TitledBorder.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
private void installPropertyChangeListeners() { final WeakReference<TitledBorder> weakReference = new WeakReference<TitledBorder>(this); final PropertyChangeListener listener = new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (weakReference.get() == null) { UIManager.removePropertyChangeListener(this); UIManager.getDefaults().removePropertyChangeListener(this); } else { String prop = evt.getPropertyName(); if ("lookAndFeel".equals(prop) || "LabelUI".equals(prop)) { label.updateUI(); } } } }; UIManager.addPropertyChangeListener(listener); UIManager.getDefaults().addPropertyChangeListener(listener); }
Example 3
Source File: LookAndFeelAddons.java From orbit-image-analysis with GNU General Public License v3.0 | 6 votes |
/** * If true, everytime the Swing look and feel is changed, the addon which * best matches the current look and feel will be automatically selected. * * @param tracking * true to automatically update the addon, false to not automatically * track the addon. Defaults to false. * @see #getBestMatchAddonClassName() */ public static synchronized void setTrackingLookAndFeelChanges(boolean tracking) { if (trackingChanges != tracking) { if (tracking) { if (changeListener == null) { changeListener = new UpdateAddon(); } UIManager.addPropertyChangeListener(changeListener); } else { if (changeListener != null) { UIManager.removePropertyChangeListener(changeListener); } changeListener = null; } trackingChanges = tracking; } }
Example 4
Source File: LookAndFeelAddons.java From CodenameOne with GNU General Public License v2.0 | 6 votes |
/** * If true, everytime the Swing look and feel is changed, the addon which * best matches the current look and feel will be automatically selected. * * @param tracking * true to automatically update the addon, false to not automatically * track the addon. Defaults to false. * @see #getBestMatchAddonClassName() */ public static synchronized void setTrackingLookAndFeelChanges(boolean tracking) { if (trackingChanges != tracking) { if (tracking) { if (changeListener == null) { changeListener = new UpdateAddon(); } UIManager.addPropertyChangeListener(changeListener); } else { if (changeListener != null) { UIManager.removePropertyChangeListener(changeListener); } changeListener = null; } trackingChanges = tracking; } }
Example 5
Source File: AnimationAutoCompletion.java From 3Dscript with BSD 2-Clause "Simplified" License | 5 votes |
/** * Uninstalls this auto-completion from its text component. If it is not * installed on any text component, nothing happens. * * @see #install(JTextComponent) */ @Override public void uninstall() { if (textComponent != null) { hidePopupWindow(); // Unregisters listeners, actions, etc. uninstallTriggerKey(); // Uninstall the function completion key. char start = provider.getParameterListStart(); if (start != 0) { KeyStroke ks = KeyStroke.getKeyStroke(start); InputMap im = textComponent.getInputMap(); im.put(ks, oldParenKey); ActionMap am = textComponent.getActionMap(); am.put(PARAM_COMPLETE_KEY, oldParenAction); } textComponentListener.removeFrom(textComponent); if (parentWindow != null) { parentWindowListener.removeFrom(parentWindow); } if (isAutoActivationEnabled()) { autoActivationListener.removeFrom(textComponent); } UIManager.removePropertyChangeListener(lafListener); textComponent = null; popupWindowListener.uninstall(popupWindow); popupWindow = null; } }
Example 6
Source File: NimbusDefaults.java From jdk1.8-source-analysis with Apache License 2.0 | 4 votes |
/** Called by UIManager when this look and feel is uninstalled. */ void uninitialize() { // remove listener for derived colors UIManager.removePropertyChangeListener(defaultsListener); UIManager.getDefaults().removePropertyChangeListener(colorTree); }
Example 7
Source File: LookAndFeelsComboBox.java From FlatLaf with Apache License 2.0 | 4 votes |
@Override public void removeNotify() { super.removeNotify(); UIManager.removePropertyChangeListener( lafListener ); }
Example 8
Source File: NimbusDefaults.java From JDKSourceCode1.8 with MIT License | 4 votes |
/** Called by UIManager when this look and feel is uninstalled. */ void uninitialize() { // remove listener for derived colors UIManager.removePropertyChangeListener(defaultsListener); UIManager.getDefaults().removePropertyChangeListener(colorTree); }
Example 9
Source File: BasicLizziePaneUI.java From lizzie with GNU General Public License v3.0 | 4 votes |
public void setFloating(boolean b, Point p) { if (lizziePane.isFloatable()) { boolean visible = false; Window ancestor = SwingUtilities.getWindowAncestor(lizziePane); if (ancestor != null) { visible = ancestor.isVisible(); } if (dragWindow != null) dragWindow.setVisible(false); this.floating = b; if (floatingLizziePane == null) { floatingLizziePane = createFloatingWindow(lizziePane); } if (b == true) { if (dockingSource == null) { dockingSource = lizziePane.getParent(); dockingSource.remove(lizziePane); } constraintBeforeFloating = calculateConstraint(); if (propertyListener != null) UIManager.addPropertyChangeListener(propertyListener); floatingLizziePane.getContentPane().add(lizziePane, BorderLayout.CENTER); if (floatingLizziePane instanceof Window) { ((Window) floatingLizziePane).pack(); ((Window) floatingLizziePane).setLocation(floatingX, floatingY); Insets insets = ((Window) floatingLizziePane).getInsets(); Dimension d = new Dimension( originSize.width + insets.left + insets.right, originSize.height + insets.top + insets.bottom); ((Window) floatingLizziePane).setSize(d); if (visible) { ((Window) floatingLizziePane).setVisible(true); } else { ancestor.addWindowListener( new WindowAdapter() { public void windowOpened(WindowEvent e) { ((Window) floatingLizziePane).setVisible(true); } }); } } } else { if (floatingLizziePane == null) floatingLizziePane = createFloatingWindow(lizziePane); if (floatingLizziePane instanceof Window) ((Window) floatingLizziePane).setVisible(false); floatingLizziePane.getContentPane().remove(lizziePane); String constraint = getDockingConstraint(dockingSource, p); if (constraint != null) { if (dockingSource == null) dockingSource = lizziePane.getParent(); if (propertyListener != null) UIManager.removePropertyChangeListener(propertyListener); dockingSource.add(constraint, lizziePane); } } dockingSource.invalidate(); Container dockingSourceParent = dockingSource.getParent(); if (dockingSourceParent != null) dockingSourceParent.validate(); dockingSource.repaint(); } }
Example 10
Source File: NimbusDefaults.java From Java8CN with Apache License 2.0 | 4 votes |
/** Called by UIManager when this look and feel is uninstalled. */ void uninitialize() { // remove listener for derived colors UIManager.removePropertyChangeListener(defaultsListener); UIManager.getDefaults().removePropertyChangeListener(colorTree); }
Example 11
Source File: Microba.java From microba with BSD 3-Clause "New" or "Revised" License | 3 votes |
/** * Initializes the library: installs L&F properties, sets up a L&F change * listener. * <p> * No need to call this method explicitly for desktop applications. You * should only call it in {@link Applet#init()}. This will handle browser * refresh button correctly. * */ public static synchronized void init() { setLookAndFeelProperties(UIManager.getLookAndFeel()); UIManager.removePropertyChangeListener(changeListener); UIManager.addPropertyChangeListener(changeListener); }