How to fill polygon without using paint component ?

hello,
i have a class called "public class Arrow2DRhombus implements Shape" with the following constructor:
public Arrow2DRhombus(Point2D begin, Point2D end) {
        this.x1 = begin.getX();
        this.y1 = begin.getY();
        this.x2 = end.getX();
        this.y2 = end.getY();
        this.initArrow();the code for .initArrow():
private void initArrow(){
        int length = (int) Math.sqrt(Math.pow(Math.abs(x1-x2),2) +
                       Math.pow(Math.abs(y1-y2),2));
        length=length-19;
Polygon poly = new Polygon();
        poly.addPoint((int) x1,(int) y1);
        poly.addPoint((int) x1+ length,(int) y1);
          poly.addPoint((int) x1+ length+10,(int) y1+5);
          poly.addPoint((int) x1+ length+20,(int) y1);
          poly.addPoint((int) x1+ length+10,(int) y1-5);
          poly.addPoint((int) x1+ length,(int) y1);
        double rad = this.calcAngle((float) this.x1,(float) this.y1,(float) this.x2,(float) this.y2);
        AffineTransform tx = AffineTransform.getRotateInstance(rad,x1,y1);
        this.arrow = tx.createTransformedShape((Shape)poly);
    }is there a way i can fill the polygon "poly" with the code above .
i know that i can fill a polygon using when using paintcomponent(Graphics g)
but here how can i do it.
10x

I don't really understand the question. "Filling" a shape implies (to me) that you have a Graphics Object and are doing custom painting. So you would do this:
a) in the paintComponent() method of a component
b) in the paintIcon method of an Icon
c) by painting onto a BufferedImage
I'm sure there are other ways, but I don't think you just "fill" a Shape object.

Similar Messages

  • Graphics without using paint

    Hi!
    I want to draw somthing without using paint. Does anyone know how to do that?
    f.eks
    I want to call a function with some parameters, and then the function draws something for me with these parameters.
    Thanks for helping:)
    Best regards
    Stian

    Sure... You could use the function to generate an image file and load that using ImageIcon and pass that to a JLabel.
    But that's not going to work nearly as fast as just using paint.

  • How can I print without using Airprint

    How can I print without using Airprint - Can I assign a printer to the Ipod touch

    Go to the App store and purchase an appropriate app.  There are many apps that are for specific printer/printer manufacturers and general ones like Print Central.

  • HT5622 how to purchase apps without using credit cards

    how to purchase apps without using credit cards

    If they are available in your country, you can use Gift Cards. Basically a prepaid card of a specified amount you can redeem to your iTunes account to get the balance for it added to your account.
    Then you can use that balance to buy things in iTunes, iBooks, and App Stores.
    http://support.apple.com/kb/ht1574
    If available in your country, thye can be bought form most convenience and electronic stores.

  • Machinewise Stores and Spares Consumption without using PM Component

    Can anyone tell me how to track machinewise spares consumption without using SAP PM Component?

    Hi
    this is kalyan
    we can try with SAP/MM & WM Modules
    I  think so if u know the answer let me know toooooo..
    kalyan

  • How to split messages without using Message split (BPM)

    In file to file scenario how to split messages coming from file without using Message split (BPM)

    Thank you very much.

  • How can you type without using capitals at the beginning of a sentence?

    How can you type something without using a capital letter at the beginning of a sentence. It always automatically outs a capital letter and I don't want one because it could be a case sensitive password?

    Tap the Shift key to turn off caps

  • How to access data without using authorization variable in report?

    Hello All,
    I am using two varibles in report, without using exit varible in report how to get the data based values enter in the ohter variable.
    How to find the roles and display the data " with out using the concept called varible used in report"

    Sorry..for late response.
    Answers to your questions:-
    Previous day to current date.
    I tried to follow steps given in the following link but failed as we have Teradata as data source and I dont know how to write a syntax for teradata similar to what is explained by Dave.
    http://www.dagira.com/2007/08/22/dynamic-dates-part-i-yesterday-and-today/
    Regards

  • How to display content without using webcenter services - task flows?

    Good day!
    I wanted to create a portlet where I can display and update an xml content retrieved from UCM Content Server. How can I do this without using taskflows (webcenter services)?
    Thanks in advance!
    Keith

    Hey Keith,
    Since you are already using the getResponseAsString() method you have your GET_FILE call working. To get the xml file as the file itself you need to instead call the getResponseStream() method. This will get you an InputStream representing the response.
    Once you have the stream you can do the following (I assume you are on a jsp page or somewhere you have access to the HttpServletResponse):
    String contentType = serviceResponse.getHeader("Content-Type");
    InputStream xmlInputStream = serviceResponse.getResponseStream();
    OutputStream outStream = response.getOutputStream();
    response.addHeader("Content-Disposition", "attachment;filename=myXmlFile.xml");
    response.setContentType(contentType);
    StreamUtil.copyStream(xmlInputStream,outStream,true,true);
    The runthrough:
    1. get the content type of the file coming back form the GET_FILE call
    2. grab the file as an InputStream
    3. get the output stream representing the response
    4. add a header to the response to trigger the "download file" dialog
    5. set the content type of the response
    6. copy the input stream to the output stream to send the xml file to the browser
    Notes:
    -StreamUtil is part of the RIDC jar
    -use Content-Disposition = inline to tell the browser to try and render the file in it's window if it can.
    Hope that helps,
    Andy Weaver - Senior Software Consultant
    Fishbowl Solutions < http://www.fishbowlsolutions.com?WT.mc_id=L_Oracle_Consulting_amw >

  • How to Start Essbase without using OPMN in 11.1.2.1

    All,
    We have installed and configured Essbase 11.1.2.1 successfully on 64 bit AIX server. Now I need to know how to start the essbase without using OPMN?
    As we can start essbase using :-

