How do I join together arcs and lines in a single Shape???

I am out of my depth, I am probably missing something spectacular .... I need to construct a shape from arcs and lines to get something like this, only closed:
Like a winding river sort of thing... I do not need to draw this I need to have this shape and its area available to me.... How do I join these two arcs and two lines into a shape from which I can find - area.contains(xy.getX(), xy.getY()); , preatty please?
here is the code that causes numerous errors:
import java.awt.*;
import java.awt.Graphics.*;
import java.awt.Graphics2D.*;
import java.awt.geom.RectangularShape.*;
import java.awt.geom.Arc2D;
import java.awt.geom.Line2D;
import java.awt.geom.Rectangle2D;
import java.awt.geom.Area;
import java.awt.geom.GeneralPath;
class MyShapes //extends Arc2D
public static Arc2D outerOne;
public static Arc2D innerOne;
public static Line2D upLine, bottomLine;
public static Area area = new Area();
public MyShapes(double[] upper, double [] lower)
outerOne.setArc(upper[0], upper[1], upper[2], upper[3], upper[4], upper[5], (int)upper[6]);
//                         x,          y,               w,          h,               OA,      AA, int OPEN =1
innerOne.setArc(lower[0], lower[1], lower[2], lower[3], lower[4], lower[5], (int)lower[6]);
//outerTR=this.makeClosedShape(outerTopRightArc,middleTopRightArc);
upLine     = new Line2D.Double(outerOne.getX(),outerOne.getY(),innerOne.getX(),innerOne.getY());
bottomLine = new Line2D.Double(outerOne.getX()+outerOne.getWidth(),outerOne.getY()+outerOne.getHeight(),innerOne.getX()+innerOne.getWidth(),innerOne.getY()+innerOne.getHeight());
area = this.joinAll(outerOne,innerOne, upLine, bottomLine);     
private Area joinAll(Arc2D out, Arc2D in, Line2D one, Line2D two)
GeneralPath joiner = new GeneralPath(out);
joiner.append(in, true);
joiner.append(one, true);
joiner.append(two, true);      
Area temp = new Area(joiner);
return temp;     
public boolean isInArea(Point xy)
return area.contains(xy.getX(), xy.getY());     
public boolean isItClosed()
return area.isSingular();     
Thanks

