/** Updates the icon displayed by this label. */ public Label setIcon (Icon icon) { this.icon.update(icon); return this; }
/** * Updates the reactive size value. The underlying collection need only call this method if it * changes the size of its collection <em>without</em> also calling {@link #notify}. */ protected void updateSize () { if (_sizeView != null) _sizeView.update(size()); }
@Override public void onHover (Mouse.HoverEvent event, Mouse.Interaction iact) { if (_active) _selector.selected.update(event.inside ? getHover(event) : null); } };
/** Updates the text displayed by this button. */ public T setText (String text) { this.text.update(text); return asT(); }
protected Menu addIcons (Menu menu) { int tile = 0; for (Element<?> item : menu) { if (item instanceof MenuItem) { ((MenuItem)item).icon.update(tile(tile++)); } } return menu; }
/** Creates a selector containing the children of elements with initialSelection selected. */ public Selector (Elements<?> elements, Element<?> initialSelection) { this(); add(elements); if (initialSelection instanceof Togglable<?>) { selected.update(initialSelection); } }
/** Updates the icon displayed by this button. */ public T setIcon (Icon icon) { this.icon.update(icon); return asT(); }
@Override public void onPress (Pointer.Interaction iact) { _anchorState = _owner.isSelected(); selected.update(!_anchorState); } @Override public void onHover (Pointer.Interaction iact, boolean inBounds) {
void update (Slider pos, float val, Scroller.Range range) { if (range.max() > 0) pos.value.update(val / range.max()); } });
public boolean merge (String name, String data) { T svalue = codec.decode(data, defval); T nvalue = resolver.resolve(value.get(), svalue); value.update(nvalue); return nvalue.equals(svalue); } public void update (String name, String data) {
@Override public void onEmit (Pointer.Event e) { Point pt = LayerUtil.screenToLayer(content.layer, e.x(), e.y()); click.text.update(pt.x + ", " + pt.y); } });
@Override public void close () { if (movie() != null) movie().layer().close(); _loopingMovie = null; _oneshotMovie = null; movie.update(null); }
@Override public void onEmit () { point.update(new BoxPoint( nx.value.get(), ny.value.get(), ox.value.get(), oy.value.get())); } };
@Override public Root setSize (float width, float height) { super.setSize(width, height); // update the image to the new size, if it's changed Texture old = _texture.get(); if (old == null || old.displayWidth != width || old.displayHeight != height) { _texture.update(iface.plat.graphics().createTexture(width, height, textureConfig())); } return this; }
/** Replace the currently active movie. */ protected Movie setCurrent (Movie current) { if (movie() != null) { _root.remove(movie().layer()); } _root.add(current.layer()); movie.update(current); return current; }
@Override public void onEmit (Button event) { Style.HAlign[] values = Style.HAlign.values(); Style.HAlign next = values[ (Style.HAlign.valueOf(halign.text.get()).ordinal() + 1) % values.length]; halign.text.update(next.name()); col = new ExposedColumn(next, col.isStretch(), col.weight(), col.minWidth()); } });
void boundsChanged(CGRect bounds) { viewportChanged(scale().scaledCeil((float)bounds.getWidth()), scale().scaledCeil((float)bounds.getHeight())); orientDetailM.update(toOrientationDetail(UIDevice.getCurrentDevice().getOrientation())); }
@Override public void onEmit (Button source) { Behavior[] behs = Behavior.values(); Behavior beh = Behavior.valueOf(source.text.get()); beh = behs[(beh.ordinal() + 1) % behs.length]; scroll.setBehavior(beh); source.text.update(beh.name()); xpos.setVisible(beh.hasHorizontal()); ypos.setVisible(beh.hasVertical()); updateSize.onEmit(); } });