@Override public int getTabCount() { return contentPanel != null ? contentPanel.getChildren().size() : 0; }
/** * Removes all existing messages from the queue */ private void removeAllMessages() { if (systemMessagesQueue != null && systemMessagesQueue.getChildrenCount() > 0) { systemMessagesQueue.getChildren().forEach((child)->{ child.markForRemoval(); }); } }
@Override public int getTabCount() { return contentPanel != null ? contentPanel.getChildren().size() : 0; }
@Override public int getTabCount() { return contentPanel != null ? contentPanel.getChildren().size() : 0; }
/** * Deletes all children from element * * @param element parent */ private void removeAllChildElements(Element element) { for (Element e : element.getChildren()) { e.markForRemoval(); } }
@Nullable @Override public Tab getSelectedTab() { if (selectedIndex == -1 || contentPanel == null) { return null; } return contentPanel.getChildren().get(selectedIndex).getNiftyControl(Tab.class); }
public void removeAll() { for (Element child : content.getChildren()) { child.markForRemoval(); } stepSize = 0; }
private void cleanButtonPanel() { this.buttonPanel.getChildren().forEach((child)->{ child.markForRemoval(); }); } }
@Nullable @Override public Tab getSelectedTab() { if (selectedIndex == -1 || contentPanel == null) { return null; } return contentPanel.getChildren().get(selectedIndex).getNiftyControl(Tab.class); }
private int getRenderOrder(@Nonnull final Element element) { if (element.renderOrder != 0) { return element.renderOrder; } return element.getParent().getChildren().indexOf(element); } }
@Override public Tab getSelectedTab() { if (selectedIndex == -1 || contentPanel == null) { return null; } return contentPanel.getChildren().get(selectedIndex).getNiftyControl(Tab.class); }
/** * Get the tab control at a specified index. * * @param index the index of the tab control * @return the tab control */ @Override public Tab getTabAtIndex(final int index) { if (contentPanel == null) { return null; } return contentPanel.getChildren().get(index).getNiftyControl(Tab.class); }
/** * Get the tab control at a specified index. * * @param index the index of the tab control * @return the tab control */ @Nullable public Tab getTabAtIndex(final int index) { if (contentPanel == null) { return null; } return contentPanel.getChildren().get(index).getNiftyControl(Tab.class); }
@Nonnull public Element createElementFromType( @Nonnull final Screen screen, @Nonnull final Element parent, final ElementType type) { if (type instanceof LayerType) { return createElementFromTypeInternal(screen, parent, type, getRootLayerFactory().createRootLayerLayoutPart (this), parent.getChildren().size()); } return createElementFromTypeInternal(screen, parent, type, new LayoutPart(), parent.getChildren().size()); }
@Override public void update(float tpf) { if (systemMessagesQueue != null) { for(Element child : systemMessagesQueue.getChildren()) { SystemMessageControl control = child.getControl(SystemMessageControl.class); if (control != null && System.currentTimeMillis() - control.getCreatedAt() > lifeTime) { child.markForRemoval(); } } } }
@Override public void onStartScreen() { for (Element tab : element.findElementById("#tab-creature-card").getChildren()) { String id = tab.getId(); if (id != null && id.endsWith("#tab-" + state.toString().toLowerCase())) { tab.show(); } else { tab.hide(); } } }
private void clearButtons() { List<Element> buttons = messageboxPopup.findElementById("#messagebox").findElementById("#buttons").getChildren(); for (Element button : buttons) { button.markForRemoval(); } }
private void clearButtons() { List<Element> buttons = messageboxPopup.findElementById("#messagebox").findElementById("#buttons").getChildren(); for (Element button : buttons) { button.markForRemoval(); } }
/** * Used to sync the effect on active messages. * Otherwise all messages pulsate differently, which looks odd. */ public void syncActiveEffects() { for(Element child : element.getParent().getChildren()) { SystemMessageControl control = child.getControl(SystemMessageControl.class); if (control != null && control.unread) { child.startEffect(EffectEventId.onActive); } } }
private boolean isCursorOnGUI() { int height = app.getContext().getSettings().getHeight(); if (view.isVisible() && view.isMouseInsideElement((int) mousePosition.x, height - (int) mousePosition.y)) { for (Element e : view.getChildren()) { if (e.isVisible() && e.isMouseInsideElement((int) mousePosition.x, height - (int) mousePosition.y)) { return true; } } return false; } return true; }