public void mouseClicked (MouseEvent evt) { if (evt.getClickCount() == 2 && addEffectButton.isEnabled()) addEffectButton.doClick(); } });
public void mouseClicked (MouseEvent evt) { if (evt.getClickCount() == 2 && addEffectButton.isEnabled()) addEffectButton.doClick(); } });
private void addToHistoryList(String pattern, int numTreesMatched, int numMatches) { if(!historyButton.isEnabled()) { historyButton.setEnabled(true); TregexGUI.getInstance().setSaveHistoryEnabled(true); } historyList.add(new HistoryEntry(pattern, numTreesMatched, numMatches)); }
/** * Finds the sentence delimited by the closest sentence delimiter preceding * start and closest period following end. If end is less than start * (or -1), sets right boundary as closest period following start. * Actually starts search for preceding sentence delimiter at (start-1) */ private void highlightSentence(int start, int end) { // clears highlight. paints over entire document because the document may have changed highlightText(0, textPane.getText().length(), normalStyle); // if start<1 set startIndex to 0, otherwise set to index following closest preceding period startIndex = (start < 1) ? 0 : nearestDelimiter(textPane.getText(), start, SEEK_BACK) + 1; // if end<startIndex, set endIndex to closest period following startIndex // else, set it to closest period following end endIndex = nearestDelimiter(textPane.getText(), (end < startIndex) ? startIndex : end, SEEK_FORWARD); if (endIndex == -1) { endIndex = textPane.getText().length() - 1; } highlightText(startIndex, endIndex, highlightStyle); // enable/disable scroll buttons as necessary backButton.setEnabled(startIndex != 0); forwardButton.setEnabled(endIndex != textPane.getText().length() - 1); parseNextButton.setEnabled(forwardButton.isEnabled() && parser != null); }
public Boolean isNextEnabled() { return nextButton == null ? null : nextButton.isEnabled(); }
final boolean isNextEnabled() { return nextButton.isEnabled(); }
/** * Enables the button, so that the user can clear/delete emails. * <p> * This method will be called by a {@link MailSaver} object when an email will be received. * </p> */ @Override public void update(Observable o, Object arg) { if (o instanceof MailSaver && !button.isEnabled()) { button.setEnabled(true); } } }
public boolean isKeyboardMovementEnabled() { return keyboardMovementEnabled.isSelected() && xPlusButton.isEnabled(); }
/** * Cancels the wizard - if Cancel button is enabled. * Always call this method from EDT thread. * @since 7.19 */ public final void doCancelClick() { assert SwingUtilities.isEventDispatchThread(); if (cancelButton.isEnabled()) { cancelButton.doClick(); } }
public void setFinishEnabled(Boolean isEnabled) { Boolean oldValue = finishButton.isEnabled(); if (!isEnabled.equals(oldValue)) { firePropertyChange("isFinishEnabled", oldValue, isEnabled); finishButton.setEnabled(isEnabled); } }
public void setCancelEnabled(Boolean isEnabled) { Boolean oldValue = cancelButton.isEnabled(); if (!isEnabled.equals(oldValue)) { firePropertyChange("isCancelEnabled", oldValue, isEnabled); cancelButton.setEnabled(isEnabled); } }
/** * Moves the wizard to its previous panel - if Previous button is enabled. * Always call this method from EDT thread. * @since 7.19 */ public final void doPreviousClick() { assert SwingUtilities.isEventDispatchThread(); if (previousButton.isEnabled()) { previousButton.doClick(); } }
/** * Finishes the wizard - if Finish button is enabled. * Always call this method from EDT thread. * @since 7.19 */ public final void doFinishClick() { assert SwingUtilities.isEventDispatchThread(); if (finishButton.isEnabled()) { finishButton.doClick(); } }
public void setNextEnabled(Boolean isEnabled) { Boolean oldValue = nextButton.isEnabled(); if (!isEnabled.equals(oldValue)) { firePropertyChange("isNextEnabled", oldValue, isEnabled); nextButton.setEnabled(isEnabled); } }
public void setBackEnabled(Boolean isEnabled) { Boolean oldValue = backButton.isEnabled(); if (!isEnabled.equals(oldValue)) { firePropertyChange("isBackEnabled", oldValue, isEnabled); backButton.setEnabled(isEnabled); } }
@Override public void mouseExited(MouseEvent e) { if (this.buttonFlat.isEnabled() && !this.isVisible) { this.buttonFlat.setContentAreaFilled(false); this.buttonFlat.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8)); } }
/** * Moves the wizard to its next panel - if Next button is enabled. * Always call this method from EDT thread. * @since 7.19 */ public final void doNextClick() { assert SwingUtilities.isEventDispatchThread(); if (nextButton.isEnabled()) { nextButton.doClick(); } }
@Override public void mouseEntered(MouseEvent e) { if (this.buttonFlat.isEnabled() && !this.isVisible) { this.buttonFlat.setContentAreaFilled(true); this.buttonFlat.setBorder(HelperUi.BORDER_ROUND_BLU); } }
public void doClick(MageComponents name, int waitBeforeClick) throws InterruptedException { final JButton j = getButton(name); TimeUnit.MILLISECONDS.sleep(waitBeforeClick); while (!j.isEnabled()) { TimeUnit.MILLISECONDS.sleep(10); } Thread t = new Thread(() -> j.doClick()); t.start(); } }