/** * Gets the default maximum of the "Example" widgets. */ @Override int getDefaultMaximum () { return scale1.getMaximum(); }
/** {@inheritDoc} */ @Override public int getMaximum() { return scale.getMaximum(); }
/** {@inheritDoc} */ public int getMaximum() { return scale.getMaximum(); }
/** {@inheritDoc} */ public int getMaximum() { return scale.getMaximum(); }
@Override int doGetIntValue(Object source) { return ((Scale) source).getMaximum(); }
private void writeMaximum( final Scale scale ) throws IOException { Integer newValue = new Integer( scale.getMaximum() ); String prop = PROP_MAXIMUM; Integer defValue = DEFAULT_MAXIMUM; if( WidgetLCAUtil.hasChanged( scale, prop, newValue, defValue ) ) { JSWriter writer = JSWriter.getWriterFor( scale ); writer.set( prop, newValue ); } }
public void preserveValues( final Widget widget ) { Scale scale = ( Scale )widget; ControlLCAUtil.preserveValues( scale ); IWidgetAdapter adapter = WidgetUtil.getAdapter( scale ); boolean hasListeners = SelectionEvent.hasListener( scale ); adapter.preserve( Props.SELECTION_LISTENERS, Boolean.valueOf( hasListeners ) ); adapter.preserve( PROP_SELECTION, new Integer( scale.getSelection() ) ); adapter.preserve( PROP_MAXIMUM, new Integer( scale.getMaximum() ) ); adapter.preserve( PROP_MINIMUM, new Integer( scale.getMinimum() ) ); adapter.preserve( PROP_PAGE_INCREMENT, new Integer( scale.getPageIncrement() ) ); adapter.preserve( PROP_INCREMENT, new Integer( scale.getIncrement() ) ); WidgetLCAUtil.preserveCustomVariant( scale ); }
/** * Sets the minimum value that the receiver will allow. This new * value will be ignored if it is negative or is not less than the receiver's * current maximum value. If the new minimum is applied then the receiver's * selection value will be adjusted if necessary to fall within its new range. * * @param value the new minimum, which must be nonnegative and less than the current maximum * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void setMinimum (int value) { checkWidget (); if (value < 0) return; int maximum = getMaximum (); if (value >= maximum) return; OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); OS.gtk_range_set_range (handle, value, maximum); OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); }
/** * Sets the minimum value that the receiver will allow. This new * value will be ignored if it is negative or is not less than the receiver's * current maximum value. If the new minimum is applied then the receiver's * selection value will be adjusted if necessary to fall within its new range. * * @param value the new minimum, which must be nonnegative and less than the current maximum * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void setMinimum (int value) { checkWidget (); if (value < 0) return; int maximum = getMaximum (); if (value >= maximum) return; OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); OS.gtk_range_set_range (handle, value, maximum); OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); }
/** * Sets the minimum value that the receiver will allow. This new * value will be ignored if it is negative or is not less than the receiver's * current maximum value. If the new minimum is applied then the receiver's * selection value will be adjusted if necessary to fall within its new range. * * @param value the new minimum, which must be nonnegative and less than the current maximum * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void setMinimum (int value) { checkWidget (); if (value < 0) return; int maximum = getMaximum (); if (value >= maximum) return; OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); OS.gtk_range_set_range (handle, value, maximum); OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); }
@Override public void preserveValues( Scale scale ) { preserveProperty( scale, PROP_MINIMUM, scale.getMinimum() ); preserveProperty( scale, PROP_MAXIMUM, scale.getMaximum() ); preserveProperty( scale, PROP_SELECTION, scale.getSelection() ); preserveProperty( scale, PROP_INCREMENT, scale.getIncrement() ); preserveProperty( scale, PROP_PAGE_INCREMENT, scale.getPageIncrement() ); }
@Override public void renderChanges( Scale scale ) throws IOException { ControlLCAUtil.renderChanges( scale ); WidgetLCAUtil.renderCustomVariant( scale ); renderProperty( scale, PROP_MINIMUM, scale.getMinimum(), DEFAULT_MINIMUM ); renderProperty( scale, PROP_MAXIMUM, scale.getMaximum(), DEFAULT_MAXIMUM ); renderProperty( scale, PROP_SELECTION, scale.getSelection(), DEFAULT_SELECTION ); renderProperty( scale, PROP_INCREMENT, scale.getIncrement(), DEFAULT_INCREMENT ); renderProperty( scale, PROP_PAGE_INCREMENT, scale.getPageIncrement(), DEFAULT_PAGE_INCREMENT ); renderListenSelection( scale ); renderClientListeners( scale ); }