private void repaintDragRepresentation() { DragSource dragSource = dragDescendant.getDragSource(); Visual dragRepresentation = dragSource.getRepresentation(); if (dragRepresentation != null) { Point dragOffset = dragSource.getOffset(); repaint(dragLocation.x - dragOffset.x, dragLocation.y - dragOffset.y, dragRepresentation.getWidth(), dragRepresentation.getHeight()); } }
@Override public void itemInserted(List<Object> list, int index) { // Increment selected ranges int updated = rangeSelection.insertIndex(index); // Notify listeners that items were inserted tableViewRowListeners.rowInserted(TableView.this, index); if (updated > 0) { tableViewSelectionListeners.selectedRangesChanged(TableView.this, getSelectedRanges()); } }
@Override public void listCleared(List<Object> list) { int cleared = rangeSelection.getLength(); rangeSelection.clear(); tableViewRowListeners.rowsCleared(TableView.this); if (cleared > 0) { tableViewSelectionListeners.selectedRangesChanged(TableView.this, getSelectedRanges()); if (selectMode == SelectMode.SINGLE) { tableViewSelectionListeners.selectedRowChanged(TableView.this, null); } } }
public LinkButtonDataRenderer() { getStyles().put("horizontalSpacing", 4); getColumns().add(new TablePane.Column()); getColumns().add(new TablePane.Column(1, true)); TablePane.Row row = new TablePane.Row(); row.add(imageView); row.add(label); getRows().add(row); label.getStyles().put("wrapText", true); }
@Override public void listCleared(List<Object> list) { int previousSelectedIndex = selectedIndex; selectedIndex = -1; listButtonItemListeners.itemsCleared(ListButton.this); if (previousSelectedIndex != selectedIndex) { listButtonSelectionListeners.selectedIndexChanged(ListButton.this, selectedIndex); listButtonSelectionListeners.selectedItemChanged(ListButton.this, getSelectedItem()); } }
@Override protected void descendantRemoved(Component descendant) { super.descendantRemoved(descendant); String automationID = descendant.getAutomationID(); if (automationID != null) { Automation.remove(automationID); } }
protected boolean mouseDown(Mouse.Button button, int xArgument, int yArgument) { boolean consumed = false; if (isEnabled()) { if (triggerTooltipCallback != null) { triggerTooltipCallback.cancel(); triggerTooltipCallback = null; } consumed = componentMouseButtonListeners.mouseDown(this, button, xArgument, yArgument); } return consumed; }
protected boolean keyPressed(int keyCode, Keyboard.KeyLocation keyLocation) { boolean consumed = false; if (isEnabled()) { consumed = componentKeyListeners.keyPressed(this, keyCode, keyLocation); if (!consumed && parent != null) { consumed = parent.keyPressed(keyCode, keyLocation); } } return consumed; }
public static void setFlag(Component component, Flag flag) { Flag previousFlag = (Flag)component.setAttribute(Attribute.FLAG, flag); if (previousFlag != flag) { Container parent = component.getParent(); if (parent instanceof Form) { Form form = (Form)parent; form.formAttributeListeners.flagChanged(form, component, previousFlag); } } }
public static void setTooltipText(Component component, String tooltipText) { String previousTooltipText = (String)component.setAttribute(Attribute.TOOLTIP_TEXT, tooltipText); if (previousTooltipText != tooltipText) { Container parent = component.getParent(); if (parent instanceof Accordion) { Accordion accordion = (Accordion)parent; accordion.accordionAttributeListeners.tooltipTextChanged(accordion, component, previousTooltipText); } } } }
@Override public void run() { Point mouseLocationLocal = getMouseLocation(); if (mouseLocationLocal != null) { componentTooltipListeners.tooltipTriggered(Component.this, mouseLocationLocal.x, mouseLocationLocal.y); } } }, tooltipDelay);
protected boolean mouseWheel(Mouse.ScrollType scrollType, int scrollAmount, int wheelRotation, int xArgument, int yArgument) { boolean consumed = false; if (isEnabled()) { consumed = componentMouseWheelListeners.mouseWheel(this, scrollType, scrollAmount, wheelRotation, xArgument, yArgument); } return consumed; }
@Override public void disabledDateFilterChanged(CalendarButton calendarButton, Filter<CalendarDate> previousDisabledDateFilter) { calendar.setDisabledDateFilter(calendarButton.getDisabledDateFilter()); }
/** * "Presses" the button. Performs any action associated with the button. */ public void press() { buttonPressListeners.buttonPressed(this); if (action != null) { action.perform(this); } }
/** * Returns the bounds of a given column. * * @param column * The column index. */ public Bounds getColumnBounds(int column) { TablePane.Skin tablePaneSkin = (TablePane.Skin)getSkin(); return tablePaneSkin.getColumnBounds(column); }
@Override public void listCleared(List<Object> list) { int cleared = rangeSelection.getLength(); rangeSelection.clear(); tableViewRowListeners.rowsCleared(TableView.this); if (cleared > 0) { tableViewSelectionListeners.selectedRangesChanged(TableView.this, getSelectedRanges()); if (selectMode == SelectMode.SINGLE) { tableViewSelectionListeners.selectedRowChanged(TableView.this, null); } } }
@Override public void itemInserted(List<Object> list, int index) { // Increment selected ranges int updated = rangeSelection.insertIndex(index); // Notify listeners that items were inserted tableViewRowListeners.rowInserted(TableView.this, index); if (updated > 0) { tableViewSelectionListeners.selectedRangesChanged(TableView.this, getSelectedRanges()); } }
@Override protected void descendantRemoved(Component descendant) { super.descendantRemoved(descendant); String automationID = descendant.getAutomationID(); if (automationID != null) { Automation.remove(automationID); } }
protected boolean mouseDown(Mouse.Button button, int x, int y) { boolean consumed = false; if (isEnabled()) { if (triggerTooltipCallback != null) { triggerTooltipCallback.cancel(); triggerTooltipCallback = null; } consumed = componentMouseButtonListeners.mouseDown(this, button, x, y); } return consumed; }