PJC button rollOver with square shape

Hello
1. I use forms10g
2. I use PJC RollOver button in order to have the new feature - "button acts like a reversal of web style that can contain two images, an image that is displayed when the button is in normal state and a second image that appears when the mouse is over the button (or roll top)."
3. it forces the button to round.
4. How can I change button PJC rolling so that I'll get a square button or get the button without bevel?
Thank you

Here is the new code you can call form forms with the following for a non-borde button:

Set_Custom_Property('BL.PB', 1, 'SET_RIGHT_MOST', 'false');
Set_Custom_Property('BL.PB', 1, 'SET_LEFT_MOST', 'false');
Set_Custom_Property('BL.PB', 1, 'SET_BORDER', 'false');
Set_Custom_Property('BL.PB', 1, 'SET_BACKGROUND', 'false');
package oracle.forms.demos;

import java.awt.*;
import java.awt.event.*;
import java.net.URL;

import oracle.forms.ui.VButton;
import oracle.ewt.button.PushButton;
import oracle.forms.handler.IHandler;
import oracle.forms.properties.ID;
import oracle.forms.properties.Property;

/**
 * 

Oracle Forms Server PJC Example

* * This is a PJC that implements a web style Rollover image button * where the image changes when the user moves the mouse over the component. The standard Forms * oracle.forms.ui.VButton is subclassed so only the additional functionality is required * to be added. * * We register two new forms properties, IMAGE_NAME_ON and IMAGE_NAME_OFF. These properties form the * the URL of the image files that the button will display. These properties will be set by PL/SQL * trigger code or can be set by defining the LABEL of the button with the prefix [ROLLOVER] followed by * the ON inage and OFF image names separated by a comma * * @version 1.0 09/13/1999 created
* @version 1.1 12/09/1999 modified to support 6i features to allow dynamic custom property manipulation * @version 1.2 02/20/2000 removed 6.0 stuff and renamed package to oracle.forms.demos for distribution * @version 2.0 09/24/2001 amemded for Forms 9i. Moved to the oracle.forms.demos.enhancedItems package. Made the setting of the on/off images declaritive, using the Label Property. Allowed loading from a JAR file as well as codebase. * @author Steve Button, Duncan Mills * @version 3.0 05/05/2010 add some method to paint the button without border (F. Degrelle) */ public class RolloverButton extends VButton { /** * the property registered to specify the on image to be used */ public final static ID IMAGE_NAME_ON = ID.registerProperty("IMAGE_NAME_ON"); /** * the property registered to specify the off image to be used */ public final static ID IMAGE_NAME_OFF = ID.registerProperty("IMAGE_NAME_OFF"); /** * Forms property used to indicate that we want the utility to switch * Messaging on to the Java Console so we can see what is going on */ private static final ID DEBUGMESSAGES = ID.registerProperty("DEBUGMESSAGES"); /** * Forms property used to indicate that we want the utility to switch * Messaging on to the Java Console for ALL INSTANCES of this PJC * so we can see what is going on * This will generate a LOT of messages */ private static final ID DEBUGMESSAGES_ALL = ID.registerProperty("DEBUGMESSAGES_ALL"); /** * methods added by F.D. */ private static final ID RIGHTMOST = ID.registerProperty("SET_RIGHT_MOST"); private static final ID LEFTMOST = ID.registerProperty("SET_LEFT_MOST"); private static final ID DRAWBORDER = ID.registerProperty("SET_BORDER"); private static final ID DRAWBACKGROUND = ID.registerProperty("SET_BACKGROUND"); /** * define ON */ private final int ON = 1; /** * define OFF */ private final int OFF = 0; /** * the classname used for debugging purposes * use getClass().getName(); if you want the * full package name */ private final String CLASSNAME = this.getDefaultName(); /** * the hardcoded root directory for buttons in the JAR */ private final String JARBUTTONSDIR = "/oracle/forms/demos/images/"; /** * the hardcoded button icon type in the JAR */ private final String JARBUTTONSEXT = ".gif"; /** * the name of the on image */ private String m_imageNameOn; /** * the name of the off image */ private String m_imageNameOff; /** * storage for the handler for this class */ private IHandler m_handler; /** * The codebase from which the JAR was loaded - used to locate images */ private URL m_codeBase; /** * the current state ON | OFF */ private int m_state = OFF; /** * array to hold the images used to represent the state of the button */ private Image[] m_images = { null, null }; /** * Boolean value which describes if the button is currently a rollover or * if it is a general rounded button. */ private boolean m_isRollover = false; /** * do we want to debug for this class? Set this to true to see debug messages. */ private boolean m_debug = false; /** * do we want to debug for all instances of this class? */ private static boolean m_debugAll = false; private boolean m_border = true ; private boolean m_background = true ; public RolloverButton() { super(); log("Debugging on: Creating Button Instance"); setLeftmost(true); setRightmost(false); } /** * Implementation of IView interface which provides an initialization opportunity for the component * * @param handler - message handler associated with this view. * @see oracle.forms.ui.IView */ public void init(IHandler handler) { m_handler = handler; m_codeBase = handler.getCodeBase(); super.init(handler); } /** * Implementation of IView interface which sets a requested property to a given value * If the property being set is LABEL then special processing is undertaken. * If the Label is Prefixed with the string [ROLLOVER] then the rest of the label is assumed * to be a comma separated list of the ON and OFF icon names * If the String after the rollover tag does not contain a pair e.g. no comma * then we assume that it's one of the Icons in the JAR which will be called * xxx_on and xxx_off where xxx is the supplied string. We then set up the pair for * you e.g. a label of [ROLLOVER]firstrec will cause the icons * /oracle/forms/demos/images/firstrec_on.gif and * /oracle/forms/demos/images/firstrec_off.gif to be loaded * If the label does not begin with [ROLLOVER] then we treat it a a normal text label * except that leading or trailing round brackets can be used to indicate if * that edge of the button is rounded in Oracle look and feel * * @param property property to be set. * @param value value of the property id. * @return true if the property could be set, false otherwise. * @see oracle.forms.ui.IView */ public boolean setProperty(ID property, Object value) { if (property == ID.LABEL) { log("Setting Label to " + value.toString()); String label = value.toString().trim(); if (label.equals("")) { enableRollover(); return true; } if (label.startsWith("[ROLLOVER]")) { enableRollover(); label = label.substring(10); int i = label.indexOf(","); if (i > 0) { m_imageNameOn = label.substring(0,i); m_imageNameOff = label.substring(i+1); } else { m_imageNameOn = JARBUTTONSDIR + label + "_on" + JARBUTTONSEXT; m_imageNameOff = JARBUTTONSDIR + label + "_off" + JARBUTTONSEXT; } log("Detected Image Names + ON='" + m_imageNameOn + "', OFF= '" + m_imageNameOff + "'"); loadImage(ON,m_imageNameOn); loadImage(OFF,m_imageNameOff); setImage(OFF); return true; } else { /** * If the button label does not start with the [ROLLOVER] prefix * then we regard it as a normal button except that the programmer * can control the Rounded button look in Oracle Look and Feel by * placing a round bracket at the start or the end (or both) of the * label */ if (label.startsWith("(")) { log("Rounding left edge of " + label); setLeftmost(true); label = label.substring(1); } if (label.endsWith(")")) { log("Rounding right edge of " + label); setRightmost(true); label = label.substring(0,label.length()-1); } return super.setProperty(property, label); } } else if (property == RIGHTMOST) { String s = value.toString(); if(s.equalsIgnoreCase("true")) setRightmost(true); else setRightmost(false); return true ; } else if (property == LEFTMOST) { String s = value.toString(); if(s.equalsIgnoreCase("true")) setLeftmost(true); else setLeftmost(false); return true ; } else if (property == DRAWBORDER) { String s = value.toString(); if(s.equalsIgnoreCase("true")) m_border = true; else m_border = false ; return true ; } else if (property == DRAWBACKGROUND) { String s = value.toString(); if(s.equalsIgnoreCase("true")) m_background = true; else m_background = false ; return true ; } else if (property == IMAGE_NAME_ON) { // make sure we are in rollover mode enableRollover(); log("setProperty - IMAGE_NAME_ON value=" + value.toString()); // load the requested image m_imageNameOn = (String) value; loadImage(ON,m_imageNameOn); // reset the currrently drawn image if needed setImage(ON,m_state); return true; } else if (property == IMAGE_NAME_OFF) { // make sure we are in rollover mode enableRollover(); log("setProperty - IMAGE_NAME_OFF value=" + value.toString()); // load the requested image m_imageNameOff = (String) value; loadImage(OFF,m_imageNameOff); // reset the currrently drawn image if needed setImage(OFF,m_state); return true; } else if (property == DEBUGMESSAGES) { if (value.toString().equalsIgnoreCase("true")) m_debug = true; else m_debug = false; log("Debugging " + m_debug); return true; } else if (property == DEBUGMESSAGES_ALL) { if (value.toString().equalsIgnoreCase("true")) m_debugAll = true; else m_debugAll = false; log("Debugging " + m_debugAll); return true; } else { return super.setProperty(property, value); } } /** * Implementation of IView interface which returns the value of a requested property * * @param pid the property id that represents the property to be set * @return the value of the property id * @see oracle.forms.ui.IView */ public Object getProperty(ID pid) { if ( pid == IMAGE_NAME_OFF ) { return m_imageNameOff; } else if ( pid == IMAGE_NAME_ON ) { return m_imageNameOn; } else { return super.getProperty(pid); } } /** * Loads the requested image from the Document base, loaded JAR files, * or from the Codebase * Here is a breakdown of the logic: *
    *
  1. First we check the the loaded JAR files for the images
  2. *
  3. If it's not an inbuilt image, the code then checks the * image name supplied for http or https, if that is present * then it assumes the name is a full URL and loads the image from there.
  4. *
  5. If there is no Protocol in the image name then we assume it is a * relative URL to the docbase of the machine that Forms is running on. * We also pick up the protocol, and port and re-use those
  6. *
  7. If that fails to find the image, then we search relative to the * codebase e.g. forms/java
* * @param which the image state to set, value values ON | OFF * @param imageName the name of the image to load, including extension */ private void loadImage(int which, String imageName) { URL imageURL = null; boolean loadSuccess = false; //JAR log("Searching JAR for " + imageName); imageURL = getClass().getResource(imageName); if (imageURL != null) { log("URL: " + imageURL.toString()); try { m_images[which] = Toolkit.getDefaultToolkit().getImage(imageURL); loadSuccess = true; log("Image found: " + imageURL.toString()); } catch (Exception ilex) { log("Error loading image from JAR: " + ilex.toString()); } } else { log("Unable to find " + imageName + " in JAR"); } //DOCBASE if (loadSuccess == false) { log("Searching docbase for " + imageName); try { if (imageName.toLowerCase().startsWith("http://")||imageName.toLowerCase().startsWith("https://")) { imageURL = new URL(imageName); } else { imageURL = new URL(m_codeBase.getProtocol() + "://" + m_codeBase.getHost() + ":" + m_codeBase.getPort() + imageName); } log("Constructed URL: " + imageURL.toString()); try { m_images[which] = createImage((java.awt.image.ImageProducer) imageURL.getContent()); loadSuccess = true; log("Image found: " + imageURL.toString()); } catch (Exception ilex) { log("Error reading image - " + ilex.toString()); } } catch (java.net.MalformedURLException urlex) { log("Error creating URL - " + urlex.toString()); } } //CODEBASE if (loadSuccess == false) { log("Searching codebase for " + imageName); try { imageURL = new URL(m_codeBase, imageName); log("Constructed URL: " + imageURL.toString()); try { m_images[which] = createImage((java.awt.image.ImageProducer) imageURL.getContent()); loadSuccess = true; log("Image found: " + imageURL.toString()); } catch (Exception ilex) { log("Error reading image - " + ilex.toString()); } } catch (java.net.MalformedURLException urlex) { log("Error creating URL - " + urlex.toString()); } } if (loadSuccess == false) log("Error image " + imageName + " could not be located"); } /** * Set the image displayed to the requested image if the requested image is the current image. * Effectively does a redraw of the currently displayed image if the image is changed by the user. * @param which the image state to draw, value values ON | OFF * @param current the current state being represented by the image */ private void setImage(int which, int current) { if(which==current) setImage(which); } /** * Set the image displayed to the appropriate image depending on the user action. * * @param which the image to display, valid values ON and OFF */ private void setImage(int which) { m_state=which; if(which==ON) log("setImage ON"); else log("setImage OFF"); this.setImage(m_images[which]); this.invalidate(); } /** * Creates the mouse listener for rollover mode * Also sets the button to fully rounded */ private void enableRollover() { if (!m_isRollover) { log("Enabling Rollover"); addMouseListener(new RolloverButtonMouseAdapter()); setLeftmost(true); setRightmost(true); m_isRollover = true; } } /** * draw the button */ public void paint (Graphics g) { if(m_border) { super.paint(g) ; } else { int iW = 0, iH = 0 ; int iX = 0, iY = 0 ; if(m_images[m_state] != null) { iW = m_images[m_state].getWidth(this); iH = m_images[m_state].getHeight(this); iX = (int)((this.getBounds().width / 2) - (iW / 2)) ; iY = (int)((this.getBounds().height / 2) - (iH / 2)) ; if(m_background) { g.setColor(this.getBackground()); g.fillRect(0,0,this.getBounds().width,this.getBounds().height); } g.drawImage(m_images[m_state],iX,iY,null); } } } public void update(Graphics g) { paint(g); } /** * Utility function to print out a debug message to the Java Console * @param msg string to display, this will be prefixed with the classname of the PJC */ public void log(String msg) { if(m_debug||m_debugAll) System.out.println(CLASSNAME + ": " + msg); } /** * Private class to handle user mouse actions and to switch images when the * user moves the mouse into and out of the button object. */ class RolloverButtonMouseAdapter extends MouseAdapter { /** * User moved the mouse over the button, swap to the on image. */ public void mouseEntered(MouseEvent me) { setImage(ON); } /** * User moved the mouse out of the button, swap to the off image. */ public void mouseExited(MouseEvent me) { setImage(OFF); } } }

François

Tags: Oracle Development

Similar Questions

  • Click on turn off sound not working not not the button Rollover in Captivate 9

    I use the Mac of Captivate 9 version. I created a button rollover with two States - Normal and Rollover (I used a smart form for the button and selected use as a button). I selected the check box turn off sound click in the Actions Panel. However, when I publish and click on the button, I can still hear the clicking noise.

    To troubleshoot, I created a button of shape smart with only a State (without roll), tested, and I heard a clicking noise. So, the issue seems related to the rollover State.

    I've searched the forums and couldn't find an answer to my question.

    Any suggestions to correct?

    Thank you.

    A button of form in Captivate 9 has always built of three States: Normal, rollover and down.  Did you remove two States in view of the State?

    Have you installed the hotfix: https://helpx.adobe.com/captivate/kb/hot-fix-captivate-9.html

  • Creating a menu with button rollover images

    Hello

    I am building a menu with buttons rollover images. It is the 5 buttons, one under the other.

    I built a class with a background image that changes between the development and the status of non-focus, to make the transfer. To enable the active state, I simply added a transparent gif (width setSpace to cover the entire background).

    The unfocus/update works fine, but when I reached the button up or down, the transparent gif and its area becomes white...

    We can see the background on the right side of the white square...

    Here's the class of the button:

    OK I solved this problem with the help of this thread:

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&thread.ID=39506

    Thank you

  • Button Rollover image

    I would like to change the color of the text in the button image (overview). Can anyone suggest me how to do this?

    You must edit the rollover image. This is one of the many reasons why I never use image buttons (old) more because the form buttons appeared with CP6.

    You can use any image as the fill for a shape button, you can add different same text for each State and give a different style to each State. In Captivate, while for the Image buttons, you must use a graphics application (such as Photoshop) to edit the images that are used for the States.

    Turn an Image into a button - Captivate blog

  • Firefox crashes in typing or by clicking check box or the radio button, even with all the plugins / extensions removed. Check with many types of malware scanners.

    Firefox crashes in typing or by clicking check box or the radio button, even with all the plugins / extensions disabled, then deleted. Sometimes it hangs for five minutes. I checked the PC with several types of scanners of evil-ware, but none to be found. All hidden and deleted cookies, all DELETED & extension plugins. Remove all instances of Firefox PC and registry, then restored to bookmarks. The only thing that I did not is to remove and reinstall not my favorites.
    Windows Vista (yes I know) and FF 13.0.1

    Try disabling hardware acceleration in Firefox.

  • Why is my imac printing docs pdf with squares instead of text

    I use OS X 10.9.5. When I want to print a pdf document was sent to me from an external source (for example, my electricity bill) the document is printed with squares where the text should be.

    Sometimes if I get an overview of printing, it will look OK but always printed with squares/no text, and sometimes it shows squares in the preview. I was not able to determine a trend.

    I tried to print the docs to two printers (HL 2140 Brother and Epson WF3620) with the same result. I can't find that someone has posted the same problem in any forum...

    If there are small places where individual letters should be, it's a problem of compatibility of fonts.

    If you print from Acrobat, you can work around this by using the option 'Print as image' under 'Advanced Print Setup:

    https://helpx.Adobe.com/Acrobat/KB/quick-fix-print-PDF-image/_jcr_content/main-p ars/img_0.img.png/Print-as-image-screens...

  • Masking an image with a shape from Keynote for the iPad?

    I am actually writing an article in support for a Web site and it does not seem you can mask an image with a shape from Keynote for iPad - something that is incredibly easy to do in the version of OS X. Clues on how to achieve this in the iOS version of Keynote?

    Thank you.

    Nevermind, I found the answer - all we need to do is add the image AND form of the slide, then select both at the same time. One of the choices that is displayed in the context menu is "mask with shape.

  • How to fill one shape with another shape, but not of models

    Hello

    How to fill one shape with another shape, but not of models. Example of this poster

    Screen Shot 2015-05-18 at 13.41.33.png

    put in a shape of the tree so that it looks like this:

    Heavy_type_tree.jpg

    Select your type with a vector path, which is the subject

    Object > envelope distort > make with top object.

  • Problem with the shape tween

    Good day everyone, I have some problems with the shape tween and I need your help and your explanations. The links below: first link is an example of how this drawing must be animated, and the second is my attempt failed. So, why these traits change their shape this way, not as in the first link? Is there a possible way to fix it? I tried to add a few shapehints, but flash has not understood what I wanted to do, boards are simply were red.

    https://www.dropbox.com/s/zf1tk8xi2mp6e31/tradigital_2.fla

    https://www.dropbox.com/s/09fsoq30xjz4vvq/tradigital_fail.fla

    separate your designs so that they are forms.

  • Strengthen a button/hyperlink with alternative text

    Hello

    I would like to improve a hyperlink with a text substitution in a different screen area, the alternative text should describe, where the hyperlink leads to.

    I tried to use a legend of reversal. But when I do the hyperlink and the rollover area overlap, I can't click on the hyperlink.

    Is it impossible to solve this problem with a hyperlink, then I'd appreciate also all solutions using a button.

    In this case, I highly recommend to have a look at the new widget CpExtra (HTML only) by InfoSemantics. You can download a trial version to check it out:

    Introduction to CpExtra | Infosemantics Pty Ltd

    One of its many features is that you can use a rollover over any object event. Maybe that's the answer. Of course the bearings are not supported in projects of a reactive nature.

    Output HTML is even more sensitive to having two interactive objects in one place.

  • Rounded square shape

    I wonder if someone would be able to help me create this type of shape in illustrator. I'm actually wanting to start with a square, to rotate 45 degrees and add curved both its corners and sides dishes until you get the desired shape?

    Help with this for a newcomer in illustrator would be much appreciated.

    Kind regards

    Joe

    Rounded diamond.jpg

    Draw a polygon 8-corner

    1. Select all the other corners
    2. Drag the corner indicateor circle or double-click to make the small corners
    3. Do the same with the remaining corners

    I did a similar mission there in this video:

  • Button rollover problem

    Hello-

    I created a button to turnover in the Muse. I call on a rectangle, then assigned different colors to each rollover State. I then placed a text box with the text overall (but still inside) the button. This text box is about 50% of the height of the button and centered vertically above the button. Now in preview mode, when I check the functionality of the button, the button changes color when twitch, as he should. But when I move the cursor to the area in the button where the text box (indicated in red below), the button roll "off" to return to its normal state. Of course I don't want to do. On the contrary, I want the button to stay "active".

    contactbutton.jpg

    How to make the text in the button play by the rules, I put in place for the reversal button indicates?

    Thank you-

    You can achieve this by using a status button is located in the library of Widgets Panel under the buttons. The States of the button and the text of the link will work the same way, regardless of the position of the mouse.

    David

    Creative muse

  • square shape layer

    CS6 AE 11.0.3.6 / Mac OS X 10.9.3 / I want to create a symmetrical shape layer (square). Now shift and dragging give me a rectangle. How can I fix it?  Reset my settings?

    I don't know if it's my settings. Other forums I have visited, have seen the same problem. After giving up, I discovered that A.E. CC doesn't have this kind of problem. Allows to adjust manually (in properties) does not work after turning 90 degrees of form. It always winds up looking like a rectangle. The same can be said about the shape of the ellipse. Hold SHIFT after that drag my composition leaves me with an oval not a symmetrical circle. It's the anchor? Help!Screen Shot 2015-05-21 at 9.40.18 PM.png

    There is nothing wrong. your model has a 1.5 pixel aspect ratio, not square. You must fix the parameters of the model.

    Mylenium

  • I want to use a custom button photoshop with my composition and have the substitution effect

    I'm trying to put a button in photoshop in a blank publication widget trigger. When I cut an paste the image into the trigger, he loses his robot and switches are no longer the colors during the reversal. It works very well in the composition of the lightbox, but the problem with lightbox composition, is there no working capital options to display click only target. How to work around this problem. I want to have my own custom button with the effect of composition within the cc muse.

    You should check the design layout and defined States for relaxation, if the State is set correctly then it should show the rollover State, but the container target corresponding to the relaxation is on the page, then it could show you the active State not the rollover State.

    Thank you

    Sanjit

  • Buttons on nav smart shape broke in the project of upgrading from 6 to 7

    Captivate version: 7.0.1.237 Windows 7

    I have a project with a navigation that worked correctly in v6, but now the smart navigation buttons form are broken. I tried to rebind the existing smart forms to another slide and create new smart forms to post a link. The forms can be changed visually when you click (normal change), but the project is not going to any other slide.

    Does anyone have suggestions for what else to try? I have a workaround in my back pocket (transparent button on the smart form), but I prefer to do this correctly.

    Thanks in advance!

    Hello

    If the Smart form does not work, I would be a transparent button (don't know why everyone's going for those, but I digress) would fail too.

    I would say check your quiz settings. Chances are that you have an object that can sititng on a blade between where is your smart shape and where you try to bind, if your Quiz settings say that each question should be answered, links will fail.

    See you soon... Rick

Maybe you are looking for