FILLING an area  without using SHAPE class

I am trying to implement the fill operation in a drawing application.
but I am not using the SHAPE class and also I do not know the co-ordinates.
I have just a very faint idea of implementing it, but am not able to path myself out.
If any appropriate method strikes to any of being, please pass on that to me kindly.
Thanks
Rgds
Ashwin

I think doing the fill operation in the paint() method is a very bad idea... how will yoou keep track of the fill action for the next time the paint() wil be called ?
In fact, you have two solutions:
1) Keep track in an array (or vectors or array list) of every object you create in your drawing tool. For example:
Object 1: Rectangle, bounds=[10,5,100,200], color=blue, fill=false
Object 2: Circle, bounds=[80,45,30,30], color=red, fill=false
Object 3: Shape, bounds=[10,5,50,60], color=green, fill=true
In this case, your paint() method only has to loop thru the objects and do the paintings accordingly.
2) Only keep track of the graphic area. The paint() method first has to recover the previous graphic area, then do the new paint action, and finally backup the graphic area. For example:
   // Call the superclass painting
   super.paintComponent(g);
   // Paint the previous graphic area
   if (oldGraphics != null) g.drawImage(previousGraphics);
   // Paint the new object
   doPaintAction(g);
   // backup the graphic area
   // NOTE: You'll have to find a way to get an image
   // of the graphic area!
   previousGraphics = getGraphicImage(g);Hope this helped,
Regards