Glad to hear you find what was wrong. Still, it doesn't the main problem : why is that method crashing?
Here is what I've done in the mean time. See if it fits your purpose.import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.geom.*;
public class MyShapes {
     private Arc2D outerOne;
     private Arc2D innerOne;
     private Shape line1;
     private Shape line2;
     public MyShapes(double[] upper, double[] lower) {
          outerOne = new Arc2D.Double(upper[0],
                                             upper[1],
                                             upper[2],
                                             upper[3],
                                             upper[4],
                                             upper[5],
                                             0);
          innerOne = new Arc2D.Double(lower[0],
                                             lower[1],
                                             lower[2],
                                             lower[3],
                                             lower[4],
                                             lower[5],
                                             0);
          line1 = new Line2D.Double(outerOne.getStartPoint().getX(),
                                          outerOne.getStartPoint().getY(),
                                          innerOne.getStartPoint().getX(),
                                          innerOne.getStartPoint().getY());
          line2 = new Line2D.Double(outerOne.getEndPoint().getX(),
                                          outerOne.getEndPoint().getY(),
                                          innerOne.getEndPoint().getX(),
                                          innerOne.getEndPoint().getY());
     public void paint(Graphics2D aGraphics2D) {
          aGraphics2D.draw(outerOne);
          aGraphics2D.draw(innerOne);
          aGraphics2D.draw(line1);
          aGraphics2D.draw(line2);
     public static void main(String[] args) {
          double [] XO= {56, 58, 400, 280, 90, 90};// outter arc
          double [] XI={114, 105, 300, 200, 90, 90}; // inner arc
          final MyShapes myShapes = new MyShapes(XO, XI);
          JPanel panel = new JPanel() {
               protected void paintComponent(Graphics g) {
                    super.paintComponent(g);
                    Graphics2D g2 = (Graphics2D)g;
                    myShapes.paint(g2);
          final JFrame frame = new JFrame("Test shape");
          frame.addWindowListener(new WindowAdapter() {
               public void windowClosing(WindowEvent e) {
                    System.exit(0);
          frame.setContentPane(panel);
          SwingUtilities.invokeLater(new Runnable() {
               public void run() {
                    frame.show();
}

Similar Messages

  • QUESTION:  In Elements 12, how do I join together separate slideshows into a single integrated alideshow?

    QUESTION:  In Elements 12, how do I join together separate slideshows into a single integrated alideshow?

    I hate to say this, but there is no way to put 1280X720 footage on a 1920X1080 sequence and upscale it to match the frame size without losing some quality. Basically, you are asking Premiere Pro to provide new pixels that were not in the original video. That is seldom a really good idea. You might want to try investing in program designed to upscale video. I have never used this, but there is a free trial, so give it a shot: http://www.infognition.com/VideoEnhancer/
    Of course, it all depends on the content. Try it with Premiere Pro. Only you can judge. However, you might need to consider putting all of your 1920X1080 on a 1280X720 sequence instead, and just produce your video at that size.
    Or, once again, this depends on the content, put some sort of frame around the smaller footage, either a blurred out version of the upscaled footage - lots of TV stations do this with 4:3 footage on a HD program, or purposefully make it even a little smaller, or crop it, and use parts of the same video in Picture-In-Picture. You have seen this before. A person talking on the phone in a larger frame to the left, and on the right a closeup of the mouth, or maybe a clip of the person they are talking to. Or use some B-Roll in the PiP.
    Get imaginative, because you already know that you messed up, so perhaps make it look like you did it on purpose.

  • How do you join together two iCloud accounts?

    How do you join together two iCloud accounts of mine?

    You would need to export the data from one account, using the respective apps, sign out of it, sign into the other, and import the data.
    Alternately, you can setup the other account as a secondary icloud account in sys prefs >> internet accounts.  A secondary account is limited compared to the main one, though.
    Actual merging the Apple ID/icloud accounts, as stated, is not possible.

  • How can i get Radio buttons  and parameters  in a Single Straight Line

    Hi Experts,
    How can i get Radio buttons  and parameters  in a Single Straight Line...
    Example:
       r1 r2 p1 p2.....
    Cheers,
    Priya
    Points granted.

    Write the following code for the selection screen:
    DECLARATION OF PARAMETERS.
    SELECTION-SCREEN: BEGIN OF BLOCK select WITH FRAME TITLE text-001,
                      BEGIN OF LINE.
                      SELECTION-SCREEN COMMENT 1(10) FOR FIELD p_detail.
                      PARAMETERS p_detail RADIOBUTTON GROUP r1 DEFAULT 'X'.
                      SELECTION-SCREEN COMMENT 25(10)  FOR FIELD p_summry.
                      PARAMETERS p_summry RADIOBUTTON GROUP r1.
    SELECTION-SCREEN: END OF LINE,
                      END OF BLOCK select.
    this will solve your poblem surly. reward the points if you find helpful
    Regards,
    Siddarth

  • Drawing arcs and lines

    Hi! I am having problem in drawing arc and line. We have function
    Graphics.drawArc(int x, int y, int startAngle, int endAngle)
    I need to get the last point where the arc ends. Because I want to draw a line touching the last point of this arc. I request you to provide me some solution.
    BR
    Omer Amin

    Graphics.drawArc requires 6 parameters (not 4). Pass all 6 parameters to the Arc2D.Double() constructor and call it's getEndPoint() method.

  • How do I join multiple (short) audio clips into one single long audio clip in Premiere Pro CS5?

    Hello,
    The question is in the title but I'm wondering how I can join multiple (short) audio clips into one single long audio clip in PP CS5.5.  I put all my short clips right next to each other and selected all of them to see what options are available by right clicking and using the toolbar options at the top.  The closest that I got was to nest the sequence, but that's not what I really want.
    I'd like to merge all the short clips into one single (long) audio file to use under the video.
    Thoughts are welcome and  greatly appreciated.
    Thanks,
    -Melvin

    O.K. This is kind of fundamental and you will need to learn up on this fully ...but for now...
    Make sure you have the WAB ( work area bar )covering the length of the audio clips. ( You do not need to select them)
    Go to the File Menu> Export Media
    You will be given all the Export Options.  Choose Wave File
    Select option for Export Work Area.
    Choose where to export the file to ( HD location)
    follow your nose from there....
    http://tv.adobe.com/watch/learn-premiere-pro-cs5/exporting-with-adobe-media-encoder/
    BTW - Why are you taking the audio to Audition anyway? What are you going to do to it.

  • How to make an checkbox editable and uneditable within a single alv output.

    Hi,
    How to make an checkbox editable and uneditable within a single alv output depending on condition.
    I have used Reuse_alv_grid_display.
    In my output every checkbox is editable. i have used edit = 'X'.
    I want editable checkbox for correct value and uneditable checkbox for incorrect value in a single alv

    >
    Mukilansap wrote:
    > I want editable checkbox for correct value and uneditable checkbox for incorrect value in a single alv
    Use alv styles to achieve this, set the style for each record before displaying the ALV. Structure LVC_S_STYL.
    Take a look at the example BCALV_EDIT_02, it is OOPS based, but check how the style table is filled.
    regards,
    Advait

  • How can I join together a photo and a text (or other vector files)?

    Hi all.
    I'm trying to do a poster with a sort of graffiti writings on a wall but I can't reach for any kind of realism. I'd like to see the writing on the wall like it was actually written.
    I'm using a real photo behind the writings but the image and the text don't connect together, it is simply like a copy-past work. I don't know if I was clear because English is not my first language.. the effect I'd like to reach is like if the writings were printed on the wall.. but the wall is a photo so I don't know if they can be joined together..

    Sounds like you are looking to make the writing realistic. That is better done in photoshop. Some tisp you can sue
    use a blending mode on your writing so that it blends naturally into
    If your wall is made of brick for example, you can save a grayscale imageg of your weall and use displace in photoshop to distort the writng so it looks liek it is follwoing a bump mapo of the grayscale imaeg you made
    you can use a grayscale of your wall as a mask on your writing. Use a curve to brighten the mask, so most of the writing shows through, except for some edges and such you want to roughen up

  • How to find a carriage return and Line feed?

    I need to detect if a crriage retunr and line feed present on each row in my text file before allowing user to upload the text file
    I know how to remove them from each line but what I need is to detect them no removing them from file.
    Our concern is when the a row does not have carriage return and line feed.
    Is there a way to find this using CF? Please help
    thanks

    That is exactly the problem Dave, if some rows do not have line feed, they're not being inserted into DB, it skips other steps and go right to finish. It looks
    like the file is done processing.
    So I need to do early rejection to this kind of file.
    I used cfloop to catch anything else that do not follow the formatting rules.
    Here is what I already done:
    Right after the file got uploaded, I have these codes:   
    <cfloop  index="x" file="#MyFile#" >
      <CFSETMyLine = Replace(x,chr(9),"|", "ALL")>
      I'm using a few functions, such as, Left(), Mid(), Right(), etc to make sure certain rules are followed.
      Up till here, it's done and tested, everything is working.
      The only problem is when 1 or more rows don't end up with line feed and or carriage return.
      I plan to add some codes to check the end of each row for chr(10) since it is looping for every row anyway.
      If detected, process file normally otherwise stop processing.
    </cfloop>
    So this can't be done in CF?

  • Query problem, two working queries how to left join together?

    Hello,
    I have a two queries that I have been trying to put together for a couple days. I'm frazzled. Hopefully you can help.
    The first query returns all rows from the database. The second query returns only one row (because the way it is currentlly set up in the Where clause). So I know that will have to change. For each row returned in Query1, I need the two fields from Query2 included
    (so the link would be through client.Id (which is an indexed field) or client.Accountnumber?
    This query, returns all records in the database:
    Select client.Id, client.accountnumber, client.Namelast,
    dmlocation.city ||', '||dmlocation.state as CityState,
    client.salesTerritory_client ||'-'|| dmuser.namefirst_user ||' '|| dmuser.namelast_user as Territory,
    MaxDates.LastRun, client.creditrisk, client.customercategory
    from client
    Left join fctclientcoverage on fctclientcoverage.client_id = client.id
    Left join dmlocation on fctclientcoverage.location_id = dmlocation.id
    Left join dmuser on dmuser.id = client.id
    Left join (Select to_char(Max(dmdate.calendardate),'MM/DD/YY') as LastRun, Client.Id
    from dmdate, client, fctadorder
    where dmdate.id = fctadorder.lastinsert_date_id and client.id = fctadorder.primaryorderer_client_id
    group by client.id) MaxDates ON client.id = MaxDates.Id
    where(fctclientcoverage.Ccoverrecordstopdate Is Null)
    Order by client.namelast;
    Query 2, only returns 1 row, so for each row returned above, the two fields selected in this query should accompany each row. But how to link these two selects using the client.accountnumber (or perhaps by dmcliet.id)?
    Select booked.CurRev, booked.LastRev from (
    Select (sum(Case When dmDate.CalendarDate &gt;= '29-DEC-2008' and dmDate.CalendarDate &lt; '
    Then fctinsertchargedetail.Amount_insertDetail Else 0 End)) As CurRev,
    (sum(Case When dmDate.CalendarDate &gt;= '29-DEC-2007' and dmDate.CalendarDate &lt; '
    Then fctinsertchargedetail.Amount_insertDetail Else 0 End)) As LastRev
    from fctAdorder
    Inner Join client On fctAdorder.primaryorderer_client_id = client.id
    Inner Join fctinsertion On fctAdorder.id=fctinsertion.fctAdorder_id
    Inner Join fctinsertchargesummary On fctinsertion.id=fctinsertchargesummary.insertion_id
    Inner Join dmDate On fctinsertion.insert_date_id=dmDate.id
    Inner Join fctinsertchargedetail On fctinsertchargesummary.id=fctinsertchargedetail.insertchargesummary_id
    WHERE client.accountnumber = '12345678' and
    dmDate.CalendarDate &gt;= '29-DEC-2007' And dmDate.CalendarDate &lt; ') booked;
    Thanks for your time.

    Yes, You are correct!
    I just recently got the query working with the aid of another forum.
    The sad part is, all though the first query took 11 seconds to return 180,000 rows (thats good); The second query took 4 minutes to calculate and return all it's rows (that's bad). Together the query ran for over 4 minutes. Way too slow.
    Being brand new to oracle I have to try and figure away to cut this time down. Perhaps I'm not considering something?
    I orginally brought into my .net app the results from the first query and then in the rowdatabound event I queried each row to get the information needed from the second query. That was way too slow also. It was recommended to try and return all needed data at once.
    I've been given a task to emulate a current application, (which I do not have access to it's code), that brings back all of this same information that I am using. It only takes them maybe 15 seconds to run, to bring back all. Of course they were experienced oracle sql developers.
    So I guess my next step is to try and improve that second query. Thanks for replying to this Frank. I'll be back. Are you or is anyone good at knowing how to optimzie queries? I'm reading a book now trying out suggestions. Nothing is working yet.
    thanks

  • How to change the network name and line name on iPad 4?

    Could anybody help me how to fix this problem?
    Previously I used qb (a mobile network in Cambodia) for my iPad 4 (iOS 7.0.4 non-jailbreak) the network name is qb.
    The problem is that after I changed to use SMART (another mobile network in Cambodia) for this iPad the network name is still in QB and the Line name changed to SMART.
    I don't know how to fix it now.
    I have tried many methods as in restore through iTunes, reset network setting, reset all setting... but I still could not get the solutions.
    I do hope to get it fix through all your experience.
    Regards,
    Panharith

    Hi Anikesh
    using SU01..u can change the password but can't see the old password..
    Hope this helps, reward with points if it does...;-)
    Regards,
    Tejas

  • Acrobat pro: how set default properties for arrow and line tool seperately?

    I have a problem with the 'comment and markup' tools in Adobe Acrobat Pro.
    I would like to change the defaults of some of the tools, eg the arrow and the line tool.
    This can be achieved by right-clicking on something drawn using the tool in question and then selecting 'properties' - or by selecting the tool and then press ctrl+E, wich opens a 'Callout Tool Properties', and then change what you want there. The latter option keeps the changes as defaults - the former offers a box to tick in the 'properties' dialogue that opens - or, you can right-click on the object again after having changed the properties, and then select 'Make Current Properties Default'.
    My Problem is now, that, apparently, you cannot choose and save default properties freely and for each tool. I woul like to have the default properties for the line tool set as the following:
    -line color: yellow
    -line thickness: 8pt
    -opacity: 60%
    and fot the arrow tool as this:
    -line color: red
    -line thickness: 1pt
    -opacity: 100%
    This all works fine as long as the program is open. As soon as I exit and start it again opening another document /the same one again, the arrow tool changes to
    -line color: yellow
    -opacity: 60%
    only the line thickness remains at 1pt.
    If I change the properties of the line to the ones I want for the arrow, the arrow properties remain unaltered if I close Acrobat Pro.
    Why do these properties interfere? Why is it "line color/thickness" in both? Why, then, do only the opacity and the color interfere, but not the thickness - even if it's the latter two properties that are bot called "line xxx"? Why does Acrobat not save all properties for these two shapes seperately - even IF the two shapes are both of a line-like kind?
    Is there a way to get around this?

    Trobbel - This indeed is puzzling behavior. Clicking 'Make Current Properties Default' should preserve the default  appearance for each. I don't have a solution, but merely a couple of suggestions:
    1) Make sure you have installed any available upgrade for your version of Acrobat Professional.
    2) Consider using the line tool exclusively - you can add an arrowhead and make one tool perform both tasks.
    Hope this helps. /rmbrown

  • How do I join together these two queries?

    Hi I have these queries:
    select br_no, br_managersname from BRANCH order by br_managersname;
    select sum(rent_endkms-rent_startkms) as "TOTAL KMS TRAVELLED" from RENTAL group by BR_NO having SUM(rent_endkms-rent_startkms) = (select MAX(sum(rent_endkms-rent_startkms)) from RENTAL group by BR_NO);
    They each output their own tables, but I wanna join them together so they output as one table. Unfortunately, I really suck at joining tables. Can anyone help?

    Hmm... Not enought information again... Any way, let me consider br_no as the key between the two query. In that case i came up with this.
    with query1
    as
    select br_no, br_managersname
    from BRANCH order by br_managersname
    query2
    as
    select br_no, sum(rent_endkms-rent_startkms) as total_kms_travelled
      from RENTAL
    group by BR_NO
    having SUM(rent_endkms-rent_startkms) = (select MAX(sum(rent_endkms-rent_startkms))
                                               from RENTAL
                                              group by BR_NO)
    select q1.bar_no, q1.br_managersname, q2.total_kms_travelled
      from query1 q1
      join query2 q2
        on q1.br_no = q2.br_no

  • How can I join Airport Express and 2Wire 3600HGV to extend wifi?

    I to join an Airport Express to the wifi network from my AT&T 2Wire 3600HGV router to extend the wifi signal.  I know it is not SOP to link an AX to a non-Apple device like this.  I found instructions ( http://fsdeviations.blogspot.com/2012/09/howto-2wire-3600hgv-airport-extreme.htm l ) for joining an Airport Extreme to the 3600HGV.  Has anyone used this or a similar approach with the Express to join and extend wifi from the 3600HGV?

    Connect an Ethernet cable from on of the LAN <--> ports on the back of the 2-Wire modem/router to the WAN "O" port on the AirPort Express.
    Power up the AirPort Express for a few minutes. The indicator light on the front of the device will be slowly blinking amber at this time.
    On your Mac......
    Open Finder > Applications > Utilities > AirPort Utility
    Click on the Other WiFi Devices tab
    Click on AirPort Express
    The setup utility will open up and take a minute to analyze the network, then suggest that the AirPort Express will create a new network....which is the correct setting.  The window will look similar to this illustration:
    For Network Name......type in the exact name of the wireless network that the 2-Wire is providing......IF.....you want to "extend" the 2-Wire network and make one "big" network.  If you want to have the AirPort Express provide a different network, type in the name of the network that you want the AiPort Express to provide.
    For Base Station Name....type in a device name that you want to call the AirPort Express
    Password......If you want to extend the 2-Wire network, then type in the exact same password that the 2-Wire network is using.  If you want the AirPort Express to provide a different network, type in a password that you want to use with the network that the AirPort Express will provide
    Verify......verify the Password
    Click Next, and the utility will set up everything for you automatically.
    When you see the message of Setup Complete, click Done.  That's it. There should be a green light on the front of the AirPort Express at this point.  You can configure other AirPort Express devices in the same manner.

  • How can i join the header and item table to fetch the data

    hi experts,
                   i have a doubt in using inner join or for all entries, for fetching the data from the item table mseg, by taking the doc.no from mkpf. Plz sort out the difference, what happens, if i use the both statements for fetching data

    Hi,
    Both has same functionality.
    but if u are using FAE, u ahev to check for the
    ~intial condition of the source table,
    ~ duplicate entries, if any
    Inner join will fetch the data from all the join tables at once. FAE will fetch the date from a table first then use that data to fetch data from subsequent table.
    say in ur case, if u r using FAE,
    1.select from mkpf.
    2.select from mseg fae in I_MKPF.
    first try using JOIN. if it is taking lots of time, then try FAE.
    regards,
    madhu

Maybe you are looking for