SlideShare a Scribd company logo
1 of 7
Download to read offline
Jslider - Francois Degrelle

                           Oracle Forms – Javabean
                             A Jslider in your application
                                            Home page


1. Purpose


  This bean allows to display a Jslider component in your Forms application.




2. The Javabean


  package oracle.forms.fd;

  import java.awt.*;
  import java.awt.event.*;

  import java.util.StringTokenizer;
  import javax.swing.JSlider;

  import javax.swing.event.ChangeEvent;
  import javax.swing.event.ChangeListener;

  import   oracle.forms.ui.CustomEvent;
  import   oracle.forms.ui.VBean;
  import   oracle.forms.handler.IHandler;
  import   oracle.forms.properties.ID;

  /**
   * A javabean to display Sliders in Forms
   *
                                                         f.degrelle@free.fr - http://fdegrelle.over-blog.com/
Jslider - Francois Degrelle
* @author Francois Degrelle
* @version 1.0
*/

public class Slider extends VBean implements ChangeListener
{
  public final static ID SetBG        = ID.registerProperty("SETBGCOLOR");
  public final static ID SetFG        = ID.registerProperty("SETFGCOLOR");
  public final static ID ValueChanged = ID.registerProperty("VALUECHANGED");
  public final static ID SetBounds    = ID.registerProperty("SETBOUNDS");
  public final static ID SetValue     = ID.registerProperty("SETVALUE");
  public final static ID GetValue     = ID.registerProperty("GETVALUE");
  private IHandler m_handler;

 static int iValue = 0 ;                // current value variable
 protected JSlider slide ;              // Slider pointer
 protected Color BGcolor, FGcolor     ; // Slider colors

 public Slider()
 {
   super();
   // create a new JSlider
   slide = new JSlider();

     slide.addChangeListener(this);
     slide.setPaintTrack(true);
     slide.setPaintTicks(true);
     slide.setPaintLabels(true);

     add(slide);

 }

 // Fires when the JSlider is modified
 public void stateChanged(ChangeEvent e) {
     JSlider source = (JSlider)e.getSource();
     if (!source.getValueIsAdjusting()) {
         iValue = (int)source.getValue();
         // Dispatch event
         CustomEvent ce = new CustomEvent(m_handler, ValueChanged);
         dispatchCustomEvent(ce);

      }
 }


 public void init(IHandler handler)
 {
   m_handler = handler;
   super.init(handler);
 }


 public boolean setProperty(ID property, Object value)
 {

     if (property == SetBG) // Set the background color
     {
       String color = value.toString().trim();
       System.out.println("BG="+color) ;
       int c=0, i=0, r=0, g=0, b=0 ;
       StringTokenizer st = new StringTokenizer(color,",");
       while (st.hasMoreTokens()) {
                c = new Integer((String)st.nextToken()).intValue()      ;
                if( i == 0) r = c;
                if( i == 1 ) g = c ;
                if( i == 2 ) b = c ;
                i++;
              }
       BGcolor = new Color(r,g,b);
       slide.setBackground(BGcolor);
       return true;
     }

                                                              f.degrelle@free.fr - http://fdegrelle.over-blog.com/
Jslider - Francois Degrelle
        else if (property == SetFG) // Set the foreground color
        {
          String color = value.toString().trim();
          System.out.println("FG="+color) ;
          int c=0, i=0, r=0, g=0, b=0 ;
          StringTokenizer st = new StringTokenizer(color,",");
          while (st.hasMoreTokens()) {
                   c = new Integer((String)st.nextToken()).intValue()     ;
                   if( i == 0) r = c;
                   if( i == 1 ) g = c ;
                   if( i == 2 ) b = c ;
                   i++ ;
                 }
          FGcolor = new Color(r,g,b);
          slide.setForeground(FGcolor);
          return true;
        }
        else if (property == SetBounds) // Set the properties
        {
          String sBounds = value.toString().trim();
          int c=0, i=1 ;
          StringTokenizer st = new StringTokenizer(sBounds,",");
          while (st.hasMoreTokens()) {
                if( i == 1)
                {
                   if ( st.nextToken().equals("H"))
                     slide.setOrientation(JSlider.HORIZONTAL);
                   else
                     slide.setOrientation(JSlider.VERTICAL);
                }
                else
                {
                   c = new Integer((String)st.nextToken()).intValue()     ;
                   if( i == 2) slide.setMinimum(c);
                   if( i == 3 ) slide.setMaximum(c);
                   if( i == 4 ) slide.setMajorTickSpacing(c);
                   if( i == 5 ) slide.setMinorTickSpacing(c);
                }
                 i++;
          }
          return true;
        }
        else if (property == SetValue) // Set the current value
        {
          slide.setValue(new Integer((String)value).intValue() );
          return true;
        }
        else
        {
         return super.setProperty(property, value);
        }

    }

    /**
     * Get the current value
     **/

    public Object getProperty(ID pId)
    {
      if (pId == GetValue)
      {
        return "" + iValue ;
      }
      else
      {
        return super.getProperty(pId);
      }
    }


}


                                                                f.degrelle@free.fr - http://fdegrelle.over-blog.com/
