Object and in place element structure

Hi!
I need some help!
How can I do the following?
In the 1.)  Set the new value here - make some changes takes effect the whole array, previously and take effect for the 2. wire?
I have tried that in place element structure without any success.
The reason is why I would like to do this is : I wanna avoid the always usage of get - set pairs when I am working with objects, tipically array of objects.
so my goal is, how to see only 10 values in both arrays?
My real problem is the following:
I have an array with objects. The order of the objects is very important, can not be changed. I use a stack - algorithm on the elements. Randomly push many elements into the stack, and randomly pop them. When I pop, I wanna use a set-method on the object, (set something flag/property) . So I want this chage to take effect the memory .
(If used a simle enable - indexing in the loop, I would lost the real order of the original array.)
(maybe I can calculate the index of the element what I want to update, but I think there is more easier alternative to do that and I should use the get - set again...)
+++ In God we believe, in Trance we Trust +++
[Hungary]
Solved!
Go to Solution.

The native LVOOP implementation is by-val and not by ref.as in most OOP implementations. If you are coming from an OOP background, think like: every time you branch a wire, it creates a clone of the object on the wire (or all the objects in the array in your case). As a general rule, this is the desired behaviour in about 80% of the cases (when using LabVIEW). So consider if you can't do it using a by-val implementation.
There are several falvours of by-ref implementation, where you will have the same objects on both wires:
* private data inside SEQ (single element queue, no replaced by the next one)
* private data inside DVR (data value reference)
* object inside DVR
which implementation you choose is up to you. From your image/code, I'd place the object inside the DVR. You could create the DVR with the obj in the first for loop. In the secend for loop, index your elements and use the IPE to get the obj out of the DVR for your get-set operation and place it back.
Felix
www.aescusoft.de
My latest community nugget on producer/consumer design
My current blog: A journey through uml

