Change objects between 2 Vectors

Voor mijn programma gebruik 2 Vectors (in klasse Schuif en Speelveld). In deze Vectors staan objecten van de klasse Steen (Een canvas, vierkantje met achtergrond).
How do I change a object Stone in Vector Playfield to Vector Slider and
substitute it for the first object Stone in Vector Slider and the substituted object Stone comes in for object Stone in Vector Playfield.
Vector Playfield Vector Slider
| | Steen | |
| | <----------> | |
| | | |
Or can i use something better than Vectors, like ArrayList???
I hope it's a little bit clear :S
Thanks in advance

Here is some of my code. Here i want to change 2 stones from place. This doesnot even work :-S
When I call the method verPlaatsStenen(), my app is hanging... :-S
How can i change 2 stones from place, just on the Playfield.
import java.awt.*;
import java.util.*;
public class Speelveld extends Panel
     //private Steen[][] veld;
     //private Vector veldX = new Vector(5);
     private ArrayList veldX = new ArrayList(5);
     private Color[] kleuren = { Color.blue,
                                        Color.yellow,
                                        Color.pink,
                                        Color.cyan,
                                        Color.green,
                                        Color.magenta,
                                        Color.red,
                                        Color.black,
                                        Color.black };
     public Speelveld()
          setLayout(null);
          setBackground(Color.black);
          for (int a =0; a < 5; a++)
               for (int b = 0; b < 9; b++)
                    //veldX.add(a, new Vector(9));
                    veldX.add(a, new ArrayList(9));
          for (int a =0; a < 5; a++)
               for (int b = 0; b < 9; b++)
                    //((Vector)veldX.get(a)).add(b, new Steen(kleuren));
                    ((ArrayList)veldX.get(a)).add(b, new Steen(kleuren[b]));
          maakVeld();
     public void maakVeld()
          for (int x = 0; x < 5; x++)
               for (int y = 0; y < 9; y++)
                    //Steen steen = (Steen)((Vector)veldX.get(x)).get(y);
                    Steen steen = (Steen)((ArrayList)veldX.get(x)).get(y);
                    //steen.setPositie((x * 45) + 10, (y * 45) + 10);
                    add(steen);
                    /*veld[x][y] = new Steen(kleuren[y]);
                    veld[x][y].setPositie((x * 45) + 10, (y * 45) + 10);
                    add(veld[x][y]);*/
     /*public Steen getSteen(int rij)
          return (Steen)((Vector)veldX.get(0)).remove(rij);
     public void setSteen(Steen steen, int rij)
          ((Vector)veldX.get(1)).add(rij,steen);
          maakVeld();
     public void verplaatsStenen()
          //Steen steen1, steen2;
          Steen[] temp = new Steen[2];
          temp[0] = (Steen)((Vector)veldX.get(3)).get(7);
          temp[1] = (Steen)((Vector)veldX.get(4)).get(2);
          ((Vector)veldX.get(3)).remove(7);
          ((Vector)veldX.get(4)).remove(2);
          ((Vector)veldX.get(4)).add(7, temp[1]);
          maakVeld();

Similar Messages

  • Urgent please. How to make objects to vector? CS6

    Hi please urgent, the printing press for signboard is looking for an vector of my design there are waiting for me right now. I send them the .eps format. I use pen tool for making different curves and shapes. How can I make it to a vector?
    Here is the .eps file
    http://www.solidfiles.com/d/5164de41a2/

    It's not clear what kind of production workflow will happen.
    Exactly. (At last!)
    Hi please urgent...
    Given the "urgentcy" I'll first ask you to forgive my being a little rough. None of this is meant to offend. It's meant to teach with some appropriate pointedness, hopefully to the benefit of all who come here having got themselves into similar jams. So be a little thick-skinned in reading this, but take it seriously. It's sound advice. It's good advice. It's given freely and represents considerable time, and so I consider myself at liberty to phrase it the way I see fit.
    This is how you (and many others) get into trouble. Failure to read instructions. Failure to become familiarized with the basic principles and mechanics of a reproduction method before charging customers for designing for those methods. Then relying upon user forums for answers to get you out of a jam, when there is no guarantee that others on a user forum know any more than you do. Wrong or incomplete "answers" here are at least as common as correct answers.
    Your situation is no more "urgent" than most who come here with questions.
    I send them the .eps format.
    EPS is Encapsulated PostScript. EPS (like PostScript) can contain any combination of raster, vector, or text objects. Think of EPS as just a "container." Just because a file is EPS does not necessarily mean its content is entirely vector paths.
    I use pen tool for making different curves and shapes.
    You used the Pen tool for drawing a few simple closed paths. You combined some of those simple paths into compound paths. You converted some text to paths. Those objects are vector paths which can be translated to HPGL instructions which a typical vinyl cutter can use to direct its cutting blade.
    But then you filled some of those objects with graduated fills. Grad fills are common constructs and can be thought of as "vector in nature" (resolution independent) in that they are mathematically-described printing instructions. But that is not something that can be reproduced by cutting pieces our of solid-colored vinyl sheet material.
    Then you applied raster-based effects (the fuzzy drop-shadows) to some of those vector-based paths.
    Plus, the compound paths in the EPS file contain raster images used as transparency masks for the shading. Like grad fills, raster images cannot be rendered by cutting a shape out of solid-colored vinyl. And Draw X4 isn't going to know what to do with that construct.
    So you are not delivering just vector-based paths in this file, no matter what file format in which you save it.
    Whenever you deliver a file for sign cutting/printing:
    Know the limitations of the sign shop you are using and its kind of equipment. Some sign shops only cut solid-colored vinyl on an HPGL-driven cutter. Other sign shops have more expensive equipment which can print raster images or grad tones onto vinyl first, and then cut the printed vinyl to shape after. Some sign shops use separate equipment for those two operations. Just as in print, you can't know how to properly prepare something for a particular output workflow unless you have at least a basic understanding of the operations involved.
    Ask the sign shop what software and version it is using. Ask what formats and versions their software can open/import.
    Best practice: Have your own copy of the software the sign shop will be using. (CorelDraw can be had by any Illustrator user at a modest competitive side-grade price, and you receive alot of other useful stuff in the deal. Any designer frequently delivering files to sign shops should make this investment.) That way, you can see what they will actually be dealing with before you send it.
    Failing that, at the very least re-open the file that you export from Illustrator in Illustrator before sending it so you can see what kind of objects you are actually sending. If you Open your EPS in Illustrator and tear it apart, you'll see the objects that I described above.
    "Dumb down" your content to the "lowest common denominator" constructs. When it comes down to it, almost everything in graphics boils down to simple vector paths, compound vector paths, vector paths used as clipping paths, raster images, and text objects. Avoid proprietary software-specific constructs like meshes and effects. Figure out the most basic and fewest kinds of objects required to build the graphic.
    Make sure you do not use compression on the file that you export.
    How can I make it to a vector?
    First, do not say "a vector." A vector-based graphics file is not "a vector." "A vector" is a direction, usually associated with a force. A vector-based graphics file is a collection of vector-based paths. "Vector path" or "vector drawing" or "vector file" are shorthand terms using the word "vector" as an adjective (modifying the path, drawing, or file), not a noun. This is not just a pet peeve of mine. It's one of those dead giveaways of beginners who usually don't really understand what they're dealing with.
    I sent them the .pdf format...
    A PDF file is like an EPS file in that it is also a "container" which may contain any combination of any number of vector paths, raster images, or text objects (as well as many other constructs, such as data fields).
    ...but they are still asking for the .esp....he will do it using CorelDraw X4...
    Just as there are designers selling services they don't understand, there are sign shops using software they don't understand. Smart designers working with such shops learn to watch for the "tell tale" signs of amateurism in the output houses they use.
    CorelDraw X4 can indeed "open" (i.e.; translate into its native constructs) PDF, EPS, and AI, so long as:
    The files are not newer versions which the particular version of CorelDraw predates.
    The files do not include Illustrator-native constructs which CorelDraw does not understand.
    (This is not because Illustrator is in any way "superior"; the same general principles apply when exchanging files in the other direction. Each software has its own proprietary constructs for which the others don't have a directly corresponding native construct.)
    CorelDraw dominates in the sign business (and for good reason). But sign shops are notorious for not keeping their Corel software up-to-date. Current version of Draw is X6, and a new version is no doubt just around the corner. You are using Illustrator CS6. You just need to save your Illustrator files back to an earlier format and CorelDraw X4 can open them. In fact, I just:
    Opened your EPS file in Illustrator CS3.
    Saved as Illustrator 8.
    Saved as PDF 1.3 (Acrobat 4)
    Opened both the PDF and the AI file in CorelDraw X3, with nothing missing.
    Why did this work? Because in saving back to earlier versions, the content was automatically "dumbed down" (deconstructed) to the more basic building blocks of graphics: Separate vector paths and raster images.
    Understand, this is still not ideal, because leaving that deconstruction to automated routines still results in needlessly messy and fragmented content. For example, when opened in CorelDraw, the AI 8 file contains 36 vector paths and 53 individual raster images. (This is not Draw's fault. It's what was exported from AI to the legacy format.)
    ...after I send the vector .eps format he said "which you send eps it open but not it vector it has more part" What he mean by it has more part?
    He meant there are objects in the design which are missing in the file you sent him after opening in Draw. That's because you did not save back to an earlier format which would deconstruct the file to more basic elements.
    He said "I have to cut acrylic & then the sticker printing...
    I'm assuming that he means cutting from vinyl adhesive film (although it's quite possible he does indeed mean acrylic plastic sheeting for a fabricated sign.) This implies (although it's still not certain from the poor wording) that the sign shop is not limited to just cutting sign vinyl, but also has the ability to print onto sign vinyl (to accommodate the grads and raster-based shading). Based on those assumptions, you still have some qestions to answer. Think of the basic operations. Think like the device(s) that have to build the physical sign:
    The solid-filled vector paths can be cut from sheets of solid-filled colored vinyl. The cut vinyl can then be applied to the (assumed) white sign board. That part is simple.
    The grad filled objects can be printed on white vinyl and then cut to shape. But there are three problems:
    Registration of print to cut. What if the printing and cutting are done in separate operations? Just as in offset printing traps and/or bleeds are typically included to allow for slight mis-registration of abutting colors, a similar trap or bleed may be required to allow for slight mis-registration between the printed grad fills and the paths which will then cut around them.
    How do you intend the drop shadows to be handled? They are graduated, so they will have to be printed. But then what? How do you cut to shape a soft fuzzy edged image from a solid piece of material? Where will the cut be made? Obviously, it has to be cut beyond the edges of the fuzzy printed image. But where? Will the whole graphic that involves the graduated fills and transparency masks (the circles, three curves, and drop shadows) be simply printed onto a piece of white vinyl and then that white vinly be cut to a single circular or rectangular shape? Or will it be cut to an offset contour running parallel to the outer edges of the whole graphic? If so, can you live with the visibility of that cut edge which is not actually part of the design? What about when that cut edge becomes more visible (as it will in the real world, especially if deployed outdoors)? Either way, you have not provided a cut path for the drop shadow portion at all.
    Or do you want the entire design to be rendered on a single sheet of vinly so as to avoid that problem of a cut edge outside the bounds of the drop shadows? If so, you don't need any vector content at all. The whole thing could just be one big raster image.
    Crosscuts: Back to the assumption that you do intend for the smaller graphic to be cut out of individual shapes, you have two dark blue vector paths overlapping. If the cutter blade follows those two paths, then they will be cut up into five separate pieces. Those paths should have been unioned into one path. A similar overlap situation exists between two green paths. unnecessary crosscuts are a bad thing in sign vinyl. Climate changes can cause slivers or peeling to appear between the unecessary cuts.
    Overlaps: Overlapping vinyl pieces can also be problematic in built-up multi-layer vinyl signs. The vinyl is usually glossy and lighting can cause the bumps at overlaps to become distractingly visible. Where that is considered a possible issue, path operations should be used to "punch" different-colored paths from each other, and then appropriate offsets added to accommodate registration, much like building traps in offset printing.
    (The above considerations are among the reasons why proper logo designs are intentionally designed as line art to avoid dependency upon graduated effects. If essential to the design, graduated effects are not just problematic for signage, but also for low-res printing like flexography, engraving on plaques or writing pens, single-color printing, screen printing, and other common needs.)
    So to do this right, you have some decisions to make:
    If this design is to be rendered from individual cut vinyl pieces adhered to a white substrate, especially for outdoor use, I would:
    Convert to solid-colored line art. Ditch the drop shadows and grad fills altogether.
    Union the two overlapping dark blue paths.
    Union the two overlapping green paths.
    Punch the green and light blue paths from the dark blue paths.
    Create offset paths of the green and light blue paths. Intersect these with the dark blue paths. Union the intersections with the green and light blue paths.
    Assemble in this order: Light blue, green, dark blue. This would provide a slight "trap" of the two ligher colors underneath the dark blue where they "kiss."
    The above treatment would be the simplest and most outdoor-durable since no printing is involved.
    If this design is to be rendered from individual cut vinyl pieces adhered to a white substrate, but I insisted on the grad fills and drop shadows, I would:
    Provide one raster image consisting of the small graphic.
    Provide one vector cut path for that image.
    Povide solid-filled cut paths for everything else.
    JET

  • Questions on scripts, tables & transfer objects between clients.

    1. In script, how to use the same print program for two different layouts? with procedure.!
    2. Why cant sapscripts be client independent.?
    3. Want to maintain a table in dev server and if i update the data, it should simultanously update in Quality and Production servers. How? please explain in details.
    4. How to transfer object between clients.? explain.
    Points will be promptly rewarded for HELPFULL answers.!

    Hi!
    3. With SE01, you can create a transport request for all table entries.
    SE01 - Create button - Workbench request - Give description and save
    Select the created request and click on Display object list.
    Click on Display - Change button
    Insert line button
    ProgID: R3TR
    Object: TABU
    Object name: Z_YOUR_TABLE
    Double click on the table name
    Insert line
    Key: *
    Save everything
    Release the transport in SE10 transaction and transport with STMS transaction.
    Regards
    Tamá

  • Difference between vector obj.clear() and Vector obj = null

    What is the difference between clearing the Vector object with .clear() method and assigning null value to Vector object?
    As per memory point of view, is it advisable to first clear vector and then assaign it to null for garbage collection or it doesn't make any difference.
    Vector may contains large volume of data.
    Please reply this if any one has fair idea regarding this.
    Thanks in advance.
    Deepalee

    What is the difference between clearing the Vector
    object with .clear() method and assigning null value
    to Vector object?
    Vector victor = new Vector(); //victor is a reference to a Vector object
    victor.clear(); //now that Vector object has no elements
    victor = null; //now victor is a null reference; it doesn't point to any Vector object
    //if that was the only reference to that Vector, the Vector is now available to be GC'ed.
    As per memory point of view, is it advisable to first
    clear vector and then assaign it to null for garbage
    collection or it doesn't make any difference.Hard to say. My gut says there will be no advantages to first clearing it. You'd have to try and measure.

  • Using Smart objects between documents

    I know how to make smart objects within a single document, but Is it possible to use Smart objects between separate psd files?
    I would like to create a master background file and have any changes made to this updated throughout all the other psd documents that contain this.
    I cant find any info on this...Can it be done?
    thanks
    Jeff

    No a smart object layer contains a copy of the original in the layer.  If you then change the orignal the copy in the smart object layer is not updated and if you change the copy in the smart object layer the original is not changed. Smart Object are independant from the original.  It is posible to have multipal smart object layers that contain the same smart object in a single document. You can change the single smart object from any of the layers that its in.  You can also have independant smart object layers of the same image. That the difference between dupeing a smart object layer and using menu layers>smart objects>new smart object via copy. 

  • Enlarged Smart Objects with vectors inside them appear as resized bitmaps

    In Photoshop CC for Mac I have...
    Created layers of vector art
    Combined them into a smart object
    Enlarged the smart object (both via "Transform" and "Image Size")
    Upon enlarging, the vector objects look the way an enlarged bitmap would (i.e. fuzzy, pixelated, terrible) instead of crisp and clean as a vector should look. I've double- and triple-checked to make sure all layers have remained vector after resizing and they have.
    This is a terrible inconvenience for anyone that works heavily with vector smart objects and resizes them. I use this workflow on a daily basis to make adapting interface elements for various screen resolutions easier, without it I am beyond screwed.
    If anyone knows a workaround (or if this requires a setting that I haven't found to be changed) please let me know.
    Screenshot proof below:

    Read this thread -link http://forums.adobe.com/message/3498406#3498406
    you may want to read it from the beginning.
    Basically while a smart object layer embedded object may contain  vector graphics.  Photoshop renders a composite for the embedded object and uses the resulting rendered pixels for the smart object layers pixels.  When you transform a smart object layer your transforming those pixels like raster layer using your Photoshop preference interpolation preference..  If you want to resize the vector graphics contained in the embedded object you must open the embedded object into the approbate application and resize the embedded object using vector tools. After you commit the resize. Photoshop will update the embedded object and the layers pixel will be the composite rendered for the updated resized embedded object.

  • Sharing an object between other objects?

    I have two classes, say DisplayPanel and ControlPanel. Both of these classes need to have access to a single instance of an object of type Data, say theData. I want to be able to set theData to a new object at any time, for example, theData = new KindOfData().
    If I store a reference to theData in both objects, when I set theData to a new object in one class, the other will still reference the old object. Is there a way to share an object between two classes as I described?
    I could create a superclass for DisplayPanel and ControlPanel that contains an instance of Data, however I may need to access this object in other classes and do not want to have the inflexibility of having to extend a possibly unrelated class just to access a single data member.
    Is there any easy way to go about this? Thanks for your help.

    Create a listener interface. Make each class implement that interface. When you create each class, register it as a listener to theData. Keep track of all listeners in a List such as an ArrayList. When you want to change theData, iterate through the List and call the interface's method to update theData in each class:
    public interface SomeListener
       void updateData(KindOfData theData);
    public class DisplayPanel implements SomeListener
      private KindOfData theData;
      public void updateData(KindOfData newData)
         theData = newData;
    public class SomeOtherClass
       private List listenerList = new ArrayList();
       public void addDataListener(SomeListener listener)
            listenerList.add(listener);
       public void fireDataChange(KindOfData newData)
           for (Iterator listenerIter = listenerList.iterator();
                  listenerIter.hasNext();
               ((DataListener)listenerIter.next()).updateData(newData);
    }Look at how EventListeners are added and fired in Swing classes.

  • Cannot recolor artwork for all objects in Vector?

    Hello All,
    I used Live Trace to create a Vector. On some of the objects in Vector I can recolor artwork, but others there is no options to recolor. Does anyone know why and is it possible to see recolor options for all objects?

    Recolor artwork is a great tool for recoloring specific colors in the artwork without having to select specific objects and and change the swatch used for that object. If you select all, and enter the recolor function you should see all the swatches for all the selected art, and change a swatch color throughout the artwork. There is much more to this function, but for what you're doing this is a quick easy way to effect color changes to all objects colored with a specific swatch. Check the on line help, Help>Illustrator Help for more on recoloring.
    Here is a Tutorial if you're intrested too.
    http://rwillustrator.blogspot.com/2009/01/tutorial-recoloring-artwork.html

  • Why org vaues is not updating the Changed Objects

    hi all,
    we have a master role with some some objects as maintained and some as changed  and some as standard.
    when i derived some 10 child roles and added org values. this org value is not pusing for the changed objects, even when i add it in the field, once if i make any other  modification in the master role and distribute it to child roles then all the org values for the changed objects are going to blank again
    so, org values wont push or work for changed objects?  please help
    thanks,
    SSS

    >
    sun wrote:
    > can you tell the difference between maintained and changed in PFCg
    >
    Hi Sun,
    Is it a coincidence that the objects having ORG level fields are in changed state in the master role or is it becasue of the SAP feature?
    When we directly maintain ORG fileds in objects and NOT in the specified ORG window, then
    first - > the object status goes to changed
    second -> when you create derived roles, that field will not be maintained in the derived role even though you maintain ORG values in derived roles. The value maintained in the master role is passed to the child role.
    What you need to do is follow what Jurjen said..... first ... fix the messed up master role, and then maintain the ORG values in the derived roles.
    Hope this helps
    Abhishek

  • OMBEXPORT only Changed Objects

    I am using TCL to Export and Import objects between different environments (ie: Dev, Test, Production). I was just wondering if there was any way to use the OMBEXPORT MDL_FILE or OMBIMPORT MDL_FILE commands to only export/import objects that have changed?
    Thanks
    Sean

    The other issue to consider is: how do you deal with dropped objects?
    We have the dba manage all DDL changes for a given patch, and then we have a script to do a full OWB project replacement to ensure that the project is properly in synch. We undeploy all mappings and drop the current project, re-import the mdl, assign the contrlcenter/location, and redeploy all mappings. Sure, that is overkill to fix just one mapping, but it IS a stable and safe script - and with 160 mappings it still doesn't take that long.
    If I were going the route of per-object replacement then I would do per-object generation of mdls for insertion into a version control system, and have the builds pull the patch from your version control and then load up each object. But I don't see an easily effective way of automating the management of a partial export of all objects into an mdl file.
    Let me think on this.....

  • Lifetime of JNI objects between calls.

    Is it possible to store/cache non-class JNI objects between calls?
    I know I can 'lock' jclass object to *env however I need to be able to do more than this.
    Implementation :
    C++ code for which I am not responsible for NOR will I ever get access to the source code needs to be built into a Java Application.
    Everything that I need to do works fine except when I need to have jobject's and, in particular, the JNIEnv reference to be cached in the dll between JNI calls.
    Raison d'etre : I want to implement a Callback using a Java object (Observer/Observable) so that the status of the C legacy app can be monitored via a callback implemented as part of the dll.
    Java object is called via the C callback, sets status via a status method called via JNI, Java App is notifoed of the change.
    Problem, as long as the first call the the jobject occurs within the actual JNI call that creates the Java object all is well, as soon as I try and store the jobject and JNIEnv references so that the C callback can call it as well then things break.
    Is it possible to have JNI objects whose lifetime spans JNI calls at all?

    In the meantime I have found out exactly how to achieve callbacks via native/Java. Having studied Sheng Liang's book (an absolute must buy and read) things became a lot clearer.
    This is what I discovered...
    The main issues with implementing callbacks within a JNI framework are the following..
    Lifetime of the JNIEnv and other classes/objects involved on the native side of the process.
    Threading issues on the native side, especially when interacting with Objects created in a different thread.
    The first issue is dealt with, in part, by being able to obtain a valid JNIEnv at arbitrary points in the native code. If you obtain a valid JNIEnv in an arbitrary native thread that JNIEnv is valid in it so this also helps problems with the second issue.
    The key to obtaining a valid JNIEnv is in having a reference to the calling VM.
    The function..
    JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved)
    allows you to cache a reference to the calling JVM. It is called when the dll is loaded before any other functions in the native code are called. The JavaVM reference is valid throughout the lifetime of the dll's instance.
    you can then do this to obtain a valid JNIEnv anytime you like..
    JNIEnv *env;
    vm->GetEnv((void **)&env, JNI_VERSION_1_2);
    Ok, thats dealt with problem of obtaining valid JNIEnv's when we need them.
    In order to extend the lifetime of objects and, in particular, classes from which those objects are instantiated you need to create global ref's to them. I did mine this way..
    In the calling Java code, I instantiate a callback object and pass that to a native method whose native code does the following..
    gets the object's class as a local reference, creates a NewGlobalRef of the passed object and its class. These jobject and jclass global references are stored as global vars in the DLL. You can also, at this point, create jmethodID's for all the methods you may need to call as part of the callback process however callbacks should finish as quickly as possible so restrict your calls to the minimum. Caching the method ID does not require a global ref, nor is is thread 'sensitive'. GetMethodID can be used to store a local jmethodID reference in a global jmethodID var, this saves you some time and performance hits in the native callback functions.
    The above description deals with the lifetime of objects between JNI calls. What about the threading issues?
    We have seen how to get a valid JNIEnv when we want one. This JNIEnv is valid for the NATIVE thread in which we call vm->GetEnv((void **)&env, JNI_VERSION_1_2);
    There is another way of getting valid JNIEnv's when we want them but this seems only to work when we are using the invocation interface (having the native side create an embedded JVM). This is the jvm->AttachCurrentThread function. I have tried both, only GetEnv seems to work as expected in the native DLL code, AttachCurrentThread when the JVM is invoked from inside a native application.
    To successfully perform the native/Java callback, assuming you have cached a JavaVM reference and the callback object/class correctly, is to get a valid JNIEnv as shown above, use this JNIEnv for the method calls you need to perform on the callback object, cleanup if needed.
    Note, you MUST DeleteGlobalRef's before the DLL is unloaded. If you don't you may find your Java VM crashing on exit (a horrible bug to have to track down).
    Either explicitly create a cleanup native method that you have to call and/or use the JNI_OnUnload function that is called just before the DLL is unloaded (usually when the JVM is being stopped).
    Things you can do to make your callback efficient :
    Make the calls return as soon as possible. I use the Observable/Observer pattern so that further Java objects (the observers) can handle the changes made to the callback object. If, like me, you are reflecting state changes in the native system component via callbacks and displaying them in a GUI environment then your Observer can wake up a thread to do the GUI updates, the observable callback need only notifyObservers in order to start things off and return.
    Hope this clears things up for you, if you have further questions please mail me, I believe my email address is available, if not post here and I will get to you.

  • Images Change Colors between monitors while the UI stays the same

    Hey! Im having an issue where photoshop changes the colors when I move the window between my monitors, seen here: http://sta.sh/04y5s60vf3j This isnt due to the monitors themselves being different, it actually changes after a few seconds of moving it inbetween the monitors. The left one has been callibrated with a spyder 3 elite which I no longer have access to. I applied the file with windows color management instead of the spyder utility. The second one is new, and it is not callibrated by anything, but instead was done by hand with the built in brightness/contrast/custom RGB settings. Both of them are very close to eachother, enough so for my tastes. but when photoshop changes what the image looks like, it's causing problems. Interestingly enough, when I disable callibration for the monitor on the left, the image does not change colors between monitors, but instead always appears as it does on the right. but then they don't match up and the whole screen looked washed out because it's uncallibrated, so that doesnt do me any good. Another interesting thing to point out, is when this image is saved as a .JPG, and viewed with firefox the image appears exactly like the monitor on the LEFT (which is my main monitor) despite the left monitor being the one that is force changed. does anyone have any suggestions? It also appears that windows photoviewer is behaving the same way, though firefox does not. Meaning when I open an image in all 3 on the left monitor, they look the same, but when opened on the right monitor, windows photo viewer and photoshop both display the image as brighter and redder than firefox does. This is frustrating, because it seems photoshop is changing the image with my callibration on my left monitor to match what it looks like on the web, which it does. but it doesn't do this for the right monitor, or when the left is uncallibrated. Another issue I can see with this is even if the UI is the same shade of gray, the images are different between the monitors because of this change. Does anyone have any suggestions?
    - BD

    Alright! So I reread through all this, poked at some things on the internet, and I'm going to attempt to summarize what would be a good solution for all this (And it seems, it still won't be perfect, but to get myself into the best environment I can for not messing with images for an hour trying to make them look nice before I post them to the web. I painted something yesterday on the cintiq, popped it over to my laptop screen and it just looked washed out and terrible.)
    1. Get a X-rite EODIS3 i1 Display Pro, Callibrate laptop and cintiq. I do have the money to drop on something like this, especially if it's a time saver.
         Things I'm not sure about:
              a. There was a ton of complaints about the software not working when I checked reviews, but also a ton that said everything was great. most of them were mac users though.
              b. I'm not sure if problems would still be posed, even while calibrated, by me having a wide gamut monitor.
              c. I'm a terrible excuse for a human being and I think the colors showing up brighter on the wide gamut screen is pretty (I should just make my images this bright on a normal screen and there won't be any issues. >.>)
    2. Set Firefox to color manage (easy enough)
    3. Change my photoshop working space to sRGB (since they'll have been calibrated at this point)
    3. Accept the fact that most of the people who look at my work will be doing so on a monitor that is almost certainly uncalibrated, and I can't control what they will see on my screen, but I CAN control if the colors are -actually- what I want them to be on any properly calibrated device. which is probably the best way to go anyways.
    4. Make paintings, have fun.
    Now, you two have been going on about all sorts of interesting things in here, and it seems that calibration issue run much much deeper than I ever thought. Do either of you have recommendations for how I should tweak this list of things to do or other things I can/ should do? I'm not currently a working professional, but if I have anything to say about it, I will be within a few years (I'm going to school for illustration and studying concept design on my own time) so it'd be useful for me to get into good habits now.
    - Brendavid

  • How to change object background color on  java run time

    Hi,
    I create object loading program. my problem is run time i change object background color using color picker. i select any one color of color picker than submit. The selecting color not assign object background.
    pls help me? How to run time change object background color?
    here follwing code
    import com.sun.j3d.loaders.objectfile.ObjectFile;
    import com.sun.j3d.loaders.ParsingErrorException;
    import com.sun.j3d.loaders.IncorrectFormatException;
    import com.sun.j3d.loaders.Scene;
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.universe.*;
    import javax.media.j3d.*;
    import javax.vecmath.*;
    import java.io.*;
    import com.sun.j3d.utils.behaviors.vp.*;
    import java.net.URL;
    import java.net.MalformedURLException;
    import java.awt.Graphics ;
    import javax.swing.*;
    public class ObjLoad1 extends Applet implements ActionListener
    private boolean spin = false;
    private boolean noTriangulate = false;
    private boolean noStripify = false;
    private double creaseAngle = 60.0;
    private URL filename = null;
    private SimpleUniverse u;
    private BoundingSphere bounds;
    private Panel cardPanel;
    private Button Tit,sub;
    private CardLayout ourLayout;
    private BorderLayout bl;
    Background bgNode;
    BranchGroup objRoot;
    List thelist;
    Label l1;
    public BranchGroup createSceneGraph()
    BranchGroup objRoot = new BranchGroup();
    TransformGroup objScale = new TransformGroup();
    Transform3D t3d = new Transform3D();
    t3d.setScale(0.7);
    objScale.setTransform(t3d);
    objRoot.addChild(objScale);
    TransformGroup objTrans = new TransformGroup();
    objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
    objScale.addChild(objTrans);
    int flags = ObjectFile.RESIZE;
    if (!noTriangulate) flags |= ObjectFile.TRIANGULATE;
    if (!noStripify) flags |= ObjectFile.STRIPIFY;
    ObjectFile f = new ObjectFile(flags,(float)(creaseAngle * Math.PI / 180.0));
    Scene s = null;
         try {
              s = f.load(filename);
         catch (FileNotFoundException e) {
         System.err.println(e);
         System.exit(1);
         catch (ParsingErrorException e) {
         System.err.println(e);
         System.exit(1);
         catch (IncorrectFormatException e) {
         System.err.println(e);
         System.exit(1);
         objTrans.addChild(s.getSceneGroup());
         bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
    if (spin) {
         Transform3D yAxis = new Transform3D();
         Alpha rotationAlpha = new Alpha(-1, Alpha.INCREASING_ENABLE,0,0,4000,0,0,0,0,0);
         RotationInterpolator rotator = new RotationInterpolator(rotationAlpha,objTrans,yAxis,0.0f,(float) Math.PI*2.0f);
         rotator.setSchedulingBounds(bounds);
         objTrans.addChild(rotator);
    //Background color setting
    Color3f bgColor = new Color3f(100,200,230);
    bgNode = new Background(bgColor);
    bgNode.setApplicationBounds(bounds);
    objRoot.addChild(bgNode);
    return objRoot;
    private void usage()
    System.out.println("Usage: java ObjLoad1 [-s] [-n] [-t] [-c degrees] <.obj file>");
    System.out.println("-s Spin (no user interaction)");
    System.out.println("-n No triangulation");
    System.out.println("-t No stripification");
    System.out.println("-c Set crease angle for normal generation (default is 60 without");
    System.out.println("smoothing group info, otherwise 180 within smoothing groups)");
    System.exit(0);
    } // End of usage
    public void init() {
    if (filename == null) {
    try {
    URL path = getCodeBase();
    filename = new URL(path.toString() + "./galleon.obj");
    catch (MalformedURLException e) {
         System.err.println(e);
         System.exit(1);
         //setLayout(new BorderLayout());
         //setLayout(new GridLayout(5,0));
         //setLayout(new CardLayout());
         //setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
    GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
    Canvas3D c = new Canvas3D(config);
    add(c);
    BranchGroup scene = createSceneGraph();
    u = new SimpleUniverse(c);
    ViewingPlatform viewingPlatform = u.getViewingPlatform();
    PlatformGeometry pg = new PlatformGeometry();
    Color3f ambientColor = new Color3f(45,27,15);
    AmbientLight ambientLightNode = new AmbientLight(ambientColor);
    ambientLightNode.setInfluencingBounds(bounds);
    pg.addChild(ambientLightNode);
    Color3f light1Color = new Color3f(111,222,222);
    Vector3f light1Direction = new Vector3f(1.0f, 1.0f, 1.0f);
    Color3f light2Color = new Color3f(1.0f, 1.0f, 1.0f);
    Vector3f light2Direction = new Vector3f(-1.0f, -1.0f, -1.0f);
    DirectionalLight light1 = new DirectionalLight(light1Color, light1Direction);
    light1.setInfluencingBounds(bounds);
    pg.addChild(light1);
    DirectionalLight light2 = new DirectionalLight(light2Color, light2Direction);
    light2.setInfluencingBounds(bounds);
    pg.addChild(light2);
    viewingPlatform.setPlatformGeometry(pg);
    viewingPlatform.setNominalViewingTransform();
    if (!spin) {
    OrbitBehavior orbit = new OrbitBehavior(c,OrbitBehavior.REVERSE_ALL);
    BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0), 100.0);
    orbit.setSchedulingBounds(bounds);
    viewingPlatform.setViewPlatformBehavior(orbit);     
    u.addBranchGraph(scene);
         public ObjLoad1(String[] args) {
              if (args.length != 0) {
                   for (int i = 0 ; i < args.length ; i++) {
                        if (args.startsWith("-")) {
                             if (args[i].equals("-s")) {
                                  spin = true;
                             } else if (args[i].equals("-n")) {
                                  noTriangulate = true;
                             } else if (args[i].equals("-t")) {
                                  noStripify = true;
                             } else if (args[i].equals("-c")) {
                                  if (i < args.length - 1) {
                                       creaseAngle = (new Double(args[++i])).doubleValue();
                                  } else usage();
                             } else {
                                  usage();
                        } else {
                             try {
                                  if ((args[i].indexOf("file:") == 0) ||
                                            (args[i].indexOf("http") == 0)) {
                                       filename = new URL(args[i]);
                                  else if (args[i].charAt(0) != '/') {
                                       filename = new URL("file:./" + args[i]);
                                  else {
                                       filename = new URL("file:" + args[i]);
                             catch (MalformedURLException e) {
                                  System.err.println(e);
                                  System.exit(1);
    public void actionPerformed(ActionEvent e)
         if (e.getSource() == Tit)
    //Color Picker tool
              Color c1 = JColorChooser.showDialog(((Component)e.getSource()).getParent(),"Zaxis Color Picker", Color.blue);
              cardPanel.setBackground(c1);
              objRoot.removeChild(bgNode);
              int a = c1.getRed();
              int b = c1.getBlue();
              int c = c1.getBlue();
              System.out.println(a);
              System.out.println(b);
              System.out.println(c);
              Color3f ccc = new Color3f(a,b,c);
              bgNode.setApplicationBounds(bounds);
         objRoot.addChild(bgNode);
         else
              System.out.println("mathi");
    public ObjLoad1()
    Tit = new Button("BG Color");
    sub = new Button("Object Color");
    cardPanel = new Panel();
    cardPanel.add(Tit);
    cardPanel.add(sub);
    //cardPanel.add(l1);
    //cardPanel.add(thelist);
    sub.addActionListener(this);
    Tit.addActionListener(this);
    // thelist.addActionListener(this);
    //setLayout for applet to be BorderLayout
    this.setLayout(new BorderLayout());
    //button Panel goes South, card panels go Center
    this.add(cardPanel, BorderLayout.SOUTH);
    //this.add(cardPanel, BorderLayout.CENTER);     
    this.setVisible(true);
    public void destroy() {
    public static void main(String[] args) {
         new MainFrame(new ObjLoad1(args),400, 400);

    hi,
    i am using setColor(Color3f color) method
    like
    if (e.getSource() == Tit)
              Color c1 = JColorChooser.showDialog(((Component)e.getSource()).getParent(),"Zaxis Color Picker", Color.blue);
              bgColor = new Color3f(c1);
              System.out.println(bgColor.get());
         bgNode.setColor(bgColor);
         bgNode.setApplicationBounds(bounds);
         objRoot.addChild(bgNode);
    but error will be displayed
    like
    javax.media.j3d.CapabilityNotSetException: Background: no capability to set color
         at javax.media.j3d.Background.setColor(Background.java:307)
         at ObjLoad1.actionPerformed(ObjLoad1.java:230)
         at java.awt.Button.processActionEvent(Unknown Source)
         at java.awt.Button.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    pls help me

  • Creation of Custom Change Object

    Hi all,
    I tried to create a custom change object from tcode- SCDO,but its asking for name space,
    and even i dont know to create it like the tables it asking for.
    I have successfully triggered a WF using standard change Object,but am not able to create custom
    Change object.
    Any one of you if have answer please help me.

    Hi Nivedita Yadav,
                               go through this link.
    http://sample-code-abap.blogspot.com/2008/02/applying-change-document-technique-on.html
    Regards,
    Dheepak
    Edited by: dheepak on Jan 21, 2009 4:03 PM
    Edited by: dheepak on Jan 21, 2009 4:28 PM

  • [CS3 JS] Find/Change Object Problem

    app.changeObjectPreferences = NothingEnum.nothing does not seem to clear the change object preferences for me.
    app.findObjectPreferences = NothingEnum.nothing works as expected, as do both app.findTextPreferences = NothingEnum.nothing and app.changeTextPreferences = NothingEnum.nothing.
    Does anyone else use the new Find/Change Object?

    Hello. I'm new here but it seems to be the only place where I can post this question to.
    I'm working in a C# application that uses InDesign CS3 scripting. I'm trying to create an index automatically from a tabbed list of words in a text file.
    As C# is a strongly typed language, I have to cast all objects to the right type. I'm having problems when I try to add the page numbers to the created index entries using the following code (I've used the CreateIndexEntry.jsx scrip as a starting point).
    //Find all occurrences of the word or set of words (the topic name)
    ((InDesign.FindTextPreference) app.FindTextPreferences).FindWhat = topic.Name;
    InDesign.Objects foundTexts = doc.FindText(System.Reflection.Missing.Value);
    It's supposed to be an Array of Text objects (InDesign.Text) but when I try to cast each object using this
    //Code is forced because I've tried everything here
    //Loop through each finding and add page numbers to topic
    IEnumerator textEnum = foundTexts.GetEnumerator();
    while (textEnum.MoveNext())
    object text = textEnum.Current;
    topic.PageReferences.Add((InDesign.Text)text, InDesign.idPageReferenceType.idCurrentPage, System.Reflection.Missing.Value, System.Reflection.Missing.Value);
    I got the following exception (translated).
    text is not an InDesign.Text object (Interfaces doesn't match)
    So the question is what object type should I use to cast each object resulting by calling the Document's FindText method.
    Every suggestion will ve very welcome.
    Thank You very much.

Maybe you are looking for

  • How to operate two gallery on the same site ?

    hello. I'm having a problem. I'm editing a template built using Flash, which already have a page that is a photo gallery. I created two others. Edict everything right in the xml file. However, when I open the page properly direct the gallery just sma

  • Nokia 5610 photo saving problem

    Hi, Whenever i took some pics using 5610Xpress music, on saving the pic it always throws an error - Unable to open file. And when i goto my gallery i can see the photo but not able to open it.

  • Delta load for 2LIS_06_INV is failing after EHP5 upgrade of ECC system

    Hi Experts, Our ECC Production system was upgraded to EHP5 last weekend. Since then Delta load for datasource 2LIS_06_INV is failing. This is the only datasource got impacted. Full Load and Initialization Loads are running fine. Only Delta load is fa

  • Finder Picture Background Not Working?

    Hi everyone, I'm trying to set a photo background to a few folders in finder, but it isn't working.  The background remains white when I try to enable a picture background.  The color backgrounds work fine, but the picture background simply refuse to

  • Lost adobe CS2 discs. How upgrade?

    I'm retired & on limited income, thus I'm far behind in Adobe upgrades. I currently use CS2 Suite mostly Indesign, Illustrator, & Photoshop, for a book I'm writing that is currently at about 3500 pages. CS2 meets my needs and don't need to upgrade. H