/** * Gets connectee value. * * @return the connectee value */ protected final Object getConnecteeValue() { if (getConnectedJComponent() != null) { return protectedGetConnecteeValue(); } else { return value; } }
/** * Implementation of connectee state modifications which normally would have * been coded in the <code>updateState</code> method should go here to * preserve the connector modification to be handled in the event dispatch * thread. */ protected void protectedUpdateState() { if (isReadable()) { if (savedForeground != null) { getConnectedJComponent().setForeground(savedForeground); } savedForeground = null; } else if (savedForeground == null) { savedForeground = getConnectedJComponent().getForeground(); getConnectedJComponent().setForeground( getConnectedJComponent().getBackground()); } }
/** * Implementation of connectee readability state modifications which normally * would have been coded in the {@code readabilityChange} method should * go here to preserve the connector modification to be handled in the event * dispatch thread. */ protected void protectedReadabilityChange() { if (isReadable()) { if (savedForeground != null) { getConnectedJComponent().setForeground(savedForeground); } savedForeground = null; } else if (savedForeground == null) { savedForeground = getConnectedJComponent().getForeground(); getConnectedJComponent().setForeground(getConnectedJComponent().getBackground()); } }
/** * This implementation takes care of having the peer component modifications * ran on the Swing event dispatch thread. It actually delegates the connectee * modification to the {@code protectedSetConnecteeValue} method. * <p> * {@inheritDoc} * * @param aValue * the a value * @see #protectedSetConnecteeValue(Object) #protectedSetConnecteeValue(Object) */ @Override protected final void setConnecteeValue(final Object aValue) { if (getConnectedJComponent() != null) { SwingUtil.updateSwingGui(new Runnable() { @Override public void run() { protectedSetConnecteeValue(aValue); } }); } else { value = aValue; } }
/** * This implementation takes care of having the peer component modifications * ran on the Swing event dispatch thread. It actually delegates the connectee * modification to the {@code protectedReadabilityChange} method. * * @see #protectedReadabilityChange() #protectedReadabilityChange() */ @Override public final void readabilityChange() { super.readabilityChange(); if (getConnectedJComponent() != null) { SwingUtil.updateSwingGui(new Runnable() { /** * {@inheritDoc} */ @Override public void run() { protectedReadabilityChange(); } }); } }
/** * This implementation takes care of having the peer component modifications * ran on the Swing event dispatch thread. It actually delegates the connectee * modification to the {@code protectedWritabilityChange} method. * * @see #protectedWritabilityChange() #protectedWritabilityChange() */ @Override public final void writabilityChange() { super.writabilityChange(); if (getConnectedJComponent() != null) { SwingUtil.updateSwingGui(new Runnable() { /** * {@inheritDoc} */ @Override public void run() { protectedWritabilityChange(); } }); } }