Jslider - Francois Degrelle




3. Forms configuration

         Copy the Slider.jar file in the /forms/java directory

         Edit the /forms/server/formsweb.cfg file to add the jar file to the archive_jini variable

         archive_jini=f90all_jinit.jar,……, Slider.jar




4. How to implement this bean in your own form

         Open your form

         Add a Javabean component to any block

         Set its Implementation class property to oracle.forms.fd.Slider

         Eventually, set the Backgroud and/or the foreground color




5. The properties that can be sent to the bean



         The background color of the slider

         Set_Custom_Property( BEAN_NAME, BEAN_NUMBER, 'SETBGCOLOR', 'rgb_color' ) ;

         e.g.

         Set_Custom_Property('BLK.ITEM_BEAN', 1, 'SETBGCOLOR', '255,0,255' ) ;



         Information about the background property

         If the background color of the bean is not setted, we use the canvas background color property.
         If the canvas background color property is not setted, we have to know what colorscheme is currently in
         use

         There is a package in the SLIDER.FMB module that store the RGB values for each colorscheme

           -- Colorscheme RGB values        --
           GC$Teal      Varchar2(15)        :=   '115,142,140' ;
           GC$Titanium Varchar2(15)         :=   '99,101,99' ;
           GC$Red       Varchar2(15)        :=   '156,130,123' ;
           GC$Khaki     Varchar2(15)        :=   '140,142,123' ;
           GC$Blue      Varchar2(15)        :=   '90,117,148' ;
           GC$Olive     Varchar2(15)        :=   '107,113,99' ;
           GC$Purple    Varchar2(15)        :=   '123,113,140' ;
           GC$Blaf      Varchar2(15)        :=   '247,247,231' ;

           -- Current colorscheme --
           GC$CurScheme Varchar2(15) := '' ;

         In the case of the use of a colorscheme, you have to indicate it as soon as possible (in a When-New-
         Form-Instance trigger)
                                                                           f.degrelle@free.fr - http://fdegrelle.over-blog.com/
Jslider - Francois Degrelle

         -- ColorScheme used ? --
         PKG_SLIDER.GC$CurScheme := PKG_SLIDER.GC$Blaf ;

         In this example, i used the blaf colorscheme




         The foreground color of the slider

         Set_Custom_Property( BEAN_NAME, BEAN_NUMBER, 'SETFGCOLOR', 'rgb_color' ) ;

         e.g.

         Set_Custom_Property('BLK.ITEM_BEAN', 1, 'SETFGCOLOR', '0,0,0' ) ;




         The properties of the slider

         Set_Custom_Property( BEAN_NAME, BEAN_NUMBER, 'SETBOUNDS', PROPERTIES ) ;

         Where properties are:

         Orientation : could be H for a horizontal slider or V for a vertical slider
         Max Value : the maximum value for the slider
         Min Value : the minimum value for the slider
         MajorTick : distance betwwen each principal graduations
         MinorTick : distance betwwen each secondary graduations


         e.g.

         Set_Custom_Property('BLK.ITEM_BEAN', 1, 'SETBOUNDS', ' H,0,10,2,1 ' ) ;



         The current value of the slider

         Set_Custom_Property( BEAN_NAME, BEAN_NUMBER, 'SETVALUE', 'value' ) ;

         e.g.

         Set_Custom_Property('BLK.ITEM_BEAN', 1, 'SETVALUE', '5' ) ;




6. The properties that can be read from the bean

         The current value of the slider

         CHAR := Get_Custom_Property( BEAN_NAME, BEAN_NUMBER, 'GETVALUE' ) ;

         e.g.

         Value := Get_Custom_Property('BLK.ITEM_BEAN', 1, 'GETVALUE' ) ;




                                                                              f.degrelle@free.fr - http://fdegrelle.over-blog.com/
