Purpose

Here is a Java Bean that allows to paint the current canevas with a Java gradient.
It needs the JRE 1.4 (Sun Java Plug-in)


     Gradient Canevas



The Java code

     PaintCanevas.java



The implementation class of the B
ean

     oracle.forms.fd.PaintCanevas



The methods you can call


  • Set the gradient parameters

    Set_Custom_Property( 'BL.BEAN', 1, 'SET_GRADIENT_COLORS', '255,255,0,255,0,0');

    It takes two RGB colors, the starting color then the ending color.


  • Set the Horizontal cycle

    Set_Custom_Property( 'BL.BEAN', 1, 'SET_H_CYCLE', 'cycle_info' ) ;

    Set the Horizontal cycle when you want to have a repetitive gradient.

    You can provide a value exprimed in pixel or a fraction

    e.g.: 

    - repeat the gradient 2 times horizontally:

    Set_Custom_Property( 'BL.BEAN', 1, 'SET_H_CYCLE', '/2' ) ;





    - repeat the gradient each 50 horizontal and vertical pixels

    Set_Custom_Property( 'BL.BEAN', 1, 'SET_H_CYCLE', '50' ) ;
    Set_Custom_Property( 'BL.BEAN', 1, 'SET_V_CYCLE', '50' ) ;






  • Set the Vertical cycle

    Set_Custom_Property( 'BL.BEAN', 1, 'SET_V_CYCLE', 'cycle_info' ) ;

    See the Horizontal cycle explanation.


  • Set the gradient direction

    Set_Custom_Property( 'BL.BEAN', 1, 'SET_GRADIENT_DIRECTION', 'direction' ) ;

    Where direction can take one of the following values:

      LeftToRight : Left to Right
      UpToDown : Up to Down
      LeftUpToRightDown : Left Up to Right Down
      LeftDownToRightUp : Left Down to Right Up

Of course, you can have one Bean per canevas, so you can have some nice mixed compositions with multiple canevases !




The sample dialog

   . Download the gradientcanevas.zip file
   . Unzip the files
   . copy the paintcanevas.jar file in the /forms/java directory
   . Edit your /forms/server/formsweb.cfg file to add the jar file
   . Open the GRADIENT_CANEVAS.fmb module (Oracle Forms 9.0.2)
   . Compile all and run the module