Similar Messages

  • In-Place Element Structures, References and Pointers, Compiler Optimization, and General Stupidity

    [The title of this forum is "Labview Ideas". Although this is NOT a direct suggestion for a change or addition to Labview, it seems appropriate to me to post it in this forum.]
    In-Place Element Structures, References and Pointers, Compiler Optimization, and General Stupidity
    I'd like to see NI actually start a round-table discussion about VI references, Data Value references, local variables, compiler optimizations, etc. I'm a C programmer; I'm used to pointers. They are simple, functional, and well defined. If you know the data type of an object and have a pointer to it, you have the object. I am used to compilers that optimize without the user having to go to weird lengths to arrange it. 
    The 'reference' you get when you right click and "Create Reference" on a control or indicator seems to be merely a shorthand read/write version of the Value property that can't be wired into a flow-of-control (like the error wire) and so causes synchronization issues and race conditions. I try not to use local variables.
    I use references a lot like C pointers; I pass items to SubVIs using references. But the use of references (as compared to C pointers) is really limited, and the implementation is insconsistent, not factorial in capabilites, and buggy. For instance, why can you pass an array by reference and NOT be able to determine the size of the array EXCEPT by dereferencing it and using the "Size Array" VI? I can even get references for all array elements; but I don't know how many there are...! Since arrays are represented internally in Labview as handles, and consist of basically a C-style pointer to the data, and array sizing information, why is the array handle opaque? Why doesn't the reference include operators to look at the referenced handle without instantiating a copy of the array? Why isn't there a "Size Array From Reference" VI in the library that doesn't instantiate a copy of the array locally, but just looks at the array handle?
    Data Value references seem to have been invented solely for the "In-Place Element Structure". Having to write the code to obtain the Data Value Reference before using the In-Place Element Structure simply points out how different a Labview reference is from a C pointer. The Labview help page for Data Value References simply says "Creates a reference to data that you can use to transfer and access the data in a serialized way.".  I've had programmers ask me if this means that the data must be accessed sequentially (serially)...!!!  What exactly does that mean? For those of use who can read between the lines, it means that Labview obtains a semaphore protecting the data references so that only one thread can modify it at a time. Is that the only reason for Data Value References? To provide something that implements the semaphore???
    The In-Place Element Structure talks about minimizing copying of data and compiler optimization. Those kind of optimizations are built in to the compiler in virtually every other language... with no special 'construct' needing to be placed around the code to identify that it can be performed without a local copy. Are you telling me that the Labview compiler is so stupid that it can't identify certain code threads as needing to be single-threaded when optimizing? That the USER has to wrap the code in semaphores before the compiler can figure out it should optimize??? That the compiler cannot implement single threading of parts of the user's code to improve execution efficiency?
    Instead of depending on the user base to send in suggestions one-at-a-time it would be nice if NI would actually host discussions aimed at coming up with a coherent and comprehensive way to handle pointers/references/optimization etc. One of the reasons Labview is so scattered is because individual ideas are evaluated and included without any group discussion about the total environment. How about a MODERATED group, available by invitation only (based on NI interactions with users in person, via support, and on the web) to try and get discussions about Labview evolution going?
    Based solely on the number of Labview bugs I've encountered and reported, I'd guess this has never been done, with the user community, or within NI itself.....

    Here are some articles that can help provide some insights into LabVIEW programming and the LabVIEW compiler. They are both interesting and recommended reading for all intermediate-to-advanced LabVIEW programmers.
    NI LabVIEW Compiler: Under the Hood
    VI Memory Usage
    The second article is a little out-of-date, as it doesn't discuss some of the newer technologies available such as the In-Place Element Structure you were referring to. However, many of the general concepts still apply. Some general notes from your post:
    1. I think part of your confusion is that you are trying to use control references and local variables like you would use variables in a C program. This is not a good analogy. Control references are references to user interface controls, and should almost always be used to control the behavior and appearance of those controls, not to store or transmit data like a pointer. LabVIEW is a dataflow language. Data is intended to be stored or transmitted through wires in most cases, not in references. It is admittedly difficult to make this transition for some text-based programmers. Programming efficiently in LabVIEW sometimes requires a different mindset.
    2. The LabVIEW compiler, while by no means perfect, is a complicated, feature-rich set of machinery that includes a large and growing set of optimizations. Many of these are described in the first link I posted. This includes optimizations you'd find in many programming environments, such as dead code elimination, inlining, and constant folding. One optimization in particular is called inplaceness, which is where LabVIEW determines when buffers can be reused. Contrary to your statement, the In-Place Element Structure is not always required for this optimization to take place. There are many circumstances (dating back years before the IPE structure) where LabVIEW can determine inplaceness and reuse buffers. The IPE structure simply helps users enforce inplaceness in some situations where it's not clear enough on the diagram for the LabVIEW compiler to make that determination.
    The more you learn about programming in LabVIEW, the more you realize that inplaceness itself is the closest analogy to pointers in C, not control references or data references or other such things. Those features have their place, but core, fundamental LabVIEW programming does not require them.
    Jarrod S.
    National Instruments

  • Crash when use indexe array with in place element structure

    Hello !
    I have a problem with in place element structure. I want index a waveform array (16 elements) and when i execute or save that labview close....
    I dont have problem with waveform array 15 elements or less, but i need index 16 elements...
    Thanks for your help !!!
    Solved!
    Go to Solution.
    Attachments:
    Test.PNG ‏8 KB

    I give you my code but it work because i used a waveform array with only 15 elements. I can't save or execute with 16 elements...
    So add it (like picture Test.png) and you will see.
    Thank you
    Attachments:
    Test.vi ‏25 KB

  • Using LV Class Property Nodes in In-place Element structure causes the code to halt

    I have some code written in LV RT 2010 that uses property nodes from a LVOOP class that I created.  I am using access the property node from inside an in-place element structure.  When the code reaches the property node, LabVIEW stops running.  (as if the abort button was pressed).  I verified this behaviour using highlight execution.  When I remove the in-place structure code runs fine.
    Is this is know bug in LabVIEW?  Is there a CAR to resolve this created for a future release?

    Bob,
    I tried to reproduce the behavior you're seeing by recreating the Trigger and Trigger List classes, but I have not been able to reproduce it.  Please take a look at my version of the project in the attached zip file.  Take a look at Test.vi, and feel free to modify and repost it to show me how to make the problem occur.  I would like to file a CAR to make sure we get the problem fixed, but I will need to be able to reliably reproduce it first.
    On a similar note, you can get much better performance out of the Process Triggers VI by preallocating the list array, instead of using build array in a loop.  Take a look at Process Triggers2.vi in my project.  You can run Benchmark.vi to see the performance difference between the two different approaches.
    Chris M
    Attachments:
    triggerlist test.zip ‏165 KB

  • An "Empty" In Place Element Structure rather than using one Flat Sequence?

    Altenbach's neat Idea here got me thinking of the various ways we do synchronization, and I sat down an In Place structure and thought, why not? It saves a "tiny" bit of space, but personally, I think it looks better - especially for the typical Delay-in-a-Box. Thoughts or caveats?
    Richard

    You could use a single run while loop, it'll be correct usage and look different.
    I recently used that solution to get the 1st element of 5 arrays at once.
    /Y 
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • Smart objects and filters in elements 10-how to?

    please help...thanks

    The main use of Smart Objects is to embed an image file into a PSD so that it can maintain resolution independence. This means you can non-destructively transform (scale, rotate, skew) the layer without losing the quality of the orignal file. You can still change the opacity or blend mode of a Smart Object layer and apply Layer Styles from the Effects panel as well. So Smart Objects allow for true non-destructive editing in Elements, but not with the sophistication of Photoshop CSx.
    Whether or not Viveza works with Photoshop Elements 10 is up to the manufacturer of the plug-in.

  • Graphic - drawing nodes and edges, place elements and mouse event

    Hello, I am new to Java. I would like to do the following:
    show graphically a node and edge structure in star format, where each of the nodes, including the centre node, is a string.
    The number of edges is varialbe, so I guess I have to divide the 360' arc into equally spaced angles, define the distance at which to place the nodes at the extremity and then draw n-lines from the centre node (also a string of characters) to each of the peripherical nodes (also a string of characters).
    Additioanally, I would need a mouse click event, where by when I click on any of the nodes (including the periphery ones), an certain event is triggered, depending on which node I am clicking. Basically, something that recognise that the mouse is on top of a specific String when clicked (to make things more complex, I would need a left click or a righ click with pop-up menu of actions..but I guess, that's the easy part)
    thanks to all for the help

    My advice is to start learning Java:
    http://java.sun.com/docs/books/tutorial/
    ... and using existing tools instead of re-inventing the wheel:
    http://www.jgraph.com/jgraph.html

  • Inplace Element Structure 2D Array

    I would like to use the in place element structure to alter each element of a 2D array.  I need to minimize buffer allocations as the array is pretty large but cannot figure out the appropriate way to do this.  Any thoughts will be appreciated!
    Cheers!
    CLA, CLED, CTD,CPI, LabVIEW Champion
    Platinum Alliance Partner
    Senior Engineer
    Using LV 2013, 2012
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.

    Looks like I posted too soon.  I answered my own question.
    Cheers
    CLA, CLED, CTD,CPI, LabVIEW Champion
    Platinum Alliance Partner
    Senior Engineer
    Using LV 2013, 2012
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
    Attachments:
    2D In Place Element.vi ‏11 KB

  • How to withdraw a wrong open and save of a structured fm file in unstructured mode?

    I opened a structured fm file wrongly in unstructured mode and saved it. When I opened this fm file again in structured mode, the structure view has been blank. Does anyone no how to withdraw this?

    Dragon,
       To expand slightly on what Alex and Russ have said, whenever you delete content from a FrameMaker document  and save the result, the deleted content is gone. It doesn't matter whether the deleted content is the element hierarchy or text and graphics in the document. A recent backup, whether a version of the file that you explicitly saved or one created by FrameMaker's automatic backup, is
       Alex mentioned that a conversion table might help recreate the document's element structure. His comment assumed that a conversion table was used somewhere in the history of this document. Whether or not that is the case, you can create a new conversion table specifically for this document. If you haven't looked at conversion tables yet, a conversion table is a FrameMaker table that describes how to use tagging in an unstructured document to create an equivalent structured document. How successfully it creates the desired structure depends very much on the nature of the tags used in the unstructured document and the desired element structure.
        --Lynne

  • View link creation on two view objects, and both view objects are populated program(not from sql)

    I have master and detail VO , both views data is loaded in program. Now for show/hide feature, I create View Link Object and using one element from both child and master VO , View Link Object created properly.
    But I can not able to add that view link object into AM.
    Now because of that , I cannot say what is a instance name of that view link object.
    Hence getting following error  -- Invalid or missing view link. Please attach view link with the bean.
    Please can you provide some directions.

    I have master and detail VO , both views data is loaded in program. Now for show/hide feature, I create View Link Object and using one element from both child and master VO , View Link Object created properly.
    But I can not able to add that view link object into AM.
    Now because of that , I cannot say what is a instance name of that view link object.
    Hence getting following error  -- Invalid or missing view link. Please attach view link with the bean.
    Please can you provide some directions.

  • Can I place a smart object and specify a layer comp?

    I have many buttons, each as a layer comp, in a single file.
    I do this because there are many common elements: layers for the button base, shared features, button gloss, etc.
    What changes is the icon on the button, and possibly a supporting label.
    I want to place these buttons on objects in other files.
    So, I'd like to Place the file as a smart object AND SPECIFY THE LAYER COMP for the proper button.
    Anybody?
    Or maybe there is another approach?
    Much obliged!
    Dave

    I'm on CC on a Mac.
    What 21 is talking about is making some sense.
    I am able to create new smart object via copy, then create a variation on the original file linked in the parent smart object. Then I save that from illustrator with a different file name. Then I go back to photoshop and replace contents of the new smart object, linking it to the newer illustrator file.
    This gets around the problem, but it takes a few more steps than the same thing did it in earlier versions of photoshop.

  • Article - In Place Element Strucure - Saves Time and Prevents Bugs

    I hope you all enjoy it and find it useful: In Place Element Strucure - Saves Time and Prevents Bugs Thanks,
    -Jim
    [cross-post]

    This one deserves a place in the structures palette.
    For some reason I always open the array palette to select a "for loop"
    and selecting the N of the for to change the visibility of the label.
    A pity both don't work.
    But I also agree with Stephen that changing palettes should be done only when really needed.
    Every change proposal should have a lot of arguments. The more users LabvIEW has the more people need to agree on a change !!!!!
    Additions on the other hand and alternatives are welcome.
    greetings from the Netherlands

  • How to change the Element structure of a DefaultSyledDocument

    Hello,
    I'm trying to override the insertUpdate method of DefaultStyledDocument so that I could build my own Element structure by adding my own BranchElement- and LeafElement-s. If I examine the Element hierarchy everything seems OK. But when I use my document in a JTextPane. I get the error Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: GlyphView: Stale view: javax.swing.text.BadLocationException: Invalid location (I add the whole dump at the end of this message), whenever I add a new line to the document (to test this compile and run the included code and press then newline after the 'He' in 'Hello'. I suspect that the error is caused by the fact that the view hierarchy is not updated correctly but I'm not sure. To be honest I have searched for a while for some example code, explaning how you can make your own element hierarchy in a DefaultStyledDocument (without using ElementBuffer), but to no avail.
    Can any of the Text gurus here shed some lights on my code and see what is wrong with it or point me to some example code.
    Thanks a lot in advance.
    Marc Mertens
    Full Stack Dump
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: GlyphView: Stale view: javax.swing.text.BadLocationException: Invalid location
    at javax.swing.text.GlyphView.getText(GlyphView.java:117)
    at javax.swing.text.GlyphPainter1.getSpan(GlyphPainter1.java:43)
    at javax.swing.text.GlyphView.getPreferredSpan(GlyphView.java:537)
    at javax.swing.text.FlowView$LogicalView.getPreferredSpan(FlowView.java:689)
    at javax.swing.text.FlowView.calculateMinorAxisRequirements(FlowView.java:216)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:911)
    at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:542)
    at javax.swing.text.BoxView.calculateMinorAxisRequirements(BoxView.java:879)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:911)
    at javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:325)
    at javax.swing.text.BoxView.layout(BoxView.java:682)
    at javax.swing.text.BoxView.setSize(BoxView.java:379)
    at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1618)
    at javax.swing.plaf.basic.BasicTextUI.getPreferredSize(BasicTextUI.java:812)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1615)
    at javax.swing.JEditorPane.getPreferredSize(JEditorPane.java:1227)
    at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:769)
    at java.awt.Container.layout(Container.java:1401)
    at java.awt.Container.doLayout(Container.java:1390)
    at java.awt.Container.validateTree(Container.java:1473)
    at java.awt.Container.validate(Container.java:1448)
    at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:379)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:113)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: GlyphView: Stale view: javax.swing.text.BadLocationException: Invalid location
    at javax.swing.text.GlyphView.getText(GlyphView.java:117)
    at javax.swing.text.GlyphPainter1.getSpan(GlyphPainter1.java:43)
    at javax.swing.text.GlyphView.getPreferredSpan(GlyphView.java:537)
    at javax.swing.text.FlowView$LogicalView.getPreferredSpan(FlowView.java:689)
    at javax.swing.text.FlowView.calculateMinorAxisRequirements(FlowView.java:216)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:911)
    at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:542)
    at javax.swing.text.BoxView.calculateMinorAxisRequirements(BoxView.java:879)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:911)
    at javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:325)
    at javax.swing.text.BoxView.layout(BoxView.java:682)
    at javax.swing.text.BoxView.setSize(BoxView.java:379)
    at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1618)
    at javax.swing.plaf.basic.BasicTextUI.modelToView(BasicTextUI.java:946)
    at javax.swing.text.DefaultCaret.repaintNewCaret(DefaultCaret.java:1246)
    at javax.swing.text.DefaultCaret$1.run(DefaultCaret.java:1225)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: GlyphView: Stale view: javax.swing.text.BadLocationException: Invalid location
    at javax.swing.text.GlyphView.getText(GlyphView.java:117)
    at javax.swing.text.GlyphPainter1.getSpan(GlyphPainter1.java:43)
    at javax.swing.text.GlyphView.getPreferredSpan(GlyphView.java:537)
    at javax.swing.text.FlowView$LogicalView.getPreferredSpan(FlowView.java:689)
    at javax.swing.text.FlowView.calculateMinorAxisRequirements(FlowView.java:216)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:911)
    at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:542)
    at javax.swing.text.BoxView.calculateMinorAxisRequirements(BoxView.java:879)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:911)
    at javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:325)
    at javax.swing.text.BoxView.layout(BoxView.java:682)
    at javax.swing.text.BoxView.setSize(BoxView.java:379)
    at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1618)
    at javax.swing.plaf.basic.BasicTextUI.modelToView(BasicTextUI.java:946)
    at javax.swing.text.DefaultCaret.setVisible(DefaultCaret.java:952)
    at javax.swing.text.DefaultCaret.focusLost(DefaultCaret.java:347)
    at java.awt.AWTEventMulticaster.focusLost(AWTEventMulticaster.java:172)
    at java.awt.Component.processFocusEvent(Component.java:5380)
    at java.awt.Component.processEvent(Component.java:5244)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1810)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:840)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:530)
    at java.awt.Component.dispatchEventImpl(Component.java:3841)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.SentEvent.dispatch(SentEvent.java:50)
    at java.awt.DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent.dispatch(DefaultKeyboardFocusManager.java:161)
    at java.awt.DefaultKeyboardFocusManager.sendMessage(DefaultKeyboardFocusManager.java:188)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:595)
    at java.awt.Component.dispatchEventImpl(Component.java:3841)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Window.dispatchEventImpl(Window.java:1778)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.SequencedEvent.dispatch(SequencedEvent.java:93)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    java.lang.ThreadDeath
    at java.lang.Thread.stop(Thread.java:698)
    at java.lang.ThreadGroup.stopOrSuspend(ThreadGroup.java:671)
    at java.lang.ThreadGroup.stop(ThreadGroup.java:584)
    at org.netbeans.core.execution.DefaultSysProcess.stop(DefaultSysProcess.java:54)
    at org.netbeans.core.execution.ProcessNodeItem$1.stop(ProcessNodeItem.java:41)
    at org.netbeans.core.execution.ProcessNodeItem$TerminateProcessAction.performAction(ProcessNodeItem.java:69)
    at org.openide.util.actions.NodeAction$3.run(NodeAction.java:531)
    at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:47)
    at org.openide.util.actions.NodeAction$DelegateAction.actionPerformed(NodeAction.java:527)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
    at java.awt.Component.processMouseEvent(Component.java:5488)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
    at java.awt.Component.processEvent(Component.java:5253)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1778)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    package Document;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import javax.swing.text.AbstractDocument.*;
    * EditorDocument.java
    * Created on September 10, 2006, 3:58 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    * Document to represent the content of a syntax highlighting editor
    * @author marc
    public class EditorDocument extends DefaultStyledDocument {
        /** List of the white space characters */
        private char[] _whiteSpaceChars;
        /** List of the delimiter characters */
        private char[] _delimiterChars;
        /** Creates a new instance of EditorDocument */
        public EditorDocument(char[] whiteSpaceChars,char[] delimiterChars) {
            _whiteSpaceChars=whiteSpaceChars;
            _delimiterChars=delimiterChars;
         * Updates document structure as a result of text insertion.  This
         * will happen within a write lock.  Since this document simply
         * maps out lines, we refresh the line map.
         * @param chng the change event describing the dit
         * @param attr the set of attributes for the inserted text
        protected void insertUpdate(AbstractDocument.DefaultDocumentEvent chng, AttributeSet attr) {
            int begin=Math.max(0,chng.getOffset()-1);
            int end=begin+chng.getLength()+1;
            Element rootElement=getDefaultRootElement();
            int index;
            int m=rootElement.getElementCount();
            AbstractDocument.BranchElement line;
            super.insertUpdate(chng,attr);
            // Add the tokens
            index=rootElement.getElementIndex(begin);
            m=rootElement.getElementCount();
            if (index>=0)
                for (;index<m && (line=(AbstractDocument.BranchElement) rootElement.getElement(index)).getStartOffset()<=end;index++) {
                chng.addEdit(addTokens(line,attr));
            //fireChangedUpdate(chng);
        protected void insertUpdate(AbstractDocument.DefaultDocumentEvent chng,AttributeSet attr) {
            int begin=chng.getOffset();
            int end=begin+chng.getLength();
            BranchElement root=(BranchElement) getDefaultRootElement();
            // Find the lines that must be removed
            int indexFirstLine=root.getElementIndex(begin);
            int indexLastLine=root.getElementIndex(end);
            BranchElement[] removeLines=new BranchElement[indexLastLine-indexFirstLine+1];
            for (int i=indexFirstLine;i<=indexLastLine;i++)
                removeLines=(BranchElement) root.getElement(i);
    // Add the lines must replace the removed lines
    int beginFirstLine=removeLines[0].getStartOffset();
    int endLastLine=removeLines[removeLines.length-1].getEndOffset();
    Segment segment=new Segment();
    ArrayList<BranchElement> newLines=new ArrayList<BranchElement>(removeLines.length); // Guess the length of the new lines
    try {
    getText(beginFirstLine,endLastLine,segment);
    char c=segment.current();
    BranchElement line;
    while (c!=Segment.DONE) {
    if (c=='\n') {
    line=new BranchElement(root,attr);
    newLines.add(line);
    addTokens(line,attr,beginFirstLine,segment.getIndex()+1);
    beginFirstLine=segment.getIndex()+1;
    c=segment.next();
    if (beginFirstLine<endLastLine) {
    line=new BranchElement(root,attr);
    newLines.add(line);
    addTokens(line,attr,beginFirstLine,endLastLine);
    // Add the lines to the Root element
    BranchElement[] linesAdded=newLines.toArray(new BranchElement[newLines.size()]);
    root.replace(indexFirstLine,indexLastLine-indexFirstLine+1,linesAdded);
    // Notify listeners
    DefaultDocumentEvent edit=new DefaultDocumentEvent(begin,end-begin,DefaultDocumentEvent.EventType.CHANGE);
    edit.addEdit(new ElementEdit(root,indexFirstLine,removeLines,linesAdded));
    fireChangedUpdate(edit);
    } catch (Exception e) {
    throw new EditorException("Error in insertUpdate, message was "+e.getMessage(),e);
    //super.insertUpdate(chng,attr);
    private void addTokens(AbstractDocument.BranchElement line,AttributeSet attr,int begin,int end) {
    try {
    ArrayList<TokenElement> childTokens=new ArrayList<TokenElement>();
    int strLength=end-begin;
    // Create the new tokens
    Segment segment=new Segment();
    getText(begin,end-begin,segment);
    char c;
    int b=0;
    TokenElement token;
    //System.out.println(str);
    c=segment.current();
    while (c!=Segment.DONE) {
    if (isWhite(c)) {
    // Whitespace character
    if (b<segment.getIndex()) {
    token=new TokenElement(line,attr,begin+b,begin+segment.getIndex(),false);
    childTokens.add(token);
    b=segment.getIndex();
    // Find all the white spaces
    while ((c=segment.next())!=Segment.DONE && isWhite(c));
    token=new TokenElement(line,attr,begin+b,begin+segment.getIndex(),true);
    childTokens.add(token);
    b=segment.getIndex(); // Begin of next token
    } else if (isDelimiter(c)) {
    // Delimiter
    if (b<segment.getIndex()) {
    token=new TokenElement(line,attr,begin+b,begin+segment.getIndex(),false);
    childTokens.add(token);
    token=new TokenElement(line,attr,begin+segment.getIndex(),begin+segment.getIndex(),c);
    childTokens.add(token);
    b=segment.getIndex();
    c=segment.next();
    } else {
    c=segment.next();
    if (b<segment.getIndex()) {
    token=new TokenElement(line,attr,begin+b,begin+segment.getIndex(),false);
    childTokens.add(token);
    Element[] removed=new Element[line.getElementCount()];
    for (int i=0;i<removed.length;i++)
    removed[i]=line.getElement(i);
    TokenElement[] newElements=childTokens.toArray(new TokenElement[childTokens.size()]);
    line.replace(0,line.getElementCount(),newElements);
    } catch (Exception e) {
    throw new EditorException("Unexpected BadlocationException ");
    * Returns a iterator of the tokens starting from the given position
    * @param The position that is covered by the first token returned by this iterator
    * @return A iterator of all the tokens starting at the given position
    public Iterator<IToken> getTokensFrom(int position) {
    return new TokenIterator(position);
    private String getText(Element element) {
    int begin=element.getStartOffset();
    int end=Math.min(element.getEndOffset(),getLength());
    try {
    return getText(begin,end-begin);
    } catch (BadLocationException e) {
    throw new EditorException("Unexpected BadLocationException (this should not happen at all)");
    * Check if a character is a white space
    * @return True if a character is a white space
    private boolean isWhite(char c) {
    if (c=='\n') // End of line is always a white space
    return true;
    for (char whiteChar : _whiteSpaceChars)
    if (whiteChar==c)
    return true;
    return false;
    * Check if a character is a delimiter character (different from a white space character)
    * @return True if a character is a delimiter character
    private boolean isDelimiter(char c) {
    for (char delimiterChar : _delimiterChars)
    if (delimiterChar==c)
    return true;
    return c=='\0';
    * Test code
    public static void main(String[] args) {
    // Display a test frame containing a test document
    try {
    JFrame frm=new JFrame();
    EditorDocument doc=new EditorDocument(new char[] {' ','\n','\t','\r'},new char[0]);
    doc.insertString(0,"Hello",null);
    JTextPane pane=new JTextPane(doc);
    JScrollPane scroll=new JScrollPane(pane);
    frm.getContentPane().add(scroll);
    frm.setSize(200,300);
    frm.setVisible(true);
    } catch (Exception e) {
    * Class that is a iterator over the tokens in the document
    private class TokenIterator implements Iterator<IToken> {
    private int _lineIndex=-1;
    private int _tokenIndex=-1;
    public TokenIterator(int position) {
    AbstractDocument.BranchElement root=(AbstractDocument.BranchElement) getDefaultRootElement();
    _lineIndex=root.getElementIndex(position);
    AbstractDocument.BranchElement line=(AbstractDocument.BranchElement) root.getElement(_lineIndex);
    _tokenIndex=line.getElementIndex(position)-1;
    * Removes from the underlying collection the last element returned by the
    * iterator (optional operation). This method can be called only once per
    * call to <tt>next</tt>. The behavior of an iterator is unspecified if
    * the underlying collection is modified while the iteration is in
    * progress in any way other than by calling this method.
    * @exception UnsupportedOperationException if the <tt>remove</tt>
    *           operation is not supported by this Iterator.
    * @exception IllegalStateException if the <tt>next</tt> method has not
    *           yet been called, or the <tt>remove</tt> method has already
    *           been called after the last call to the <tt>next</tt>
    *           method.
    public void remove() {
    // Do nothing
    * Returns the next element in the iteration. Calling this method
    * repeatedly until the {@link #hasNext()} method returns false will
    * return each element in the underlying collection exactly once.
    * @return the next element in the iteration.
    * @exception NoSuchElementException iteration has no more elements.
    public IToken next() {
    Element root=getDefaultRootElement();
    if (_lineIndex>=root.getElementCount())
    return null;
    Element line=root.getElement(_lineIndex);
    _tokenIndex++;
    if (_tokenIndex>=line.getElementCount()) {
    _lineIndex++;
    if (_lineIndex>=root.getElementCount())
    return null;
    line=root.getElement(_lineIndex);
    if (line.getElementCount()==0)
    return null;
    _tokenIndex=0;
    return (IToken) line.getElement(_tokenIndex);
    * Returns <tt>true</tt> if the iteration has more elements. (In other
    * words, returns <tt>true</tt> if <tt>next</tt> would return an element
    * rather than throwing an exception.)
    * @return <tt>true</tt> if the iterator has more elements.
    public boolean hasNext() {
    int lineIndex=_lineIndex;
    int tokenIndex=_tokenIndex;
    Element root=getDefaultRootElement();
    if (lineIndex>=root.getElementCount())
    return false;
    Element line=root.getElement(lineIndex);
    tokenIndex++;
    if (tokenIndex>=line.getElementCount()) {
    lineIndex++;
    if (lineIndex>=root.getElementCount())
    return false;
    line=root.getElement(lineIndex);
    if (line.getElementCount()==0)
    return false;
    return true;
    * Represents a token in the document
    private class TokenElement extends AbstractDocument.LeafElement implements IToken, Comparable<TokenElement> {
    private boolean _isWhiteSpace;
    private char _separatorChar='\0';
    public TokenElement(Element parent,AttributeSet attributeSet,int offs0,int offs1,boolean whiteSpace) {
    super(parent,attributeSet,offs0,offs1);
    _isWhiteSpace=whiteSpace;
    public TokenElement(Element parent,AttributeSet attributeSet,int offs0,int offs1,char separatorChar) {
    super(parent,attributeSet,offs0,offs1);
    _separatorChar=separatorChar;
    * Returns the separator character if this token is a separator, returns '\0' otherwise
    * @return The separator charactor or null otherwise
    public char getSeparatorChar() {
    return _separatorChar;
    * Compares this object with the specified object for order. Returns a
    * negative integer, zero, or a positive integer as this object is less
    * than, equal to, or greater than the specified object.<p>
    * In the foregoing description, the notation
    * <tt>sgn(</tt><i>expression</i><tt>)</tt> designates the mathematical
    * <i>signum</i> function, which is defined to return one of <tt>-1</tt>,
    * <tt>0</tt>, or <tt>1</tt> according to whether the value of <i>expression</i>
    * is negative, zero or positive.
    * The implementor must ensure <tt>sgn(x.compareTo(y)) ==
    * -sgn(y.compareTo(x))</tt> for all <tt>x</tt> and <tt>y</tt>. (This
    * implies that <tt>x.compareTo(y)</tt> must throw an exception iff
    * <tt>y.compareTo(x)</tt> throws an exception.)<p>
    * The implementor must also ensure that the relation is transitive:
    * <tt>(x.compareTo(y)>0 && y.compareTo(z)>0)</tt> implies
    * <tt>x.compareTo(z)>0</tt>.<p>
    * Finally, the implementer must ensure that <tt>x.compareTo(y)==0</tt>
    * implies that <tt>sgn(x.compareTo(z)) == sgn(y.compareTo(z))</tt>, for
    * all <tt>z</tt>.<p>
    * It is strongly recommended, but <i>not</i> strictly required that
    * <tt>(x.compareTo(y)==0) == (x.equals(y))</tt>. Generally speaking, any
    * class that implements the <tt>Comparable</tt> interface and violates
    * this condition should clearly indicate this fact. The recommended
    * language is "Note: this class has a natural ordering that is
    * inconsistent with equals."
    * @param o the Object to be compared.
    * @return a negative integer, zero, or a positive integer as this object
    *           is less than, equal to, or greater than the specified object.
    * @throws ClassCastException if the specified object's type prevents it
    * from being compared to this Object.
    public int compareTo(TokenElement o) {
    return getStartOffset()-o.getStartOffset();
    * Indicates this is a white space token
    * @return true if this is a white space token false otherwise
    public boolean isWhiteSpace() {
    return _isWhiteSpace;
    * Returns the string this token is representing
    * @return The string behind this token
    public String getText() {
    return EditorDocument.this.getText(this);
    class SearchToken implements IToken {
    private int _offset;
    public SearchToken(int offset) {
    _offset=offset;
    * @return The start of the token used in comparisation operations
    public int getEndOffset() {
    return _offset;
    public int getStartOffset() {
    return _offset;
    public boolean isWhiteSpace() {
    throw new EditorException("May not be called");
    public String getText() {
    throw new EditorException("May not be called");
    public char getSeparatorChar() {
    throw new EditorException("May not be called");

    I am trying to add primitive syntax highlighting to my JTextPane and have serious problems which I already stated in this forum. Now I read from uncle_alice that the text package from swing is not ment for that and that I need to write my own JTextPane and my own document and view.
    Can you explain what you mean by "writing my own JTextPane and View and Dcoument".
    My own Document I already have in order to provide SQL-highlighting.
    But what exactly do you mean by suggesting to write my own View! Whoever uses JTextPane doesnt really have much to do with its view. Can you give me a hint as I am completely stuck with an Exception : "javax.swing.text.StateInvariantError: GlyphView: Stale view: javax.swing.text.BadLocationException: Length must be positive"
    can you pinpoint the standard text-package's deficiency? it lacks what? what is the best work around?
    cheers
    ioannis

  • How to create a transport request with query and only with its structure.

    HI guru,
                how to create a transport request with query and only with its structure.transport request should not  include any other query items like ( variables, conditions...etc)
    thanks in advance.
    venkata

    Hi,
    Goto RSA1 and then Transport Connection -> In SAP Transports select Object Types-> Query Elements -> Then select Query->Give Technical name of the query and then select for transfer. In the right side you can choose the components which you wanted to transport.
    Regards,
    anil

  • How can I duplicate a smart object and then edit it, without affecting the original?

    I have a vector element from illustrator that I am placing in a tshirt mockup in photoshop. I have the layout essentially how I would like, but I am trying different color variations. I would think to just duplicate the first placement and then edit the color of the resulting copy, but this affects both the copy and the original. I looked into it a bit further, and found that I should try the "replace contents" option under smart objects, and that this would change the copy. So I go back to illustrator, made a copy of the original vector, and then made the color change I had in mind, and then saved it as a separate document that I could then use in replacing the contents of the copied. This however, is still affecting both smart objects!
    I have tried this as both linked smart objects and embedded smart objects without success.
    Ultimately, I simply want to maintain the position of the original layer with the duplicated and edited layers. If you know of a better way, please share!

    I'm on CC on a Mac.
    What 21 is talking about is making some sense.
    I am able to create new smart object via copy, then create a variation on the original file linked in the parent smart object. Then I save that from illustrator with a different file name. Then I go back to photoshop and replace contents of the new smart object, linking it to the newer illustrator file.
    This gets around the problem, but it takes a few more steps than the same thing did it in earlier versions of photoshop.

Maybe you are looking for

  • Defaulting tax code at the time of PO creation

    Hi Friends How do i default  tax code in a PO for a combination of COCD pur. org. PO doc. type when ever COCD == X & Pur. org -== Y P.o Doc type == NB then i should have Tax code == Z in the invoice tab of PO item details. if some thing other than Z

  • HR: Address data not updated in ALE inbound

    Hello all, EBP 5.0, HR R/3 4.7 In HR system Main addresses are not maintainted. So we create standard partner and in table T77S0 in field HRALX OADBP we maintain its address (with leading zeroes) and in HRALX OADRE we set flag. When we replicate org

  • How to use JMX with oc4j

    is there any document about how to use JMX with OC4J? the intention is that I would like to create an application, using JMX to manage OC4J, such dynamiclly adding connection pool, create data source. potentially, restart server, application ... is t

  • Active directory Webservice error

    I have installed and configured the active directory authentication webservice. I get the following error when I try to synchronize. Does anybody know the reason for the error? Apr 28, 2006 11:35:13 AM- Sync Agent is processing memberships. Apr 28, 2

  • Problems with the SMIL-plugin

    I've played around a little bit with the SMIL-plugin and ran in to some problems that might be possible bugs. Hope somebody could shed some light on this. 1. Adding the attribute clipBegin and/or clipEnd seems to be ignored in the creation of all ele