Vendredi 15 février 2008

Purpose

Here is a Pluggable Java Component that allows to have non rectangular buttons.

Because it uses the Gradient features, it needs, at least the Sun java plugin 1.4
It won't run against JInitiator

You can have shapes described by polygon coordinate pairs, and also button made by a single letter, a word or even, by a complete sentence.


Amazing Button



The Java code

     amazingbutton.java



The implementation class of the Push Button Item

     oracle.forms.fd.AmazingButton


The methods you can set

Because it is a PJC that extends VButton, you can use the standard Set_Item_Property() built-in to set the standard button's properties.



Draw a circle button - SET_CIRCLE

Set_Custom_Property( 'BL.BT', 1, 'SET_CIRCLE','');

 

Draw a losange button - SET_LOSANGE

Set_Custom_Property( 'BL.BT', 1, 'SET_LOSANGE','');


 

Draw a polygon button - SET_POLYGON

Set_Custom_Property( 'BL.BT', 1, 'SET_POLYGON','x,y[,x,y[,...]]');

e.g.
Set_Custom_Property( 'BL.BT', 1, 'SET_POLYGON','24,0,47,34,47,58,38,58,24,37,10,58,1,58,0,33,24,1');

 

Draw a text button - SET_TEXT

Set_Custom_Property( 'BL.BT', 1, 'SET_TEXT','text[,font_name[,font_weight[,font_size]]]');

e.g.
Set_Custom_Property( 'BL.BT', 1, 'SET_TEXT','The text,Tahoma,B,45');

 

 

Set the text shadow color - SET_SHADOW_COLOR

Set_Custom_Property( 'BL.BT', 1, 'SET_TEXT_SHADOW','rgb_color');

default color is grey (r160g160b160)

e.g.
Set_Custom_Property( 'BL.BT', 1, 'SET_TEXT_SHADOW','r129g25b222');

 

 

Set the text shadow shift - SET_SHADOW_SHIFT

Set_Custom_Property( 'BL.BT', 1, 'SET_SHADOW_SHIFT','x_shift,y_shift');

e.g.
Set_Custom_Property( 'BL.BT', 1, 'SET_TEXT_SHADOW','-5,-4');


When no given x=4 and y=3.

If you want to hide the shadow, provide 0,0

 

  

Set the text position - SET_TEXT_POSITION

Set_Custom_Property( 'BL.BT', 1, 'SET_TEXT_POSITION','left | center | right');

e.g.
Set_Custom_Property( 'BL.BT', 1, 'SET_TEXT_POSITION','left');

 

  

Set the text x,y position - SET_TEXT_AT

Set_Custom_Property( 'BL.BT', 1, 'SET_TEXT_AT','x_pos,y_pos');

e.g.
Set_Custom_Property( 'BL.BT', 1, 'SET_TEXT_AT','10,10');

 

 

 

Set the gradient colors - SET_GRADIENT

Set_Custom_Property( 'BL.BT', 1, 'SET_GRADIENT','rgb_color,rgb_color');

e.g.
Set_Custom_Property( 'BL.BT', 1, 'SET_GRADIENT','r230g154b117,r230g78b0');


 

Set the border color - SET_BORDER_COLOR

Set_Custom_Property( 'BL.BT', 1, 'SET_BORDER_COLOR','rgb_color');

e.g.
Set_Custom_Property( 'BL.BT', 1, 'SET_BORDER_COLOR','r225g50b30');


 

Set the rotation angle - SET_ROTATION

Set_Custom_Property( 'BL.BT', 1, 'SET_ROTATION','angle');

e.g.
Set_Custom_Property( 'BL.BT', 1, 'SET_ROTATION','90');


 

Scale the shape to fit the button's size - SCALE

Set_Custom_Property( 'BL.BT', 1, 'SCALE','true | false');

If not used, the shape is scaled by default.

e.g.
-- don't scale the shape --
Set_Custom_Property( 'BL.BT', 1, 'SCALE','false');


 

Draw the button's bounding box - DRAW_BORDER

Set_Custom_Property( 'BL.BT', 1, 'DRAW_BORDER','true | false');

e.g.
Set_Custom_Property( 'BL.BT', 1, 'DRAW_BORDER','true');


 

Draw all buttons' bounding boxes - DRAW_BORDER_ALL

Set_Custom_Property( 'BL.BT', 1, 'DRAW_BORDER_ALL','true | false');

e.g.
Set_Custom_Property( 'BL.BT', 1, 'DRAW_BORDER_ALL','true');


 

 

Draw the shape's bounding box - DRAW_CLIP_BORDER

Set_Custom_Property( 'BL.BT', 1, 'DRAW_CLIP_BORDER','true | false');

e.g.
Set_Custom_Property( 'BL.BT', 1, 'DRAW_CLIP_BORDER','true');


 

Draw all shapes' bounding boxes - DRAW_CLIP_BORDER_ALL

Set_Custom_Property( 'BL.BT', 1, 'DRAW_CLIP_BORDER_ALL','true | false');

e.g.
Set_Custom_Property( 'BL.BT', 1, 'DRAW_CLIP_BORDER_ALL','true');



 

Set a bevel background - SET_RELIEF

Set_Custom_Property( 'BL.BT', 1, 'SET_RELIEF','true | false');

e.g.
Set_Custom_Property( 'BL.BT', 1, 'SET_RELIEF','true');



 

Set a bevel background on every button - SET_RELIEF_ALL

Set_Custom_Property( 'BL.BT', 1, 'SET_RELIEF_ALL','true | false');

