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

Similar Messages

  • 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

  • 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.

  • 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.

  • 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

  • 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 :)

  • The new Synaptics UltraNav: a few workarounds and minor bug report.

    I only wanted to file bug report, but then decided to also share what I did with my touchpad configuration to make it more convenient for me. I have Thinkpad T540p so this might work differently or not work at all for other notebooks.
     #1 Regedit
    Configure as much as you can using UltraNav tab in mouse settings dialog. (It is mostly self-explanatory.)
    If you didn't find some option, start regedit (using Win+R) and navigate to
    HKEY_CURRENT_USER\Software\Synaptics\SynTP\something
    This something is TouchPadSMB2c on T540p but you can find one you need by changing something in settings dialog and looking for changed values in regedit.
    All the touchpad configuration registry keys are there. You need to relogin to apply changes made there.
    But it might take a lot of trial and error to find out how these registry keys work.
    #2 3-finger tap
    As for me, I prefer tapping over clicking. While 3-finger press option is in settings dialog, 3-finger tap is not. But you can change it.
    Set whatever option you want for 3-finger press. Then go to regedit and copy value from 3FingerPressButtonAction key to 3FingerTapAction.
    #3 Button sizes and locations
    You can change button bounds with keys like LeftButtonZoneX where X is L for left, R for right, T for top and B for bottom bounds. 0xFFFFFFFF ultimately means "unlimited in that direction". For finding other values defaults might be helpful. Trackpoint buttons keys are SlaveSomeButtonZoneX.
    What for?
    First, trackpoint buttons can cover the whole trackpad only when trackpad itself is disabled. By changing button sizes manually you can overcome this restriction. It is useful because trackpad does not respond well to pressing corners and when buttons cover it all you can press it somewhere in the middle.
    Second, the same corner pressing problem exists for normal trackpad buttons so it is more convenient to use multi-finger taps or clicks. You can still hold trackpad pressed with one finger and use yet another finger to move mouse pointer.
    At the same time when you tap or press with multiple fingers and one of them touches one of the buttons you get that button pressed instead of whatever you intended. It frustrated me a lot when I got context menu popups while trying to close chrome tabs with middle mouse button click. The solution is to set top bounds for left and right buttons to zero.
    BUG (With the latest UltraNav drivers from support page)
    When the middle trackpoint button (used for scrolling) is enabled, it is always enabled, no matter if you are using trackpont or touchpad. Left and right trackpoint buttons are properly disabled when you don't need them.
    Even if you disable trackpoint completely without disabling that middle button first, it will remain enabled and will do nothing. (Blocking single- and multi-finger presses that touch it.)
    I could not find a way to fix that problem with regedit.

    Any problem can get official response and follow-up through a SR on Metalink/MOS (if you have a DB support contract), else you can post here and hope someone from development picks it up.
    Regards,
    K.

  • Minor bug in photo app since 5.1

    as said just a minor issue ... not sure if that's wanted in 5.1 : okay in 5.0/5.0.1 adding photos to an existing album showed, while being processed (so very shortly) the number of photos just added on the corresponding album entry in the list. This doesn't happen anymore. The entry, while photos are being added shows the old count (the new count will still appear correctly once you're back in album list view).
    ps: on a side note here, it seems that now you can sucessively add (so just label in fact) a same photo to multiple albums - not sure but I don't think this was possible in 5.0.1

    RMISocketFactory socketFactory = RMISocketFactory.getDefaultSocketFactory();
    socketFactory.createServerSocket(rmiObjectsPort);Remove the above code. It is unnecessary and evidently harmful. RMI socket factories are for use by RMI, not application code.// Export jOTDBconnection
    jOTDBconnAdaptee = new jOTDBconnection(args[0], args[1], args[2]);
    jOTDBconnAdapter = new jOTDBadapter(jOTDBconnAdaptee);
    //A custom port was specified, export the
    object using the port specified
    if(objectPort!=0){
    OTDBconnAdapter.unexportObject(jOTDBconnAdapter,true);
    logger.info("jOTDBconnection unexported");
    logger.info("Exporting jOTDBadapter:");
    OTDBconnAdapter.exportObject(jOTDBconnAdapter,objectPort);
    logger.info("jOTDBadapter exported");This is truly bizarre. The remote object is exported, then unexported again, then exported on the correct port. Why not provide the desired port number to the constructor of the object and have it export itself on the correct port in the first place. Saving two steps? This pattern recurs several times.

  • Minor bug upgrading from apex 3.1 to 4.1

    I have an application written by someone else in apex 3.1. When upgrading to apex 4.1 some pages failed to work. This was because for some reason there was a condition on a process which had a begin and end when the condition was of type: "NOT EXISTS (SQL qurey returns no rows".
    This was combines by the process being:
    begin
    null;
    end;
    Anyway I thought I might share obviously this was crap code but maybe the upgrade process should run better then that.

    Hi Ben,
    are you upgrading your existing machine or are you setting up a new environment with Oracle 11g and APEX 4.2? If that's the case you can use have a look at http://www.talkapex.com/2012/04/command-line-backups-for-apex.html which creates export scripts for all your workspaces and applications. Those export scripts can than easily be imported with SQL*Plus. Note: Please have a look at bug# 14777994 in our Known Issues list at http://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-42-known-issues-1863578.html
    If you are upgrading your existing database, you don't have to export/import. When you upgrade APEX to 4.2 all your existing workspaces and applications will be upgraded to 4.2 as well.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • [Minor BUG] - Tasks Window does not have an Accelerator.

    I was trying to use the "Tasks Window" to go through my sources on the project and check my //TODO's and //FIXME's. When I was about to set an Accelerator for it, I see that it wasn't listed under Accelerators. Not only that, but also, when I selected the Task with the keyboard, the ENTER didn't take me to the source code.
    So, my best choice to get to a Task was:
    - ALT+V, then W (Tasks Window), !!!TAB!!! (which is a pain to not have the focus directly on the tasks), select the task with the Arrows, Press the Context Menu KEY, and then select Go to Source...
    In the end, it turned out that I was better off with the mouse. :-(
    And while we're at it, maybe you could add an Accelerator to "Go to Next Task..." :-)
    Eventhough, I still have to congratulate you guys for JDeveloper is a great tool.
    Thanks

    Sergio,
    I filed an Enhancement request so this gets tracked. Its not a bug because it is a missing feature.
    Frank

  • Minor Bug 1.5.4 Reports Navigator

    Hello,
    when I open the Reports Navigator in 1.5.4 in localized Germen version I get
    + Benutzerdefinierte Berichte
    + Data Dictionary-Berichte
    - Data Dictionary ReportsThe last node is empty and should not be there.
    And to be pedantic: There should be no hyphen in "Data Dictionary-Berichte" ;-)
    Regards
    Marcus

    I think it is a Bug. The same we had already in the previous version 1.5.3.
    best regards freamer

  • 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

Maybe you are looking for

  • How do I create a new iCloud login so that my wife and I can share an account?

    All I want to do is create a second login my wife and I can share.  In other words I want to have 2 accounts one with my wife and one for just me

  • HOW TO DESIGN A RPD .. PLS HELP

    I am new to OBI - I want to understand the methodology to design a RDP - I have gone through the ORACLE BY EXPAMPLE set avaible, it was really helpful , but still want some experts suggestion on HOW TO DESIGN THE BUSINESS AND PRESENTAION LAYER - How

  • Is there a tablet that has similar options as PC?

    I want to buy tablet for my sister ....I would like to know if there is a tablet that is the most similar to a PC , in that ...it should run flash so she can see videos on any website not, or listen to music anywhere not just youtube ...to have same

  • NullPointerException at sun.applet.AppletPanel.findAppletJDKLevel

    Hi, we have a online HTML page containing an <applet> and different <iframe> definitions. By clicking a HTML link or calling Applet.getAppletContext().showDocument(), other HTML pages containing other applets are loaded into the referenced frame. All

  • Tone curve panel

    New to LR and have just discovered I should be  able to see a 'tone curve panel'  in Develope mode.  There is no such panel available on my screen  -  what am I missing? LR v 2.3 Doug