Dirty paint

Hello everybody.
I've coded a little programm which displays some figure when I click on a button. But I have a little problem with the "dirty painting".
here 's my code :
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;
import java.util.*;
import java.io.*;
public class Frame1 extends Frame implements ActionListener, WindowListener, AdjustmentListener {
     Canvas canvas1 = new java.awt.Canvas();
     JButton JButton1 = new JButton();
     JButton JButton2 = new JButton();
     JButton JButton3 = new JButton();
JButton JButton4 = new JButton();
JButton JButton5 = new JButton();
ScrollPane spane = new ScrollPane();
int dimXcanvas = 1000;
int dimYcanvas = 1000;
     int dimXSPane = 500;
     int dimYSPane = 280;
     public Frame1( String s){
     super(s);
          setLayout(null);
          spane.setBounds(50,50, dimXSPane, dimYSPane);
          canvas1.setBounds(0,0,dimXcanvas,dimYcanvas);
          spane.add(canvas1);
          add(spane);
          JButton1.setText("Carr�");
          add(JButton1);
          JButton1.setBounds(12,350,108,24);
          JButton2.setText("Cercle");
          add(JButton2);
          JButton2.setBounds(120,350,120,24);
          JButton3.setText("RecTextFleche");
          add(JButton3);
          JButton3.setBounds(240,350,108,24);
          JButton4.setText("Effacer");
          add(JButton4);
          JButton4.setBounds(360,350,108,24);
          JButton5.setBounds(480,350,108,24);
          JButton5.setText("Tout");
          add(JButton5);
          setTitle("A Simple Frame");
          JButton1.addActionListener(this);
          JButton2.addActionListener(this);
          JButton3.addActionListener(this);
          JButton4.addActionListener(this);
          JButton5.addActionListener(this);
          spane.getVAdjustable().addAdjustmentListener(this);
          spane.getHAdjustable().addAdjustmentListener(this);
     this.addWindowListener(this);
public void dessineCarre(int x, int y, int l, int h){
Graphics g = canvas1.getGraphics();
g.setColor(java.awt.Color.blue);
g.drawRect(x, y, l, h);
public void dessineCercle(int x, int y, int r1, int r2){
Graphics g = canvas1.getGraphics();
g.setColor(java.awt.Color.red);
g.drawOval(x, y, r1, r2);
public void dessineRect_Texte(int x, int y, int l, int h, String texte){
Graphics g = canvas1.getGraphics();
g.setColor(java.awt.Color.black);
g.drawRect(x, y, l, h);
g.drawString(texte, x+(l/4), (y+(h/2)));
g.dispose();
public void dessinefleche(int x, int y, int l){
Graphics g = canvas1.getGraphics();
g.setColor(java.awt.Color.black);
int[] XArray = {x-5, x, x+5, x, x};
int[] YArray = {y+10, y, y+10, y, y+l};
g.drawPolyline (XArray, YArray, 5);
public void dessineTout(){
Graphics g = canvas1.getGraphics();
//Cercle
g.setColor(java.awt.Color.red);
g.drawOval(180,500,100,100);
//Fl�che
g.setColor(java.awt.Color.black);
int[] XArray = {330-5, 330, 330+5, 330, 330};
int[] YArray = {20+10, 20, 20+10, 20, 120};
g.drawPolyline (XArray, YArray, 5);
//Carr�
g.setColor(java.awt.Color.blue);
g.drawRect(20,20,100,100);
//Rectangle Text
g.setColor(java.awt.Color.black);
g.drawRect(350,20,100,100);
g.drawString("coucou", 350+(100/4), (20+(100/2)));
public void efface(){
canvas1.repaint();
public void paint(Graphics g){}
     public void actionPerformed(ActionEvent e){
     if(e.getSource() == JButton1)
dessineCarre(20,20,100,100);
     else if(e.getSource()==JButton2)
     dessineCercle(180,20,100,100);
     else if(e.getSource()==JButton3)
     dessineRect_Texte(350,20,100,100,"Coucou");
     dessinefleche(330,20,100);
     else if(e.getSource()==JButton4)
     efface();
     else if(e.getSource()==JButton5)
     dessineTout();
     public void adjustmentValueChanged(AdjustmentEvent evt){
     dessineTout();
public void windowClosing(WindowEvent e){System.exit(0);}
public void windowActivated(WindowEvent e){}
public void windowDeactivated(WindowEvent e){}
public void windowIconified(WindowEvent e){}
public void windowClosed(WindowEvent e){}
public void windowDeiconified(WindowEvent e){}
public void windowOpened(WindowEvent e){}
What's wrong with this ?

My code :
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;
import java.util.*;
import java.io.*;
public class Frame1 extends Frame implements ActionListener, WindowListener, AdjustmentListener {
     Canvas canvas1 = new java.awt.Canvas();
     JButton JButton1 = new JButton();
     JButton JButton2 = new JButton();
     JButton JButton3 = new JButton();
    JButton JButton4 = new JButton();
    JButton JButton5 = new JButton();
    ScrollPane spane = new ScrollPane();
    int dimXcanvas = 1000;
    int dimYcanvas = 1000;
     int dimXSPane = 500;
     int dimYSPane = 280;
     public Frame1( String s){
         super(s);
          setLayout(null);
          spane.setBounds(50,50, dimXSPane, dimYSPane);
          canvas1.setBounds(0,0,dimXcanvas,dimYcanvas);
          spane.add(canvas1);
          add(spane);
          JButton1.setText("Carr�");
          add(JButton1);
          JButton1.setBounds(12,350,108,24);
          JButton2.setText("Cercle");
          add(JButton2);
          JButton2.setBounds(120,350,120,24);
          JButton3.setText("RecTextFleche");
          add(JButton3);
          JButton3.setBounds(240,350,108,24);
          JButton4.setText("Effacer");
          add(JButton4);
          JButton4.setBounds(360,350,108,24);
          JButton5.setBounds(480,350,108,24);
          JButton5.setText("Tout");
          add(JButton5);
          setTitle("A Simple Frame");
          JButton1.addActionListener(this);
          JButton2.addActionListener(this);
          JButton3.addActionListener(this);
          JButton4.addActionListener(this);
          JButton5.addActionListener(this);
          spane.getVAdjustable().addAdjustmentListener(this);
          spane.getHAdjustable().addAdjustmentListener(this);
         this.addWindowListener(this);
    public void dessineCarre(int x, int y, int l, int h){
        Graphics g = canvas1.getGraphics();        
        g.setColor(java.awt.Color.blue);       
        g.drawRect(x, y, l, h);          
    public void dessineCercle(int x, int y, int r1, int r2){
        Graphics g = canvas1.getGraphics();
        g.setColor(java.awt.Color.red);
        g.drawOval(x, y, r1, r2);
    public void dessineRect_Texte(int x, int y, int l, int h, String texte){
        Graphics g = canvas1.getGraphics();
        g.setColor(java.awt.Color.black);       
        g.drawRect(x, y, l, h);
        g.drawString(texte, x+(l/4), (y+(h/2)));
        g.dispose();
    public void dessinefleche(int x, int y, int l){
        Graphics g = canvas1.getGraphics();
        g.setColor(java.awt.Color.black);               
        int[] XArray = {x-5, x, x+5, x, x};
        int[] YArray = {y+10, y, y+10, y, y+l};
        g.drawPolyline (XArray, YArray, 5);
    public void dessineTout(){
        Graphics g = canvas1.getGraphics();
        //Cercle
        g.setColor(java.awt.Color.red);
        g.drawOval(180,500,100,100);
        //Fl�che 
        g.setColor(java.awt.Color.black);            
        int[] XArray = {330-5, 330, 330+5, 330, 330};
        int[] YArray = {20+10, 20, 20+10, 20, 120};
        g.drawPolyline (XArray, YArray, 5);
        //Carr�
        g.setColor(java.awt.Color.blue);       
        g.drawRect(20,20,100,100);
        //Rectangle Text
        g.setColor(java.awt.Color.black);       
        g.drawRect(350,20,100,100);
        g.drawString("coucou", 350+(100/4), (20+(100/2)));
    public void efface(){
        canvas1.repaint();
    public void paint(Graphics g){}
     public void actionPerformed(ActionEvent e){
         if(e.getSource() == JButton1)
            dessineCarre(20,20,100,100);
         else if(e.getSource()==JButton2)
            dessineCercle(180,20,100,100);
         else if(e.getSource()==JButton3)
             dessineRect_Texte(350,20,100,100,"Coucou");
             dessinefleche(330,20,100);
         else if(e.getSource()==JButton4)
             efface();
         else if(e.getSource()==JButton5)
             dessineTout();
      public void adjustmentValueChanged(AdjustmentEvent evt){
             dessineTout();
    public void windowClosing(WindowEvent e){System.exit(0);}
    public void windowActivated(WindowEvent e){}
    public void windowDeactivated(WindowEvent e){}
    public void windowIconified(WindowEvent e){}
    public void windowClosed(WindowEvent e){}
    public void windowDeiconified(WindowEvent e){}
    public void windowOpened(WindowEvent e){}
import java.io.*;
import java.util.*;
public class Lancement{
  public static void main(String targ[] ) throws IOException{
    Frame1 F = new Frame1("Dessins");
    F.setSize(600,400);
    F.pack();
    F.show();
}My problem : I lose the painting when I disable the window :(
How can I keep the painting in the canvas ?
Thank you for any help.

Similar Messages

  • Return Mail--Invalid TAO ID(s)

    The TAO Internet E-mail Gateway could NOT deliver your message
    to the following invalid @mayspeh.com TAO mail ID's
    (all other @mayspeh.com TAO recipients addressed received
    your message):
    [email protected]
    ----------------------> Document Follows <---------------------
    Received: (from smap@localhost)
    by mail.mayspeh.com (8.9.1a/8.9.1) id RAA15293;
    Thu, 3 Sep 1998 17:23:26 -0500 (CDT)
    Received: from pebble.sageit.com(206.169.110.3) by hermod.mayspeh.com via smap (V2.1)
    id xma015274; Thu, 3 Sep 98 17:22:32 -0500
    Received: (from sync@localhost) by pebble.SageIT.com (8.6.10/8.6.9) id OAA01188 for forte-users-outgoing; Thu, 3 Sep 1998 14:09:37 -0700
    Received: (from uucp@localhost) by pebble.SageIT.com (8.6.10/8.6.9) id OAA01182 for <[email protected]>; Thu, 3 Sep 1998 14:09:34 -0700
    Received: from unknown(205.138.216.6) by pebble.sagesoln.com via smap (V2.0)
    id xma001180; Thu, 3 Sep 98 14:09:12 -0700
    Received: from Lotus Notes (PU Serial #1787)
    by smtp3.per-se.com (PostalUnion/SMTP(tm) v2.2 (Build 22005) for Windows NT(tm))
    id AA-1998Sep03.135823.1787.2005624; Thu, 03 Sep 1998 16:10:48 -0500
    From: [email protected]
    To: [email protected]
    Message-ID: <[email protected]>
    X-Conversion-ID: <PU-NOTES.2212.904849103.323>
    X-Mailer: Lotus Notes via PostalUnion/SMTP (v2.2 Build 22005)
    Mime-Version: 1.0
    Content-Type: text/plain; charset="US-ASCII"
    Date: Thu, 03 Sep 1998 16:10:48 -0500
    Subject: Non-Delivery of:forte-users-digest V1 #1041
    Sender: [email protected]
    Precedence: bulk
    Reply-To: [email protected]
    forte-users-digest Wednesday, 2 September 1998 Volume 01 : Number 1041
    In this issue:
    ArrayField and state of child
    Widget States
    From: Luca Gioppo <[email protected]>
    Date: Wed, 02 Sep 1998 15:00:23 +0200
    Subject: ArrayField and state of child
    I got this problem:
    I want the array fieild to show the elementa of some columns depending on a
    boolean attribute of the mapped class:
    if true col 6 and 7 (datafield) will be invisible an col 5 visible and vice
    versa.
    Col 5 is a scrolllist so I need to populate each time the widget with
    different data.
    Everything functions well (htanks to the help found on the list) but I see
    a strange quirk:
    When I set to true two consecutive rows and then I scroll the arrayfield
    the widget of col 6 and 7 that were invisible
    pop up (only on one of the row), they are just a dirty paint as they cannot
    be selected (but show the hidden data)
    Any suggestion on this.
    I use R3.f
    Here is a code fragment of the method
    The array field has 5 rows
    Method popProv just populate the scrolllist with the array of listelement
    passed as parameter.
    mw1 : fieldWidget;
    mw2 : fieldWidget;
    mw3 : fieldWidget;
    myRow : integer = 1;
    for i in <arfProc>.TopRow to <arfProc>.TopRow + 4 do
    mw1 = <arfProc>.BodyGrid.GetChildInCell(myRow ,5);
    mw2 = <arfProc>.BodyGrid.GetChildInCell(myRow ,6);
    mw3 = <arfProc>.BodyGrid.GetChildInCell(myRow ,7);
    if arfProc.codFilter then
    mw1.State = FS_UPDATE;
    popProv(PI_sclProv = ScrollList(mw1),
    PI_arrPr = arfProc[i].arrProv);
    mw2.State = FS_INVISIBLE;
    mw3.State = FS_INVISIBLE;
    else
    mw1.State = FS_INVISIBLE;
    mw2.State = FS_UPDATE;
    mw3.State = FS_UPDATE;
    end if;
    myRow = myRow + 1;
    end for;
    Thanks
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    From: Geoff Puterbaugh <[email protected]>
    Date: Wed, 02 Sep 1998 07:41:21 -0700
    Subject: Widget States
    Dave,
    FS_VIEW etc. aren't text values, they're integer constants which
    you can check out in DisplayProject. The one you want looks to
    be FS_VIEWONLY, which is equal to 2.
    All my best,
    Geoff
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    End of forte-users-digest V1 #1041
    ------ Message Header Follows ------
    Received: from pebble.SageIT.com by smtp3.per-se.com
    (PostalUnion/SMTP(tm) v2.2 (Build 22005) for Windows NT(tm))
    id AA-1998Sep02.105013.1787.119170; Wed, 02 Sep 1998 10:50:14 -0500
    Received: (from sync@localhost) by pebble.SageIT.com (8.6.10/8.6.9) id IAA16372
    for forte-users-digest-outgoing; Wed, 2 Sep 1998 08:00:11 -0700
    Date: Wed, 2 Sep 1998 08:00:11 -0700
    Message-Id: <[email protected]>
    From: [email protected]
    To: [email protected]
    Subject: forte-users-digest V1 #1041
    Reply-To: [email protected]
    Errors-To: [email protected]
    Precedence: bulk
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hello
    I'm a newbie labwindows,
     so i'm having the same error i have two pannel when i press paue still the same erro here is a preview of the code and a pic of the panel
    int CVICALLBACK PauseCB (int panel, int control, int event,
                             void *callbackData, int eventData1, int eventData2)
        switch (event)
            case EVENT_COMMIT:
             PauseFlag = TRUE;
             /*Timer Disabled When User Pauses*/
              SetCtrlAttribute (panelHandle,TABPANEL_TIMER,ATTR_ENABLED,0);
             SetPanelAttribute(TABPANEL_TIMER, ATTR_ENABLED,0);   
             TimerEnabled = FALSE;
             /*Timer Disabled When User Pauses*/
             /*Disable Use of Read/Write when timer is "paused"*/
             SetCtrlAttribute (panelHandle, TABPANEL_gpibwrt, ATTR_DIMMED,1);
             SetCtrlAttribute (panelHandle, TABPANEL_gpibwrt, ATTR_DIMMED,1);
             /*Disable Use of Read/Write when timer is "paused"*/
             SetCtrlAttribute (panelHandle, TABPANEL_CONTINUE, ATTR_DIMMED, 0);
             SetCtrlAttribute (panelHandle, TABPANEL_PAUSE, ATTR_DIMMED, 1);
                break;
            case EVENT_RIGHT_CLICK:
                break;
        return 0;
    Attachments:
    uir gpib .jpg ‏62 KB

  • ArrayField and state of child

    I got this problem:
    I want the array fieild to show the elementa of some columns depending on a
    boolean attribute of the mapped class:
    if true col 6 and 7 (datafield) will be invisible an col 5 visible and vice
    versa.
    Col 5 is a scrolllist so I need to populate each time the widget with
    different data.
    Everything functions well (htanks to the help found on the list) but I see
    a strange quirk:
    When I set to true two consecutive rows and then I scroll the arrayfield
    the widget of col 6 and 7 that were invisible
    pop up (only on one of the row), they are just a dirty paint as they cannot
    be selected (but show the hidden data)
    Any suggestion on this.
    I use R3.f
    Here is a code fragment of the method
    The array field has 5 rows
    Method popProv just populate the scrolllist with the array of listelement
    passed as parameter.
    mw1 : fieldWidget;
    mw2 : fieldWidget;
    mw3 : fieldWidget;
    myRow : integer = 1;
    for i in <arfProc>.TopRow to <arfProc>.TopRow + 4 do
    mw1 = <arfProc>.BodyGrid.GetChildInCell(myRow ,5);
    mw2 = <arfProc>.BodyGrid.GetChildInCell(myRow ,6);
    mw3 = <arfProc>.BodyGrid.GetChildInCell(myRow ,7);
    if arfProc.codFilter then
    mw1.State = FS_UPDATE;
    popProv(PI_sclProv = ScrollList(mw1),
    PI_arrPr = arfProc[i].arrProv);
    mw2.State = FS_INVISIBLE;
    mw3.State = FS_INVISIBLE;
    else
    mw1.State = FS_INVISIBLE;
    mw2.State = FS_UPDATE;
    mw3.State = FS_UPDATE;
    end if;
    myRow = myRow + 1;
    end for;
    Thanks
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Apple does not sell Macs for any other purpose than for their own software, especially Mac OS X. It is not available without Leopard, soon to be Snow Leopard.
    Nothing has changed regarding installing or hosting other OSs.
    Apple posts no information for expanding the RAM capacity. You would need to check with the Hackintosh community for that information.
    Dah•veed
    Why do you reward points? 
The reward system helps to increase community participation. When a community member gives a reward to another member for providing helpful advice or a solution to his or her question, the recipient's points will help increase his or her status level within the community.

  • Keys getting dirty look--paint wearing off!  What does Apple do for this?

    This is dismaying. I received a brand new MacBook Pro (early 2008 model) from Apple only a few months ago and the silver paint on several keys is already wearing off! They're getting that dirty look. See http://forums.macrumors.com/showthread.php?t=451259
    I went through something similar with an old iBook G4... On those, the keys' lettering wore off. Apple service was responsive for sure, although it was pretty silly that they kept sending me replacement keyboards Instead of individual keys or decals. After pushing by me, they even sprung for one of those iSkin plasticky keyboard covers (which turned out it interferes with typing and some say can cause a heat problem). Eventually, they sent me a 4th keyboard that didn't wear out at all. So, it seems that they fixed that issue.
    Has Apple solved this paint wearing problem for the MBP's? Do I just go the Apple Care route--again-- and do they send out an entire keyboard? What have other people experience and done?
    In this case, obviously, they can't send decals as this keyboard is the backlit (underlit) kind!

    This is a known issue with the Early 2008 MBP (as well as earlier models). It has nothing to do with dirty hands, or lotions or hands or anything else. Just from plain old use, it wears down the paint on the keys.
    The MBP keyboard keys are no longer removable one by one on that model and onward -- you have to bring your MBP into an Apple Store (or call Apple Care) - they will take it in, change it out for a new keyboard (its under warranty for one year, and if you have Apple Care for two additional years). If you are beyond the one year warranty and did not purchase Apple Care, then you will have to pay to have it replaced (probably a couple hundred dollars plus shipping).
    The turnaround for something like that is usually about a week if you have to send it in, and a day if you go to the Apple Store. The Apple Store, after deeming it a repair issue, will order the keyboard. Then they will call you to bring in your MBP and leave it for the time it is required for them to fix it -- usually an afternoon, or overnight.
    But this is a well-documented and much discussed issue over the years -- it occured to my old MBP as well. Luckily, I have three apple stores all within a half hour drive of me, so I don't worry about those sorts of things. But it's annoying if you have to send it it.

  • Problem in Painting in JDesktopPane

    Hi
    Here is the code for my class:
    public class DiagramPane extends JDesktopPane{
    public DiagramPane() {
    setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
    public void paint(Graphics g){
    super.paint(g);
    int cmpCount=getComponentCount();
    if(cmpCount>1){
    for(int i=0;i<cmpCount-1;i++){
    Component cmp1=getComponent(i);
    Component cmp2=getComponent(i+1);
    g.drawLine(cmp1.getX(),cmp1.getY(),cmp2.getX(),cmp2.getY());
    public static void main(String[] s){
    JFrame f=new JFrame();
    DiagramPane dgrPane= new DiagramPane();
    JScrollPane scr=new JScrollPane(dgrPane);
    JInternalFrame lst1=new JInternalFrame("Frame1");
    JInternalFrame lst2=new JInternalFrame("Frame2");
    lst1.setBounds(150,150,100,100);
    lst2.setBounds(300,300,100,100);
    lst1.show();
    lst2.show();
    f.getContentPane().add(scr);
    dgrPane.add(lst1);
    dgrPane.add(lst2);
    f.setSize(400,400);
    f.show();
    Run this code and try to move any of the two InternalFrames. The lines need to be repainted accurately but this doesn't happen. This happens due to background filling of dirty region in JLayeredPane paint method. Can anyone tell me, what I should do so as to make these lines repaint properly. Lines are not in dirty region.
    Thanks in advance.
    Anil.

    You need your own DesktopManager that triggers a repaint after dragging ends, like:
    class MyDesktopManager extends DefaultDesktopManager {
    public void endDraggingFrame(JComponent comp) {
         super.endDraggingFrame(comp);
         repaint();
    then use it in your custom DesktopPane
    public DiagramPane() {
    setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
    setDesktopManager(new MyDesktopManager());
    Greetings
    Jeanette

  • Random slowdown of BufferedImage painting.

    Relying on another thread that dealed with painting background image in GUI using Borders, I wrote a custom Border that display an image in the background. This is quite smart and stylish, it works and looks beautifull, except that.....
    I get sometimes a slowdown (on specific images) in painting. I mean : if I resize the window that contain the JPanel with my "ImageBorder", or if I hide then re-make visible this window, with a lot of images it is cool but with some specific images (always the same files) is take 100% CPU for 3 to 10s.
    It is not size-dependant as I suspected, cause somme huge images repaint quick as some small ones repaint slow qith 100% CPU.
    It is not type-dependant (TYPE_INT_XXX or TYPE_BYTE_YYY or other) as I thought... I believed first that images with Alpha-channel where slower but is it false : huges TYPE_CUSTOM png images with alpha channel repaint faster than a specific TYPE_3BYTE_BGR small jpeg image...
    So is there a bug in J2SE 1.4 (I'm using Hotspot 1.4.1-b21, mixed mode) ?
    Or is my code wrong ? Is it possible to predict wich images will slow down painting process ?
    package jro.gui.border;
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Insets;
    import java.awt.geom.AffineTransform;
    import java.awt.image.AffineTransformOp;
    import java.awt.image.BufferedImage;
    import java.awt.image.BufferedImageOp;
    import javax.imageio.ImageIO;
    import javax.swing.border.Border;
    * A border with a background image for GUI enhancement...
    * @author Kilwch
    public class ImageBorder implements Border {
         private BufferedImage aImage;
         private ImageBorder(){
         public ImageBorder(BufferedImage backgroundImage){
              aImage=backgroundImage;
         /* (non-Javadoc)
          * @see javax.swing.border.Border#isBorderOpaque()
         public boolean isBorderOpaque() {
              //TODO : utiliser la transparence de l'image pour d�terminer si opaque ou non
              return true;
         /* (non-Javadoc)
          * @see javax.swing.border.Border#paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int)
         public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
              if(g instanceof Graphics2D){
                   Graphics2D g2d=(Graphics2D)g;
                   int w=aImage.getWidth(), h=aImage.getHeight();
                   if(w!=width || h!=height){
                        BufferedImageOp op=new AffineTransformOp(AffineTransform.getScaleInstance(width/(double)aImage.getWidth(),height/(double)aImage.getHeight()),AffineTransformOp.TYPE_BILINEAR);
                        //TODO PROBLEM Draw with scale op is high-CPU consuming  ! Due to Alpha channel ? Problem occured with QNS only
                        g2d.drawImage(aImage, op, x, y);
                   }else
                        g2d.drawImage(aImage, null, x, y);
         /* (non-Javadoc)
          * @see javax.swing.border.Border#getBorderInsets(java.awt.Component)
         public Insets getBorderInsets(Component c) {
              return new Insets(0,0,0,0);//Copie d�fensive, car Insets a des attributs publics ! grr...
         public static void main(String[] args) {
              if(args.length<1){
                   System.err.println("Missing argument : image URL/path");
                   System.exit(0x80010000);
              java.net.URL imageURL=ImageBorder.class.getClassLoader().getResource(args[0]);
              if(imageURL==null){
                   System.err.println("Invalid image URL/path : "+args[0]);
                   System.exit(0x80020000);
              BufferedImage img;
              try{
                   img=ImageIO.read(imageURL);
                   StringBuffer imgMsg=new StringBuffer(256);
                   imgMsg.append("Image loaded: ").append(imageURL).append("\n * type = ");
                   switch(img.getType()){
                        case BufferedImage.TYPE_3BYTE_BGR: imgMsg.append("TYPE_3BYTE_BGR"); break;
                        case BufferedImage.TYPE_4BYTE_ABGR: imgMsg.append("TYPE_4BYTE_ABGR"); break;
                        case BufferedImage.TYPE_4BYTE_ABGR_PRE: imgMsg.append("TYPE_4BYTE_ABGR_PRE"); break;
                        case BufferedImage.TYPE_BYTE_BINARY: imgMsg.append("TYPE_BYTE_BINARY"); break;
                        case BufferedImage.TYPE_BYTE_GRAY: imgMsg.append("TYPE_BYTE_GRAY"); break;
                        case BufferedImage.TYPE_BYTE_INDEXED: imgMsg.append("TYPE_BYTE_INDEXED"); break;
                        case BufferedImage.TYPE_CUSTOM: imgMsg.append("TYPE_CUSTOM"); break;
                        case BufferedImage.TYPE_INT_ARGB: imgMsg.append("TYPE_INT_ARGB"); break;
                        case BufferedImage.TYPE_INT_ARGB_PRE: imgMsg.append("TYPE_INT_ARGB_PRE"); break;
                        case BufferedImage.TYPE_INT_BGR: imgMsg.append("TYPE_INT_BGR"); break;
                        case BufferedImage.TYPE_INT_RGB: imgMsg.append("TYPE_INT_RGB"); break;
                        case BufferedImage.TYPE_USHORT_555_RGB: imgMsg.append("TYPE_USHORT_555_RGB"); break;
                        case BufferedImage.TYPE_USHORT_565_RGB: imgMsg.append("TYPE_USHORT_565_RGB"); break;
                        case BufferedImage.TYPE_USHORT_GRAY: imgMsg.append("TYPE_USHORT_GRAY"); break;
                        default: imgMsg.append("unknown");
                   imgMsg.append(" (type ").append(img.getType()).append(")");
                   imgMsg.append("\n * Dim = ").append(img.getWidth()).append("x").append(img.getHeight());
                   System.out.println(imgMsg);
              }catch(java.io.IOException pIOEx){
                   System.err.println(pIOEx);
                   System.exit(0x80030000);
                   img=null;//Yes, thats dead code !
              javax.swing.JFrame testFrame=new javax.swing.JFrame();
              testFrame.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
              testFrame.setTitle("Test frame for "+ImageBorder.class.getName());
              testFrame.setSize(img.getWidth(), img.getHeight());
              ((javax.swing.JPanel)testFrame.getContentPane()).setBorder(new ImageBorder(img));
              testFrame.getContentPane().setLayout(new BorderLayout());
              javax.swing.JLabel [] l={new javax.swing.JLabel(args[0]),new javax.swing.JLabel()};
              l[0].setForeground(new java.awt.Color(0x00,0x00,0x66,0xC0));
              l[0].setBackground(new java.awt.Color(0xFF,0xFF,0x99,0x30));
              l[0].setOpaque(true);
              testFrame.getContentPane().add(l[0], BorderLayout.NORTH);
              testFrame.getContentPane().add(l[1], BorderLayout.CENTER);
              testFrame.setVisible(true);
    }

    I've just tried out the VolatileImage. It is a partial workaround for my problem :
    1) the very first paint of my VolatileImage (and next "first paint after contentLost") takes bloody ages, because I need to create a BufferedImage first (from an URL).
    2)Then, each time I need to resize my VolatileImage (because I want it to fit the JFrame's content pane), I have to recreate it, so I re-use the BufferedImage that is the source data, and it re-takes bloody ages.
    3) it is OK since the content of VolatileImage is not lost. So minimize/restore the parent JFrame does not slow down repaint anymore, hiding the parent JFrame with another window then putting it back to front does not slow repaint anymore.
    4)Big Alpha problem : The volatile image is used to paint the borders of the content pane. Imagine now your content pane contains a yellow JLabel with 75% transparency : when another window passes over the JLabel, it look ugly (the window lets dirty marks). It seems that transparent components does not refresh with the underlying image like expected.
    (Note that I know where the slowdown occurs in the paint method : it occurs during image resize (scaling with BufferedImageOp). But I repeat, only on specific images, regardless of their size&colordepth. As I always need a BufferedImage to "remember" the picture to paint on VolatileImage, the slowdown occurs less often, but still occurs)
    Test it for the 4th problem (1st and 2nd come along with specifig images only), passing an image path as 1st arg (note the path is relative to current dir or any classpath dir as I'm using getRessource method):
    package jro.gui.border;
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Insets;
    import java.awt.geom.AffineTransform;
    import java.awt.image.AffineTransformOp;
    import java.awt.image.BufferedImage;
    import java.awt.image.BufferedImageOp;
    import java.awt.image.VolatileImage;
    import javax.imageio.ImageIO;
    import javax.swing.border.Border;
    * A border with a background image for GUI enhancement...
    * @author rousseau_j
    public class VolatileImageBorder implements Border {
         private VolatileImage aVImage;
         private BufferedImage aStaticImage;
         private VolatileImageBorder(){
         public VolatileImageBorder(BufferedImage backgroundImage){
              aStaticImage=backgroundImage;
         /* (non-Javadoc)
          * @see javax.swing.border.Border#isBorderOpaque()
         public boolean isBorderOpaque() {
              //TODO : utiliser la transparence de l'image pour d�terminer si opaque ou non
              return true;
         /* (non-Javadoc)
          * @see javax.swing.border.Border#paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int)
         public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
              if((g instanceof Graphics2D)&& c!=null){
                   Graphics2D g2d=(Graphics2D)g;
                   if(aVImage==null){
                        aVImage=c.createVolatileImage(width, height);
                   int w=aVImage.getWidth(), h=aVImage.getHeight();
                   if(w!=width || h!=height){
                        aVImage=c.createVolatileImage(width, height);
                   do{
                        int returnCode = aVImage.validate(c.getGraphicsConfiguration());
                        if (returnCode == VolatileImage.IMAGE_RESTORED) {
                             renderOffscreen(c, x, y, width, height);
                        } else if (returnCode == VolatileImage.IMAGE_INCOMPATIBLE) {
                             aVImage = c.createVolatileImage(width, height);
                             renderOffscreen(c, x, y, width, height);
                        g2d.drawImage(aVImage, 0, 0, c);
                   }while(aVImage.contentsLost());
         private void renderOffscreen(Component c, int x, int y,int width,  int height){
              System.out.print("renderOffscreen{");//TEST
              do{
                   System.out.print("do{...");//TEST
                   if(aVImage.validate(c.getGraphicsConfiguration())==VolatileImage.IMAGE_INCOMPATIBLE){
                        aVImage=c.createVolatileImage(width, height);
                   Graphics2D vImgG2d=aVImage.createGraphics();
                   int w=aStaticImage.getWidth(), h=aStaticImage.getHeight();
                   if(w!=width || h!=height){
                        //TODO : option pour une redim d�finitive si image trop grande
                        BufferedImageOp op=new AffineTransformOp(AffineTransform.getScaleInstance(width/(double)aStaticImage.getWidth(),height/(double)aStaticImage.getHeight()),AffineTransformOp.TYPE_BILINEAR);
                        //TODO PROBLEM Draw with scale op is high-CPU consuming  ! Due to Alpha channel ? Problem occured with QNS only
                        vImgG2d.drawImage(aStaticImage, op, x, y);
                   }else
                   vImgG2d.drawImage(aStaticImage, null, x, y);
                   vImgG2d.dispose();
                   System.out.print("...}while; ");//TEST
              }while(aVImage.contentsLost());
              System.out.println("}\n");//TEST
         /* (non-Javadoc)
          * @see javax.swing.border.Border#getBorderInsets(java.awt.Component)
         public Insets getBorderInsets(Component c) {
              return new Insets(0,0,0,0);//Copie d�fensive, car Insets a des attributs publics ! grr...
         public static void main(String[] args) {
              if(args.length<1){
                   System.err.println("Missing argument : image URL/path");
                   System.exit(0x80010000);
              java.net.URL imageURL=VolatileImageBorder.class.getClassLoader().getResource(args[0]);
              if(imageURL==null){
                   System.err.println("Invalid image URL/path : "+args[0]);
                   System.exit(0x80020000);
              BufferedImage img;
              try{
                   img=ImageIO.read(imageURL);
                   StringBuffer imgMsg=new StringBuffer(256);
                   imgMsg.append("Image loaded: ").append(imageURL).append("\n * type = ");
                   switch(img.getType()){
                        case BufferedImage.TYPE_3BYTE_BGR: imgMsg.append("TYPE_3BYTE_BGR"); break;
                        case BufferedImage.TYPE_4BYTE_ABGR: imgMsg.append("TYPE_4BYTE_ABGR"); break;
                        case BufferedImage.TYPE_4BYTE_ABGR_PRE: imgMsg.append("TYPE_4BYTE_ABGR_PRE"); break;
                        case BufferedImage.TYPE_BYTE_BINARY: imgMsg.append("TYPE_BYTE_BINARY"); break;
                        case BufferedImage.TYPE_BYTE_GRAY: imgMsg.append("TYPE_BYTE_GRAY"); break;
                        case BufferedImage.TYPE_BYTE_INDEXED: imgMsg.append("TYPE_BYTE_INDEXED"); break;
                        case BufferedImage.TYPE_CUSTOM: imgMsg.append("TYPE_CUSTOM"); break;
                        case BufferedImage.TYPE_INT_ARGB: imgMsg.append("TYPE_INT_ARGB"); break;
                        case BufferedImage.TYPE_INT_ARGB_PRE: imgMsg.append("TYPE_INT_ARGB_PRE"); break;
                        case BufferedImage.TYPE_INT_BGR: imgMsg.append("TYPE_INT_BGR"); break;
                        case BufferedImage.TYPE_INT_RGB: imgMsg.append("TYPE_INT_RGB"); break;
                        case BufferedImage.TYPE_USHORT_555_RGB: imgMsg.append("TYPE_USHORT_555_RGB"); break;
                        case BufferedImage.TYPE_USHORT_565_RGB: imgMsg.append("TYPE_USHORT_565_RGB"); break;
                        case BufferedImage.TYPE_USHORT_GRAY: imgMsg.append("TYPE_USHORT_GRAY"); break;
                        default: imgMsg.append("unknown");
                   imgMsg.append(" (type ").append(img.getType()).append(")");
                   imgMsg.append("\n * Dim = ").append(img.getWidth()).append("x").append(img.getHeight());
                   System.out.println(imgMsg);
              }catch(java.io.IOException pIOEx){
                   System.err.println(pIOEx);
                   System.exit(0x80030000);
                   img=null;//Yes, thats dead code !
              javax.swing.JFrame testFrame=new javax.swing.JFrame();
              testFrame.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
              testFrame.setTitle("Test frame for "+VolatileImageBorder.class.getName());
              testFrame.setSize(img.getWidth(), img.getHeight());
              ((javax.swing.JPanel)testFrame.getContentPane()).setBorder(new VolatileImageBorder(img));
              testFrame.getContentPane().setLayout(new BorderLayout());
              javax.swing.JLabel [] l={new javax.swing.JLabel(args[0]),new javax.swing.JLabel()};
              l[0].setForeground(new java.awt.Color(0x00,0x00,0x66,0xC0));
              l[0].setBackground(new java.awt.Color(0xFF,0xFF,0x99,0x30));
              l[0].setOpaque(true);
              testFrame.getContentPane().add(l[0], BorderLayout.NORTH);
              testFrame.getContentPane().add(l[1], BorderLayout.CENTER);
              testFrame.setVisible(true);
    }

  • Help on custom caret painting

    Hello all!
    I am developing a very custom editor (not only characters, but also drawings, etc) --
    therefore need a caret blinking somewhere text exists.
    Tried out the following code:
    * Paints only caret.
    * @param pGraphics
    * @param pLineHeight
    private void paintCaret(Graphics pGraphics, int pLineHeight) {
         final int x = getCaretX();
         final int y = getCaretY();
         if (x < 0 || y < 0) return;
         pGraphics.setXORMode(Color.BLACK);
         pGraphics.setColor(Color.WHITE);
         pGraphics.fillRect(x, y, CARET_WIDTH, pLineHeight);
    //     caretOn =! caretOn;
         }Cursor blinking is done this way:
         caretBlinkTimer.schedule(new SwingTimerTask() {
              protected void doRun() {
                   final int x = getCaretX();
                   final int y = getCaretY();
                   if (x < 0 || y < 0) return;
                   repaint(x, y, CARET_WIDTH, lineHeight);
         }, 0/*start_jetzt!*/, CARET_BLINK_RATE);The paintComponent(Graphics) code knows if to paint caret only, or more -- to save machine resources, deducing it from area of "dirty" clip rectangle to be repainted.
    Well, what's the problem?
    The problem exists. The editor backgound is somehow yellow color. When application starts and editor is shown up, I can observe the default gray color instead yellow in place of hidden-by-blinking timer caret. In the same situation, if I select another component (out of this editor), which currently paints itself using a kind of turqoise, the caret turns itself in turqoise, and hidden caret even worse, in a kind of violet (I suppose is inverse of turqoise).
    I tried a lot of "dances with flute" around problem, but it doesn't help at all... You see, Graphics has color settings only by setColor(Color) and setXORMode(Color). And, what more (I know 4 sure) the pGraphics object is a brand new one, each another time the "paintComponent(Graphics)" is invoked...
    So, please, any ideas are accepted. Helping me, you help a lot of people with similar problems.
    Thank you in advance.

    What an ungodly amount of the code for the task!
    I tried
    SELECT * FROM SCCM_GetNextServiceWindow('00811A9E08221600', 4)
    Which is said mean "Occurs the Third Monday of every 1 month(s)" and it returned 2015-03-17. Which is a Tuesday. But it is the third Tuesday.
    Turns out that I have British settings on that instance, DATEFIRST is 1. If do SET DATEFIRST 7, I get 2015-03-23. Which is a Monday, but the wrong one.
    The current setting of DATEFIRST can be detected with @@DATEFIRST, and that would make the code even more complex.
    My gut reaction would be to start over and do it all in C#, where at least I don't have to bother about SET DATEFIRST.
    Or maybe first inspect that the ScheduleToken is correct. Maybe it is, but to me that is just an incomprehensible hex string.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Painting one root Application Module to rule them all

    hi
    The description below uses the same MyApplicationModuleListener approach as I describe in the forum thread "painting a picture of Application Module pooling".
    Another example review of Application Module pools behaviour is the blog post by Chris Muir, "JDev 11g, Task Flows & ADF BC – one root Application Module to rule them all?".
    That post also says "... we'll have trouble discerning what the ADF BC layer is actually doing underneath the task flow transaction options. ...", where the approach below might help alleviate some of that discerning trouble.
    And about "... By deduction as there are no other log entries, this second instance of Root1AppModule must be nested under the root Root1AppModule? ..." more information will be logged, so less deduction is required.
    The blog post describes an application similar to this one (which is using the HR.EMPLOYEES table) created using JDeveloper 11.1.1.6.0
    at http://www.consideringred.com/files/oracle/2012/OneSizeOneRootAMApp-v0.01.zip
    It uses somewhat different names than the blog post, and it has two sets of task-flows so that no transaction configuration changes are required to review the behaviour.
    When a MyApplicationModuleListener approach is introduced (with minor changes, mostly configuration, using JAR files available in MyApplicationModuleListenerApp-v0.03.zip) it results in the application available
    at http://www.consideringred.com/files/oracle/2012/OneSizeOneRootAMApp-v0.02.zip
    Using this, the (chained) "No Controller Transaction" scenario's result in similar logging like this:
    [C][L][r1001][(ctx31) /faces : /firstIndex] setRequestInfoPrefix() : extra [GET with 3 parameters (partial request false) (initial render true) (postback true)]
    [C][L][r1002][(ctx32) /faces : /firstIndex] setRequestInfoPrefix() : extra [GET with 3 parameters (partial request false) (initial render true) (postback true)]
    [C][L][r1001][(ctx31) /faces : /firstIndex] onAfterRequest() : no ApplicationPools
    [C][L][r1002][(ctx32) /faces : /firstIndex] onAfterRequest() : no ApplicationPools
    [C][L][r1003][(ctx31) /faces : /firstIndex] setRequestInfoPrefix() : extra [POST with 5 parameters (partial request false) (initial render false) (postback true)]
    [C][L][r1003][(ctx31) /faces : /firstIndex] onNewConstruction() : [(am501) FirstAppModuleImpl_1 (not root) parent = (null)]
    [C][L][r1003][(ctx31) /faces : /firstIndex] onActivate() : [(am501) FirstAppModule (is root)](session version 11.1.1.61.92 oracle.jbo.server.SessionImpl@16cbcec)
    [C][L][r1003][(ctx31) /faces : /firstIndex] onCreate() : [(am501) FirstAppModule (is root)]
    ########FirstAppModuleImpl.create() called.  AM isRoot() = true
    [C][L][r1003][(ctx31) /faces : /firstIndex] onAfterConnect() : [(am501) FirstAppModule (is root)]
    [C][L][r1003][(ctx31) /faces : /firstIndex] onPrepareSession() : [(am501) FirstAppModule (is root)]
    ########FirstAppModuleImpl.prepareSession() called.  AM isRoot() = true
    [C][L][r1003][(ctx31) /faces : /firstIndex] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
    [C][L][r1003][(ctx31) /faces : /firstIndex] onPassivateState() : 5 : [(am501) FirstAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
    [C][L][r1003][(ctx31) /faces : /firstIndex] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
    [C][L][r1003][(ctx31) /faces : /firstIndex] onNewShortId() : pNewShortId = ds81, pId = java:comp/env/jdbc/connHRDS - com.bea:ServerRuntime=DefaultServer,Name=OneSizeOneRootAMApp@connHR@connHR,ApplicationRuntime=OneSizeOneRootAMApp,Type=JDBCDataSourceRuntime
    [C][L][r1003][(ctx31) /faces : /firstIndex] onAfterRequest() : 1 : ApplicationPool = onesizeonerootamapp.model.FirstAppModuleLocal
    (ap21)[cre 1; rem 0; act 0; pas 0; co 1; ci 1; ref reu 0; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
    (ds81)[cur cap 1; avai 0; unav 1; cp hig 1; ac cur 1; ac avg 0; ac hig 1; co del 168; co tot 1; res req 1; fai res 0; fai rec 0; h avai 1; h unav 1; lea co 0; psc acc 0; psc add 0; psc csi 0; psc del 0; psc hit 0; psc mis 0; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]
    [C][L][r1004][(ctx31) /faces : /firstam-btf/empVoFirstViPage] setRequestInfoPrefix() : extra [GET with 5 parameters (partial request true) (initial render false) (postback true)]
    [C][L][r1004][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
    [C][L][r1004][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onPassivateState() : 5 : [(am501) FirstAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
    [C][L][r1004][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
    [C][L][r1004][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterRequest() : 1 : ApplicationPool = onesizeonerootamapp.model.FirstAppModuleLocal
    (ap21)[cre 1; rem 0; act 0; pas 0; co 2; ci 2; ref reu 1; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
    (ds81)[cur cap 1; avai 0; unav 1; cp hig 1; ac cur 1; ac avg 0; ac hig 1; co del 168; co tot 1; res req 1; fai res 0; fai rec 0; h avai 1; h unav 1; lea co 0; psc acc 2; psc add 2; psc csi 2; psc del 0; psc hit 0; psc mis 2; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]
    [C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] setRequestInfoPrefix() : extra [POST with 55 parameters (partial request false) (initial render false) (postback true)]
    [C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
    [C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onNewConstruction() : [(am502) SecondAppModuleImpl_154 (not root) parent = (null)]
    [C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onActivate() : [(am502) SecondAppModule (is root)](session version 11.1.1.61.92 oracle.jbo.server.SessionImpl@8add89)
    [C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onCreate() : [(am502) SecondAppModule (is root)]
    ########SecondAppModuleImpl.create() called.  AM isRoot() = true
    [C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterConnect() : [(am502) SecondAppModule (is root)]
    [C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onPrepareSession() : [(am502) SecondAppModule (is root)]
    ########SecondAppModuleImpl.prepareSession() called.  AM isRoot() = true
    [C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am502) SecondAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
    [C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onPassivateState() : 5 : [(am501) FirstAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
    [C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
    [C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onPassivateState() : 5 : [(am502) SecondAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
    [C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am502) SecondAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
    [C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterRequest() : 1 : ApplicationPool = onesizeonerootamapp.model.FirstAppModuleLocal
    (ap21)[cre 1; rem 0; act 0; pas 0; co 3; ci 3; ref reu 2; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
    (ds81)[cur cap 2; avai 0; unav 2; cp hig 2; ac cur 2; ac avg 0; ac hig 2; co del 122; co tot 2; res req 2; fai res 0; fai rec 0; h avai 1; h unav 2; lea co 0; psc acc 2; psc add 2; psc csi 2; psc del 0; psc hit 0; psc mis 2; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]
    [C][L][r1005][(ctx31) /faces : /firstam-btf/empVoFirstViPage] onAfterRequest() : 2 : ApplicationPool = onesizeonerootamapp.model.SecondAppModuleLocal
    (ap22)[cre 1; rem 0; act 0; pas 0; co 1; ci 1; ref reu 0; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
    (ds81)[cur cap 2; avai 0; unav 2; cp hig 2; ac cur 2; ac avg 0; ac hig 2; co del 122; co tot 2; res req 2; fai res 0; fai rec 0; h avai 1; h unav 2; lea co 0; psc acc 2; psc add 2; psc csi 2; psc del 0; psc hit 0; psc mis 2; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]
    [C][L][r1006][(ctx31) /faces : /secondam-btf/empVoSecondViPage] setRequestInfoPrefix() : extra [GET with 5 parameters (partial request true) (initial render false) (postback true)]
    [C][L][r1006][(ctx31) /faces : /secondam-btf/empVoSecondViPage] onAfterDoPoolMessage() : [(am502) SecondAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
    [C][L][r1006][(ctx31) /faces : /secondam-btf/empVoSecondViPage] onPassivateState() : 5 : [(am502) SecondAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
    [C][L][r1006][(ctx31) /faces : /secondam-btf/empVoSecondViPage] onAfterDoPoolMessage() : [(am502) SecondAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
    [C][L][r1006][(ctx31) /faces : /secondam-btf/empVoSecondViPage] onAfterRequest() : 1 : ApplicationPool = onesizeonerootamapp.model.FirstAppModuleLocal
    (ap21)[cre 1; rem 0; act 0; pas 0; co 3; ci 3; ref reu 2; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
    (ds81)[cur cap 2; avai 0; unav 2; cp hig 2; ac cur 2; ac avg 0; ac hig 2; co del 122; co tot 2; res req 2; fai res 0; fai rec 0; h avai 1; h unav 2; lea co 0; psc acc 4; psc add 4; psc csi 4; psc del 0; psc hit 0; psc mis 4; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]
    [C][L][r1006][(ctx31) /faces : /secondam-btf/empVoSecondViPage] onAfterRequest() : 2 : ApplicationPool = onesizeonerootamapp.model.SecondAppModuleLocal
    (ap22)[cre 1; rem 0; act 0; pas 0; co 2; ci 2; ref reu 1; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
    (ds81)[cur cap 2; avai 0; unav 2; cp hig 2; ac cur 2; ac avg 0; ac hig 2; co del 122; co tot 2; res req 2; fai res 0; fai rec 0; h avai 1; h unav 2; lea co 0; psc acc 4; psc add 4; psc csi 4; psc del 0; psc hit 0; psc mis 4; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]The "Always Begin New Transaction and Always Use Existing transaction" scenario results in logging like this:
    [C][L][r1001][(ctx31) /faces : /secondIndex] setRequestInfoPrefix() : extra [GET with 3 parameters (partial request false) (initial render true) (postback true)]
    [C][L][r1002][(ctx32) /faces : /secondIndex] setRequestInfoPrefix() : extra [GET with 3 parameters (partial request false) (initial render true) (postback true)]
    [C][L][r1001][(ctx31) /faces : /secondIndex] onAfterRequest() : no ApplicationPools
    [C][L][r1002][(ctx32) /faces : /secondIndex] onAfterRequest() : no ApplicationPools
    [C][L][r1003][(ctx32) /faces : /secondIndex] setRequestInfoPrefix() : extra [POST with 5 parameters (partial request false) (initial render false) (postback true)]
    [C][L][r1003][(ctx32) /faces : /secondIndex] onNewConstruction() : [(am501) FirstAppModuleImpl_1 (not root) parent = (null)]
    [C][L][r1003][(ctx32) /faces : /secondIndex] onActivate() : [(am501) FirstAppModule (is root)](session version 11.1.1.61.92 oracle.jbo.server.SessionImpl@1d90a2c)
    [C][L][r1003][(ctx32) /faces : /secondIndex] onCreate() : [(am501) FirstAppModule (is root)]
    ########FirstAppModuleImpl.create() called.  AM isRoot() = true
    [C][L][r1003][(ctx32) /faces : /secondIndex] onAfterConnect() : [(am501) FirstAppModule (is root)]
    [C][L][r1003][(ctx32) /faces : /secondIndex] onPrepareSession() : [(am501) FirstAppModule (is root)]
    ########FirstAppModuleImpl.prepareSession() called.  AM isRoot() = true
    [C][L][r1003][(ctx32) /faces : /secondIndex] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
    [C][L][r1003][(ctx32) /faces : /secondIndex] onNewConstruction() : [(am502) FirstAppModuleImpl_2 (not root) parent = (null)]
    [C][L][r1003][(ctx32) /faces : /secondIndex] onSetParent() : 2 : [(am502) onesizeonerootamapp_model_FirstAppModule (not root) parent = (null)] parent = [(am501) FirstAppModule (is root)]
    [C][L][r1003][(ctx32) /faces : /secondIndex] onCreate() : [(am502) onesizeonerootamapp_model_FirstAppModule (not root) parent = [(am501) FirstAppModule (is root)]]
    ########FirstAppModuleImpl.create() called.  AM isRoot() = false
    [C][L][r1003][(ctx32) /faces : /secondIndex] onPassivateState() : 5 : [(am501) FirstAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
    [C][L][r1003][(ctx32) /faces : /secondIndex] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
    [C][L][r1003][(ctx32) /faces : /secondIndex] onNewShortId() : pNewShortId = ds81, pId = java:comp/env/jdbc/connHRDS - com.bea:ServerRuntime=DefaultServer,Name=OneSizeOneRootAMApp@connHR@connHR,ApplicationRuntime=OneSizeOneRootAMApp,Type=JDBCDataSourceRuntime
    [C][L][r1003][(ctx32) /faces : /secondIndex] onAfterRequest() : 1 : ApplicationPool = onesizeonerootamapp.model.FirstAppModuleLocal
    (ap21)[cre 1; rem 0; act 0; pas 0; co 1; ci 1; ref reu 0; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
    (ds81)[cur cap 1; avai 0; unav 1; cp hig 1; ac cur 1; ac avg 0; ac hig 1; co del 75; co tot 1; res req 1; fai res 0; fai rec 0; h avai 1; h unav 1; lea co 0; psc acc 0; psc add 0; psc csi 0; psc del 0; psc hit 0; psc mis 0; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]
    [L-before][L][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
    [C][L][r1004][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] setRequestInfoPrefix() : extra [GET with 5 parameters (partial request true) (initial render false) (postback true)]
    [C][L][r1004][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onPassivateState() : 5 : [(am501) FirstAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
    [C][L][r1004][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
    [C][L][r1004][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterRequest() : 1 : ApplicationPool = onesizeonerootamapp.model.FirstAppModuleLocal
    (ap21)[cre 1; rem 0; act 0; pas 0; co 2; ci 2; ref reu 1; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
    (ds81)[cur cap 1; avai 0; unav 1; cp hig 1; ac cur 1; ac avg 0; ac hig 1; co del 75; co tot 1; res req 1; fai res 0; fai rec 0; h avai 1; h unav 1; lea co 0; psc acc 2; psc add 2; psc csi 2; psc del 0; psc hit 0; psc mis 2; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]
    [L-before][L][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
    [C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] setRequestInfoPrefix() : extra [POST with 55 parameters (partial request false) (initial render false) (postback true)]
    [C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPassivateStateForUndo() : [(am501) FirstAppModule (is root)] pId = null, pClientData = null, pFlags = unknown passivation flags (0)
    [C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPassivateState() : 2 : [(am501) FirstAppModule (is root)] pClientData = null, pFlags = PASSIVATE_UNDO_FLAG, PASSIVATE_TO_STACK_FLAG (40)
    [C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPassivateConnectionState() : [(am502) onesizeonerootamapp_model_FirstAppModule (not root) parent = [(am501) FirstAppModule (is root)]] pDoc = (name = #document, doc elem = null), pParent = (name = CONN)
    [C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPassivateConnectionState() : [(am501) FirstAppModule (is root)] pDoc = (name = #document, doc elem = null), pParent = (name = CONN)
    [C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPrepareForPassivation() : [(am501) FirstAppModule (is root)] pOut = (name = #document, doc elem = null) pParent = (name = AM)
    [C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPrepareForPassivation() : [(am502) onesizeonerootamapp_model_FirstAppModule (not root) parent = [(am501) FirstAppModule (is root)]] pOut = (name = #document, doc elem = null) pParent = (name = AM)
    [C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPassivateState() : 3 : [(am502) onesizeonerootamapp_model_FirstAppModule (not root) parent = [(am501) FirstAppModule (is root)]] pDoc = (name = #document, doc elem = null), pParent = (name = AM)
    [C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPassivateState() : 3 : [(am501) FirstAppModule (is root)] pDoc = (name = #document, doc elem = null), pParent = (name = AM)
    [C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onNewConstruction() : [(am503) SecondAppModuleImpl_155 (not root) parent = (null)]
    [C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onSetParent() : 2 : [(am503) onesizeonerootamapp_model_SecondAppModule (not root) parent = (null)] parent = [(am501) FirstAppModule (is root)]
    [C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onCreate() : [(am503) onesizeonerootamapp_model_SecondAppModule (not root) parent = [(am501) FirstAppModule (is root)]]
    ########SecondAppModuleImpl.create() called.  AM isRoot() = false
    [C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onPassivateState() : 5 : [(am501) FirstAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
    [C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
    [C][L][r1005][(ctx31) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterRequest() : 1 : ApplicationPool = onesizeonerootamapp.model.FirstAppModuleLocal
    (ap21)[cre 1; rem 0; act 0; pas 0; co 3; ci 3; ref reu 2; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
    (ds81)[cur cap 2; avai 1; unav 1; cp hig 2; ac cur 1; ac avg 0; ac hig 2; co del 79; co tot 2; res req 2; fai res 0; fai rec 0; h avai 1; h unav 2; lea co 0; psc acc 3; psc add 3; psc csi 3; psc del 0; psc hit 0; psc mis 3; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]
    [L-before][L][(ctx31) /faces : /secondam-tx-btf/empVoSecondViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_USING (1) STATUS_SUCCESS (8) (rp 4)]
    [C][L][r1006][(ctx31) /faces : /secondam-tx-btf/empVoSecondViPage] setRequestInfoPrefix() : extra [GET with 5 parameters (partial request true) (initial render false) (postback true)]
    [C][L][r1006][(ctx31) /faces : /secondam-tx-btf/empVoSecondViPage] onPassivateState() : 5 : [(am501) FirstAppModule (is root)] pId = -1, pClientData = null, pFlags = PASSIVATE_HINT_FLAG (16)
    [C][L][r1006][(ctx31) /faces : /secondam-tx-btf/empVoSecondViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
    [C][L][r1006][(ctx31) /faces : /secondam-tx-btf/empVoSecondViPage] onAfterRequest() : 1 : ApplicationPool = onesizeonerootamapp.model.FirstAppModuleLocal
    (ap21)[cre 1; rem 0; act 0; pas 0; co 4; ci 4; ref reu 3; ref rec 0; unr rec 0; fail 0; tot am 1; max am 1; avg am 1; tot ava 1; avg ava 1; avg una 0; tot ref 1; ses 1; avg ses 1]
    (ds81)[cur cap 2; avai 1; unav 1; cp hig 2; ac cur 1; ac avg 0; ac hig 2; co del 79; co tot 2; res req 2; fai res 0; fai rec 0; h avai 1; h unav 2; lea co 0; psc acc 5; psc add 3; psc csi 3; psc del 0; psc hit 1; psc mis 4; wfc cur 0; wfc fai 0; wfc hig 0; wfc tot 0; wse hig 0]This seems to confirm more explicitly some of the observations in the blog post, and at the same time might add some additional insight into what the framework is doing.
    Suggestions to improve such MyApplicationModuleListener approach (or an alternative approach) are welcome.
    many thanks
    Jan Vervecken

    fyi
    Some additional features were added in the JAR files available
    in http://www.consideringred.com/files/oracle/2013/MyApplicationModuleListenerApp-v0.05.zip
    Like line numbers, or a queryOneRecord() method to support logging the database session SID, or a TaskFlowInfoHelper class to allow logging task-flow transaction options or DataControlFrame information.
    If these JAR files are used, it results in the modified example application
    at http://www.consideringred.com/files/oracle/2013/OneSizeOneRootAMApp-v0.03.zip
    For the same scenarios (using OneSizeOneRootAMApp-v0.03.zip), the resulting logging can be found in these files:
    - "maml-log-20130113-jdev111160-nctx.txt" : when using JDeveloper 11.1.1.6.0 and the chained "No Controller Transaction" scenario :
    [0002][C][L][r1001][(ctx31) /faces : /firstIndex] logContextInformation() :
    [0003]#{a_versionBean.appVersionInfo} = OneSizeOneRootAMApp v0.03 : oracle.jbo.Version = 11.1.1.61.92
    [0007][C][L][r1002][(ctx32) /faces : /firstIndex] onAfterPrepareModel() : task-flow = (no current TaskFlowId) (unbounded task-flow pages)
    [0008]transaction type = (no current TaskFlowId), DC scope = (no current TaskFlowId), DC frame = e1o4lmuw3_2, open transaction = null, is transaction dirty = false
    [0044][C][L][r1005][(ctx32) /faces : /firstam-btf/empVoFirstViPage] onAfterPrepareModel() : task-flow = /WEB-INF/btf/firstam-btf.xml#firstam-btf (no page-fragments)
    [0045]transaction type = -No Controller Transaction-, DC scope = shared DataControlScopeType, DC frame = e1o4lmuw3_2, open transaction = null, is transaction dirty = false
    [0046][C][L][r1005][(ctx32) /faces : /firstam-btf/empVoFirstViPage] onAfterPrepareModel() : task-flow = /WEB-INF/btf/secondam-btf.xml#secondam-btf (no page-fragments)
    [0047]transaction type = -No Controller Transaction-, DC scope = shared DataControlScopeType, DC frame = e1o4lmuw3_2, open transaction = null, is transaction dirty = true
    [0057][C][L][r1005][(ctx32) /faces : /firstam-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
    [0058](am501) SID = 41 for select sys_context('USERENV', 'SID') as sid from dual
    [0060][C][L][r1005][(ctx32) /faces : /firstam-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am502) SecondAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
    [0061](am502) SID = 27 for select sys_context('USERENV', 'SID') as sid from dual
    Notice the transaction type and DataControl scope information per task-flow.
    Notice the different database session SID values ("[0058](am501) SID = 41" and "[0061](am502) SID = 27") during the same request [r1005].
    - "maml-log-20130113-jdev111230-nctx.txt" : when using JDeveloper 11.1.2.3.0 and the chained "No Controller Transaction" scenario :
    [0002][C][L][r1001][(ctx31) /faces : /firstIndex] logContextInformation() :
    [0003]#{a_versionBean.appVersionInfo} = OneSizeOneRootAMApp v0.03 : oracle.jbo.Version = 11.1.2.62.76
    Notice the logged information seems similar to when, for the same application and scenario, JDeveloper 11.1.1.6.0 is used (above).
    - "maml-log-20130113-jdev111160-tx.txt" : when using JDeveloper 11.1.1.6.0 and the "Always Begin New Transaction and Always Use Existing transaction" scenario :
    [0002][C][L][r1001][(ctx31) /faces : /secondIndex] logContextInformation() :
    [0003]#{a_versionBean.appVersionInfo} = OneSizeOneRootAMApp v0.03 : oracle.jbo.Version = 11.1.1.61.92
    [0013][C][L][r1003][(ctx32) /faces : /secondIndex] onAfterPrepareModel() : task-flow = /WEB-INF/btf/firstam-tx-btf.xml#firstam-tx-btf (no page-fragments)
    [0014]transaction type = Always Begin New Transaction, DC scope = isolated DataControlScopeType, DC frame = 1220j2l4q9_5, open transaction = 1220j2l4q9_5, is transaction dirty = false
    [0017][C][L][r1003][(ctx32) /faces : /secondIndex] onCreate() : [(am501) FirstAppModule (is root)]
    [0018](am501) SID = 41 for select sys_context('USERENV', 'SID') as sid from dual
    [0025][C][L][r1003][(ctx32) /faces : /secondIndex] onCreate() : [(am502) onesizeonerootamapp_model_FirstAppModule (not root) parent = [(am501) FirstAppModule (is root)]]
    [0026](am502) SID = 41 for select sys_context('USERENV', 'SID') as sid from dual
    [0056][C][L][r1005][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterPrepareModel() : task-flow = /WEB-INF/btf/secondam-tx-btf.xml#secondam-tx-btf (no page-fragments)
    [0057]transaction type = Always Use Existing Transaction, DC scope = shared DataControlScopeType, DC frame = 1220j2l4q9_5, open transaction = 1220j2l4q9_5, is transaction dirty = true
    [0060][C][L][r1005][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onCreate() : [(am503) onesizeonerootamapp_model_SecondAppModule (not root) parent = [(am501) FirstAppModule (is root)]]
    [0061](am503) SID = 41 for select sys_context('USERENV', 'SID') as sid from dual
    [0063][C][L][r1005][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
    [0064](am501) SID = 41 for select sys_context('USERENV', 'SID') as sid from dual
    Notice that nested Application Module instances are created, resulting in one database session SID value per request.
    - "maml-log-20130113-jdev111230-tx.txt" : when using JDeveloper 11.1.2.3.0 and the "Always Begin New Transaction and Always Use Existing transaction" scenario :
    [0002][C][L][r1001][(ctx31) /faces : /secondIndex] logContextInformation() :
    [0003]#{a_versionBean.appVersionInfo} = OneSizeOneRootAMApp v0.03 : oracle.jbo.Version = 11.1.2.62.76
    [0052][C][L][r1005][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterPrepareModel() : task-flow = /WEB-INF/btf/firstam-tx-btf.xml#firstam-tx-btf (no page-fragments)
    [0053]transaction type = Always Begin New Transaction, DC scope = isolated DataControlScopeType, DC frame = dw58co387_4, open transaction = dw58co387_4, is transaction dirty = false
    [0059][C][L][r1005][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterPrepareModel() : task-flow = /WEB-INF/btf/secondam-tx-btf.xml#secondam-tx-btf (no page-fragments)
    [0060]transaction type = Always Use Existing Transaction, DC scope = shared DataControlScopeType, DC frame = dw58co387_4, open transaction = dw58co387_4, is transaction dirty = true
    [0070][C][L][r1005][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am501) FirstAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
    [0071](am501) SID = 38 for select sys_context('USERENV', 'SID') as sid from dual
    [0073][C][L][r1005][(ctx32) /faces : /firstam-tx-btf/empVoFirstViPage] onAfterDoPoolMessage() : [(am502) SecondAppModule (is root)][(ses101) MESSAGE_TYPE_RELEASING (2) STATUS_SUCCESS (8) (rp 3)]
    [0074](am502) SID = 38 for select sys_context('USERENV', 'SID') as sid from dual
    Notice that two root Application Module instances are used in the same request (and no nested instances), and both (am501) and (am502) report using the same database session SID value. That seems to be "Bruce" [1] at work.
    Remember, it should not be difficult (and not intrusive) to configure similar logging for other ADF applications.
    - [1] seeblog post "Task flows: Sayonara auto AM nesting in 11.1.2.0.0. Hello, ah, let's call it Bruce."
    at http://one-size-doesnt-fit-all.blogspot.com.au/2011/08/task-flows-sayonara-auto-am-nesting-in.html
    regards
    Jan Vervecken

  • Tracking dirty region on a complex component

    Hi,
    I have a component displaying geo data. Controllers used to pan, select data can draw on top of it ( like selection rectangle or whatever can help the user keeps track of its interaction... ) To accelerate the refresh, I only want to redraw the region of the component that the controllers have painted on.
    I have a problem tracking those dirty region. Here is how I would like the select controller to behave :
    - draw the selection rectangle while the user drags the mouse ;
    - once the user release the mouse button, the rectangle should still be displayed
    - on a new interaction, erase the previous selection rectangle and start over
    Below is a sample code that supposed to do that however for time to time the dirty region is not fully repaint and leave part the selection rectangle edges ( you'll have to play a little to see it happens )
    Could somebody tell me what did I do wrong or if it is a bug ? I doubt that although it happends rather randomly...
    Thanks for your help
    Brieuc
    PS : - sample code is below
    - I've run it on jre 1.5.0_06, 1.5.0_08 and 1.6.0 beta4x
    - don't just click you'll get a null pointer exception... :-) I'm too lazy to fix it
    package graphics;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseMotionListener;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    public class DrawRectangle extends JComponent implements MouseListener,
              MouseMotionListener {
         Point clickedPoint;
         Rectangle rect;
         Rectangle dirtyRegion = new Rectangle();
         public DrawRectangle() {
              super();
              setLayout( null );
              setSize( 400, 400 );
              setMinimumSize( new Dimension( 400, 400 ) );
              setPreferredSize( new Dimension( 400, 400 ) );
              setOpaque( true );
              addMouseListener( this );
              addMouseMotionListener( this );
         public void mousePressed(MouseEvent e ) {
              clickedPoint = e.getPoint();
              if ( rect != null ) {
                   repaint( rect );
                   rect = null;
         public void mouseDragged(MouseEvent e ) {
              if ( rect == null )
                   rect = new Rectangle();
              else {
                   dirtyRegion.setFrame( rect );
                   rect.setFrameFromDiagonal( clickedPoint, e.getPoint() );
                   Rectangle.union( dirtyRegion, rect, dirtyRegion );
                   dirtyRegion.width += 1;
                   dirtyRegion.height += 1;
                   dirtyRegion.width += 1;
                   dirtyRegion.height += 1;
         repaint( dirtyRegion );
         public void mouseReleased(MouseEvent e ) {
              dirtyRegion.setFrame( rect );
              rect.setFrameFromDiagonal( clickedPoint, e.getPoint() );
              Rectangle.union( dirtyRegion, rect, dirtyRegion );
              dirtyRegion.width += 1;
              dirtyRegion.height += 1;
              repaint( dirtyRegion );
         public void mouseClicked( MouseEvent e ) {
         public void mouseEntered(MouseEvent e ) {
         public void mouseExited(MouseEvent e ) {
         public void mouseMoved(MouseEvent e ) {
         @Override
         protected void paintComponent(Graphics g ) {
              Graphics2D g2 = (Graphics2D) g;
              if ( isOpaque() ) {
                   Color c = g2.getColor();
                   g2.setColor( getBackground() );
                   g2.fillRect( dirtyRegion.x, dirtyRegion.y, dirtyRegion.width, dirtyRegion.height );
                   g2.setColor( c );
              if ( rect != null )
                   g2.drawRect( rect.x, rect.y, rect.width - 1, rect.height - 1 );
         public static void main( String[] args ) {
              JFrame f = new JFrame( "Test" );
              f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              f.add( new DrawRectangle() );
              f.pack();
              f.setVisible( true );
    }

    Hi,
    the text field value, where is it persisted? Is it the binding layer or a managed bean in request scope. The latter would exlain what happens in that the original field value is set back from what you set it to. In this case try viewScope
    Just a guess
    Frank

  • How show area being painted on mask?

    I suspect this is obvious to the informed observer, but I've been searching and can't seem to find it........
    Do the normal processing for high pass sharpening - duplicate a layer, set blur to 10px, set to hard light......  Works fine
    but it sharpens my sky.....  SO, create a mask and paint the sky with black so it doesn't get sharpened.....  All this
    works just fine...
    What I WANT to do is be able to see ON MY IMAGE, where I've painted with black......  something like the pink overlay
    you get in quick mask mode...  HOW do I turn this on and off so I can see where I"m painting my mask?

    Hi, Dave.
    I'm a little unclear exactly what you need. But is sounds like you're on the right track. Maybe a little out of order.
    Anyway, here's one approach.
    1. Duplicate  the background layer twice. Fill the bottom layer with red.
    2. Sharpen the Backround copy layer.
    3. Select Background copy 2. Do a rough selection of the sky. I used the magic wand.
    4. Click on the Add Vector Mask button (highlighted).
    Background copy 2 is the unsharpend sky. But the mask is quick and dirty and needs refinement. There is no feature like Quick Mask for vector masking. But one way to check your progress is to Ctrl+Click on the Layer mask thumbnail. This will show you a selection where your mask is, but that's about it. You can't edit in this state. More useful is to turn of the background copy. You can edit the mask in this state. And you can clearly see what is masked and what is not. But still a little awkward, because you can't see the whole image.
    So, to create a fake quick mask effect, turn the Background copy layer back on, and set the opacity to 50%. Now you can see both layers, but you can tell what you've masked and what you haven't. Set up this way, the unpainted areas will have a red tint.
    When your done fine tuning your mask. Turn the opacity back up to 100% and you're good to go.
    And of course you can use a different color and opacity. Whatever helps you see what you're doing best.
    Peace,
    Lee

  • Suggestion: Remove bucket from the dirty-words list

    The forum software evidently believes "bucket" is a dirty word, as in "Photoshop Elements' Paint Bucket tool".  (B u c k e t).   See this thread:
    http://forums.adobe.com/thread/434983?tstart=0

    John Joslin wrote:
    Harbs. wrote:
    We never had any problems of foul language with the webx forums 
    You obviously didn't get around much! 
    Yup would make very experienced sailor blush

  • Call paint or validate

    What should I call paint or validate once a person
    minimizes or maximizes a frame or a dialog box.
    I have little confusion on this.
    rajesh

    paint is to render, validate is for layout stuff. Sometimes the UI becomes dirty even if the layout did not change. If your UI seems to be painted but display a bad layout, call validate. Note that you also might have to call both, empiric testing will prevail in this domain since Containers are sometimes a bit strange on their behaviours.
    Also, do not use paint but rather repaint(), it would be better. Also note that there's an invalidate method, depending on what you are doing, invalidate might be your answer.
    conclusion:
    use repaint(), invalidate(), validate(). the use of 3, 2 or 1 of those methods will be answered by empiric tests.

  • Cleaning Dirty iMacs

    My school just got 7 (count 'em 7!) rev b bondi iMacs donated. Unfortunately, they came from a vet office with lots of hair and dandruff floating around, so, as you can imagine they got very dirty. So, my question is what is the best way to clean these macs and what could be damaged?. I have an air compressor and bottled air and have taken a bunch of (mostly newer) iMacs apart. Thanks for the help!
    iMac   Mac OS X (10.4.3)  

    I cleaned my iMac by taking it apart, however working around the CRT can be deadly. CRTs need to be discharged before even coming close to touching them. That said, I didn't use much compressed air because, in many areas, it would have blown the dust further down inside. I used dampened rags and paper towels and a dampened soft paint brush to lift the dust off, only using compressed air when I could blow the debris away from the iMac.
    The bottom comes off first, then the front panel, then the back (colored) part.
    <http://homepage.mac.com/dreed2/PhotoAlbum52.html>
    There are some manuals listed here for Bondi iMacs, but I haven't downloaded them to check them out yet. Gotta get back to work on installing the new kitchen floor.
    Good luck with those iMacs.
    Message was edited by: dreed2 (forgot to include a link)

  • Painting Error while displaying Waveform charts in subpanel

    Hello:
    I've been using subpanels for a while without problems. Recently I've
    noticed a painting error when I load a VI containing a Waveform Chart
    into the subpanel. The label of the Y Scale of the waveform chart 
    doesn't show, instead a black rectangle appears. This problem can be
    seen in the VI viewer.vi, in the subpanel examples of LabVIEW. I know
    this is not a big problem, but I'd like to know if there's a way to
    correct it.
    Thanks in advance.
    Robst
    Robst - CLD
    Using LabVIEW since version 7.0

    Hi Robst,
    This is a known issue with LabVIEW 7.x.  Happily, it has been corrected in LabVIEW 8.0.  There is a "quick and dirty" workaround (courtesy of Marc A http://forums.ni.com/ni/board/message?board.id=170&message.id=155006&requireLogin=False) that I hope you will find satisfactory.  The background of the Y axis label is clear by default.  If you manually change it to the color of the graph, then when you view it in a subpanel it will not turn black. 
    I hope this helps!  Let us know if you have any further questions!
    Megan B.
    Applications Engineer
    National Instruments

  • Logical Formulae in Report Painter

    Hi,
    How do we insert a logical formula in a report painter.
    For instance, "IF-THEN-ELSE".
    Your early replies would be appreciated..

    You would create a formula column in reports or formula variables to use in columns. 
    More details on link's below:
    http://help.sap.com/saphelp_erp2005/helpdata/en/5b/d22c6243c611d182b30000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/5b/d22ea043c611d182b30000e829fbfe/frameset.htm
    Best Regards,
    Daniel Scoz.

Maybe you are looking for

  • FTP'ing the BI Publisher report

    if i ftp'ing the report from BI Publisher will that report save in the Database? if i do the normal scheduling(to email's) of that report from publisher will that report first save in database then deliver to scheduling emails? Edited by: user1225547

  • Display Dynamic Member List Variable value in the Header

    Hi In my HFR report im using a dynamic member list as DynList1(@POV) in the Entity Dimension; for HFM Application. For the Entity Parameter im using User Prompt for Entity. For the User Prompt im using a choice list of Four entity members. E1, E2,E3,

  • Publishing to quicktime 7.5 from Flash 8

    Hello, I'm trying to publish or export my flash fla file to quicktime. I followed the instructions to reduce the flash player, only to run into the same error. I'm working with Flash 8 and Quicktime 7.5 and unfortunately do not have the funds to upgr

  • Blurring/hiding text in Acrobat

    Acrobat 9.0.0 I'm a new user. I would like to know if Acrobat has a feature where I can blur parts of the text so that my reader will not see them. Ideally, this would just be a selection tool type of an action. If not, does anyone have any tips from

  • Why since I download iOS 6 , I can't connect to wifi for a long time! :(

    I have download iOS 6 a few time ago , and now it's hard to stay connected to a wifi signal , and I am sure is not a problema with my iPad or my wifi , the problem is iOS 6 and btw sorry for my English!