TableCellRenderer, drawing to the object

i have hit a bit of a snag and need a recommendation......
i'm building an application that will allow the user to drag office cubicles onto a layout and move them around, etc. the list of available cubicles (sizes and such) are stored in a JTable and displayed on the left side as a single column.
The issue i have run into is in my cell renderer.
The user is able to create custom cubicle sizes/shapes in a seperate editor, these cubicles are then added to the table, i would like to be able to render scaled down versions of the cubicles inside the cells in the JTable as pictoral icons for each cube. inside my cell renderer class when i override the getTableCellRendererComponent method i am able to set the text, or apply an Icon but i can not get a Graphics hook to do any kind of drawing, which is what i need to do to create the scaled image of the cubicle. so i guess my question is, is it possible to draw to the TableCellRenderer object before returning it? since it is possible to write text or an icon and set the background color i am lead to believe that a Graphics context exists for the object although calls to getGraphics return null.
thanks for any insight.
-xian
another solution is to store a scaled icon object in each Cubicle object but again i need to create the Icon dynamically, is there an easy facility to draw to an Icon object?

thx for the response, i did give this a try, however since i am returning "this" it would only work for one cell, to use the paint method i would have to create a seperate instance of my cell renderer for every cubicle size and because the user can add additional cubicle sizes/shape at any time it is impossible for me to create the paint methods at run time....
i'm starting to think that pre-drawing the cubicle thumbnail to an ImageIcon and applying that to the JLabel may accually be the easiest way to go.
thanks!
-xian

