changeset 4000:c879a1c4c77e

Removing unused / commented out code.
author jgiles
date Tue, 18 Jun 2013 12:26:41 +1200
parents 39ed875879a8
children 92d455c3783b
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ContextMenuContent.java javafx-ui-controls/src/com/sun/javafx/scene/control/skin/FXVKSkin.java javafx-ui-controls/src/com/sun/javafx/scene/control/skin/Utils.java
diffstat 3 files changed, 0 insertions(+), 243 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ContextMenuContent.java	Tue Jun 18 09:24:30 2013 +1200
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ContextMenuContent.java	Tue Jun 18 12:26:41 2013 +1200
@@ -601,29 +601,6 @@
                 // on the Menu whose submenu is open.
                 if (submenu != null && submenu.isShowing()) return;
                   
-                // RT-15339 : if this context menu has another context menu part 
-                // of its content, then do nothing similar to the submenu case.
-                // walk thru all windows open to see if if this context menu is
-                // the owner window for another context menu, if so return.
-                final Iterator<Window> iter =
-                        AccessController.doPrivileged(
-                                new PrivilegedAction<Iterator<Window>>() {
-                                    @Override
-                                    public Iterator<Window> run() {
-                                        return Window.impl_getWindows();
-                                    }
-                                });
-                while(iter.hasNext()) {
-                    Window w = iter.next();
-                    if (w instanceof ContextMenu && !(contextMenu == w)) {
-                        Window ownerWin = ((ContextMenu)w).getOwnerWindow();
-                        if (contextMenu == ownerWin && ownerWin.isShowing()) {
-                            return;
-                        }
-                        
-                    }
-                    
-                }
                 requestFocus();
             }
         });
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/FXVKSkin.java	Tue Jun 18 09:24:30 2013 +1200
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/FXVKSkin.java	Tue Jun 18 12:26:41 2013 +1200
@@ -29,8 +29,6 @@
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.lang.reflect.Field;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -138,28 +136,6 @@
         }
     }
 
-
-    /**
-     * If true, places the virtual keyboard(s) in a new root wrapper
-     * on the scene instead of in a popup. The children of the wrapper
-     * are the original root container and a Group of one or more
-     * keyboards.
-     *
-     * This is suitable for a fullscreen application that does not use
-     * dialogs with text input controls.
-     *
-     * The root wrapper pans up/down automatically as needed to keep
-     * the focused input control visible, and allows the user to drag
-     * up/down with mouse or touch.
-     */
-    private final static boolean inScene =
-        AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
-            @Override public Boolean run() {
-                String value = System.getProperty("com.sun.javafx.fxvkContainerType");
-                return ("inscene".equalsIgnoreCase(value));
-            }
-    });
-
     private final static boolean USE_SECONDARY_POPUP = false;
 
     private static Region oldRoot;
@@ -204,13 +180,6 @@
         });
     }
 
-    private static Boolean enableCaching = AccessController.doPrivileged(
-    new PrivilegedAction<Boolean>() {
-        @Override public Boolean run() {
-            return Boolean.getBoolean("com.sun.javafx.scene.control.skin.FXVK.cache");
-        }
-    });
-
     private static void startSlideIn() {
         slideOutTimeline.stop();
         winY.set(vkPopup.getY());
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/Utils.java	Tue Jun 18 09:24:30 2013 +1200
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/Utils.java	Tue Jun 18 12:26:41 2013 +1200
@@ -547,195 +547,6 @@
         }
     }
 
