Cluster VI Reference Minor Bug

Over on LAVA PJM_labview posted a video of a bug found in LabVIEW 2013 SP1.  It is a minor bug with the block diagram when showing a cluster constant with a VI reference constant in it.  Here is the video of how to reproduce the bug.
http://screencast.com/t/gfKwlvMcCsHI
And here is the original thread on LAVA.
http://lavag.org/topic/18297-cool-little-lv-2013-sp1-bug/#entry109757
Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

I played with this and filed it as a CAR (#479432). Intriguingly, there are a couple workarounds:
Option 1
On block diagram:
1. Create cluster constant containing refnum with auto-sizing set as arranged (vertical or horizontal)
2. Create typedef
3. Unlink from type def
4. Change auto-sizing to desired value
5. Recreate typedef
Option 2
On front panel:
1. Create cluster containing refnum control
2. Create typedef
On block diagram:
3. Create constant from cluster typedef on block diagram.
4. Unlink constant from typedef, change auto-sizing as desired, recreate typedef
Christopher S. | Applications Engineer
Certified LabVIEW Developer
"If in doubt... flat out." - Colin McRae

Similar Messages

  • Strange Problem - Cluster of References

    Hello guys
    I had a strange problems using a cluster with references.
    How to reproduce the problem:
    - open a blank VI;
    - create two graphs in the front panel;
    - in the block diagram, create references for both graphs;
    - connect these references to a bundle (not bundle by name);
    - create an indicator for the bundle;
    - run the VI once;
    - right click on the bundle indicator and change it to a control;
    - delete references and bundle;
    - select the control in the front panel, go to EDIT, CUSTOMIZE CONTROL;
    - change to strict type def;
    - save this control as Control1.ctl;
    - connect the control to a unbundle by name;
    - right click on the unbundle by name and select one of the two graphs as an item (doesn't matter which one you select);
    - create a property node and feed its reference terminal with the reference from the unbundle by name;
    - use the property "Label.Text" in the property node;
    - create an indicator for the the property node;
    - run the VI;
    - the indicator will show the correct label for that graph;
    - perfect!!!
    If you save the VI and run it again, everything is fine.
    But............... if you close it, open again and run.... you will get an error 1055 "Object reference is invalid".
    Why it was working before closing?
    Find attached the VI and the Control.
    Thanks
    Dan07
    Solved!
    Go to Solution.
    Attachments:
    Cluster References.vi ‏11 KB
    Control1.ctl ‏7 KB

    Let see if I can answer before I have to start working.
    Do a quick experiment.
    Use a Type cast to cast your ref as a U32 and show that value on the FP.
    Save the VI run it and record the number on the FP.
    Mod the vi save it clsoe it open it and run again. The number should have changed.
    That is the issue you facing, the ref number changes so you need one that is valid when you run.
    How I do it;
    I use an Action Engine (see this Nugget to learn what an Action Engine is) that servse as a GUI controller and lets me get at refs where even I need them. The following is a case study.
    First I collect all of th refs I will need and bundle them in a type def. I sue a state machine to do the bundling if there are a lot.
    THe bundled clsuter get passed to an GUI Controller Action Engine
    Inside the Init I check the refs to make sure they are vlid. THis has saved a lot of wated time chasing invalid refs.
    If they were valid I cache the refs.
    For major mode changes that demand a lot of GUI punching I create sub-VI to do the dirty work.
    When ever other codes needs a ref to the GUI I have a method that returns the refs.
    THe following shows another VI using those GUI refs.
    I hope that helps,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Minor bug in BindingContext

    To whom it may concern,
    I found the following minor bug in the BindingContext class: keysIterator() behaves like veluesIterator().
    I don't think this affects the framework right now, but here I post it.
    Product: JDeveloper 9.0.5.1 (Build 1605)
    Class: oracle.adf.model.BindingContext.java
    Code affected:
    * Returns a thread safe values iterator.
    public Iterator valuesIterator()
    HashMap copy = (HashMap)mContextMap.clone();
    return copy.values().iterator();
    * Returns a thread safe keys iterator.
    public Iterator keysIterator()
    HashMap copy = (HashMap)mContextMap.clone();
    return copy.values().iterator(); /* <-- This should be "copy.keySet().iterator();" instead. */
    Hope it helps,
    Lluís.

    Thanks for pointing this out. This will be fixed in the next release.
    JR

  • Cluster of References Constant

    I want to do UI control of my front panel within a subVI.  Hence, I need to pass a number of references to front panel objects to a subVI.
    See the attached (simplified) example to illustrate my point.  Everything that lies within the sequence structure frames would reside in the subVI.
    In the top part of the block diagram, the references are explicitly bundled together, before being passed to the subVI to be applied to property nodes.  This works fine.
    However, if I want to define a constant cluster of references, as in the bottom part of the block diagram, it returns an error: "Object reference is invalid".  How would I make this work?  Note: I created this constant by right-clicking on the cluster wire in the top part of the diagram.
    Many Thanks,
    Dan
    Message Edited by DanB1983 on 04-20-2010 07:08 AM
    Message Edited by DanB1983 on 04-20-2010 07:09 AM
    Dan
    CLD
    Attachments:
    cluster of refs.JPG ‏63 KB

    You can pop-up on the middle input of teh bundle to create a constant. See this mini-Nugget.
    This thread may help, here is a preview.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Minor bug in user interface

    I have noticed a minor bug in the user interface... the font color in develop module changes to barely legible whilst editing values using keyboard. Does not seem to affect the font when using sliders to change  values.

    We've got that one bugged, thanks au2045

  • [svn] 4513: Minor bug fixes.

    Revision: 4513
    Author: [email protected]
    Date: 2009-01-13 13:46:08 -0800 (Tue, 13 Jan 2009)
    Log Message:
    Minor bug fixes.
    * pausing effect currently sleeping through its startDelay now works
    * new effects now work correctly with nonzero repeatDelay
    * ASDoc fixes for ANIMATION_REPEAT event
    QE Notes: None
    Doc Notes: None
    Bugs: sdk-17993, sdk-17842, sdk-18672
    Reviewer: Jason
    Tests: checkintests, Mustella: Effects, gumbo/effects, ListDataEffects
    Ticket Links:
    http://bugs.adobe.com/jira/browse/sdk-17993
    http://bugs.adobe.com/jira/browse/sdk-17842
    http://bugs.adobe.com/jira/browse/sdk-18672
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/Animation.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimate.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.a s
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/events/AnimationEvent.as

    It means that small issues in the software were fixed.

  • Text-inset cross-reference PDF bug ever fixed?

    We're using FrameMaker 8.0 and Acrobat 8.1.
    Has Adobe ever fixed the bug where cross-references in text insets aren't converted to valid links in PDFs? In other words, do we still need to work around that bug by using newlink / gotolink hypertext markers in text insets?

    Robert:
    As far as I can tell, FM8 still exhibits the undesirable behavior...
    Cheers & hope this helps,
    Riley

  • Help, experiencing minor bugs in program

    this is supposed to use rectangles and you should be able to load and save and they have colors and do a few more things with them, the loading is where it doesn't work.
    *-------------------------------------------------------------- 80 columns ---|
    * This is the main class for the application. It is built along the same
    * lines as the Editor class of project 1. It has a constructor, two instance
    * methods, and a static main()  that kicks the whole thing off.
    * The two instance methods are a menu creation method, and a menuItems
    * initialisation method.  The constructor instantiates the window
    * and sets up its internals by creating and installing the drawing canvas,
    * toolbar, and menus. All of the code works correctly as is and should
    * require no changes.
    * @version      1.1 15/04/01
    * @author       Julie Zelenski
    * @author       Restructured by Ian A. Mason
    * @see       javax.swing.JFrame
    * @see       javax.swing.JMenuBar
    * @see       javax.swing.JMenuItem
    * @see       javax.swing.JMenu
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class JavaDraw extends JFrame {
        final Toolbar toolbar = new Toolbar();
        final DrawingCanvas canvas = new DrawingCanvas(toolbar, 350, 350);
        final int menuMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
        final JMenuBar mb = new JMenuBar();
        final String[]
             fileMenuItems = {"Clear all", "Load file", "Save to file", "Quit"};
        final int[] fileKeyCodes = {KeyEvent.VK_N, KeyEvent.VK_O, KeyEvent.VK_S, KeyEvent.VK_Q};
        final ActionListener[] fileActionListeners = {
         new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                  canvas.clearAll();}},
         new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                  canvas.loadFile();}},
         new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                  canvas.saveToFile();}},
         new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                  System.exit(0);}}
        final String[] editMenuItems = {"Cut", "Copy", "Paste", "Delete"};
        final int[] editKeyCodes = {KeyEvent.VK_X, KeyEvent.VK_C, KeyEvent.VK_V, KeyEvent.VK_BACK_SPACE};
        final int[] editMenuMasks = {menuMask, menuMask, menuMask, 0};
        final ActionListener[] editActionListeners = {
         new ActionListener() {
              public void actionPerformed(ActionEvent e) { canvas.cut();}},
         new ActionListener() {
              public void actionPerformed(ActionEvent e) { canvas.copy();}},
         new ActionListener() {
              public void actionPerformed(ActionEvent e) { canvas.paste();}},
         new ActionListener() {
              public void actionPerformed(ActionEvent e) { canvas.delete();}}
        final String[] layeringMenuItems = {"Bring to front", "Send to back"};
        final int[]    layeringKeyCodes = {KeyEvent.VK_F, KeyEvent.VK_B};
        final ActionListener[] layeringActionListeners = {
         new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                  canvas.bringToFront();}},
         new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                  canvas.sendToBack();}}
        private JavaDraw(){
         super("JavaDraw!");
         toolbar.setCanvas(canvas);
         getContentPane().add(toolbar, BorderLayout.SOUTH);
         getContentPane().add(canvas, BorderLayout.CENTER);
         createMenus();
         setJMenuBar(mb);
         setLocation(100, 20);
         pack();
         setVisible(true);
        static public void main(String[] args){
         JavaDraw javaDraw = new JavaDraw();
        private void initMenus(JMenu m,
                      String  miLabel,
                      int keyCode,
                      int menuMask,
                      ActionListener al){
         JMenuItem mi = new JMenuItem(miLabel);
         m.add(mi);
         mi.addActionListener(al);
         mi.setAccelerator(KeyStroke.getKeyStroke(keyCode, menuMask));
        private void createMenus(){
         JMenu m;
         m = new JMenu("File");
         for(int i = 0; i < fileMenuItems.length; i++)
             initMenus(m,
                    fileMenuItems,
              fileKeyCodes[i],
              menuMask,
              fileActionListeners[i]);
         mb.add(m);
         m = new JMenu("Edit");
         for(int i = 0; i < editMenuItems.length; i++)
         initMenus(m,
              editMenuItems[i],
              editKeyCodes[i],
              editMenuMasks[i],
              editActionListeners[i]);
         mb.add(m);
         m = new JMenu("Layering");
         for(int i = 0; i < layeringMenuItems.length; i++)
         initMenus(m,
              layeringMenuItems[i],
              layeringKeyCodes[i],
              menuMask,
              layeringActionListeners[i]);
         mb.add(m);
    *-------------------------------------------------------------- 80 columns ---|
    * The DrawingCanvas class a small extension of JComponent
    * @version 1.1 15/04/01
    * @author Julie Zelenski
    * @author (touched up by Ian A. Mason)
    * @see javax.swing.JComponent
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.util.*;
    public class DrawingCanvas extends JComponent{
    static final int DRAG_NONE = 0;
    static final int DRAG_CREATE = 1;
    static final int DRAG_RESIZE = 2;
    static final int DRAG_MOVE = 3;
    // list of all shapes on canvas
    protected Vector allShapes;          
    // currently selected shape (can be null at times)
    protected Rect selectedShape;
    // reference to toolbar to message for tool&color settings
    protected Toolbar toolbar;
    protected Rect clipboard=null;          
    /* These are the unimplemented menu commands. The menus are already
    * set up to send the correct messages to the canvas, but the
    * method bodies themselves are currently completely empty. It will
    * be your job to fill them in!
    public void cut() {
         copy();
         delete();
    public void copy() {
         int x=(int)selectedShape.getBounds().getX();
         int y=(int)selectedShape.getBounds().getY();
         Point p=new Point(x,y);
         clipboard=new Rect(p,this);
         clipboard.setBounds(selectedShape.getBounds());
    public void paste() {
         if(clipboard==null)
              return;
         allShapes.add(clipboard);
         setSelectedShape(clipboard);
         copy();
         this.repaint();
    public void delete() {
         if(selectedShape==null)
              return;
         else{
         int num=allShapes.indexOf(selectedShape);
         allShapes.remove(num);
         selectedShape=null;
         this.repaint();
    public void clearAll() {
         allShapes.removeAllElements();
         this.repaint();
    public void loadFile() {
         Load load=new Load(this);
         load.setSize(250,200);
         load.validate();
         load.setVisible(true);
    public void done(Vector vect){
         allShapes.removeAllElements();
         for(int i=0;i<vect.size();i++){
              allShapes.add(vect.elementAt(i));
         this.repaint();
    public void saveToFile() {
         Save save=new Save(allShapes);
         save.setSize(250,200);
         save.validate();
         save.setVisible(true);
    public void bringToFront() {
         if(selectedShape==null)
              return;
         int size=allShapes.size();
         int index=allShapes.indexOf(selectedShape);
         for(int i=index+1;i<=size-1;i++){
              allShapes.set(i-1,allShapes.elementAt(i));
         allShapes.set(size-1,selectedShape);
         this.repaint();
    public void sendToBack() {
         if(selectedShape==null)
              return;
         int index=allShapes.indexOf(selectedShape);
         for(int i=index-1;i>=0;i--){
              allShapes.remove(allShapes.elementAt(i+1));
              allShapes.add(i+1,allShapes.elementAt(i));
         allShapes.remove(allShapes.elementAt(0));
         allShapes.add(0,selectedShape);
         this.repaint();
    * Constructor for creating a new empty DrawingCanvas. We set up
    * our size and background colors, instantiate an empty vector of shapes,
    * and install a listener for mouse events using our inner class
    * CanvasMouseHandler
    public DrawingCanvas(Toolbar tb, int width, int height){
         setPreferredSize(new Dimension(width, height));
         setBackground(Color.white);
         toolbar = tb;
         allShapes = new Vector();
         selectedShape = null;
         CanvasMouseHandler handler = new CanvasMouseHandler();
         addMouseListener(handler);
         addMouseMotionListener(handler);
    * All components are responsible for drawing themselves in
    * response to repaint() requests. The standard method a component
    * overrides is paint(Graphics g), but for Swing components, the default
    * paint() handler calls paintBorder(), paintComponent() and paintChildren()
    * For a Swing component, you override paintComponent and do your
    * drawing in that method. For the drawing canvas, we want to
    * clear the background, then iterate through our shapes asking each
    * to draw. The Graphics object is clipped to the region to update
    * and we use to that avoid needlessly redrawing shapes outside the
    * update region.
    public void paintComponent(Graphics g){
         Rectangle regionToRedraw = g.getClipBounds();
         g.setColor(getBackground());
         g.fillRect(regionToRedraw.x, regionToRedraw.y,
              regionToRedraw.width, regionToRedraw.height);
         Iterator iter = allShapes.iterator();
         while (iter.hasNext())
         ((Rect)iter.next()).draw(g, regionToRedraw);
    * Changes the currently selected shape. There is at most
    * one shape selected at a time on the canvas. It is possible
    * for the selected shape to be null. Messages the shape to
    * change its selected state which will in turn refresh the
    * shape with the knobs active.
    protected void setSelectedShape(Rect shapeToSelect) {
         // if change in selection
         if (selectedShape != shapeToSelect) {
         // deselect previous selection
         if (selectedShape != null)
              selectedShape.setSelected(false);
         // set selection to new shape
         selectedShape = shapeToSelect;
         if (selectedShape != null) {
              shapeToSelect.setSelected(true);
    * A hit-test routine which finds the topmost shape underneath a
    * given point.We search Vector of shapes in back-to-front order
    * since shapes created later are added to end and drawn last, thus
    * appearing to be "on top" of the earlier ones. When a click comes
    * in, we want to select the top-most shape.
    protected Rect shapeContainingPoint(Point pt){
         for (int i = allShapes.size()-1; i >= 0; i--) {
         Rect r = (Rect)allShapes.elementAt(i);
         if (r.inside(pt)) return r;
         return null;
    * The inner class CanvasMouseHandler is the object that handles the
    * mouse actions (press, drag, release) over the canvas. Since there is
    * a bit of state to drag during the various operations (which shape,
    * where we started from, etc.) it is convenient to encapsulate all that
    * state with this little convenience object and register it as the
    * handler for mouse events on the canvas.
    protected class CanvasMouseHandler
         extends MouseAdapter implements MouseMotionListener {
         Point dragAnchor;          
         // variables using to track state during drag operations
         int dragStatus;
         /** When the mouse is pressed we need to figure out what
         * action to take. If the tool mode is arrow, the click might
         * be a select, move or reisze. If the tool mode is one of the
         * shapes, the click initiates creation of a new shape.
         public void mousePressed(MouseEvent event){
         Rect clicked = null;
         Point curPt = event.getPoint();
         // first, determine if click was on resize knob of selected shape
         if (toolbar.getCurrentTool() == Toolbar.SELECT) {
              if (selectedShape != null &&
              (dragAnchor = selectedShape.getAnchorForResize(curPt))
              != null) {
              // drag will resize this shape
              dragStatus = DRAG_RESIZE;     
              } else if ((clicked = shapeContainingPoint(curPt)) != null) {
              // if not, check if any shape was clicked
              setSelectedShape(clicked);
              // drag will move this shape      
              dragStatus = DRAG_MOVE;
              dragAnchor = curPt;
              } else {     
              // else this was a click in empty area,
              // deselect selected shape,
              setSelectedShape(null);
              // drag does nothing in this case
              dragStatus = DRAG_NONE;
         } else {
              Rect newShape = new Rect(curPt, DrawingCanvas.this);
              // create rect here
              allShapes.add(newShape);
              setSelectedShape(newShape);
              dragStatus = DRAG_CREATE;          
              // drag will create (resize) this shape
              dragAnchor = curPt;
         /** As the mouse is dragged, our listener will receive periodic
         * updates as mouseDragged events. When we get an update position,
         * we update the move/resize event that is in progress.
         public void mouseDragged(MouseEvent event){
         Point curPt = event.getPoint();
         switch (dragStatus) {
         case DRAG_MOVE:
              selectedShape.translate(curPt.x - dragAnchor.x,
                             curPt.y - dragAnchor.y);
              // update for next dragged event
              dragAnchor = curPt;
              break;
         case DRAG_CREATE: case DRAG_RESIZE:
              selectedShape.resize(dragAnchor, curPt);
              break;
         public void mouseMoved(MouseEvent e) {}
    /** A little helper routine that will be useful for the load & save
    * operations. It brings up the standard JFileChooser dialog and
    * allows the user to specify a file to open or save. The return
    * value is the full path to the chosen file or null if no file was
    * selected.
    protected String filenameChosenByUser(boolean forOpen){
         JFileChooser fc = new JFileChooser(System.getProperty("user.dir") +
                             java.io.File.separator + "Documents");
         int result = (forOpen? (fc.showOpenDialog(this)) :
              fc.showSaveDialog(this));
         java.io.File chosenFile = fc.getSelectedFile();
         if (result == JFileChooser.APPROVE_OPTION && chosenFile != null)
         return chosenFile.getPath();
         return null;
         // return null if no file chosen or dialog cancelled
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Vector;
    import java.io.*;
    class Load extends JFrame implements ActionListener, Serializable{
         Container contentPane;
         JTextField jtf;
         JButton jb;
         Object obj=null;
         Load load;
         Thread thread;
         DrawingCanvas draw;
         public Load(DrawingCanvas dc){
              draw=dc;
              contentPane=getContentPane();
              contentPane.setLayout(new FlowLayout());
              jtf=new JTextField(20);
              jb=new JButton("Load");
              jb.addActionListener(this);
              contentPane.add(jtf);
              contentPane.add(jb);
         public void actionPerformed(ActionEvent e){
              String text=jtf.getText();
              SimpleObjectReader reader=SimpleObjectReader.openFileForReading(text+".shp");
              if(reader==null){
                   System.out.println("Couldn't open file!");
                   return;
              obj=reader.readObject();
              reader.close();
              draw.done((Vector)obj);
              this.setVisible(false);
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.util.Vector;
    import java.io.*;
    class Save extends JFrame implements ActionListener, Serializable{
         Container contentPane;
         JTextField jtf;
         Vector shapes;
         JButton jb;
         public Save(Vector shapeVector){
              shapes=shapeVector;
              contentPane=getContentPane();
              contentPane.setLayout(new FlowLayout());
              jtf=new JTextField(20);
              jb=new JButton("Save");
              jb.addActionListener(this);
              contentPane.add(jtf);
              contentPane.add(jb);
         public void actionPerformed(ActionEvent e){
              String text=jtf.getText();
              SimpleObjectWriter writer=SimpleObjectWriter.openFileForWriting(text+".shp");
              if(writer==null){
                   System.out.println("Couldn't open file!");
                   return;
              writer.writeObject(shapes);
              writer.close();
              this.setVisible(false);
    *-------------------------------------------------------------- 80 columns ---|
    * The RectShape class defines a simple rectangular shape object.
    * It tracks its bounding box, selected state, and the canvas it is being
    * drawn in. It has some basic methods to select, move, and resize the
    * rectangle. It has methods that draw the shape in the selected or unselected
    * states and updates the canvas whenever the state or bounds of the rectangle
    * change. The code that is there works properly, but you will need to extend
    * and change the code to support additional features.
    * @version 1.1 15/04/01
    * @author Julie Zelenski
    * @author (touched up by Ian A. Mason)
    import java.awt.*;
    import java.io.*;
    public class Rect implements Serializable{     
    protected Rectangle bounds;
    protected boolean isSelected;
    public Color color;
    public DrawingCanvas canvas;
    protected static final int KNOB_SIZE = 6;
    protected static final int NONE = -1;
    protected static final int NW = 0;
    protected static final int SW = 1;
    protected static final int SE = 2;
    protected static final int NE = 3;
    /** The constructor that creates a new zero width and height rectangle
    * at the given position in the canvas.
    public Rect(Point start, DrawingCanvas dcanvas){
         canvas = dcanvas;
         bounds = new Rectangle(start);
         color=canvas.toolbar.getCurrentColor();
    /** The "primitive" for all resizing/moving/creating operations that
    * affect the rect bounding box. The current implementation just resets
    * the bounds variable and triggers a re-draw of the union of the old &
    * new rectangles. This will redraw the shape in new size and place and
    * also "erase" if bounds are now smaller than before. It is a good
    * design to have all changes to a critical variable bottleneck through
    * one method so that you can be sure that all the updating that goes
    * with it only needs to be implemented in this one place. If any of your
    * subclasses have additional work to do when the bounds change, this is
    * the method to override. Make sure that any methods that change the
    * bounds call this method instead of directly manipulating the variable.
    protected void setBounds(Rectangle newBounds){
         Rectangle oldBounds = bounds;
         bounds = newBounds;
         updateCanvas(oldBounds.union(bounds));
    /** The resize operation is called when first creating a rect, as well as
    * when later resizing by dragging one of its knobs. The two parameters
    * are the points that define the new bounding box. The anchor point
    * is the location of the mouse-down event during a creation operation
    * or the opposite corner of the knob being dragged during a resize
    * operation. The end is the current location of the mouse. If you
    * create the smallest rectangle which encloses these two points, you
    * will have the new bounding box. Use the setBounds() primitive which
    * is the bottleneck we are using for all geometry changes, it handles
    * updating and redrawing.
    public void resize(Point anchor, Point end){
         Rectangle newRect = new Rectangle(anchor);
         // creates smallest rectange which
         // includes both anchor & end
         newRect.add(end);
         // reset bounds & redraw affected areas
         setBounds(newRect);      
    public Rectangle getBounds(){
         return bounds;
    /** The translate operation is called when moving a shape by dragging in
    * the canvas. The two parameters are the delta-x and delta-y to move
    * by. Note that either or both can be negative. Create a new rectangle
    * from our bounds and translate and then go through the setBounds()
    * primitive to change it.
    public void translate(int dx, int dy){
         Rectangle newRect = new Rectangle(bounds);
         newRect.translate(dx, dy);
         setBounds(newRect);
    /** Used to change the selected state of the shape which will require
    * updating the affected area of the canvas to add/remove knobs.
    public void setSelected(boolean newState){
         isSelected = newState;
         // need to erase/add knobs
         // including extent of extended bounds
         updateCanvas(bounds, true);
    /** The updateCanvas() methods are used when the state has changed
    * in such a way that it needs to be refreshed in the canvas to properly
    * reflect the new settings. The shape should take responsibility for
    * messaging the canvas to properly update itself. The appropriate AWT/JFC
    * way to re-draw a component is to send it the repaint() method with the
    * rectangle that needs refreshing. This will cause an update() event to
    * be sent to the component which in turn will call paint(), where the
    * real drawing implementation goes. See the paint() method in
    * DrawingCanvas to see how it is implemented.
    protected void updateCanvas(Rectangle areaOfChange, boolean enlargeForKnobs){
         Rectangle toRedraw = new Rectangle(areaOfChange);
         if (enlargeForKnobs)
         toRedraw.grow(KNOB_SIZE/2, KNOB_SIZE/2);
         canvas.repaint(toRedraw);
    protected void updateCanvas(Rectangle areaOfChange){
         updateCanvas(areaOfChange, isSelected);
    /** When the DrawingCanvas needs a shape to draw itself, it sends a draw
    * message, passing the graphics context and the current region being
    * redrawn. If the shape intersects with that region, it must draw itself
    * doing whatever it takes to properly represent itself in the canvas
    * (colors, location, size, knobs, etc.) by messaging the Graphics object.
    public void draw(Graphics g, Rectangle regionToDraw){
         if (!bounds.intersects(regionToDraw))
         return;
         g.setColor(color);
         g.fillRect(bounds.x, bounds.y, bounds.width, bounds.height);
         if (isSelected) { // if selected, draw the resizing knobs
         // along the 4 corners
         Rectangle[] knobs = getKnobRects();
         for (int i = 0; i < knobs.length; i++)
              g.fillRect(knobs[i].x, knobs[i].y,
                   knobs[i].width, knobs[i].height);
    /** When the DrawingCanvas needs to determine which shape is under
    * the mouse, it asks the shape to determine if a point is "inside".
    * This method should returns true if the given point is inside the
    * region for this shape. For a rectangle, any point within the
    * bounding box is inside the shape.
    public boolean inside(Point pt){
         return bounds.contains(pt);
    /** When needed, we create the array of knob rectangles on demand. This
    * does mean we create and discard the array and rectangles repeatedly.
    * These are small objects, so perhaps it is not a big deal, but
    * a valid alternative would be to store the array of knobs as an
    * instance variable of the Shape and and update the knobs as the bounds
    * change. This means a little more memory overhead for each Shape
    * (since it is always storing the knobs, even when not being used) and
    * having that redundant data opens up the possibility of bugs from
    * getting out of synch (bounds move but knobs didn't, etc.) but you may
    * find that a more appealing way to go. Either way is fine with us.
    * Note this method provides a nice unified place for one override from
    * a shape subclass to substitute fewer or different knobs.
    protected Rectangle[] getKnobRects(){
         Rectangle[] knobs = new Rectangle[4];
         knobs[NW] = new Rectangle(bounds.x - KNOB_SIZE/2,
                        bounds.y - KNOB_SIZE/2, KNOB_SIZE, KNOB_SIZE);
         knobs[SW] = new Rectangle(bounds.x - KNOB_SIZE/2,
                        bounds.y + bounds.height - KNOB_SIZE/2,
                        KNOB_SIZE, KNOB_SIZE);
         knobs[SE] = new Rectangle(bounds.x + bounds.width - KNOB_SIZE/2,
                        bounds.y + bounds.height - KNOB_SIZE/2,
                        KNOB_SIZE, KNOB_SIZE);
         knobs[NE] = new Rectangle(bounds.x + bounds.width - KNOB_SIZE/2,
                        bounds.y - KNOB_SIZE/2,
                        KNOB_SIZE, KNOB_SIZE);
         return knobs;
    /** Helper method to determine if a point is within one of the resize
    * corner knobs. If not selected, we have no resize knobs, so it can't
    * have been a click on one. Otherwise, we calculate the knob rects and
    * then check whether the point falls in one of them. The return value
    * is one of NW, NE, SW, SE constants depending on which knob is found,
    * or NONE if the click doesn't fall within any knob.
    protected int getKnobContainingPoint(Point pt){
         // if we aren't selected, the knobs
         // aren't showing and thus there are no knobs to check
         if (!isSelected) return NONE;
         Rectangle[] knobs = getKnobRects();
         for (int i = 0; i < knobs.length; i++)
         if (knobs[i].contains(pt))
              return i;
         return NONE;
    /** Method used by DrawingCanvas to determine if a mouse click is starting
    * a resize event. In order for it to be a resize, the click must have
    * been within one of the knob rects (checked by the helper method
    * getKnobContainingPoint) and if so, we return the "anchor" ie the knob
    * opposite this corner that will remain fixed as the user drags the
    * resizing knob of the other corner around. During the drag actions of a
    * resize, that fixed anchor point and the current mouse point will be
    * passed to the resize method, which will reset the bounds in response
    * to the movement. If the mouseLocation wasn't a click in a knob and
    * thus not the beginning of a resize event, null is returned.
    public Point getAnchorForResize(Point mouseLocation){
         int whichKnob = getKnobContainingPoint(mouseLocation);
         // no resize knob is at this location
         if (whichKnob == NONE)
         return null;
         switch (whichKnob) {
         case NW: return new Point(bounds.x + bounds.width,
                        bounds.y + bounds.height);
         case NE: return new Point(bounds.x, bounds.y + bounds.height);
         case SW: return new Point(bounds.x + bounds.width, bounds.y);
         case SE: return new Point(bounds.x, bounds.y);
         return null;
    import java.io.*;
    * SimpleObjectReader is a small class to wrap around the usual ObjectStream
    * to shield you from the exception handling which we haven't yet gotten
    * to in class.
    * <P>It has just three methods of note: one to open a new file for reading,
    * one to read an object from an open file, and one to close the file when done.
    * <P>Any object that you attempt to read must properly implement the Serializable
    * interface. Here is a simple example that shows using the SimpleFileReader to
    * to rehydrate objects from a file and print them:
    * <PRE>
    * SimpleObjectReader reader = SimpleObjectReader.openFileForReading("shapes");
    * if (reader == null) {
    * System.out.println("Couldn't open file!");
    * return;
    * Object obj;
    * while ((obj = reader.readObject()) != null)
    * System.out.println(obj);
    * reader.close();
    * </PRE>
    * <P>You are free to edit or extend this class, but we don't expect that
    * you should need to make any changes.
    * @version 1.1 15/04/01
    * @author Julie Zelenski
    * @author (touched up by Ian A. Mason)
    public class SimpleObjectReader {
    private ObjectInputStream ois;
    * Opens a new file for reading. The filename can either be a relative
    * path, which will be relative to the working directory of the program
    * when started, or an absolute path. If the file exists and can be
    * opened, a new SimpleObjectReader is returned. If the file cannot be
    * opened (for any reason: wrong name, wrong path, lack of permissions, etc.)
    * null is returned.
    public static SimpleObjectReader openFileForReading(String filename){
         try {
         return new SimpleObjectReader(new ObjectInputStream(new FileInputStream(filename)));
         } catch(IOException e) {     
         return null;
    * Reads a single object from the file and returns it. If there are
    * no more objects in the file (i.e, we have reached the end of file),
    * null is returned null is returned. null is also
    * returned on any I/O error.
    public Object readObject (){
         try {
         return ois.readObject();
         } catch (IOException e) {
         e.printStackTrace();
         return null;
         } catch (ClassNotFoundException e) {
         e.printStackTrace();
         return null;
    * Closes the file when done reading. You should close a reader when
    * you are finished to release the OS resources for use by others.
    public void close (){
         try {
         ois.close();
         catch (IOException e) {}
    * Constructor is private so that only means to create a new reader
    * is through the static method which does error checking.
    private SimpleObjectReader(ObjectInputStream ois){
         this.ois = ois;
    import java.io.*;
    * SimpleObjectWriter is a small class to wrap around the usual
    * ObjectOutputStream to shield you from the exception handling
    * which we haven't yet gotten to in class.
    * <P>It has just three methods of note: one to open a new file for writing,
    * one to write an object to the file, and one to close the
    * the file when done.
    * <P>Here is a simple example that shows using the SimpleObjectWriter
    * to create a new file and write some objects into it:
    * <PRE>
    * SimpleObjectWriter writer =
    * SimpleObjectWriter.openFileForWriting("objects");
    * if (writer == null) {
    * System.out.println("Couldn't open file!");
    * return;
    * writer.writeObject("Here is a string");
    * writer.writeObject("And another one.");
    * writer.writeObject(new Date());
    * writer.close();
    * </PRE>
    * <P>You are free to edit or extend this class, but we don't expect that
    * you should need to make any changes.
    * @version 1.1 15/04/01
    * @author Julie Zelenski
    * @author (touched up by Ian A. Mason)
    public class SimpleObjectWriter {
    private ObjectOutputStream oos;
    * Opens a new file for writing. The filename can either be a relative
    * path, which will be relative to the working directory of the program
    * when started, or an absolute path. If the file can be created, a
    * new SimpleObjectWriter is returned. If the file already exists, this
    * will overwrite its content

    I'm not reading that either, but to help you for next time:
    - use more than 1 sentence to describe your problem
    - only post the RELEVANT code, or a small test program with the same problem if possible.
    At least you formatted it, I'll give you that.
    Cheers,
    Radish21
    PS. I think in this case, posting another (better worded) thread might be a good idea, because no one is going to read this one. In general though, don't :)

  • Minor bug with Connections node in SQL Dev. 2.1 EA1

    This is minor compared to some of the other issues found with EA1.
    When I expand the Connections node by clicking on the "+" I cannot collapse it when clicking on the "-". This happens both when migrating settings from 1.5.5 and when starting clean without migrating settings and then creating new connections. (I deleted the "system2.1.0.62.61" folder between tests.) I tried this by running "+<install_dir>+\sqldeveloper\sqldeveloper.exe" and "+<install_dir>+\sqldeveloper\sqldeveloper\bin\sqldeveloper.exe" to get a console window. (The only messages I saw in the console window occurred when I opened a connection.)
    Here are the "About" and "Version" info:
    About
    Oracle SQL Developer 2.1.0.62
    Version 2.1.0.62
    Build MAIN-62.61
    Copyright © 2005,2009 Oracle. All Rights Reserved.
    IDE Version: 11.1.1.2.36.54.96
    Product ID: oracle.sqldeveloper
    Product Version: 11.1.1.62.61
    Version
    Component     Version
    =========     =======
    Java(TM) Platform     1.6.0_14
    Oracle IDE     2.1.0.62.61
    Versioning Support     2.1.0.62.61
    FWIW, I can collapse and expand the Connections node in 1.5.5 without any problem.
    Ed. H.

    Thanks the bug is that the +/- is even being shown. I put something in there to prevent the collapsing of that since there's nothing when it's collapse.
    -kris

  • JDev 11r1 minor bug in Subversion Import Wizard

    Hi all,
    When performing the initial import of an application into a Subversion repository, on step 4 of 6 of the import wizard (Filters), there is a minor UI bug. Both the "New" button (for adding a new ignore filter) and the "Next" button (for going to the next step of the wizard) have a shortcut key of "N".
    Obviously not a show-stopper, but a minor annoyance.
    John

    Logged bug 7516297 for this

  • Another Minor Bug in SQLDev

    I discovered another minor irritant in sqlDeveloper.
    Steps to recreate the bug:
    1) Create table t ( n1 number); (table created)
    2) insert into t values (1); Commit; (Record Committed)
    3) Goto Explorer on the left pane and click on the table to view the table t on the right (table will be displayed with a single column); Click on the data tab to view the data.
    4) Alter table t add (n2 binary_float); (Table modified)
    5) insert into t values (10, 10); Commit; (record committed)
    6) click on refresh button to view the data.
    You would expect to see two columns and two rows of record. But you would see only one column and two rows of data.
    7) click on columns tab and click on the refresh button. (Two columns are displayed).
    8) now go back to data tab; you would still see only ONE column and two records. Clicking on refresh does not display two columns
    Only alternative is to close the tab and click on the table t again. You can now view the records with two columns
    Version: 2.1.1.64
    OS: Linux
    Database: 11g
    -- rsrini

    I am having a similar problem in 2.1.063.10. When I put in a filter I need to use the enter key and not the refresh button. Nothing happens to the data grid when I hit refresh button. When I enter a filter that causes no data to display, then blank out the filter and hit the refresh button, no data is displayed in the grid. Then I hit enter and the data grid is refreshed.

  • Cluster Control References

    The Controls[] property of a cluster will provide an array of generic
    references to the cluster elements.  However, each element must have
    its own "Type Cast" or "To More Specific Class" node, and the resulting
    type must corresponding to the order of elements in the cluster.    
    An "Unbundle By Name" or "Bundle By Name" node will respectively read or write typed values of cluster elements.
    Is there an "Unbundle References By Name" node or VI to obtain a cluster of typed (not generic) references from a cluster?

    Attached is a very quick toy example of using a cluster's element references.
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA
    Attachments:
    element ref example.vi ‏14 KB

  • Minor bug in dp-xml processing...

    Each time user selects a channel
    <Reference value="MyChannel" merge="replace" lock="false" propagate="true" advanced="false"/>"
    will be added to <Selected> in his dp.xml
    (even if <Reference value="MyChannel" merge="remove" lock="false" propagate="true" advanced="false"/>"
    already exists!)
    Now, each time user deselects a channel -
    only merge="remove" will be set for this element,
    but the entry will not be deleted!
    Which means in three months of intensive use
    your portal will get really slow...
    Cheers,
    Alex :-)

    Andy,
    1) Stangely enough, the Escape XML.vi doesn't escape "</"!
    2) Escape XML.vi takes a string, so you have to convert the picture to string. But when you convert the picture to string, the bug isn't there anymore.
    So to work around the problem, you can just convert the picture to string (use flatten to string, casting is (without any reason) disabled...).
    Someone who wants to flatten pictures to XML should be experienced enough to figure this out, so I wouldn't put the bug on the priority list. Also, fixing it could cause backwards compatibility problems.
    Regards,
    Wiebe.
    Attachments:
    Bug Flatten Picture To XML.vi ‏39 KB

  • Minor bug report SoundTrack Pro

    Hi,
    I would like to report what seems to be a little bug in SoundTrack Pro wav file creation process and haven't found a page where to send a ticket so I'm posting this here
    I am currently writing a programm to read simple WAVE fles with the basic scheme RIFF/WAVE/fmt /data and I am basically skipping any chunk whose ID differs from the four previous. Every chunk of meta in a WAVE file is supposed to be ChunkID on 4 bytes then, immediatly after, ChunkSize on 4 bytes too.
    SoundTrack Pro seems to respects this format for the APPL chunk (contains a path) except for one little bug: the size I read is one byte too short for me. And only for this chunk of meta. (Not the storage of the size, which is on 4 bytes too, the actual size of the whole chunk). I have to manually read one more byte when the chunk is APPL.
    Any ideas of where this should be reported ? Plus it is really minor, I don't really have a hope that this bug be corrected one day but anyway...
    Tignus.

    This is a user to user forum. To submit feedback to Apple, (with the program open) select Soundtrack Pro (the item just to the right of the Apple icon) then> Provide Soundtrack Pro Feedback. This will send an email to Apple.
    In the FWIW catagory, STP is a dead program. There will be no additional development on it.
    Good luck,
    x

  • Create subVI Control from Reference Name Bug

    If you connect N references to a sequence structure and create a subVI from this structure, the first N-1 controls will have the name of the original control (desired), but the last one will not. It will have the name of the generic type of the control this reference is pointing to. Of course, if N = 1, that means that the created control will have the generic name.
    Illustration:
    In the diagram above, subVI 1 has been created from a sequence to which a reference to "Numeric Control" was connected. Here is the FP of that subVI, as created by LV:
    subVI 2 was created from a sequence to which both references were connected. Here is the FP of that subVI:
    This does not seem to depend on the type of the control. If I add a graph:
    the created subVI looks like this:

    Kind of an extension of this bug, but not exactly the same. Might be due to the same cause though
    If you create a subVI incorporating Property Nodes (not recommended in general for performance reasons, but not a killer either), the subVI will obviously have references to the corresponding controls as controls and references to the controls will appear in the calling VI:
    Before:
    After:
    (it never ceases to amaze me how bad the cleanup/auto-routing algorithm developed by NI is :-)
    Here is the corresponding FP of the created subVI:
    This time, never mind the names of the original controls, they will be ignored, no matter how many different controls there is.
    (I am not even mentioning the well-known feature that if instead of enclosing the property nodes you just enclose the wires coming from the "Value" node, the subVI's controls will read "Value, Value2", etc, where the type of the "Value" controls will in general have absolutely nothing in common).

Maybe you are looking for

  • Start up pause/hang before loading A-Dock and Control Strip

    Ok, I know, running a sooped up 7200 PowerMac is not worth the time or money, but...I've got this hang that's become more pronounced lately. Everything seems to load fine. After about 3-5 minutes A-Dock and Control Strip come one. Already tried disab

  • Email trouble

    I have an msn email account on my iphone 4s. I am not able to send mail. The message says: The user name or password for SMTP:********@ smpt.live.com is incorrect. Help please! <Email Edited by Host>

  • How to stop video from playing while working on menu

    I have some menus with a bunch of moving video clips in drop zones in them. After some fiddling around with preferences, the clips are playing while working on the menus rather than just showing still images. I havent seen this behavior before. Anywa

  • Apply patch Java SE Critical Patch October 2011

    Hello, Server: Red Hat 5 Enterprise Edition java –version java version "1.6.0_06" Java(TM) SE Runtime Environment (build 1.6.0_06-b02) Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing) According to Oracle information http://www.oracle.

  • Links to PPRO bugfix list for cs 6.01 and 6.03 please

    hello,  i may be moving to CS6 production premium this week i'm doing lots of research can someone supply links to the bugfix lists/ release notes for the ppro updates so far in cs6 6.01 and 6.02 all i get from adobe website is 'sorry page not availa