Jslider - Francois Degrelle
7. The sample dialog

     Download the jslider.zip file

     Unzip the jslider.zip file

     Copy the Slider.jar file in your /forms/java/ directory

     Edit your /forms/server/formsweb.cfg file

     Open the SLIDER.fmb module (Oracle Forms 10.1.2)

     Compile all and run the module


  The settings of the slider properties are grouped in the PKG_SLIDER package

  PACKAGE PKG_SLIDER IS

    -- Colorscheme RGB values        --
    GC$Teal      Varchar2(15)        :=   '115,142,140' ;
    GC$Titanium Varchar2(15)         :=   '99,101,99' ;
    GC$Red       Varchar2(15)        :=   '156,130,123' ;
    GC$Khaki     Varchar2(15)        :=   '140,142,123' ;
    GC$Blue      Varchar2(15)        :=   '90,117,148' ;
    GC$Olive     Varchar2(15)        :=   '107,113,99' ;
    GC$Purple    Varchar2(15)        :=   '123,113,140' ;
    GC$Blaf      Varchar2(15)        :=   '247,247,231' ;

    -- Current colorscheme --
    GC$CurScheme Varchar2(15) := '' ;

    PROCEDURE    Init_Slider
    (
       PC$Name       IN VARCHAR2,
       PN$Num        IN PLS_INTEGER,
       PC$Bounds     IN VARCHAR2
    ) ;

    PROCEDURE Set_Value
    (
       PC$Name       IN VARCHAR2,
       PN$Num        IN PLS_INTEGER,
       PN$Value      IN NUMBER
    ) ;


  END;

  PACKAGE BODY PKG_SLIDER IS

  PROCEDURE    Init_Slider
    (
       PC$Name        IN VARCHAR2,
       PN$Num         IN PLS_INTEGER,
       PC$Bounds      IN VARCHAR2
    )
  Is
  LC$CVBColor    Varchar2(20) := Get_Canvas_Property( Get_Item_Property( PC$Name, ITEM_CANVAS ),
  BACKGROUND_COLOR ) ;
        LC$CVFColor    Varchar2(20) := Get_Canvas_Property( Get_Item_Property( PC$Name,
  ITEM_CANVAS ), FOREGROUND_COLOR ) ;
  LC$BGColor     Varchar2(20) := Get_Item_Property(PC$Name, BACKGROUND_COLOR) ;
  LC$FGColor     Varchar2(20) := Get_Item_Property(PC$Name, FOREGROUND_COLOR) ;
  LC$Color       Varchar2(15) ;
  Begin

  -- BackGround color --
  If LC$BGColor is not null Then
    LC$Color := Translate( LC$BGColor, '0123456789gbr','0123456789,,' ) ;

                                                                   f.degrelle@free.fr - http://fdegrelle.over-blog.com/
Jslider - Francois Degrelle
  Set_Custom_Property( PC$Name, PN$Num, 'SETBGCOLOR', LC$Color ) ;
Elsif LC$CVBColor is not null Then
  LC$Color := Translate( LC$CVBColor, '0123456789gbr','0123456789,,' ) ;
  Set_Custom_Property( PC$Name, PN$Num, 'SETBGCOLOR', LC$Color ) ;
Else
LC$Color := PKG_SLIDER.GC$CurScheme ;
Set_Custom_Property( PC$Name, PN$Num, 'SETBGCOLOR', LC$Color ) ;
End if ;

-- ForeGround color --
If LC$FGColor is not null Then
  LC$Color := Translate( LC$FGColor, '0123456789gbr','0123456789,,' ) ;
  Set_Custom_Property( PC$Name, PN$Num, 'SETFGCOLOR', LC$Color ) ;
Elsif LC$CVFColor is not null Then
  LC$Color := Translate( LC$CVFColor, '0123456789gbr','0123456789,,' ) ;
  Set_Custom_Property( PC$Name, PN$Num, 'SETBGCOLOR', LC$Color ) ;
End if ;

-- Bounds --
Set_Custom_Property( PC$Name, PN$Num, 'SETBOUNDS', PC$Bounds ) ;


End ;

-------------------------------------------
-- Set the current value of the Slider --
-------------------------------------------
PROCEDURE Set_Value
  (
     PC$Name       IN VARCHAR2,
     PN$Num        IN PLS_INTEGER,
     PN$Value      IN NUMBER
  )
IS
BEGIN

  -- Initial value --
  Set_Custom_Property( PC$Name, PN$Num, 'SETVALUE', To_Char(PN$Value) ) ;

End Set_Value;

END;



So, in the When-New-Form-Instance trigger, you can set the slider settings:

-- ColorScheme used ? --
PKG_SLIDER.GC$CurScheme := PKG_SLIDER.GC$Blaf ;

-- Init the slider properties --
PKG_SLIDER.Init_Slider ( 'BL1.BEAN_SLIDER', 1, 'H,0,10,2,1' ) ;

-- Set current the value --
PKG_SLIDER.Set_Value   ( 'BL1.BEAN_SLIDER', 1, 5 ) ;



And get the current value with the When-Custom-Item-Event trigger created on the bean item:

-- Get new value --
:BL1.VAL := Get_Custom_Property( 'BL1.BEAN_SLIDER', 1, 'GETVALUE') ;




                                                                        f.degrelle@free.fr - http://fdegrelle.over-blog.com/

More Related Content

What's hot

code for quiz in my sql
code for quiz  in my sql code for quiz  in my sql
code for quiz in my sql JOYITAKUNDU1
 
Crazy things done on PHP
Crazy things done on PHPCrazy things done on PHP
Crazy things done on PHPTaras Kalapun
 
究極のコントローラを目指す
究極のコントローラを目指す究極のコントローラを目指す
究極のコントローラを目指すYasuo Harada
 
Backbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The BrowserBackbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The BrowserHoward Lewis Ship
 
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICKonstantin Kudryashov
 
Document Classification In PHP
Document Classification In PHPDocument Classification In PHP
Document Classification In PHPIan Barber
 
Document Classification In PHP - Slight Return
Document Classification In PHP - Slight ReturnDocument Classification In PHP - Slight Return
Document Classification In PHP - Slight ReturnIan Barber
 
Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5Leonardo Proietti
 
Instant Dynamic Forms with #states
Instant Dynamic Forms with #statesInstant Dynamic Forms with #states
Instant Dynamic Forms with #statesKonstantin Käfer
 
購物車程式架構簡介
購物車程式架構簡介購物車程式架構簡介
購物車程式架構簡介Jace Ju
 
