public RosCameraBenchmarker(String topicName) { new RepeatingReleasedEventsFixer().install(); this.topicName = topicName; }
public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { assert assertEDT(); // ?: Are we already cancelled? // (Judging by Timer and TimerQueue code, we can theoretically be raced to be posted onto EDT by TimerQueue, // due to some lag, unfair scheduling) if (_timer == null) { // -> Yes, so don't post the new RELEASED event. return; } // Stop Timer and clean. cancel(); // Creating new KeyEvent (we've consumed the original). KeyEvent newEvent = new RepostedKeyEvent((Component) _originalKeyEvent.getSource(), _originalKeyEvent.getID(), _originalKeyEvent.getWhen(), _originalKeyEvent.getModifiers(), _originalKeyEvent.getKeyCode(), _originalKeyEvent.getKeyChar(), _originalKeyEvent.getKeyLocation()); // Posting to EventQueue. Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(newEvent); // System.out.println("Posted synthetic RELEASED [" + newEvent + "]."); } }
assert assertEDT(); // REMEMBER THAT THIS IS SINGLE THREADED, so no need for synch. ReleasedAction action = new ReleasedAction(keyEvent, timer); timer.addActionListener(action); timer.start(); action.cancel();
public RosCameraBenchmarker(String topicName) { new RepeatingReleasedEventsFixer().install(); this.topicName = topicName; }
public void eventDispatched(AWTEvent event) assert assertEDT(); // REMEMBER THAT THIS IS SINGLE THREADED, so no need for synch. ReleasedAction action = new ReleasedAction(keyEvent, timer); timer.addActionListener(action); timer.start(); action.cancel();
@Override public void actionPerformed(ActionEvent e) { assert assertEDT(); // ?: Are we already cancelled? // (Judging by Timer and TimerQueue code, we can theoretically be raced to be posted onto EDT by TimerQueue, // due to some lag, unfair scheduling) if (_timer == null) { // -> Yes, so don't post the new RELEASED event. return; } // Stop Timer and clean. cancel(); // Creating new KeyEvent (we've consumed the original). KeyEvent newEvent = new RepostedKeyEvent((Component) _originalKeyEvent.getSource(), _originalKeyEvent.getID(), _originalKeyEvent.getWhen(), _originalKeyEvent.getModifiers(), _originalKeyEvent.getKeyCode(), _originalKeyEvent.getKeyChar(), _originalKeyEvent.getKeyLocation()); // Posting to EventQueue. Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(newEvent); // System.out.println("Posted synthetic RELEASED [" + newEvent + "]."); } }
public RosCameraBenchmarker(String topicName) { new RepeatingReleasedEventsFixer().install(); this.topicName = topicName; }
public RosJavaGrabImagesBase() { new RepeatingReleasedEventsFixer().install(); colorSpace = (COLOR_IMAGE ? ColorSpace.getInstance(ColorSpace.CS_sRGB) : ColorSpace.getInstance(ColorSpace.CS_GRAY)); colorModel = new ComponentColorModel(colorSpace, false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE); }
public GazeboDrivingBase() { new RepeatingReleasedEventsFixer().install(); colorSpace = (COLOR_IMAGE ? ColorSpace.getInstance(ColorSpace.CS_sRGB) : ColorSpace.getInstance(ColorSpace.CS_GRAY)); colorModel = new ComponentColorModel(colorSpace, false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE); }
public ExternalCameraFeed(String cameraName, String topicName, boolean showRecordingButtons) { new RepeatingReleasedEventsFixer().install(); this.cameraName = cameraName; this.topicName = topicName; colorSpace = (COLOR_IMAGE ? ColorSpace.getInstance(ColorSpace.CS_sRGB) : ColorSpace.getInstance(ColorSpace.CS_GRAY)); colorModel = new ComponentColorModel(colorSpace, false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE); this.showRecordingButtons = showRecordingButtons; }