Class GraphicsUtil


  • public final class GraphicsUtil
    extends java.lang.Object
    Utility function for graphics operations.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static boolean isRAP  
    • Constructor Summary

      Constructors 
      Constructor Description
      GraphicsUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.eclipse.swt.graphics.Cursor createCursor​(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.ImageData imageData, int width, int height)  
      static org.eclipse.swt.graphics.GC createGC​(org.eclipse.swt.graphics.Drawable image)
      Used for single sourcing, returns null if called in RAP Context.
      static void drawVerticalText​(org.eclipse.draw2d.Graphics graphics, java.lang.String text, int x, int y, boolean upToDown)
      Draw vertical text.
      static void drawVerticalText​(org.eclipse.draw2d.Graphics graphics, java.lang.String text, org.eclipse.draw2d.geometry.Point location, boolean upToDown)
      Draw vertical text.
      static boolean isRAP()  
      static void setTransform​(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Transform transform)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • isRAP

        private static boolean isRAP
    • Constructor Detail

      • GraphicsUtil

        public GraphicsUtil()
    • Method Detail

      • drawVerticalText

        public static final void drawVerticalText​(org.eclipse.draw2d.Graphics graphics,
                                                  java.lang.String text,
                                                  int x,
                                                  int y,
                                                  boolean upToDown)
        Draw vertical text.
        Parameters:
        graphics - draw2D graphics.
        text - text to be drawn.
        x - the x coordinate of the text, which is the left upper corner.
        y - the y coordinate of the text, which is the left upper corner.
      • drawVerticalText

        public static final void drawVerticalText​(org.eclipse.draw2d.Graphics graphics,
                                                  java.lang.String text,
                                                  org.eclipse.draw2d.geometry.Point location,
                                                  boolean upToDown)
        Draw vertical text.
        Parameters:
        graphics - draw2D graphics.
        text - text to be drawn.
        location - the left upper corner coordinates of the text.
      • isRAP

        public static final boolean isRAP()
      • createGC

        public static org.eclipse.swt.graphics.GC createGC​(org.eclipse.swt.graphics.Drawable image)
        Used for single sourcing, returns null if called in RAP Context.
        Parameters:
        image -
        Returns:
      • setTransform

        public static void setTransform​(org.eclipse.swt.graphics.GC gc,
                                        org.eclipse.swt.graphics.Transform transform)
      • createCursor

        public static org.eclipse.swt.graphics.Cursor createCursor​(org.eclipse.swt.graphics.Device device,
                                                                   org.eclipse.swt.graphics.ImageData imageData,
                                                                   int width,
                                                                   int height)