Symfony World - Symfony components and design patterns
Symfony World - Symfony components and design patternsSymfony World - Symfony components and design patterns
Symfony World - Symfony components and design patternsŁukasz Chruściel
 
Advanced php testing in action
Advanced php testing in actionAdvanced php testing in action
Advanced php testing in actionJace Ju
 
Building fast interpreters in Rust
Building fast interpreters in RustBuilding fast interpreters in Rust
Building fast interpreters in RustIngvar Stepanyan
 
Revisiting SOLID Principles
Revisiting  SOLID Principles Revisiting  SOLID Principles
Revisiting SOLID Principles Anis Ahmad
 
Working With JQuery Part1
Working With JQuery Part1Working With JQuery Part1
Working With JQuery Part1saydin_soft
 

What's hot (20)

code for quiz in my sql
code for quiz  in my sql code for quiz  in my sql
code for quiz in my sql
 
Crazy things done on PHP
Crazy things done on PHPCrazy things done on PHP
Crazy things done on PHP
 
究極のコントローラを目指す
究極のコントローラを目指す究極のコントローラを目指す
究極のコントローラを目指す
 
SDC - Einführung in Scala
SDC - Einführung in ScalaSDC - Einführung in Scala
SDC - Einführung in Scala
 
Min-Maxing Software Costs
Min-Maxing Software CostsMin-Maxing Software Costs
Min-Maxing Software Costs
 
Backbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The BrowserBackbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The Browser
 
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DIC
 
Document Classification In PHP
Document Classification In PHPDocument Classification In PHP
Document Classification In PHP
 
Document Classification In PHP - Slight Return
Document Classification In PHP - Slight ReturnDocument Classification In PHP - Slight Return
Document Classification In PHP - Slight Return
 
Presentation1
Presentation1Presentation1
Presentation1
 
Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5
 
Instant Dynamic Forms with #states
Instant Dynamic Forms with #statesInstant Dynamic Forms with #states
Instant Dynamic Forms with #states
 
購物車程式架構簡介
購物車程式架構簡介購物車程式架構簡介
購物車程式架構簡介
 
Symfony World - Symfony components and design patterns
Symfony World - Symfony components and design patternsSymfony World - Symfony components and design patterns
Symfony World - Symfony components and design patterns
 
Advanced php testing in action
Advanced php testing in actionAdvanced php testing in action
Advanced php testing in action
 
Building fast interpreters in Rust
Building fast interpreters in RustBuilding fast interpreters in Rust
Building fast interpreters in Rust
 
Rust ⇋ JavaScript
Rust ⇋ JavaScriptRust ⇋ JavaScript
Rust ⇋ JavaScript
 
Drupal 8 database api
Drupal 8 database apiDrupal 8 database api
Drupal 8 database api
 
Revisiting SOLID Principles
Revisiting  SOLID Principles Revisiting  SOLID Principles
Revisiting SOLID Principles
 
Working With JQuery Part1
Working With JQuery Part1Working With JQuery Part1
Working With JQuery Part1
 

Viewers also liked

Il sito internet museale e l’interazione con il visitatore attraverso gli st...
Il sito internet museale e l’interazione con il visitatore attraverso  gli st...Il sito internet museale e l’interazione con il visitatore attraverso  gli st...
Il sito internet museale e l’interazione con il visitatore attraverso gli st...Federica Battaglia
 
Brasilia Veste Pele
Brasilia Veste PeleBrasilia Veste Pele
Brasilia Veste PeleSamuel Silva
 
Auww presentation en.ppsx
Auww presentation en.ppsxAuww presentation en.ppsx
Auww presentation en.ppsxCici Dualief
 
Exhibitions Australia, Spain, Germany, Belgium And The Netherlands
Exhibitions Australia, Spain, Germany, Belgium And The NetherlandsExhibitions Australia, Spain, Germany, Belgium And The Netherlands
Exhibitions Australia, Spain, Germany, Belgium And The Netherlandsstefancools
 
[Yrc] tiem nang phat trien loai hinh du lich van hoa o vung mien nui lao cai
[Yrc] tiem nang phat trien loai hinh du lich van hoa o vung mien nui lao cai[Yrc] tiem nang phat trien loai hinh du lich van hoa o vung mien nui lao cai
[Yrc] tiem nang phat trien loai hinh du lich van hoa o vung mien nui lao caiFurin Hn
 
marketing mix of global business
marketing mix of global businessmarketing mix of global business
marketing mix of global businessYasir Chowdhary
 
My non profit project
My non profit projectMy non profit project
My non profit projectmlh5223
 
Building.Aut.Giugno2004.Mi
Building.Aut.Giugno2004.MiBuilding.Aut.Giugno2004.Mi
Building.Aut.Giugno2004.Migggerma72
 
Presentación1
Presentación1Presentación1
Presentación1monchifor
 
11 annex-xi-idb project-risk_management_guidelines
11 annex-xi-idb project-risk_management_guidelines11 annex-xi-idb project-risk_management_guidelines
11 annex-xi-idb project-risk_management_guidelinesAshish Kumar
 

Viewers also liked (16)