Similar Messages

  • I am trying to copy a document and I keep getting the error "Can't paste the objects. The requested transformation would make some objects fall completely off the drawing area."

    I am trying to make duplicate documents with minor adjustments to each and when I try to copy the artwork from one document and paste it into the new document I keep getting the error "Can't paste the objects. The requested transformation would make some objects fall completely off the drawing area." Both documents are exactly the same size, res, color format etc. I even tried to drag and drop and get the same error message. Anyone know what I can do to resolve this issue?

    Try scaling the view size down to 6% or so and then do a Select All. See if there are objects off the artboard which may be causing this error. Most often you will see this if there were guides dragged from a ruler which were selected by dragging the white arrow and then deleted. This leaves the anchor points at the edge of the work area.

  • Please help. New CS 4 error: can't move the objects. the requested transformation would make some objects fall completely off the drawing area.

    I know this is not a "new" error message, but I have never gotten it on any previous version of Illustrator. I just upgraded to CS 4 and now get it on virtually every file when I try to nudge an object in any direction. Not that it should matter, but these are files that were created in earlier versions of Illustrator and I never had this problem. I have followed instructions from similar posts to no avail. I have zoomed way out to the edge of the art board: there are no hidden layers, objects, or guidelines, no lingering points from erased guidelines, or objects of any sort anywhere near the edge of the art board (which, I know, is enormous compared to the size of my working 11 x 17 document.)
    What am I missing?
    Also, on occasion, when I CAN nudge an object (usually a JPG or PDF image that I placed in the document), the image just disappears. I think it is still "there" though I cannot see it. Any suggestions?

    I am nudging it by selecting the object and hitting the up, down, or side arrows. Dragging with the mouse works fine, but does not give me the precision I'm looking for. Dragging with the mouse also avoids the "disappearing PDF/JPG" problem.
    I don't know what plug-ins I have. Possibly none.
    I don't use clipping masks. But I did select one object (and then ultimately selected all objects) and went to clipping mask, the "release" function was not active, so I am assuming there are no clipping masks in the document.
    I did attempt to select stray points, nada.
    I have not tried getting rid of the settings folder. Not sure how to do that?
    Also not sure how to take a screen shot to show you. I can tell you that there is only one layer and it is a very simple document with just a JPG image, a few objects and some text.
    Sorry! I hope this helps you help me, I normally just use a few simple tools to produce some basic documents.

  • How do I 'assign a higher layer to the object on the master' (page numbers on master) I understand the layer needs to be at the top to show above placed images on pages but how do I do this?

    I've added the page numbers to my master pages. They are displaying on the pages but I have images on the individual pages that are covering the numbers. I understand I need to assign a higher layer to the object but I don't understand how to do that. Please help me? Please explain a simply clearly as possible, I've read other answers but still don't understand. Wish it was as simple as select object, right click, edit layer!
    Many thanks!

    Layers panel;
    Create new layer
    Switch to Master page
    Make sure new layer is on top in the Layers panel, if not drag the layer on top in the Layers panel.
    Select (click once on) that top layer (pen symbol appears behind that layer in the Layer panel)
    Now draw your page numbers etc on the Mastet page
    From now on, select (click once on) any Layer in the Layers panel that is below the layer you used on your Master page items and create new objects in your document pages.
    If you accidently created objects on a 'wrong' layer:
    Select those objects
    You will see a square behind the layers name in the Layers panel
    Click and hold the mouse on that square and drag it behind the name of the layer you want to move the objects to.
    Buy a book about InDesign and start learning these basic principles!

  • How can i convert the object to class~~~????

    recently i develop UML drawing tool for drawing UML diagram, i now design a program structure. now i have already defined many classes that represent each shape in UML. each class stores data of the related shape. then i use a vector to store all shape as follow;
    Vector shape = new Vector();
    shape.addElement(useCase); \\useCase is a Class i defined
    shape.addElement(actor);\\actor is a Class i defined
    now i want to use all shape's methods stored in the vector before how can i do that in general ways?
    i don't want to code like this;
    Object o = shape.elementAt(a);
    if (o instanceof UseCase)
    if (o instanceof Actor)
    because i have many classed!! can u all professional help me? i am just a beginer of java programming student

    Sounds like you need to use an inheritance structure...
    Setup a generic class that contains methods (probably blank) which each class (such as actor, useCase) will inherit from. Then make actor/useCase inherit from this base class and provide specific code in each of the general methods.
    Then when you retrieve your object from the class, you can cast it as your generic class and access the general methods without caring what the actual class is.
    Eg. Basic class "shape". has empty methods "draw" and "setPosition". Class "circle" and "square" both extend "shape" and provide specific implementations of setPosition and draw methods. You can then cast them as class type shape and do draw() and setPosition methods without caring about what type the object actually is.

  • How do you have two classes drawing to the same JPanel? Graphics g problem

    Hi all,
    This is probably a five second answer but im really stuck on it!
    How do i have two classes both writing to the same JPanel?
    I have one class that extends JPanel and using Graphics g, draws to the panel ie g.drawString(..);
    But i would like another class to draw to the same panel, so that the two different classes can both draw what they like to the JPanel.
    How do i do this?
    I have tried sending the Graphics g object from the one class to the other but only the original class draws still. I was thinking perhaps if it carn't be done could i have a JPanel on top of the other one that is transparent so there would be a tracing paper effect?
    Many thanks

    I have tried sending the Graphics g object from the
    one class to the other but only the original class
    draws still. I was thinking perhaps if it carn't beThis is the right idea. One problem you may be running into is that JPanel fills in its background with the background color by default. If you switch and use JComponent instead of JPanel you may get better results. Another idea is to use a "painter": a class that has a paint(Graphics g) but is not a component and just paints on a component. I've done this before in implementing Tetris where the dropping piece is a class which can paint itself but is not a component.

  • Drawing with the line or shape tools

    This question was posted in response to the following article: http://help.adobe.com/en_US/indesign/cs/using/WSa285fff53dea4f8617383751001ea8cb3f-6c1fa.h tml

    There are two 'rectangle' tools The top one draws a rectangle with a "Graphic" content -- having an 'X' to indicate this --, the bottom one draws a rectangle with an "Undefined" content. Apart from the content type, there is also a difference in the graphic style assigned. The top one gets '[None]' (and it's usually totally blank, no fill and no stroke), the bottom one gets '[Basic Graphics Frame]' (usually the colors in the Fill/Stroke color proxy at the bottom of the tool palette).
    You presumably were using the top rectangle first, then switched to the bottom one.
    In any case, apart from the default color and graphic style, it really doesn't matter which one you use. If you like to see the cross, select your rectangle and change its content type to "Graphic" ("Content" is under the Object menu).
    Now you mention it: a Graphics rectangle gets the style [None], whereas an Undefined rectangle gets a style [Basic Graphics Frame]. Kind of unnecessary complication, if you ask me

  • # of objects, not the size of the objects, determine size of a Collection

    There are objects, and references to objects.
    Do, List / Set / Map , etc. just maintain a list of 32-bit addresses for their contained objects? What more does a Collection need, memory-wise, to add an element? The size of the objects in a Collection should not matter?
    listA.add(new Integer(2));  // listA size grows by 32-bits
    listB.add(new GiantSizedClass());  // listB size grows by 32-bitsI started thinking about Collections being able to dynamically grow in runtime. I heard this is complex, but it "looks" like all you do is append a memory address and incriment a counter? This sounds quick, easy, and incorrect. I don't understand. Thanks.

    jverd, ejp: you have always been there with quick responses to help me. ejp, i purchased your book "Fundamental Networking in Java". When I start programming again, your book about RMI is on my list. that said.
    with all sincerity. i belived that serliazing objects in byte[] allows for storing objects in objects, not object references in objects. here is my test code (just cut/paste):
    My idea seems similars to me as cryogenics and so that is the theme of my test code (and it is my favourite movie). note: this code is "proof of concept" and is exetremely hacked together.
    public class Test {
      private static HashMap<String, byte[]> barracks = new HashMap<String, byte[]>();
      public static void main(String[] args) {
        try {  new Test().go();  }   catch(Exception e) {  e.printStackTrace();  }
      public void go() throws Exception {
        Employee empl = new Employee("Dallas", "Captain");
        barracks.put(empl.name, cryogenicallyFreeze(empl));
        empl = new Employee("Kane", "Navigator");
        barracks.put(empl.name, cryogenicallyFreeze(empl));
        empl = new Employee("Ripley", "First Officer");
        barracks.put(empl.name, cryogenicallyFreeze(empl));
        empl = new Employee("Ash", "Science Officer");
        barracks.put(empl.name, cryogenicallyFreeze(empl));
        System.out.println("___log file___");System.out.println(".........");
        int id = (int) (System.currentTimeMillis() % barracks.size());
        System.out.println("[Nostromo]: emergency id #"+id+". Re-animation initiated...");
        switch (id) {
          case 0: empl = (Employee) reanimate("Dallas"); break;
          case 1: empl = (Employee) reanimate("Kane"); break;
          case 2: empl = (Employee) reanimate("Ash"); break;
          case 3: empl = (Employee) reanimate("Ripley");
        System.out.println("[Nostromo]: \"" + empl.name + "\" in command.");
        System.out.println("["+empl.name+"]: Hello. I was an object, not a reference, stored in a collection.");
        System.out.println();
        public static Employee reanimate(String name) throws Exception {
            PipedOutputStream pout = new PipedOutputStream();
            PipedInputStream pin = new PipedInputStream(pout);
            byte[] frozenEmpl = (byte[]) barracks.get(name);
            pout.write(frozenEmpl);
            ObjectInputStream ois = new ObjectInputStream(pin);
            return ((Employee) ois.readObject());
        public static byte[] cryogenicallyFreeze(Employee emp) throws Exception {
            PipedOutputStream pout = new PipedOutputStream();
            PipedInputStream pin = new PipedInputStream(pout);
            ObjectOutputStream oos = new ObjectOutputStream(pout);
            oos.writeObject(emp);
            byte[] frozenEmpl = new byte[pin.available()];
            pin.read(frozenEmpl);
            return frozenEmpl;
          public static class Employee implements Serializable {
            String name; String title;
            Employee(String n, String t) {  name = n; title = t;  }
    }"inside" of each byte[] object is an "Employee" object? I can't see it any other way. But I am not the sharpest pencil in the drawer...I'm on vacation from coding for a while. maybe i will get it when i start again. thanks.
    Edited by: rdkh on Jan 29, 2010 3:53 AM

  • Error Illustrator-"Cna't paste the objects."

    Our designer is using Illustrator 10, OS - Window XP Professional, HP core 2 duo, 2GB RAM, 20 GB free disk space. After using the software for a while it will give an error message when the graphic artist tries to "PLACE" a tiff file on the Illustrator software. The graphis artist also use Photoshop and is also open when this error occurs.
    The exact error message is "Can't paste the objects. The requested transformation would make some objects fall completely out of the drawing area. "
    We have another artist, the same exact installation. But does not have this problem. Please help because I cant find out why this happens. They have the same specs of computer and version of the software used. They both have different ACtions which they made for he graphic design that they do.

    Try scaling the view size down to 6% or so and then do a Select All. See if there are objects off the artboard which may be causing this error. Most often you will see this if there were guides dragged from a ruler which were selected by dragging the white arrow and then deleted. This leaves the anchor points at the edge of the work area.

  • Where is the Object/Merge tool

    I've watched the online video that demonstrates how to change drawing mode of objects in Flash CS4. I tried to locate the Object/Merge tool that's demonstrated on the toolbar in my version of Flash and it's not there. Do I need to make a setting elsewhere to make this tool appear?
    Can anyone suggest a reason why I may be missing a tool? I've attached a screen capture of the toolbar.
    Thanks.
    Grace Daminato

    Never mind - I played around some more and discovered that the Object/Merge tool appears if I select the rectangle (or ellipse) tool instead of the rectangle primitive.
    Thanks you.
    Grace

  • Drawing a Graphics object on a Graphics object

    Is there anyway to draw a Graphics object on another Graphics object? I'm trying to show 2 screens, side by side, on a Canvas and I'm trying to cheat a little :-P Basically, I want to take half of one screen and half of another and put them on top of each other to form one screen.
    OR is there a way to turn a Graphics object into an Image object?

    I'm not sure if this is what you're after, but you can
    - create an offscreen image using "createImage(int width, int height)" method of a Component , then
    - obtain the graphics context of the offscreen image using "getGraphics()",
    - you can then draw onto the offscreen image using the graphics context.
    hope that helps. =)

  • Adobe Form - Path of the context field from the object pallate

    Hi,
    I am trying to modify the standard adobe(MR_PRINT_INSERS) form as per the requirement.
    There are many tables and fields in the context.
    I want to know the path to which the the UI elements(library pallate) are binded.
    I can see the field name in object pallate but the place from where that object is taken is not shown.
    For Eg: I can see the field WRBTR in the object pallate of the text UI element of library pallate but I couldnot figure it out from which table of context they are reffering, as their are many tables in the context which have WRBTR.
    Can you please let me know how to figure out exact path to which table the field is binded.
    Thanks & Regards,
    kiran Kumar K

    Hi Tamas,
    I checked the mentioned form and, as this table is setted as TABLEROW and some of its cells are static, is not possible to change the column size in the layout or even though changing it directly in the XML file, cell by cell. I was trying it.
    For example, choose the Cell6 of TABLEROW[0] and click on tab 'XML Source'. You will see this statement:
    <draw colSpan="3" h="16.3166mm" name="Cell7" w="22.225mm">
    You can try to change the value 'colSpan' according to your requirement.
    This table size is not modifiable because it was developed to it.
    I believe that Diego's suggestion can help in this case, if you are having problems to print the entire table on the page.
    Regards,
    Lucas Comassetto.

  • Can not call a static function with-in a instance of the object.

    Another FYI.
    I wanted to keep all of the "option" input parameters values for a new object that
    i am creating in one place. I thought that the easiest way would be to use a
    static function that returns a value; one function for each option value.
    I was looking for a way to define "constants" that are not stored in
    the persistent data of the object, but could be reference each time
    the object is used.
    After creating the static functions in both the "type" and "body" components,
    I created the method that acutally receives the option input values.
    In this method I used a "case" statement. I tested the input parameter
    value, which should be one of the option values.
    I used a set of "WHEN conditions" that called the same
    static functions to get the exact same values that the user should
    pass in.
    When I try to store this new version, I get the error:
    "PLS-00587: a static method cannot be invoked on an instance value"
    It points to the first "when statifc_function()" of the case function.
    This seems weird!
    If I can call the static method from the "type object" without creating
    and instance of an object, then why can't I call it within the body
    of a method of an instance of the object type?
    This doesn't seem appropriate,
    unless this implementation of objects is trying to avoid some type
    of "recursion"?
    If there is some other reason, I can not think of it.
    Any ideas?

    Sorry for the confusion. Here is the simplest example of what
    I want to accomplish.
    The anonymous block is a testing of the object type, which definition follows.
    declare
    test audit_info;
    begin
    test := audit_info(...);
    test.testcall( audit_info.t_EMPLOYER() );
    end;
    -- * ========================================== * --
    create or replace type audit_info as object
    ( seq_key integer
    , static function t_EMPLOYER return varchar2
    , member procedure test_call(input_type varchar2)
    instantiable
    final;
    create or replace type body audit_info
    as
    ( id audit_info
    static function t_EMPLOYER return varchar2
    as
    begin
    return 'EMPLOYER';
    end;
    member procedure test_call(input_type varchar2)
    as
    begin
    CASE input_type
    WHEN t_EMPLOYER()
    select * from dual;
    WHEN ...
    end case;
    end;
    end;
    The error occurs on the "WHEN t_EMPLOYER()" line. This code is only
    an example.
    Thanks.

  • Not able to see the objects in DSO Display but available in object list

    Hi All,
    I am facing a weird  issue in DSO.
    When I am right clicking DSO and selecting the Object list I am able to see all the (30) objects, 
    But when I am right clicking the same DSO and selecting Display I am able to see only some objects (20) objects.
    DSO is in Active and execute  version only.
    Can any one tell me what may be reason for that.  Because whenever I am trying to transport I am getting the error.
    Regards
    Sankar

    Hi,
    U get error when u activate the so in original system or only while u try to transport it?
    what does th error message say ...are those info objects u are trying to add in active state?... If u are deleting any info object from the dso make sre u have deleted the data from that dso in the terget system before the transport
    Regards,
    Rathy

  • 1)Now I use Lightrom 5.7 how to upgrade to 6 or CC? 2) What is the difference between 6 and CC vercion? 3) When I used lightromm 3, I could see inEXIF the distance in meters till the object I took, in the later virsions that function disappeared, it is ve

    1)Now I use Lightrom 5.7 how to upgrade to 6 or CC?
    2) What is the difference between 6 and CC version?
    3) When I used lightromm 3, I could see in EXIF the distance in meters till the object I took, in the later virsions that function disappeared, it is very sad  I am stiil waiting and hope that it would be possibble in the new  versions. Or this indication may  possible by setting?

    1)Now I use Lightrom 5.7 how to upgrade to 6 or CC?
    Purchase the standalone upgrade from here: Products
    Download CC version from here: Explore Adobe desktop apps | Adobe Creative Cloud
    2) What is the difference between 6 and CC version?
    See this comparison chart: Compare Lightroom versions | Adobe Photoshop Lightroom CC
    3) When I used lightromm 3, I could see in EXIF the distance in meters till the object I took, in the later virsions that function disappeared, it is very sad  I am stiil waiting and hope that it would be possibble in the new  versions. Or this indication may  possible by setting?
    Rob Cole's ExifMeta plugin displays the Subject Distance field (and much more).  Unfortunately, his Web site appears to be down again.  He used to be very active here, but he hasn't posted in several months.