Similar Messages

  • Using Custom Legend without Using Legend Class for line Chart

    Hi ,
    I m trying to create legend with checkbox without using Legend class of flex, but problem is that how to use itemrenderer of lineseries in the legend.
    My requirement is like this:

    my problemb is how to get that shape and use in container .
    i am using hbox in that i have checkbox ,label and i tried to use Image or IFlexDisplayObject but i am unable to assign that renderer to either  image or IFlexDisplayOBject nothing isd working.
    any suggestion for what component i shall use to assign the itemrenderer of lineseries.
    Thanks for replying

  • Can somebody can tell me is CC for team can support to save the files in the local area without using the cloud ?

    Can somebody can tell me is CC for team can support to save the files in the local area without using the cloud ?

    The desktop applications are still installed on your computer, and the files are also saved on your computer.
    Optionally you can upload files with a browser to https://creative.adobe.com/files, or sync up files using the file sync that is part of the Creative Cloud desktop application. The online file storage is private to you, no one else can see it your files.
    If you do want to share your files there are two options:
    You can Collaborate, which is sharing a folder with another Adobe ID. Only the person you collaborate with can see the folder.
    You can use Send Link to send a publicly accessible url to a file or folder.

  • Why are we using Abstract class?

    Why are we using Abstract class? What is specify use of Abstract class?

    The way I understand it....and I may be wrong because
    I am very new....is that by making the class abstract
    you will add abstract methods to it. Those abstract
    methods MUST be defined in in any subclass that
    inherits from the abstract class thereby making the
    abstract a template for subclasses.
    If your animal class is abstract then you would need
    an abstract method (Which is just siganture, no body)
    of say "numberOfLegs". Then in your dog and cat
    classes which extend animal you must define a
    "numberOfLegs" method with appropriate code.it isn't mandatory for an abstract class to have abstract methods. if a class does have abstract methods, the class must be abstract. but the following is perfectly legal
    public abstract class NoAbstractMethods {
      public void doStuff() {
         // do stuff
    }a subclass of an abstract class can also be abstract, and as such need not implement any additional methods

  • Using text in a GUI without using .swing classes

    In a Java application, is there any way to create a text object that can be positioned in a GUI like an ImageIcon (using a class from the standard Java API)? For example, when using ImageIcon, you feed the x and y-coordinates, whereas with .swing, you'd have to create a new panel, position the panel, and re-position the panel using BorderLayout.(direction).
    Ex. (with ImageIcon, you'd place it like so):
    //construct ImageIcon w/ URL
    ImageIcon myImage = new ImageIcon(new URL("http://..."));
    //x and y are pixels to the right and to the bottom from the top left corner
    myImage.paintIcon( (Component), (Graphics), x, y);
    //I'm looking for one that does the same, like this (without using an image, preferrably), TextMessage is what the class might be:
    TextMessage myText = new TextMessage("Here is some string to print out");
    myText.printText( (Component), (Graphics), x, y)

    or you can paint a string, like this
    public void paint(Graphics g) {
         super.paint(g);
         g.drawString("Hello World!", x,y);  // replace x, y with your own coordinates
    }hope that helps

  • Is it possible to fill in areas (like using the brush/bucket tool in PS) in Illustrator?

    Hi all,
    I am very new to Illustrator and need to fill in parts of a vector image. Is there a way to fill in the areas I want to have color, easily?  I'm down for tutorials and stuff but I'm also on a deadline and NOT wanting to resort to bringing it into PS (because I do want to learn how to do this in Illustrator).  I did a search and got that I could do it using the Live Paint option but I wasn't able to figure out exactly what to do.  Well, I hope there is a way!  The image is below.  Thanks for your help!

    It's assuming that you have a vector image - do you?
    If this is a vector image, select all, take the live paint tool and fill the areas using swatches. There shoukd be a video in the manual (find the manual in the help menu)

  • Setting body directly without using multipart classes

    I want to be able to send mail using JavaMail by just setting the header and body. I do not want to care about multi-part and the like.
    As an example, whatever be the main content-type, I set that in the header, and set the whole body as a string.
    Example, for the following, I want to just set "multipart/alternative" and set the following as text, and it should handle it.
    ------_=_NextPart_001_01C63EA7.9A5D7BC9
    Content-Type: text/plain;
    charset="us-ascii"
    Content-Transfer-Encoding: quoted-printable
    =20
    ------_=_NextPart_001_01C63EA7.9A5D7BC9
    Content-Type: text/html;
    charset="us-ascii"
    Content-Transfer-Encoding: quoted-printable
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD>
    <META http-equiv=3DContent-Type content=3D"text/html; =
    charset=3Dus-ascii">
    <META content=3D"MSHTML 6.00.3790.2577" name=3DGENERATOR></HEAD>
    <BODY>
    <DIV> </DIV></BODY></HTML>
    ------_=_NextPart_001_01C63EA7.9A5D7BC9--
    Is there a way to do it?

    Are you trying to make it difficult on purpose? :-)
    I suspect you could use a ByteArrayDataSource with the appropriate
    content type and content data and then set that as the content for the
    message itself:
    msg.setDataHandler(new ByteArrayDataSource(myText, myMIMEtype));

  • Database connectivity without using Class.forName()

    Hi,
    Can anyone please tell how we can connect to a database without in java without using the Class.forName() method , and then how the database driver gets loaded.
    Regards,
    Tanmoy

    Hi,
    I recently wrote code that connects to a database without using Class.forName() in order to be compatible with Microsoft's JVM. I read about it here:
    http://www.idssoftware.com/faq-e.html#E1
    Basically, you create a new Driver object and use its connect method.
    Here's what my particular code ended up being:
    String url = "jdbc:mysql://localhost:3306/test?user=root&password=mypass";
    Driver drv = new org.gjt.mm.mysql.Driver();
    Connection con = drv.connect(url,null);

  • How to create folder and items in content area without edit folder option

    Hello!!
    I would like to create something to users can create and insert folders and items in content area without using the edit folder option.They would have a form to include the name of the file and the name.i would like to do this for the end users can insert files more easily. Can i do this? Anyone can help me ??
    Thanks in advance!!!
    null

    The wwsbr_api and wwsbr_search_api packages are included in the current PDK, but won't be supported until 3.0.8 is release, later this month.
    Regards,
    Jerry
    null

  • Register startup classes in 6.0 without using the console

    how do you register startup classes in 6.0 without using the console application?
    thanks

    Config.xml DTD
    http://e-docs.bea.com/wls/docs60///////adminguide/config_xml.html
    "Mark Griffith" <[email protected]> wrote in message
    news:[email protected]..
    | You can edit the config.xml when the server is not running.
    |
    | You will need to know the DTD, which I can't seem to find online right
    this
    | second.
    |
    | Either way you are better off using the console.
    |
    |
    http://e-docs.bea.com/wls/docs60/ConsoleHelp/server.html#deploy_startup_shut
    | down_classes_on_server
    |
    | mbg
    |
    | "Bjorn Wennerstrom" <[email protected]> wrote in message
    | news:3a68e39e$[email protected]..
    | >
    | > how do you register startup classes in 6.0 without using the console
    | application?
    | >
    | > thanks
    |
    |

  • I have hidden unwanted books from the purchased area of the iBooks store, but they're are still appearing on the front page of iOS as cloud downloads, is there a way to remove these from iBooks without using the hide iCloud books button?

    I have hidden unwanted books from the purchased area of the iBooks store, but they're are still appearing on the front page of iOS as cloud downloads, is there a way to remove these from iBooks without using the hide iCloud books button?
    Let me explain a little more. I had downloaded a lot of free books in the past as a trial when iBooks was first released and since then I have decided I no longer want them, because of this I hid them from the purchased section of the iBooks store. The 5 books left are ones I decided to keep as seen in the following picture.
    This is how it appears in iBooks on my mac. There are 4 books downloaded and 1 book that I have decided not to download at this time. I would still like to keep this book available in the cloud incase I want to download it again in the future. You’ll notice that hide iCloud books is not selected, if I wanted to hide the book that I have chosen to keep in the cloud, but have not downloaded yet I could.
    This is exactly how I think this feature should work. If you have hidden a book from your purchases it should not show up in the mac Ibooks app. (I am aware you can never actually delete a purchase, just hide them and that hidden purchases can be restored to your account from within the account management section of the iBooks store).
    The iOS app is working differently for me. Here is a picture of the purchased tab on the iBooks store in iOS Ibooks. Again notice that pictures of Lilly is still yet to be downloaded. This is how I expected it to look.
    If we visit the front page of iOS iBooks the view is very different from what I expected. Here we can see the 4 books I wanted to keep on my device and have downloaded. We can also see the 1 book I wanted to keep, but did not want to store locally on the device and left in iCloud (Pictures of Lilly). However we can also see all the books I had hidden from the purchased section of my iTunes account and which I believe should no-longer be visible, Dracula, frankenstein etc…
    I am aware of the hide iCloud books button within the iOS app, but I did not need to use this to hide the books I had removed from the my purchased section of the iBooks store on the mac, why are they still appearing in iOS?
    I’m still not sure if this is a software glitch or not. This article suggests to me that books can be hidden, but I had already completed these steps.
    https://support.apple.com/en-us/HT201322
    A browse of google also suggests people may have been able to hide past purchases from the front page of iBooks on iOS in the past.
    In case there was an issue with syncing I tried logging in and out of my iTunes account via settings in iOS. Force closing the app, disabling automatic downloads and removing my device from iTunes in the cloud. Syncing with iTunes on the mac did not correct the issue either.
    Interestingly I have the same issue on my iPhone 6 running iOS 8.3 as I do on my iPad mini suggesting that this might be an issue either with my account or with iOS iBooks software in general.
    If there is a way to remove the already hidden iBooks in your account from the front page of iBooks on iOS without using the hide iCloud downloads button? Please help community!

    My apologies for the lack of photos, here is my post again with photos.
    I have hidden unwanted books from the purchased area of the iBooks store, but they're are still appearing on the front page of iOS as cloud downloads, is there a way to remove these from iBooks without using the hide iCloud books button?
    Let me explain a little more. I had downloaded a lot of free books in the past as a trial when iBooks was first released and since then I have decided I no longer want them, because of this I hid them from the purchased section of the iBooks store. The 5 books left are ones I decided to keep as seen in the following picture.
    This is how it appears in iBooks on my mac. There are 4 books downloaded and 1 book that I have decided not to download at this time. I would still like to keep this book available in the cloud incase I want to download it again in the future. You’ll notice that hide iCloud books is not selected, if I wanted to hide the book that I have chosen to keep in the cloud, but have not downloaded yet I could.
    This is exactly how I think this feature should work. If you have hidden a book from your purchases it should not show up in the mac Ibooks app. (I am aware you can never actually delete a purchase, just hide them and that hidden purchases can be restored to your account from within the account management section of the iBooks store).
    The iOS app is working differently for me. Here is a picture of the purchased tab on the iBooks store in iOS Ibooks. Again notice that pictures of Lilly is still yet to be downloaded. This is how I expected it to look.
    If we visit the front page of iOS iBooks the view is very different from what I expected. Here we can see the 4 books I wanted to keep on my device and have downloaded. We can also see the 1 book I wanted to keep, but did not want to store locally on the device and left in iCloud (Pictures of Lilly). However we can also see all the books I had hidden from the purchased section of my iTunes account and which I believe should no-longer be visible, Dracula, frankenstein etc…
    I am aware of the hide iCloud books button within the iOS app, but I did not need to use this to hide the books I had removed from the my purchased section of the iBooks store on the mac, why are they still appearing in iOS?
    I’m still not sure if this is a software glitch or not. This article suggests to me that books can be hidden, but I had already completed these steps.
    https://support.apple.com/en-us/HT201322
    A browse of google also suggests people may have been able to hide past purchases from the front page of iBooks on iOS in the past.
    In case there was an issue with syncing I tried logging in and out of my iTunes account via settings in iOS. Force closing the app, disabling automatic downloads and removing my device from iTunes in the cloud. Syncing with iTunes on the mac did not correct the issue either.
    Interestingly I have the same issue on my iPhone 6 running iOS 8.3 as I do on my iPad mini suggesting that this might be an issue either with my account or with iOS iBooks software in general.
    If there is a way to remove the already hidden iBooks in your account from the front page of iBooks on iOS without using the hide iCloud downloads button? Please help community!
    iPhone 6, iOS 8.3, Also an issue on my iPad mini iOS 8

  • Can i make a book in iPhoto without using any of the built in layout templates, which are too limiting when i have already cropped my pictures to show just what I want. Ideally I just want to drag and drop and arrange and size the pictures myself

    Can i make a book in iPhoto without using any of the built in layout templates, which are too limiting when i have already cropped my pictures to show just what I want. Ideally I just want to drag and drop and arrange and size the pictures myself

    If you have Pages you can create customs pages for your book as TD suggested. If you have Pages from iWork 09 or 11 this app will add 80 or so additional frames to those offered:  Frames and Strokes Installer. Don't use it on the latest Pages version, however.
    This tutorial shows how to create a custom page with the theme's background: iP11 - Creating a Custom Page, with the Theme's Background for an iPhoto Book.  Once the page is complete to get it into iPhoto as a jpeg file follow these steps:
    Here's how to get any file into iPhoto as a jpeg file:
    1 - open the file in any application that will open it.
    2 - type Command+P to start the print process.
    3  - click on the PDF button and select "Save PDF to iPhoto".
    NOTE:  If you don't have any of those options go to Toad's Cellar and download these two files:
    Save PDF to iPhoto 200 DPI.workflow.zip
    Save PDF to iPhoto 300 DPI.workflow.zip
    Unzip the files and place in the HD/Library/PDF Services folder and reboot.
    4 - select either of the files above (300 dip is used for photos to be included in a book that will be ordered).
    5 - in the window that comes up enter an album name or select an existing album and hit the Continue button.
    That will create a 200 or 300 dpi jpeg file of the item being printed and import it into iPhoto. For books to be printed choose 300 dpi.

  • How to reference a class without using the new keyword

    I need to access some information from a class using the getter, but I don't want to use the new keyword because it will erase the information in the class. How can I reference the class without using the new keyword.
    ContactInfo c = new ContactInfo(); // problem is here because it erases the info in the class
    c.getFirstName();

    quedogf94 wrote:
    I need to access some information from a class using the getter, but I don't want to use the new keyword because it will erase the information in the class. How can I reference the class without using the new keyword.
    ContactInfo c = new ContactInfo(); // problem is here because it erases the info in the class
    c.getFirstName();No.
    Using new does not erase anything. There's nothing to erase. It's brand new. It creates a new instance, and whatever that constructor puts in there, is there. If you then change the contents of that instance, and you want to see them, you have to have maintained a reference to it somewhere, and access that instance's state through that reference.
    As already stated, you seem to be confused between class and instance, at the very least.
    Run this. Study the output carefully. Make sure you understand why you see what you do. Then, if you're still confused, try to rephrase your question in a way that makes some sense based on what you've observed.
    (And not that accessing a class (static) member through a reference, like foo1.getNumFoos() is syntactically legal, but is bad form, since it looks like you're accessing an instance (non-static) member. I do it here just for demonstration purposes.)
    public class Foo {
      private static int numFoos; // class variable
      private int x; // instance varaible
      public Foo(int x) {
        this.x = x;
        numFoos++;
      // class method
      public static int getNumFoos() {
        return numFoos;
      // instance method 
      public int getX() {
        return x;
      public static void main (String[] args) {
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ();
        Foo foo1 = new Foo(42);
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ("foo1.numFoos is " + foo1.getNumFoos ());
        System.out.println ("foo1.x is " + foo1.getX ());
        System.out.println ();
        Foo foo2 = new Foo(666);
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ("foo1.numFoos is " + foo1.getNumFoos ());
        System.out.println ("foo1.x is " + foo1.getX ());
        System.out.println ("foo2.numFoos is " + foo2.getNumFoos ());
        System.out.println ("foo2.x is " + foo2.getX ());
        System.out.println ();
    }

  • I want to upgrade my phone to the 4 or 4s.  My macs are still running Tiger.  If I bought an iPad 2, could I sync everything to it from the 4 without using a Mac at all, and then be able to iCloud my calendar and contacts, etc?

    I want to upgrade my phone to the 4 or 4s.  My macs are still running Tiger.  If I bought an iPad 2, could I sync everything to it from the 4 without using a Mac at all, and then be able to iCloud my calendar and contacts, etc?

    Radiation Mac wrote:
    And you must be using a recent version of iTunes on your iMac in order to activate the iPad,  So, no.
    You don't need a computer to activate a new iOS device anymore. Anything with iOS 5 can be activated over a WiFi network (or cellular if that applies).

  • HT4914 If I use I tunes match and have all my music on the cloud, will I be able to listen to it, meaning will it be on my device when I am without a cell or wifi signal....like on a plane or in an area without service?

    If I choose to use I tunes match, and store my music on the cloud, will I be able to access it when I don't have a cell signal or wifi?  For example, when I'm on a plane or in an area without a cell signal or wifi.  And, if its just cellular coverage, will it count as "data" against my limit?

    Yes, it would count against your data.  The transfer part is part of your cellular coverage, whether it be from Apple's iCloud or a totally unrelated feed.
    iTunes match - http://www.apple.com/itunes/itunes-match/ - see FAQ at end too
    "Does iTunes Match stream or download songs?
    On a computer, any songs stored in iCloud will stream over the air when played, though you can download them at any time by clicking the iCloud download button. iOS devices will start playing tracks from iCloud as they download and will store them so that you can listen to them later even if you don’t have a network connection. Apple TV only streams songs."
    So, from the above, if you are sitting in an airplane and suddenly decide you want to listen to a song that has not downloaded to your device then you will have to wait until you can use your service again (or pay the airline to use their wireless).

Maybe you are looking for

  • Issue with BUS2105 events

    Hi, I have Custom workflow and Business Object for BUS2105. It is working fine and generating and email notification for next user to take a decision on the PR. Now, the issue is when a user cancel the one release steps two events are getting trigger

  • Cannot open a document in adobe reader x

    I cannot open a document(.pdf)  under recent documents as i get an error message that the file cannot be found? Why?  I did open both of them the other day. Under recent files both of these documents are listed in duplicate. Thanks for your help.

  • Black border around jpegs even tho frame size set right

    Hi Can a friendly soul please tell me why my images are not the same width as my video footage. The project is set to "standard" at 720 by 576. When I set up the image prior to importing to CS3 i make sure they are the same 720 by 576. Yet after they

  • Why does the cursor disappear

    The cursor intermittently disappears on my imac. I use a mighty mouse. If I shoot to the bottom and then up again it comes back but this is frustrating and it also happens again soon after. Any proper solutions anyone?

  • Trying to generate a WCF Proxy - where is SlSvcUtil.exe?

    I was hoping/expecting to see SlSvcUtil.exe in Silverlight Beta2, but I can't seem to find it. I'd like to not have to "Add Service Reference". I can't find SlSvcUtil.exe. Did it a) Not ship with Beta2?, or b) I am not looking at the right place? Tha