C++ can ban
C++ can banC++ can ban
C++ can ban
 
Il sito internet museale e l’interazione con il visitatore attraverso gli st...
Il sito internet museale e l’interazione con il visitatore attraverso  gli st...Il sito internet museale e l’interazione con il visitatore attraverso  gli st...
Il sito internet museale e l’interazione con il visitatore attraverso gli st...
 
Brasilia Veste Pele
Brasilia Veste PeleBrasilia Veste Pele
Brasilia Veste Pele
 
nose
nosenose
nose
 
Eco 301 ch26
Eco 301 ch26Eco 301 ch26
Eco 301 ch26
 
Auww presentation en.ppsx
Auww presentation en.ppsxAuww presentation en.ppsx
Auww presentation en.ppsx
 
Dell03012006
Dell03012006Dell03012006
Dell03012006
 
Exhibitions Australia, Spain, Germany, Belgium And The Netherlands
Exhibitions Australia, Spain, Germany, Belgium And The NetherlandsExhibitions Australia, Spain, Germany, Belgium And The Netherlands
Exhibitions Australia, Spain, Germany, Belgium And The Netherlands
 
Smartgrids
SmartgridsSmartgrids
Smartgrids
 
[Yrc] tiem nang phat trien loai hinh du lich van hoa o vung mien nui lao cai
[Yrc] tiem nang phat trien loai hinh du lich van hoa o vung mien nui lao cai[Yrc] tiem nang phat trien loai hinh du lich van hoa o vung mien nui lao cai
[Yrc] tiem nang phat trien loai hinh du lich van hoa o vung mien nui lao cai
 
CSR
CSR CSR
CSR
 
marketing mix of global business
marketing mix of global businessmarketing mix of global business
marketing mix of global business
 
My non profit project
My non profit projectMy non profit project
My non profit project
 
Building.Aut.Giugno2004.Mi
Building.Aut.Giugno2004.MiBuilding.Aut.Giugno2004.Mi
Building.Aut.Giugno2004.Mi
 
Presentación1
Presentación1Presentación1
Presentación1
 
11 annex-xi-idb project-risk_management_guidelines
11 annex-xi-idb project-risk_management_guidelines11 annex-xi-idb project-risk_management_guidelines
11 annex-xi-idb project-risk_management_guidelines
 

Similar to J slider

This is Java,I am currently stumped on how to add a scoreboard for.pdf
This is Java,I am currently stumped on how to add a scoreboard for.pdfThis is Java,I am currently stumped on how to add a scoreboard for.pdf
This is Java,I am currently stumped on how to add a scoreboard for.pdfanjandavid
 
Jggug 2010 330 Grails 1.3 観察
Jggug 2010 330 Grails 1.3 観察Jggug 2010 330 Grails 1.3 観察
Jggug 2010 330 Grails 1.3 観察Tsuyoshi Yamamoto
 
Introduction to open gl in android droidcon - slides
Introduction to open gl in android   droidcon - slidesIntroduction to open gl in android   droidcon - slides
Introduction to open gl in android droidcon - slidestamillarasan
 
VISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEVISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEDarwin Durand
 
