/** * Overridden so we can tell when the text area is resized and update the * current-line highlight, if necessary (i.e., if it is enabled and if * lineWrap is enabled. * * @param e The component event about to be sent to all registered * <code>ComponentListener</code>s. */ @Override protected void processComponentEvent(ComponentEvent e) { // In line wrap mode, resizing the text area means that the caret's // "line" could change - not to a different logical line, but a // different physical one. So, here we force a repaint of the current // line's highlight if necessary. if (e.getID()==ComponentEvent.COMPONENT_RESIZED && getLineWrap() && getHighlightCurrentLine()) { previousCaretY = -1; // So we are sure to repaint. fireCaretUpdate(mouseListener); } super.processComponentEvent(e); }
calendarTable.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent evt) { if (evt.getID() == ComponentEvent.COMPONENT_RESIZED) { calendarTable.setRowHeight(calendarTable.getHeight() / calendarTable.getRowCount()); } } });
@Override public Boolean call(ComponentEvent event) { return event.getID() == id; } }
public static final com.jogamp.newt.event.WindowEvent createWindowEvent(final java.awt.event.ComponentEvent event, final NativeSurfaceHolder sourceHolder) { final short newtType = eventTypeAWT2NEWT(event.getID()); if( (short)0 != newtType ) { return new com.jogamp.newt.event.WindowEvent(newtType, sourceHolder, System.currentTimeMillis()); } return null; // no mapping .. }
@Override protected void processComponentEvent(ComponentEvent e) { switch (e.getID()) { case ComponentEvent.COMPONENT_RESIZED: onResize(); update(); break; } } }
/** * Reset state information when the dialog is shown. * * @param event Component event. */ @Override protected void processComponentEvent( final ComponentEvent event ) { super.processComponentEvent( event ); if ( event.getID() == ComponentEvent.COMPONENT_SHOWN ) { reset(); } }
/** * Called when the parent dialog/frame fires a component event. This * method is here so we can hide the drop-down file list when the parent * frame is moved or resized. * * @param e The component event fired by the parent dialog/frame. */ private void processParentComponentEvent(ComponentEvent e) { switch (e.getID()) { case ComponentEvent.COMPONENT_HIDDEN: case ComponentEvent.COMPONENT_MOVED: case ComponentEvent.COMPONENT_RESIZED: updatePopupWindowDimensions(); if (popupWindow!=null) { setPopupVisible(false); } break; case ComponentEvent.COMPONENT_SHOWN: } }
@Override protected void processComponentEvent(ComponentEvent event) { super.processComponentEvent(event); switch (event.getID()) { case ComponentEvent.COMPONENT_RESIZED: { if (scale == 1) { display.setSize(Math.max(getWidth(), 0), Math.max(getHeight(), 0)); } else { display.setSize(Math.max((int)Math.ceil(getWidth() / scale), 0), Math.max((int)Math.ceil(getHeight() / scale), 0)); } break; } } }
@Override protected void processComponentEvent(ComponentEvent event) { super.processComponentEvent(event); switch (event.getID()) { case ComponentEvent.COMPONENT_RESIZED: { if (scale == 1) { display.setSize(Math.max(getWidth(), 0), Math.max(getHeight(), 0)); } else { display.setSize(Math.max((int)Math.ceil(getWidth() / scale), 0), Math.max((int)Math.ceil(getHeight() / scale), 0)); } break; } default: { break; } } }
if (e.getID() == ComponentEvent.COMPONENT_RESIZED) { this.init();
private void processEvent(@Nonnull ComponentEvent event) { Component component = event.getComponent(); if (component == null) { return; } int id = event.getID(); if (id == WINDOW_OPENED) { recognizeAsOpenWindow(component); return; } if (id == WINDOW_CLOSED) { recognizeAsClosedWindow(component); return; } if (id == WINDOW_CLOSING) { return; } if ((id >= WINDOW_FIRST && id <= WINDOW_LAST) || id == COMPONENT_SHOWN) { if ((!context.rootWindows().contains(component)) || windows.isClosed(component)) { recognizeAsOpenWindow(component); } } }
/** * Overridden so we can tell when the text area is resized and update the * current-line highlight, if necessary (i.e., if it is enabled and if * lineWrap is enabled. * * @param e The component event about to be sent to all registered * <code>ComponentListener</code>s. */ @Override protected void processComponentEvent(ComponentEvent e) { // In line wrap mode, resizing the text area means that the caret's // "line" could change - not to a different logical line, but a // different physical one. So, here we force a repaint of the current // line's highlight if necessary. if (e.getID()==ComponentEvent.COMPONENT_RESIZED && getLineWrap() && getHighlightCurrentLine()) { previousCaretY = -1; // So we are sure to repaint. fireCaretUpdate(mouseListener); } super.processComponentEvent(e); }
if (e.getID() == ComponentEvent.COMPONENT_RESIZED) { this.init();
if (e.getID() == ComponentEvent.COMPONENT_RESIZED) { this.init();
/** * Overridden so we can tell when the text area is resized and update the * current-line highlight, if necessary (i.e., if it is enabled and if * lineWrap is enabled. * * @param e The component event about to be sent to all registered * <code>ComponentListener</code>s. */ protected void processComponentEvent(ComponentEvent e) { // In line wrap mode, resizing the text area means that the caret's // "line" could change - not to a different logical line, but a // different physical one. So, here we force a repaint of the current // line's highlight if necessary. if (e.getID()==ComponentEvent.COMPONENT_RESIZED && getLineWrap()==true && getHighlightCurrentLine()) { previousCaretY = -1; // So we are sure to repaint. fireCaretUpdate(mouseListener); } super.processComponentEvent(e); }
/** * Overridden so we can tell when the text area is resized and update the * current-line highlight, if necessary (i.e., if it is enabled and if * lineWrap is enabled. * * @param e The component event about to be sent to all registered * <code>ComponentListener</code>s. */ protected void processComponentEvent(ComponentEvent e) { // In line wrap mode, resizing the text area means that the caret's // "line" could change - not to a different logical line, but a // different physical one. So, here we force a repaint of the current // line's highlight if necessary. if (e.getID()==ComponentEvent.COMPONENT_RESIZED && getLineWrap()==true && getHighlightCurrentLine()) { previousCaretY = -1; // So we are sure to repaint. fireCaretUpdate(mouseListener); } super.processComponentEvent(e); }
if (e.getID() == ComponentEvent.COMPONENT_RESIZED) { this.init();
/** * This method will process component event. By default, if popup's ancestor is hidden, we will hide the popup as * well if the popup is transient (isTransient returns true). If popup's ancestor is moved, we will either move or * hide the popup depending on {@link #getDefaultMoveOperation()} value. * * @param e the ComponentEvent. */ protected void handleComponentEvent(ComponentEvent e) { Component owner = getActualOwner(); if (!(e.getSource() instanceof Container)) { return; } Container container = (Container) e.getSource(); if (e.getID() == ComponentEvent.COMPONENT_HIDDEN && (container == owner || container.isAncestorOf(owner))) { ancestorHidden(); } else if (e.getID() == ComponentEvent.COMPONENT_MOVED && (container == owner || container.isAncestorOf(owner))) { // this line is for Linux because the JFrame moves when combobox is shown inside JidePopup // System.out.println("_actualOwnerLocation " + _actualOwnerLocation + " _actualOwner " + _actualOwner + " _actualOwner.getLocationOnScreen() " + (_actualOwner != null ? _actualOwner.getLocationOnScreen() : null)); try { if (_actualOwnerLocation == null || _actualOwner == null || !_actualOwner.getLocationOnScreen().equals(_actualOwnerLocation)) { ancestorMoved(); } } catch (Exception ex) { // ignore in case IllegalComponentStateException happens in getLocationOnScreen } } }