Selection Area in an OpenGL GLAnimCanvas

Hi,
I need to make an selection area by clicking and draging with the mouse. I have an GLAnimCanvas (Open GL canvas object) that is inherited from java.awt.Canvas.
I have an addMouseMotionListener() and an addMouseListener() that detects correctly the events on the GLAnimCanvas... But I don't know how to display the rectangle of the selection area dragging with the mouse...
I tried with the example I found on the sun site (http://java.sun.com/docs/books/tutorial/uiswing/painting/overview.html#repaint)
but it seems that there is a problem with the paintComponent(Graphics g) method...
Is there anybody who has an idea ??
Thank you in advance
Mat

You may want to use openGL calls instead of
java.awt.Graphics otherwise you would lose hardware
acceleration for drawing the box. These calls would
be made within gl4java's GLAnimCanvas display()
method. Basically, if your GLAnimCanvas implements
MouseListener and MouseMotionListener you can change
the box coordinates within the appropriate method
(e.g. mouseDragged, mousePressed) and have the box
rendering code within display()Not necessarily. Java2D is accelerated in version 1.4

Similar Messages

  • Drag Selection Area implementation

    Hello,
    I'm trying to implement a "drag selection area"
    functionality, like a clipping style. Where user will draw a
    rectangle on top of a series of sprites, and that will perform an
    action to those sprited whitin the rectangle.
    I was wondering how it would be best to implment it? In
    terms of performance.
    I was thinking of using the .containsPoint() of the
    Rectangle, however, that means I have to do lots os calculations as
    my sprites are lines drawn all over the screen. So, calculating the
    intersection points for all lines would not be good...
    Is there a way to get the sprites or elements that are drawn
    "behind" the rectangle? since this lines are sprites and they are
    drawn before the rectangle I thought that will be a better way of
    getting the "selected" items?
    Marcela

    You may want to use openGL calls instead of
    java.awt.Graphics otherwise you would lose hardware
    acceleration for drawing the box. These calls would
    be made within gl4java's GLAnimCanvas display()
    method. Basically, if your GLAnimCanvas implements
    MouseListener and MouseMotionListener you can change
    the box coordinates within the appropriate method
    (e.g. mouseDragged, mousePressed) and have the box
    rendering code within display()Not necessarily. Java2D is accelerated in version 1.4

  • I have 4 equal oblong shape created with borders How do I go about knowing what size the selection area is so that I can crop an image to fit. I don't want to use paste in then adjust the bounding box to suit

    I have 4 equal oblong shape created with borders How do I go about knowing what size the selection area is so that I can crop an image to fit. I don't want to use paste in then adjust the bounding box to suit

    What do you mean a moderator

  • Updated iPad 2 last night.  All movies (9) on my iPad can no longer be viewed.  The movie plays but the photos and scene selection are blank. How do I fix this

    Updated iPad 2 last night.  All movies (9) on my iPad can no longer be viewed.  The movie plays but the photos and scene selection are blank. How do I fix this

    Quit the app and restart the iPad.
    In order to quit or close apps - Go to the home screen first by tapping the home button. Quit/close open apps by double tapping the home button and the task bar will appear with all of you recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner to close the apps. Restart the iPad. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Try the videos app again.

  • Sudden loss of print selected area in Photoshop 10.0.1?

    Between printing one image and printing the next I seem to have lost the ability to print a selected area in Photoshop 10.0.1. I am using this old program because the new Photoshop does not have that option. The box is now greyed out. Does any know why I could lose this, and what can I do to get it back? This is extremely important to my work method...
    Thank you.
    Mary Challinor

    Great news! "Print Selected Area" was restored in Photoshop CS6.
    Go to File > Print, scroll down in the dialog box that appears, et voila:

  • Adobe Acrobat 9 supposedly allows you to convert selected areas of a web page to PDF from within Int

    Software: Adobe Acrobat 9 Standard
    Issue: Using the ‘Adobe PDF toolbar’ from within Internet Explorer
    Problem #1:
    Can’t convert selected areas of a web page to PDF
    When you click ‘select’ on the adobe pdf toolbar, a red dotted line is supposed to appear around parts of the web page as you move the cursor
    In my case, that’s not happening
    Similarly, when you click on a part of the page, the part is supposed to be highlighted in blue
    In my case, that’s not happening
    Problem #2:
    Can’t convert part of a web page to PDF
    You’re supposed to use the cursor to select text and images on a page, then right-click and convert them to a PDF
    In my case, nothing happens when I right-click
    Any advice??

    You can not do that using Adobe Acrobat 9. Adobe never made a create PDF add-on for Firefox for use with Adobe Acrobat 9. They created a Firefox add-on for use with Acrobat X, but currently that one does not work with Firefox 4 though Adobe are working on an update.

  • [JS CS4] define a selection area

    Hi all,
    I have to isolate repetitive areas in documents of hundreds of pages. My intention is to select the items located in this area.
    I wrote a while ago a script to find an item at xy location but this time, x & y will always be different and I can't imagine trying to catch items randomly until the script finds something.
    So I thought that maybe I could mimic the selection arrow and drag a selection area from x1y1 to x2y2 to select what's inside that field. My first guess is that js is not enough to do that so I guess it's more c++ related but I am not even sure.
    Does someone have any clue on that ?
    TIA
    Loic

    Piece of cake, Loic.
    selectInRectangle (app.activeWindow.activePage, 5,10, 120,100);
    // Maybe x,y,wide,high would work better?
    function selectInRectangle (source, x1,y1, x2,y2)
         var it;
         app.select(null);
         for (it=0; it<source.pageItems.length; it++)
         //     Only select all inside:
              if (source.pageItems[it].geometricBounds[0] >= y1 &&
                   source.pageItems[it].geometricBounds[1] >= x1 &&
                   source.pageItems[it].geometricBounds[2] <= y2 &&
                   source.pageItems[it].geometricBounds[3] <= x2)
                   source.pageItems[it].select (SelectionOptions.ADD_TO);

  • Print only cursor-selected area of a PDF in Acrobat Pro, just as it is psbl to do in a browser

    Hi
    I want to print only cursor-selected area of a PDF in Acrobat Pro. That could be both text and images, which are in my selection. Just as it is psbl to do in a browser. Is it possible in Acrobat PRO?
    I am using the latest Acrobat Pro 11.0.9

    Thanks for your effort but this again clearly does NOT answer my question. I do see a particular problem and that is that I might want to select text and images over a range of multiple pages. In a doc of 20 pages I might want to make a single selection of the text starting PRECISELY at the MIDDLE of page 2 and then continue dragging my selection all the way to PRECISELY the MIDDLE of page 15, thereby selecting all text and images within the precise range of my selection. That is some 13 pages there and I want to print out ONLY THAT selection of text and images. And in that case I cannot use your suggestion with the marquee zoom. Do you get me?

  • I'd like to download a film in English but all films in my iTunes film selection are with Italian audio. I live in Italy of course but is there any way to download films in English language format?

    I'd like to download a film in English but all films in my iTunes film selection are with Italian audio. I live in Italy of course but is there any way to download films in English language format from Italy?

    Click here and follow the instructions to change the iTunes Store country. You’ll need to provide an Italian payment method.
    (110156)

  • In the app search, the selections are hard to move right to left why?

    in the app search, the selections are hard to move right to left why?

    I doubt it was either.  As I suggested the possiblity the two issues were related.  One of a number things could have been the cause, and the solution.
    It took me several minutes to finalize my post in which during that time Apple could have very easilty got things back up and running.  The two issues could have been unrelated.
    Chamar - tt also appears you posted a screen shot from the Mac App store.  The link I provided was specifically for the online "Apple Store"  - not "App" store. 
    And again, as it's been an issue in the past - I suggested the two issues may have been related;  it usually is, because your Apple ID is tied to "everything Apple" - Mac App store, iCloud, FaceTime, iTunes, Apple Store online, and even here, including the forums... "everythig Apple."
    I even tried to get onto Apple Store online through the App on my iPhone.  I get the exact same screen shot I placed in my original post.  At any rate... everything is back up and running.

  • Elements 7 print selected area only

    Have just upgraded from Elements 4 to 7.
    Under old version I could easily print a small rectangular selection from a possible A3 print for evaluation before printing the whole thing. There was an option after File>Print to 'Print selected area', after first making a rectangular selection on the image.
    Perhaps I am missing something but I cannot find an equivalent command in Elements 7.
    Couls someone please enlighten me? - Thanks.

    Hello Nicole,
    Thanks for that, it seems strange that such a useful feature was discontinued - A3 size paper and ink is too expensive to just run tests. Once or twice, having marked a selection using the Marquee tool, I have found that if I click on 'custom' size the selection only will appear in the print preview. Unfortunately it does not always happen and I have no idea of the criteria required to make it do this on demand.
    Cheers.

  • How to sort only a selected area?

    I'm trying to sort only a selected area (4 of my 5 columns) and not the entire table. Numbers help is worthless and nothing I've tried works. Any thoughts?

    What Yvan says, with additions.
    As well as copying the data to a second table, sorting it there, then pasting it back into the original table, Numbers lets you select and drag one or more columns from a table, then drop it on the sheet, where it will automatically become a new table.
    Here's an example:
    This is the original 10 column table. We wish to sort columns E, F and G into alphabetical order, while leaving the other columns in their original order. note the four locations where AAA, BBB, CCC and EEE appear in the same line.
    Click on any cell in column E. When the column tabs appear, select columns E, F and G by clicking on the E tab, then dragging to add to the selection.
    When the three columns are selected, click and hold on one of the three tabs, drag up until the columns separate from the table, then drag the selected columns to an empty space on the sheet. Drop to form a new three column table.
    If you now select column A on this table and Sort Ascending, the result will be as shown:
    Note that rows in the three columns moved together. If this is the result you are looking for, skip to the last step. If you want each of the three rows sorted individually, continue from here.
    To sort the three columns individually, each must be in a separate table. Separate them in the same manner as you did to separate the three column group from the original table: Select the individual column, then drag it's tab up until it separates, then left or right as appropriate and drop it to form a single column table. Take care to keep the separate columns in their original left to right order.
    Sort each column in turn.
    LAST STEP
    After sorting, drag each column (or the group of three if you did not sort the columns separately and individually) back to its place in the original table. Click on the temporary table to show the tab(s), Select the column(s), then click and drag a tab to move the column(s) to the original table. As you approach th place they came from, a double blue line will appear to show where the column(s) will be inserted if dropped. Drop at the appropriate location. If you are moving single columns, repeat until done.
    Finished. Note that each of the red columns is now in order. While AAA and BBB remain together, the other 'matched sets' no longer match.
    Regards,
    Barry

  • Is it possible to make changes on object selection area???

    Hi friends,
    I wanna ask a question about portal.
    When we connect to portal we choose corporate documents , there are files of departmants like hr, it, corporate general ...
    We want some changes in object selection area of these files. For example when we get into object selection area of IT there are objects like favorites, others, personel documents, common document, common documents.
    My question is
    Can we deduct or hide some of these objects from object selection area? If we can, how can we do it?
    Thanks
    Muzaffer Öz
    Edited by: Muzaffer Oz on Dec 2, 2011 9:31 AM
    Edited by: Muzaffer Oz on Dec 2, 2011 9:44 AM

    Hi,
    We can hide those options by implementing the Layoutsets. If you need to hide those options for standard admin user itself, then you need to change the standard Layoutsets, which is not recommended. These options are defined in the "Command Group" of the Layoutsets.
    You can Navigate to Layoutsets thru below path.
    Sys Admin -> System Configuration -> Knowledge Management ->Content Management -> User Interface -> Settings -> Layoutset
    Tweaking over the Layoutset Command group properties will hide the options which you mentioned.
    Thanks,
    Mahendran B.

  • Replacing Selected Areas with White Space

    I am using Acrobat version 8 on an XP Pro SP2 system.
    I have a PDF file. Certain selected areas I wish to replace with pure white space. How can I do that?

    You will find other ways which SEEM to remove blank material but avoid
    them like the plague since it is very easy to get back the hidden
    material. Redaction needs specialist tools. There is a plug-in, Redax
    from http://www.appligent.com/
    Aandi Inston

  • How to crop selected area?

    Is it possible to crop the selected area of a page, because now if i go to Tools>Pages>Crop it can only crop the area that is outside the selected area?
    Thanks!

    This delete the content inside the selected area but doesn't crop the area, but i guess i could use it.
    How can i add content from the clipboard and retain the format? I am trying to create pdf file with content that i copy from html pages but when i paste the text it paste it as plain text, doesn't keep the format. 

Maybe you are looking for