Canvas, paint(), and FlowLayout/BoxLayout

Has anyone encountered an error of paint() not being called when placed in a Container with a FlowLayout or a BoxLayout? This has been a recurring issue for me.
{=^)                                                                                                                                                                                                                                                                                                                                               

Anyone?
{=^)                                                                                                                                                                                                                                                   

Similar Messages

  • Native Canvas Painting and Refresh

    Hi,
    I have a project where I get live video from a firewire camera, and paint it to an awt Canvas natively using JNI. I need additional items painted on the canvas (on top of the video), like a pair of crosshairs and rulers to measure certain widths, etc. The software tracks an object moving across the screen, so the crosshairs need to be moved around and refreshed often.
    I am getting a strange problem - the natively painted video is working just fine, but the painted objects are not refreshing properly. For example, instead of getting a crosshair that moves around the screen, I get a trail of crosshairs. And underneath the crosshairs, the video is refreshing just fine. What's going on? I'm using libXv, an X-windows extension to paint YUV4:2:2 camera buffers directly to the screen.
    Here are relevant class snippets:
    public class NativeCanvas extends Canvas{
        public void update(Graphics g)                 <-- overridden to eliminate flicker
            paint(g);
        public native void paint(Graphics g);         <-- here's the native video drawing function
    public class CanvasWithOverlays extends NativeCanvas
        public void paint(Graphics g)
               super.paint();
               Graphics2D g2 = (Graphics2D)g;
               //(paint crosshairs, etc)
    } Any help will be greatly appreciated. Thanks very much!
    --Ismail Degani
    High Energy Synchrotron Source
    Cornell University

    Hi,
    I'm not sure how the crosshairs can be out of sync with the video stream - the canvas paint routines paint the video frame natively, and then paint the crosshairs. It's all sequential -
    super.paint();    // goes into a native function XvPutImage that quickly blits the frame on screen
    Graphics2D g2 = (Graphics2D)g;          
    //(paint crosshairs, etc) This should work properly with the Event Queue, to the best of my knowledge. I schedule a TimerTask that continually calls the repaint() method to refresh the video:
    public class LiveVideoPainter extends TimerTask
        static Logger logger = Logger.getLogger(LiveVideoPainter.class.getName());
        NativeCanvas nc;
        VideoDataSource vs;
        public LiveVideoPainter(NativeCanvas nc, VideoDataSource vs)
            if(nc == null)  {
                logger.error("The Native Canvas is null!");
                return;
            if(vs == null)  {
                logger.error("The Video Data Source is null!");
                return;
            this.nc = nc;
            this.vs = vs;
        public void run()
            vs.getFrame(nc.buffer);
            nc.repaint();
    } I actually had this same problem when designing this application with C++ using the Qt windowing toolkit a year ago. Basically, if I called XvPutimage, and then called regular X drawing routines like XDrawLine etc in a loop, it would draw successfully, but never refresh properly:
    while(true)
    get_decompressed_frame(buf);
    xv_image=XvCreateImage(display,info[0].base_id, XV_UYVY, (char*)buf, 1024, 768);
    XvPutImage(display, info[0].base_id, window, gc, xv_image,
                       0,0,1024,768,
                       0,0, 1024,768);
    if(crossHairDisplayed)
    // Draw Horizontal CrossHair                                                                                                                                                           
                XDrawLine(display, window, gc,
                          0,   (int)(DataSource::pixPerMicron*DataSource :: crossY + DataSource::zcenY),
                          1024,(int)(DataSource::pixPerMicron*DataSource :: crossY + DataSource::zcenY));
                // Draw Vertical CrossHair                                                                                                                                                             
                XDrawLine(display, window, gc,
                          (int)(DataSource::pixPerMicron*DataSource :: crossX + DataSource::zcenX), 0,
                          (int)(DataSource::pixPerMicron*DataSource :: crossX + DataSource::zcenX) , 768);
    }In this code bit, the crosshairs should move when the DataSource object changes member variables, line CrossX. But, the old crosshairs would not go away until the window was moved or resized. I'd get two crosshairs on the screen. I had to use a hack from the xwindows utility xrefresh everytime the crosshairs changed. It essentially simulated an x-window that opened over the Qt window, and then immediately closed. This worked well, but I thought I'd be free of that hack when I moved to java and JNI. Isn't this bizarre? Why would the window hold on to the old crosshair even when the varialbes change and there isn't any code that repaints it there after the video frame gets blitted?
    hack adapted from xrefresh.c:
          if(newCrossHair)
                              Visual visual;
                      XSetWindowAttributes xswa;
                      Display *dpy;
                      unsigned long mask = 0;
                      int screen;
                      Window win;
                      if ((dpy = XOpenDisplay(NULL)) == NULL) {
                        fprintf (stderr, "unable to open display\n");
                        return;
                      screen = DefaultScreen (dpy);
                      xswa.background_pixmap = ParentRelative;
                      mask |= CWBackPixmap;
                      xswa.override_redirect = True;
                      xswa.backing_store = NotUseful;
                      xswa.save_under = False;
                      mask |= (CWOverrideRedirect | CWBackingStore | CWSaveUnder);
                      visual.visualid = CopyFromParent;
                      win = XCreateWindow(dpy, DefaultRootWindow(dpy), 400, 600, 1, 1,
                                          0, DefaultDepth(dpy, screen), InputOutput, &visual, mask, &xswa);
                      XMapWindow (dpy, win);
                      /* the following will free the color that we might have allocateded */
                      XCloseDisplay (dpy);
                      newCrossHair = false;
          } Any ideas? There's probably just some type of refresh call I need to use.
    --Ismail                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • I have Photoshop CS6 Extended Students and Teachers Edition.  When I go into the Filter/Oil paint and try to use Oil paint a notice comes up "This feature requires graphics processor acceleration.  Please check Performance Preferences and verify that "Use

    I have Photoshop CS6 Extended Students and Teachers Edition.  when I go into the Filter/Oil paint and try to use Oil Paint a notice comes up "This feature requires graphics processor acceleration.  Please Check Performance Preferences and verify that "Use Graphics Processor" is enabled.  When I go into Performance Preferences I get a notice "No GPU available with Photoshop Standard.  Is there any way I can add this feature to my Photoshop either by purchasing an addition or downloading something?

    Does you display adapter have a supported  GPU with at least 512MB of Vram? And do you have the latest device drivers install with Open GL support.  Use CS6 menu Help>System Info... use its copy button and paste the information in here.

  • Non-modal JDialog is not painted and blocks the GUI

    I have developed a GUI that's basically a JFrame with a JDesktopPane.
    The user can, via a menu item, pop up a JDialog that contains some JLists and then select some value from it. Once he/she has done the selection and clicks on OK, the dialog disappears (data processing is then done in the main GUI) and comes back once a specific event has happened. The user then selects other data and so on, until he/she clicks on Cancel, which definitely disposes of the JDialog.
    The graphics of the JDialog are build in the class constructor, which does a pack() but does not make the dialog visible yet. The dialog appears only when doSelection() is called.
         /** Called the first time when user selects the menu item, and then
         when a specific event has happened. */
         public Data[] doSelection() {
              dialog.setVisible(true);
              // ... Code that reacts to user's input. Basically, the ActionListener
              // added to the buttons retrieves the user's selection and calls
              // dialog.setVisible(false) if OK is clicked, or calls dialog.dispose()
              // if Cancel is clicked.
         }Now, everything works fine if the JDialog is modal, but if I make it non-modal only the window decorations of the JDialog are painted, and the control doesn't return to the main GUI. Calling doLayout() or repaint() on the doSelection() has no effect. How can this be fixed?
    I hope I have been able to explain the problem satisfactorily, I could not create a suitable SSCCEE to show you. Thanks in advance for any hint.

    Ok, I've taken some time to think about this problem and I've modified the code a bit.
    Now the dialog shows itself and is responsive (i.e. its JLists can be operated), but the Ok button does not close the dialog as I'd want. I believe that I'm messing up things about threading, and the operations in actionPerformed() should be carried out in another thread, if possible.
    Thanks in advance for any hint / suggestion / comment / insult.
         private Data[] selection;
         /** Constructor */
         public MyDialog() {
              // ... Here is the code that builds the dialog...
              dialog.setModal(false);
              dialog.pack();
              // Note that the dialog is not visible yet
         public Data[] doSelection() {
              operatorAnswer = NONE_YET;
              dialog.setVisible(true);          
              while (operatorAnswer == NONE_YET) {
                   try {
                        wait();
                   } catch (InterruptedException e) { }
              return (operatorAnswer == OK ? selection : null);
         public void actionPerformed(ActionEvent evt) {
              if (okButton.equals(evt.getSource())) {
                   operatorAnswer = OK;
                   retrieveSelection();
                   dialog.setVisible(false);
              else if (cancelButton.equals(evt.getSource())) {               
                   operatorAnswer = CANCEL;
                   dialog.dispose();
         private void retrieveSelection() {
              // ... Here is the code that retrieves selected data from the dialog's JLists
              // and stores it in the "selection" private array...
              notifyAll();
         }

  • How can I export an image from Illustrator same canvas size and custom resolution?

    Hey all.  i am using Adobe Illustrator CS5 for creating images for iPhone app icons the size of image 374 px 374 px and 264 ppi. i created an image same size and ppi .the problem after export the image file size changing to  1371px x 1371px and 264 ppi pixel dimension.How can I export same canvas size and same resolution file from illustrator

    10111980,
    If you just forget about PPI and use Save for Web, you will get the 374 x 374 pixel size.
    The 1371 x 1371 pixels is because you somehow increase the resolution by 264/72.
    You should never mix pixel by pixel sizes and PPI.
    The 374 x 374 pixels is the actual image size. At 264 PPI that will be about 1.417 inches. At 72 PPI that will be about 5.194 inches.

  • Report painter  and drill down reports

    Hi SAP gurus,
                   Can any froward configuration of  report painter  and drill down reports.
       iassign points

    Hiii Sai Krishna,
    can u forward the same documentation to me..plsss
    my mail id - [email protected]
    thanks in advance
    regards
    ramki

  • Difference between Report painter and abap query .

    can anyone please tell me the difference between the report painter and the ordinary alv,clasical reporting and also the difference between Report painter and abap query. How the output format will be in Report painter. If anyone has any documents please send it to
    [email protected]
    Thanks,
    Joseph.

    hi,
    ABAP Query is an ABAP Workbench tool that enables users without knowledge of the ABAP programming language to define and execute their own reports.
    In ABAP Query, you enter texts and select fields and options to determine the structure of the reports. Fields are selected from functional areas and can be assigned a sequence by numbering.
    link for abap query --
    https://forums.sdn.sap.com/click.jspa?searchID=221911&messageID=2790992
    whereas the Report Painter enables you to report on data from various applications. It uses a graphical report structure that forms the basis for the report definition. When defining the report, you work with a structure that corresponds to the final structure of the report when the report data is output.
    link for report painter --
    https://forums.sdn.sap.com/click.jspa?searchID=221874&messageID=1818114
    Regards,
    pankaj singh
    Message was edited by:
            Pankaj Singh
    Message was edited by:
            Pankaj Singh

  • Report Painter and Report Writer (URGENT)

    Hi All,
         Please can you send me Step by Step screen shots Configuration document for Report Painter and Report Writer,
    If any body send relavent data i will give reword points,
    Regards,
    TML

    Hi,
    see the below link cfor complete documentaion of report painter.
    http://www.virtuosollc.com/PDF/Get_Reporter.pdf
    Thanks.

  • Report Painter and Report Query

    Hi,
    Can some body explain me the difference between Report painter and report queries. How these are diffrent from ABAP prgram and ABAP queries. Who are the persons who are using all these like functional consultant or ABAPer or End users.
    Regards
    RKG.

    Hi
    Report Painter is mainly used by CO functional consultants for generating reports using variables, Key fugures and sets. This is a SAP standard functionality.
    ABAB Queries / Report queries are created by Abapers and Functional consultants , this is mainly to join two or more tables run a query on the available data in the table and get the reports
    ABAP program are complete program which are the coding language of SAP, where a program can be created for a new functionality which is not available in SAP . However the data required for this program has to available in SAP.
    Anand

  • Report painter and drilldown

    Dear Friends
    Please send steps for Report painter and drilldown report how to do
    Regards
    JK
    Moderator: Step 1 - search before posting

    diff b/w normal reports and interactive reports
       Normal report contains only one output screen
      Interactive reports contains 0-20 screens.
    sometimes client requirement is whenever we perform action
    on outputscreen it will goes to next screen there we will display the complete details of thet particular field.

  • Screen Painter and Menu Painter Translations

    Hello All,
    I want to translate the Screen painter and Menu Painter Objects .
    When I go to the SE41 and select the PF Status of my Program and press change Button I'm getting the following msg :
    Make repairs in foreign namespaces only if they are urgent .
    If I press Ok and select the Menu path : Goto --> Translation .
    The Translation options is in deactivated mode.
    How to do the Translation now ?
    Regards,
    Deepu.K

    Hi
    Run trx SE63, then go to: Translation->Short Texts->Screen Painter
    Choose:
    - Header to translate the title of attribute of the screen;
    - Texts   to translate the label of the input/ouput fields
    Translation->Short Texts->User interface to translate the menu
    Max

  • Screen Painter and tables

    I have created a Table Control in a Screen Painter and I need help to fill it.
    I assign to the Table Control a field of an internal table but when I try to activate it i receive the followin error:
    The field "XXXX-XXXX" is not assigned to a LOOP. "LOOP...ENDLOOP" must apper in PBO and PAI
    Can u help me?
    Thanx in advance

    Hi Jose,
    Refer the below code for clarification.
    Regards,
    Raj
    *& Module pool ZTESTRAJ_TABLECONTROL *
    PROGRAM ztestraj_tablecontrol .
    TABLES mara.
    CONTROLS : tc1 TYPE TABLEVIEW USING SCREEN 100.
    TYPES : BEGIN OF t_mara,
    matnr TYPE mara-matnr,
    mtart TYPE mara-mtart,
    mbrsh TYPE mara-mbrsh,
    meins TYPE mara-meins,
    lsel TYPE c,
    END OF t_mara.
    DATA : it_mara TYPE STANDARD TABLE OF t_mara WITH HEADER LINE,
    it_mara1 TYPE STANDARD TABLE OF t_mara WITH HEADER LINE,
    cols LIKE LINE OF tc1-cols.
    DATA : v_lines TYPE i,
    lsel,
    v_fill TYPE i,
    v_limit TYPE i.
    DATA : fg_set TYPE c VALUE ''.
    DATA : ok_code TYPE sy-ucomm,
    save_ok TYPE sy-ucomm.
    CONSTANTS : c_mtart(4) TYPE c VALUE 'FERT'.
    *& Module STATUS_0100 OUTPUT
    text
    MODULE status_0100 OUTPUT.
    SET PF-STATUS 'SCREEN_100'.
    SET TITLEBAR 'RAJ'.
    IF fg_set = ''.
    SELECT matnr
    mtart
    mbrsh
    meins
    FROM mara
    INTO TABLE it_mara
    WHERE mtart = c_mtart.
    DESCRIBE TABLE it_mara LINES v_fill.
    v_lines = v_fill.
    fg_set = 'X'.
    ENDIF.
    IF fg_set = 'X'.
    EXIT.
    ENDIF.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Module fill_table_control OUTPUT
    text
    MODULE fill_table_control OUTPUT.
    READ TABLE it_mara INTO it_mara1 INDEX tc1-current_line.
    ENDMODULE. " fill_table_control OUTPUT
    *& Module cancel INPUT
    text
    MODULE cancel INPUT.
    LEAVE PROGRAM.
    ENDMODULE. " cancel INPUT
    *& Module read_table_control INPUT
    text
    MODULE read_table_control INPUT.
    v_lines = sy-loopc .
    it_mara1-lsel = lsel.
    MODIFY it_mara FROM it_mara1 INDEX tc1-current_line.
    ENDMODULE. " read_table_control INPUT
    *& Module USER_COMMAND_0100 INPUT
    text
    MODULE user_command_0100 INPUT.
    ok_code = sy-ucomm.
    save_ok = ok_code.
    CLEAR ok_code.
    CASE save_ok.
    WHEN 'NEXT_LINE'.
    tc1-top_line = tc1-top_line + 1.
    v_limit = v_fill - v_lines + 1.
    IF tc1-top_line > v_limit.
    tc1-top_line = v_limit.
    ENDIF.
    WHEN 'PREV_LINE'.
    tc1-top_line = tc1-top_line - 1.
    IF tc1-top_line < 0.
    tc1-top_line = 0.
    ENDIF.
    WHEN 'NEXT_PAGE'.
    tc1-top_line = tc1-top_line + v_lines.
    v_limit = v_fill - v_lines + 1.
    IF tc1-top_line > v_limit.
    tc1-top_line = v_limit.
    ENDIF.
    WHEN 'PREV_PAGE'.
    tc1-top_line = tc1-top_line - v_lines.
    IF tc1-top_line < 0.
    tc1-top_line = 0.
    ENDIF.
    WHEN 'LAST_PAGE'.
    tc1-top_line = v_fill - v_lines + 1.
    WHEN 'FIRST_PAGE'.
    tc1-top_line = 0.
    WHEN 'DELETE'.
    READ TABLE tc1-cols INTO cols
    WITH KEY screen-input = '1'.
    IF sy-subrc = 0.
    LOOP AT it_mara INTO it_mara1 WHERE lsel = 'X'.
    DELETE it_mara.
    fg_set = 'X'.
    ENDLOOP.
    ELSE.
    fg_set = ''.
    ENDIF.
    WHEN 'INSERT'.
    LOOP AT it_mara INTO it_mara1 WHERE lsel = 'X'.
    INSERT INITIAL LINE INTO it_mara INDEX sy-tabix.
    ENDLOOP.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    WHEN 'EXIT'.
    LEAVE TO SCREEN 0.
    WHEN 'JADOO'.
    READ TABLE tc1-cols INTO cols
    WITH KEY selected = 'X'.
    IF sy-subrc = 0.
    cols-invisible = '1'.
    MODIFY tc1-cols FROM cols INDEX sy-tabix.
    ENDIF.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT

  • Difference between Reaport Painter and Report Writer

    HI All,
    What is the Difference between Report painter and Report Writer
    regards
    JK

    Hi
    Report Painter allows the user to report on data from various applications using graphical report structure which forms the basis for report.
    Report Writer allows the user to report on data from multiple applications using functions such as sets, variables, formulas, cells, key figures and the user can create more complex reports as per clients requirements.

  • Increasing canvas size and re-clipping (intentionally)

    Hi,
    So I bolluxed up a little bit while creating my first full-bleed print piece. I used Ps to edit the image, Ai to add some stuff, and ignored Id completely for the printer. Now I have a perfect 8.5 x 11 image that I want to print all the way to the edges without scaling; I left white bleeds 1.8" but apparently that won't suffice.
    I'm trying to go back into photoshop and increase the canvas size (8.75 x 11.25 to include bleeds), and with it, extend the image that was originally clipped when I trimmed the document from a vertical picture (12 x 16 or whatever) to fit the standard letter paper size. When I do that, I get only white areas around the canvas.
    Can anyone provide a solution to create full-color bleeds the way they should have been done originally? I have tried changing the canvas size and re-placing another layer of the image behind the existing one (with the hopes that it would clip automatically), but it didn't work. At this point, should I worry about bringing anything into InDesign?
    Thanks,
    - boda

    The Nish Adeel,
    > i wants to increase my fla canvas size from all sides...
    when we
    > increase the size of a file it increases from right and
    bottom , i
    > want to make it from all four sides like photoshop ...
    is there any
    > way to do this.
    There is a way to do this; unfortunately, it's not an
    automatic feature
    like in Photoshop. The approach you'll need to take is to
    update the
    document dimensions (basically, the canvas size) as desired,
    then use the
    Edit Multiple Frames button on the lower left of the Timeline
    panel to
    manually move all assets on the main timeline. To do this,
    you'll have to
    make sure all layers are unlocked. To do this quickly, click
    the
    Lock/Unlock All Layers button at the top, between the eye and
    the square
    buttons, until you see that all locks have been removed (one
    or two clicks
    will do it). In the Modify Onion Markers button next to the
    Edit Multiple
    Frames button, choose Onion All. Select Edit > Select All,
    then use the
    arrow buttons to move your assets.
    David Stiller
    Co-author, Foundation Flash CS3 for Designers
    http://tinyurl.com/2k29mj
    "Luck is the residue of good design."

  • Canvas children and mouseOver

    Simply put, I have a repeating canvas that contains buttons,
    an image, and a text field. When the user rolls their mouseOver the
    canvas, a child canvas becomes visible with buttons inside of it.
    Works great when you make sure that the mouse stays only over true
    canvas area and not over a child inside of the canvas. If it falls
    over a child, it fires the mouseOut and the buttons become
    invisible. Essentially, you can't click on the buttons because they
    are a child and the mouseOut goes off, making them invisible! How
    can I keep the mouseOver alive, even over a child?
    Thanks!

    check the parent of the event "target", not the parent of the
    event.
    In Flex, events can possibly participate in three phases:
    1) cascading phase as the event goes from the top of the
    display list through all parents of the control that dispatched the
    event.
    2) targeting phase, as the event goes through the target, the
    control that dispatched the event.
    3) bubbling phase as the event goes back up the display list
    through parents of the control that dispatched the event.
    - not all events bubble
    - you may need to add an event listener twice, and have the
    arg to addEventListener for bubbling to true and then false if you
    want to listen during cascading and bubbling phases.
    Now you are probably confused, so ignore some of what I said,
    and concentrate on listening to mouseOver events in the Cnavas, and
    then when the event handler is called, examine the target and
    possibly currentTarget properties of the event object to see if it
    is the child of the Canvas, and then act as appropriate.

Maybe you are looking for

  • Slow Vi using analog I/O

    Hello, I'm having issues fixing my labview code to have an efficient response time. I tried multiple things to fix my issue, but can't seem to find a solution. I'm not as comfortable with LabVIEW as I am with other coding languages so troubleshooting

  • I get sound no video when using AirPlay.  Any ideas?

    I get sound no video when using AirPlay.  Any ideas?

  • Customer want to decrease the Value of AUC

    Hi, Expert They want to decrease the value of AUC and post it to other GL account. Dr  other balance sheet account Cr  AUC What Transaction type i need be be used? The value decrease is just apart of AUC 's value. Thank you very much for helping.

  • Source system for FLATFILE

    When I right click on the source system FLATFILE, I don't see the 'Replicate datasources' option. Would this be a problem because I am getting an error on the transports: <i>No mapping defined for source system FLATFILE When transporting InfoPackages

  • Suddenly not authorized to transfer music to my iPhone

    Using same account as always, checked settings, when I sync my iPhone I get a message that some music can't be downloaded to my iPhone because I am not authorized. I just bought these songs and albums on iTunes. What's going on?