Circle Theorem Problem

Hi everyone,
Im new to java and would like some help in developing a certain circle theorem -
THe circle Theorem states that -
Angles at the circumference which are all in the same segment are all eequal-
I need to demonstrate this by letting the user click on the circle and drag it about on screen as well as giving him the option to drag and change the chords which contain the angles to prove that no matter where the chords are in the circle the angle that they form is always the same -
Plus - I need a table which would show the values of the Circles Area , Circumference and the angles like Angle A, Angle B and Angle C etc.
The chords when touching the circumference should display a point which the user can drag..
Please help or give me some hint as to how you would go about developing it.
Cheers
Gob.

Your pretty diagram won't actually prove anything, but I suppose your teacher was looking for a nice problem.
First, write the code to draw a circle.
Then amend it to have a parameter theta and draw the chords from your chosen diameter to a point on the circle at angle theta from some arbitrary point.
Then write a MouseListener and a MouseMotionListener to track mouse clicks and drags and update theta.
Finally add the display.
If you find that any of your code for these steps doesn't work, post it in this thread, being sure to use [co[b]de] tags to mark it up.

Similar Messages

  • Just wanted to try the creative cloud- BUT keep getting a circle of problems- unable to use at all

    even spent the majority of the day trying to get through to adobe by phone--- hold times of 45 to an hour--- finally, finally get someone-- unfortunately couldn't understand much of what he said due to accent- i know this is a global world, but come on--- i just want to try the product--- i do all this, have to keep asking politely, please repeat that step- or i'm sorry but i can't understand you--- and we go through all these steps and all this time and he wants me to control alt delete--- then we repeat the process--- i ask him about common reasons why i keep getting "adobe application manager failed to install", but he can't say- he had control of my pc and did all the things, you or i would do, and kept wanting to control alt delete- i was polite and courteous and so was he, but talk about "mind-numbing"- how is this possible with such a cutting edge company and a new flagship, "welcome to the new world" softare/ cloud debut- no way to install- obviously means i won't be trying- and i wasted about 6 hours of total time today messing with this- arghhh- not awesome!

    Hi, I have downloaded Photoshop etc with good success a couple of months ago. I now want to download inDesign and can't get the Adobe Application Manager to load.  I have a Macbook Pro with 16 gig of memory and 250 gig space on my hard drive. 
    Can you please give me an idea what may be wrong

  • Photoshop CS5 problem - Is this Banding?

    Hi
    I am using Adobe lightroom 3.0.64 to process RAW photos from my Canon Camera. Then I touch up the pictures in Photoshop CS5. I have been working on some snooted background shots recently and I am experiencing a problem when I edit the photos in photoshop. It appears to be some of kind artifacting or distortion particularly noticeable if using graduated lighting. Looking on the web I have come across references to "banding". I am not sure if this is the problem I am experiencing, but I would appreciate it if someone could take a look.
    Either way any help on how to get rid of this issue "post" picture taken would be greatly appreciated.
    I have tried duplicating a layer/Blurring it and then using masks to bring out the main focus of the picture. This doesnt seem to work very well and just makes the banding look more noticeable.
    I have uploaded a hi-res version of the file:
    http://www.lakelanddigitalmedia.com/stock/bandingproblem.jpg
    and circled the problem areas.
    Any help would be most appreciated.

    function(){return A.apply(null,[this].concat($A(arguments)))}
    slackbladder wrote:
    I can see the same posterization effect when I click on that one too. Does that mean the problem is to do with the screen display profile after all, and I should change the profile to Srgb as suggested.
    There's no easy answer, but in general unless your monitor is actually displaying the sRGB color space accurately I'd say it's not generally a good idea to throw out a display profile that brings your particular monitor into proper calibration.
    If you want your document products - i.e., that which you publish or print - to hide the posterization, then I suggest making sure Dithering is enabled in your color preferences.  That way when the conversion of the document profile to sRGB occurs, the gradients will look smooth.
    Today's monitors are good enough that you can easily see 256 different shades of gray.  The posterization you're seeing may well be because of that - OR - you may be experiencing the problem I reported in this thread:  http://forums.adobe.com/message/3473424
    Try going into Edit - Preferences - Performance, [Advanced] and changing your OpenGL mode in Photoshop to Basic, then restarting Photoshop.  Does that help make your rose image look better on your monitor?
    -Noel

  • Problems on Linux

    I am running redhat 8.
    When I start the domain I have an interesting problem.
    Issue #1
    I run
    asadmin start-domain --domain domain1
    and I get the following error but both admin-server and server instance are actually running.
    Could not start the instance: domain1:admin-server
    server failed to start: abnormal subprocess termination
    Could not start the instance: domain1:server1
    server failed to start: abnormal subprocess termination
    Could not start the domain.
    Could not start one or more instances in the domain : domain1
    I run this to confirm
    asadmin list-instances
    admin-server <running>
    server1 <running>
    Issue #2
    This one is even more interesting
    I run
    ps -ef | grep appservd
    root 7182 1 0 17:06 ? 00:00:00 appservd -r /opt/sun/appserver7
    root 7186 7182 1 17:06 ? 00:00:16 appservd -r /opt/sun/appserver7
    root 7260 1 0 17:07 ? 00:00:00 appservd -r /opt/sun/appserver7
    root 7264 7260 0 17:07 ? 00:00:10 appservd -r /opt/sun/appserver7
    strange no watchdog processes ???
    now I take a look at the pid file in the log dir for both admin-server and service instance,
    7259
    7181
    as you might have guess it, these process do not exist
    This is a problem as the tools seem to look at these numbers to stop the servers, in this case there is nothing to stop.
    So it seems like the issue here is that the watchdog processes are not starting up (not for long at least).
    We need a watchdog for a watchdog :-)
    Any ideas.
    PS I do not have any firewall running on this box (I know that this might be a problem)
    cheers
    mac

    I do have the very same errors on my RedHat 8 installation. However, I do see an 'appservd-wdog' process after I start up the AS7 (see end of posting):
    #> ./bin/asadmin start-appserv
    Could not start the instance: domain1:admin-server
    server failed to start: abnormal subprocess termination
    Instance domain1:server1 started
    Could not start one or more instances in the domain : domain1
    Could not start one or more domains
    I have a perfectly working non-RedHat 8 installaion to compare to, and the admin-server's server.log there ends with:
    [11/Mar/2003:10:34:05] INFO (23878): HTTP3072: HTTP listener http-listener-1 [http://XXXXXXXX] ready to accept reques
    ts
    [11/Mar/2003:10:34:05] INFO (23878): CORE3274: successful server startup
    [11/Mar/2003:10:34:06] INFO (23932): CORE5053: Application onReady complete.
    On the RedHat 8 machine, however:
    [11/Mar/2003:12:42:18] INFO ( 873): CORE3274: successful server startup
    [11/Mar/2003:12:42:18] SEVERE ( 870): CORE3092: Error receiving response from watchdog
    [11/Mar/2003:12:42:18] SEVERE ( 870): CORE3144: Watchdog admin channel has been closed
    [11/Mar/2003:12:42:19] INFO ( 927): CORE5053: Application onReady complete.
    And unlike in the initial posting from Mac, on my RedHat 8 machine, I do see a watchdog process AND the AS7 is serving the requests properly:
    #> ps -efw | grep appservd
    root 870 1 0 12:41 ? 00:00:01 appservd -r /opt/SUNWappserver7 -d /opt/SUNWappserver7/var/domains/domain1/admin-ser
    root 873 870 13 12:41 ? 00:00:37 appservd -r /opt/SUNWappserver7 -d /opt/SUNWappserver7/var/domains/domain1/admin-ser
    root 949 1 0 12:42 ? 00:00:00 ./appservd-wdog -r /opt/SUNWappserver7 -d /opt/SUNWappserver7/var/domains/domain1/se
    root 950 949 0 12:42 ? 00:00:01 appservd -r /opt/SUNWappserver7 -d /opt/SUNWappserver7/var/domains/domain1/server1/c
    root 952 950 9 12:42 ? 00:00:24 appservd -r /opt/SUNWappserver7 -d /opt/SUNWappserver7/var/domains/domain1/server1/c
    In addition to that, I cannot shut down the AS7 anymore using the appserv-stop, instance-stop commands or the GUI interface; the same error messages pop up, the appservd processes (only from the admin-server!) stay alive and the pid files do not get deleted.
    #> ./bin/asadmin stop-appserv
    Could not stop the instance: domain1:admin-server
    server failed to stop: abnormal subprocess termination
    Instance domain1:server1 stopped
    Could not stop one or more instances in the domain : domain1
    Could not stop one or more domains
    Is there no way to circle the problem and find out what causes this strange behaviour and why the watchdog doesn't work properly on RedHat 8? Has anyone else experienced this? Any comments are greatly appreciated. Thanks.
    Greetings,
    Bernd.

  • Using Variables in Syntax

    We are in the process of consolidating all data.  We have consolidated all our timekeeping/payroll data, but unfortunately the bulk of sale data still exists in tables based off store numbers.  I am needing to get a list of all employees who worked
    on Black Friday (Nov 28) and take a look at their sales.  I took this in a two step approach one, get a list of all employees who had a clockin date of 11/28/2014 and insert them into a table, then step 2 I was going to iterate each employee from that
    table and insert sale #'s into a second table, and query the final results of the 2nd table to show full circle.  Problem, I keep getting an error of 'Invalid Column Name 'Employee''  
    Below is my syntax...speed is critical for me, so if there is a faster way of achieving these same results please let me know.  SQL Server 2008 is the server I am running this on.
    Create Table #EmployeesWhoWorked (ID Int Identity, storeNum int)
    Create Table #Results (empName, StoreNum int, empitemSold int, emptotalSold int)
    --This works
    Insert Into @EmployeesWhoWorked (storeNum)
    Select storeNum
    From timekeeping
    Where clockindate = '11/28/2014'
    --This is the piece that errors
    Declare @N int, @Str Nvarchar(4000), @storeNum varchar(1000), @MaxID int)
    Set @N = 1
    Select @MaxID = Max(ID)
    FROM #EmployeesWhoWorked
    While (@N<=@MaxID)
    Begin
    Select @storeNum = storeNum
    FROM #EmployesWhoWorked
    Where ID = @N
    Set @Str =
    ' Insert Into #Results (empName, StoreNum, empitemSold, emptotalSold)
    Select empName, '+@StoreNum+', Count(itemSold), SUM(itemvalues)
    From '+@StoreNum+'
    WHERE clockindate = '11/28/2014'
    Exec SP_ExecuteSQL @Str
    Set @N = @N + 1
    End
    Select *
    FROM #Results

    E.g.
    CREATE TABLE #EmployeesWhoWorked
    ID INT IDENTITY ,
    storeNum INT
    CREATE TABLE #Results
    empName VARCHAR(1000) ,
    StoreNum INT ,
    empitemSold INT ,
    emptotalSold INT
    DECLARE @clockindate DATE = '20141128';
    INSERT INTO #EmployeesWhoWorked
    ( storeNum
    SELECT storeNum
    FROM timekeeping
    WHERE clockindate = @clockindate;
    DECLARE @N INT ,
    @Str VARCHAR(MAX) ,
    @storeNum INT ,
    @MaxID INT;
    SET @N = 1;
    SELECT @MaxID = MAX(ID)
    FROM #EmployeesWhoWorked;
    DECLARE @SQL VARCHAR(MAX);
    SET @SQL = '
    INSERT INTO #Results
    ( empName ,
    StoreNum ,
    empitemSold ,
    emptotalSold
    SELECT empName ,
    @storeNum ,
    Count(itemSold) ,
    SUM(itemvalues)
    FROM @TableName
    WHERE clockindate = @clockindate;
    WHILE ( @N <= @MaxID )
    BEGIN
    SELECT @storeNum = storeNum
    FROM #EmployesWhoWorked
    WHERE ID = @N;
    SET @Str = REPLACE(@SQL, '@TableName', QUOTENAME(CAST(@storeNum AS VARCHAR(255))));
    EXEC sp_executesql @Str, '@storeNum INT, @clockindate DATE', @storeNum, @clockindate;
    SET @N = @N + 1;
    END;
    SELECT *
    FROM #Results;
    But I don't understand your loop approach..

  • How do I update a timer's timeout threshold in realtime?

    Hi all. 
    I'm trying to implement something that would look like a 'Timer event' but I couldn't find anything in Labview that could be used to trigger a case in an event structure.
    I also can't seem to update the internal timeout threshold of running timers (such as one of the frames in a Time Sequence).  If the user accidently entered a number with 2 extra digits in it, they have to wait all that time for the frame to end.  This breaks one of my personal design rules: Allow the user to update anything in real-time unless it violates the the intended functionality.
    With neither of these approaches available, does this mean I'm still stuck doing a low-level approach polling timestamps?

    thanks for the responses!  I think we are circling the problem without quite landing on it yet... 
    Let me describe the simple version of what I'm doing.
    Customer needs a PWM digital signal with period times that could be very long, an hour or more.  Duty cyle and period are two separate user-settable controls.  There is also an enable/disable switch.
    In the old days, I would implement this like an onion.
    First,  polling-wait loops for each half of the PWM cycle..  If the user aborts or changes the PWM timing, the loops just finishes or extends out, depending.  Each half of the PWM cycle is buried in a two-step sequence.
    That two-step sequence sits in a case-statement gated by the Enable switch.  That assembly sits inside an endless While loop.  Everytime one PWM cycle ends, the enable switch is retested and the PWM started again, otherwise nothing happens. (appropriate wait statements to keep polling to a minimum neccessary are scattered around)
    I'm trying to move away from this effective but messy approach.  Instead of polling wait-loops, the timed sequence should be ideal.  However, once a time value is passed to a frame, it can't be changed.  So, for example, once a frame of a time sequence receives a value of one hour, then me the programmer can't provide the user with any way to change the one hour setting once it has engaged. (except for the 'Stop Sequence' VI, but that kills the whole sequence, not just the frame.  Grit teeth, arghhh!)  Ideally this would be a 'timed-sequence Method' driven somewhere else that would update the timer value insidethe frame.  If the method call passed a value of, say, 30 minutes, and 45 minutes had already passed, then the frame would calculate that the time limit for that threshold had been exceeded and the frame would simply timeout.  That would be the ideal.
    OK, can't make a timed sequence work.  How about some other kind of background timer?  Can't do.  Can't find anything like it in Labveiw.  If there was one, I'd make it an Event-driver.  Start a clock somewhere, then tie an Event-structure frame to it, where the action would happen.
    I can still do it the old way, I'm just tring to find a more elegant way using more event-driven techniques.  Besides, lots of nesting requires lots of tedious outward-propagation of abort signals. (and high-resolution polling uses more CPU time)
    thanks,
    Matt

  • Internal and LaCie Drives Fail to Burn

    Ok here's the situation:
    Problem #1 -- All of my burn drives have committed massive, bloody, catastrophic suicide. My internal "died" literally days after the warranty expired (I did not get AppleCare). It's still there and it recognizes when I put CDs and DVDs into it; I can hear it spin at start up and it spins when something is in there. It simply won't PLAY or BURN anything, I don't know why. I get all sorts of interesting "fail" messages, including the laser can't be calibrated and the device was removed. Usually it initalizes and then seconds later says burn completed, ejecting the disc which hasn't been written. Apple offered to fix it by installing a new one for $500+; I declined and instead purchased a LaCie external drive...
    Problem #2 -- which used to work just fine. It was a little tempermental but with minor tweaking I was able to burn in iTunes, Roxio Toast (which now has decided to start crashing every time I do a drag-and-drop), Finder, etc. Now the LaCie doesn't want to work either. Sometimes the drive will mount, sometimes it won't. Even when it does mount, it isn't working properly. Sometimes I'll get the same device removed message as I do with the internal, other times it just squeaks at me. No, nothing has been dropped, banged, drowned, etc. I've run EVERYTHING on both drives -- Disk Utility, permissions corrections (even though there were no problems with any iTunes files), turning off CD text, dealing with the weird language bug in the International System Preferences, Burn Patch, setting burn speed to 4x instead of best possible, battery out for 15 minutes and restart, compressed air, etc... nada. Which leads to...
    Problem #3 -- the next problem. If I can't burn CDs/DVDs, I won't die. It's an annoying, inconvenient and expensive problem, but I'll survive. I can just use my old iPod... oh, right, that just died, too. Unfortunately, along with the lovely MacBook and LaCie, I've also purchased iLife '08, Mac OS X 10.5.1, and a 200 GB Time Capsule. Of course, all of these require a functioning CD/DVD drive to install, and without one I have a lot of useless and rather expensive crap. On to...
    Problem #4 -- the final issue. I have 2 512 MB memory cards in the laptop. According to my System Profiler, I have 1.69 GB left on my hard drive and the computer keeps yelling at me that I don't have enough space left on my start up. I know this. I also know that I want to keep my files, which is why I bought the Time Capsule in the first place. I haven't done ANY backups and really need it in place, both so I can free up space on the hard drive and also so I don't lose everything with the inevitable epic fail. Again, I can't install the Time Capsule without a working CD/DVD drive, so this brings us full circle to problem #1.
    Any help or suggestions would be GREATLY appreciated. Apple found a nice way of telling me where to go (and how it really is too bad that I didn't get AppleCare) and LaCie says ask Apple, so... I'm in great shape.
    Specs:
    MacBook
    OS X 10.4.11
    LaCie d2 DL DVD+-RW with LightScribe
    Matshita CD-RW CW-8221
    iTunes 7.7.1 (11)

    I've freed up a ton of space by deleting a bunch of things I didn't want to, in case that was the problem. Now my LaCie is showing up as Read Only, which it NEVER was before.

  • Invisible characters on webpages

    Since upgrading to Snow Leopard, I've noticed a couple of pages where some random text is invisible. It's there because I can select it and paste it somewhere else and then see it. It's not white on white because I can't see it when I highlight it. Here's a screenshot of what I'm talking about. I circled the problem in red:
    http://homepage.mac.com/abramr/Sites/missingtextscreenshot.jpg
    Also, while I'm posting screenshots, I've had a double search field box on this page (Apple Discussions) for a long time. Anyone know why?
    Here's a picture:
    http://homepage.mac.com/abramr/Sites/doubletextbox.jpg
    Thanks,
    Rob

    Here's another example. It's from mathforum.org. The letters aren't just missing, they're only certain letters, but not the real letters. I copied and pasted most of the page to text edit and it looks fine.
    webpage: http://homepage.mac.com/abramr/Sites/mathforumdotorg.jpg
    text file: http://homepage.mac.com/abramr/Sites/mathforumdotorg.txt
    screenshot from textedit: http://homepage.mac.com/abramr/Sites/mathforumdotorgtxt.jpg
    I posted the text file, but when I view it in my browser, it looks the same as the webpage did. The screenshot shows what I see in text edit. This is really weird.
    Thanks for helping,
    Rob

  • Chess board

    hello
    i need help with this animation i need to make
    i have a chess board and a simple form, lets say a circle, my
    problem is that i need to change the color of the part of the cell
    while the circle pass, so when the cicrle is in a black cell part
    of the cell becomes white and the next white cell should be change
    to white
    thanks alot for you help

    quote:
    Originally posted by:
    chrisf671
    ok i know what you need to do is make collistion detection on
    the cells i found you a tutorial on it. here
    http://www.spoono.com/flash/tutorials/tutorial.php?id=18
    if you need futher help just ask.
    tyvm for your answer chris
    the collinding is really usefull and im sure ill use it, my
    only problem is that i need one of the boxes to gradually change
    color as it is getting into the other box
    lets say that the green box is half in and half outside the
    gray box, meaning that the outside part will rest green and the
    half within the gray box will change to red
    ill make some experiment with it and keep you updated, pls if
    u have any other idea i will really apreciated it
    thxs again

  • Security Update 2008-008 No user window.

    I do apologise if this is the incorrect discussion group, but I couldn’t find a email address to report this so I thought I would post it and it may eventually get to the right people.
    I’ve just updated (using Software Update) the latest Security Update 2008-008. The Mac was running perfectly beforehand (all updates and security updates to date).
    When using the Mac I regularly switch between user accounts, however I have found that after the update if I log out of a user account (with no admin privileges) the main user accounts window does not appear. (I am left with the desktop picture of the account I have tried to log out of and no menu bar.)
    The only solution I have found to this problem (in each instance after the initial one, I have waited for 5 minutes to give the system a chance) is to hold down the power key until it switches off the Mac. The Mac then starts up fine and displays the user window, from there I can choose which account I want to use.
    As I switch between these accounts throughout the day, shutting down the Mac, between switches, will seriously impede getting anything done.
    Nevertheless, the above problem does not manifest itself when I have logged out of the admin account, this appears to be working as it should. The list of user accounts opens and I can choose an account as normal. Additionally, the problem does not appear if a user account is already open and I am logging onto another account from the fast user switching menu.
    I realise the short term solution is to have an account open all the time, but this is not ideal, as the open account I am sure, will be using resources unnecessarily.
    If however, someone has a more substantial solution then I would be most grateful for the suggestion.

    Accounts are numbered 501, 502, etc. as the computer sees them, so that's the origin of the multiple trash folders. Each account has its own trash.
    As you can read in an earlier post and through the links, safe mode does move some things to the trash so it does act as a temporary purge of items.
    I just tried reading the file about what the most recent security update changes. I don't really understand most of it but I didn't see anything that specifically said log out modification to me. It is pretty hard trying to resolve logout issues and you seem to have this strange combination of accounts that work and don't work.
    One thing you haven't done but could try is booting from your installer disc and run Disk Utility's repair drive (not permissions but drive). Actually, running Applejack does a reduced version of the same thing but it's worth a try if only to see what it reports about drive condition.
    Dock. I am not sure what the dock would have to do with this. You could try removing the com.apple.dock.plist file from your home directory > Library > Preferences folder. Just move it to someplace else temporarily and see if that clears up anything on a logout.
    It appears that this Secuirty update 2008-008 (10.4.11) is causing an ever increasing circle of problems as more posts are appearing in various places on the Internet.
    This happens after any kind of update, but especially an update which changes components of the operating system. It is really a matter of matter of perception. It looks like there's a lot of problems because the hundred people who do have problems post here to ask about the problem. What you don't see are the thousands (millions?) of people who do not post because they did not have a problem.
    There's been recent discussions as to what steps are truly necessary in doing a minimal problem update.
    I think #1 to which all agree is to make sure you have a backup of your computer in case you do need to back out of it again.
    Some like to boot from their installer discs or an external backup and verify (and if necessary repair) their internal drives as well as drive permissions. This is done with Disk Utility.
    You can also go to the step of booting into safe mode to do the install.
    I like to download the update onto my computer and install it from there rather than let Software Update do it. I know a few people who had problems with doing the update via software updater found a manual install to work.
    Repair permissions again afterward.
    It also helps to only install one update at a time and to run the computer for a while to make sure it is behaving well.
    Almost all of the above steps (except backup) have been questioned as to necessity because probably many people have done successful updates without doing them. I say they can't hurt, they can very likely do good (especially if your computer isn't regularly maintained), so why not do them to be safe.
    I cannot bear the idea, but having spent the last 20 or so hours trying to solve this problem, I am left with reinstalling the entire system from scratch. I cannot believe that this is my only alternative. And for the moment at least it will remain on the shelf.
    Well, I am not a computer expert (just another Mac user with a few years on the clock) and I am running out of ideas. Maybe somebody else will happen by who can figure out what is going on. Can you think of anything that is different about the problem accounts that makes them different from the others? Any special software installed?
    Incidentally, how much free space do you have on your hard drive? Sometimes stragne issues can arise if drives are getting over full.

  • Need some advide on drawing arrows.

    basically my program is almost done. I can have the use click on anywhere on the canvas and a filled circle pops up...can draw many circles at once.
    i also manage to have the user have a choice to link them up circle to circle.
    the problem comes when i try and draw arrow heads to the lines. The lines are connected from the centre of each circle to another centre of another circle..
    so when the arrow heads appear, they will point in the right direction....but then the arrow head are blocked by the filled circles color..so i can't see them... how do i make the arrows point on the circles circumference?

    I left the circles unfilled so you can see where the lines terminate and left the code in paintComponent; don't know how you are refactoring things. The lines could easily be added to another ArrayList.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.util.ArrayList;
    import java.util.List;
    import javax.swing.*;
    public class DrawingTest
        public static void main(String[] args)
            CirclesAndArrows circles = new CirclesAndArrows();
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(circles.connector.getUIPanel(), "North");
            f.getContentPane().add(circles);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class CirclesAndArrows extends JPanel
        List circleList;
        final double DIA;
        boolean showLines;
        Connector connector;
        public CirclesAndArrows()
            circleList = new ArrayList();
            DIA = 20;
            showLines = false;
            setBackground(Color.white);
            connector = new Connector(this);
            addMouseListener(connector);
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            for(int j = 0; j < circleList.size(); j++)
                g2.draw((Shape)circleList.get(j));
            if(showLines)
                Ellipse2D.Double e1, e2;
                double x1, y1, x2, y2, phi;
                for(int j = 0; j < circleList.size(); j++)
                    e1 = (Ellipse2D.Double)circleList.get(j);
                    for(int k = j + 1; k < circleList.size(); k++)
                        e2 = (Ellipse2D.Double)circleList.get(k);
                        phi = Math.atan2(e2.y - e1.y, e2.x - e1.x);
                        x1 = e1.x + DIA/2 + (Math.cos(phi) * DIA + 1)/2;
                        y1 = e1.y + DIA/2 + (Math.sin(phi) * DIA + 1)/2;
                        x2 = e2.x + DIA/2 - (Math.cos(phi) * DIA - 1)/2;
                        y2 = e2.y + DIA/2 - (Math.sin(phi) * DIA - 1)/2;
                        g2.draw(new Line2D.Double(x1, y1, x2, y2));
        public void setCircle(Point p)
            Ellipse2D.Double e = new Ellipse2D.Double(p.x - DIA/2, p.y - DIA/2, DIA, DIA);
            circleList.add(e);
            repaint();
        public void setShowLines(boolean show)
            showLines = show;
            repaint();
        public void clear()
            circleList.clear();
            repaint();
    class Connector extends MouseAdapter
        CirclesAndArrows circles;
        public Connector(CirclesAndArrows caa)
            circles = caa;
        public void mousePressed(MouseEvent e)
            circles.setCircle(e.getPoint());
        public JPanel getUIPanel()
            JButton clear = new JButton("clear");
            clear.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    circles.clear();
            final JCheckBox connect = new JCheckBox("connect circles");
            connect.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    circles.setShowLines(connect.isSelected());
            JPanel panel = new JPanel();
            panel.add(clear);
            panel.add(connect);
            return panel;
    }

  • I hate sleep lights.

    i had the same problem with my powerbook G4. i learned to get to sleep with it but it takes me till midnight usually and with school starting augest 23rd I NEED MY SLEEP. anyone have ideas for shutting the sleep light off.

    Tape.
    Go to an auto parts store. Find Chrome adhesive
    decal - used for pinstripes.
    Place adhesive sticker over your button, either
    entire button, or just the little circle.
    Problem Solved.
    Or, if you are really technically inclined, take it
    apart and take out the LED, or replace it with an old
    iBook bar - the iBook's sleep light is built into the
    casing, not the button.
    tape too sticky. I WOULD take it apart though i dont feel like voiding my 3 year apple care.

  • Polymorphism and casting

    Hi there, I would be grateful if I could get some help on the following:
    I am writing an application that dynamically processes diferent shapes (e.g. line, circle, rectangle) using a number of algorithms (algorithmA, algorithmB, algorithmC etc).
    Therefore, I have defined an abstract superclass called Shape and the subclasses Line, Circle, and Rectangle. I have also difined an abstract superclass called ShapeProcessor and a number of subclasses, ShapeProcessorA, ShapeProcessorB, ShapeProcessorC... Each shapeProcesssor class has overloaded member methods (called processShape) to process each shape type. So my ShapeProcessor class looks like:
    public abstract class ShapeProcessor{
         public abstract void processShape(Line aLine);
         public abstract void processShape(Circle aCircle);
         public abstract void processShape(Rectangle aRectangle);
    For instance, if I want to process a cirlce using the algorithm B I can write something like:
    ShapeProcessor aShapeProcessor= new ShapeProcessorB();
    aShapeProcessor.processShape(new Circle());
    My problem is when I have an array of Shape objects which I need to process. Before I can pass each shape to the processShape method I need to cast it first (i.e. to convert them from the abstract superclass Shape into a particular shape, Circle, Rectangle etc).
    A crude way of doing that it will be to retrieve the "Class" of each shape and use a switch statement to cast each shape. However, this is not what Object-Orientation is all about. Is there any better approach?
    best regards,
    Kyri.

    If you make the superclass method definition abstract,
    then once again you get the benefit of compile-time
    checking, no matter how many classes you add.I'm not sure I understand what you mean by this.
    Let's take mattbunch's approach, where a ProcessableShape calls a method in ShapeProcessor. If I understand what you're saying, you would have that method be abstract. We could also define ShapeProcessor as an interface, like so:
        public interface ShapeProcessor
            void processShape(Line shape);
            void processShape(Circle shape);
            void processShape(Ellipse shape);
        }OK, here we have our "case" statement, represented by separate methods in the interface. The ProcessableShape subclass calls processShape, passing itself as the argument, and the compiler picks the appropriate method. Each implementation of ShapeProcessor needs to implement all the methods for defined by the interface.
    The problem comes when you change the definition of ShapeProcessor but don't recompile all your implementations. This is pretty easy to do with javac, because there isn't necessarily a direct dependency. You can of course overcome the problem with a rigorous build process.
    However, if your builds do get out of sync, your app is going to blow up. Perhaps not right away, perhaps not until you happen to process the unsupported shape. But because Java does dynamic, as-needed binding, the possibility will be there.
    This isn't a Java-specific problem. I suspect that it would happen with DLLs, and know that it happens with UNIX shared libraries. The key to avoiding it is to eliminate unnecessary interdependencies, especially (in my experience) between work and worker objects.
    And, to head off the obvious critique: yes, there are times that you can't avoid such dependencies. I suspect the OP's original design was one of those times. But if by changing the design slightly, the dependencies could be eliminated, you have a better design.

  • LaCie and Internal Drives Fail with iTunes 7.7

    Ok here's the situation:
    Problem #1 -- All of my burn drives have committed massive, bloody, catastrophic suicide. My internal "died" literally days after the warranty expired (I did not get AppleCare). It's still there and it recognizes when I put CDs and DVDs into it; I can hear it spin at start up and it spins when something is in there. It simply won't PLAY or BURN anything, I don't know why. I get all sorts of interesting "fail" messages, including the laser can't be calibrated and the device was removed. Usually it initalizes and then seconds later says burn completed, ejecting the disc which hasn't been written. Apple offered to fix it by installing a new one for $500+; I declined and instead purchased a LaCie external drive...
    Problem #2 -- which used to work just fine. It was a little tempermental but with minor tweaking I was able to burn in iTunes, Roxio Toast (which now has decided to start crashing every time I do a drag-and-drop), Finder, etc. Now the LaCie doesn't want to work either. Sometimes the drive will mount, sometimes it won't. Even when it does mount, it isn't working properly. Sometimes I'll get the same device removed message as I do with the internal, other times it just squeaks at me. No, nothing has been dropped, banged, drowned, etc. I've run EVERYTHING on both drives -- Disk Utility, permissions corrections (even though there were no problems with any iTunes files), turning off CD text, dealing with the weird language bug in the International System Preferences, Burn Patch, setting burn speed to 4x instead of best possible, battery out for 15 minutes and restart, compressed air, etc... nada. Which leads to...
    Problem #3 -- the next problem. If I can't burn CDs, I won't die. It's an annoying, inconvenient and expensive problem, but I'll survive. I can just use my old iPod... oh, right, that just died, too. Unfortunately, along with the lovely MacBook and LaCie, I've also purchased iLife '08, Mac OS X 10.5.1, and a 200 GB Time Capsule. Of course, all of these require a functioning CD drive to install, and without one I have a lot of useless and rather expensive crap. On to...
    Problem #4 -- the final issue. I have 2 512 MB memory cards in the laptop. According to my System Profiler, I have 1.69 GB left on my hard drive and the computer keeps yelling at me that I don't have enough space left on my start up. I know this. I also know that I want to keep my files, which is why I bought the Time Capsule in the first place. I haven't done ANY backups and really need it in place, both so I can free up space on the hard drive and also so I don't lose everything with the inevitable epic fail. Again, I can't install the Time Capsule without a working CD drive, so this brings us full circle to problem #1.
    Any help or suggestions would be GREATLY appreciated.
    Specs:
    MacBook
    OS X 10.4.11
    LaCie d2 DL DVD+-RW with LightScribe
    Matshita CD-RW CW-8221
    iTunes 7.7.1 (11)
    <Edited by Moderator>

    95% of this is really primarily a hardware issue, possibly an OS issue, and 5% an iTunes issue. I would suggest posting this on a MacBook hardware forum where you'll get specific assistance for MacBooks.
    I have 1.69 GB
    On the external drive issue (I assume this is really a DVD drive though you keep on saying "CD") it could be a chicken and the egg question. A lot of the problems could be due to the crowded drive. I keep at least 18GB free on my computer all the time for OSX wiggle room.
    Perhaps your next line of investigation should be to purchase a drive for backup purposes, and a separate drive for archiving files.

  • Little circle turns/ page doesn't load/ problem triangle comes up almost all the time

    The little connecting circle comes on and turns no matter what -- whether it's from a bookmark, an email, a typed in address. It turns and turns, then either times out or says problem loading page ALMOST all the time (I can't figure our why or why not). I just downloaded the latest versions of both Firefox & Thunderbird. I check my AVG and Firefox has a clear pass.

    It is possible that your security software (firewall, anti-virus) blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox and the plugin-container from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
    See:
    *https://support.mozilla.org/kb/Server+not+found
    *https://support.mozilla.org/kb/Firewalls
    *https://support.mozilla.org/kb/fix-problems-connecting-websites-after-updating
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Create a new profile as a test to check if your current profile is causing the problems.
    See "Creating a profile":
    *https://support.mozilla.org/kb/profile-manager-create-and-remove-firefox-profiles
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Profile_issues
    If the new profile works then you can transfer some files from an existing profile to the new profile, but be careful not to copy corrupted files.
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