-
-    /*    private static Object KERNING;
-       private static Object KERNING_ON;
-       private static Object LIGATURES;
-       private static Object LIGATURES_ON;
-       private static Object TRACKING;
-
-       static {
-       try {
-       KERNING = TextAttribute.class.getField("KERNING").get(null);
-       KERNING_ON = TextAttribute.class.getField("KERNING_ON").get(null);
-       LIGATURES = TextAttribute.class.getField("LIGATURES").get(null);
-       LIGATURES_ON = TextAttribute.class.getField("LIGATURES_ON").get(null);
-       TRACKING = TextAttribute.class.getField("TRACKING").get(null);
-       }
-       catch (Exception e) {
-       // running on 1.5
-       KERNING = KERNING_ON = LIGATURES = LIGATURES_ON = TRACKING = "unsupported";
-       }
-       }
-
-       private static FontRenderContext DEFAULT_FRC = new FontRenderContext(null, false, false);
-
-       private Utils() {}
-
-       static FontMetrics getFontMetrics(Font font) {
-       return getFontMetrics(font, DEFAULT_FRC);
-       }
-
-       static double computeLineHeight(Font font) {
-       if (font == null) return 0;
-       FontMetrics metrics = getFontMetrics(font, DEFAULT_FRC);
-       return metrics.getMaxAscent() + metrics.getMaxDescent();
-       }
-
-       static double computeXHeight(Font font) {
-       if (font == null) return 0;
-       return font.createGlyphVector(DEFAULT_FRC, "x").getGlyphMetrics(0).getBounds2D().getHeight();
-       }
-
-       // computes an offset from the baseline that would be the location of
-       // the center of the font. basically, this is where strikthrough would
-       // happen
-       static double computeCenterline(Font font) {
-       FontMetrics metrics = getFontMetrics(font, DEFAULT_FRC);
-       return metrics.getAscent() / 2;
-       }*/
-
-    /**
-     * Computes the width of the string if displayed with a default font
-     * render context (typically useful for display but not for printing).
-     * Nodes in the scene graph don't have a way to fetch the font render
-     * context, and computation of string widths typically happens outside
-     * of a paint cycle (since the scene graph is a retained mode API and not
-     * an immediate mode API).
-     *
-     * @param font this is an AWT font because I cannot refer to the fx font
-     *        from this java file.
-     * @param string
-     * @return
-     */
-    /*    static double computeStringWidth(Font font, String string) {
-       if (string == null || string.equals("")) return 0;
-       FontMetrics metrics = getFontMetrics(font, DEFAULT_FRC);
-       return computeStringWidth(metrics, string);
-       }
-
-       static double computeStringWidth(FontMetrics metrics, String string) {
-       if (string == null || string.equals("")) return 0;
-       return metrics.stringWidth(string);
-       }
-
-       private static boolean contains(Map map, Object key, Object value) {
-       Object o = map.get(key);
-       return o != null && o.equals(value);
-       }
-
-       private static boolean fontDesignMetricsInitialized = false;
-       private static Class<?> fontDesignMetricsClass;
-       private static Method getFontDesignMetrics;
-       private static Constructor newFontDesignMetrics;
-
-       private static synchronized FontMetrics getFontMetrics(final Font font, final FontRenderContext frc) {
-       FontMetrics rv = null;
-       if (! fontDesignMetricsInitialized) {
-       AccessController.doPrivileged(
-       new PrivilegedAction<Void>() {
-       public Void run() {
-       fontDesignMetricsInitialized = true;
-       try {
-       fontDesignMetricsClass =
-       Class.forName("sun.font.FontDesignMetrics", true, null);
-       } catch (ClassNotFoundException e) {
-       return null;
-       }
-       try {
-       newFontDesignMetrics =
-       fontDesignMetricsClass.getConstructor(Font.class,
-       FontRenderContext.class);
-       getFontDesignMetrics =
-       fontDesignMetricsClass.getMethod("getMetrics",
-       Font.class, FontRenderContext.class);
-       } catch (NoSuchMethodException ignore) {
-       }
-       return null;
-       }
-       });
-       }
-       try {
-       if (getFontDesignMetrics != null) {
-       rv = (FontMetrics) getFontDesignMetrics.invoke(null, font, frc);
-       } else if (newFontDesignMetrics != null) {
-       rv = (FontMetrics) newFontDesignMetrics.newInstance(font, frc);
-       }
-       } catch(IllegalAccessException ignore) {
-       } catch(InstantiationException ignore) {
-       } catch(InvocationTargetException exception) {
-       if (exception.getTargetException() instanceof RuntimeException) {
-       throw (RuntimeException) exception.getTargetException();
-       }
-       }
-       if (rv == null) {
-       //can not create FontDesignMetrics. Fall back to toolkit's fontMetrics.
-       rv = Toolkit.getDefaultToolkit().getFontMetrics(font);
-       }
-       return rv;
-       }*/
-
-    // ---- begin code included from SwingUtilities2 ----
-    // This code is present in sun.swing.SwingUtilities2 in JRE 1.6 or higher, but
-    // was copied into our codebase to handle running on Java 1.5.  Arguably we
-    // shouldn't be depending on sun.* APIs if at all possible anyway.
-
-    /**
-     * Indic, Thai, and surrogate char values require complex
-     * text layout and cursor support.
-     *
-     * @param ch character to be tested
-     * @return <tt>true</tt> if TextLayout is required
-     */
-    /*    private static final boolean isComplexLayout(char ch) {
-       return (ch >= '\u0900' && ch <= '\u0D7F') || // Indic
-       (ch >= '\u0E00' && ch <= '\u0E7F') || // Thai
-       (ch >= '\u1780' && ch <= '\u17ff') || // Khmer
-       (ch >= '\uD800' && ch <= '\uDFFF');   // surrogate value range
-       }*/
-
-    /**
-     * Fast method to check that TextLayout is not required for the
-     * character.
-     * if returns <tt>true</tt> TextLayout is not required
-     * if returns <tt>false</tt> TextLayout might be required
-     *
-     * @param ch character to be tested
-     * @return <tt>true</tt> if TextLayout is not required
-     */
-    /*    private static final boolean isSimpleLayout(char ch) {
-       return ch < 0x590 || (0x2E00 <= ch && ch < 0xD800);
-       }*/
-
-    /**
-     * checks whether TextLayout is required to handle characters.
-     *
-     * @param text characters to be tested
-     * @param start start
-     * @param limit limit
-     * @return <tt>true</tt>  if TextLayout is required
-     *         <tt>false</tt> if TextLayout is not required
-     */
-    /*    public static final boolean isComplexLayout(char[] text, int start, int limit) {
-       boolean simpleLayout = true;
-       char ch;
-       for (int i = start; i < limit; ++i) {
-       ch = text[i];
-       if (isComplexLayout(ch)) {
-       return true;
-       }
-       if (simpleLayout) {
-       simpleLayout = isSimpleLayout(ch);
-       }
-       }
-       if (simpleLayout) {
-       return false;
-       } else {
-       return Bidi.requiresBidi(text, start, limit);
-       }
-       }*/
-    // ---- end code included from SwingUtilities2 ----
-
     private static boolean requiresComplexLayout(Font font, String string) {
         /*        Map attrs = font.getAttributes();
            if (contains(attrs, KERNING, KERNING_ON) ||