e.g.
Set_Custom_Property( 'BL.BT', 1, 'SET_RELIEF_ALL','true');



 

 

Set the Text button shadow thickness - SET_TEXT_THICKNESS

Set_Custom_Property( 'BL.BT', 1, 'SET_TEXT_THICKNESS','horizontal_thickness,vertical_thickness');

e.g.
Set_Custom_Property( 'BL.BT', 1, 'SET_TEXT_THICKNESS','6,6');




The sample dialog


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

 

par Oracle Forms community publié dans : PJC - Buttons
ajouter un commentaire commentaires (0)    recommander
Vendredi 26 janvier 2007
 Purpose

Here is a Swing JButton that overloads a standard PJC's button.
It needs the JRE 1.4 (Sun Java Plug-in)

     Swing button

It allows to have a standard Forms button with some nice decoration features.

You can apply a gradient color, set rounded borders, justify the label and also have a shadow behind the label.
Because it is firstly a PJC, you can set most of the common properties with the Set_Item_Property() built-in (label, position, foreground color, background color, etc...).

The gradient feature is part of the JRE 1.4 so this bean need the Sun Java plug-in to run.



The Java code

     SwingButton.java      CButton.java



The implementation class of the Button item

     oracle.forms.fd.SwingButton


The methods you can call

 

  • Set the gradient parameter

    Set_Custom_Property( 'BL.SWINGBUTTON', 1, 'SET_GRADIENT_COLOR', '255,255,0,255,0,0');

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


  • Set the label's shadow color

    Set_Custom_Property( 'BL.SWINGBUTTON', 1, 'SET_SHADOW_COLOR', 'r,g,b');

    On the screenshot, you can see a white shadow behind the label.


  • Set the buttons's border color

    Set_Custom_Property( 'BL.SWINGBUTTON', 1, 'SET_BORDER_COLOR', 'r,g,b');


  • Set the gradient direction

    Set_Custom_Property( 'BL.SWINGBUTTON', 1, 'SET_GRADIENT_DIR', 'direction');

    Where direction can take one of the following value:

      1 : left to right
      2 : right to left
      3 : up to down (like the screen-shot)
      4 : down to up


  • Set the text position

    Set_Custom_Property( 'BL.SWINGBUTTON', 1, 'SET_TEXT_POSITION', 'left | center | right' ) ;


  • Set the image position

    Set_Custom_Property('BL.SWINGBUTTON', 1, 'SET_IMAGE_POSITION', 'HV' );

    Where H can be:
    Left, Center, Right

    and V can be:
    Top, Middle, Bottom


        
    LT CT RT
    LM CM RM
    LB CB RB


  • Set the current image name

    Set_Custom_Property('BL.SWINGBUTTON', 1, 'SET_IMAGE', 'image_name[,position]');

    position is facultative and by default CM (Center Middle)


    image_name can be a url (http://...) a client machine file (d:/...) or a JAR file.



  • Set the mouse ON image (that appears when the mouse enters the button)

    Set_Custom_Property('BL.SWINGBUTTON', 1, 'SET_IMAGE_ON', 'image_name' ) ;


  • Set the rounded setting

    Set_Custom_Property( 'BL.SWINGBUTTON', 1, 'SET_ROUNDED', 'horizontal diameter,vertical diameter' ) ;





The sample dialog

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

   The swingbutton.jar file have to be signed.
   The swingbutton.jar file provided with the article is already signed.

par Oracle Forms community publié dans : PJC - Buttons
ajouter un commentaire commentaires (2)    recommander
Mercredi 22 février 2006

Purpose

This PJC extends default button functionality to show both icon and label.

By
Oleg Tishchenko




The Java code

Get the source code here


Forms configuration

. Copy the lablediconbutton.jar file in the /forms/java directory
. Edit the/forms/server/formsweb.cfg file to add the jar file to thearchive_jini variable

         archive_jini=f90all_jinit.jar,……,lablediconbutton.jar

  Note : Notice that icon files used in this demo are stored in the root of the jar file


Implementation Class property

     oracle.forms.enhancedItems.LabledIconButton


The properties you can set

On image

Set_Custom_Property( 'BLOC.BEAN_ITEM',1, 'IMAGE_NAME_ON', 'icon_name' );

Off image

Set_Custom_Property( 'BLOC.BEAN_ITEM',1, 'IMAGE_NAME_OFF', 'icon_name' );

Trun debug on/off

Set_Custom_Property( 'BLOC.BEAN_ITEM',1, 'DEBUGMESSAGES', 'true' );

Trun debug all instance of this PJC on/off

Set_Custom_Property( 'BLOC.BEAN_ITEM',1, ' DEBUGMESSAGES_ALL', 'false' );


The properties you can read

On image

Get_Custom_Property( 'BLOC.BEAN_ITEM',1, 'IMAGE_NAME_ON' );

Off image

Get_Custom_Property( 'BLOC.BEAN_ITEM',1, 'IMAGE_NAME_OFF' );


The sample dialog

     . Download the lablediconbutton.zip file
     . Unzip the file
     . Edit your /forms/server/formsweb.cfg file
     . Open the lablediconbutton.fmb module (Oracle Forms 10.1.2)
     . Compile all and run the module

par Oracle Forms community publié dans : PJC - Buttons
ajouter un commentaire commentaires (0)    recommander
définition blog sur over-blog.com - Contact - C.G.U. - Rémunération en droits d'auteur avec TF1 Network - Signaler un abus