1 /*
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
3826 else if(changeName == JTree.SHOWS_ROOT_HANDLES_PROPERTY) {
3827 setShowsRootHandles(((Boolean)event.getNewValue()).
3828 booleanValue());
3829 }
3830 else if(changeName == JTree.ROW_HEIGHT_PROPERTY) {
3831 setRowHeight(((Integer)event.getNewValue()).
3832 intValue());
3833 }
3834 else if(changeName == JTree.CELL_EDITOR_PROPERTY) {
3835 setCellEditor((TreeCellEditor)event.getNewValue());
3836 }
3837 else if(changeName == JTree.EDITABLE_PROPERTY) {
3838 setEditable(((Boolean)event.getNewValue()).booleanValue());
3839 }
3840 else if(changeName == JTree.LARGE_MODEL_PROPERTY) {
3841 setLargeModel(tree.isLargeModel());
3842 }
3843 else if(changeName == JTree.SELECTION_MODEL_PROPERTY) {
3844 setSelectionModel(tree.getSelectionModel());
3845 }
3846 else if(changeName == "font") {
3847 completeEditing();
3848 if(treeState != null)
3849 treeState.invalidateSizes();
3850 updateSize();
3851 }
3852 else if (changeName == "componentOrientation") {
3853 if (tree != null) {
3854 leftToRight = BasicGraphicsUtils.isLeftToRight(tree);
3855 redoTheLayout();
3856 tree.treeDidChange();
3857
3858 InputMap km = getInputMap(JComponent.WHEN_FOCUSED);
3859 SwingUtilities.replaceUIInputMap(tree,
3860 JComponent.WHEN_FOCUSED, km);
3861 }
3862 } else if ("dropLocation" == changeName) {
3863 JTree.DropLocation oldValue = (JTree.DropLocation)event.getOldValue();
3864 repaintDropLocation(oldValue);
3865 repaintDropLocation(tree.getDropLocation());
3866 }
|
1 /*
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
3826 else if(changeName == JTree.SHOWS_ROOT_HANDLES_PROPERTY) {
3827 setShowsRootHandles(((Boolean)event.getNewValue()).
3828 booleanValue());
3829 }
3830 else if(changeName == JTree.ROW_HEIGHT_PROPERTY) {
3831 setRowHeight(((Integer)event.getNewValue()).
3832 intValue());
3833 }
3834 else if(changeName == JTree.CELL_EDITOR_PROPERTY) {
3835 setCellEditor((TreeCellEditor)event.getNewValue());
3836 }
3837 else if(changeName == JTree.EDITABLE_PROPERTY) {
3838 setEditable(((Boolean)event.getNewValue()).booleanValue());
3839 }
3840 else if(changeName == JTree.LARGE_MODEL_PROPERTY) {
3841 setLargeModel(tree.isLargeModel());
3842 }
3843 else if(changeName == JTree.SELECTION_MODEL_PROPERTY) {
3844 setSelectionModel(tree.getSelectionModel());
3845 }
3846 else if(changeName == "font"
3847 || changeName == "graphicsConfiguration") {
3848 completeEditing();
3849 if(treeState != null)
3850 treeState.invalidateSizes();
3851 updateSize();
3852 }
3853 else if (changeName == "componentOrientation") {
3854 if (tree != null) {
3855 leftToRight = BasicGraphicsUtils.isLeftToRight(tree);
3856 redoTheLayout();
3857 tree.treeDidChange();
3858
3859 InputMap km = getInputMap(JComponent.WHEN_FOCUSED);
3860 SwingUtilities.replaceUIInputMap(tree,
3861 JComponent.WHEN_FOCUSED, km);
3862 }
3863 } else if ("dropLocation" == changeName) {
3864 JTree.DropLocation oldValue = (JTree.DropLocation)event.getOldValue();
3865 repaintDropLocation(oldValue);
3866 repaintDropLocation(tree.getDropLocation());
3867 }
|