<EPM_ORACLE_HOME>\user_projects\epmsystem1\bin\startEssbase.bat

; But this method will still use OPMN, if OPMN is not running it will first start up the OPMN processes and then start up Essbase.

    As we are not using Essbase clustering and so do not find OPMN more beneficial and moreover OPMN is not working properly to start any processes. so we just do not want to use OPMN in starting the essbase.
    is there any workaround to just skip the OPMN while starting/stopping/restart essbase?
    Thanks in advance,

    In 11.1.2.0 there was startEssbase.bat at <EPM_HOME>\user_projects\epmsystem1\EssbaseServer\essbaseserver1\bin\startEssbase.bat

    which basically just called setEssbaseEnv.bat which sets a number of variables, one being %ESSBASEPATH% which points to <EPM_HOME>\EPMSystem11R1\products\Essbase\EssbaseServer
    Then called %ESSBASEPATH%\bin\essbase.exe
    This bypasses opmn
    Now in 11.1.2.1 Oracle removed <EPM_HOME>\user_projects\epmsystem1\EssbaseServer\essbaseserver1\bin\startEssbase.bat

    but still left setEssbaseEnv.bat, it is possible to call setEssbaseEnv.bat and then %ESSBASEPATH%\bin\essbase.exe
    Essbase starts up fine and bypasses opmn.
    I would have thought it would be possible on other OS types as long as the environment variables are set first being starting up essbase.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to save requisitions without using E-Recruiting

    Hello All,
    Is there a way, to save requisitions data without using the E-Recruiting Web pages?
    Is there a Function module or a Class or a BAdI that I can use?
    We want to use a Interface that will send a flat fille with a lot of data
    and then to handle it in the same way the SAVE button on E-Recruiting does...
    Any Suggestions?
    Best Regards,
    Eran
    SAVE THE DATE 01-01-2011 ****

    Hi Roman,
    The flat file will come from other systems .
    It will store Requisitions details and the program/interface will have to proccess these records and create or update the infotypes according to them...
    Someone told me that it would be a bad thing to use classes and pointed out that there are FM like RH_* that wiil do the same
    I tried to use FM 'RH_INSERT_INFTY'  just to see if any record was entered ,but nothing happened...
    HRP1000 didn't get the new record
    What did I do wrong? What is the right way? FM's or Classes?
    Best Regards,
    Eran
    DATA: X1000 LIKE P1000 OCCURS 1 WITH HEADER LINE.
    X1000-MANDT = SY-MANDT.
    X1000-PLVAR = '01'.
    X1000-OTYPE = 'NB'.
    X1000-INFTY = '1000'.
    X1000-ISTAT = '1'.
    X1000-BEGDA = sy-datum.
    X1000-ENDDA = '99991231'.
    X1000-LANGU = 'B'.
    X1000-SHORT = 'ERAN'.
    X1000-STEXT = 'ERAN TEST'.
    append x1000.
    * 1. Reset standard authorization
      CALL FUNCTION 'RH_AUTHORITY_CHECK_OFF'.
    * 2. Insert new row into Infotype 1000 for position with new name
    CALL FUNCTION 'RH_INSERT_INFTY'
      EXPORTING
    *   FCODE                     = 'INSE'
        VTASK                     = 'S'
    *   ORDER_FLG                 = 'X'
    *   COMMIT_FLG                = 'X'
    *   AUTHY                     = 'X'
    *   PPPAR_IMP                 =
    *   OLD_TABNR                 = ' '
    *   REPID                     = ' '
    *   FORM                      = ' '
    *   KEEP_LUPD                 =
    *   WORKF_ACTV                = 'X'
      TABLES
        INNNN                     = X1000
    *   ILFCODE                   =
    * EXCEPTIONS
    *   NO_AUTHORIZATION          = 1
    *   ERROR_DURING_INSERT       = 2
    *   REPID_FORM_INITIAL        = 3
    *   CORR_EXIT                 = 4
    *   BEGDA_GREATER_ENDDA       = 5
    *   OTHERS                    = 6
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    COMMIT WORK.
    * 3. Set standard authorization
    CALL FUNCTION 'RH_AUTHORITY_CHECK_ON' .
    SAVE THE DATE 01-01-2011 ****
    More convenient to use, More efficient search , Easier to find...

  • How to Upload data without using PSA layer

    Hi Colleagues,
    I would like to apply LSA architecture principals.
    Is it possible to upload data from SAP source system or NON-SAP source system directly in a Write Optimized DSO without have to use the PSA layer ?
    And if yes how ?
    Thanks

    Hi Peter,
    We donot have any option for skipping the PSA loading in BI7.
    If you are working with BW3.5, then yes we can load the data directly without using PSA. Goto  IP>Processing Tab> Select the radio button Data Targets only--> When you schedule the IP, data will be directly loaded to Data Target without using PSA.
    Hope it helps!
    Rregards,
    Pavan

  • Struts how can validate form without using validate method.

    Hi
    Is this possible validate a form without using validate form
    if it is possible then
    please tell me how can we validate it
    Thanks
    Surendra

    Make use of validator framework.. this would enable you to do validation both @ client side by javascript under defined validation rules and also enables you to do it @ serverside....
    And if want to create a Dyanamic Form beans which takes care of validations to make use ValidatorForm or DynaValidatorForm class under the pacakage org.apache.struts.validator and create an instance of it with preconfigured validations under structs...
    Make use of the links below which i think are the best tutors for newbies....
    http://www.roseindia.net/struts/struts_validator_framework.shtml
    http://www.oracle.com/technology/oramag/oracle/04-jan/o14dev_struts.html
    http://www.onjava.com/pub/a/onjava/2002/12/11/jakartastruts.html
    Hope might be of some help.. :)
    REGARDS,
    RaHuL

  • How to create links without using widgets

    I am using a vertical menu via the widget, but want to create a submenu without using the widget. btw, the rollover feature is fun

    To create a sub menu without using the sub menus in the menu widget you can combine the menu widget and the tooltip widget to create your menu.
    There is plenty of examples and widgets that do what you are asking if I understand correctly at the Muse exchange and places like musegrid.com.

  • How to declare procedure without using IN OUT parameter?

    Hi:
    I want to declare procedure without using IN OUT parameter.
    My Script is:
    DECLARE
    procedure pro_bank_master() As
    Declare
    kr_bankid integer;
    last_bank_id number(10,0);
    CURSOR comp_cur IS select bank_id,date_created,created_by,modified_by,name_en from COM_BANK_MASTER ;
    comp_rec comp_cur%ROWTYPE;
    BEGIN
    OPEN comp_cur;
    FETCH comp_cur INTO comp_rec;
    WHILE comp_cur%FOUND
    LOOP
    kr_bankid:= comp_rec.bank_id;
    insert into crayom_db.C_Bank(ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, name, routingno, c_location_id, swiftcode, isownbank, description) values(11,11,'Y',sysdate,100,sysdate,11,comp_rec.name_en,'A',1000009,'A','Y','A');
    select crayom_db.C_Bank.c_bank_id into last_bank_id from crayom_db.C_Bank where rownum=1 ORDER BY crayom_db.c_bank.c_bank_id DESC;
    insert into crayom_db.CR_IdBackup values(kr_bankid, last_bank_id);
    FETCH comp_cur INTO comp_rec;
    End LOOP;
    close comp_cur;
    END;
    BEGIN
    pro_bank_master();
    END;
    The Error i am receiving is:
    Error starting at line 1 in command:
    DECLARE
    procedure pro_bank_master() As
    Declare
    kr_bankid integer;
    last_bank_id number(10,0);
    CURSOR comp_cur IS select bank_id,date_created,created_by,modified_by,name_en from COM_BANK_MASTER ;
    comp_rec comp_cur%ROWTYPE;
    BEGIN
    OPEN comp_cur;
    FETCH comp_cur INTO comp_rec;
    WHILE comp_cur%FOUND
    LOOP
    kr_bankid:= comp_rec.bank_id;
    insert into crayom_db.C_Bank(ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, name, routingno, c_location_id, swiftcode, isownbank, description) values(11,11,'Y',sysdate,100,sysdate,11,comp_rec.name_en,'A',1000009,'A','Y','A');
    select crayom_db.C_Bank.c_bank_id into last_bank_id from crayom_db.C_Bank where rownum=1 ORDER BY crayom_db.c_bank.c_bank_id DESC;
    insert into crayom_db.CR_IdBackup values(kr_bankid, last_bank_id);
    FETCH comp_cur INTO comp_rec;
    End LOOP;
    close comp_cur;
    END;
    BEGIN
    pro_bank_master();
    END;
    Error report:
    ORA-06550: line 8, column 27:
    PLS-00103: Encountered the symbol ")" when expecting one of the following:
    <an identifier> <a double-quoted delimited-identifier>
    current
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    Can any Body Help Me?
    Thank You

    DECLARE
    procedure pro_bank_master As --also you should remove brackets when you are not using any parameters
    ----Declare-- *( declare should not be present in procedure declaration )*
    kr_bankid integer;
    last_bank_id number(10,0);
    CURSOR comp_cur IS select bank_id,date_created,created_by,modified_by,name_en from COM_BANK_MASTER ;
    comp_rec comp_cur%ROWTYPE;
    BEGIN
    OPEN comp_cur;
    FETCH comp_cur INTO comp_rec;
    WHILE comp_cur%FOUND
    LOOP
    kr_bankid:= comp_rec.bank_id;
    insert into crayom_db.C_Bank(ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, name, routingno, c_location_id, swiftcode, isownbank, description) values(11,11,'Y',sysdate,100,sysdate,11,comp_rec.name_en,'A',1000009,'A','Y','A');
    select crayom_db.C_Bank.c_bank_id into last_bank_id from crayom_db.C_Bank where rownum=1 ORDER BY crayom_db.c_bank.c_bank_id DESC;
    insert into crayom_db.CR_IdBackup values(kr_bankid, last_bank_id);
    FETCH comp_cur INTO comp_rec;
    End LOOP;
    close comp_cur;
    END;
    BEGIN
    pro_bank_master();
    END;
    Edited by: user11183973 on Sep 22, 2009 5:49 PM

Maybe you are looking for

  • Missing pages when printing in Adobe Reader 9?

    I'm trying to print a chapter in a PDF document using the Bookmarks Navigational Panel but whenever I print the chapter (i.e. right-click on the chapter and select Print Pages), some pages are skipped and not printed. I have tried to re-install Adobe

  • In which table field DEPARTMENT

    hi all, In which table i can find field DEPARTMENT. Thanks, sappk25 Moderator Message: Consult your Functional Consultant/Specifications. Edited by: kishan P on Sep 2, 2010 12:46 PM

  • AP1252 in dual radio mode with in-line power.

    Hi, Has anyone actually managed to deploy the AP1252s in dual radio mode and been able to power via a POE device? The information regarding max power supplied is misleading. For example, the 6500 802.3af POE line cards appear to only provide a max of

  • How to read material services object attachments

    Hi, I'd like to read pdf documents attached to material master. There is any function to do that? Then I have to send an email attaching this document with a custom program. thank you in advance! Oscar

  • Handle SF for multiple customers in select options

    Hi All,     I have a Customer Statement where I need to Print for multiple customer's invoice details.. The logic i have used here is i am passing the Customer data to the SmartForm(SF) and extracting the invoice details of that customer and then pop