To paint a rectangle in a specific position of a specific colour --- help!

Hi,
i want to paint many 2D squares of colour "contrast" (which i have set previously and changes each time the 2D square is drawn so that many 2D square of different colours result) and i want to draw these 2D squares in a particular position.
my code so far is (in the Paint method: )
for(j = 0; j < max; j++)
for(k = 0; k < max; k++)
g2D.setPaint(new Color(contrast, contrast, contrast));
Rectangle2D r2 = new Rectangle2D.Float( j , k , 2 , 2 );
g2D.fill(r2);
}but this is in a class called "Second" which is called from the class where the main method is called "First". "First" may change the size and position of where the "Second" draws. how do i make sure it draws where i want it to?
thank you

i want to draw these 2D
squares in a particular position.
but this is in a class called "Second" which is
called from the class where the main method is called
"First". "First" may change the size and position of
where the "Second" draws. how do i make sure it
draws where i want it to?This seems to be a contradiction in goals here, care to explain it more fully?
Make a third class that sets everthing back the way you want before you call second. This is just a guess, because your statements of desire and implementation seem to contradict each other.

Similar Messages

  • Paint inside rectangle shape

    I am confused about following.  How to paint inside rectangle with paint brush without going outside my edges. 
    I create rectangle with rectangle tool and now i would like to use brush inside it but it keeps going outside.  How do i prevent that?
    is the only way to do that to use marquette tool? i tried that but cant seem to be able to select all of my shape. 
    Can someone give me some suggestions please

  • Painting a rectangle after clicking a JButton?

    Hi all,
    I'm developing an applet that when a button is clicked, a rectangle is painted over an image. The problem is that when I add the painting code in the mouseClicked() method, using Graphics2D.createGraphics(), etc., run the applet and click the button, nothing happens. So, how can I paint a rectangle over an image by clicking a JButton?
    Perhaps something like JPanel.validate(), I don't know...
    Any help would be appreciated.
    Thanks in advance.

    http://forum.java.sun.com/thread.jsp?forum=54&thread=529542&start=5

  • FM to get the date specific structural help

    I am working on structural help for Org id  for a selection screen parameter.
    I am using  FM RH_OBJID_REQUEST. It is giving the structure valid ion today. My requirement is to get the structure valid on given period in the above selection field.
    Please let me know is there any other way(other FM) to get the date specific structural help.

    Pass your dates to ORGBEG     & ORGEND                                                                               
    Description                                                                               
    This parameter only applies to the search function.                                                                               
    The parameters ORGEND and ORGBEG together determine the period in which          
         the organizational assignment data for positions is read. The entry in           
         ORGBEG specifies the start of the search period.                                                                               
    Value range                                                                               
    Allowed values are all dates smaller than the date in ORGEND.                                                                               
    Default                                                                               
    The default value is the smallest system date.                                                                               
    Function Module                                                                      
    ^Saquib

  • Counting pixels of a specific colour

    Hello.
    Can anyone tell me if it's possible to load an image into
    flash and count the pixels of a specific colour in that image?
    I'm trying to develop an application that loads images with a
    white background, then counts all the white pixels and returns the
    number of non-white pixels.
    I don't need a step-by-step explanation of how to achieve
    this (although I'd be immensely grateful if anyone would go to that
    trouble), for a now a simple yes or no, and perhaps a few clues
    would be plenty of help.
    Thanks in advance.

    Extract the bitmapData from the image you load in - this will
    be in Bitmap(loader.content).bitmapData. Then you can loop through
    the bitmapData pixels with BitmapData.getPixel() and keep a tally
    of white/non-white pixels.

  • Is there a way to use specific colours on gradient noise?

    Hi,
    I am hoping to make a radial gradient noise effect, but I would like to select the specific colours on the effect. I see that when you go to the gradient-maker tool and switch it to the noise option, there is no option to select the specific colours. Is there a different way to achieve this desired effect?
    Basically, I would like to make circular lines of colour from a specific colour set.
    Thanks!

    Hi again,
    Thanks again for your help. For example, I am starting with an image like this created in photoshop:
    Next, I will take indexed colours from this (probably 50 of them), and want to make an image like this but with only the 50 colours indexed:
    So in the end you get a "colour pie chart" like this:
    Anyway it sounds like there is not an automatic way to do this? Otherwise I will just overlay a template with the slices and manually fill in the colours--- but as there are many photographs in my project I was just hoping to find a quicker way to achieve this or something similar.
    If you have any further tips, let me know. Otherwise, thanks again for your input until now!

  • How can I call a specific search help from and still get all the tabs

    hello
    I use F4IF_FIELD_VALUE_REQUEST to display a specific search help from my program. This search help is included in a collective search help, but only the one specified search help is displayed.
    Is it possible to call the collective search help and display one specific search help ?
    Example: in CRM i have a collective search help BUPA. When F4 is issued from a customer field the search help "Search customer" should be displayed, and not the last search help which was activated - i.e.. "Search employee".
    best regards
    Peter Christiansen

    Hi,
    you can try some thing like this..
          CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
            EXPORTING
              TABNAME           = 'KNA1'
              FIELDNAME         = 'KUNNR'
              SEARCHHELP        = 'DEBI'
            TABLES
              RETURN_TAB        = LT_RETURN
            EXCEPTIONS
              FIELD_NOT_FOUND   = 1
              NO_HELP_FOR_FIELD = 2
              INCONSISTENT_HELP = 3
              NO_VALUES_FOUND   = 4
              OTHERS            = 5.
          IF SY-SUBRC <> 0.
            MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    Regards
    vijay

  • How to add text in .ai file and  set position, font, size and colour

    I want to place multiple lines of of text (individually) into .ai file and set size, font, colour and position for each.
    Preferably text should have origin in a single point (rather than be framed)
    Hope anyone can help me out.
    Thank you in advance.

    Here's what's in the Scripting Reference
    Creating and modifying text frames
    // Creates a document with text frames displaying path, area and point
    // text, changes the content of each frame then deletes the 2nd frame
    // create a new document
    var docRef = documents.add();
    // create 3 new textFrames (area, line, point)
    // Area Text
    var rectRef = docRef.pathItems.rectangle(700, 50, 100, 100);
    var areaTextRef = docRef.textFrames.areaText(rectRef);
    areaTextRef.contents = "TextFrame #1";
    areaTextRef.selected = true;
    // Line Text
    var lineRef = docRef.pathItems.add();
    lineRef.setEntirePath( Array(Array(200, 700), Array(300, 550) ) );
    var pathTextRef = docRef.textFrames.pathText(lineRef);
    pathTextRef.contents = "TextFrame #2";
    pathTextRef.selected = true;
    // Point Text
    var pointTextRef = docRef.textFrames.add();
    pointTextRef.contents = "TextFrame #3";
    pointTextRef.top = 700;
    pointTextRef.left = 400;
    pointTextRef.selected = true;
    redraw();
    // count the TextFrames
    var iCount = docRef.textFrames.length;
    var sText = "There are " + iCount + " TextFrames.\r"
    sText += "Changing contents of each TextFrame.";
    // change the content of each
    docRef.textFrames[0].contents = "Area TextFrame.";
    docRef.textFrames[1].contents = "Path TextFrame.";
    docRef.textFrames[2].contents = "Point TextFrame.";
    redraw();
    docRef.textFrames[1].remove();
    redraw();
    // count again
    var iCount = docRef.textFrames.length;
    Your are looking stuff with the pointTextRef.

  • Material specific ( urgent help required)

    hi abapers,
                       i have a problem in user exit, my client want the tcode me11 material specific,  in tcode mm02 he want to give the maximum value (commercial price 15rs.) at the time of creating info records(using me11 tcode) if an end user enter a value greater then the value of commercial price then they want a error message will appear for this condition ( entered value is grater then commercial price) and he don't want this report vendor specific.
    thnks
    pardeep

    Hi Pradeep,
    Below exits are for ME11  T-code you can select particular exit and write the code based on the MM02 fields. take the data base fields which you want to pick from MM02 and validate in ME11 by writing the code in exit.
    LMEDR001            Enhancements to print program
    LMELA002            Adopt batch no. from shipping notification when posting a GR
    LMELA010            Inbound shipping notification: Transfer item data from IDOC
    LMEQR001            User exit for source determination
    LMEXF001            Conditions in Purchasing Documents Without Invoice Receipt
    LWSUS001            Customer-Specific Source Determination in Retail
    M06B0001            Role determination for purchase requisition release
    M06B0002            Changes to comm. structure for purchase requisition release
    M06B0003            Number range and document number
    M06B0004            Number range and document number
    M06B0005            Changes to comm. structure for overall release of requisn.
    M06E0004            Changes to communication structure for release purch. doc.
    M06E0005            Role determination for release of purchasing documents
    ME590001            Grouping of requsitions for PO split in ME59
    MEETA001            Define schedule line type (backlog, immed. req., preview)
    MEFLD004            Determine earliest delivery date f. check w. GR (only PO)
    MELAB001            Gen. forecast delivery schedules: Transfer schedule implem.
    MEQUERY1            Enhancement to Document Overview ME21N/ME51N
    MEVME001            WE default quantity calc. and over/ underdelivery tolerance
    MM06E001            User exits for EDI inbound and outbound purchasing documents
    MM06E003            Number range and document number
    MM06E004            Control import data screens in purchase order
    MM06E005            Customer fields in purchasing document
    MM06E007            Change document for requisitions upon conversion into PO
    MM06E008            Monitoring of contr. target value in case of release orders
    MM06E009            Relevant texts for "Texts exist" indicator
    MM06E010            Field selection for vendor address
    MMAL0001            ALE source list distribution: Outbound processing
    MMAL0002            ALE source list distribution: Inbound processing
    MMAL0003            ALE purcasing info record distribution: Outbound processing
    MMAL0004            ALE purchasing info record distribution: Inbound processing
    MMDA0001            Default delivery addresses
    MMFAB001            User exit for generation of release order
    MRFLB001            Control Items for Contract Release Order
    AMPL0001            User subscreen for additional data on AMPL
    if you give me exact requirement and i can help you out.
    Thank you.
    Regards
    Ram

  • Product Specific Form - Help Needed

    I have a client who will be selling firearms and ammunition on a hunting site, along with other hunting products.
    I need to have a form specific for firearms and ammunition products that will be required to be filled out before that product firearm and or ammunition can be added to the cart. The laws in Canada are very strict about purchases of such product on the internet.
    How do I do this or is it even possible to have a form specific to these products pop up when add to cart is clicked?
    Thanks in advance

    Hello river east,
    I'm just spitballing here, but here is one option for this to work.
    Basically you would create a secure zone and if the user isn't signed in they wouldn't see the Add to Cart button.
    The js would look like this - http://jsfiddle.net/chaddidthis/uDmXj/1/
    As a part of signing up for the secure zone they have to accept the gun and ammo purchasing terms. You could have the link to the form on the large product page, sends them to either log in or sign up via the form they need to fill out. After then fill out the form they are sent back a page sending them back into the large product view they were on, and since they are signed in now the product will be able to add to cart.
    Maybe this will spark others to add on to this, but that is pretty much the only way I could think to accomplish the desired results.
    Hope it helps,
    Chad Smith | http://bcgurus.com/Business-Catalyst-Templates for only $7

  • Layer position misBehavior..!    -(  help ? )-

    On any of the various pages I'd been putting together recently, I get confusing responses.
    When I come back to verify link settings before publishing (locally), some of the links refuse to be positioned frontmost. Then I discover that a few of the other graphics in its neighborhood refuse to be directed backmost.
    I've seen so much of this 'misbehavior' that I've developed the pattern of changing the opacity of any questionable link -(back to almost full)- just to determine from it's coloring where in the layer hierarchy it's decided to settle.
    I tried duplicating another, properly behaving link, and changing its setting to the link I'd had to delete. That would only stay front most until it I'd moved it near the old position.
    My experience has been that a newly duplicated item, iWeb would deposit on the page as frontmost
    But these new links seemed to change their layer mind when they'd get close to the layer position they were replacing. Their now temporarily fully colored area would slide behind any item(s) in the current problem area.
    I've tried several workarounds - most of them from within the same page. But the only thing that seems to work consistently has been to select something similar from another page where they seemed to be behaving correctly. Then I'd copy them from there and paste them into the new page as a group and change any text or graphic components as necessary.
    It sure has become tedious keeping up with these iWeb neuroses.!
    Does anyone know why this might be happening..?
    -(my domain file size currently is around 16 mB, probably half of which is temp. archived graphics )-
    -( for the interim, totally publishing locally)-
    Has anyone a cure for this peripatetic behavior..?
    Is there any easier workaround..?
    Much advance appreciation for any tediosity relief.!
    G-4; 400/896   Mac OS X (10.4.7)  

    One way to do that would be to use two images: one blurred, one not. then use a mask to show and hide one or the other. You can probably adapt this example file: http://www.ddg-designs.com/downloads/mask.zip

  • Specific Colour changing Script from RGB to CMYK

    I need to change the RGB values (imported from word) to specific CMYK values in Indesign (its not a straight swop) so I need a script or a similar plug-in that enables me to input the colour values for the CMYK so they automatically change.... the doc i work on is huge and im importing from a word file many times so i need to save time!!
    Can anyone help me?
    Thank you!

    Hi Phil... Hmmm not sure if i explained myself! Or maybe I am being thick.... I tried the new code but im not sure I was clear on my problem?
    This is the current code i use to change the RGN values to the CMYK is: I have entered the RGB and CMYK values as they need to be changed and it works but the swatch pallette ends up looking messy! See below.
    var myIDOc = app.activeDocument;
    var mySwatch = myIDOc.swatches;
    for (var j=4; j<mySwatch.length; j++){
        try{
             if(mySwatch[j].space ==ColorSpace.RGB){
                 if(mySwatch[j].name=="Word_R122_G75_B153"){// may be this is correct you can check the indesign swatches name
                     mySwatch[j].model=ColorModel.PROCESS;
                     mySwatch[j].space = ColorSpace.CMYK;
                     var myCV = mySwatch[j].colorValue=[48,72,0,0];
                     mySwatch[j].name = "C=" + myCV[48] + " M=" + myCV[72] +" Y=" + myCV[0] + " K=" + myCV[0];
             }catch(e){alert(e)}
    var myIDOc = app.activeDocument;
    var mySwatch = myIDOc.swatches;
    for (var j=4; j<mySwatch.length; j++){
        try{
             if(mySwatch[j].space ==ColorSpace.RGB){
                 if(mySwatch[j].name=="Word_R255_G0_B255"){// may be this is correct you can check the indesign swatches name
                     mySwatch[j].model=ColorModel.PROCESS;
                     mySwatch[j].space = ColorSpace.CMYK;
                     var myCV = mySwatch[j].colorValue=[0,100,0,0];
                     mySwatch[j].name = "C=" + myCV[0] + " M=" + myCV[100] +" Y=" + myCV[0] + " K=" + myCV[0];
             }catch(e){alert(e)}
      var myIDOc = app.activeDocument;
    var mySwatch = myIDOc.swatches;
    for (var j=4; j<mySwatch.length; j++){
        try{
             if(mySwatch[j].space ==ColorSpace.RGB){
                 if(mySwatch[j].name=="Word_R0_G0_B255"){// may be this is correct you can check the indesign swatches name
                     mySwatch[j].model=ColorModel.PROCESS;
                     mySwatch[j].space = ColorSpace.CMYK;
                     var myCV = mySwatch[j].colorValue=[100,0,0,0];
                     mySwatch[j].name = "C=" + myCV[100] + " M=" + myCV[0] +" Y=" + myCV[0] + " K=" + myCV[0];
             }catch(e){alert(e)}
      var myIDOc = app.activeDocument;
    var mySwatch = myIDOc.swatches;
    for (var j=4; j<mySwatch.length; j++){
        try{
             if(mySwatch[j].space ==ColorSpace.RGB){
                 if(mySwatch[j].name=="Word_R255_G255_B255"){// may be this is correct you can check the indesign swatches name
                     mySwatch[j].model=ColorModel.PROCESS;
                     mySwatch[j].space = ColorSpace.CMYK;
                     var myCV = mySwatch[j].colorValue=[0,0,0,0];
                     mySwatch[j].name = "C=" + myCV[0] + " M=" + myCV[0] +" Y=" + myCV[0] + " K=" + myCV[0];
             }catch(e){alert(e)}
      var myIDOc = app.activeDocument;
    var mySwatch = myIDOc.swatches;
    for (var j=4; j<mySwatch.length; j++){
        try{
             if(mySwatch[j].space ==ColorSpace.RGB){
                 if(mySwatch[j].name=="Word_R0_G0_B0"){// may be this is correct you can check the indesign swatches name
                     mySwatch[j].model=ColorModel.PROCESS;
                     mySwatch[j].space = ColorSpace.CMYK;
                     var myCV = mySwatch[j].colorValue=[0,0,0,100];
                     mySwatch[j].name = "C=" + myCV[0] + " M=" + myCV[100] +" Y=" + myCV[0] + " K=" + myCV[100];
             }catch(e){alert(e)}
      var myIDOc = app.activeDocument;
    var mySwatch = myIDOc.swatches;
    for (var j=4; j<mySwatch.length; j++){
        try{
             if(mySwatch[j].space ==ColorSpace.RGB){
                 if(mySwatch[j].name=="Word_R234_G229_B255"){// may be this is correct you can check the indesign swatches name
                     mySwatch[j].model=ColorModel.PROCESS;
                     mySwatch[j].space = ColorSpace.CMYK;
                     var myCV = mySwatch[j].colorValue=[8,10,0,0];
                     mySwatch[j].name = "C=" + myCV[8] + " M=" + myCV[10] +" Y=" + myCV[0] + " K=" + myCV[0];
             }catch(e){alert(e)}
    The outcome is the swatch pallette attached:
    How do I incorporate the new code to make sure all the values are hopefully to end up looking similar to this!!??
    Thanks for all your time and effort helping me!
    babeanz

  • How to Create Positions ???? - Help me pls...

    Hi,
    This is my first q to this forum...
    Im a fresh SAP HR Cons.... I have problem in Creating positions in the Recruitment Module. Following is what I have done. Im using SAP R/3 4.7
    Personnel Mgmt -> Recruitment -> Workforce Reqs and Advt --> Create Positions.
    Here Im not able to enter the text of the position im creating... Pls let me know if the path is correct or if there is any alternate way to create positions.
    Cheers,
    Sri...

    Hi Sridhar,
    As per concept  - Recruitment Module is used to fill the positions which are vacant as defined in OM.
    In your case,
    first create the required position using PO13 or PPOM_OLD to create the position under the org.Unit , which you need.
    Th new Position  created by you will be given a 8 digit Obj.Key.
    And ensure that the Position's Staffing Status is marked as vacant, using the transaction - PPOME (basic Data tab).
    and then come to the recruitment module and create positions for the workforce Requirement and Advertisement, by entering the newly created Position id.
    As per IMG help
    A company's workforce requirements are represented in the Recruitment system by means of vacancies created and maintained by the user. A user can only create a vacancy if the positions available within the company have already been set up.
    Hope this clarifies your doubt.
    Regards,
    Raj

  • JPQL Query for specific usecase, help needed

    Does anyone knows how to write the JPQL query for this specific use case.
    Take 3 tables,
    Table 1 contains bids for many auctions (Bid table)
    Table 2 Contains many auctions (Auction Table)
    Table 3 contains many users (User Table)
    I need a query to retrieve all the highest bids per auction for a particular user.
    For example if the user has bidded on 10 auctions., but for each auctions has placed 3 bids each. Following the query, I would expect to get 10 bids back, each being the highest per auction.
    A Bid has a bid value that can be used for filtering.
    Thanks
    Peter

    It would be something like the JPQL version of 'select * from bids join auctions using (auction_id) where bids.userid = ? group by auctions.auction_id order by bids.amount desc'. But this is primarily an SQL question, and only secondarily a question as to how to translate that into JPQL, which should be straightforward.

  • Using a specific colour

    I want to replace one colour in an image with another specific one which I have the Hex code for. How do I do that? Thanks!

    No one has come across this problem before?
    Regards,
    Andi

Maybe you are looking for

  • Processing a data mining structure throws an error

    Processing a data mining structure throws an exception stating the following: "Errors in the OLAP storage engine: An error occurred while the 'IDK' attribute of the 'Test  IDK' dimension from the 'Project1' database was being processed." "Errors in t

  • Converting aac to mp3 for a cd

    Hello Is t possible to convert my iTunes library (aac format) to mp3 in order to burn a mp3-cd? I couldn't do it, iTunes tells me that none of the songs are in mp3 format. Do I have to bring all the cd's again to my library in mp3-format? There's 7 g

  • Can't create new projects in RoboHelp HTML 7

    When I try to create a new projects in RoboHelp HTML 7, the Projects Type field is blank on the New tab of hte New Project dialog box. I just bought this product after using the trial version for 30 days. I can open the projects I created before but

  • Can you sell Used Adobe Photoshop CS5 (Windows)software?

    I have no use for the Adobe Photoshop CS5 (Windows). Is it possible to sell the software on ebay? What about licenses? Thanks, John

  • Burning CD-Rs at 4X

    I have several Macs. Only one of them will burn CD-Rs at 4X. It's an imac 2.66ghz with a Pioneer superdrive. I prefer buring Audio CD-Rs at no faster than 4X becaue a lot of them are used as masters for repliation. I have much better luck and less er