Maybe you are looking for

  • Can't install Adobe 11 on Macbook Pro Retina with 10.8.2 OS

    Never had trouble installing Adobe Reader in previous versions. ARe other Mac folk finding they get "installation error...contact company for support"? the installeer downloads, installer runs but before completion I have gotten a long error message

  • My old computer has died, how can i get all my tunes on to my new computer and ipod?

    My old computer died and i can't get access to itunes on it. how can i get itunes on my new computer without wiping my ipod and having to start again from scratch?

  • How do I transfer my iphone songs to a newly restored computer?

    My computer was recently formatted. All of my data was lost. I am using the same computer, and I am wondering how I can transfer my songs on my Iphone to my computer. I am not sure how to access the library my iphone is synced to, because that librar

  • Data Type Issue Calling Function DATE_GET_WEEK in FOX

    Hi, I am calling DATE_GET_WEEK in the FOX Formula in Integrated Planning. DATA START_DATE TYPE 0CALDAY. DATA START_WEEK TYPE 0CALWEEK. CALL FUNCTION DATE_GET_WEEK EXPORTING DATE = START_DATE IMPORTING WEEK = START_WEEK. I get an error saying Type of

  • Prepayment - payroll run link

    How to link the prepayment to the payroll run?  Meaning I run the payroll run for adhoc payments multiple times in a month, and for each payroll run, I need to run the prepayment and send the payment file to the bank each time, I got all the info nee