Maybe you are looking for

  • How to set the DVD Folder Path?

    Hello, had a quick question regarding the folder path variable when accessing DVD video files. When authoring, Director seems to automatically add a hardcoded file Name to the cast member properties, as well as a folder path to the DVD member propert

  • A simple query in My SQL what is the similer query for that in Oracle ???

    hello friends In My Sql if i have 1000 records in a table and i want to get the records from 400 to 550 then it is posible by giving the following query Select * from Table a , table b where condition "List 400,550" gives the records from 400 to 550

  • Currency in Rebate Agreement is different to Curr. required for Credit Memo

    Hello! I have a question regarding Rebate Agreements. We have clients with whom we have Rebate Agreements in USD, but clients are chilean so the Credit Memo is meant to be in Chilean Pesos. But there is apparently no possiblity to change the currency

  • RSA Web Agent & SGD 4.71

    I'm trying to configure SGD 4.71 for web authentication using the RSA Web Agent 7.1. In the SGD documentation it refers to an environment variable that is set by the SA agent but I don't see any mwntion of it in the RSA documentation. Can anyone poin

  • Logitech C910HD webcam not working in Mac OSX 10.6.6

    I'm currently using Mac OSX 10.6.6 and flash  10.1.102.64. My problem occurs in the most recent versions of Safari, Firefox, and Chrome. I am able to select my cam by exact name in the settings for video and as an unknown usb device for audio with it