feat(jdk8): move files to new folder to avoid resources compiled.
This commit is contained in:
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiButtonUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiButtonUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.ButtonUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>ButtonUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiButtonUI extends ButtonUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ButtonUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiButtonUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiButtonUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiColorChooserUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiColorChooserUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.ColorChooserUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>ColorChooserUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiColorChooserUI extends ColorChooserUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ColorChooserUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiColorChooserUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiColorChooserUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
250
jdkSrc/jdk8/javax/swing/plaf/multi/MultiComboBoxUI.java
Normal file
250
jdkSrc/jdk8/javax/swing/plaf/multi/MultiComboBoxUI.java
Normal file
@@ -0,0 +1,250 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.ComboBoxUI;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>ComboBoxUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiComboBoxUI extends ComboBoxUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ComboBoxUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>isFocusTraversable</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean isFocusTraversable(JComboBox a) {
|
||||
boolean returnValue =
|
||||
((ComboBoxUI) (uis.elementAt(0))).isFocusTraversable(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComboBoxUI) (uis.elementAt(i))).isFocusTraversable(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>setPopupVisible</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void setPopupVisible(JComboBox a, boolean b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComboBoxUI) (uis.elementAt(i))).setPopupVisible(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>isPopupVisible</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean isPopupVisible(JComboBox a) {
|
||||
boolean returnValue =
|
||||
((ComboBoxUI) (uis.elementAt(0))).isPopupVisible(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComboBoxUI) (uis.elementAt(i))).isPopupVisible(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiComboBoxUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiComboBoxUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiDesktopIconUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiDesktopIconUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.DesktopIconUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>DesktopIconUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiDesktopIconUI extends DesktopIconUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// DesktopIconUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiDesktopIconUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiDesktopIconUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiDesktopPaneUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiDesktopPaneUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.DesktopPaneUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>DesktopPaneUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiDesktopPaneUI extends DesktopPaneUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// DesktopPaneUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiDesktopPaneUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiDesktopPaneUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
293
jdkSrc/jdk8/javax/swing/plaf/multi/MultiFileChooserUI.java
Normal file
293
jdkSrc/jdk8/javax/swing/plaf/multi/MultiFileChooserUI.java
Normal file
@@ -0,0 +1,293 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.FileChooserUI;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.filechooser.FileView;
|
||||
import java.lang.String;
|
||||
import java.io.File;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>FileChooserUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiFileChooserUI extends FileChooserUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// FileChooserUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAcceptAllFileFilter</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public FileFilter getAcceptAllFileFilter(JFileChooser a) {
|
||||
FileFilter returnValue =
|
||||
((FileChooserUI) (uis.elementAt(0))).getAcceptAllFileFilter(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((FileChooserUI) (uis.elementAt(i))).getAcceptAllFileFilter(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getFileView</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public FileView getFileView(JFileChooser a) {
|
||||
FileView returnValue =
|
||||
((FileChooserUI) (uis.elementAt(0))).getFileView(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((FileChooserUI) (uis.elementAt(i))).getFileView(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getApproveButtonText</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public String getApproveButtonText(JFileChooser a) {
|
||||
String returnValue =
|
||||
((FileChooserUI) (uis.elementAt(0))).getApproveButtonText(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((FileChooserUI) (uis.elementAt(i))).getApproveButtonText(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getDialogTitle</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public String getDialogTitle(JFileChooser a) {
|
||||
String returnValue =
|
||||
((FileChooserUI) (uis.elementAt(0))).getDialogTitle(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((FileChooserUI) (uis.elementAt(i))).getDialogTitle(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>rescanCurrentDirectory</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void rescanCurrentDirectory(JFileChooser a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((FileChooserUI) (uis.elementAt(i))).rescanCurrentDirectory(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>ensureFileIsVisible</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void ensureFileIsVisible(JFileChooser a, File b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((FileChooserUI) (uis.elementAt(i))).ensureFileIsVisible(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiFileChooserUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiFileChooserUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiInternalFrameUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiInternalFrameUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.InternalFrameUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>InternalFrameUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiInternalFrameUI extends InternalFrameUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// InternalFrameUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiInternalFrameUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiInternalFrameUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiLabelUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiLabelUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.LabelUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>LabelUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiLabelUI extends LabelUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// LabelUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiLabelUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiLabelUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
258
jdkSrc/jdk8/javax/swing/plaf/multi/MultiListUI.java
Normal file
258
jdkSrc/jdk8/javax/swing/plaf/multi/MultiListUI.java
Normal file
@@ -0,0 +1,258 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.ListUI;
|
||||
import javax.swing.JList;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>ListUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiListUI extends ListUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ListUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>locationToIndex</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int locationToIndex(JList a, Point b) {
|
||||
int returnValue =
|
||||
((ListUI) (uis.elementAt(0))).locationToIndex(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ListUI) (uis.elementAt(i))).locationToIndex(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>indexToLocation</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Point indexToLocation(JList a, int b) {
|
||||
Point returnValue =
|
||||
((ListUI) (uis.elementAt(0))).indexToLocation(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ListUI) (uis.elementAt(i))).indexToLocation(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getCellBounds</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Rectangle getCellBounds(JList a, int b, int c) {
|
||||
Rectangle returnValue =
|
||||
((ListUI) (uis.elementAt(0))).getCellBounds(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ListUI) (uis.elementAt(i))).getCellBounds(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiListUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiListUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
303
jdkSrc/jdk8/javax/swing/plaf/multi/MultiLookAndFeel.java
Normal file
303
jdkSrc/jdk8/javax/swing/plaf/multi/MultiLookAndFeel.java
Normal file
@@ -0,0 +1,303 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import java.lang.reflect.Method;
|
||||
import javax.swing.*;
|
||||
import javax.swing.plaf.*;
|
||||
|
||||
/**
|
||||
* <p>A multiplexing look and feel that allows more than one UI
|
||||
* to be associated with a component at the same time.
|
||||
* The primary look and feel is called
|
||||
* the <em>default</em> look and feel,
|
||||
* and the other look and feels are called <em>auxiliary</em>.
|
||||
* <p>
|
||||
*
|
||||
* For further information, see
|
||||
* <a href="doc-files/multi_tsc.html" target="_top">Using the
|
||||
* Multiplexing Look and Feel.</a>
|
||||
*
|
||||
* <p>
|
||||
* <strong>Warning:</strong>
|
||||
* Serialized objects of this class will not be compatible with
|
||||
* future Swing releases. The current serialization support is
|
||||
* appropriate for short term storage or RMI between applications running
|
||||
* the same version of Swing. As of 1.4, support for long term storage
|
||||
* of all JavaBeans™
|
||||
* has been added to the <code>java.beans</code> package.
|
||||
* Please see {@link java.beans.XMLEncoder}.
|
||||
*
|
||||
* @see UIManager#addAuxiliaryLookAndFeel
|
||||
* @see javax.swing.plaf.multi
|
||||
*
|
||||
* @author Willie Walker
|
||||
*/
|
||||
public class MultiLookAndFeel extends LookAndFeel {
|
||||
|
||||
//////////////////////////////
|
||||
// LookAndFeel methods
|
||||
//////////////////////////////
|
||||
|
||||
/**
|
||||
* Returns a string, suitable for use in menus,
|
||||
* that identifies this look and feel.
|
||||
*
|
||||
* @return a string such as "Multiplexing Look and Feel"
|
||||
*/
|
||||
public String getName() {
|
||||
return "Multiplexing Look and Feel";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string, suitable for use by applications/services,
|
||||
* that identifies this look and feel.
|
||||
*
|
||||
* @return "Multiplex"
|
||||
*/
|
||||
public String getID() {
|
||||
return "Multiplex";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a one-line description of this look and feel.
|
||||
*
|
||||
* @return a descriptive string such as "Allows multiple UI instances per component instance"
|
||||
*/
|
||||
public String getDescription() {
|
||||
return "Allows multiple UI instances per component instance";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns <code>false</code>;
|
||||
* this look and feel is not native to any platform.
|
||||
*
|
||||
* @return <code>false</code>
|
||||
*/
|
||||
public boolean isNativeLookAndFeel() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns <code>true</code>;
|
||||
* every platform permits this look and feel.
|
||||
*
|
||||
* @return <code>true</code>
|
||||
*/
|
||||
public boolean isSupportedLookAndFeel() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates, initializes, and returns
|
||||
* the look and feel specific defaults.
|
||||
* For this look and feel,
|
||||
* the defaults consist solely of
|
||||
* mappings of UI class IDs
|
||||
* (such as "ButtonUI")
|
||||
* to <code>ComponentUI</code> class names
|
||||
* (such as "javax.swing.plaf.multi.MultiButtonUI").
|
||||
*
|
||||
* @return an initialized <code>UIDefaults</code> object
|
||||
* @see javax.swing.JComponent#getUIClassID
|
||||
*/
|
||||
public UIDefaults getDefaults() {
|
||||
String packageName = "javax.swing.plaf.multi.Multi";
|
||||
Object[] uiDefaults = {
|
||||
"ButtonUI", packageName + "ButtonUI",
|
||||
"CheckBoxMenuItemUI", packageName + "MenuItemUI",
|
||||
"CheckBoxUI", packageName + "ButtonUI",
|
||||
"ColorChooserUI", packageName + "ColorChooserUI",
|
||||
"ComboBoxUI", packageName + "ComboBoxUI",
|
||||
"DesktopIconUI", packageName + "DesktopIconUI",
|
||||
"DesktopPaneUI", packageName + "DesktopPaneUI",
|
||||
"EditorPaneUI", packageName + "TextUI",
|
||||
"FileChooserUI", packageName + "FileChooserUI",
|
||||
"FormattedTextFieldUI", packageName + "TextUI",
|
||||
"InternalFrameUI", packageName + "InternalFrameUI",
|
||||
"LabelUI", packageName + "LabelUI",
|
||||
"ListUI", packageName + "ListUI",
|
||||
"MenuBarUI", packageName + "MenuBarUI",
|
||||
"MenuItemUI", packageName + "MenuItemUI",
|
||||
"MenuUI", packageName + "MenuItemUI",
|
||||
"OptionPaneUI", packageName + "OptionPaneUI",
|
||||
"PanelUI", packageName + "PanelUI",
|
||||
"PasswordFieldUI", packageName + "TextUI",
|
||||
"PopupMenuSeparatorUI", packageName + "SeparatorUI",
|
||||
"PopupMenuUI", packageName + "PopupMenuUI",
|
||||
"ProgressBarUI", packageName + "ProgressBarUI",
|
||||
"RadioButtonMenuItemUI", packageName + "MenuItemUI",
|
||||
"RadioButtonUI", packageName + "ButtonUI",
|
||||
"RootPaneUI", packageName + "RootPaneUI",
|
||||
"ScrollBarUI", packageName + "ScrollBarUI",
|
||||
"ScrollPaneUI", packageName + "ScrollPaneUI",
|
||||
"SeparatorUI", packageName + "SeparatorUI",
|
||||
"SliderUI", packageName + "SliderUI",
|
||||
"SpinnerUI", packageName + "SpinnerUI",
|
||||
"SplitPaneUI", packageName + "SplitPaneUI",
|
||||
"TabbedPaneUI", packageName + "TabbedPaneUI",
|
||||
"TableHeaderUI", packageName + "TableHeaderUI",
|
||||
"TableUI", packageName + "TableUI",
|
||||
"TextAreaUI", packageName + "TextUI",
|
||||
"TextFieldUI", packageName + "TextUI",
|
||||
"TextPaneUI", packageName + "TextUI",
|
||||
"ToggleButtonUI", packageName + "ButtonUI",
|
||||
"ToolBarSeparatorUI", packageName + "SeparatorUI",
|
||||
"ToolBarUI", packageName + "ToolBarUI",
|
||||
"ToolTipUI", packageName + "ToolTipUI",
|
||||
"TreeUI", packageName + "TreeUI",
|
||||
"ViewportUI", packageName + "ViewportUI",
|
||||
};
|
||||
|
||||
UIDefaults table = new MultiUIDefaults(uiDefaults.length / 2, 0.75f);
|
||||
table.putDefaults(uiDefaults);
|
||||
return table;
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
// Utility methods for the UI's
|
||||
///////////////////////////////
|
||||
|
||||
/**
|
||||
* Creates the <code>ComponentUI</code> objects
|
||||
* required to present
|
||||
* the <code>target</code> component,
|
||||
* placing the objects in the <code>uis</code> vector and
|
||||
* returning the
|
||||
* <code>ComponentUI</code> object
|
||||
* that best represents the component's UI.
|
||||
* This method finds the <code>ComponentUI</code> objects
|
||||
* by invoking
|
||||
* <code>getDefaults().getUI(target)</code> on each
|
||||
* default and auxiliary look and feel currently in use.
|
||||
* The first UI object this method adds
|
||||
* to the <code>uis</code> vector
|
||||
* is for the default look and feel.
|
||||
* <p>
|
||||
* This method is invoked by the <code>createUI</code> method
|
||||
* of <code>MultiXxxxUI</code> classes.
|
||||
*
|
||||
* @param mui the <code>ComponentUI</code> object
|
||||
* that represents the complete UI
|
||||
* for the <code>target</code> component;
|
||||
* this should be an instance
|
||||
* of one of the <code>MultiXxxxUI</code> classes
|
||||
* @param uis a <code>Vector</code>;
|
||||
* generally this is the <code>uis</code> field
|
||||
* of the <code>mui</code> argument
|
||||
* @param target a component whose UI is represented by <code>mui</code>
|
||||
*
|
||||
* @return <code>mui</code> if the component has any auxiliary UI objects;
|
||||
* otherwise, returns the UI object for the default look and feel
|
||||
* or <code>null</code> if the default UI object couldn't be found
|
||||
*
|
||||
* @see javax.swing.UIManager#getAuxiliaryLookAndFeels
|
||||
* @see javax.swing.UIDefaults#getUI
|
||||
* @see MultiButtonUI#uis
|
||||
* @see MultiButtonUI#createUI
|
||||
*/
|
||||
public static ComponentUI createUIs(ComponentUI mui,
|
||||
Vector uis,
|
||||
JComponent target) {
|
||||
ComponentUI ui;
|
||||
|
||||
// Make sure we can at least get the default UI
|
||||
//
|
||||
ui = UIManager.getDefaults().getUI(target);
|
||||
if (ui != null) {
|
||||
uis.addElement(ui);
|
||||
LookAndFeel[] auxiliaryLookAndFeels;
|
||||
auxiliaryLookAndFeels = UIManager.getAuxiliaryLookAndFeels();
|
||||
if (auxiliaryLookAndFeels != null) {
|
||||
for (int i = 0; i < auxiliaryLookAndFeels.length; i++) {
|
||||
ui = auxiliaryLookAndFeels[i].getDefaults().getUI(target);
|
||||
if (ui != null) {
|
||||
uis.addElement(ui);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Don't bother returning the multiplexing UI if all we did was
|
||||
// get a UI from just the default look and feel.
|
||||
//
|
||||
if (uis.size() == 1) {
|
||||
return (ComponentUI) uis.elementAt(0);
|
||||
} else {
|
||||
return mui;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array,
|
||||
* populates it with UI objects from the passed-in vector,
|
||||
* and returns the array.
|
||||
* If <code>uis</code> is null,
|
||||
* this method returns an array with zero elements.
|
||||
* If <code>uis</code> is an empty vector,
|
||||
* this method returns <code>null</code>.
|
||||
* A run-time error occurs if any objects in the <code>uis</code> vector
|
||||
* are not of type <code>ComponentUI</code>.
|
||||
*
|
||||
* @param uis a vector containing <code>ComponentUI</code> objects
|
||||
* @return an array equivalent to the passed-in vector
|
||||
*
|
||||
*/
|
||||
protected static ComponentUI[] uisToArray(Vector uis) {
|
||||
if (uis == null) {
|
||||
return new ComponentUI[0];
|
||||
} else {
|
||||
int count = uis.size();
|
||||
if (count > 0) {
|
||||
ComponentUI[] u = new ComponentUI[count];
|
||||
for (int i = 0; i < count; i++) {
|
||||
u[i] = (ComponentUI)uis.elementAt(i);
|
||||
}
|
||||
return u;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We want the Multiplexing LookAndFeel to be quiet and fallback
|
||||
* gracefully if it cannot find a UI. This class overrides the
|
||||
* getUIError method of UIDefaults, which is the method that
|
||||
* emits error messages when it cannot find a UI class in the
|
||||
* LAF.
|
||||
*/
|
||||
class MultiUIDefaults extends UIDefaults {
|
||||
MultiUIDefaults(int initialCapacity, float loadFactor) {
|
||||
super(initialCapacity, loadFactor);
|
||||
}
|
||||
protected void getUIError(String msg) {
|
||||
System.err.println("Multiplexing LAF: " + msg);
|
||||
}
|
||||
}
|
||||
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiMenuBarUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiMenuBarUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.MenuBarUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>MenuBarUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiMenuBarUI extends MenuBarUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// MenuBarUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiMenuBarUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiMenuBarUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
215
jdkSrc/jdk8/javax/swing/plaf/multi/MultiMenuItemUI.java
Normal file
215
jdkSrc/jdk8/javax/swing/plaf/multi/MultiMenuItemUI.java
Normal file
@@ -0,0 +1,215 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.MenuItemUI;
|
||||
import javax.swing.plaf.ButtonUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>MenuItemUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiMenuItemUI extends MenuItemUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// MenuItemUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ButtonUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiMenuItemUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiMenuItemUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
235
jdkSrc/jdk8/javax/swing/plaf/multi/MultiOptionPaneUI.java
Normal file
235
jdkSrc/jdk8/javax/swing/plaf/multi/MultiOptionPaneUI.java
Normal file
@@ -0,0 +1,235 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.OptionPaneUI;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>OptionPaneUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiOptionPaneUI extends OptionPaneUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// OptionPaneUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>selectInitialValue</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void selectInitialValue(JOptionPane a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((OptionPaneUI) (uis.elementAt(i))).selectInitialValue(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>containsCustomComponents</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean containsCustomComponents(JOptionPane a) {
|
||||
boolean returnValue =
|
||||
((OptionPaneUI) (uis.elementAt(0))).containsCustomComponents(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((OptionPaneUI) (uis.elementAt(i))).containsCustomComponents(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiOptionPaneUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiOptionPaneUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiPanelUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiPanelUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.PanelUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>PanelUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiPanelUI extends PanelUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// PanelUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiPanelUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiPanelUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
245
jdkSrc/jdk8/javax/swing/plaf/multi/MultiPopupMenuUI.java
Normal file
245
jdkSrc/jdk8/javax/swing/plaf/multi/MultiPopupMenuUI.java
Normal file
@@ -0,0 +1,245 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.PopupMenuUI;
|
||||
import java.awt.event.MouseEvent;
|
||||
import javax.swing.Popup;
|
||||
import javax.swing.JPopupMenu;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>PopupMenuUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiPopupMenuUI extends PopupMenuUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// PopupMenuUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>isPopupTrigger</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
* @since 1.3
|
||||
*/
|
||||
public boolean isPopupTrigger(MouseEvent a) {
|
||||
boolean returnValue =
|
||||
((PopupMenuUI) (uis.elementAt(0))).isPopupTrigger(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((PopupMenuUI) (uis.elementAt(i))).isPopupTrigger(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPopup</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
* @since 1.4
|
||||
*/
|
||||
public Popup getPopup(JPopupMenu a, int b, int c) {
|
||||
Popup returnValue =
|
||||
((PopupMenuUI) (uis.elementAt(0))).getPopup(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((PopupMenuUI) (uis.elementAt(i))).getPopup(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiPopupMenuUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiPopupMenuUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiProgressBarUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiProgressBarUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.ProgressBarUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>ProgressBarUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiProgressBarUI extends ProgressBarUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ProgressBarUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiProgressBarUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiProgressBarUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
211
jdkSrc/jdk8/javax/swing/plaf/multi/MultiRootPaneUI.java
Normal file
211
jdkSrc/jdk8/javax/swing/plaf/multi/MultiRootPaneUI.java
Normal file
@@ -0,0 +1,211 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.RootPaneUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>RootPaneUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
* @since 1.4
|
||||
*/
|
||||
public class MultiRootPaneUI extends RootPaneUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// RootPaneUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiRootPaneUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiRootPaneUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiScrollBarUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiScrollBarUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.ScrollBarUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>ScrollBarUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiScrollBarUI extends ScrollBarUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ScrollBarUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiScrollBarUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiScrollBarUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiScrollPaneUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiScrollPaneUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.ScrollPaneUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>ScrollPaneUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiScrollPaneUI extends ScrollPaneUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ScrollPaneUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiScrollPaneUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiScrollPaneUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiSeparatorUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiSeparatorUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.SeparatorUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>SeparatorUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiSeparatorUI extends SeparatorUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// SeparatorUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiSeparatorUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiSeparatorUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiSliderUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiSliderUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.SliderUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>SliderUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiSliderUI extends SliderUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// SliderUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiSliderUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiSliderUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
211
jdkSrc/jdk8/javax/swing/plaf/multi/MultiSpinnerUI.java
Normal file
211
jdkSrc/jdk8/javax/swing/plaf/multi/MultiSpinnerUI.java
Normal file
@@ -0,0 +1,211 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.SpinnerUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>SpinnerUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
* @since 1.4
|
||||
*/
|
||||
public class MultiSpinnerUI extends SpinnerUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// SpinnerUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiSpinnerUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiSpinnerUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
283
jdkSrc/jdk8/javax/swing/plaf/multi/MultiSplitPaneUI.java
Normal file
283
jdkSrc/jdk8/javax/swing/plaf/multi/MultiSplitPaneUI.java
Normal file
@@ -0,0 +1,283 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.SplitPaneUI;
|
||||
import javax.swing.JSplitPane;
|
||||
import java.awt.Graphics;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>SplitPaneUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiSplitPaneUI extends SplitPaneUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// SplitPaneUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>resetToPreferredSizes</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void resetToPreferredSizes(JSplitPane a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((SplitPaneUI) (uis.elementAt(i))).resetToPreferredSizes(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>setDividerLocation</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void setDividerLocation(JSplitPane a, int b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((SplitPaneUI) (uis.elementAt(i))).setDividerLocation(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getDividerLocation</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getDividerLocation(JSplitPane a) {
|
||||
int returnValue =
|
||||
((SplitPaneUI) (uis.elementAt(0))).getDividerLocation(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((SplitPaneUI) (uis.elementAt(i))).getDividerLocation(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumDividerLocation</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getMinimumDividerLocation(JSplitPane a) {
|
||||
int returnValue =
|
||||
((SplitPaneUI) (uis.elementAt(0))).getMinimumDividerLocation(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((SplitPaneUI) (uis.elementAt(i))).getMinimumDividerLocation(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumDividerLocation</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getMaximumDividerLocation(JSplitPane a) {
|
||||
int returnValue =
|
||||
((SplitPaneUI) (uis.elementAt(0))).getMaximumDividerLocation(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((SplitPaneUI) (uis.elementAt(i))).getMaximumDividerLocation(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>finishedPaintingChildren</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void finishedPaintingChildren(JSplitPane a, Graphics b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((SplitPaneUI) (uis.elementAt(i))).finishedPaintingChildren(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiSplitPaneUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiSplitPaneUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
257
jdkSrc/jdk8/javax/swing/plaf/multi/MultiTabbedPaneUI.java
Normal file
257
jdkSrc/jdk8/javax/swing/plaf/multi/MultiTabbedPaneUI.java
Normal file
@@ -0,0 +1,257 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.TabbedPaneUI;
|
||||
import javax.swing.JTabbedPane;
|
||||
import java.awt.Rectangle;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>TabbedPaneUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiTabbedPaneUI extends TabbedPaneUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// TabbedPaneUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>tabForCoordinate</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int tabForCoordinate(JTabbedPane a, int b, int c) {
|
||||
int returnValue =
|
||||
((TabbedPaneUI) (uis.elementAt(0))).tabForCoordinate(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TabbedPaneUI) (uis.elementAt(i))).tabForCoordinate(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getTabBounds</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Rectangle getTabBounds(JTabbedPane a, int b) {
|
||||
Rectangle returnValue =
|
||||
((TabbedPaneUI) (uis.elementAt(0))).getTabBounds(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TabbedPaneUI) (uis.elementAt(i))).getTabBounds(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getTabRunCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getTabRunCount(JTabbedPane a) {
|
||||
int returnValue =
|
||||
((TabbedPaneUI) (uis.elementAt(0))).getTabRunCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TabbedPaneUI) (uis.elementAt(i))).getTabRunCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiTabbedPaneUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiTabbedPaneUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiTableHeaderUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiTableHeaderUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.TableHeaderUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>TableHeaderUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiTableHeaderUI extends TableHeaderUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// TableHeaderUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiTableHeaderUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiTableHeaderUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiTableUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiTableUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.TableUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>TableUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiTableUI extends TableUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// TableUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiTableUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiTableUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
360
jdkSrc/jdk8/javax/swing/plaf/multi/MultiTextUI.java
Normal file
360
jdkSrc/jdk8/javax/swing/plaf/multi/MultiTextUI.java
Normal file
@@ -0,0 +1,360 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.TextUI;
|
||||
import java.lang.String;
|
||||
import javax.swing.text.JTextComponent;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import javax.swing.text.BadLocationException;
|
||||
import javax.swing.text.Position;
|
||||
import javax.swing.text.EditorKit;
|
||||
import javax.swing.text.View;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>TextUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiTextUI extends TextUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// TextUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>getToolTipText</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
* @since 1.4
|
||||
*/
|
||||
public String getToolTipText(JTextComponent a, Point b) {
|
||||
String returnValue =
|
||||
((TextUI) (uis.elementAt(0))).getToolTipText(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TextUI) (uis.elementAt(i))).getToolTipText(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>modelToView</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Rectangle modelToView(JTextComponent a, int b)
|
||||
throws BadLocationException {
|
||||
Rectangle returnValue =
|
||||
((TextUI) (uis.elementAt(0))).modelToView(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TextUI) (uis.elementAt(i))).modelToView(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>modelToView</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Rectangle modelToView(JTextComponent a, int b, Position.Bias c)
|
||||
throws BadLocationException {
|
||||
Rectangle returnValue =
|
||||
((TextUI) (uis.elementAt(0))).modelToView(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TextUI) (uis.elementAt(i))).modelToView(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>viewToModel</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int viewToModel(JTextComponent a, Point b) {
|
||||
int returnValue =
|
||||
((TextUI) (uis.elementAt(0))).viewToModel(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TextUI) (uis.elementAt(i))).viewToModel(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>viewToModel</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int viewToModel(JTextComponent a, Point b, Position.Bias[] c) {
|
||||
int returnValue =
|
||||
((TextUI) (uis.elementAt(0))).viewToModel(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TextUI) (uis.elementAt(i))).viewToModel(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getNextVisualPositionFrom</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getNextVisualPositionFrom(JTextComponent a, int b, Position.Bias c, int d, Position.Bias[] e)
|
||||
throws BadLocationException {
|
||||
int returnValue =
|
||||
((TextUI) (uis.elementAt(0))).getNextVisualPositionFrom(a,b,c,d,e);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TextUI) (uis.elementAt(i))).getNextVisualPositionFrom(a,b,c,d,e);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>damageRange</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void damageRange(JTextComponent a, int b, int c) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((TextUI) (uis.elementAt(i))).damageRange(a,b,c);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>damageRange</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void damageRange(JTextComponent a, int b, int c, Position.Bias d, Position.Bias e) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((TextUI) (uis.elementAt(i))).damageRange(a,b,c,d,e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getEditorKit</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public EditorKit getEditorKit(JTextComponent a) {
|
||||
EditorKit returnValue =
|
||||
((TextUI) (uis.elementAt(0))).getEditorKit(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TextUI) (uis.elementAt(i))).getEditorKit(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getRootView</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public View getRootView(JTextComponent a) {
|
||||
View returnValue =
|
||||
((TextUI) (uis.elementAt(0))).getRootView(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TextUI) (uis.elementAt(i))).getRootView(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiTextUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiTextUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiToolBarUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiToolBarUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.ToolBarUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>ToolBarUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiToolBarUI extends ToolBarUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ToolBarUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiToolBarUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiToolBarUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiToolTipUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiToolTipUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.ToolTipUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>ToolTipUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiToolTipUI extends ToolTipUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ToolTipUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiToolTipUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiToolTipUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
351
jdkSrc/jdk8/javax/swing/plaf/multi/MultiTreeUI.java
Normal file
351
jdkSrc/jdk8/javax/swing/plaf/multi/MultiTreeUI.java
Normal file
@@ -0,0 +1,351 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.TreeUI;
|
||||
import java.awt.Rectangle;
|
||||
import javax.swing.JTree;
|
||||
import javax.swing.tree.TreePath;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>TreeUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiTreeUI extends TreeUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// TreeUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPathBounds</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Rectangle getPathBounds(JTree a, TreePath b) {
|
||||
Rectangle returnValue =
|
||||
((TreeUI) (uis.elementAt(0))).getPathBounds(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TreeUI) (uis.elementAt(i))).getPathBounds(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPathForRow</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public TreePath getPathForRow(JTree a, int b) {
|
||||
TreePath returnValue =
|
||||
((TreeUI) (uis.elementAt(0))).getPathForRow(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TreeUI) (uis.elementAt(i))).getPathForRow(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getRowForPath</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getRowForPath(JTree a, TreePath b) {
|
||||
int returnValue =
|
||||
((TreeUI) (uis.elementAt(0))).getRowForPath(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TreeUI) (uis.elementAt(i))).getRowForPath(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getRowCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getRowCount(JTree a) {
|
||||
int returnValue =
|
||||
((TreeUI) (uis.elementAt(0))).getRowCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TreeUI) (uis.elementAt(i))).getRowCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getClosestPathForLocation</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public TreePath getClosestPathForLocation(JTree a, int b, int c) {
|
||||
TreePath returnValue =
|
||||
((TreeUI) (uis.elementAt(0))).getClosestPathForLocation(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TreeUI) (uis.elementAt(i))).getClosestPathForLocation(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>isEditing</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean isEditing(JTree a) {
|
||||
boolean returnValue =
|
||||
((TreeUI) (uis.elementAt(0))).isEditing(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TreeUI) (uis.elementAt(i))).isEditing(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>stopEditing</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean stopEditing(JTree a) {
|
||||
boolean returnValue =
|
||||
((TreeUI) (uis.elementAt(0))).stopEditing(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TreeUI) (uis.elementAt(i))).stopEditing(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>cancelEditing</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void cancelEditing(JTree a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((TreeUI) (uis.elementAt(i))).cancelEditing(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>startEditingAtPath</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void startEditingAtPath(JTree a, TreePath b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((TreeUI) (uis.elementAt(i))).startEditingAtPath(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getEditingPath</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public TreePath getEditingPath(JTree a) {
|
||||
TreePath returnValue =
|
||||
((TreeUI) (uis.elementAt(0))).getEditingPath(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((TreeUI) (uis.elementAt(i))).getEditingPath(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiTreeUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiTreeUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiViewportUI.java
Normal file
210
jdkSrc/jdk8/javax/swing/plaf/multi/MultiViewportUI.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.swing.plaf.multi;
|
||||
|
||||
import java.util.Vector;
|
||||
import javax.swing.plaf.ViewportUI;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Dimension;
|
||||
import javax.accessibility.Accessible;
|
||||
|
||||
/**
|
||||
* A multiplexing UI used to combine <code>ViewportUI</code>s.
|
||||
*
|
||||
* <p>This file was automatically generated by AutoMulti.
|
||||
*
|
||||
* @author Otto Multey
|
||||
*/
|
||||
public class MultiViewportUI extends ViewportUI {
|
||||
|
||||
/**
|
||||
* The vector containing the real UIs. This is populated
|
||||
* in the call to <code>createUI</code>, and can be obtained by calling
|
||||
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
|
||||
* obtained from the default look and feel.
|
||||
*/
|
||||
protected Vector uis = new Vector();
|
||||
|
||||
////////////////////
|
||||
// Common UI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Returns the list of UIs associated with this multiplexing UI. This
|
||||
* allows processing of the UIs by an application aware of multiplexing
|
||||
* UIs on components.
|
||||
*/
|
||||
public ComponentUI[] getUIs() {
|
||||
return MultiLookAndFeel.uisToArray(uis);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// ViewportUI methods
|
||||
////////////////////
|
||||
|
||||
////////////////////
|
||||
// ComponentUI methods
|
||||
////////////////////
|
||||
|
||||
/**
|
||||
* Invokes the <code>contains</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public boolean contains(JComponent a, int b, int c) {
|
||||
boolean returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>update</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void update(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).update(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a multiplexing UI instance if any of the auxiliary
|
||||
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
|
||||
* UI object obtained from the default <code>LookAndFeel</code>.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent a) {
|
||||
ComponentUI mui = new MultiViewportUI();
|
||||
return MultiLookAndFeel.createUIs(mui,
|
||||
((MultiViewportUI) mui).uis,
|
||||
a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>installUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void installUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).installUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void uninstallUI(JComponent a) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>paint</code> method on each UI handled by this object.
|
||||
*/
|
||||
public void paint(Graphics a, JComponent b) {
|
||||
for (int i = 0; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).paint(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getPreferredSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMinimumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Dimension getMaximumSize(JComponent a) {
|
||||
Dimension returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public int getAccessibleChildrenCount(JComponent a) {
|
||||
int returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
|
||||
*
|
||||
* @return the value obtained from the first UI, which is
|
||||
* the UI obtained from the default <code>LookAndFeel</code>
|
||||
*/
|
||||
public Accessible getAccessibleChild(JComponent a, int b) {
|
||||
Accessible returnValue =
|
||||
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
|
||||
for (int i = 1; i < uis.size(); i++) {
|
||||
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user