Sokoban Game Development Using Java ( Updated using Screenshots & Class Diagr...
Sokoban Game Development Using Java ( Updated using Screenshots & Class Diagr...Sokoban Game Development Using Java ( Updated using Screenshots & Class Diagr...
Sokoban Game Development Using Java ( Updated using Screenshots & Class Diagr...British Council
 
I need help on this 5 and 6. here is the code so far import jav.pdf
I need help on this 5 and 6. here is the code so far import jav.pdfI need help on this 5 and 6. here is the code so far import jav.pdf
I need help on this 5 and 6. here is the code so far import jav.pdfmail931892
 
JavaScript - i och utanför webbläsaren (2010-03-03)
JavaScript - i och utanför webbläsaren (2010-03-03)JavaScript - i och utanför webbläsaren (2010-03-03)
JavaScript - i och utanför webbläsaren (2010-03-03)Anders Jönsson
 
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Tsuyoshi Yamamoto
 
Webgl para JavaScripters
Webgl para JavaScriptersWebgl para JavaScripters
Webgl para JavaScriptersgerbille
 
¿Cómo de sexy puede hacer Backbone mi código?
¿Cómo de sexy puede hacer Backbone mi código?¿Cómo de sexy puede hacer Backbone mi código?
¿Cómo de sexy puede hacer Backbone mi código?jaespinmora
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript IntroductionDmitry Sheiko
 
assignmentTwoCar.javaassignmentTwoCar.javapackage assignmentTw.docx
assignmentTwoCar.javaassignmentTwoCar.javapackage assignmentTw.docxassignmentTwoCar.javaassignmentTwoCar.javapackage assignmentTw.docx
assignmentTwoCar.javaassignmentTwoCar.javapackage assignmentTw.docxssuser562afc1
 
ES6 patterns in the wild
ES6 patterns in the wildES6 patterns in the wild
ES6 patterns in the wildJoe Morgan
 

Similar to J slider (20)

662305 11
662305 11662305 11
662305 11
 
Fact, Fiction, and FP
Fact, Fiction, and FPFact, Fiction, and FP
Fact, Fiction, and FP
 
This is Java,I am currently stumped on how to add a scoreboard for.pdf
This is Java,I am currently stumped on how to add a scoreboard for.pdfThis is Java,I am currently stumped on how to add a scoreboard for.pdf
This is Java,I am currently stumped on how to add a scoreboard for.pdf
 
Jggug 2010 330 Grails 1.3 観察
Jggug 2010 330 Grails 1.3 観察Jggug 2010 330 Grails 1.3 観察
Jggug 2010 330 Grails 1.3 観察
 
Introduction to open gl in android droidcon - slides
Introduction to open gl in android   droidcon - slidesIntroduction to open gl in android   droidcon - slides
Introduction to open gl in android droidcon - slides
 
VISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEVISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLE
 
Sokoban Game Development Using Java ( Updated using Screenshots & Class Diagr...
Sokoban Game Development Using Java ( Updated using Screenshots & Class Diagr...Sokoban Game Development Using Java ( Updated using Screenshots & Class Diagr...
Sokoban Game Development Using Java ( Updated using Screenshots & Class Diagr...
 
I need help on this 5 and 6. here is the code so far import jav.pdf
I need help on this 5 and 6. here is the code so far import jav.pdfI need help on this 5 and 6. here is the code so far import jav.pdf
I need help on this 5 and 6. here is the code so far import jav.pdf
 
ES6 Overview
ES6 OverviewES6 Overview
ES6 Overview
 
JavaScript - i och utanför webbläsaren (2010-03-03)
JavaScript - i och utanför webbläsaren (2010-03-03)JavaScript - i och utanför webbläsaren (2010-03-03)
JavaScript - i och utanför webbläsaren (2010-03-03)
 
662305 LAB13
662305 LAB13662305 LAB13
662305 LAB13
 
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
 
Webgl para JavaScripters
Webgl para JavaScriptersWebgl para JavaScripters
Webgl para JavaScripters
 
Introduction to Groovy
Introduction to GroovyIntroduction to Groovy
Introduction to Groovy
 
Applications
ApplicationsApplications
Applications
 
¿Cómo de sexy puede hacer Backbone mi código?
¿Cómo de sexy puede hacer Backbone mi código?¿Cómo de sexy puede hacer Backbone mi código?
¿Cómo de sexy puede hacer Backbone mi código?
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript Introduction
 
All things that are not code
All things that are not codeAll things that are not code
All things that are not code
 
assignmentTwoCar.javaassignmentTwoCar.javapackage assignmentTw.docx
assignmentTwoCar.javaassignmentTwoCar.javapackage assignmentTw.docxassignmentTwoCar.javaassignmentTwoCar.javapackage assignmentTw.docx
assignmentTwoCar.javaassignmentTwoCar.javapackage assignmentTw.docx
 
ES6 patterns in the wild
ES6 patterns in the wildES6 patterns in the wild
ES6 patterns in the wild
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

J slider

  • 1. Jslider - Francois Degrelle Oracle Forms – Javabean A Jslider in your application Home page 1. Purpose This bean allows to display a Jslider component in your Forms application. 2. The Javabean package oracle.forms.fd; import java.awt.*; import java.awt.event.*; import java.util.StringTokenizer; import javax.swing.JSlider; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import oracle.forms.ui.CustomEvent; import oracle.forms.ui.VBean; import oracle.forms.handler.IHandler; import oracle.forms.properties.ID; /** * A javabean to display Sliders in Forms * f.degrelle@free.fr - http://fdegrelle.over-blog.com/
  • 2. Jslider - Francois Degrelle * @author Francois Degrelle * @version 1.0 */ public class Slider extends VBean implements ChangeListener { public final static ID SetBG = ID.registerProperty("SETBGCOLOR"); public final static ID SetFG = ID.registerProperty("SETFGCOLOR"); public final static ID ValueChanged = ID.registerProperty("VALUECHANGED"); public final static ID SetBounds = ID.registerProperty("SETBOUNDS"); public final static ID SetValue = ID.registerProperty("SETVALUE"); public final static ID GetValue = ID.registerProperty("GETVALUE"); private IHandler m_handler; static int iValue = 0 ; // current value variable protected JSlider slide ; // Slider pointer protected Color BGcolor, FGcolor ; // Slider colors public Slider() { super(); // create a new JSlider slide = new JSlider(); slide.addChangeListener(this); slide.setPaintTrack(true); slide.setPaintTicks(true); slide.setPaintLabels(true); add(slide); } // Fires when the JSlider is modified public void stateChanged(ChangeEvent e) { JSlider source = (JSlider)e.getSource(); if (!source.getValueIsAdjusting()) { iValue = (int)source.getValue(); // Dispatch event CustomEvent ce = new CustomEvent(m_handler, ValueChanged); dispatchCustomEvent(ce); } } public void init(IHandler handler) { m_handler = handler; super.init(handler); } public boolean setProperty(ID property, Object value) { if (property == SetBG) // Set the background color { String color = value.toString().trim(); System.out.println("BG="+color) ; int c=0, i=0, r=0, g=0, b=0 ; StringTokenizer st = new StringTokenizer(color,","); while (st.hasMoreTokens()) { c = new Integer((String)st.nextToken()).intValue() ; if( i == 0) r = c; if( i == 1 ) g = c ; if( i == 2 ) b = c ; i++; } BGcolor = new Color(r,g,b); slide.setBackground(BGcolor); return true; } f.degrelle@free.fr - http://fdegrelle.over-blog.com/
  • 3. Jslider - Francois Degrelle else if (property == SetFG) // Set the foreground color { String color = value.toString().trim(); System.out.println("FG="+color) ; int c=0, i=0, r=0, g=0, b=0 ; StringTokenizer st = new StringTokenizer(color,","); while (st.hasMoreTokens()) { c = new Integer((String)st.nextToken()).intValue() ; if( i == 0) r = c; if( i == 1 ) g = c ; if( i == 2 ) b = c ; i++ ; } FGcolor = new Color(r,g,b); slide.setForeground(FGcolor); return true; } else if (property == SetBounds) // Set the properties { String sBounds = value.toString().trim(); int c=0, i=1 ; StringTokenizer st = new StringTokenizer(sBounds,","); while (st.hasMoreTokens()) { if( i == 1) { if ( st.nextToken().equals("H")) slide.setOrientation(JSlider.HORIZONTAL); else slide.setOrientation(JSlider.VERTICAL); } else { c = new Integer((String)st.nextToken()).intValue() ; if( i == 2) slide.setMinimum(c); if( i == 3 ) slide.setMaximum(c); if( i == 4 ) slide.setMajorTickSpacing(c); if( i == 5 ) slide.setMinorTickSpacing(c); } i++; } return true; } else if (property == SetValue) // Set the current value { slide.setValue(new Integer((String)value).intValue() ); return true; } else { return super.setProperty(property, value); } } /** * Get the current value **/ public Object getProperty(ID pId) { if (pId == GetValue) { return "" + iValue ; } else { return super.getProperty(pId); } } } f.degrelle@free.fr - http://fdegrelle.over-blog.com/
  • 4. Jslider - Francois Degrelle 3. Forms configuration Copy the Slider.jar file in the /forms/java directory Edit the /forms/server/formsweb.cfg file to add the jar file to the archive_jini variable archive_jini=f90all_jinit.jar,……, Slider.jar 4. How to implement this bean in your own form Open your form Add a Javabean component to any block Set its Implementation class property to oracle.forms.fd.Slider Eventually, set the Backgroud and/or the foreground color 5. The properties that can be sent to the bean The background color of the slider Set_Custom_Property( BEAN_NAME, BEAN_NUMBER, 'SETBGCOLOR', 'rgb_color' ) ; e.g. Set_Custom_Property('BLK.ITEM_BEAN', 1, 'SETBGCOLOR', '255,0,255' ) ; Information about the background property If the background color of the bean is not setted, we use the canvas background color property. If the canvas background color property is not setted, we have to know what colorscheme is currently in use There is a package in the SLIDER.FMB module that store the RGB values for each colorscheme -- Colorscheme RGB values -- GC$Teal Varchar2(15) := '115,142,140' ; GC$Titanium Varchar2(15) := '99,101,99' ; GC$Red Varchar2(15) := '156,130,123' ; GC$Khaki Varchar2(15) := '140,142,123' ; GC$Blue Varchar2(15) := '90,117,148' ; GC$Olive Varchar2(15) := '107,113,99' ; GC$Purple Varchar2(15) := '123,113,140' ; GC$Blaf Varchar2(15) := '247,247,231' ; -- Current colorscheme -- GC$CurScheme Varchar2(15) := '' ; In the case of the use of a colorscheme, you have to indicate it as soon as possible (in a When-New- Form-Instance trigger) f.degrelle@free.fr - http://fdegrelle.over-blog.com/
  • 5. Jslider - Francois Degrelle -- ColorScheme used ? -- PKG_SLIDER.GC$CurScheme := PKG_SLIDER.GC$Blaf ; In this example, i used the blaf colorscheme The foreground color of the slider Set_Custom_Property( BEAN_NAME, BEAN_NUMBER, 'SETFGCOLOR', 'rgb_color' ) ; e.g. Set_Custom_Property('BLK.ITEM_BEAN', 1, 'SETFGCOLOR', '0,0,0' ) ; The properties of the slider Set_Custom_Property( BEAN_NAME, BEAN_NUMBER, 'SETBOUNDS', PROPERTIES ) ; Where properties are: Orientation : could be H for a horizontal slider or V for a vertical slider Max Value : the maximum value for the slider Min Value : the minimum value for the slider MajorTick : distance betwwen each principal graduations MinorTick : distance betwwen each secondary graduations e.g. Set_Custom_Property('BLK.ITEM_BEAN', 1, 'SETBOUNDS', ' H,0,10,2,1 ' ) ; The current value of the slider Set_Custom_Property( BEAN_NAME, BEAN_NUMBER, 'SETVALUE', 'value' ) ; e.g. Set_Custom_Property('BLK.ITEM_BEAN', 1, 'SETVALUE', '5' ) ; 6. The properties that can be read from the bean The current value of the slider CHAR := Get_Custom_Property( BEAN_NAME, BEAN_NUMBER, 'GETVALUE' ) ; e.g. Value := Get_Custom_Property('BLK.ITEM_BEAN', 1, 'GETVALUE' ) ; f.degrelle@free.fr - http://fdegrelle.over-blog.com/
  • 6. Jslider - Francois Degrelle 7. The sample dialog Download the jslider.zip file Unzip the jslider.zip file Copy the Slider.jar file in your /forms/java/ directory Edit your /forms/server/formsweb.cfg file Open the SLIDER.fmb module (Oracle Forms 10.1.2) Compile all and run the module The settings of the slider properties are grouped in the PKG_SLIDER package PACKAGE PKG_SLIDER IS -- Colorscheme RGB values -- GC$Teal Varchar2(15) := '115,142,140' ; GC$Titanium Varchar2(15) := '99,101,99' ; GC$Red Varchar2(15) := '156,130,123' ; GC$Khaki Varchar2(15) := '140,142,123' ; GC$Blue Varchar2(15) := '90,117,148' ; GC$Olive Varchar2(15) := '107,113,99' ; GC$Purple Varchar2(15) := '123,113,140' ; GC$Blaf Varchar2(15) := '247,247,231' ; -- Current colorscheme -- GC$CurScheme Varchar2(15) := '' ; PROCEDURE Init_Slider ( PC$Name IN VARCHAR2, PN$Num IN PLS_INTEGER, PC$Bounds IN VARCHAR2 ) ; PROCEDURE Set_Value ( PC$Name IN VARCHAR2, PN$Num IN PLS_INTEGER, PN$Value IN NUMBER ) ; END; PACKAGE BODY PKG_SLIDER IS PROCEDURE Init_Slider ( PC$Name IN VARCHAR2, PN$Num IN PLS_INTEGER, PC$Bounds IN VARCHAR2 ) Is LC$CVBColor Varchar2(20) := Get_Canvas_Property( Get_Item_Property( PC$Name, ITEM_CANVAS ), BACKGROUND_COLOR ) ; LC$CVFColor Varchar2(20) := Get_Canvas_Property( Get_Item_Property( PC$Name, ITEM_CANVAS ), FOREGROUND_COLOR ) ; LC$BGColor Varchar2(20) := Get_Item_Property(PC$Name, BACKGROUND_COLOR) ; LC$FGColor Varchar2(20) := Get_Item_Property(PC$Name, FOREGROUND_COLOR) ; LC$Color Varchar2(15) ; Begin -- BackGround color -- If LC$BGColor is not null Then LC$Color := Translate( LC$BGColor, '0123456789gbr','0123456789,,' ) ; f.degrelle@free.fr - http://fdegrelle.over-blog.com/
  • 7. Jslider - Francois Degrelle Set_Custom_Property( PC$Name, PN$Num, 'SETBGCOLOR', LC$Color ) ; Elsif LC$CVBColor is not null Then LC$Color := Translate( LC$CVBColor, '0123456789gbr','0123456789,,' ) ; Set_Custom_Property( PC$Name, PN$Num, 'SETBGCOLOR', LC$Color ) ; Else LC$Color := PKG_SLIDER.GC$CurScheme ; Set_Custom_Property( PC$Name, PN$Num, 'SETBGCOLOR', LC$Color ) ; End if ; -- ForeGround color -- If LC$FGColor is not null Then LC$Color := Translate( LC$FGColor, '0123456789gbr','0123456789,,' ) ; Set_Custom_Property( PC$Name, PN$Num, 'SETFGCOLOR', LC$Color ) ; Elsif LC$CVFColor is not null Then LC$Color := Translate( LC$CVFColor, '0123456789gbr','0123456789,,' ) ; Set_Custom_Property( PC$Name, PN$Num, 'SETBGCOLOR', LC$Color ) ; End if ; -- Bounds -- Set_Custom_Property( PC$Name, PN$Num, 'SETBOUNDS', PC$Bounds ) ; End ; ------------------------------------------- -- Set the current value of the Slider -- ------------------------------------------- PROCEDURE Set_Value ( PC$Name IN VARCHAR2, PN$Num IN PLS_INTEGER, PN$Value IN NUMBER ) IS BEGIN -- Initial value -- Set_Custom_Property( PC$Name, PN$Num, 'SETVALUE', To_Char(PN$Value) ) ; End Set_Value; END; So, in the When-New-Form-Instance trigger, you can set the slider settings: -- ColorScheme used ? -- PKG_SLIDER.GC$CurScheme := PKG_SLIDER.GC$Blaf ; -- Init the slider properties -- PKG_SLIDER.Init_Slider ( 'BL1.BEAN_SLIDER', 1, 'H,0,10,2,1' ) ; -- Set current the value -- PKG_SLIDER.Set_Value ( 'BL1.BEAN_SLIDER', 1, 5 ) ; And get the current value with the When-Custom-Item-Event trigger created on the bean item: -- Get new value -- :BL1.VAL := Get_Custom_Property( 'BL1.BEAN_SLIDER', 1, 'GETVALUE') ; f.degrelle@free.fr - http://fdegrelle.over-blog.com/