/** Toggle the expanded state of a property set if either the event * was a double click in the title area, a single click in the spinner * area, or a keyboard event. */ private void maybeToggleExpanded(int row, EventObject e) { boolean doExpand = true; //If it's a mouse event, we need to check if it's a double click. if (e instanceof MouseEvent) { MouseEvent me = (MouseEvent) e; doExpand = me.getClickCount() > 1; //If not a double click, allow single click in the spinner margin if (!doExpand) { //marginWidth will definitely be initialized, you can't //click something that isn't on the screen doExpand = me.getPoint().x <= PropUtils.getMarginWidth(); } } if (doExpand) { toggleExpanded(row); } }
/** Toggle the expanded state of a property set if either the event * was a double click in the title area, a single click in the spinner * area, or a keyboard event. */ private void maybeToggleExpanded (int row, EventObject e) { boolean doExpand = true; //If it's a mouse event, we need to check if it's a double click. if (e instanceof MouseEvent) { MouseEvent me = (MouseEvent) e; doExpand = me.getClickCount() > 1; //If not a double click, allow single click in the spinner margin if (!doExpand) { //marginWidth will definitely be initialized, you can't //click something that isn't on the screen doExpand = me.getPoint().x <= PropUtils.getMarginWidth(); } } if (doExpand) { toggleExpanded (row); } }
/** Toggle the expanded state of a property set if either the event * was a double click in the title area, a single click in the spinner * area, or a keyboard event. */ private void maybeToggleExpanded (int row, EventObject e) { boolean doExpand = true; //If it's a mouse event, we need to check if it's a double click. if (e instanceof MouseEvent) { MouseEvent me = (MouseEvent) e; doExpand = me.getClickCount() > 1; //If not a double click, allow single click in the spinner margin if (!doExpand) { //marginWidth will definitely be initialized, you can't //click something that isn't on the screen doExpand = me.getPoint().x <= PropUtils.getMarginWidth(); } } if (doExpand) { toggleExpanded (row); } }