< prev index next >

modules/graphics/src/test/java/test/com/sun/javafx/pgstub/StubToolkit.java

Print this page


   1 /*
   2  * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 /*
  27  * StubToolkit.java
  28  */
  29 
  30 package test.com.sun.javafx.pgstub;
  31 
  32 import com.sun.glass.ui.CommonDialogs.FileChooserResult;
  33 import com.sun.javafx.application.PlatformImpl;
  34 import com.sun.javafx.embed.HostInterface;
  35 import com.sun.javafx.geom.Path2D;
  36 import com.sun.javafx.geom.Shape;
  37 import com.sun.javafx.geom.transform.BaseTransform;
  38 import com.sun.javafx.menu.MenuBase;
  39 import com.sun.javafx.perf.PerformanceTracker;
  40 import com.sun.javafx.runtime.async.AsyncOperation;
  41 import com.sun.javafx.runtime.async.AsyncOperationListener;
  42 import com.sun.javafx.scene.text.HitInfo;
  43 import com.sun.javafx.scene.text.TextLayoutFactory;
  44 import com.sun.javafx.tk.*;
  45 import com.sun.prism.BasicStroke;
  46 import com.sun.scenario.DelayedRunnable;
  47 import com.sun.scenario.animation.AbstractMasterTimer;
  48 import com.sun.scenario.effect.FilterContext;
  49 import com.sun.scenario.effect.Filterable;
  50 import javafx.application.ConditionalFeature;
  51 import javafx.geometry.Dimension2D;
  52 import javafx.scene.image.Image;
  53 import javafx.scene.input.*;
  54 import javafx.scene.paint.Color;
  55 import javafx.scene.paint.ImagePattern;
  56 import javafx.scene.paint.LinearGradient;
  57 import javafx.scene.paint.RadialGradient;
  58 import javafx.scene.shape.*;
  59 import javafx.stage.FileChooser.ExtensionFilter;
  60 import javafx.stage.Modality;
  61 import javafx.stage.StageStyle;
  62 import javafx.stage.Window;


 616     }
 617 
 618     @Override
 619     public int getKeyCodeForChar(String character) {
 620         if (charToKeyCodeMap != null) {
 621             final KeyCode keyCode = charToKeyCodeMap.get(character);
 622             if (keyCode != null) {
 623                 return keyCode.getCode();
 624             }
 625         }
 626 
 627         return 0;
 628     }
 629 
 630     @Override
 631     public PathElement[] convertShapeToFXPath(Object shape) {
 632         // Had to be mocked up for TextField tests (for the caret!)
 633         // Since the "shape" could be anything, I'm just returning
 634         // something here, doesn't matter what.
 635         return new PathElement[0];
 636     }
 637 
 638     @Override
 639     public HitInfo convertHitInfoToFX(Object hit) {
 640         return (HitInfo) hit;
 641     }
 642 
 643     @Override
 644     public Filterable toFilterable(Image img) {
 645         return StubFilterable.create((StubPlatformImage)img.impl_getPlatformImage());
 646     }
 647 
 648     @Override
 649     public FilterContext getFilterContext(Object config) {
 650         throw new UnsupportedOperationException();
 651     }
 652 
 653     @Override
 654     public boolean isForwardTraversalKey(KeyEvent e) {
 655         throw new UnsupportedOperationException();
 656     }
 657 
 658     @Override
 659     public boolean isBackwardTraversalKey(KeyEvent e) {
 660         throw new UnsupportedOperationException();


   1 /*
   2  * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 /*
  27  * StubToolkit.java
  28  */
  29 
  30 package test.com.sun.javafx.pgstub;
  31 
  32 import com.sun.glass.ui.CommonDialogs.FileChooserResult;
  33 import com.sun.javafx.application.PlatformImpl;
  34 import com.sun.javafx.embed.HostInterface;
  35 import com.sun.javafx.geom.Path2D;
  36 import com.sun.javafx.geom.Shape;
  37 import com.sun.javafx.geom.transform.BaseTransform;
  38 import com.sun.javafx.menu.MenuBase;
  39 import com.sun.javafx.perf.PerformanceTracker;
  40 import com.sun.javafx.runtime.async.AsyncOperation;
  41 import com.sun.javafx.runtime.async.AsyncOperationListener;

  42 import com.sun.javafx.scene.text.TextLayoutFactory;
  43 import com.sun.javafx.tk.*;
  44 import com.sun.prism.BasicStroke;
  45 import com.sun.scenario.DelayedRunnable;
  46 import com.sun.scenario.animation.AbstractMasterTimer;
  47 import com.sun.scenario.effect.FilterContext;
  48 import com.sun.scenario.effect.Filterable;
  49 import javafx.application.ConditionalFeature;
  50 import javafx.geometry.Dimension2D;
  51 import javafx.scene.image.Image;
  52 import javafx.scene.input.*;
  53 import javafx.scene.paint.Color;
  54 import javafx.scene.paint.ImagePattern;
  55 import javafx.scene.paint.LinearGradient;
  56 import javafx.scene.paint.RadialGradient;
  57 import javafx.scene.shape.*;
  58 import javafx.stage.FileChooser.ExtensionFilter;
  59 import javafx.stage.Modality;
  60 import javafx.stage.StageStyle;
  61 import javafx.stage.Window;


 615     }
 616 
 617     @Override
 618     public int getKeyCodeForChar(String character) {
 619         if (charToKeyCodeMap != null) {
 620             final KeyCode keyCode = charToKeyCodeMap.get(character);
 621             if (keyCode != null) {
 622                 return keyCode.getCode();
 623             }
 624         }
 625 
 626         return 0;
 627     }
 628 
 629     @Override
 630     public PathElement[] convertShapeToFXPath(Object shape) {
 631         // Had to be mocked up for TextField tests (for the caret!)
 632         // Since the "shape" could be anything, I'm just returning
 633         // something here, doesn't matter what.
 634         return new PathElement[0];





 635     }
 636 
 637     @Override
 638     public Filterable toFilterable(Image img) {
 639         return StubFilterable.create((StubPlatformImage)img.impl_getPlatformImage());
 640     }
 641 
 642     @Override
 643     public FilterContext getFilterContext(Object config) {
 644         throw new UnsupportedOperationException();
 645     }
 646 
 647     @Override
 648     public boolean isForwardTraversalKey(KeyEvent e) {
 649         throw new UnsupportedOperationException();
 650     }
 651 
 652     @Override
 653     public boolean isBackwardTraversalKey(KeyEvent e) {
 654         throw new UnsupportedOperationException();


< prev index next >