Know Java classes and subclasses
I m working with Forms & Report 10 gr 2.I m working with Forms & year Report 1,997. Normally, I flip between different application 8 or 9. My applications now appear a bit old-fashioned. Looking to solve this problem, I found an article by Grant Ronald, I think well know in this forum and it solved me a question that I post here. In this article Grant said:
Extend the user interface forms
So, how can you achieve the balance to give your
Application Forms of the makeover to match the 21
century without having to embark on an extensive program of
refurbishment or recycling of the user?
The answer lies in the architecture of Oracle Forms.
For a form that runs via a browser, application the
the user interface is rendered as a Java applet. This Java applet
includes a number of officials of the Java classes
each of the components of UI forms made. Magic
lies in the fact that, since each component of the interface user is, indeed,
a Java class, it can be subclassed. This means that you can
create your own component that does all the
component base, but with your own code to change
the functionality or appearance.
Really a piece of gold, in this regard, it will give you the key can change the forms look & feel.
But, now, come the questions, how can I do this? How do I know what forms of using classes to display a button for example, what I need to do for subclasses?
is there an example or documentation that can help me? If yes ¿where? One of the gurus can give me some links to explore this?
Thank you & considers everyone.
Look at this.
http://fdtool.free.fr/LAF/doc/Oracle_Forms_Look_and_Feel_project.htm
It is not supported by Oracle, but is widely used. All support for its use will come from its web page.
Tags: Oracle Development
Similar Questions
-
Dear people
I want to import the very simple java class of forms 6i, I went to programs then I choose to import java classes and then it gives me the error THAT BDP-UJ1001 could not create the Java virtual machine.
Please tell me how to solve the problem.
YasserThis option only works for the deployed Web Forms 6i version. Who does not work with C/S mode, because the C/S mode does not use Java at all.
François
-
Java - functions and PL/SQL procedures?
It is my understanding that Java can call stored PL/SQL and PL/SQL procedures and functions can call Java stored procedures and functions.
The reason why I ask this is that my company is considering options on how to migrate our product. Our consultant said that PL/SQL cannot access Java procedures. I think they can. I am not well educated in the present, but I'm trying to learn as much as I can before we committed.
Our graphical interface is written in Java, but they are still debating the back-end (lots of great transaction). Some think that it should be written in Java, some Java State itself would be too slow. I read the mantra of AskTom - SQL, PL/SQL, Java, and C.
So, what's the scoop?
What is the preference, or best practices?>
It's the answer that confused me: PL/SQL cannot access Java procedures in an external JAVA virtual machine, but Oracle has its own JAVA virtual machine integrated in the database (except express edition).
>
Since I wrote it I'll try to explain it.Oracle, with the exception of the express edition, has a functionality integrated into the database (including the JVM) Java. You can import the java classes and jar files in the Oracle database and run Java code using the JAVA virtual machine, which is part of the Oracle.
By "External JVM", I hear one application that is launched from the OS and Java Virtual Machine and it is a stand-alone process; in other words, not a part of the Oracle or Oracle of FMV at all.
Both JVMs running in the 'sandbox' different and do not have access to each other code, classes, or process. Of course, they may be able to communicate using sockets, JNDI, EJBs and other features of wrapper, but they cannot access each other classes, instances of class or methods as they would if only there wasn't one JAVA virtual machine.
So a stand-alone Java application can call stored procedures in Oracle (even those written in Java), Oracle PL/SQL procedures can call Java from Oracle procedures, Oracle Java procedures can call Oracle PL/SQL procedures. But procedures Oracle PL/SQL or Java can't call procedures or access to Classes or class instances that are part of an external JAVA virtual machine.
-
Hi, is it possible that I can send some information from a BPM object to my java class and work with this info on the java class?
Thank youHello
I believe that the error is due to the JAVA virtual machine used by Studio. What you need to do is the following:
1 open the file:/eclipse/eclipse.ini
2. add these two lines at the top of the file:
-vm
\jdk160_05\bin\javaw.exe
This path could change depending on your Version of JDeveloper. I use JDeveloper 11 G
3. change the existing line, referring to the JAVA virtual machine used by BPM Studio. You will find something like:
-Xbootclasspath/a:C:\OraBPMStudioHome\eclipse\jre\lib\ext\tools.jarChange this line:
-Xbootclasspath/a:\JDK\1.6\lib\ext\tools.jar This is how my eclipse.ini is configured:
-vm
D:\Oracle\Middleware\jdk160_05\bin\javaw.exe
-showsplash
Fuego.Eclipse.Studio
-Launcher. XXMaxPermSize
2048 m
-vmargs
-Xms1024m
-Xmx1024m-Dfuego.fstudio = true
-DprodMode = pre-production
-Dbea.home=D:\OraBPMStudioHome\...
-Djava.endorsed.dirs =""
-Dsun.lang.ClassLoader.allowArraySyntax = true
-Dfuego.studio.engine.java.options = - Dsun.lang.ClassLoader.allowArraySyntax = true
-XX: PermSize = 512M
-XX: MaxPermSize = 512M
-Xbootclasspath/a:D:\Oracle\Middleware\jdk160_05\lib\tools.jarIt may be useful
Jackson Meza -
Access the content of BPEL Process Manager to a java class
Hello
Is it possible to access the API of a class of java process manager stand alone... My requirement is as follows. I need to run a script in the Unix environment, which will in turn call a java class and pass some parameters like username, password and Networkid processName. This java class must call the APIs necessary to authenticate the credentials passed, choose current examples of the ProcessName spent and bulk to abandon their...
I tried to create a class of my java class Locator Networkid, password and IP address. But I had a communication Exception like this: 'javax.naming.CommunicationException': cannot find SerialContextProvider. I guess that Im not no definition JNDI properties and other places for FinderBeans in DomainAuth...
Can someone help me on how to go to the definition of the JNDI properties and other locations of resources...
Thank you
CorinneBaudelaire,
See the following forum thread:
Re: Querying Oracle BPEL process Instances using BPEL client api-defaultDiakité
http://SOA-HOWTO.blogspot.com -
How to get the jar file without knowing his name and any class on the inside?
Hello, everyone!
I would like to know if there is a way to get a reference programmatically in the original container without knowing his name and any class it contains. I mean by "initial pot" the pot that was called in the prompt, like this:
or in another way, in a graphics system. To be honest, what I really want is to get a reference to the manifest of the jar, but I know that if I can get a reference to the jar I can get a reference to its manifest file. Or if you know a way to get the manifest directly, it would also be useful. So, is there a way to do this?java -jar jarfile.jar
Thank you.
MarcosAh, so you want to find the calling class and get its source code.
I managed to get the class calling on occasion, but this is probably a somewhat fragile solution. You must extend SecurityManager because getClassContext() is a protected method.
private static class CallerFetch extends SecurityManager { public Class> getCallerClass() { return getClassContext()[3]; } } private static CallerFetch callerFetch = new CallerFetch(); /** * Find the class of the code which called the * method that invokes this method. * @return The class of the caller's caller */ public static Class> getCallerClass() { return callerFetch.getCallerClass(); }
-
Scheme of Oracle10g with java classes invalid--a need to know the reason
Dear experts,
As a newbie, I was presentede with a scheme of database with an invalid object of type CLASS JAVA.
I need to know why they are not valid. Expected to find information in the USER_OBJECTS. But no information at hand.
Is there a way to know, why a CLASS JAVA type object is INVALID?
/ JornHello
Use [change java | http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_1010.htm#SQLRF00807]:
create or replace and compile java source named "brokenJava" as public class brokenJava { public static void test() { Properties p = System.getProperties(); } } 8 / Warning: Java created with compilation errors. SQL> alter java class "brokenJava" compile; Warning: Java altered with compilation errors. SQL> sho err Errors for JAVA CLASS "brokenJava": LINE/COL ERROR -------- ----------------------------------------------------------------- 0/0 ORA-29535: source requires recompilation SQL> alter java source "brokenJava" compile; Warning: Java altered with compilation errors. SQL> sho err Errors for JAVA SOURCE "brokenJava": LINE/COL ERROR -------- ----------------------------------------------------------------- 0/0 brokenJava:3: cannot find symbol 0/0 symbol : class Properties 0/0 1 error 0/0 Properties p = System.getProperties(); 0/0 ^ 0/0 location: class brokenJava
-
Java class to connect to Oracle Database Express Edition11g and URL
Can I use Oracle SQL Developer to do or use it as the value of the URL for the host name?
I'm just starting to learn Java and with it, learn how to use the Oracle Database Express Edition11g and with it the Oracle SQL Developer...
At this point, I have the Express Edition is installed and the SQL Developer installed and were able to establish a connection and to run a query and get a result.
I use Eclipse for JAVA. I have a work of class that performs a query on a database/table in MySQL.
So now I'm eager to make the same use as the database Oracle Database Express Edition11g engine.
And this means that two different versions of JAVA that I need to get the right to be able to do.
The first is the value of the url variable.
I now like
String url = "jdbc:oracle:thin:@localhost";
then
Class.forName ("oracle.jdbc.OracleDriver");
and then
Connection connection = DriverManager.getConnection (url);
The thing I'm puzzled on is in the URL where I 'localhost' was supposed to be the term generic and not so much as the text, you should use.
I see in Web sites like 3 connection to Oracle Database XE
and decrease example 3-2 by specifying the URL of database using the XE Client Setup
There I see
JDBC:driver_type: [username/password] @[//]host_name[: port] [XE]]
And just what is and what is not is explained here. So what I ended up with was
String url = "jdbc:oracle:thin:@localhost";
So if it was just a text to rest for a name I wonder just such a value or name might really where.
I noticed that view that an app called "Oracle JDeveloper" has been used to create the values. I don't have such a thing, or at least I don't think I do.
Do I need?
I have Oracle SQL DEVELOPER, where I used the following to connect to the database of the XE.
My choice for Oracle's SQL Developer Help
Name of connection: Connection1
User name: Rod
Password: myOracle11
Host name: localhost
Port: 1521, which is the default value
SID: xe
Above so I have to host name set to localhost
Can I use Oracle SQL Developer to do or use it as the value of the URL for the host name?
1. I do nothing
2. While wouldn't you say it
3. no results from the earlier assignment.
I asked "'can I use Oracle SQL Developer to do or use it as the value of the URL for the host name?" "
I showed the choice that I used in SQL Developer to connect to the schema. And I was wondering, now that I had done this case those are the values that I could use in the Java class that I wrote. The web site in the first post of this thread showed connection but he was using JDeveloper and SQL Developer.
So I was wondering if the connection that I made using SQL Developer would do the same trick, and if I could use the values I did there.
I'm happy to announce that YES, The values used to connect using SQL Developer work exactly like JDeveloper.
So, given that in SQL Developer for Hostname I chose the value "localhost" "Rod" Username and password "myOracle11".
I did the following JAVA CLASS that worked:
package VC_2_9;
Java for COBOL - copyright 1999 Doke & Hardgrave programmer
import java.sql. *;
public class DataBaseDemoOracle
{
Public Shared Sub main (string args [])
{
String CUST_LAST_NAME;
/ * String url = "jdbc:mysql://localhost/visualcafe"; */
String url = "JDBC: thin: @localhost';"
/ * String sqlQuery = "SELECT Name, SSNo, address, telephone OF THE customer; */
String sqlQuery = "SELECT CUST_LAST_NAME FROM DEMO_CUSTOMERS";
// |||||||||||||||
Try
{
Class.forName ("oracle.jdbc.OracleDriver");
Connection connection = DriverManager.getConnection (url, "Rod","myOracle11" ");
Statement statement = aConnection.createStatement ();
ResultSet rs = aStatement.executeQuery (sqlQuery);
Boolean more = rs.next ();
(more)
{
CUST_LAST_NAME = rs.getString (1);
/* */
System.out.println ("name:" + CUST_LAST_NAME);
more = rs.next ();
}
RS. Close();
aStatement.close ();
aConnection.close ();
}
catch (ClassNotFoundException e)
{System.out.println ("Exception caught" + e) ;}}
catch (SQLException e)
{If (e! = null)}
{System.out.println ("SQLException taking" + e);}
e = e.getNextException ();
} / / end of while loop
} / / end of capture
} / / main end
} / / end DataBaseDemoOracle.java
-
When the external program C and Java Class loaded in a schema
Hi all
I understand that both an external C program and a Java class are loaded after two of them are called in the PL/SQL environment, once they are published and loaded into shared libraries. Is this correct?
Best regards
ValAn external procedure is never loaded into a schema. Oracle calls the external program.
A Java class that is part of a Java stored procedure, however, is charged as a PL/SQL procedure is created - at compile time.
Justin
-
Difference in WHERE clause VO and java class!
Hello!
I have VO:
When I put the value of VO in java classSELECT ADokumenti.A_DOKUMENTI_PK, ADokumenti.APRAKSTS, ADokumenti.DOKUMENTA_TIPS, ADokumenti.DOKUMENTS, ADokumenti.FAILA_VARDS, ADokumenti.PASES_DATI_ID, ADokumenti.PIEVIENOSANAS_DATUMS FROM A_DOKUMENTI ADokumenti WHERE ADokumenti.DOKUMENTA_TIPS = 'image/jpeg' or ADokumenti.DOKUMENTA_TIPS = 'image/gif' or ADokumenti.DOKUMENTA_TIPS = 'image/png'
WHAT result would be? Only java put where clause, or both?vo.setWhereClause("A_DOKUMENTI_PK="+imageId);
If one clause of java, and then how to add this: «A_DOKUMENTI_PK = "+ imageId vo?»
Best regards, Debuger!Debuger,
That's why I suggested that you create a view named criteria (with a variable binding) at design time. At runtime, you set the value of the variable binding and apply the criteria to view. The first link in the documentation I gave explains you quite well.
You must use bind variables for five reasons:
(1) performance
(2) performance
(3) performance
(4) performance
and
(5) performance.Oh and
(6) avoid errors of insufficient memory in the shared the database pool.
John
-
Overlap two images, ordinary java works, and not in BlackBerry JDE 5
I have an application for swing of simple java that takes two images and overlaps the other. While trying to this port in JDE5, I got out there is no class BufferedImage in the api of BB, but a similar class of the Bitmap. It's brought to BB mixing function is unable to produce an image that overlap. It shows a blank white screen.
Here's the plain java function
public BufferedImage blend( BufferedImage bi1, BufferedImage bi2, double weight ) { if (bi1 == null) throw new NullPointerException("bi1 is null"); if (bi2 == null) throw new NullPointerException("bi2 is null"); int width = bi1.getWidth(); if (width != bi2.getWidth()) throw new IllegalArgumentException("widths not equal"); int height = bi1.getHeight(); if (height != bi2.getHeight()) throw new IllegalArgumentException("heights not equal"); BufferedImage bi3 = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); int[] rgbim1 = new int[width]; int[] rgbim2 = new int[width]; int[] rgbim3 = new int[width]; for (int row = 0; row < height; row++) { bi1.getRGB(0, row, width, 1, rgbim1, 0, width); bi2.getRGB(0, row, width, 1, rgbim2, 0, width); for (int col = 0; col < width; col++) { int rgb1 = rgbim1[col]; int r1 = (rgb1 >> 16) & 255; int g1 = (rgb1 >> 8) & 255; int b1 = rgb1 & 255; int rgb2 = rgbim2[col]; int r2 = (rgb2 >> 16) & 255; int g2 = (rgb2 >> 8) & 255; int b2 = rgb2 & 255; int r3 = (int) (r1 * weight + r2 * (1.0 - weight)); int g3 = (int) (g1 * weight + g2 * (1.0 - weight)); int b3 = (int) (b1 * weight + b2 * (1.0 - weight)); rgbim3[col] = (r3 << 16) | (g3 << 8) | b3; } bi3.setRGB(0, row, width, 1, rgbim3, 0, width); } return bi3; }
Here's the java function of BB
public Bitmap blend( Bitmap bi1, Bitmap bi2, double weight ) { if (bi1 == null) throw new NullPointerException("bi1 is null"); if (bi2 == null) throw new NullPointerException("bi2 is null"); int width = bi1.getWidth(); if (width != bi2.getWidth()) throw new IllegalArgumentException("widths not equal"); int height = bi1.getHeight(); if (height != bi2.getHeight()) throw new IllegalArgumentException("heights not equal"); Bitmap bi3 = new Bitmap(width, height); int[] rgbim1 = new int[width]; int[] rgbim2 = new int[width]; int[] rgbim3 = new int[width]; for (int row = 0; row < height; row++) { bi1.getARGB(rgbim1,0,width,0,row, width,1); bi2.getARGB(rgbim2,0,width,0,row, width,1); for (int col = 0; col < width; col++) { int rgb1 = rgbim1[col]; int r1 = (rgb1 >> 16) & 255; int g1 = (rgb1 >> 8) & 255; int b1 = rgb1 & 255; int rgb2 = rgbim2[col]; int r2 = (rgb2 >> 16) & 255; int g2 = (rgb2 >> 8) & 255; int b2 = rgb2 & 255; int r3 = (int) (r1 * weight + r2 * (1.0 - weight)); int g3 = (int) (g1 * weight + g2 * (1.0 - weight)); int b3 = (int) (b1 * weight + b2 * (1.0 - weight)); rgbim3[col] = (r3 << 16) | (g3 << 8) | b3; } bi3.setARGB(rgbim3, 0, width, 0, row,width, 1); } return bi3; }
The weight of the arg is a value from 1 to 100.
For reference, the full plain java source
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package imagetest; /** * * @author COMPUTER */// Blender1.java import java.awt.*;import java.awt.image.*; import javax.swing.*;import javax.swing.event.*; /** * This class describes and contains the entry point to an application that * demonstrates the blending transition. */ public class Blender1 extends JFrame{ /** * */ private static final long serialVersionUID = 1L; /** * Construct Blender1 GUI. */ public Blender1() { super("Blender #1"); setDefaultCloseOperation(EXIT_ON_CLOSE); // Load first image from JAR file and draw image into a buffered image. ImageIcon ii1 = new ImageIcon(getClass().getResource("x.png")); final BufferedImage bi1; bi1 = new BufferedImage(ii1.getIconWidth(), ii1.getIconHeight(), BufferedImage.TYPE_INT_RGB); Graphics2D g2d = bi1.createGraphics(); int h = ii1.getImage().getHeight(null); System.out.println("Blender1.Blender1()--------> height :" + h); g2d.drawImage(ii1.getImage(), 0, 0, null); g2d.dispose(); // Load second image from JAR file and draw image into a buffered image. ImageIcon ii2 = new ImageIcon(getClass().getResource("y.png")); final BufferedImage bi2; bi2 = new BufferedImage(ii2.getIconWidth(), ii2.getIconHeight(), BufferedImage.TYPE_INT_RGB); g2d = bi2.createGraphics(); int h2 = ii2.getImage().getHeight(null); System.out.println("Blender1.Blender1()--------> height :" + h2); g2d.drawImage(ii2.getImage(), 0, 0, null); g2d.dispose(); // Create an image panel capable of displaying entire image. The widths // of both images and the heights of both images must be identical. final ImagePanel ip = new ImagePanel(); ip.setPreferredSize(new Dimension(ii1.getIconWidth(), ii1 .getIconHeight())); getContentPane().add(ip, BorderLayout.NORTH); // Create a slider for selecting the blending percentage: 100% means // show all of first image; 0% means show all of second image. final JSlider slider = new JSlider(JSlider.HORIZONTAL, 0, 100, 100); slider.setMinorTickSpacing(5); slider.setMajorTickSpacing(10); slider.setPaintTicks(true); slider.setPaintLabels(true); slider.setLabelTable(slider.createStandardLabels(10)); slider.setInverted(true); ChangeListener cl; cl = new ChangeListener() { public void stateChanged( ChangeEvent e ) { // Each time the user adjusts the slider, obtain the new // blend percentage value and use it to blend the images. int value = slider.getValue(); ip.setImage(blend(bi1, bi2, value / 100.0)); } }; slider.addChangeListener(cl); getContentPane().add(slider, BorderLayout.SOUTH); // Display the first image, which corresponds to a 100% blend // percentage. ip.setImage(bi1); pack(); setVisible(true); } /** * Blend the contents of two BufferedImages according to a specified weight. * * @param bi1 * first BufferedImage * @param bi2 * second BufferedImage * @param weight * the fractional percentage of the first image to keep * * @return new BufferedImage containing blended contents of BufferedImage * arguments */ public BufferedImage blend( BufferedImage bi1, BufferedImage bi2, double weight ) { if (bi1 == null) throw new NullPointerException("bi1 is null"); if (bi2 == null) throw new NullPointerException("bi2 is null"); int width = bi1.getWidth(); if (width != bi2.getWidth()) throw new IllegalArgumentException("widths not equal"); int height = bi1.getHeight(); if (height != bi2.getHeight()) throw new IllegalArgumentException("heights not equal"); BufferedImage bi3 = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); int[] rgbim1 = new int[width]; int[] rgbim2 = new int[width]; int[] rgbim3 = new int[width]; for (int row = 0; row < height; row++) { bi1.getRGB(0, row, width, 1, rgbim1, 0, width); bi2.getRGB(0, row, width, 1, rgbim2, 0, width); for (int col = 0; col < width; col++) { int rgb1 = rgbim1[col]; int r1 = (rgb1 >> 16) & 255; int g1 = (rgb1 >> 8) & 255; int b1 = rgb1 & 255; int rgb2 = rgbim2[col]; int r2 = (rgb2 >> 16) & 255; int g2 = (rgb2 >> 8) & 255; int b2 = rgb2 & 255; int r3 = (int) (r1 * weight + r2 * (1.0 - weight)); int g3 = (int) (g1 * weight + g2 * (1.0 - weight)); int b3 = (int) (b1 * weight + b2 * (1.0 - weight)); rgbim3[col] = (r3 << 16) | (g3 << 8) | b3; } bi3.setRGB(0, row, width, 1, rgbim3, 0, width); } return bi3; } /** * Application entry point. * * @param args * array of command-line arguments */ public static void main( String[] args ) { Runnable r = new Runnable() { public void run() { // Create Blender1's GUI on the event-dispatching // thread. new Blender1(); } }; EventQueue.invokeLater(r); }} /** * This class describes a panel that displays a BufferedImage's contents. */ class ImagePanel extends JPanel{ /** * */ private static final long serialVersionUID = 4977990666209629996L; private BufferedImage bi; /** * Specify and paint a new BufferedImage. * * @param bi * BufferedImage whose contents are to be painted */ void setImage( BufferedImage bi ) { this.bi = bi; repaint(); } /** * Paint the image panel. * * @param g * graphics context used to paint the contents of the current * BufferedImage */ public void paintComponent( Graphics g ) { if (bi != null) { Graphics2D g2d = (Graphics2D) g; g2d.drawImage(bi, null, 0, 0); } }}
Full java BB source
/* * ImageScreen.java * * © , * Confidential and proprietary. */ package src; /** * */ import java.io.OutputStream;import javax.microedition.io.Connector;import javax.microedition.io.file.FileConnection;import net.rim.device.api.system.Bitmap;import net.rim.device.api.ui.Field;import net.rim.device.api.ui.FieldChangeListener;import net.rim.device.api.ui.UiApplication;import net.rim.device.api.ui.component.BitmapField;import net.rim.device.api.ui.component.ButtonField;import net.rim.device.api.ui.component.Dialog;import net.rim.device.api.ui.component.LabelField;import net.rim.device.api.ui.container.HorizontalFieldManager;import net.rim.device.api.ui.container.MainScreen;import net.rim.device.api.ui.component.GaugeField;/** * The main screen to display an image taken from the camera demo. */public final class ImageScreen extends MainScreen{ /** The down-scaling ratio applied to the snapshot Bitmap */ private static final int IMAGE_SCALING = 7; /** The base file name used to store pictures */ private static final String FILE_NAME = System.getProperty("fileconn.dir.photos") + "IMAGE"; /** The extension of the pictures to be saved */ private static final String EXTENSION = ".bmp"; /** A counter for the number of snapshots taken */ private static int _counter; Bitmap image1,image2; BitmapField imageField; /** A reference to the current screen for listeners */ private ImageScreen _imageScreen; /** * Constructor * @param raw A byte array representing an image */ public ImageScreen( final byte[] raw1,final byte[] raw2 ) { // A reference to this object, to be used in listeners _imageScreen = this; setTitle("Blend and Save"); // Convert the byte array to a Bitmap image image1 = Bitmap.createBitmapFromBytes( raw1, 0, -1, 1 ); image2 = Bitmap.createBitmapFromBytes( raw2, 0, -1, 1 ); // Create two field managers to center the screen's contents HorizontalFieldManager hfm1 = new HorizontalFieldManager( Field.FIELD_HCENTER ); HorizontalFieldManager hfm2 = new HorizontalFieldManager( Field.FIELD_HCENTER ); HorizontalFieldManager hfm3 = new HorizontalFieldManager( Field.FIELD_HCENTER ); // Create the field that contains the image//blend(image1, image2, 50/ 100.0) imageField = new BitmapField(blend(image1, image2, 50/ 100.0) ){ public int getPreferredWidth(){ return 250;} public int getPreferredHeight(){ return 150;} }; hfm1.add( imageField ); GaugeField scroller = new GaugeField("Adjust (alt + < >)",0,100,50,Field.EDITABLE | Field.FOCUSABLE); //scroller.setBackground( net.rim.device.api.ui.decor.BackgroundFactory.createSolidBackground(0x00000000)); scroller.setChangeListener( new GaugeFieldListener() ); hfm2.add(scroller); // Create the SAVE button which returns the user to the main camera // screen and saves the picture as a file. ButtonField photoButton = new ButtonField( "Save" ); photoButton.setChangeListener( new SaveListener(raw1,raw2) ); hfm3.add(photoButton); // Create the CANCEL button which returns the user to the main camera // screen without saving the picture. ButtonField cancelButton = new ButtonField( "Cancel" ); cancelButton.setChangeListener( new CancelListener() ); hfm3.add(cancelButton); // Add the field managers to the screen add( hfm1 ); add( hfm2 ); add( hfm3 );scroller.setFocus();//scroller.setValue(50); } public Bitmap blend( Bitmap bi1, Bitmap bi2, double weight ) { if (bi1 == null) throw new NullPointerException("bi1 is null"); if (bi2 == null) throw new NullPointerException("bi2 is null"); int width = bi1.getWidth(); if (width != bi2.getWidth()) throw new IllegalArgumentException("widths not equal"); int height = bi1.getHeight(); if (height != bi2.getHeight()) throw new IllegalArgumentException("heights not equal"); Bitmap bi3 = new Bitmap(width, height); int[] rgbim1 = new int[width]; int[] rgbim2 = new int[width]; int[] rgbim3 = new int[width]; for (int row = 0; row < height; row++) { // bi -> int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize) // bit - > int[] argbData, int offset, int scanLength, int x, int y, int width, int height) bi1.getARGB(rgbim1,0,width,0,row, width,1);// row, width, 1, , 0, width); bi2.getARGB(rgbim2,0,width,0,row, width,1); //bi1.getRGB(0, row, width, 1, rgbim1, 0, width); //bi2.getRGB(0, row, width, 1, rgbim2, 0, width); for (int col = 0; col < width; col++) { int rgb1 = rgbim1[col]; int r1 = (rgb1 >> 16) & 255; int g1 = (rgb1 >> 8) & 255; int b1 = rgb1 & 255; int rgb2 = rgbim2[col]; int r2 = (rgb2 >> 16) & 255; int g2 = (rgb2 >> 8) & 255; int b2 = rgb2 & 255; int r3 = (int) (r1 * weight + r2 * (1.0 - weight)); int g3 = (int) (g1 * weight + g2 * (1.0 - weight)); int b3 = (int) (b1 * weight + b2 * (1.0 - weight)); rgbim3[col] = (r3 << 16) | (g3 << 8) | b3; } //bi -> int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize) //bit -> (int[] data, int offset, int scanLength, int left, int top, int width, int height) bi3.setARGB(rgbim3, 0, width, 0, row,width, 1); // bi3.setRGB(0, row, width, 1, rgbim3, 0, width); } return bi3; } /** * Handles trackball click events * @see net.rim.device.api.ui.Screen#invokeAction(int) */ protected boolean invokeAction(int action) { boolean handled = super.invokeAction(action); if(!handled) { switch(action) { case ACTION_INVOKE: // Trackball click. { return true; } } } return handled; } /** * A listener used for the "Save" button */ private class GaugeFieldListener implements FieldChangeListener { public void fieldChanged(Field field, int context) { int value = ((GaugeField)field).getValue(); if (value==0){return;} imageField.setBitmap( blend(image1, image2, value/ 100.0) ); ((GaugeField)field).setLabel("Adjust (alt + < >)"+value); } } /** * A listener used for the "Save" button */ private class SaveListener implements FieldChangeListener { /** A byte array representing an image */ private byte[] _raw1,_raw2; /** * Constructor. * @param raw A byte array representing an image */ SaveListener(byte[] raw1,byte[] raw2) { _raw1 = raw1; _raw2 = raw2; } /** * Saves the image as a file in the BlackBerry filesystem */ public void fieldChanged(Field field, int context) { try { // Create the connection to a file that may or // may not exist. FileConnection file = (FileConnection)Connector.open( FILE_NAME + _counter + EXTENSION ); // If the file exists, increment the counter until we find // one that hasn't been created yet. while( file.exists() ) { file.close(); ++_counter; file = (FileConnection)Connector.open( FILE_NAME + _counter + EXTENSION ); } // We know the file doesn't exist yet, so create it file.create(); // Write the image to the file OutputStream out = file.openOutputStream(); out.write(_raw1); // Close the connections out.close(); file.close(); } catch(Exception e) { Dialog.alert( "ERROR " + e.getClass() + ": " + e.getMessage() ); } // Inform the user where the file has been saved Dialog.inform( "Saved to " + FILE_NAME + _counter + EXTENSION ); // Increment the image counter ++_counter; // Return to the main camera screen UiApplication.getUiApplication().popScreen( _imageScreen ); } } /** * A listener used for the "Cancel" button */ private class CancelListener implements FieldChangeListener { /** * Return to the main camera screen */ public void fieldChanged(Field field, int context) { UiApplication.getUiApplication().popScreen( _imageScreen ); } }}
Yes, your original code:
for (int col = 0; col < width; col++){int rgb1 = rgbim1[col];int r1 = (rgb1 >> 16) & 255;int g1 = (rgb1 >> 8) & 255;int b1 = rgb1 & 255; int rgb2 = rgbim2[col];int r2 = (rgb2 >> 16) & 255;int g2 = (rgb2 >> 8) & 255;int b2 = rgb2 & 255; int r3 = (int) (r1 * weight + r2 * (1.0 - weight));int g3 = (int) (g1 * weight + g2 * (1.0 - weight));int b3 = (int) (b1 * weight + b2 * (1.0 - weight));rgbim3[col] = (r3 << 16) | (g3 << 8) | b3;}
Labour Code:
for (int col = 0; col < width; col++) { int rgb1 = rgbim1[col]; int a1 = (rgb1 >> 24) & 255; int r1 = (rgb1 >> 16) & 255; int g1 = (rgb1 >> 8) & 255; int b1 = rgb1 & 255; int rgb2 = rgbim2[col]; int a2 = (rgb2 >> 24) & 255; int r2 = (rgb2 >> 16) & 255; int g2 = (rgb2 >> 8) & 255; int b2 = rgb2 & 255; int a3 = (int) (a1 * weight + a2 * (1.0 - weight)); int r3 = (int) (r1 * weight + r2 * (1.0 - weight)); int g3 = (int) (g1 * weight + g2 * (1.0 - weight)); int b3 = (int) (b1 * weight + b2 * (1.0 - weight)); rgbim3[col] = (a3 << 24) | (r3 << 16) | (g3 << 8) | b3; }
-
Error on Java class calling in the Oracle database
I have a java class indicated below:
/*
* To change this license header, choose license headers in the project properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package oracletree1;
import java.sql.Connection;
to import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
/**
*
* @author oracle
*/
public class TREEUPDATER {}
int levels;
int NodeId;
int ParentId;
String FatherID;
int ChildBed_new;
int ChildBes_new;
int ChildMande_new;
int ChildBed_old;
int ChildBes_old;
int ChildMande_old;
int ParentBed;
int ParentBes;
int ParentMande;
Script string;
String ValueState;
String TreeState;
Public TREEUPDATER() throws SQLException {}
}
public void update (levels int, int NodeIds, int childBed_old, int childBes_old, int childMande_old) throws SQLException {}
This. ChildBed_old = childBed_old;
This. ChildBes_old = childBes_old;
This. ChildMande_old = childMande_old;
This. Levels = levels;
This. NodeId = NodeIds;
String [] array;
try {}
Class.forName ("oracle.jdbc.driver.OracleDriver");
} catch (ClassNotFoundException e) {}
System.out.println ("where is your Oracle JDBC Driver?');
return;
}
System.out.println ("Oracle JDBC Driver registered!");
Fitting out = null;
try {}
connection = DriverManager.getConnection)
"jdbc:oracle:thin:@192.168.1.12:1521:orcl", "tree1"
'oracle');
} catch (SQLException e) {}
System.out.println ("connection failed! Check the console output");
return;
}
If (connection! = null) {}
Statement stmt = connection.createStatement ();
Instruction stmt2 = connection.createStatement ();
stmt.executeUpdate ("insert into test.java_test (id) values (21)" ");
ResultSet rs = stmt.executeQuery ("SELECT * from value" + "where nodeid =" + NodeId);
ResultSet rs2 = stmt.executeQuery ("select * from tree where id =" + NodeId);
While (RS. Next {}
This. FatherID = rs2.getNString("FatherID");
This. ChildBed_new = rs2.getInt ("bed");
This. ChildBes_new = rs2.getInt ("bes");
This. ChildMande_new = rs2.getInt ("control");
table = new String [100000];
Table = FatherID.split ("_");
for (int i = 0; i < array.length; i ++) {}
ResultSet rs3 = stmt2.executeQuery ("SELECT * from tree" + "where id =" + array [i]);
This. ParentId = rs3.getInt ("id");
This. ParentBed = rs3.getInt ("bed");
This. ParentBes = rs3.getInt ("bes");
This. ParentMande = rs3.getInt ("control");
connection.setAutoCommit (false);
ParentBed = ChildBed_new - ChildBed_old;
ParentBes = ChildBes_new - ChildBes_old;
This. TreeState = rs2.getNString ("state");
If (TreeState.equalsIgnoreCase ("BED")) {}
This. ParentMande = ParentBed - ParentBes;
} else {}
This. ParentMande = ParentBes - ParentBed;
}
This. Script = ("update the bed = bed set value +" + ParentBed + "and bes = bes +" + ParentBes + "and control = control +"+ ParentMande ")
+ ' where id = "+ ParentId);»
stmt2. ExecuteUpdate ("" + Script);
}
}
}
}
}
I have a main class, which show below:
/*
* To change this license header, choose license headers in the project properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package oracletree1;
import java.sql.SQLException;
/**
*
* @author oracle
*/
public class OracleTree1 {}
/**
@param args command-line arguments
*/
Public Shared Sub main (String [] args) throws SQLException {}
TODO logical application of the code here
TREEUPDATER t = new TREEUPDATER();
}
}
I was responsible for these classes in oracle database 11 g 2 and I want to use a trigger to execute the updating() method. If I created a procedure like this:
CREATE OR REPLACE PROCEDURE REPORT4
(
LEVELS IN NUMBERS
NODEID NUMBER
CHILDBED_OLD NUMBER
CHILDBES_OLD NUMBER
CHILDMANDE_OLD NUMBER
) AS
Name of the java LANGUAGE "TREEUPDATER.updating (1,2,3,4,5);
But when I want to compile and run this procedure, I get this error:
Error: PL/SQL: analysis of completed Compilation unit
Error (9,16): PLS-00311: the declaration of 'TREEUPDATER.updating' (1,2,3,4,5) is incomplete or incorrect
Can any one solve this?
Thank you
The correct syntax for PORCEDURE4 is:
No it's not. I already gave the correct syntax, which apparently ignored you.
I don't know how can pass these parameters to this method.
My question is clear?
It is clear that you are interested in reading the documentation. All the answers are there.
You're mixing two things:
(1) creating the procedure (once), and I already told you how to do it
(2) the procedure call
For 1)-do you only once :
CREATE OR REPLACE PROCEDURE REPORT4)
LEVELS IN NUMBERS
NODEID NUMBER
CHILDBED_OLD NUMBER
CHILDBES_OLD NUMBER
CHILDMANDE_OLD NUMBER
)
AS
JAVA LANGUAGE
NAME of ' oracletree1. TREEUPDATER.updating (int, int, int, int, int)';
For 2)-procedure call:
...
BEGIN
... of the code
-you call proc with your real settings:
procedure4 (v_levels, v_nodeid, v_childbed_old, v_childbes_old, v_childmande_old);
... rest of your code
END;
Pay attention to remarks from other institutions.
-
java.lang.NoClassDefFoundError when calling a java class of BPEL
Hello
I'm calling a java class to convert JSON to XML using BPEL. I imported all the necessary jar files in the project and compile successfully done.
But while running, I get the java.lang.NoClassDefFoundError: net/sf/json/JSON error.
For this, I placed all the necessary pots under the path FUSION_HOME/Oracle_SOA1/soa/modules/oracle.soa.ext_11.1.1/ and restarted the server.
But still, I get the same error when running.
A I missed a step? Let me know the procedure to solve this problem.
I have to run ant or change the file manifests after placing the pot?
in a site I find that we must place the pots under < DOMAIN HOME > directory / lib. Is this correct?
We use SOA suite 11.1.1.6.
Thank you
Terry
Hello Terry,
I'm not quite sure of what exactly would be the problem. Please go through this link and see if it helps: integrating Java and Java EE Code in a BPEL process
Kind regards
Karan
-
Access the current instance of request module in a java class in the model
Hi all
I'm trying to implement the custom story types in our application, (ModifiedById), I can read the user name of the security context, but not the username.
I have a view object, say UserInfoVO which contains the logged in users info.
I know, I can create a new instance of the application at the bean module and using security context information, I can go get the user ID.
I'm trying to access the current instance of the Application module in my java class customized, that is used to return the attribute history ModifiedById.ApplicationModule am = Configuration.createRootApplicationModule(amDef, config); ViewObject vo = am.findViewObject("UserInfoVO1"); // view criteria applied by default vo.setNamedWhereClauseParam("bUserName", user); // user from security context vo.executeQuery();
It is, how do I access the current instance of ApplicationModule in a class as * "HistoryAwareEntityImpl" * located in project template. ?//referring the blog http://jobinesh.blogspot.in/2011/02/creating-custom-history-types.html
any help will be appreciated.
Kind regards
RognardOK, in this case, you get the transaction of db of the base class object and this object allows you to search the module of the application
public final DBTransaction getDBTransaction(); ... DBTransaction: public ApplicationModule findApplicationModule(java.lang.String amName)
or if you get the application root module
public ApplicationModule getRootApplicationModule()
Timo
-
How to generate Java classes during the generation of the WebService Datacontrols?
Hello
I use data controls generated by the web service in my application, but I am stuck at a point where I got a requirement to create a Java bean for the complex type. There's no java class created when we create data controls using the web service.
I need to grasp the object of return type of a method of data control (example: I need to capture the Department object that is returned by the getDetartment method) to validate the data.
The XML files are created in the template while creating web service data controls. How to generate java classes out of it?
Please can someone help out of this?
I hope you understand my question.
Please let me know if you want more details about me.
Thanks and greetings
ThoomHello
If this is your condition using a WS client proxy class and create a POJO to data control (right click). The WS data control generates classes and uses instead of XML schema definitions
See example at http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html 073
Frank
Maybe you are looking for
-
How can I fix slow loading emails and very slow delete email on my macbook pro 2009?
the emails are long to load on my macbook pro 2009 and when I click on delete it takes about 10 to 15 seconds for it to delete. no problem on my imac occurs. both machines run the mavericks. What is the reference for this?
-
I bought a scale in an Apple Store and I can't connect with my Airport Express.I submit my problem to the Withings and they gave me 4 reasons: or attempt to connect to a network of 5 GHz instead of a 2.4 GHz network. The scale is able to connect to n
-
my trash moved to drive d. When I try to empty the trash, it is said the trash in the d drive is corrupt you want to clean up. We have 3 computers in the House, they are all the same and all have the same message. Computers are PC HP Pavilion Medi
-
Forum of the need to help with Win 7/PowerShell
Hi all. I saw entrust the task of trying to build a box of Windows 7 almost 'scratch' (what we call a picture of layer 3) using PowerShell to do everything with a single script, including change of name of the PC, adding accounts, turning on the ser
-
XP Solitaire on windows 8 in mode full screen
Original title: xp' lonely t on windows 8 After having successfully installed the solitaire, hearts, freecell from xp to W8 I can't expand the game/s to show full screen, how advice pls